diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 1a3526825a41e..0000000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -github: [ncw] -patreon: njcw -liberapay: ncw -custom: ["https://rclone.org/donate/"] diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9463899d74610..123014908bebb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,6 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: "daily" +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19113318b7d36..d12696daf1987 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,9 +8,9 @@ name: build on: push: branches: - - '*' + - '**' tags: - - '*' + - '**' pull_request: workflow_dispatch: inputs: @@ -27,12 +27,12 @@ jobs: strategy: fail-fast: false matrix: - job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.18', 'go1.19'] + job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.19', 'go1.20'] include: - job_name: linux os: ubuntu-latest - go: '1.20' + go: '1.21' gotags: cmount build_flags: '-include "^linux/"' check: true @@ -43,14 +43,14 @@ jobs: - job_name: linux_386 os: ubuntu-latest - go: '1.20' + go: '1.21' goarch: 386 gotags: cmount quicktest: true - job_name: mac_amd64 os: macos-11 - go: '1.20' + go: '1.21' gotags: 'cmount' build_flags: '-include "^darwin/amd64" -cgo' quicktest: true @@ -59,14 +59,14 @@ jobs: - job_name: mac_arm64 os: macos-11 - go: '1.20' + go: '1.21' gotags: 'cmount' build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib' deploy: true - job_name: windows os: windows-latest - go: '1.20' + go: '1.21' gotags: cmount cgo: '0' build_flags: '-include "^windows/"' @@ -76,20 +76,20 @@ jobs: - job_name: other_os os: ubuntu-latest - go: '1.20' + go: '1.21' build_flags: '-exclude "^(windows/|darwin/|linux/)"' compile_all: true deploy: true - - job_name: go1.18 + - job_name: go1.19 os: ubuntu-latest - go: '1.18' + go: '1.19' quicktest: true racequicktest: true - - job_name: go1.19 + - job_name: go1.20 os: ubuntu-latest - go: '1.19' + go: '1.20' quicktest: true racequicktest: true @@ -99,12 +99,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} check-latest: true @@ -130,6 +130,11 @@ jobs: - name: Install Libraries on macOS shell: bash run: | + # https://github.com/Homebrew/brew/issues/15621#issuecomment-1619266788 + # https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6319008 + unset HOMEBREW_NO_INSTALL_FROM_API + brew untap --force homebrew/core + brew untap --force homebrew/cask brew update brew install --cask macfuse if: matrix.os == 'macos-11' @@ -211,13 +216,12 @@ jobs: shell: bash run: | if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then make release_dep_linux ; fi - if [[ "${{ matrix.os }}" == "windows-latest" ]]; then make release_dep_windows ; fi make ci_beta env: RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }} # working-directory: '$(modulePath)' # Deploy binaries if enabled in config && not a PR && not a fork - if: matrix.deploy && github.head_ref == '' && github.repository == 'rclone/rclone' + if: env.RCLONE_CONFIG_PASS != '' && matrix.deploy && github.head_ref == '' && github.repository == 'rclone/rclone' lint: if: ${{ github.event.inputs.manual == 'true' || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }} @@ -227,7 +231,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Code quality test uses: golangci/golangci-lint-action@v3 @@ -237,9 +241,9 @@ jobs: # Run govulncheck on the latest go version, the one we build binaries with - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' check-latest: true - name: Install govulncheck @@ -256,15 +260,15 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Upgrade together with NDK version - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' - name: Go module cache uses: actions/cache@v3 @@ -352,4 +356,4 @@ jobs: env: RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }} # Upload artifacts if not a PR && not a fork - if: github.head_ref == '' && github.repository == 'rclone/rclone' + if: env.RCLONE_CONFIG_PASS != '' && github.head_ref == '' && github.repository == 'rclone/rclone' diff --git a/.github/workflows/build_publish_beta_docker_image.yml b/.github/workflows/build_publish_beta_docker_image.yml new file mode 100644 index 0000000000000..4c4f935c4ceae --- /dev/null +++ b/.github/workflows/build_publish_beta_docker_image.yml @@ -0,0 +1,77 @@ +name: Docker beta build + +on: + push: + branches: + - master +jobs: + build: + if: github.repository == 'rclone/rclone' + runs-on: ubuntu-latest + name: Build image job + steps: + - name: Free some space + shell: bash + run: | + df -h . + # Remove android SDK + sudo rm -rf /usr/local/lib/android || true + # Remove .net runtime + sudo rm -rf /usr/share/dotnet || true + df -h . + - name: Checkout master + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + # This is the user that triggered the Workflow. In this case, it will + # either be the user whom created the Release or manually triggered + # the workflow_dispatch. + username: ${{ github.actor }} + # `secrets.GITHUB_TOKEN` is a secret that's automatically generated by + # GitHub Actions at the start of a workflow run to identify the job. + # This is used to authenticate against GitHub Container Registry. + # See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret + # for more detailed information. + password: ${{ secrets.GITHUB_TOKEN }} + - name: Show disk usage + shell: bash + run: | + df -h . + - name: Build and publish image + uses: docker/build-push-action@v5 + with: + file: Dockerfile + context: . + push: true # push the image to ghcr + tags: | + ghcr.io/rclone/rclone:beta + rclone/rclone:beta + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 + cache-from: type=gha, scope=${{ github.workflow }} + cache-to: type=gha, mode=max, scope=${{ github.workflow }} + provenance: false + # Eventually cache will need to be cleared if builds more frequent than once a week + # https://github.com/docker/build-push-action/issues/252 + - name: Show disk usage + shell: bash + run: | + df -h . diff --git a/.github/workflows/build_publish_docker_image.yml b/.github/workflows/build_publish_docker_image.yml deleted file mode 100644 index af52509732534..0000000000000 --- a/.github/workflows/build_publish_docker_image.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Docker beta build - -on: - push: - branches: - - master - -jobs: - build: - if: github.repository == 'rclone/rclone' - runs-on: ubuntu-latest - name: Build image job - steps: - - name: Checkout master - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Build and publish image - uses: ilteoood/docker_buildx@1.1.0 - with: - tag: beta - imageName: rclone/rclone - platform: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 - publish: true - dockerHubUser: ${{ secrets.DOCKER_HUB_USER }} - dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }} diff --git a/.github/workflows/build_publish_release_docker_image.yml b/.github/workflows/build_publish_release_docker_image.yml index 6fe9213c78761..319ce1b3050c6 100644 --- a/.github/workflows/build_publish_release_docker_image.yml +++ b/.github/workflows/build_publish_release_docker_image.yml @@ -10,8 +10,17 @@ jobs: runs-on: ubuntu-latest name: Build image job steps: + - name: Free some space + shell: bash + run: | + df -h . + # Remove android SDK + sudo rm -rf /usr/local/lib/android || true + # Remove .net runtime + sudo rm -rf /usr/share/dotnet || true + df -h . - name: Checkout master - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Get actual patch version @@ -39,8 +48,17 @@ jobs: runs-on: ubuntu-latest name: Build docker plugin job steps: + - name: Free some space + shell: bash + run: | + df -h . + # Remove android SDK + sudo rm -rf /usr/local/lib/android || true + # Remove .net runtime + sudo rm -rf /usr/share/dotnet || true + df -h . - name: Checkout master - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build and publish docker plugin diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index db79b3aa34ecf..6a2264b93a015 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -5,7 +5,7 @@ on: jobs: publish: - runs-on: windows-latest # Action can only run on Windows + runs-on: ubuntu-latest steps: - uses: vedantmgoyal2009/winget-releaser@v2 with: diff --git a/.gitignore b/.gitignore index ff61403f32e3d..9627f353d8d97 100644 --- a/.gitignore +++ b/.gitignore @@ -8,10 +8,13 @@ rclone.iml .idea .history *.test -*.log *.iml fuzz-build.zip *.orig *.rej Thumbs.db __pycache__ +.DS_Store +/docs/static/img/logos/ +resource_windows_*.syso +.devcontainer diff --git a/.golangci.yml b/.golangci.yml index 9828c53dd9df4..0d61df700a51f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,15 +2,17 @@ linters: enable: - - deadcode - errcheck - goimports - revive - ineffassign - - structcheck - - varcheck - govet - unconvert + - staticcheck + - gosimple + - stylecheck + - unused + - misspell #- prealloc #- maligned disable-all: true @@ -25,6 +27,74 @@ issues: # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 + exclude-rules: + + - linters: + - staticcheck + text: 'SA1019: "github.com/rclone/rclone/cmd/serve/httplib" is deprecated' + + # don't disable the revive messages about comments on exported functions + include: + - EXC0012 + - EXC0013 + - EXC0014 + - EXC0015 + run: # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 10m + +linters-settings: + revive: + # setting rules seems to disable all the rules, so re-enable them here + rules: + - name: blank-imports + disabled: false + - name: context-as-argument + disabled: false + - name: context-keys-type + disabled: false + - name: dot-imports + disabled: false + - name: empty-block + disabled: true + - name: error-naming + disabled: false + - name: error-return + disabled: false + - name: error-strings + disabled: false + - name: errorf + disabled: false + - name: exported + disabled: false + - name: increment-decrement + disabled: true + - name: indent-error-flow + disabled: false + - name: package-comments + disabled: false + - name: range + disabled: false + - name: receiver-naming + disabled: false + - name: redefines-builtin-id + disabled: true + - name: superfluous-else + disabled: true + - name: time-naming + disabled: false + - name: unexported-return + disabled: false + - name: unreachable-code + disabled: true + - name: unused-parameter + disabled: true + - name: var-declaration + disabled: false + - name: var-naming + disabled: false + stylecheck: + # Only enable the checks performed by the staticcheck stand-alone tool, + # as documented here: https://staticcheck.io/docs/configuration/options/#checks + checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1023"] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f8ea2aface69..6e2e885ee4bf3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ -# Contributing to rclone # +# Contributing to rclone This is a short guide on how to contribute things to rclone. -## Reporting a bug ## +## Reporting a bug If you've just got a question or aren't sure if you've found a bug then please use the [rclone forum](https://forum.rclone.org/) instead @@ -12,13 +12,13 @@ When filing an issue, please include the following information if possible as well as a description of the problem. Make sure you test with the [latest beta of rclone](https://beta.rclone.org/): - * Rclone version (e.g. output from `rclone version`) - * Which OS you are using and how many bits (e.g. Windows 10, 64 bit) - * The command you were trying to run (e.g. `rclone copy /tmp remote:tmp`) - * A log of the command with the `-vv` flag (e.g. output from `rclone -vv copy /tmp remote:tmp`) - * if the log contains secrets then edit the file with a text editor first to obscure them +- Rclone version (e.g. output from `rclone version`) +- Which OS you are using and how many bits (e.g. Windows 10, 64 bit) +- The command you were trying to run (e.g. `rclone copy /tmp remote:tmp`) +- A log of the command with the `-vv` flag (e.g. output from `rclone -vv copy /tmp remote:tmp`) + - if the log contains secrets then edit the file with a text editor first to obscure them -## Submitting a new feature or bug fix ## +## Submitting a new feature or bug fix If you find a bug that you'd like to fix, or a new feature that you'd like to implement then please submit a pull request via GitHub. @@ -73,9 +73,9 @@ This is typically enough if you made a simple bug fix, otherwise please read the Make sure you - * Add [unit tests](#testing) for a new feature. - * Add [documentation](#writing-documentation) for a new feature. - * [Commit your changes](#committing-your-changes) using the [message guideline](#commit-messages). +- Add [unit tests](#testing) for a new feature. +- Add [documentation](#writing-documentation) for a new feature. +- [Commit your changes](#committing-your-changes) using the [commit message guidelines](#commit-messages). When you are done with that push your changes to GitHub: @@ -88,9 +88,9 @@ Your changes will then get reviewed and you might get asked to fix some stuff. I You may sometimes be asked to [base your changes on the latest master](#basing-your-changes-on-the-latest-master) or [squash your commits](#squashing-your-commits). -## Using Git and GitHub ## +## Using Git and GitHub -### Committing your changes ### +### Committing your changes Follow the guideline for [commit messages](#commit-messages) and then: @@ -107,7 +107,7 @@ You can modify the message or changes in the latest commit using: If you amend to commits that have been pushed to GitHub, then you will have to [replace your previously pushed commits](#replacing-your-previously-pushed-commits). -### Replacing your previously pushed commits ### +### Replacing your previously pushed commits Note that you are about to rewrite the GitHub history of your branch. It is good practice to involve your collaborators before modifying commits that have been pushed to GitHub. @@ -115,7 +115,7 @@ Your previously pushed commits are replaced by: git push --force origin my-new-feature -### Basing your changes on the latest master ### +### Basing your changes on the latest master To base your changes on the latest version of the [rclone master](https://github.com/rclone/rclone/tree/master) (upstream): @@ -149,13 +149,21 @@ If you squash commits that have been pushed to GitHub, then you will have to [re Tip: You may like to use `git rebase -i master` if you are experienced or have a more complex situation. -### GitHub Continuous Integration ### +### GitHub Continuous Integration rclone currently uses [GitHub Actions](https://github.com/rclone/rclone/actions) to build and test the project, which should be automatically available for your fork too from the `Actions` tab in your repository. -## Testing ## +## Testing -### Quick testing ### +### Code quality tests + +If you install [golangci-lint](https://github.com/golangci/golangci-lint) then you can run the same tests as get run in the CI which can be very helpful. + +You can run them with `make check` or with `golangci-lint run ./...`. + +Using these tests ensures that the rclone codebase all uses the same coding standards. These tests also check for easy mistakes to make (like forgetting to check an error return). + +### Quick testing rclone's tests are run from the go testing framework, so at the top level you can run this to run all the tests. @@ -168,7 +176,7 @@ You can also use `make`, if supported by your platform The quicktest is [automatically run by GitHub](#github-continuous-integration) when you push your branch to GitHub. -### Backend testing ### +### Backend testing rclone contains a mixture of unit tests and integration tests. Because it is difficult (and in some respects pointless) to test cloud @@ -203,7 +211,7 @@ project root: go install github.com/rclone/rclone/fstest/test_all test_all -backend drive -### Full integration testing ### +### Full integration testing If you want to run all the integration tests against all the remotes, then change into the project root and run @@ -218,55 +226,56 @@ The commands may require some extra go packages which you can install with The full integration tests are run daily on the integration test server. You can find the results at https://pub.rclone.org/integration-tests/ -## Code Organisation ## +## Code Organisation Rclone code is organised into a small number of top level directories with modules beneath. - * backend - the rclone backends for interfacing to cloud providers - - * all - import this to load all the cloud providers - * ...providers - * bin - scripts for use while building or maintaining rclone - * cmd - the rclone commands - * all - import this to load all the commands - * ...commands - * cmdtest - end-to-end tests of commands, flags, environment variables,... - * docs - the documentation and website - * content - adjust these docs only - everything else is autogenerated - * command - these are auto-generated - edit the corresponding .go file - * fs - main rclone definitions - minimal amount of code - * accounting - bandwidth limiting and statistics - * asyncreader - an io.Reader which reads ahead - * config - manage the config file and flags - * driveletter - detect if a name is a drive letter - * filter - implements include/exclude filtering - * fserrors - rclone specific error handling - * fshttp - http handling for rclone - * fspath - path handling for rclone - * hash - defines rclone's hash types and functions - * list - list a remote - * log - logging facilities - * march - iterates directories in lock step - * object - in memory Fs objects - * operations - primitives for sync, e.g. Copy, Move - * sync - sync directories - * walk - walk a directory - * fstest - provides integration test framework - * fstests - integration tests for the backends - * mockdir - mocks an fs.Directory - * mockobject - mocks an fs.Object - * test_all - Runs integration tests for everything - * graphics - the images used in the website, etc. - * lib - libraries used by the backend - * atexit - register functions to run when rclone exits - * dircache - directory ID to name caching - * oauthutil - helpers for using oauth - * pacer - retries with backoff and paces operations - * readers - a selection of useful io.Readers - * rest - a thin abstraction over net/http for REST - * vfs - Virtual FileSystem layer for implementing rclone mount and similar - -## Writing Documentation ## +- backend - the rclone backends for interfacing to cloud providers - + - all - import this to load all the cloud providers + - ...providers +- bin - scripts for use while building or maintaining rclone +- cmd - the rclone commands + - all - import this to load all the commands + - ...commands +- cmdtest - end-to-end tests of commands, flags, environment variables,... +- docs - the documentation and website + - content - adjust these docs only - everything else is autogenerated + - command - these are auto-generated - edit the corresponding .go file +- fs - main rclone definitions - minimal amount of code + - accounting - bandwidth limiting and statistics + - asyncreader - an io.Reader which reads ahead + - config - manage the config file and flags + - driveletter - detect if a name is a drive letter + - filter - implements include/exclude filtering + - fserrors - rclone specific error handling + - fshttp - http handling for rclone + - fspath - path handling for rclone + - hash - defines rclone's hash types and functions + - list - list a remote + - log - logging facilities + - march - iterates directories in lock step + - object - in memory Fs objects + - operations - primitives for sync, e.g. Copy, Move + - sync - sync directories + - walk - walk a directory +- fstest - provides integration test framework + - fstests - integration tests for the backends + - mockdir - mocks an fs.Directory + - mockobject - mocks an fs.Object + - test_all - Runs integration tests for everything +- graphics - the images used in the website, etc. +- lib - libraries used by the backend + - atexit - register functions to run when rclone exits + - dircache - directory ID to name caching + - oauthutil - helpers for using oauth + - pacer - retries with backoff and paces operations + - readers - a selection of useful io.Readers + - rest - a thin abstraction over net/http for REST +- librclone - in memory interface to rclone's API for embedding rclone +- vfs - Virtual FileSystem layer for implementing rclone mount and similar + +## Writing Documentation If you are adding a new feature then please update the documentation. @@ -277,22 +286,22 @@ alphabetical order. If you add a new backend option/flag, then it should be documented in the source file in the `Help:` field. - * Start with the most important information about the option, +- Start with the most important information about the option, as a single sentence on a single line. - * This text will be used for the command-line flag help. - * It will be combined with other information, such as any default value, + - This text will be used for the command-line flag help. + - It will be combined with other information, such as any default value, and the result will look odd if not written as a single sentence. - * It should end with a period/full stop character, which will be shown + - It should end with a period/full stop character, which will be shown in docs but automatically removed when producing the flag help. - * Try to keep it below 80 characters, to reduce text wrapping in the terminal. - * More details can be added in a new paragraph, after an empty line (`"\n\n"`). - * Like with docs generated from Markdown, a single line break is ignored + - Try to keep it below 80 characters, to reduce text wrapping in the terminal. +- More details can be added in a new paragraph, after an empty line (`"\n\n"`). + - Like with docs generated from Markdown, a single line break is ignored and two line breaks creates a new paragraph. - * This text will be shown to the user in `rclone config` + - This text will be shown to the user in `rclone config` and in the docs (where it will be added by `make backenddocs`, normally run some time before next release). - * To create options of enumeration type use the `Examples:` field. - * Each example value have their own `Help:` field, but they are treated +- To create options of enumeration type use the `Examples:` field. + - Each example value have their own `Help:` field, but they are treated a bit different than the main option help text. They will be shown as an unordered list, therefore a single line break is enough to create a new list item. Also, for enumeration texts like name of @@ -312,12 +321,12 @@ combined unmodified with other information (such as any default value). Note that you can use [GitHub's online editor](https://help.github.com/en/github/managing-files-in-a-repository/editing-files-in-another-users-repository) for small changes in the docs which makes it very easy. -## Making a release ## +## Making a release There are separate instructions for making a release in the RELEASE.md file. -## Commit messages ## +## Commit messages Please make the first line of your commit message a summary of the change that a user (not a developer) of rclone would like to read, and @@ -358,7 +367,7 @@ error fixing the hang. Fixes #1498 ``` -## Adding a dependency ## +## Adding a dependency rclone uses the [go modules](https://tip.golang.org/cmd/go/#hdr-Modules__module_versions__and_more) @@ -370,7 +379,7 @@ To add a dependency `github.com/ncw/new_dependency` see the instructions below. These will fetch the dependency and add it to `go.mod` and `go.sum`. - GO111MODULE=on go get github.com/ncw/new_dependency + go get github.com/ncw/new_dependency You can add constraints on that package when doing `go get` (see the go docs linked above), but don't unless you really need to. @@ -378,15 +387,15 @@ go docs linked above), but don't unless you really need to. Please check in the changes generated by `go mod` including `go.mod` and `go.sum` in the same commit as your other changes. -## Updating a dependency ## +## Updating a dependency If you need to update a dependency then run - GO111MODULE=on go get -u golang.org/x/crypto + go get golang.org/x/crypto Check in a single commit as above. -## Updating all the dependencies ## +## Updating all the dependencies In order to update all the dependencies then run `make update`. This just uses the go modules to update all the modules to their latest @@ -395,7 +404,7 @@ stable release. Check in the changes in a single commit as above. This should be done early in the release cycle to pick up new versions of packages in time for them to get some testing. -## Updating a backend ## +## Updating a backend If you update a backend then please run the unit tests and the integration tests for that backend. @@ -410,82 +419,133 @@ integration tests. The next section goes into more detail about the tests. -## Writing a new backend ## +## Writing a new backend Choose a name. The docs here will use `remote` as an example. Note that in rclone terminology a file system backend is called a remote or an fs. -Research +### Research - * Look at the interfaces defined in `fs/fs.go` - * Study one or more of the existing remotes +- Look at the interfaces defined in `fs/types.go` +- Study one or more of the existing remotes -Getting going +### Getting going - * Create `backend/remote/remote.go` (copy this from a similar remote) - * box is a good one to start from if you have a directory-based remote - * b2 is a good one to start from if you have a bucket-based remote - * Add your remote to the imports in `backend/all/all.go` - * HTTP based remotes are easiest to maintain if they use rclone's rest module, but if there is a really good go SDK then use that instead. - * Try to implement as many optional methods as possible as it makes the remote more usable. - * Use lib/encoder to make sure we can encode any path name and `rclone info` to help determine the encodings needed - * `rclone purge -v TestRemote:rclone-info` - * `rclone test info --all --remote-encoding None -vv --write-json remote.json TestRemote:rclone-info` - * `go run cmd/test/info/internal/build_csv/main.go -o remote.csv remote.json` - * open `remote.csv` in a spreadsheet and examine +- Create `backend/remote/remote.go` (copy this from a similar remote) + - box is a good one to start from if you have a directory-based remote (and shows how to use the directory cache) + - b2 is a good one to start from if you have a bucket-based remote +- Add your remote to the imports in `backend/all/all.go` +- HTTP based remotes are easiest to maintain if they use rclone's [lib/rest](https://pkg.go.dev/github.com/rclone/rclone/lib/rest) module, but if there is a really good Go SDK from the provider then use that instead. +- Try to implement as many optional methods as possible as it makes the remote more usable. +- Use [lib/encoder](https://pkg.go.dev/github.com/rclone/rclone/lib/encoder) to make sure we can encode any path name and `rclone info` to help determine the encodings needed + - `rclone purge -v TestRemote:rclone-info` + - `rclone test info --all --remote-encoding None -vv --write-json remote.json TestRemote:rclone-info` + - `go run cmd/test/info/internal/build_csv/main.go -o remote.csv remote.json` + - open `remote.csv` in a spreadsheet and examine -Unit tests +### Guidelines for a speedy merge - * Create a config entry called `TestRemote` for the unit tests to use - * Create a `backend/remote/remote_test.go` - copy and adjust your example remote - * Make sure all tests pass with `go test -v` +- **Do** use [lib/rest](https://pkg.go.dev/github.com/rclone/rclone/lib/rest) if you are implementing a REST like backend and parsing XML/JSON in the backend. +- **Do** use rclone's Client or Transport from [fs/fshttp](https://pkg.go.dev/github.com/rclone/rclone/fs/fshttp) if your backend is HTTP based - this adds features like `--dump bodies`, `--tpslimit`, `--user-agent` without you having to code anything! +- **Do** follow your example backend exactly - use the same code order, function names, layout, structure. **Don't** move stuff around and **Don't** delete the comments. +- **Do not** split your backend up into `fs.go` and `object.go` (there are a few backends like that - don't follow them!) +- **Do** put your API type definitions in a separate file - by preference `api/types.go` +- **Remember** we have >50 backends to maintain so keeping them as similar as possible to each other is a high priority! -Integration tests +### Unit tests - * Add your backend to `fstest/test_all/config.yaml` - * Once you've done that then you can use the integration test framework from the project root: - * go install ./... - * test_all -backends remote +- Create a config entry called `TestRemote` for the unit tests to use +- Create a `backend/remote/remote_test.go` - copy and adjust your example remote +- Make sure all tests pass with `go test -v` + +### Integration tests + +- Add your backend to `fstest/test_all/config.yaml` + - Once you've done that then you can use the integration test framework from the project root: + - go install ./... + - test_all -backends remote Or if you want to run the integration tests manually: - * Make sure integration tests pass with - * `cd fs/operations` - * `go test -v -remote TestRemote:` - * `cd fs/sync` - * `go test -v -remote TestRemote:` - * If your remote defines `ListR` check with this also - * `go test -v -remote TestRemote: -fast-list` +- Make sure integration tests pass with + - `cd fs/operations` + - `go test -v -remote TestRemote:` + - `cd fs/sync` + - `go test -v -remote TestRemote:` +- If your remote defines `ListR` check with this also + - `go test -v -remote TestRemote: -fast-list` See the [testing](#testing) section for more information on integration tests. -Add your fs to the docs - you'll need to pick an icon for it from +### Backend documentation + +Add your backend to the docs - you'll need to pick an icon for it from [fontawesome](http://fontawesome.io/icons/). Keep lists of remotes in alphabetical order of full name of remote (e.g. `drive` is ordered as `Google Drive`) but with the local file system last. - * `README.md` - main GitHub page - * `docs/content/remote.md` - main docs page (note the backend options are automatically added to this file with `make backenddocs`) - * make sure this has the `autogenerated options` comments in (see your reference backend docs) - * update them with `make backenddocs` - revert any changes in other backends - * `docs/content/overview.md` - overview docs - * `docs/content/docs.md` - list of remotes in config section - * `docs/content/_index.md` - front page of rclone.org - * `docs/layouts/chrome/navbar.html` - add it to the website navigation - * `bin/make_manual.py` - add the page to the `docs` constant +- `README.md` - main GitHub page +- `docs/content/remote.md` - main docs page (note the backend options are automatically added to this file with `make backenddocs`) + - make sure this has the `autogenerated options` comments in (see your reference backend docs) + - update them in your backend with `bin/make_backend_docs.py remote` +- `docs/content/overview.md` - overview docs +- `docs/content/docs.md` - list of remotes in config section +- `docs/content/_index.md` - front page of rclone.org +- `docs/layouts/chrome/navbar.html` - add it to the website navigation +- `bin/make_manual.py` - add the page to the `docs` constant Once you've written the docs, run `make serve` and check they look OK in the web browser and the links (internal and external) all work. -## Writing a plugin ## +## Adding a new s3 provider + +It is quite easy to add a new S3 provider to rclone. + +You'll need to modify the following files + +- `backend/s3/s3.go` + - Add the provider to `providerOption` at the top of the file + - Add endpoints and other config for your provider gated on the provider in `fs.RegInfo`. + - Exclude your provider from genric config questions (eg `region` and `endpoint). + - Add the provider to the `setQuirks` function - see the documentation there. +- `docs/content/s3.md` + - Add the provider at the top of the page. + - Add a section about the provider linked from there. + - Add a transcript of a trial `rclone config` session + - Edit the transcript to remove things which might change in subsequent versions + - **Do not** alter or add to the autogenerated parts of `s3.md` + - **Do not** run `make backenddocs` or `bin/make_backend_docs.py s3` +- `README.md` - this is the home page in github + - Add the provider and a link to the section you wrote in `docs/contents/s3.md` +- `docs/content/_index.md` - this is the home page of rclone.org + - Add the provider and a link to the section you wrote in `docs/contents/s3.md` + +When adding the provider, endpoints, quirks, docs etc keep them in +alphabetical order by `Provider` name, but with `AWS` first and +`Other` last. + +Once you've written the docs, run `make serve` and check they look OK +in the web browser and the links (internal and external) all work. + +Once you've written the code, test `rclone config` works to your +satisfaction, and check the integration tests work `go test -v -remote +NewS3Provider:`. You may need to adjust the quirks to get them to +pass. Some providers just can't pass the tests with control characters +in the names so if these fail and the provider doesn't support +`urlEncodeListings` in the quirks then ignore them. Note that the +`SetTier` test may also fail on non AWS providers. + +For an example of adding an s3 provider see [eb3082a1](https://github.com/rclone/rclone/commit/eb3082a1ebdb76d5625f14cedec3f5154a5e7b10). + +## Writing a plugin New features (backends, commands) can also be added "out-of-tree", through Go plugins. Changes will be kept in a dynamically loaded file instead of being compiled into the main binary. This is useful if you can't merge your changes upstream or don't want to maintain a fork of rclone. -Usage +### Usage - Naming - Plugins names must have the pattern `librcloneplugin_KIND_NAME.so`. @@ -500,7 +560,7 @@ Usage - Plugins must be compiled against the exact version of rclone to work. (The rclone used during building the plugin must be the same as the source of rclone) -Building +### Building To turn your existing additions into a Go plugin, move them to an external repository and change the top-level package name to `main`. diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 8b24b3e3691bd..3ab1c22482203 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -16,6 +16,11 @@ Current active maintainers of rclone are: | Max Sum | @Max-Sum | union backend | | Fred | @creativeprojects | seafile backend | | Caleb Case | @calebcase | storj backend | +| wiserain | @wiserain | pikpak backend | +| albertony | @albertony | | +| Chun-Hung Tseng | @henrybear327 | Proton Drive Backend | +| Hideo Aoyama | @boukendesho | snap packaging | +| nielash | @nielash | bisync | **This is a work in progress Draft** diff --git a/MANUAL.html b/MANUAL.html index 39b3e2d3321de..d16296fa0acd4 100644 --- a/MANUAL.html +++ b/MANUAL.html @@ -13,13 +13,75 @@ div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} + pre > code.sourceCode { white-space: pre; position: relative; } + pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } + pre > code.sourceCode > span:empty { height: 1.2em; } + code.sourceCode > span { color: inherit; text-decoration: inherit; } + div.sourceCode { margin: 1em 0; } + pre.sourceCode { margin: 0; } + @media screen { + div.sourceCode { overflow: auto; } + } + @media print { + pre > code.sourceCode { white-space: pre-wrap; } + pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } + } + pre.numberSource code + { counter-reset: source-line 0; } + pre.numberSource code > span + { position: relative; left: -4em; counter-increment: source-line; } + pre.numberSource code > span > a:first-child::before + { content: counter(source-line); + position: relative; left: -1em; text-align: right; vertical-align: baseline; + border: none; display: inline-block; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; + color: #aaaaaa; + } + pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } + div.sourceCode + { } + @media screen { + pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } + } + code span.al { color: #ff0000; font-weight: bold; } /* Alert */ + code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ + code span.at { color: #7d9029; } /* Attribute */ + code span.bn { color: #40a070; } /* BaseN */ + code span.bu { } /* BuiltIn */ + code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ + code span.ch { color: #4070a0; } /* Char */ + code span.cn { color: #880000; } /* Constant */ + code span.co { color: #60a0b0; font-style: italic; } /* Comment */ + code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ + code span.do { color: #ba2121; font-style: italic; } /* Documentation */ + code span.dt { color: #902000; } /* DataType */ + code span.dv { color: #40a070; } /* DecVal */ + code span.er { color: #ff0000; font-weight: bold; } /* Error */ + code span.ex { } /* Extension */ + code span.fl { color: #40a070; } /* Float */ + code span.fu { color: #06287e; } /* Function */ + code span.im { } /* Import */ + code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ + code span.kw { color: #007020; font-weight: bold; } /* Keyword */ + code span.op { color: #666666; } /* Operator */ + code span.ot { color: #007020; } /* Other */ + code span.pp { color: #bc7a00; } /* Preprocessor */ + code span.sc { color: #4070a0; } /* SpecialChar */ + code span.ss { color: #bb6688; } /* SpecialString */ + code span.st { color: #4070a0; } /* String */ + code span.va { color: #19177c; } /* Variable */ + code span.vs { color: #4070a0; } /* VerbatimString */ + code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */

rclone(1) User Manual

Nick Craig-Wood

-

Mar 14, 2023

+

Nov 26, 2023

Rclone syncs your files to cloud storage

rclone logo

@@ -33,7 +95,7 @@

Rclone syncs your files to clo
  • Donate.
  • About rclone

    -

    Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 40 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.

    +

    Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 70 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.

    Rclone has powerful cloud equivalents to the unix commands rsync, cp, mv, mount, ls, ncdu, tree, rm, and cat. Rclone's familiar syntax includes shell pipeline support, and --dry-run protection. It is used at the command line, in scripts or via its API.

    Users call rclone "The Swiss army knife of cloud storage", and "Technology indistinguishable from magic".

    Rclone really looks after your data. It preserves timestamps and verifies checksums at all times. Transfers over limited bandwidth; intermittent connections, or subject to quota can be restarted, from the last good file transferred. You can check the integrity of your files. Where possible, rclone employs server-side transfers to minimise local bandwidth use and transfers from one provider to another without using local disk.

    @@ -91,6 +153,7 @@

    Supported providers

  • Dreamhost
  • Dropbox
  • Enterprise File Fabric
  • +
  • Fastmail Files
  • FTP
  • Google Cloud Storage
  • Google Drive
  • @@ -105,26 +168,35 @@

    Supported providers

  • IDrive e2
  • IONOS Cloud
  • Koofr
  • +
  • Leviia Object Storage
  • Liara Object Storage
  • +
  • Linkbox
  • +
  • Linode Object Storage
  • Mail.ru Cloud
  • Memset Memstore
  • Mega
  • Memory
  • Microsoft Azure Blob Storage
  • +
  • Microsoft Azure Files Storage
  • Microsoft OneDrive
  • Minio
  • Nextcloud
  • OVH
  • +
  • Blomp Cloud Storage
  • OpenDrive
  • OpenStack Swift
  • Oracle Cloud Storage Swift
  • Oracle Object Storage
  • ownCloud
  • pCloud
  • +
  • Petabox
  • +
  • PikPak
  • premiumize.me
  • put.io
  • +
  • Proton Drive
  • QingStor
  • Qiniu Cloud Object Storage (Kodo)
  • +
  • Quatrix by Maytech
  • Rackspace Cloud Files
  • rsync.net
  • Scaleway
  • @@ -136,6 +208,7 @@

    Supported providers

  • SMB / CIFS
  • StackPath
  • Storj
  • +
  • Synology
  • SugarSync
  • Tencent Cloud Object Storage (COS)
  • Uptobox
  • @@ -176,6 +249,7 @@

    Quickstart

    See below for some expanded Linux / macOS / Windows instructions.

    See the usage docs for how to use rclone, or run rclone -h.

    Already installed rclone can be easily updated to the latest version using the rclone selfupdate command.

    +

    See the release signing docs for how to verify signatures on the release.

    Script installation

    To install rclone on Linux/macOS/BSD systems, run:

    sudo -v ; curl https://rclone.org/install.sh | sudo bash
    @@ -204,6 +278,12 @@

    Installation with brew

    NOTE: This version of rclone will not support mount any more (see #5373). If mounting is wanted on macOS, either install a precompiled binary or enable the relevant option when installing from source.

    Note that this is a third party installer not controlled by the rclone developers so it may be out of date. Its current version is as below.

    Homebrew package

    +

    Installation with MacPorts (#macos-macports)

    +

    On macOS, rclone can also be installed via MacPorts:

    +
    sudo port install rclone
    +

    Note that this is a third party installer not controlled by the rclone developers so it may be out of date. Its current version is as below.

    +

    MacPorts port

    +

    More information here.

    Precompiled binary, using curl

    To avoid problems with macOS gatekeeper enforcing the binary to be signed and notarized it is enough to download with curl.

    Download the latest version of rclone.

    @@ -241,7 +321,10 @@

    Precompiled binary

    If you are planning to use the rclone mount feature then you will need to install the third party utility WinFsp also.

    Windows package manager (Winget)

    Winget comes pre-installed with the latest versions of Windows. If not, update the App Installer package from the Microsoft store.

    +

    To install rclone

    winget install Rclone.Rclone
    +

    To uninstall rclone

    +
    winget uninstall Rclone.Rclone --force

    Chocolatey package manager

    Make sure you have Choco installed

    choco search rclone
    @@ -289,10 +372,16 @@ 

    Docker installation

    # config on host at ~/.config/rclone/rclone.conf
     # data on host at ~/data
     
    +# add a remote interactively
    +docker run --rm -it \
    +    --volume ~/.config/rclone:/config/rclone \
    +    --user $(id -u):$(id -g) \
    +    rclone/rclone \
    +    config
    +
     # make sure the config is ok by listing the remotes
     docker run --rm \
         --volume ~/.config/rclone:/config/rclone \
    -    --volume ~/data:/data:shared \
         --user $(id -u):$(id -g) \
         rclone/rclone \
         listremotes
    @@ -309,8 +398,23 @@ 

    Docker installation

    mount dropbox:Photos /data/mount & ls ~/data/mount kill %1
    +

    Snap installation

    +

    Get it from the Snap Store

    +

    Make sure you have Snapd installed

    +
    $ sudo snap install rclone
    +

    Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below.

    + +

    Note: Due to the strict confinement of Snap, rclone mount feature is not supported.

    +

    If mounting is wanted, either install a precompiled binary or enable the relevant option when installing from source.

    +

    Note that this is controlled by community maintainer not the rclone developers so it may be out of date. Its current version is as below.

    +

    rclone

    Source installation

    -

    Make sure you have git and Go installed. Go version 1.17 or newer is required, latest release is recommended. You can get it from your package manager, or download it from golang.org/dl. Then you can run the following:

    +

    Make sure you have git and Go installed. Go version 1.18 or newer is required, the latest release is recommended. You can get it from your package manager, or download it from golang.org/dl. Then you can run the following:

    git clone https://github.com/rclone/rclone.git
     cd rclone
     go build
    @@ -318,19 +422,22 @@

    Source installation

    Note that on macOS and Windows the mount command will not be available unless you specify an additional build tag cmount.

    go build -tags cmount

    This assumes you have a GCC compatible C compiler (GCC or Clang) in your PATH, as it uses cgo. But on Windows, the cgofuse library that the cmount implementation is based on, also supports building without cgo, i.e. by setting environment variable CGO_ENABLED to value 0 (static linking). This is how the official Windows release of rclone is being built, starting with version 1.59. It is still possible to build with cgo on Windows as well, by using the MinGW port of GCC, e.g. by installing it in a MSYS2 distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible).

    -

    Additionally, on Windows, you must install the third party utility WinFsp, with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally C:\Program Files (x86)\WinFsp\inc\fuse).

    -

    You may also add arguments -ldflags -s (with or without -tags cmount), to omit symbol table and debug information, making the executable file smaller, and -trimpath to remove references to local file system paths. This is how the official rclone releases are built.

    +

    Additionally, to build with mount on Windows, you must install the third party utility WinFsp, with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally C:\Program Files (x86)\WinFsp\inc\fuse).

    +

    You may add arguments -ldflags -s to omit symbol table and debug information, making the executable file smaller, and -trimpath to remove references to local file system paths. The official rclone releases are built with both of these.

    go build -trimpath -ldflags -s -tags cmount
    -

    Instead of executing the go build command directly, you can run it via the Makefile. It changes the version number suffix from "-DEV" to "-beta" and appends commit details. It also copies the resulting rclone executable into your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

    +

    If you want to customize the version string, as reported by the rclone version command, you can set one of the variables fs.Version, fs.VersionTag (to keep default suffix but customize the number), or fs.VersionSuffix (to keep default number but customize the suffix). This can be done from the build command, by adding to the -ldflags argument value as shown below.

    +
    go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount
    +

    On Windows, the official executables also have the version information, as well as a file icon, embedded as binary resources. To get that with your own build you need to run the following command before the build command. It generates a Windows resource system object file, with extension .syso, e.g. resource_windows_amd64.syso, that will be automatically picked up by future build commands.

    +
    go run bin/resource_windows.go
    +

    The above command will generate a resource file containing version information based on the fs.Version variable in source at the time you run the command, which means if the value of this variable changes you need to re-run the command for it to be reflected in the version information. Also, if you override this version variable in the build command as described above, you need to do that also when generating the resource file, or else it will still use the value from the source.

    +
    go run bin/resource_windows.go -version v9.9.9-test
    +

    Instead of executing the go build command directly, you can run it via the Makefile. The default target changes the version suffix from "-DEV" to "-beta" followed by additional commit details, embeds version information binary resources on Windows, and copies the resulting rclone executable into your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

    make

    To include mount command on macOS and Windows with Makefile build:

    make GOTAGS=cmount
    -

    There are other make targets that can be used for more advanced builds, such as cross-compiling for all supported os/architectures, embedding icon and version info resources into windows executable, and packaging results into release artifacts. See Makefile and cross-compile.go for details.

    -

    Another alternative is to download the source, build and install rclone in one operation, as a regular Go package. The source will be stored it in the Go module cache, and the resulting executable will be in your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

    -

    With Go version 1.17 or newer:

    +

    There are other make targets that can be used for more advanced builds, such as cross-compiling for all supported os/architectures, and packaging results into release artifacts. See Makefile and cross-compile.go for details.

    +

    Another alternative method for source installation is to download the source, build and install rclone - all in one operation, as a regular Go package. The source will be stored it in the Go module cache, and the resulting executable will be in your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

    go install github.com/rclone/rclone@latest
    -

    With Go versions older than 1.17 (do not use the -u flag, it causes Go to try to update the dependencies that rclone uses and sometimes these don't work with the current version):

    -
    go get github.com/rclone/rclone

    Ansible installation

    This can be done with Stefan Weichinger's ansible role.

    Instructions

    @@ -371,7 +478,7 @@
    Mount command built-in servi

    The WinFsp service infrastructure supports incorporating services for file system implementations, such as rclone, into its own launcher service, as kind of "child services". This has the additional advantage that it also implements a network provider that integrates into Windows standard methods for managing network drives. This is currently not officially supported by Rclone, but with WinFsp version 2019.3 B2 / v1.5B2 or later it should be possible through path rewriting as described here.

    Third-party service integration

    To Windows service running any rclone command, the excellent third-party utility NSSM, the "Non-Sucking Service Manager", can be used. It includes some advanced features such as adjusting process priority, defining process environment variables, redirect to file anything written to stdout, and customized response to different exit codes, with a GUI to configure everything from (although it can also be used from command line ).

    -

    There are also several other alternatives. To mention one more, WinSW, "Windows Service Wrapper", is worth checking out. It requires .NET Framework, but it is preinstalled on newer versions of Windows, and it also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it is easy to back up and re-use the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter).

    +

    There are also several other alternatives. To mention one more, WinSW, "Windows Service Wrapper", is worth checking out. It requires .NET Framework, but it is preinstalled on newer versions of Windows, and it also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it is easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter).

    Autostart on Linux

    Start as a service

    To always run rclone in background, relevant for mount commands etc, you can use systemd to set up rclone as a system or user service. Running as a system service ensures that it is run at startup even if the user it is running as has no active session. Running rclone as a user service ensures that it only starts after the configured user has logged into the system.

    @@ -412,18 +519,23 @@

    Configure

  • Internet Archive
  • Jottacloud
  • Koofr
  • +
  • Linkbox
  • Mail.ru Cloud
  • Mega
  • Memory
  • Microsoft Azure Blob Storage
  • +
  • Microsoft Azure Files Storage
  • Microsoft OneDrive
  • -
  • OpenStack Swift / Rackspace Cloudfiles / Memset Memstore
  • +
  • OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset Memstore
  • OpenDrive
  • Oracle Object Storage
  • Pcloud
  • +
  • PikPak
  • premiumize.me
  • put.io
  • +
  • Proton Drive
  • QingStor
  • +
  • Quatrix by Maytech
  • Seafile
  • SFTP
  • Sia
  • @@ -457,18 +569,20 @@

    Synopsis

    Options

      -h, --help   help for config

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    +

    The default number of parallel checks is 8. See the --checkers=N option for more information.

    rclone check source:path dest:path [flags]

    Options

      -C, --checkfile string        Treat source:path as a SUM file with hashes of given type
    @@ -637,8 +1011,39 @@ 

    Options

    --missing-on-dst string Report all files missing from the destination to this file --missing-on-src string Report all files missing from the source to this file --one-way Check one way only, source files must exist on remote
    +

    Check Options

    +

    Flags used for rclone check.

    +
          --max-backlog int   Maximum number of objects in sync or check backlog (default 10000)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -668,8 +1073,36 @@

    Synopsis

    rclone ls remote:path [flags]

    Options

      -h, --help   help for ls
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -704,8 +1137,36 @@

    Synopsis

    Options

      -h, --help        help for lsd
       -R, --recursive   Recurse into the listing
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -735,8 +1196,36 @@

    Synopsis

    rclone lsl remote:path [flags]

    Options

      -h, --help   help for lsl
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -754,8 +1243,36 @@

    Options

    --download Download the file and hash it locally; if this flag is not specified, the hash is requested from the remote -h, --help help for md5sum --output-file string Output hashsums to a file rather than the terminal
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -774,8 +1291,36 @@

    Options

    --download Download the file and hash it locally; if this flag is not specified, the hash is requested from the remote -h, --help help for sha1sum --output-file string Output hashsums to a file rather than the terminal +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -785,13 +1330,41 @@

    Synopsis

    Counts objects in the path and calculates the total size. Prints the result to standard output.

    By default the output is in human-readable format, but shows values in both human-readable format as well as the raw numbers (global option --human-readable is not considered). Use option --json to format output as JSON instead.

    Recurses by default, use --max-depth 1 to stop the recursion.

    -

    Some backends do not always provide file sizes, see for example Google Photos and Google Drive. Rclone will then show a notice in the log indicating how many such files were encountered, and count them in as empty files in the output of the size command.

    +

    Some backends do not always provide file sizes, see for example Google Photos and Google Docs. Rclone will then show a notice in the log indicating how many such files were encountered, and count them in as empty files in the output of the size command.

    rclone size remote:path [flags]

    Options

      -h, --help   help for size
           --json   Format output as JSON
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -827,7 +1400,7 @@

    Options

          --check   Check for new version
       -h, --help    help for version

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -838,8 +1411,13 @@

    Synopsis

    rclone cleanup remote:path [flags]

    Options

      -h, --help   help for cleanup
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -917,8 +1495,13 @@

    Options

          --by-hash              Find identical hashes rather than names
           --dedupe-mode string   Dedupe mode interactive|skip|first|newest|oldest|largest|smallest|rename (default "interactive")
       -h, --help                 help for dedupe
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -964,7 +1547,7 @@

    Options

    -h, --help help for about --json Format output as JSON

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -980,7 +1563,7 @@

    Options

    -h, --help help for authorize --template string The path to a custom Go template for generating HTML responses

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1003,8 +1586,13 @@

    Options

      -h, --help                 help for backend
           --json                 Always output in JSON format
       -o, --option stringArray   Option in the form name=value or name
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1016,19 +1604,84 @@

    Synopsis

    See full bisync description for details.

    rclone bisync remote1:path1 remote2:path2 [flags]

    Options

    -
          --check-access            Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort.
    -      --check-filename string   Filename for --check-access (default: RCLONE_TEST)
    -      --check-sync string       Controls comparison of final listings: true|false|only (default: true) (default "true")
    -      --filters-file string     Read filtering patterns from a file
    -      --force                   Bypass --max-delete safety check and run the sync. Consider using with --verbose
    -  -h, --help                    help for bisync
    -      --localtime               Use local time in listings (default: UTC)
    -      --no-cleanup              Retain working files (useful for troubleshooting and testing).
    -      --remove-empty-dirs       Remove empty directories at the final cleanup step.
    -  -1, --resync                  Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.
    -      --workdir string          Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync)
    +
          --check-access              Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort.
    +      --check-filename string     Filename for --check-access (default: RCLONE_TEST)
    +      --check-sync string         Controls comparison of final listings: true|false|only (default: true) (default "true")
    +      --create-empty-src-dirs     Sync creation and deletion of empty directories. (Not compatible with --remove-empty-dirs)
    +      --filters-file string       Read filtering patterns from a file
    +      --force                     Bypass --max-delete safety check and run the sync. Consider using with --verbose
    +  -h, --help                      help for bisync
    +      --ignore-listing-checksum   Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks)
    +      --localtime                 Use local time in listings (default: UTC)
    +      --no-cleanup                Retain working files (useful for troubleshooting and testing).
    +      --remove-empty-dirs         Remove ALL empty directories at the final cleanup step.
    +      --resilient                 Allow future runs to retry after certain less-serious errors, instead of requiring --resync. Use at your own risk!
    +  -1, --resync                    Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.
    +      --workdir string            Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync)
    +

    Copy Options

    +

    Flags for anything which can Copy a file.

    +
          --check-first                                 Do all the checks before starting transfers
    +  -c, --checksum                                    Check for changes with size & checksum (if available, or fallback to size only).
    +      --compare-dest stringArray                    Include additional comma separated server-side paths during comparison
    +      --copy-dest stringArray                       Implies --compare-dest but also copies files from paths into destination
    +      --cutoff-mode HARD|SOFT|CAUTIOUS              Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD)
    +      --ignore-case-sync                            Ignore case when synchronizing
    +      --ignore-checksum                             Skip post copy check of checksums
    +      --ignore-existing                             Skip all files that exist on destination
    +      --ignore-size                                 Ignore size when skipping use modtime or checksum
    +  -I, --ignore-times                                Don't skip files that match size and time - transfer all files
    +      --immutable                                   Do not modify files, fail if existing files have been modified
    +      --inplace                                     Download directly to destination file instead of atomic download to temp/rename
    +      --max-backlog int                             Maximum number of objects in sync or check backlog (default 10000)
    +      --max-duration Duration                       Maximum duration rclone will transfer data for (default 0s)
    +      --max-transfer SizeSuffix                     Maximum size of data to transfer (default off)
    +  -M, --metadata                                    If set, preserve metadata when copying objects
    +      --modify-window Duration                      Max time diff to be considered the same (default 1ns)
    +      --multi-thread-chunk-size SizeSuffix          Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi)
    +      --multi-thread-cutoff SizeSuffix              Use multi-thread downloads for files above this size (default 256Mi)
    +      --multi-thread-streams int                    Number of streams to use for multi-thread downloads (default 4)
    +      --multi-thread-write-buffer-size SizeSuffix   In memory buffer size for writing when in multi-thread mode (default 128Ki)
    +      --no-check-dest                               Don't check the destination, copy regardless
    +      --no-traverse                                 Don't traverse destination file system on copy
    +      --no-update-modtime                           Don't update destination modtime if files identical
    +      --order-by string                             Instructions on how to order the transfers, e.g. 'size,descending'
    +      --partial-suffix string                       Add partial-suffix to temporary file name when --inplace is not used (default ".partial")
    +      --refresh-times                               Refresh the modtime of remote files
    +      --server-side-across-configs                  Allow server-side operations (e.g. copy) to work across different configs
    +      --size-only                                   Skip based on size only, not modtime or checksum
    +      --streaming-upload-cutoff SizeSuffix          Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
    +  -u, --update                                      Skip files that are newer on the destination
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1043,24 +1696,61 @@

    Synopsis

    Or like this to output any .txt files in dir or its subdirectories.

    rclone --include "*.txt" cat remote:path/to/dir

    Use the --head flag to print characters only at the start, --tail for the end and --offset and --count to print a section in the middle. Note that if offset is negative it will count from the end, so --offset -1 --count 1 is equivalent to --tail 1.

    +

    Use the --separator flag to print a separator value between files. Be sure to shell-escape special characters. For example, to print a newline between files, use:

    +
    rclone cat remote:path [flags]

    Options

    -
          --count int    Only print N characters (default -1)
    -      --discard      Discard the output instead of printing
    -      --head int     Only print the first N characters
    -  -h, --help         help for cat
    -      --offset int   Start printing at offset N (or from end if -ve)
    -      --tail int     Only print the last N characters
    +
          --count int          Only print N characters (default -1)
    +      --discard            Discard the output instead of printing
    +      --head int           Only print the first N characters
    +  -h, --help               help for cat
    +      --offset int         Start printing at offset N (or from end if -ve)
    +      --separator string   Separator to use between objects when printing multiple files
    +      --tail int           Only print the last N characters
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone checksum

    -

    Checks the files in the source against a SUM file.

    +

    Checks the files in the destination against a SUM file.

    Synopsis

    -

    Checks that hashsums of source files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system.

    -

    If you supply the --download flag, it will download the data from remote and calculate the contents hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data.

    +

    Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system.

    +

    The sumfile is treated as the source and the dst:path is treated as the destination for the purposes of the output.

    +

    If you supply the --download flag, it will download the data from the remote and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data.

    Note that hash values in the SUM file are treated as case insensitive.

    If you supply the --one-way flag, it will only check that files in the source match the files in the destination, not the other way around. This means that extra files in the destination that are not in the source will not be detected.

    The --differ, --missing-on-dst, --missing-on-src, --match and --error flags write paths, one per line, to the file name (or stdout if it is -) supplied. What they write is described in the help below. For example --differ will write all paths which are present on both the source and destination but different.

    @@ -1072,7 +1762,8 @@

    Synopsis

  • `* path` means path was present in source and destination but different.
  • ! path means there was an error reading or hashing the source or dest.
  • -
    rclone checksum <hash> sumfile src:path [flags]
    +

    The default number of parallel checks is 8. See the --checkers=N option for more information.

    +
    rclone checksum <hash> sumfile dst:path [flags]

    Options

          --combined string         Make a combined report of changes to this file
           --differ string           Report all non-matching files to this file
    @@ -1083,104 +1774,123 @@ 

    Options

    --missing-on-dst string Report all files missing from the destination to this file --missing-on-src string Report all files missing from the source to this file --one-way Check one way only, source files must exist on remote
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone completion

    -

    Generate the autocompletion script for the specified shell

    +

    Output completion script for a given shell.

    Synopsis

    -

    Generate the autocompletion script for rclone for the specified shell. See each sub-command's help for details on how to use the generated script.

    +

    Generates a shell completion script for rclone. Run with --help to list the supported shells.

    Options

      -h, --help   help for completion

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone completion bash

    -

    Generate the autocompletion script for bash

    +

    Output bash completion script for rclone.

    Synopsis

    -

    Generate the autocompletion script for the bash shell.

    -

    This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.

    -

    To load completions in your current shell session:

    -
    source <(rclone completion bash)
    -

    To load completions for every new session, execute once:

    -

    Linux:

    -
    rclone completion bash > /etc/bash_completion.d/rclone
    -

    macOS:

    -
    rclone completion bash > $(brew --prefix)/etc/bash_completion.d/rclone
    -

    You will need to start a new shell for this setup to take effect.

    -
    rclone completion bash
    +

    Generates a bash shell autocompletion script for rclone.

    +

    This writes to /etc/bash_completion.d/rclone by default so will probably need to be run with sudo or as root, e.g.

    +
    sudo rclone genautocomplete bash
    +

    Logout and login again to use the autocompletion scripts, or source them directly

    +
    . /etc/bash_completion
    +

    If you supply a command line argument the script will be written there.

    +

    If output_file is "-", then the output will be written to stdout.

    +
    rclone completion bash [output_file] [flags]

    Options

    -
      -h, --help              help for bash
    -      --no-descriptions   disable completion descriptions
    +
      -h, --help   help for bash

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone completion fish

    -

    Generate the autocompletion script for fish

    +

    Output fish completion script for rclone.

    Synopsis

    -

    Generate the autocompletion script for the fish shell.

    -

    To load completions in your current shell session:

    -
    rclone completion fish | source
    -

    To load completions for every new session, execute once:

    -
    rclone completion fish > ~/.config/fish/completions/rclone.fish
    -

    You will need to start a new shell for this setup to take effect.

    -
    rclone completion fish [flags]
    +

    Generates a fish autocompletion script for rclone.

    +

    This writes to /etc/fish/completions/rclone.fish by default so will probably need to be run with sudo or as root, e.g.

    +
    sudo rclone genautocomplete fish
    +

    Logout and login again to use the autocompletion scripts, or source them directly

    +
    . /etc/fish/completions/rclone.fish
    +

    If you supply a command line argument the script will be written there.

    +

    If output_file is "-", then the output will be written to stdout.

    +
    rclone completion fish [output_file] [flags]

    Options

    -
      -h, --help              help for fish
    -      --no-descriptions   disable completion descriptions
    +
      -h, --help   help for fish

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone completion powershell

    -

    Generate the autocompletion script for powershell

    +

    Output powershell completion script for rclone.

    Synopsis

    Generate the autocompletion script for powershell.

    To load completions in your current shell session:

    rclone completion powershell | Out-String | Invoke-Expression

    To load completions for every new session, add the output of the above command to your powershell profile.

    -
    rclone completion powershell [flags]
    +

    If output_file is "-" or missing, then the output will be written to stdout.

    +
    rclone completion powershell [output_file] [flags]

    Options

    -
      -h, --help              help for powershell
    -      --no-descriptions   disable completion descriptions
    +
      -h, --help   help for powershell

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone completion zsh

    -

    Generate the autocompletion script for zsh

    +

    Output zsh completion script for rclone.

    Synopsis

    -

    Generate the autocompletion script for the zsh shell.

    -

    If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:

    -
    echo "autoload -U compinit; compinit" >> ~/.zshrc
    -

    To load completions in your current shell session:

    -
    source <(rclone completion zsh); compdef _rclone rclone
    -

    To load completions for every new session, execute once:

    -

    Linux:

    -
    rclone completion zsh > "${fpath[1]}/_rclone"
    -

    macOS:

    -
    rclone completion zsh > $(brew --prefix)/share/zsh/site-functions/_rclone
    -

    You will need to start a new shell for this setup to take effect.

    -
    rclone completion zsh [flags]
    +

    Generates a zsh autocompletion script for rclone.

    +

    This writes to /usr/share/zsh/vendor-completions/_rclone by default so will probably need to be run with sudo or as root, e.g.

    +
    sudo rclone genautocomplete zsh
    +

    Logout and login again to use the autocompletion scripts, or source them directly

    +
    autoload -U compinit && compinit
    +

    If you supply a command line argument the script will be written there.

    +

    If output_file is "-", then the output will be written to stdout.

    +
    rclone completion zsh [output_file] [flags]

    Options

    -
      -h, --help              help for zsh
    -      --no-descriptions   disable completion descriptions
    +
      -h, --help   help for zsh

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone config create

    Create a new remote with name, type and options.

    @@ -1249,7 +1959,7 @@

    Options

    --result string Result - use with --continue --state string State - use with --continue

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1259,7 +1969,7 @@

    rclone config delete

    Options

      -h, --help   help for delete

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1273,7 +1983,7 @@

    Synopsis

    Options

      -h, --help   help for disconnect

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1283,16 +1993,16 @@

    rclone config dump

    Options

      -h, --help   help for dump

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone config edit

    Enter an interactive configuration session.

    -

    Synopsis

    +

    Synopsis

    Enter an interactive configuration session where you can setup new remotes and manage existing ones. You may also set or remove a password to protect your configuration.

    rclone config edit [flags]
    -

    Options

    +

    Options

      -h, --help   help for edit

    See the global flags page for global options not listed here.

    SEE ALSO

    @@ -1305,7 +2015,7 @@

    rclone config file

    Options

      -h, --help   help for file

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1321,7 +2031,7 @@

    Synopsis

    Options

      -h, --help   help for password

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1331,7 +2041,7 @@

    rclone config paths

    Options

      -h, --help   help for paths

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1341,7 +2051,7 @@

    rclone config providers

    Options

      -h, --help   help for providers

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    @@ -1355,33 +2065,48 @@

    Synopsis

    Options

      -h, --help   help for reconnect

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    + +

    rclone config redacted

    +

    Print redacted (decrypted) config file, or the redacted config for a single remote.

    +

    Synopsis

    +

    This prints a redacted copy of the config file, either the whole config file or for a given remote.

    +

    The config file will be redacted by replacing all passwords and other sensitive info with XXX.

    +

    This makes the config file suitable for posting online for support.

    +

    It should be double checked before posting as the redaction may not be perfect.

    +
    rclone config redacted [<remote>] [flags]
    +

    Options

    +
      -h, --help   help for redacted
    +

    See the global flags page for global options not listed here.

    +

    SEE ALSO

    rclone config show

    Print (decrypted) config file, or the config for a single remote.

    rclone config show [<remote>] [flags]
    -

    Options

    +

    Options

      -h, --help   help for show

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone config touch

    Ensure configuration file exists.

    rclone config touch [flags]
    -

    Options

    +

    Options

      -h, --help   help for touch

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone config update

    Update options in an existing remote.

    -

    Synopsis

    +

    Synopsis

    Update an existing remote's options. The options should be passed in pairs of key value or as key=value.

    For example, to update the env_auth field of a remote of name myremote you would do:

    rclone config update myremote env_auth true
    @@ -1436,7 +2161,7 @@ 

    Synopsis

    If --all is passed then rclone will ask all the config questions, not just the post config questions. Any parameters are used as defaults for questions as usual.

    Note that bin/config.py in the rclone source implements this protocol as a readable demonstration.

    rclone config update name [key value]+ [flags]
    -

    Options

    +

    Options

          --all               Ask the full set of config questions
           --continue          Continue the configuration process with an answer
       -h, --help              help for update
    @@ -1446,26 +2171,26 @@ 

    Options

    --result string Result - use with --continue --state string State - use with --continue

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone config userinfo

    Prints info about logged in user of remote.

    -

    Synopsis

    +

    Synopsis

    This prints the details of the person logged in to the cloud storage system.

    rclone config userinfo remote: [flags]
    -

    Options

    +

    Options

      -h, --help   help for userinfo
           --json   Format output as JSON

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone copyto

    Copy files from source to dest, skipping identical files.

    -

    Synopsis

    +

    Synopsis

    If source:path is a file or directory then it copies it to a file or directory named dest:path.

    This can be used to upload single files to other than their current name. If the source is a directory then it acts exactly like the copy command.

    So

    @@ -1480,37 +2205,108 @@

    Synopsis

    This doesn't transfer files that are identical on src and dst, testing by size and modification time or MD5SUM. It doesn't delete files from the destination.

    Note: Use the -P/--progress flag to view real-time transfer statistics

    rclone copyto source:path dest:path [flags]
    -

    Options

    +

    Options

      -h, --help   help for copyto
    +

    Copy Options

    +

    Flags for anything which can Copy a file.

    +
          --check-first                                 Do all the checks before starting transfers
    +  -c, --checksum                                    Check for changes with size & checksum (if available, or fallback to size only).
    +      --compare-dest stringArray                    Include additional comma separated server-side paths during comparison
    +      --copy-dest stringArray                       Implies --compare-dest but also copies files from paths into destination
    +      --cutoff-mode HARD|SOFT|CAUTIOUS              Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD)
    +      --ignore-case-sync                            Ignore case when synchronizing
    +      --ignore-checksum                             Skip post copy check of checksums
    +      --ignore-existing                             Skip all files that exist on destination
    +      --ignore-size                                 Ignore size when skipping use modtime or checksum
    +  -I, --ignore-times                                Don't skip files that match size and time - transfer all files
    +      --immutable                                   Do not modify files, fail if existing files have been modified
    +      --inplace                                     Download directly to destination file instead of atomic download to temp/rename
    +      --max-backlog int                             Maximum number of objects in sync or check backlog (default 10000)
    +      --max-duration Duration                       Maximum duration rclone will transfer data for (default 0s)
    +      --max-transfer SizeSuffix                     Maximum size of data to transfer (default off)
    +  -M, --metadata                                    If set, preserve metadata when copying objects
    +      --modify-window Duration                      Max time diff to be considered the same (default 1ns)
    +      --multi-thread-chunk-size SizeSuffix          Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi)
    +      --multi-thread-cutoff SizeSuffix              Use multi-thread downloads for files above this size (default 256Mi)
    +      --multi-thread-streams int                    Number of streams to use for multi-thread downloads (default 4)
    +      --multi-thread-write-buffer-size SizeSuffix   In memory buffer size for writing when in multi-thread mode (default 128Ki)
    +      --no-check-dest                               Don't check the destination, copy regardless
    +      --no-traverse                                 Don't traverse destination file system on copy
    +      --no-update-modtime                           Don't update destination modtime if files identical
    +      --order-by string                             Instructions on how to order the transfers, e.g. 'size,descending'
    +      --partial-suffix string                       Add partial-suffix to temporary file name when --inplace is not used (default ".partial")
    +      --refresh-times                               Refresh the modtime of remote files
    +      --server-side-across-configs                  Allow server-side operations (e.g. copy) to work across different configs
    +      --size-only                                   Skip based on size only, not modtime or checksum
    +      --streaming-upload-cutoff SizeSuffix          Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
    +  -u, --update                                      Skip files that are newer on the destination
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone copyurl

    Copy url content to dest.

    -

    Synopsis

    +

    Synopsis

    Download a URL's content and copy it to the destination without saving it in temporary storage.

    Setting --auto-filename will attempt to automatically determine the filename from the URL (after any redirections) and used in the destination path. With --auto-filename-header in addition, if a specific filename is set in HTTP headers, it will be used instead of the name from the URL. With --print-filename in addition, the resulting file name will be printed.

    Setting --no-clobber will prevent overwriting file on the destination if there is one with the same name.

    Setting --stdout or making the output file name - will cause the output to be written to standard output.

    rclone copyurl https://example.com dest:path [flags]
    -

    Options

    +

    Options

      -a, --auto-filename     Get the file name from the URL and use it for destination file path
           --header-filename   Get the file name from the Content-Disposition header
       -h, --help              help for copyurl
           --no-clobber        Prevent overwriting file with same name
       -p, --print-filename    Print the resulting name from --auto-filename
           --stdout            Write the output to stdout rather than a file
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone cryptcheck

    -

    Cryptcheck checks the integrity of a crypted remote.

    -

    Synopsis

    -

    rclone cryptcheck checks a remote against a crypted remote. This is the equivalent of running rclone check, but able to check the checksums of the crypted remote.

    +

    Cryptcheck checks the integrity of an encrypted remote.

    +

    Synopsis

    +

    rclone cryptcheck checks a remote against a crypted remote. This is the equivalent of running rclone check, but able to check the checksums of the encrypted remote.

    For it to work the underlying remote of the cryptedremote must support some kind of checksum.

    It works by reading the nonce from each file on the cryptedremote: and using that to encrypt each file on the remote:. It then checks the checksum of the underlying file on the cryptedremote: against the checksum of the file it has just encrypted.

    Use it like this

    @@ -1528,8 +2324,9 @@

    Synopsis

  • `* path` means path was present in source and destination but different.
  • ! path means there was an error reading or hashing the source or dest.
  • +

    The default number of parallel checks is 8. See the --checkers=N option for more information.

    rclone cryptcheck remote:path cryptedremote:path [flags]
    -

    Options

    +

    Options

          --combined string         Make a combined report of changes to this file
           --differ string           Report all non-matching files to this file
           --error string            Report all files with errors (hashing or reading) to this file
    @@ -1538,14 +2335,45 @@ 

    Options

    --missing-on-dst string Report all files missing from the destination to this file --missing-on-src string Report all files missing from the source to this file --one-way Check one way only, source files must exist on remote
    +

    Check Options

    +

    Flags used for rclone check.

    +
          --max-backlog int   Maximum number of objects in sync or check backlog (default 10000)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone cryptdecode

    Cryptdecode returns unencrypted file names.

    -

    Synopsis

    +

    Synopsis

    rclone cryptdecode returns unencrypted file names when provided with a list of encrypted file names. List limit is 10 items.

    If you supply the --reverse flag, it will return encrypted file names.

    use it like this

    @@ -1554,34 +2382,39 @@

    Synopsis

    rclone cryptdecode --reverse encryptedremote: filename1 filename2

    Another way to accomplish this is by using the rclone backend encode (or decode) command. See the documentation on the crypt overlay for more info.

    rclone cryptdecode encryptedremote: encryptedfilename [flags]
    -

    Options

    +

    Options

      -h, --help      help for cryptdecode
           --reverse   Reverse cryptdecode, encrypts filenames

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone deletefile

    Remove a single file from remote.

    -

    Synopsis

    +

    Synopsis

    Remove a single file from remote. Unlike delete it cannot be used to remove a directory and it doesn't obey include/exclude filters - if the specified file exists, it will always be removed.

    rclone deletefile remote:path [flags]
    -

    Options

    +

    Options

      -h, --help   help for deletefile
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone genautocomplete

    Output completion script for a given shell.

    -

    Synopsis

    +

    Synopsis

    Generates a shell completion script for rclone. Run with --help to list the supported shells.

    -

    Options

    +

    Options

      -h, --help   help for genautocomplete

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone genautocomplete bash

    Output bash completion script for rclone.

    -

    Synopsis

    +

    Synopsis

    Generates a bash shell autocompletion script for rclone.

    This writes to /etc/bash_completion.d/rclone by default so will probably need to be run with sudo or as root, e.g.

    sudo rclone genautocomplete bash
    @@ -1599,16 +2432,16 @@

    Synopsis

    If you supply a command line argument the script will be written there.

    If output_file is "-", then the output will be written to stdout.

    rclone genautocomplete bash [output_file] [flags]
    -

    Options

    +

    Options

      -h, --help   help for bash

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone genautocomplete fish

    Output fish completion script for rclone.

    -

    Synopsis

    +

    Synopsis

    Generates a fish autocompletion script for rclone.

    This writes to /etc/fish/completions/rclone.fish by default so will probably need to be run with sudo or as root, e.g.

    sudo rclone genautocomplete fish
    @@ -1617,16 +2450,16 @@

    Synopsis

    If you supply a command line argument the script will be written there.

    If output_file is "-", then the output will be written to stdout.

    rclone genautocomplete fish [output_file] [flags]
    -

    Options

    +

    Options

      -h, --help   help for fish

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone genautocomplete zsh

    Output zsh completion script for rclone.

    -

    Synopsis

    +

    Synopsis

    Generates a zsh autocompletion script for rclone.

    This writes to /usr/share/zsh/vendor-completions/_rclone by default so will probably need to be run with sudo or as root, e.g.

    sudo rclone genautocomplete zsh
    @@ -1635,28 +2468,28 @@

    Synopsis

    If you supply a command line argument the script will be written there.

    If output_file is "-", then the output will be written to stdout.

    rclone genautocomplete zsh [output_file] [flags]
    -

    Options

    +

    Options

      -h, --help   help for zsh

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone gendocs

    Output markdown docs for rclone to the directory supplied.

    -

    Synopsis

    +

    Synopsis

    This produces markdown docs for the rclone commands to the directory supplied. These are in a format suitable for hugo to render into the rclone.org website.

    rclone gendocs output_directory [flags]
    -

    Options

    +

    Options

      -h, --help   help for gendocs

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone hashsum

    Produces a hashsum file for all the objects in the path.

    -

    Synopsis

    +

    Synopsis

    Produces a hash file for all the objects in the path using the hash named. The output is in the same format as the standard md5sum/sha1sum tool.

    By default, the hash is requested from the remote. If the hash is not supported by the remote, no hash will be returned. With the download flag, the file will be downloaded from the remote and hashed locally enabling any hash for any remote.

    For the MD5 and SHA1 algorithms there are also dedicated commands, md5sum and sha1sum.

    @@ -1668,29 +2501,53 @@

    Synopsis

    * sha1 * whirlpool * crc32 - * sha256 - * dropbox - * hidrive - * mailru - * quickxor + * sha256

    Then

    $ rclone hashsum MD5 remote:path

    Note that hash names are case insensitive and values are output in lower case.

    -
    rclone hashsum <hash> remote:path [flags]
    -

    Options

    +
    rclone hashsum [<hash> remote:path] [flags]
    +

    Options

          --base64               Output base64 encoded hashsum
       -C, --checkfile string     Validate hashes against a given SUM file instead of printing them
           --download             Download the file and hash it locally; if this flag is not specified, the hash is requested from the remote
       -h, --help                 help for hashsum
           --output-file string   Output hashsums to a file rather than the terminal
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone link

    Generate public link to file/folder.

    -

    Synopsis

    +

    Synopsis

    rclone link will create, retrieve or remove a public link to the given file or folder.

    rclone link remote:path/to/file
     rclone link remote:path/to/folder/
    @@ -1700,32 +2557,32 @@ 

    Synopsis

    Use the --unlink flag to remove existing public links to the file or folder. Note not all backends support "--unlink" flag - those that don't will just ignore it.

    If successful, the last line of the output will contain the link. Exact capabilities depend on the remote, but the link will always by default be created with the least constraints – e.g. no expiry, no password protection, accessible without account.

    rclone link remote:path [flags]
    -

    Options

    +

    Options

          --expire Duration   The amount of time that the link will be valid (default off)
       -h, --help              help for link
           --unlink            Remove existing public link to file/folder

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone listremotes

    -

    List all the remotes in the config file.

    -

    Synopsis

    +

    List all the remotes in the config file and defined in environment variables.

    +

    Synopsis

    rclone listremotes lists all the available remotes from the config file.

    When used with the --long flag it lists the types too.

    rclone listremotes [flags]
    -

    Options

    +

    Options

      -h, --help   help for listremotes
           --long   Show the type as well as names

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone lsf

    List directories and objects in remote:path formatted for parsing.

    -

    Synopsis

    +

    Synopsis

    List the contents of the source path (directories and objects) to standard output in a form which is easy to parse by scripts. By default this will just be the names of the objects and directories, one per line. The directories will have a / suffix.

    Eg

    $ rclone lsf swift:bucket
    @@ -1796,7 +2653,7 @@ 

    Synopsis

    The other list commands lsd,lsf,lsjson do not recurse by default - use -R to make them recurse.

    Listing a nonexistent directory will produce an error except for remotes which can't have empty directories (e.g. s3, swift, or gcs - the bucket-based remotes).

    rclone lsf remote:path [flags]
    -

    Options

    +

    Options

          --absolute           Put a leading / in front of path names
           --csv                Output in CSV format
       -d, --dir-slash          Append a slash to directory names (default true)
    @@ -1807,14 +2664,42 @@ 

    Options

    -h, --help help for lsf -R, --recursive Recurse into the listing -s, --separator string Separator for the items in the format (default ";")
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone lsjson

    List directories and objects in the path in JSON format.

    -

    Synopsis

    +

    Synopsis

    List directories and objects in the path in JSON format.

    The output is an array of Items, where each Item looks like this

    {
    @@ -1862,7 +2747,7 @@ 

    Synopsis

    The other list commands lsd,lsf,lsjson do not recurse by default - use -R to make them recurse.

    Listing a nonexistent directory will produce an error except for remotes which can't have empty directories (e.g. s3, swift, or gcs - the bucket-based remotes).

    rclone lsjson remote:path [flags]
    -

    Options

    +

    Options

          --dirs-only               Show only directories in the listing
           --encrypted               Show the encrypted names
           --files-only              Show only files in the listing
    @@ -1875,14 +2760,42 @@ 

    Options

    --original Show the ID of the underlying Object -R, --recursive Recurse into the listing --stat Just return the info for the pointed to file
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone mount

    Mount the remote as file system on a mountpoint.

    -

    Synopsis

    +

    Synopsis

    rclone mount allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's cloud storage systems as a file system with FUSE.

    First set up your remote using rclone config. Check it works with rclone ls etc.

    On Linux and macOS, you can run mount in either foreground or background (aka daemon) mode. Mount runs in foreground mode by default. Use the --daemon flag to force background mode. On Windows you can run mount in foreground only, the flag is ignored.

    @@ -1943,7 +2856,14 @@

    Windows caveats

    It is also possible to make a drive mount available to everyone on the system, by running the process creating it as the built-in SYSTEM account. There are several ways to do this: One is to use the command-line utility PsExec, from Microsoft's Sysinternals suite, which has option -s to start processes as the SYSTEM account. Another alternative is to run the mount command from a Windows Scheduled Task, or a Windows Service, configured to run as the SYSTEM account. A third alternative is to use the WinFsp.Launcher infrastructure). Read more in the install documentation. Note that when running rclone as another user, it will not use the configuration file from your profile unless you tell it to with the --config option. Note also that it is now the SYSTEM account that will have the owner permissions, and other accounts will have permissions according to the group or others scopes. As mentioned above, these will then not get the "write extended attributes" permission, and this may prevent writing to files. You can work around this with the FileSecurity option, see example above.

    Note that mapping to a directory path, instead of a drive letter, does not suffer from the same limitations.

    Mounting on macOS

    -

    Mounting on macOS can be done either via macFUSE (also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server.

    +

    Mounting on macOS can be done either via built-in NFS server, macFUSE (also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server.

    +

    NFS mount

    +

    This method spins up an NFS server using serve nfs command and mounts it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to send SIGTERM signal to the rclone process using |kill| command to stop the mount.

    +

    macFUSE Notes

    +

    If installing macFUSE using dmg packages from the website, rclone will locate the macFUSE libraries without any further intervention. If however, macFUSE is installed using the macports package manager, the following addition steps are required.

    +
    sudo mkdir /usr/local/lib
    +cd /usr/local/lib
    +sudo ln -s /opt/local/lib/libfuse.2.dylib

    FUSE-T Limitations, Caveats, and Notes

    There are some limitations, caveats, and notes about how it works. These are current as of FUSE-T version 1.0.14.

    ModTime update on read

    @@ -1958,7 +2878,7 @@

    Unicode Normalization

    Read Only mounts

    When mounting with --read-only, attempts to write to files will fail silently as opposed to with a clear warning as in macFUSE.

    Limitations

    -

    Without the use of --vfs-cache-mode this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without --vfs-cache-mode writes or --vfs-cache-mode full. See the VFS File Caching section for more info.

    +

    Without the use of --vfs-cache-mode this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without --vfs-cache-mode writes or --vfs-cache-mode full. See the VFS File Caching section for more info. When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| the mount point will be read-only.

    The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty directories will have a tendency to disappear once they fall out of the directory cache.

    When rclone mount is invoked on Unix with --daemon flag, the main rclone program will wait for the background mount to become ready or until the timeout specified by the --daemon-wait flag. On Linux it can check mount status using ProcFS so the flag in fact sets maximum time to wait, while the real wait can be less. On macOS / BSD the time to wait is constant and the check is performed only at the end. We advise you to set wait time on macOS reasonably.

    Only supported on Linux, FreeBSD, OS X and Windows at the moment.

    @@ -1985,17 +2905,16 @@

    Rclone as Unix mount helper

    or create systemd mount units:

    # /etc/systemd/system/mnt-data.mount
     [Unit]
    -After=network-online.target
    +Description=Mount for /mnt/data
     [Mount]
     Type=rclone
     What=sftp1:subdir
     Where=/mnt/data
    -Options=rw,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone
    +Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone

    optionally accompanied by systemd automount unit

    # /etc/systemd/system/mnt-data.automount
     [Unit]
    -After=network-online.target
    -Before=remote-fs.target
    +Description=AutoMount for /mnt/data
     [Automount]
     Where=/mnt/data
     TimeoutIdleSec=600
    @@ -2011,9 +2930,8 @@ 

    Rclone as Unix mount helper

  • command=cmount can be used to run cmount or any other rclone command rather than the default mount.
  • args2env will pass mount options to the mount helper running in background via environment variables instead of command line arguments. This allows to hide secrets from such commands as ps or pgrep.
  • vv... will be transformed into appropriate --verbose=N
  • -
  • standard mount options like x-systemd.automount, _netdev, nosuid and alike are intended only for Automountd and ignored by rclone.
  • +
  • standard mount options like x-systemd.automount, _netdev, nosuid and alike are intended only for Automountd and ignored by rclone. ## VFS - Virtual File System
  • -

    VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -2037,16 +2955,18 @@

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    -
    --cache-dir string                   Directory rclone will use for caching.
    ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
    ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
    ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
    ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
    ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    -

    If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    @@ -2129,7 +3049,7 @@

    Alternate report of used bytes

    Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

    WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

    rclone mount remote:path /path/to/mountpoint [flags]
    -

    Options

    +

    Options

          --allow-non-empty                        Allow mounting over a non-empty directory (not supported on Windows)
           --allow-other                            Allow access to other users (not supported on Windows)
           --allow-root                             Allow access to root user (not supported on Windows)
    @@ -2148,6 +3068,7 @@ 

    Options

    --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for mount --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -2159,8 +3080,9 @@

    Options

    --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -2170,19 +3092,44 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) --volname string Set the volume name (supported on Windows and OSX only) --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone moveto

    Move file or directory from source to dest.

    -

    Synopsis

    +

    Synopsis

    If source:path is a file or directory then it moves it to a file or directory named dest:path.

    This can be used to rename files or upload single files to other than their existing name. If the source is a directory then it acts exactly like the move command.

    So

    @@ -2198,16 +3145,82 @@

    Synopsis

    Important: Since this can cause data loss, test first with the --dry-run or the --interactive/-i flag.

    Note: Use the -P/--progress flag to view real-time transfer statistics.

    rclone moveto source:path dest:path [flags]
    -

    Options

    +

    Options

      -h, --help   help for moveto
    +

    Copy Options

    +

    Flags for anything which can Copy a file.

    +
          --check-first                                 Do all the checks before starting transfers
    +  -c, --checksum                                    Check for changes with size & checksum (if available, or fallback to size only).
    +      --compare-dest stringArray                    Include additional comma separated server-side paths during comparison
    +      --copy-dest stringArray                       Implies --compare-dest but also copies files from paths into destination
    +      --cutoff-mode HARD|SOFT|CAUTIOUS              Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD)
    +      --ignore-case-sync                            Ignore case when synchronizing
    +      --ignore-checksum                             Skip post copy check of checksums
    +      --ignore-existing                             Skip all files that exist on destination
    +      --ignore-size                                 Ignore size when skipping use modtime or checksum
    +  -I, --ignore-times                                Don't skip files that match size and time - transfer all files
    +      --immutable                                   Do not modify files, fail if existing files have been modified
    +      --inplace                                     Download directly to destination file instead of atomic download to temp/rename
    +      --max-backlog int                             Maximum number of objects in sync or check backlog (default 10000)
    +      --max-duration Duration                       Maximum duration rclone will transfer data for (default 0s)
    +      --max-transfer SizeSuffix                     Maximum size of data to transfer (default off)
    +  -M, --metadata                                    If set, preserve metadata when copying objects
    +      --modify-window Duration                      Max time diff to be considered the same (default 1ns)
    +      --multi-thread-chunk-size SizeSuffix          Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi)
    +      --multi-thread-cutoff SizeSuffix              Use multi-thread downloads for files above this size (default 256Mi)
    +      --multi-thread-streams int                    Number of streams to use for multi-thread downloads (default 4)
    +      --multi-thread-write-buffer-size SizeSuffix   In memory buffer size for writing when in multi-thread mode (default 128Ki)
    +      --no-check-dest                               Don't check the destination, copy regardless
    +      --no-traverse                                 Don't traverse destination file system on copy
    +      --no-update-modtime                           Don't update destination modtime if files identical
    +      --order-by string                             Instructions on how to order the transfers, e.g. 'size,descending'
    +      --partial-suffix string                       Add partial-suffix to temporary file name when --inplace is not used (default ".partial")
    +      --refresh-times                               Refresh the modtime of remote files
    +      --server-side-across-configs                  Allow server-side operations (e.g. copy) to work across different configs
    +      --size-only                                   Skip based on size only, not modtime or checksum
    +      --streaming-upload-cutoff SizeSuffix          Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
    +  -u, --update                                      Skip files that are newer on the destination
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone ncdu

    Explore a remote with a text based user interface.

    -

    Synopsis

    +

    Synopsis

    This displays a text based user interface allowing the navigation of a remote. It is most useful for answering the question - "What is using all my disk space?".

    To make the user interface it first scans the entire remote given and builds an in memory representation. rclone ncdu can be used during this scanning phase and you will see it building up the directory structure as it goes along.

    You can interact with the user interface using key presses, press '?' to toggle the help on and off. The supported keys are:

    @@ -2227,6 +3240,7 @@

    Synopsis

    y copy current path to clipboard Y display current path ^L refresh screen (fix screen corruption) + r recalculate file sizes ? to toggle help on and off q/ESC/^c to quit

    Listed files/directories may be prefixed by a one-character flag, some of them combined with a description in brackets at end of line. These flags have the following meaning:

    @@ -2244,16 +3258,44 @@

    Synopsis

    Note that it might take some time to delete big files/directories. The UI won't respond in the meantime since the deletion is done synchronously.

    For a non-interactive listing of the remote, see the tree command. To just get the total size of the remote you can also use the size command.

    rclone ncdu remote:path [flags]
    -

    Options

    +

    Options

      -h, --help   help for ncdu
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing Options

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone obscure

    Obscure password for use in the rclone config file.

    -

    Synopsis

    +

    Synopsis

    In the rclone config file, human-readable passwords are obscured. Obscuring them is done by encrypting them and writing them out in base64. This is not a secure way of encrypting these passwords as rclone can decrypt them - it is to prevent "eyedropping" - namely someone seeing a password in the rclone config file by accident.

    Many equally important things (like access tokens) are not obscured in the config file. However it is very hard to shoulder surf a 64 character hex token.

    This command can also accept a password through STDIN instead of an argument by passing a hyphen as an argument. This will use the first line of STDIN as the password not including the trailing newline.

    @@ -2261,16 +3303,16 @@

    Synopsis

    If there is no data on STDIN to read, rclone obscure will default to obfuscating the hyphen itself.

    If you want to encrypt the config file then please use config file encryption - see rclone config for more info.

    rclone obscure password [flags]
    -

    Options

    +

    Options

      -h, --help   help for obscure

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone rc

    Run a command against a running rclone.

    -

    Synopsis

    +

    Synopsis

    This runs a command against a running rclone. Use the --url flag to specify an non default URL to connect on. This can be either a ":port" which is taken to mean "http://localhost:port" or a "host:port" which is taken to mean "http://host:port"

    A username and password can be passed in with --user and --pass.

    Note that --rc-addr, --rc-user, --rc-pass will be read also for --url, --user, --pass.

    @@ -2289,7 +3331,7 @@

    Synopsis

    rclone rc --loopback operations/about fs=/

    Use rclone rc to see a list of all possible commands.

    rclone rc commands parameter [flags]
    -

    Options

    +

    Options

      -a, --arg stringArray   Argument placed in the "arg" array
       -h, --help              help for rc
           --json string       Input JSON - use instead of key=value args
    @@ -2300,13 +3342,13 @@ 

    Options

    --url string URL to connect to rclone remote control (default "http://localhost:5572/") --user string Username to use to rclone remote control

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone rcat

    Copies standard input to file on remote.

    -

    Synopsis

    +

    Synopsis

    rclone rcat reads from standard input (stdin) and copies it to a single remote file.

    echo "hello world" | rclone rcat remote:path/to/file
     ffmpeg - | rclone rcat remote:path/to/file
    @@ -2314,37 +3356,42 @@

    Synopsis

    rcat will try to upload small files in a single request, which is usually more efficient than the streaming/chunked upload endpoints, which use multiple requests. Exact behaviour depends on the remote. What is considered a small file may be set through --streaming-upload-cutoff. Uploading only starts after the cutoff is reached or if the file ends before that. The data must fit into RAM. The cutoff needs to be small enough to adhere the limits of your remote, please see there. Generally speaking, setting this cutoff too high will decrease your performance.

    Use the --size flag to preallocate the file in advance at the remote end and actually stream it, even if remote backend doesn't support streaming.

    --size should be the exact size of the input stream in bytes. If the size of the stream is different in length to the --size passed in then the transfer will likely fail.

    -

    Note that the upload can also not be retried because the data is not kept around until the upload succeeds. If you need to transfer a lot of data, you're better off caching locally and then rclone move it to the destination.

    +

    Note that the upload cannot be retried because the data is not stored. If the backend supports multipart uploading then individual chunks can be retried. If you need to transfer a lot of data, you may be better off caching it locally and then rclone move it to the destination which can use retries.

    rclone rcat remote:path [flags]
    -

    Options

    +

    Options

      -h, --help       help for rcat
           --size int   File size hint to preallocate (default -1)
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone rcd

    Run rclone listening to remote control commands only.

    -

    Synopsis

    +

    Synopsis

    This runs rclone so that it only listens to remote control commands.

    This is useful if you are controlling rclone via the rc API.

    If you pass in a path to a directory, rclone will serve that directory for GET requests on the URL passed in. It will also open the URL in the browser when rclone is run.

    See the rc documentation for more info on the rc flags.

    Server options

    -

    Use --addr to specify which IP address and port the server should listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

    -

    If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

    +

    Use --rc-addr to specify which IP address and port the server should listen on, eg --rc-addr 1.2.3.4:8000 or --rc-addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

    +

    If you set --rc-addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

    You can use a unix socket by setting the url to unix:///path/to/socket or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions.

    -

    --addr may be repeated to listen on multiple IPs/ports/sockets.

    -

    --server-read-timeout and --server-write-timeout can be used to control the timeouts on the server. Note that this is the total time for a transfer.

    -

    --max-header-bytes controls the maximum number of bytes the server will accept in the HTTP header.

    -

    --baseurl controls the URL prefix that rclone serves from. By default rclone will serve from the root. If you used --baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading and trailing "/" on --baseurl, so --baseurl "rclone", --baseurl "/rclone" and --baseurl "/rclone/" are all treated identically.

    +

    --rc-addr may be repeated to listen on multiple IPs/ports/sockets.

    +

    --rc-server-read-timeout and --rc-server-write-timeout can be used to control the timeouts on the server. Note that this is the total time for a transfer.

    +

    --rc-max-header-bytes controls the maximum number of bytes the server will accept in the HTTP header.

    +

    --rc-baseurl controls the URL prefix that rclone serves from. By default rclone will serve from the root. If you used --rc-baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading and trailing "/" on --rc-baseurl, so --rc-baseurl "rclone", --rc-baseurl "/rclone" and --rc-baseurl "/rclone/" are all treated identically.

    TLS (SSL)

    -

    By default this will serve over http. If you want you can serve over https. You will need to supply the --cert and --key flags. If you wish to do client side certificate validation then you will need to supply --client-ca also.

    -

    --cert should be a either a PEM encoded certificate or a concatenation of that with the CA certificate. --key should be the PEM encoded private key and --client-ca should be the PEM encoded client certificate authority certificate.

    -

    --min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0").

    +

    By default this will serve over http. If you want you can serve over https. You will need to supply the --rc-cert and --rc-key flags. If you wish to do client side certificate validation then you will need to supply --rc-client-ca also.

    +

    --rc-cert should be a either a PEM encoded certificate or a concatenation of that with the CA certificate. --krc-ey should be the PEM encoded private key and --rc-client-ca should be the PEM encoded client certificate authority certificate.

    +

    --rc-min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0").

    Template

    -

    --template allows a user to specify a custom markup template for HTTP and WebDAV serve functions. The server exports the following markup to be used within the template to server pages:

    +

    --rc-template allows a user to specify a custom markup template for HTTP and WebDAV serve functions. The server exports the following markup to be used within the template to server pages:

    @@ -2423,54 +3470,122 @@

    Template

    +

    The server also makes the following functions available so that they can be used within the template. These functions help extend the options for dynamic rendering of HTML. They can be used to render HTML based on specific conditions.

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionDescription
    afterEpochReturns the time since the epoch for the given time.
    containsChecks whether a given substring is present or not in a given string.
    hasPrefixChecks whether the given string begins with the specified prefix.
    hasSuffixChecks whether the given string end with the specified suffix.

    Authentication

    By default this will serve files without needing a login.

    -

    You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags.

    -

    Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended.

    +

    You can either use an htpasswd file which can take lots of users, or set a single username and password with the --rc-user and --rc-pass flags.

    +

    If no static users are configured by either of the above methods, and client certificates are required by the --client-ca flag passed to the server, the client certificate common name will be considered as the username.

    +

    Use --rc-htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended.

    To create an htpasswd file:

    touch htpasswd
     htpasswd -B htpasswd user
     htpasswd -B htpasswd anotherUser

    The password file can be updated while rclone is running.

    -

    Use --realm to set the authentication realm.

    -

    Use --salt to change the password hashing salt from the default.

    +

    Use --rc-realm to set the authentication realm.

    +

    Use --rc-salt to change the password hashing salt from the default.

    rclone rcd <path to files to serve>* [flags]
    -

    Options

    +

    Options

      -h, --help   help for rcd
    +

    RC Options

    +

    Flags to control the Remote Control API.

    +
          --rc                                 Enable the remote control server
    +      --rc-addr stringArray                IPaddress:Port or :Port to bind server to (default [localhost:5572])
    +      --rc-allow-origin string             Origin which cross-domain request (CORS) can be executed from
    +      --rc-baseurl string                  Prefix for URLs - leave blank for root
    +      --rc-cert string                     TLS PEM key (concatenation of certificate and CA certificate)
    +      --rc-client-ca string                Client certificate authority to verify clients with
    +      --rc-enable-metrics                  Enable prometheus metrics on /metrics
    +      --rc-files string                    Path to local files to serve on the HTTP server
    +      --rc-htpasswd string                 A htpasswd file - if not provided no authentication is done
    +      --rc-job-expire-duration Duration    Expire finished async jobs older than this value (default 1m0s)
    +      --rc-job-expire-interval Duration    Interval to check for expired async jobs (default 10s)
    +      --rc-key string                      TLS PEM Private key
    +      --rc-max-header-bytes int            Maximum size of request header (default 4096)
    +      --rc-min-tls-version string          Minimum TLS version that is acceptable (default "tls1.0")
    +      --rc-no-auth                         Don't require auth for certain methods
    +      --rc-pass string                     Password for authentication
    +      --rc-realm string                    Realm for authentication
    +      --rc-salt string                     Password hashing salt (default "dlPL2MqE")
    +      --rc-serve                           Enable the serving of remote objects
    +      --rc-server-read-timeout Duration    Timeout for server reading data (default 1h0m0s)
    +      --rc-server-write-timeout Duration   Timeout for server writing data (default 1h0m0s)
    +      --rc-template string                 User-specified template
    +      --rc-user string                     User name for authentication
    +      --rc-web-fetch-url string            URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest")
    +      --rc-web-gui                         Launch WebGUI on localhost
    +      --rc-web-gui-force-update            Force update to latest version of web gui
    +      --rc-web-gui-no-open-browser         Don't open the browser automatically
    +      --rc-web-gui-update                  Check and update to latest version of web gui

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone rmdirs

    Remove empty directories under the path.

    -

    Synopsis

    +

    Synopsis

    This recursively removes any empty directories (including directories that only contain empty directories), that it finds under the path. The root path itself will also be removed if it is empty, unless you supply the --leave-root flag.

    Use command rmdir to delete just the empty directory given by path, not recurse.

    This is useful for tidying up remotes that rclone has left a lot of empty directories in. For example the delete command will delete files but leave the directory structure (unless used with option --rmdirs).

    -

    To delete a path and any objects in it, use purge command.

    +

    This will delete --checkers directories concurrently so if you have thousands of empty directories consider increasing this number.

    +

    To delete a path and any objects in it, use the purge command.

    rclone rmdirs remote:path [flags]
    -

    Options

    +

    Options

      -h, --help         help for rmdirs
           --leave-root   Do not remove root directory if empty
    +

    Important Options

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone selfupdate

    Update the rclone binary.

    -

    Synopsis

    -

    This command downloads the latest release of rclone and replaces the currently running binary. The download is verified with a hashsum and cryptographically signed signature.

    +

    Synopsis

    +

    This command downloads the latest release of rclone and replaces the currently running binary. The download is verified with a hashsum and cryptographically signed signature; see the release signing docs for details.

    If used without flags (or with implied --stable flag), this command will install the latest stable release. However, some issues may be fixed (or features added) only in the latest beta release. In such cases you should run the command with the --beta flag, i.e. rclone selfupdate --beta. You can check in advance what version would be installed by adding the --check flag, then repeat the command without it when you are satisfied.

    Sometimes the rclone team may recommend you a concrete beta or stable rclone release to troubleshoot your issue or add a bleeding edge feature. The --version VER flag, if given, will update to the concrete version instead of the latest one. If you omit micro version from VER (for example 1.53), the latest matching micro version will be used.

    Upon successful update rclone will print a message that contains a previous version number. You will need it if you later decide to revert your update for some reason. Then you'll have to note the previous version and run the following command: rclone selfupdate [--beta] OLDVER. If the old version contains only dots and digits (for example v1.54.0) then it's a stable release so you won't need the --beta flag. Beta releases have an additional information similar to v1.54.0-beta.5111.06f1c0c61. (if you are a developer and use a locally built rclone, the version number will end with -DEV, you will have to rebuild it as it obviously can't be distributed).

    If you previously installed rclone via a package manager, the package may include local documentation or configure services. You may wish to update with the flag --package deb or --package rpm (whichever is correct for your OS) to update these too. This command with the default --package zip will update only the rclone executable so the local manual may become inaccurate after it.

    -

    The rclone mount command (https://rclone.org/commands/rclone_mount/) may or may not support extended FUSE options depending on the build and OS. selfupdate will refuse to update if the capability would be discarded.

    +

    The rclone mount command may or may not support extended FUSE options depending on the build and OS. selfupdate will refuse to update if the capability would be discarded.

    Note: Windows forbids deletion of a currently running executable so this command will rename the old executable to 'rclone.old.exe' upon success.

    Please note that this command was not available before rclone version 1.55. If it fails for you with the message unknown command "selfupdate" then you will need to update manually following the install instructions located at https://rclone.org/install/

    rclone selfupdate [flags]
    -

    Options

    +

    Options

          --beta             Install beta release
           --check            Check for latest release, do not download
       -h, --help             help for selfupdate
    @@ -2479,41 +3594,42 @@ 

    Options

    --stable Install stable release (this is the default) --version string Install the given rclone version (default: latest)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    • rclone - Show help for rclone commands, flags and backends.

    rclone serve

    Serve a remote over a protocol.

    -

    Synopsis

    +

    Synopsis

    Serve a remote over a given protocol. Requires the use of a subcommand to specify the protocol, e.g.

    rclone serve http remote:

    Each subcommand has its own options which you can see in their help.

    rclone serve <protocol> [opts] <remote> [flags]
    -

    Options

    +

    Options

      -h, --help   help for serve

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone serve dlna

    Serve remote:path over DLNA

    -

    Synopsis

    +

    Synopsis

    Run a DLNA media server for media stored in an rclone remote. Many devices, such as the Xbox and PlayStation, can automatically discover this server in the LAN and play audio/video from it. VLC is also supported. Service discovery uses UDP multicast packets (SSDP) and will thus only work on LANs.

    Rclone will list all files present in the remote, without filtering based on media formats or file extensions. Additionally, there is no media transcoding support. This means that some players might show files that they are not able to play back correctly.

    Server options

    Use --addr to specify which IP address and port the server should listen on, e.g. --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs.

    Use --name to choose the friendly server name, which is by default "rclone (hostname)".

    -

    Use --log-trace in conjunction with -vv to enable additional debug logging of all UPNP traffic.

    -

    VFS - Virtual File System

    +

    Use --log-trace in conjunction with -vv to enable additional debug logging of all UPNP traffic. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -2537,16 +3653,18 @@

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    -
    --cache-dir string                   Directory rclone will use for caching.
    ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
    ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
    ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
    ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
    ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    -

    If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    @@ -2629,7 +3747,7 @@

    Alternate report of used bytes

    Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

    WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

    rclone serve dlna remote:path [flags]
    -

    Options

    +

    Options

          --addr string                            The ip:port or :port to bind the DLNA http server to (default ":7879")
           --announce-interval Duration             The interval between SSDP announcements (default 12m0s)
           --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
    @@ -2647,8 +3765,9 @@ 

    Options

    --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -2658,25 +3777,49 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone serve docker

    Serve any remote on docker's volume plugin API.

    -

    Synopsis

    +

    Synopsis

    This command implements the Docker volume plugin API allowing docker to use rclone as a data storage mechanism for various cloud providers. rclone provides docker volume plugin based on it.

    To create a docker plugin, one must create a Unix or TCP socket that Docker will look for when you use the plugin and then it listens for commands from docker daemon and runs the corresponding code when necessary. Docker plugins can run as a managed plugin under control of the docker daemon or as an independent native service. For testing, you can just run it directly from the command line, for example:

    sudo rclone serve docker --base-dir /tmp/rclone-volumes --socket-addr localhost:8787 -vv

    Running rclone serve docker will create the said socket, listening for commands from Docker to create the necessary Volumes. Normally you need not give the --socket-addr flag. The API will listen on the unix domain socket at /run/docker/plugins/rclone.sock. In the example above rclone will create a TCP socket and a small file /etc/docker/plugins/rclone.spec containing the socket address. We use sudo because both paths are writeable only by the root user.

    If you later decide to change listening socket, the docker daemon must be restarted to reconnect to /run/docker/plugins/rclone.sock or parse new /etc/docker/plugins/rclone.spec. Until you restart, any volume related docker commands will timeout trying to access the old socket. Running directly is supported on Linux only, not on Windows or MacOS. This is not a problem with managed plugin mode described in details in the full documentation.

    The command will create volume mounts under the path given by --base-dir (by default /var/lib/docker-volumes/rclone available only to root) and maintain the JSON formatted file docker-plugin.state in the rclone cache directory with book-keeping records of created and mounted volumes.

    -

    All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity.

    -

    VFS - Virtual File System

    +

    All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -2700,16 +3843,18 @@

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    -
    --cache-dir string                   Directory rclone will use for caching.
    ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
    ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
    ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
    ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
    ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    -

    If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    @@ -2792,7 +3937,7 @@

    Alternate report of used bytes

    Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

    WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

    rclone serve docker [flags]
    -

    Options

    +

    Options

          --allow-non-empty                        Allow mounting over a non-empty directory (not supported on Windows)
           --allow-other                            Allow access to other users (not supported on Windows)
           --allow-root                             Allow access to root user (not supported on Windows)
    @@ -2813,6 +3958,7 @@ 

    Options

    --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for docker --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -2827,8 +3973,9 @@

    Options

    --socket-gid int GID for unix socket (default: current process GID) (default 1000) --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -2838,27 +3985,51 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) --volname string Set the volume name (supported on Windows and OSX only) --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone serve ftp

    Serve remote:path over FTP.

    -

    Synopsis

    +

    Synopsis

    Run a basic FTP server to serve a remote over FTP protocol. This can be viewed with a FTP client or you can make a remote of type FTP to read and write it.

    Server options

    Use --addr to specify which IP address and port the server should listen on, e.g. --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

    If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

    Authentication

    By default this will serve files without needing a login.

    -

    You can set a single username and password with the --user and --pass flags.

    -

    VFS - Virtual File System

    +

    You can set a single username and password with the --user and --pass flags. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -2882,16 +4053,18 @@

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    -
    --cache-dir string                   Directory rclone will use for caching.
    ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
    ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
    ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
    ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
    ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    -

    If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    @@ -3004,7 +4177,7 @@

    Auth Proxy

    Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

    This can be used to build general purpose proxies to any kind of backend that rclone supports.

    rclone serve ftp remote:path [flags]
    -

    Options

    +

    Options

          --addr string                            IPaddress:Port or :Port to bind server to (default "localhost:2121")
           --auth-proxy string                      A program to use to create the backend from the auth
           --cert string                            TLS PEM key (concatenation of certificate and CA certificate)
    @@ -3025,8 +4198,9 @@ 

    Options

    --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication (default "anonymous") - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -3036,17 +4210,42 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    rclone serve http

    Serve the remote over HTTP.

    -

    Synopsis

    +

    Synopsis

    Run a basic web server to serve a remote over HTTP. This can be viewed in a web browser or you can make a remote of type http read from it.

    You can use the filter flags (e.g. --include, --exclude) to control what is served.

    The server will log errors. Use -v to see access logs.

    @@ -3143,9 +4342,41 @@

    Template

    +

    The server also makes the following functions available so that they can be used within the template. These functions help extend the options for dynamic rendering of HTML. They can be used to render HTML based on specific conditions.

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionDescription
    afterEpochReturns the time since the epoch for the given time.
    containsChecks whether a given substring is present or not in a given string.
    hasPrefixChecks whether the given string begins with the specified prefix.
    hasSuffixChecks whether the given string end with the specified suffix.

    Authentication

    By default this will serve files without needing a login.

    You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags.

    +

    If no static users are configured by either of the above methods, and client certificates are required by the --client-ca flag passed to the server, the client certificate common name will be considered as the username.

    Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended.

    To create an htpasswd file:

    touch htpasswd
    @@ -3153,8 +4384,7 @@ 

    Authentication

    htpasswd -B htpasswd anotherUser

    The password file can be updated while rclone is running.

    Use --realm to set the authentication realm.

    -

    Use --salt to change the password hashing salt from the default.

    -

    VFS - Virtual File System

    +

    Use --salt to change the password hashing salt from the default. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -3178,16 +4408,18 @@

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    -
    --cache-dir string                   Directory rclone will use for caching.
    ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
    ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
    ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
    ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
    ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    -

    If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    @@ -3300,8 +4532,9 @@

    Auth Proxy

    Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

    This can be used to build general purpose proxies to any kind of backend that rclone supports.

    rclone serve http remote:path [flags]
    -

    Options

    +

    Options

          --addr stringArray                       IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
    +      --allow-origin string                    Origin which cross-domain request (CORS) can be executed from
           --auth-proxy string                      A program to use to create the backend from the auth
           --baseurl string                         Prefix for URLs - leave blank for root
           --cert string                            TLS PEM key (concatenation of certificate and CA certificate)
    @@ -3329,8 +4562,9 @@ 

    Options

    --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -3340,42 +4574,258 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    -

    rclone serve restic

    -

    Serve the remote for restic's REST API.

    -

    Synopsis

    -

    Run a basic web server to serve a remote over restic's REST backend API over HTTP. This allows restic to use rclone as a data storage mechanism for cloud providers that restic does not support directly.

    -

    Restic is a command-line program for doing backups.

    -

    The server will log errors. Use -v to see access logs.

    -

    --bwlimit will be respected for file transfers. Use --stats to control the stats printing.

    -

    Setting up rclone for use by restic

    -

    First set up a remote for your chosen cloud provider.

    -

    Once you have set up the remote, check it is working with, for example "rclone lsd remote:". You may have called the remote something other than "remote:" - just substitute whatever you called it in the following instructions.

    -

    Now start the rclone restic server

    -
    rclone serve restic -v remote:backup
    -

    Where you can replace "backup" in the above by whatever path in the remote you wish to use.

    -

    By default this will serve on "localhost:8080" you can change this with use of the --addr flag.

    -

    You might wish to start this server on boot.

    -

    Adding --cache-objects=false will cause rclone to stop caching objects returned from the List call. Caching is normally desirable as it speeds up downloading objects, saves transactions and uses very little memory.

    -

    Setting up restic to use rclone

    -

    Now you can follow the restic instructions on setting up restic.

    -

    Note that you will need restic 0.8.2 or later to interoperate with rclone.

    -

    For the example above you will want to use "http://localhost:8080/" as the URL for the REST server.

    -

    For example:

    -
    $ export RESTIC_REPOSITORY=rest:http://localhost:8080/
    -$ export RESTIC_PASSWORD=yourpassword
    -$ restic init
    -created restic backend 8b1a4b56ae at rest:http://localhost:8080/
    -
    -Please note that knowledge of your password is required to access
    -the repository. Losing your password means that your data is
    +

    rclone serve nfs

    +

    Serve the remote as an NFS mount

    +

    Synopsis

    +

    Create an NFS server that serves the given remote over the network.

    +

    The primary purpose for this command is to enable mount command on recent macOS versions where installing FUSE is very cumbersome.

    +

    Since this is running on NFSv3, no authentication method is available. Any client will be able to access the data. To limit access, you can use serve NFS on loopback address and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; meaning that it is only available to the local machine. If you want other machines to access the NFS mount over local network, you need to specify the listening address and port using --addr flag.

    +

    Modifying files through NFS protocol requires VFS caching. Usually you will need to specify --vfs-cache-mode in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, the mount will be read-only.

    +

    To serve NFS over the network use following command:

    +
    rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full
    +

    We specify a specific port that we can use in the mount command:

    +

    To mount the server under Linux/macOS, use the following command:

    +
    mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint
    +

    Where $PORT is the same port number we used in the serve nfs command.

    +

    This feature is only available on Unix platforms.

    +

    VFS - Virtual File System

    +

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    +

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    +

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    +

    VFS Directory Cache

    +

    Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

    +
    --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
    +--poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
    +

    However, changes made directly on the cloud storage by the web interface or a different copy of rclone will only be picked up once the directory cache expires if the backend configured does not support polling for changes. If the backend supports polling, changes will be picked up within the polling interval.

    +

    You can send a SIGHUP signal to rclone for it to flush all directory caches, regardless of how old they are. Assuming only one rclone instance is running, you can reset the cache like this:

    +
    kill -SIGHUP $(pidof rclone)
    +

    If you configure rclone with a remote control then you can use rclone rc to flush the whole directory cache:

    +
    rclone rc vfs/forget
    +

    Or individual files or directories:

    +
    rclone rc vfs/forget file=path/to/file dir=path/to/dir
    +

    VFS File Buffering

    +

    The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

    +

    Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

    +

    This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

    +

    The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

    +

    VFS File Caching

    +

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    +

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    +

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)
    +

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    +

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    +

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    +

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    +

    --vfs-cache-mode off

    +

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    +

    This will mean some operations are not possible

    +
      +
    • Files can't be opened for both read AND write
    • +
    • Files opened for write can't be seeked
    • +
    • Existing files opened for write must have O_TRUNC set
    • +
    • Files open for read with O_TRUNC will be opened write only
    • +
    • Files open for write only will behave as if O_TRUNC was supplied
    • +
    • Open modes O_APPEND, O_TRUNC are ignored
    • +
    • If an upload fails it can't be retried
    • +
    +

    --vfs-cache-mode minimal

    +

    This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

    +

    These operations are not possible

    +
      +
    • Files opened for write only can't be seeked
    • +
    • Existing files opened for write must have O_TRUNC set
    • +
    • Files opened for write only will ignore O_APPEND, O_TRUNC
    • +
    • If an upload fails it can't be retried
    • +
    +

    --vfs-cache-mode writes

    +

    In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

    +

    This mode should support all normal file system operations.

    +

    If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

    +

    --vfs-cache-mode full

    +

    In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

    +

    In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

    +

    So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

    +

    This mode should support all normal file system operations and is otherwise identical to --vfs-cache-mode writes.

    +

    When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

    +

    When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

    +

    IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

    +

    Fingerprinting

    +

    Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

    +
      +
    • size
    • +
    • modification time
    • +
    • hash
    • +
    +

    where available on an object.

    +

    On some backends some of these attributes are slow to read (they take an extra API call per object, or extra work per object).

    +

    For example hash is slow with the local and sftp backends as they have to read the entire file and hash it, and modtime is slow with the s3, swift, ftp and qinqstor backends because they need to do an extra API call to fetch it.

    +

    If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

    +

    If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

    +

    Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

    +

    VFS Chunked Reading

    +

    When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

    +

    These flags control the chunking:

    +
    --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
    +--vfs-read-chunk-size-limit SizeSuffix  Max chunk doubling size (default off)
    +

    Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

    +

    With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

    +

    Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

    +

    VFS Performance

    +

    These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

    +

    In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

    +
    --no-checksum     Don't compare checksums on up/download.
    +--no-modtime      Don't read/write the modification time (can speed things up).
    +--no-seek         Don't allow seeking in files.
    +--read-only       Only allow read-only access.
    +

    Sometimes rclone is delivered reads or writes out of order. Rather than seeking rclone will wait a short time for the in sequence read or write to come in. These flags only come into effect when not using an on disk cache file.

    +
    --vfs-read-wait duration   Time to wait for in-sequence read before seeking (default 20ms)
    +--vfs-write-wait duration  Time to wait for in-sequence write before giving error (default 1s)
    +

    When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

    +
    --transfers int  Number of file transfers to run in parallel (default 4)
    +

    VFS Case Sensitivity

    +

    Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

    +

    File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

    +

    Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

    +

    The --vfs-case-insensitive VFS flag controls how rclone handles these two cases. If its value is "false", rclone passes file names to the remote as-is. If the flag is "true" (or appears without a value on the command line), rclone may perform a "fixup" as explained below.

    +

    The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

    +

    Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

    +

    If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

    +

    VFS Disk Options

    +

    This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

    +
    --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
    +

    Alternate report of used bytes

    +

    Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

    +

    WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

    +
    rclone serve nfs remote:path [flags]
    +

    Options

    +
          --addr string                            IPaddress:Port or :Port to bind server to
    +      --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
    +      --dir-perms FileMode                     Directory permissions (default 0777)
    +      --file-perms FileMode                    File permissions (default 0666)
    +      --gid uint32                             Override the gid field set by the filesystem (not supported on Windows) (default 1000)
    +  -h, --help                                   help for nfs
    +      --no-checksum                            Don't compare checksums on up/download
    +      --no-modtime                             Don't read/write the modification time (can speed things up)
    +      --no-seek                                Don't allow seeking in files
    +      --poll-interval Duration                 Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)
    +      --read-only                              Only allow read-only access
    +      --uid uint32                             Override the uid field set by the filesystem (not supported on Windows) (default 1000)
    +      --umask int                              Override the permission bits set by the filesystem (not supported on Windows) (default 2)
    +      --vfs-cache-max-age Duration             Max time since last access of objects in the cache (default 1h0m0s)
    +      --vfs-cache-max-size SizeSuffix          Max total size of objects in the cache (default off)
    +      --vfs-cache-min-free-space SizeSuffix    Target minimum free space on the disk containing the cache (default off)
    +      --vfs-cache-mode CacheMode               Cache mode off|minimal|writes|full (default off)
    +      --vfs-cache-poll-interval Duration       Interval to poll the cache for stale objects (default 1m0s)
    +      --vfs-case-insensitive                   If a file name not found, find a case insensitive match
    +      --vfs-disk-space-total-size SizeSuffix   Specify the total space of disk (default off)
    +      --vfs-fast-fingerprint                   Use fast (less accurate) fingerprints for change detection
    +      --vfs-read-ahead SizeSuffix              Extra read ahead over --buffer-size when using cache-mode full
    +      --vfs-read-chunk-size SizeSuffix         Read the source objects in chunks (default 128Mi)
    +      --vfs-read-chunk-size-limit SizeSuffix   If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off)
    +      --vfs-read-wait Duration                 Time to wait for in-sequence read before seeking (default 20ms)
    +      --vfs-refresh                            Refreshes the directory cache recursively on start
    +      --vfs-used-is-size rclone size           Use the rclone size algorithm for Used size
    +      --vfs-write-back Duration                Time to writeback files after last use when using cache (default 5s)
    +      --vfs-write-wait Duration                Time to wait for in-sequence write before giving error (default 1s)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    See the global flags page for global options not listed here.

    +

    SEE ALSO

    + +

    rclone serve restic

    +

    Serve the remote for restic's REST API.

    +

    Synopsis

    +

    Run a basic web server to serve a remote over restic's REST backend API over HTTP. This allows restic to use rclone as a data storage mechanism for cloud providers that restic does not support directly.

    +

    Restic is a command-line program for doing backups.

    +

    The server will log errors. Use -v to see access logs.

    +

    --bwlimit will be respected for file transfers. Use --stats to control the stats printing.

    +

    Setting up rclone for use by restic

    +

    First set up a remote for your chosen cloud provider.

    +

    Once you have set up the remote, check it is working with, for example "rclone lsd remote:". You may have called the remote something other than "remote:" - just substitute whatever you called it in the following instructions.

    +

    Now start the rclone restic server

    +
    rclone serve restic -v remote:backup
    +

    Where you can replace "backup" in the above by whatever path in the remote you wish to use.

    +

    By default this will serve on "localhost:8080" you can change this with use of the --addr flag.

    +

    You might wish to start this server on boot.

    +

    Adding --cache-objects=false will cause rclone to stop caching objects returned from the List call. Caching is normally desirable as it speeds up downloading objects, saves transactions and uses very little memory.

    +

    Setting up restic to use rclone

    +

    Now you can follow the restic instructions on setting up restic.

    +

    Note that you will need restic 0.8.2 or later to interoperate with rclone.

    +

    For the example above you will want to use "http://localhost:8080/" as the URL for the REST server.

    +

    For example:

    +
    $ export RESTIC_REPOSITORY=rest:http://localhost:8080/
    +$ export RESTIC_PASSWORD=yourpassword
    +$ restic init
    +created restic backend 8b1a4b56ae at rest:http://localhost:8080/
    +
    +Please note that knowledge of your password is required to access
    +the repository. Losing your password means that your data is
     irrecoverably lost.
     $ restic backup /path/to/files/to/backup
     scan [/path/to/files/to/backup]
    @@ -3406,6 +4856,7 @@ 

    TLS (SSL)

    Authentication

    By default this will serve files without needing a login.

    You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags.

    +

    If no static users are configured by either of the above methods, and client certificates are required by the --client-ca flag passed to the server, the client certificate common name will be considered as the username.

    Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended.

    To create an htpasswd file:

    touch htpasswd
    @@ -3415,8 +4866,9 @@ 

    Authentication

    Use --realm to set the authentication realm.

    Use --salt to change the password hashing salt from the default.

    rclone serve restic remote:path [flags]
    -

    Options

    +

    Options

          --addr stringArray                IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
    +      --allow-origin string             Origin which cross-domain request (CORS) can be executed from
           --append-only                     Disallow deletion of repository data
           --baseurl string                  Prefix for URLs - leave blank for root
           --cache-objects                   Cache listed objects (default true)
    @@ -3436,32 +4888,84 @@ 

    Options

    --stdio Run an HTTP2 server on stdin/stdout --user string User name for authentication

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    -

    rclone serve sftp

    -

    Serve the remote over SFTP.

    -

    Synopsis

    -

    Run an SFTP server to serve a remote over SFTP. This can be used with an SFTP client or you can make a remote of type sftp to use with it.

    -

    You can use the filter flags (e.g. --include, --exclude) to control what is served.

    -

    The server will respond to a small number of shell commands, mainly md5sum, sha1sum and df, which enable it to provide support for checksums and the about feature when accessed from an sftp remote.

    -

    Note that this server uses standard 32 KiB packet payload size, which means you must not configure the client to expect anything else, e.g. with the chunk_size option on an sftp remote.

    -

    The server will log errors. Use -v to see access logs.

    -

    --bwlimit will be respected for file transfers. Use --stats to control the stats printing.

    -

    You must provide some means of authentication, either with --user/--pass, an authorized keys file (specify location with --authorized-keys - the default is the same as ssh), an --auth-proxy, or set the --no-auth flag for no authentication when logging in.

    -

    If you don't supply a host --key then rclone will generate rsa, ecdsa and ed25519 variants, and cache them for later use in rclone's cache directory (see rclone help flags cache-dir) in the "serve-sftp" directory.

    -

    By default the server binds to localhost:2022 - if you want it to be reachable externally then supply --addr :2022 for example.

    -

    Note that the default of --vfs-cache-mode off is fine for the rclone sftp backend, but it may not be with other SFTP clients.

    -

    If --stdio is specified, rclone will serve SFTP over stdio, which can be used with sshd via ~/.ssh/authorized_keys, for example:

    -
    restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ...
    -

    On the client you need to set --transfers 1 when using --stdio. Otherwise multiple instances of the rclone server are started by OpenSSH which can lead to "corrupted on transfer" errors. This is the case because the client chooses indiscriminately which server to send commands to while the servers all have different views of the state of the filing system.

    -

    The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from beeing used. Omitting "restrict" and using --sftp-path-override to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case.

    -

    VFS - Virtual File System

    +

    rclone serve s3

    +

    Serve remote:path over s3.

    +

    Synopsis

    +

    serve s3 implements a basic s3 server that serves a remote via s3. This can be viewed with an s3 client, or you can make an s3 type remote to read and write to it with rclone.

    +

    serve s3 is considered Experimental so use with care.

    +

    S3 server supports Signature Version 4 authentication. Just use --auth-key accessKey,secretKey and set the Authorization header correctly in the request. (See the AWS docs).

    +

    --auth-key can be repeated for multiple auth pairs. If --auth-key is not provided then serve s3 will allow anonymous access.

    +

    Please note that some clients may require HTTPS endpoints. See the SSL docs for more information.

    +

    This command uses the VFS directory cache. All the functionality will work with --vfs-cache-mode off. Using --vfs-cache-mode full (or writes) can be used to cache objects locally to improve performance.

    +

    Use --force-path-style=false if you want to use the bucket name as a part of the hostname (such as mybucket.local)

    +

    Use --etag-hash if you want to change the hash uses for the ETag. Note that using anything other than MD5 (the default) is likely to cause problems for S3 clients which rely on the Etag being the MD5.

    +

    Quickstart

    +

    For a simple set up, to serve remote:path over s3, run the server like this:

    +
    rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path
    +

    This will be compatible with an rclone remote which is defined like this:

    +
    [serves3]
    +type = s3
    +provider = Rclone
    +endpoint = http://127.0.0.1:8080/
    +access_key_id = ACCESS_KEY_ID
    +secret_access_key = SECRET_ACCESS_KEY
    +use_multipart_uploads = false
    +

    Note that setting disable_multipart_uploads = true is to work around a bug which will be fixed in due course.

    +

    Bugs

    +

    When uploading multipart files serve s3 holds all the parts in memory (see #7453). This is a limitaton of the library rclone uses for serving S3 and will hopefully be fixed at some point.

    +

    Multipart server side copies do not work (see #7454). These take a very long time and eventually fail. The default threshold for multipart server side copies is 5G which is the maximum it can be, so files above this side will fail to be server side copied.

    +

    For a current list of serve s3 bugs see the serve s3 bug category on GitHub.

    +

    Limitations

    +

    serve s3 will treat all directories in the root as buckets and ignore all files in the root. You can use CreateBucket to create folders under the root, but you can't create empty folders under other folders not in the root.

    +

    When using PutObject or DeleteObject, rclone will automatically create or clean up empty folders. If you don't want to clean up empty folders automatically, use --no-cleanup.

    +

    When using ListObjects, rclone will use / when the delimiter is empty. This reduces backend requests with no effect on most operations, but if the delimiter is something other than / and empty, rclone will do a full recursive search of the backend, which can take some time.

    +

    Versioning is not currently supported.

    +

    Metadata will only be saved in memory other than the rclone mtime metadata which will be set as the modification time of the file.

    +

    Supported operations

    +

    serve s3 currently supports the following operations.

    +
      +
    • Bucket +
        +
      • ListBuckets
      • +
      • CreateBucket
      • +
      • DeleteBucket
      • +
    • +
    • Object +
        +
      • HeadObject
      • +
      • ListObjects
      • +
      • GetObject
      • +
      • PutObject
      • +
      • DeleteObject
      • +
      • DeleteObjects
      • +
      • CreateMultipartUpload
      • +
      • CompleteMultipartUpload
      • +
      • AbortMultipartUpload
      • +
      • CopyObject
      • +
      • UploadPart
      • +
    • +
    +

    Other operations will return error Unimplemented.

    +

    Server options

    +

    Use --addr to specify which IP address and port the server should listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

    +

    If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

    +

    You can use a unix socket by setting the url to unix:///path/to/socket or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions.

    +

    --addr may be repeated to listen on multiple IPs/ports/sockets.

    +

    --server-read-timeout and --server-write-timeout can be used to control the timeouts on the server. Note that this is the total time for a transfer.

    +

    --max-header-bytes controls the maximum number of bytes the server will accept in the HTTP header.

    +

    --baseurl controls the URL prefix that rclone serves from. By default rclone will serve from the root. If you used --baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading and trailing "/" on --baseurl, so --baseurl "rclone", --baseurl "/rclone" and --baseurl "/rclone/" are all treated identically.

    +

    TLS (SSL)

    +

    By default this will serve over http. If you want you can serve over https. You will need to supply the --cert and --key flags. If you wish to do client side certificate validation then you will need to supply --client-ca also.

    +

    --cert should be a either a PEM encoded certificate or a concatenation of that with the CA certificate. --key should be the PEM encoded private key and --client-ca should be the PEM encoded client certificate authority certificate.

    +

    --min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    -

    VFS Directory Cache

    +

    VFS Directory Cache

    Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

    --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
     --poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
    @@ -3472,27 +4976,29 @@

    VFS Directory Cache

    rclone rc vfs/forget

    Or individual files or directories:

    rclone rc vfs/forget file=path/to/file dir=path/to/dir
    -

    VFS File Buffering

    +

    VFS File Buffering

    The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

    Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

    This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

    The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

    -

    VFS File Caching

    +

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    -
    --cache-dir string                   Directory rclone will use for caching.
    ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
    ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
    ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
    ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
    ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    -

    If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    -

    --vfs-cache-mode off

    +

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    This will mean some operations are not possible

      @@ -3504,7 +5010,7 @@

      --vfs-cache-mode off

    • Open modes O_APPEND, O_TRUNC are ignored
    • If an upload fails it can't be retried
    -

    --vfs-cache-mode minimal

    +

    --vfs-cache-mode minimal

    This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

    These operations are not possible

      @@ -3513,11 +5019,11 @@

      --vfs-cache-mode minimal

    • Files opened for write only will ignore O_APPEND, O_TRUNC
    • If an upload fails it can't be retried
    -

    --vfs-cache-mode writes

    +

    --vfs-cache-mode writes

    In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

    This mode should support all normal file system operations.

    If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

    -

    --vfs-cache-mode full

    +

    --vfs-cache-mode full

    In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

    In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

    So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

    @@ -3525,7 +5031,7 @@

    --vfs-cache-mode full

    When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

    When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

    IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

    -

    Fingerprinting

    +

    Fingerprinting

    Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

    • size
    • @@ -3538,7 +5044,7 @@

      Fingerprinting

      If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

      If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

      Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

      -

      VFS Chunked Reading

      +

      VFS Chunked Reading

      When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

      These flags control the chunking:

      --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
      @@ -3546,7 +5052,7 @@ 

      VFS Chunked Reading

      Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

      With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

      Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

      -

      VFS Performance

      +

      VFS Performance

      These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

      In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

      --no-checksum     Don't compare checksums on up/download.
      @@ -3558,7 +5064,7 @@ 

      VFS Performance

      --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s)

      When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

      --transfers int  Number of file transfers to run in parallel (default 4)
      -

      VFS Case Sensitivity

      +

      VFS Case Sensitivity

      Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

      File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

      Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

      @@ -3566,44 +5072,251 @@

      VFS Case Sensitivity

      The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

      Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

      If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

      -

      VFS Disk Options

      +

      VFS Disk Options

      This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

      --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
      -

      Alternate report of used bytes

      +

      Alternate report of used bytes

      Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

      WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

      -

      Auth Proxy

      -

      If you supply the parameter --auth-proxy /path/to/program then rclone will use that program to generate backends on the fly which then are used to authenticate incoming requests. This uses a simple JSON based protocol with input on STDIN and output on STDOUT.

      -

      PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, if --auth-proxy is set the authorized keys option will be ignored.

      -

      There is an example program bin/test_proxy.py in the rclone source code.

      -

      The program's job is to take a user and pass on the input and turn those into the config for a backend on STDOUT in JSON format. This config will have any default parameters for the backend added, but it won't use configuration from environment variables or command line options - it is the job of the proxy program to make a complete config.

      -

      This config generated must have this extra parameter - _root - root to use for the backend

      -

      And it may have this parameter - _obscure - comma separated strings for parameters to obscure

      -

      If password authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      -
      {
      -    "user": "me",
      -    "pass": "mypassword"
      -}
      -

      If public-key authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      -
      {
      -    "user": "me",
      -    "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf"
      -}
      -

      And as an example return this on STDOUT

      -
      {
      -    "type": "sftp",
      -    "_root": "",
      -    "_obscure": "pass",
      -    "user": "me",
      -    "pass": "mypassword",
      -    "host": "sftp.example.com"
      -}
      +
      rclone serve s3 remote:path [flags]
      +

      Options

      +
            --addr stringArray                       IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
      +      --allow-origin string                    Origin which cross-domain request (CORS) can be executed from
      +      --auth-key stringArray                   Set key pair for v4 authorization: access_key_id,secret_access_key
      +      --baseurl string                         Prefix for URLs - leave blank for root
      +      --cert string                            TLS PEM key (concatenation of certificate and CA certificate)
      +      --client-ca string                       Client certificate authority to verify clients with
      +      --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
      +      --dir-perms FileMode                     Directory permissions (default 0777)
      +      --etag-hash string                       Which hash to use for the ETag, or auto or blank for off (default "MD5")
      +      --file-perms FileMode                    File permissions (default 0666)
      +      --force-path-style                       If true use path style access if false use virtual hosted style (default true) (default true)
      +      --gid uint32                             Override the gid field set by the filesystem (not supported on Windows) (default 1000)
      +  -h, --help                                   help for s3
      +      --key string                             TLS PEM Private key
      +      --max-header-bytes int                   Maximum size of request header (default 4096)
      +      --min-tls-version string                 Minimum TLS version that is acceptable (default "tls1.0")
      +      --no-checksum                            Don't compare checksums on up/download
      +      --no-cleanup                             Not to cleanup empty folder after object is deleted
      +      --no-modtime                             Don't read/write the modification time (can speed things up)
      +      --no-seek                                Don't allow seeking in files
      +      --poll-interval Duration                 Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)
      +      --read-only                              Only allow read-only access
      +      --server-read-timeout Duration           Timeout for server reading data (default 1h0m0s)
      +      --server-write-timeout Duration          Timeout for server writing data (default 1h0m0s)
      +      --uid uint32                             Override the uid field set by the filesystem (not supported on Windows) (default 1000)
      +      --umask int                              Override the permission bits set by the filesystem (not supported on Windows) (default 2)
      +      --vfs-cache-max-age Duration             Max time since last access of objects in the cache (default 1h0m0s)
      +      --vfs-cache-max-size SizeSuffix          Max total size of objects in the cache (default off)
      +      --vfs-cache-min-free-space SizeSuffix    Target minimum free space on the disk containing the cache (default off)
      +      --vfs-cache-mode CacheMode               Cache mode off|minimal|writes|full (default off)
      +      --vfs-cache-poll-interval Duration       Interval to poll the cache for stale objects (default 1m0s)
      +      --vfs-case-insensitive                   If a file name not found, find a case insensitive match
      +      --vfs-disk-space-total-size SizeSuffix   Specify the total space of disk (default off)
      +      --vfs-fast-fingerprint                   Use fast (less accurate) fingerprints for change detection
      +      --vfs-read-ahead SizeSuffix              Extra read ahead over --buffer-size when using cache-mode full
      +      --vfs-read-chunk-size SizeSuffix         Read the source objects in chunks (default 128Mi)
      +      --vfs-read-chunk-size-limit SizeSuffix   If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off)
      +      --vfs-read-wait Duration                 Time to wait for in-sequence read before seeking (default 20ms)
      +      --vfs-refresh                            Refreshes the directory cache recursively on start
      +      --vfs-used-is-size rclone size           Use the rclone size algorithm for Used size
      +      --vfs-write-back Duration                Time to writeback files after last use when using cache (default 5s)
      +      --vfs-write-wait Duration                Time to wait for in-sequence write before giving error (default 1s)
      +

      Filter Options

      +

      Flags for filtering directory listings.

      +
            --delete-excluded                     Delete files on dest excluded from sync
      +      --exclude stringArray                 Exclude files matching pattern
      +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
      +      --exclude-if-present stringArray      Exclude directories if filename is present
      +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
      +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
      +  -f, --filter stringArray                  Add a file filtering rule
      +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
      +      --ignore-case                         Ignore case in filters (case insensitive)
      +      --include stringArray                 Include files matching pattern
      +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
      +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
      +      --max-depth int                       If set limits the recursion depth to this (default -1)
      +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
      +      --metadata-exclude stringArray        Exclude metadatas matching pattern
      +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
      +      --metadata-filter stringArray         Add a metadata filtering rule
      +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
      +      --metadata-include stringArray        Include metadatas matching pattern
      +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
      +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
      +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
      +

      See the global flags page for global options not listed here.

      +

      SEE ALSO

      + +

      rclone serve sftp

      +

      Serve the remote over SFTP.

      +

      Synopsis

      +

      Run an SFTP server to serve a remote over SFTP. This can be used with an SFTP client or you can make a remote of type sftp to use with it.

      +

      You can use the filter flags (e.g. --include, --exclude) to control what is served.

      +

      The server will respond to a small number of shell commands, mainly md5sum, sha1sum and df, which enable it to provide support for checksums and the about feature when accessed from an sftp remote.

      +

      Note that this server uses standard 32 KiB packet payload size, which means you must not configure the client to expect anything else, e.g. with the chunk_size option on an sftp remote.

      +

      The server will log errors. Use -v to see access logs.

      +

      --bwlimit will be respected for file transfers. Use --stats to control the stats printing.

      +

      You must provide some means of authentication, either with --user/--pass, an authorized keys file (specify location with --authorized-keys - the default is the same as ssh), an --auth-proxy, or set the --no-auth flag for no authentication when logging in.

      +

      If you don't supply a host --key then rclone will generate rsa, ecdsa and ed25519 variants, and cache them for later use in rclone's cache directory (see rclone help flags cache-dir) in the "serve-sftp" directory.

      +

      By default the server binds to localhost:2022 - if you want it to be reachable externally then supply --addr :2022 for example.

      +

      Note that the default of --vfs-cache-mode off is fine for the rclone sftp backend, but it may not be with other SFTP clients.

      +

      If --stdio is specified, rclone will serve SFTP over stdio, which can be used with sshd via ~/.ssh/authorized_keys, for example:

      +
      restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ...
      +

      On the client you need to set --transfers 1 when using --stdio. Otherwise multiple instances of the rclone server are started by OpenSSH which can lead to "corrupted on transfer" errors. This is the case because the client chooses indiscriminately which server to send commands to while the servers all have different views of the state of the filing system.

      +

      The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being used. Omitting "restrict" and using --sftp-path-override to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case.

      +

      VFS - Virtual File System

      +

      This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

      +

      Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

      +

      The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

      +

      VFS Directory Cache

      +

      Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

      +
      --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
      +--poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
      +

      However, changes made directly on the cloud storage by the web interface or a different copy of rclone will only be picked up once the directory cache expires if the backend configured does not support polling for changes. If the backend supports polling, changes will be picked up within the polling interval.

      +

      You can send a SIGHUP signal to rclone for it to flush all directory caches, regardless of how old they are. Assuming only one rclone instance is running, you can reset the cache like this:

      +
      kill -SIGHUP $(pidof rclone)
      +

      If you configure rclone with a remote control then you can use rclone rc to flush the whole directory cache:

      +
      rclone rc vfs/forget
      +

      Or individual files or directories:

      +
      rclone rc vfs/forget file=path/to/file dir=path/to/dir
      +

      VFS File Buffering

      +

      The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

      +

      Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

      +

      This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

      +

      The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

      +

      VFS File Caching

      +

      These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

      +

      For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

      +

      Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

      +
      --cache-dir string                     Directory rclone will use for caching.
      +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
      +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
      +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
      +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
      +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
      +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)
      +

      If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

      +

      The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

      +

      Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

      +

      If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

      +

      The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

      +

      You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

      +

      --vfs-cache-mode off

      +

      In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

      +

      This will mean some operations are not possible

      +
        +
      • Files can't be opened for both read AND write
      • +
      • Files opened for write can't be seeked
      • +
      • Existing files opened for write must have O_TRUNC set
      • +
      • Files open for read with O_TRUNC will be opened write only
      • +
      • Files open for write only will behave as if O_TRUNC was supplied
      • +
      • Open modes O_APPEND, O_TRUNC are ignored
      • +
      • If an upload fails it can't be retried
      • +
      +

      --vfs-cache-mode minimal

      +

      This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

      +

      These operations are not possible

      +
        +
      • Files opened for write only can't be seeked
      • +
      • Existing files opened for write must have O_TRUNC set
      • +
      • Files opened for write only will ignore O_APPEND, O_TRUNC
      • +
      • If an upload fails it can't be retried
      • +
      +

      --vfs-cache-mode writes

      +

      In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

      +

      This mode should support all normal file system operations.

      +

      If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

      +

      --vfs-cache-mode full

      +

      In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

      +

      In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

      +

      So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

      +

      This mode should support all normal file system operations and is otherwise identical to --vfs-cache-mode writes.

      +

      When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

      +

      When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

      +

      IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

      +

      Fingerprinting

      +

      Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

      +
        +
      • size
      • +
      • modification time
      • +
      • hash
      • +
      +

      where available on an object.

      +

      On some backends some of these attributes are slow to read (they take an extra API call per object, or extra work per object).

      +

      For example hash is slow with the local and sftp backends as they have to read the entire file and hash it, and modtime is slow with the s3, swift, ftp and qinqstor backends because they need to do an extra API call to fetch it.

      +

      If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

      +

      If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

      +

      Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

      +

      VFS Chunked Reading

      +

      When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

      +

      These flags control the chunking:

      +
      --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
      +--vfs-read-chunk-size-limit SizeSuffix  Max chunk doubling size (default off)
      +

      Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

      +

      With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

      +

      Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

      +

      VFS Performance

      +

      These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

      +

      In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

      +
      --no-checksum     Don't compare checksums on up/download.
      +--no-modtime      Don't read/write the modification time (can speed things up).
      +--no-seek         Don't allow seeking in files.
      +--read-only       Only allow read-only access.
      +

      Sometimes rclone is delivered reads or writes out of order. Rather than seeking rclone will wait a short time for the in sequence read or write to come in. These flags only come into effect when not using an on disk cache file.

      +
      --vfs-read-wait duration   Time to wait for in-sequence read before seeking (default 20ms)
      +--vfs-write-wait duration  Time to wait for in-sequence write before giving error (default 1s)
      +

      When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

      +
      --transfers int  Number of file transfers to run in parallel (default 4)
      +

      VFS Case Sensitivity

      +

      Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

      +

      File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

      +

      Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

      +

      The --vfs-case-insensitive VFS flag controls how rclone handles these two cases. If its value is "false", rclone passes file names to the remote as-is. If the flag is "true" (or appears without a value on the command line), rclone may perform a "fixup" as explained below.

      +

      The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

      +

      Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

      +

      If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

      +

      VFS Disk Options

      +

      This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

      +
      --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
      +

      Alternate report of used bytes

      +

      Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

      +

      WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

      +

      Auth Proxy

      +

      If you supply the parameter --auth-proxy /path/to/program then rclone will use that program to generate backends on the fly which then are used to authenticate incoming requests. This uses a simple JSON based protocol with input on STDIN and output on STDOUT.

      +

      PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, if --auth-proxy is set the authorized keys option will be ignored.

      +

      There is an example program bin/test_proxy.py in the rclone source code.

      +

      The program's job is to take a user and pass on the input and turn those into the config for a backend on STDOUT in JSON format. This config will have any default parameters for the backend added, but it won't use configuration from environment variables or command line options - it is the job of the proxy program to make a complete config.

      +

      This config generated must have this extra parameter - _root - root to use for the backend

      +

      And it may have this parameter - _obscure - comma separated strings for parameters to obscure

      +

      If password authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      +
      {
      +    "user": "me",
      +    "pass": "mypassword"
      +}
      +

      If public-key authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      +
      {
      +    "user": "me",
      +    "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf"
      +}
      +

      And as an example return this on STDOUT

      +
      {
      +    "type": "sftp",
      +    "_root": "",
      +    "_obscure": "pass",
      +    "user": "me",
      +    "pass": "mypassword",
      +    "host": "sftp.example.com"
      +}

      This would mean that an SFTP backend would be created on the fly for the user and pass/public_key returned in the output to the host given. Note that since _obscure is set to pass, rclone will obscure the pass parameter before creating the backend (which is required for sftp backends).

      The program can manipulate the supplied user in any way, for example to make proxy to many different sftp backends, you could make the user be user@example.com and then set the host to example.com in the output and the user to user. For security you'd probably want to restrict the host to a limited list.

      Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

      This can be used to build general purpose proxies to any kind of backend that rclone supports.

      rclone serve sftp remote:path [flags]
      -

      Options

      +

      Options

            --addr string                            IPaddress:Port or :Port to bind server to (default "localhost:2022")
             --auth-proxy string                      A program to use to create the backend from the auth
             --authorized-keys string                 Authorized keys file (default "~/.ssh/authorized_keys")
      @@ -3624,8 +5337,9 @@ 

      Options

      --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -3635,17 +5349,42 @@

      Options

      --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
      +

      Filter Options

      +

      Flags for filtering directory listings.

      +
            --delete-excluded                     Delete files on dest excluded from sync
      +      --exclude stringArray                 Exclude files matching pattern
      +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
      +      --exclude-if-present stringArray      Exclude directories if filename is present
      +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
      +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
      +  -f, --filter stringArray                  Add a file filtering rule
      +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
      +      --ignore-case                         Ignore case in filters (case insensitive)
      +      --include stringArray                 Include files matching pattern
      +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
      +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
      +      --max-depth int                       If set limits the recursion depth to this (default -1)
      +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
      +      --metadata-exclude stringArray        Exclude metadatas matching pattern
      +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
      +      --metadata-filter stringArray         Add a metadata filtering rule
      +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
      +      --metadata-include stringArray        Include metadatas matching pattern
      +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
      +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
      +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

      See the global flags page for global options not listed here.

      -

      SEE ALSO

      +

      SEE ALSO

      rclone serve webdav

      Serve remote:path over WebDAV.

      -

      Synopsis

      +

      Synopsis

      Run a basic WebDAV server to serve a remote over HTTP via the WebDAV protocol. This can be viewed with a WebDAV client, through a web browser, or you can make a remote of type WebDAV to read and write it.

      WebDAV options

      --etag-hash

      @@ -3656,7 +5395,7 @@

      Access WebDAV on Windows

      Access Office applications on WebDAV

      Navigate to following registry HKEY_CURRENT_USER[14.0/15.0/16.0] Create a new DWORD BasicAuthLevel with value 2. 0 - Basic authentication disabled 1 - Basic authentication enabled for SSL connections only 2 - Basic authentication enabled for SSL and for non-SSL connections

      https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint

      -

      Server options

      +

      Server options

      Use --addr to specify which IP address and port the server should listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

      If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

      You can use a unix socket by setting the url to unix:///path/to/socket or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions.

      @@ -3664,7 +5403,7 @@

      Server options

      --server-read-timeout and --server-write-timeout can be used to control the timeouts on the server. Note that this is the total time for a transfer.

      --max-header-bytes controls the maximum number of bytes the server will accept in the HTTP header.

      --baseurl controls the URL prefix that rclone serves from. By default rclone will serve from the root. If you used --baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading and trailing "/" on --baseurl, so --baseurl "rclone", --baseurl "/rclone" and --baseurl "/rclone/" are all treated identically.

      -

      TLS (SSL)

      +

      TLS (SSL)

      By default this will serve over http. If you want you can serve over https. You will need to supply the --cert and --key flags. If you wish to do client side certificate validation then you will need to supply --client-ca also.

      --cert should be a either a PEM encoded certificate or a concatenation of that with the CA certificate. --key should be the PEM encoded private key and --client-ca should be the PEM encoded client certificate authority certificate.

      --min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0").

      @@ -3748,9 +5487,41 @@

      Template

      +

      The server also makes the following functions available so that they can be used within the template. These functions help extend the options for dynamic rendering of HTML. They can be used to render HTML based on specific conditions.

      + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
      FunctionDescription
      afterEpochReturns the time since the epoch for the given time.
      containsChecks whether a given substring is present or not in a given string.
      hasPrefixChecks whether the given string begins with the specified prefix.
      hasSuffixChecks whether the given string end with the specified suffix.

      Authentication

      By default this will serve files without needing a login.

      You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags.

      +

      If no static users are configured by either of the above methods, and client certificates are required by the --client-ca flag passed to the server, the client certificate common name will be considered as the username.

      Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended.

      To create an htpasswd file:

      touch htpasswd
      @@ -3758,12 +5529,11 @@ 

      Authentication

      htpasswd -B htpasswd anotherUser

      The password file can be updated while rclone is running.

      Use --realm to set the authentication realm.

      -

      Use --salt to change the password hashing salt from the default.

      -

      VFS - Virtual File System

      +

      Use --salt to change the password hashing salt from the default. ## VFS - Virtual File System

      This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

      Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

      The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

      -

      VFS Directory Cache

      +

      VFS Directory Cache

      Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

      --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
       --poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
      @@ -3774,27 +5544,29 @@

      VFS Directory Cache

      rclone rc vfs/forget

      Or individual files or directories:

      rclone rc vfs/forget file=path/to/file dir=path/to/dir
      -

      VFS File Buffering

      +

      VFS File Buffering

      The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

      Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

      This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

      The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

      -

      VFS File Caching

      +

      VFS File Caching

      These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

      For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

      Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

      -
      --cache-dir string                   Directory rclone will use for caching.
      ---vfs-cache-mode CacheMode           Cache mode off|minimal|writes|full (default off)
      ---vfs-cache-max-age duration         Max age of objects in the cache (default 1h0m0s)
      ---vfs-cache-max-size SizeSuffix      Max total size of objects in the cache (default off)
      ---vfs-cache-poll-interval duration   Interval to poll the cache for stale objects (default 1m0s)
      ---vfs-write-back duration            Time to writeback files after last use when using cache (default 5s)
      +
      --cache-dir string                     Directory rclone will use for caching.
      +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
      +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
      +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
      +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
      +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
      +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

      If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

      The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

      Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

      -

      If using --vfs-cache-max-size note that the cache may exceed this size for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache.

      +

      If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

      +

      The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

      You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

      -

      --vfs-cache-mode off

      +

      --vfs-cache-mode off

      In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

      This will mean some operations are not possible

        @@ -3806,7 +5578,7 @@

        --vfs-cache-mode off

      • Open modes O_APPEND, O_TRUNC are ignored
      • If an upload fails it can't be retried
      -

      --vfs-cache-mode minimal

      +

      --vfs-cache-mode minimal

      This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

      These operations are not possible

        @@ -3815,11 +5587,11 @@

        --vfs-cache-mode minimal

      • Files opened for write only will ignore O_APPEND, O_TRUNC
      • If an upload fails it can't be retried
      -

      --vfs-cache-mode writes

      +

      --vfs-cache-mode writes

      In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

      This mode should support all normal file system operations.

      If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

      -

      --vfs-cache-mode full

      +

      --vfs-cache-mode full

      In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

      In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

      So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

      @@ -3827,7 +5599,7 @@

      --vfs-cache-mode full

      When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

      When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

      IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

      -

      Fingerprinting

      +

      Fingerprinting

      Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

      • size
      • @@ -3840,7 +5612,7 @@

        Fingerprinting

        If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

        If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

        Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

        -

        VFS Chunked Reading

        +

        VFS Chunked Reading

        When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

        These flags control the chunking:

        --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
        @@ -3848,7 +5620,7 @@ 

        VFS Chunked Reading

        Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

        With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

        Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

        -

        VFS Performance

        +

        VFS Performance

        These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

        In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

        --no-checksum     Don't compare checksums on up/download.
        @@ -3860,7 +5632,7 @@ 

        VFS Performance

        --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s)

        When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

        --transfers int  Number of file transfers to run in parallel (default 4)
        -

        VFS Case Sensitivity

        +

        VFS Case Sensitivity

        Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

        File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

        Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

        @@ -3868,10 +5640,10 @@

        VFS Case Sensitivity

        The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

        Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

        If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

        -

        VFS Disk Options

        +

        VFS Disk Options

        This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

        --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
        -

        Alternate report of used bytes

        +

        Alternate report of used bytes

        Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

        WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

        Auth Proxy

        @@ -3905,8 +5677,9 @@

        Auth Proxy

        Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

        This can be used to build general purpose proxies to any kind of backend that rclone supports.

        rclone serve webdav remote:path [flags]
        -

        Options

        +

        Options

              --addr stringArray                       IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
        +      --allow-origin string                    Origin which cross-domain request (CORS) can be executed from
               --auth-proxy string                      A program to use to create the backend from the auth
               --baseurl string                         Prefix for URLs - leave blank for root
               --cert string                            TLS PEM key (concatenation of certificate and CA certificate)
        @@ -3936,8 +5709,9 @@ 

        Options

        --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -3947,17 +5721,42 @@

        Options

        --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
        +

        Filter Options

        +

        Flags for filtering directory listings.

        +
              --delete-excluded                     Delete files on dest excluded from sync
        +      --exclude stringArray                 Exclude files matching pattern
        +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
        +      --exclude-if-present stringArray      Exclude directories if filename is present
        +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
        +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
        +  -f, --filter stringArray                  Add a file filtering rule
        +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
        +      --ignore-case                         Ignore case in filters (case insensitive)
        +      --include stringArray                 Include files matching pattern
        +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
        +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
        +      --max-depth int                       If set limits the recursion depth to this (default -1)
        +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
        +      --metadata-exclude stringArray        Exclude metadatas matching pattern
        +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
        +      --metadata-filter stringArray         Add a metadata filtering rule
        +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
        +      --metadata-include stringArray        Include metadatas matching pattern
        +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
        +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
        +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        rclone settier

        Changes storage class/tier of objects in remote.

        -

        Synopsis

        +

        Synopsis

        rclone settier changes storage tier or class at remote if supported. Few cloud storage services provides different storage classes on objects, for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive, Google Cloud Storage, Regional Storage, Nearline, Coldline etc.

        Note that, certain tier changes make objects not available to access immediately. For example tiering to archive in azure blob storage makes objects in frozen state, user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object inaccessible.true

        You can use it to tier single object

        @@ -3967,25 +5766,25 @@

        Synopsis

        Or just provide remote directory and all files in directory will be tiered

        rclone settier tier remote:path/dir
        rclone settier tier remote:path [flags]
        -

        Options

        +

        Options

          -h, --help   help for settier

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.

        rclone test

        Run a test command

        -

        Synopsis

        +

        Synopsis

        Rclone test is used to run test commands.

        -

        Select which test comand you want with the subcommand, eg

        +

        Select which test command you want with the subcommand, eg

        rclone test memory remote:

        Each subcommand has its own options which you can see in their help.

        NB Be careful running these commands, they may do strange things so reading their documentation first is recommended.

        -

        Options

        +

        Options

          -h, --help   help for test

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.
        • rclone test changenotify - Log any change notify requests for the remote passed in.
        • @@ -3998,35 +5797,36 @@

          SEE ALSO

          rclone test changenotify

          Log any change notify requests for the remote passed in.

          rclone test changenotify remote: [flags]
          -

          Options

          +

          Options

            -h, --help                     help for changenotify
                 --poll-interval Duration   Time to wait between polling for changes (default 10s)

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test histogram

          Makes a histogram of file name characters.

          -

          Synopsis

          +

          Synopsis

          This command outputs JSON which shows the histogram of characters used in filenames in the remote:path specified.

          The data doesn't contain any identifying information but is useful for the rclone developers when developing filename compression.

          rclone test histogram [remote:path] [flags]
          -

          Options

          +

          Options

            -h, --help   help for histogram

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test info

          Discovers file name or other limitations for paths.

          -

          Synopsis

          +

          Synopsis

          rclone info discovers what filenames and upload methods are possible to write to the paths passed in and how long they can be. It can take some time. It will write test files into the remote:path passed in. It outputs a bit of go code for each one.

          NB this can create undeletable files and other hazards - use with care

          rclone test info [remote:path]+ [flags]
          -

          Options

          +

          Options

                --all                    Run all tests
          +      --check-base32768        Check can store all possible base32768 characters
                 --check-control          Check control characters
                 --check-length           Check max filename length
                 --check-normalization    Check UTF-8 Normalization
          @@ -4035,14 +5835,14 @@ 

          Options

          --upload-wait Duration Wait after writing a file (default 0s) --write-json string Write results to file

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test makefile

          Make files with random contents of the size given

          rclone test makefile <size> [<file>]+ [flags]
          -

          Options

          +

          Options

                --ascii      Fill files with random ASCII printable bytes only
                 --chargen    Fill files with a ASCII chargen pattern
             -h, --help       help for makefile
          @@ -4051,14 +5851,14 @@ 

          Options

          --sparse Make the files sparse (appear to be filled with ASCII 0x00) --zero Fill files with ASCII 0x00

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test makefiles

          Make a random file hierarchy in a directory

          rclone test makefiles <dir> [flags]
          -

          Options

          +

          Options

                --ascii                      Fill files with random ASCII printable bytes only
                 --chargen                    Fill files with a ASCII chargen pattern
                 --files int                  Number of files to create (default 1000)
          @@ -4074,23 +5874,23 @@ 

          Options

          --sparse Make the files sparse (appear to be filled with ASCII 0x00) --zero Fill files with ASCII 0x00

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test memory

          Load all the objects at remote:path into memory and report memory stats.

          rclone test memory remote:path [flags]
          -

          Options

          +

          Options

            -h, --help   help for memory

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone touch

          Create new file or change file modification time.

          -

          Synopsis

          +

          Synopsis

          Set the modification time on file(s) as specified by remote:path to have the current time.

          If remote:path does not exist then a zero sized file will be created, unless --no-create or --recursive is provided.

          If --recursive is used then recursively sets the modification time on all existing files that is found under the path. Filters are supported, and you can test with the --dry-run or the --interactive/-i flag.

          @@ -4102,20 +5902,53 @@

          Synopsis

        Note that value of --timestamp is in UTC. If you want local time then add the --localtime flag.

        rclone touch remote:path [flags]
        -

        Options

        +

        Options

          -h, --help               help for touch
               --localtime          Use localtime for timestamp, not UTC
           -C, --no-create          Do not create the file if it does not exist (implied with --recursive)
           -R, --recursive          Recursively touch all files
           -t, --timestamp string   Use specified time instead of the current time of day
        +

        Important Options

        +

        Important flags useful for most commands.

        +
          -n, --dry-run         Do a trial run with no permanent changes
        +  -i, --interactive     Enable interactive mode
        +  -v, --verbose count   Print lots more stuff (repeat for more)
        +

        Filter Options

        +

        Flags for filtering directory listings.

        +
              --delete-excluded                     Delete files on dest excluded from sync
        +      --exclude stringArray                 Exclude files matching pattern
        +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
        +      --exclude-if-present stringArray      Exclude directories if filename is present
        +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
        +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
        +  -f, --filter stringArray                  Add a file filtering rule
        +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
        +      --ignore-case                         Ignore case in filters (case insensitive)
        +      --include stringArray                 Include files matching pattern
        +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
        +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
        +      --max-depth int                       If set limits the recursion depth to this (default -1)
        +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
        +      --metadata-exclude stringArray        Exclude metadatas matching pattern
        +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
        +      --metadata-filter stringArray         Add a metadata filtering rule
        +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
        +      --metadata-include stringArray        Include metadatas matching pattern
        +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
        +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
        +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
        +

        Listing Options

        +

        Flags for listing directories.

        +
              --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
        +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.

        rclone tree

        List the contents of the remote in a tree like fashion.

        -

        Synopsis

        +

        Synopsis

        rclone tree lists the contents of a remote in a similar way to the unix tree command.

        For example

        $ rclone tree remote:path
        @@ -4132,7 +5965,7 @@ 

        Synopsis

        The tree command has many options for controlling the listing which are compatible with the tree command, for example you can include file sizes with --size. Note that not all of them have short options as they conflict with rclone's short options.

        For a more interactive navigation of the remote see the ncdu command.

        rclone tree remote:path [flags]
        -

        Options

        +

        Options

          -a, --all             All files are listed (list . files too)
           -d, --dirs-only       List directories only
               --dirsfirst       List directories before files (-U disables)
        @@ -4152,8 +5985,36 @@ 

        Options

        -r, --sort-reverse Reverse the order of the sort -U, --unsorted Leave files unsorted --version Sort files alphanumerically by version
        +

        Filter Options

        +

        Flags for filtering directory listings.

        +
              --delete-excluded                     Delete files on dest excluded from sync
        +      --exclude stringArray                 Exclude files matching pattern
        +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
        +      --exclude-if-present stringArray      Exclude directories if filename is present
        +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
        +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
        +  -f, --filter stringArray                  Add a file filtering rule
        +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
        +      --ignore-case                         Ignore case in filters (case insensitive)
        +      --include stringArray                 Include files matching pattern
        +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
        +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
        +      --max-depth int                       If set limits the recursion depth to this (default -1)
        +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
        +      --metadata-exclude stringArray        Exclude metadatas matching pattern
        +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
        +      --metadata-filter stringArray         Add a metadata filtering rule
        +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
        +      --metadata-include stringArray        Include metadatas matching pattern
        +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
        +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
        +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
        +

        Listing Options

        +

        Flags for listing directories.

        +
              --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
        +      --fast-list           Use recursive list if available; uses more memory but fewer transactions

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.
        @@ -4234,6 +6095,7 @@

        Connection strings, config and lo

        Valid remote names

        Remote names are case sensitive, and must adhere to the following rules: - May contain number, letter, _, -, ., +, @ and space. - May not start with - or space. - May not end with space.

        Starting with rclone version 1.61, any Unicode numbers and letters are allowed, while in older versions it was limited to plain ASCII (0-9, A-Z, a-z). If you use the same rclone configuration from different shells, which may be configured with different character encoding, you must be cautious to use characters that are possible to write in all of them. This is mostly a problem on Windows, where the console traditionally uses a non-Unicode character set - defined by the so-called "code page".

        +

        Do not use single character names on Windows as it creates ambiguity with Windows drives' names, e.g.: remote called C is indistinguishable from C drive. Rclone will always assume that single letter name refers to a drive.

        Quoting and the shell

        When you are typing commands to your computer you are using something called the command line shell. This interprets various characters in an OS specific way.

        Here are some gotchas which may help users unfamiliar with the shell rules

        @@ -4273,6 +6135,7 @@

        Metadata support

        Rclone only supports a one-time sync of metadata. This means that metadata will be synced from the source object to the destination object only when the source object has changed and needs to be re-uploaded. If the metadata subsequently changes on the source object without changing the object itself then it won't be synced to the destination object. This is in line with the way rclone syncs Content-Type without the --metadata flag.

        Using --metadata when syncing from local to local will preserve file attributes such as file mode, owner, extended attributes (not Windows).

        Note that arbitrary metadata may be added to objects using the --metadata-set key=value flag when the object is first uploaded. This flag can be repeated as many times as necessary.

        +

        The --metadata-mapper flag can be used to pass the name of a program in which can transform metadata when it is being copied from source to destination.

        Types of metadata

        Metadata is divided into two type. System metadata and User metadata.

        Metadata which the backend uses itself is called system metadata. For example on the local backend the system metadata uid will store the user ID of the file when used on a unix based platform.

        @@ -4350,26 +6213,31 @@

        Standard system metadata

        2006-01-02T15:04:05.999999999Z07:00 +utime +Time of file upload: RFC 3339 +2006-01-02T15:04:05.999999999Z07:00 + + cache-control Cache-Control header no-cache - + content-disposition Content-Disposition header inline - + content-encoding Content-Encoding header gzip - + content-language Content-Language header en-US - + content-type Content-Type header text/plain @@ -4378,7 +6246,7 @@

        Standard system metadata

        The metadata keys mtime and content-type will take precedence if supplied in the metadata over reading the Content-Type or modification time of the source object.

        Hashes are not included in system metadata as there is a well defined way of reading those already.

        -

        Options

        +

        Options

        Rclone has a number of options to control its behaviour.

        Options that take parameters can have the values passed in two ways, --option=value or --option value. However boolean (true/false) options behave slightly differently to the other options in that --boolean sets the option to true and the absence of the flag sets it to false. It is also possible to specify --boolean=false or --boolean=true. Note that --boolean false is not valid - this is parsed as --boolean and the false is parsed as an extra command line argument for rclone.

        Time or duration options

        @@ -4414,6 +6282,7 @@

        --backup-dir=DIR

        See --compare-dest and --copy-dest.

        --bind string

        Local address to bind to for outgoing connections. This can be an IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If the host name doesn't resolve or resolves to more than one IP address it will give an error.

        +

        You can use --bind 0.0.0.0 to force rclone to use IPv4 addresses and --bind ::0 to force rclone to use IPv6 addresses.

        --bwlimit=BANDWIDTH_SPEC

        This option controls the bandwidth limit. For example

        --bwlimit 10M
        @@ -4479,7 +6348,7 @@

        -c, --checksum

        Eg rclone --checksum sync s3:/bucket swift:/bucket would run much quicker than without the --checksum flag.

        When using this flag, rclone won't update mtimes of remote files if they are incorrect as it would normally.

        --color WHEN

        -

        Specifiy when colors (and other ANSI codes) should be added to the output.

        +

        Specify when colors (and other ANSI codes) should be added to the output.

        AUTO (default) only allows ANSI codes when the output is a terminal

        NEVER never allow ANSI codes

        ALWAYS always add ANSI codes, regardless of the output format (terminal or file)

        @@ -4525,6 +6394,8 @@

        --config=CONFIG_FILE

        Note that passwords are in obscured form. Also, many storage systems uses token-based authentication instead of passwords, and this requires additional steps. It is easier, and safer, to use the interactive command rclone config instead of manually editing the configuration file.

        The configuration file will typically contain login information, and should therefore have restricted permissions so that only the current user can read it. Rclone tries to ensure this when it writes the file. You may also choose to encrypt the file.

        When token-based authentication are used, the configuration file must be writable, because rclone needs to update the tokens inside it.

        +

        To reduce risk of corrupting an existing configuration file, rclone will not write directly to it when saving changes. Instead it will first write to a new, temporary, file. If a configuration file already existed, it will (on Unix systems) try to mirror its permissions to the new file. Then it will rename the existing file to a temporary name as backup. Next, rclone will rename the new file to the correct name, before finally cleaning up by deleting the backup file.

        +

        If the configuration file path used by rclone is a symbolic link, then this will be evaluated and rclone will write to the resolved path, instead of overwriting the symbolic link. Temporary files used in the process (described above) will be written to the same parent directory as that of the resolved configuration file, but if this directory is also a symbolic link it will not be resolved and the temporary files will be written to the location of the directory symbolic link.

        --contimeout=TIME

        Set the connection timeout. This should be in go time format which looks like 5s for 5 seconds, 10m for 10 minutes, or 3h30m.

        The connection timeout is the amount of time rclone will wait for a connection to go through to a remote object storage system. It is 1m by default.

        @@ -4535,13 +6406,21 @@

        --copy-dest=DIR

        --dedupe-mode MODE

        Mode to run dedupe command in. One of interactive, skip, first, newest, oldest, rename. The default is interactive.
        See the dedupe command for more information as to what these options mean.

        +

        --default-time TIME

        +

        If a file or directory does have a modification time rclone can read then rclone will display this fixed time instead.

        +

        The default is 2000-01-01 00:00:00 UTC. This can be configured in any of the ways shown in the time or duration options.

        +

        For example --default-time 2020-06-01 to set the default time to the 1st of June 2020 or --default-time 0s to set the default time to the time rclone started up.

        --disable FEATURE,FEATURE,...

        This disables a comma separated list of optional features. For example to disable server-side move and server-side copy use:

        --disable move,copy

        The features can be put in any case.

        To see a list of which features can be disabled use:

        --disable help
        +

        The features a remote has can be seen in JSON format with:

        +
        rclone backend features remote:

        See the overview features and optional features to get an idea of which feature does what.

        +

        Note that some features can be set to true if they are true/false feature flag features by prefixing them with !. For example the CaseInsensitive feature can be forced to false with --disable CaseInsensitive and forced to true with --disable '!CaseInsensitive'. In general it isn't a good idea doing this but it may be useful in extremis.

        +

        (Note that ! is a shell command which you will need to escape with single quotes or a backslash on unix like platforms.)

        This flag can be useful for debugging and in exceptional circumstances (e.g. Google Drive limiting the total volume of Server Side Copies to 100 GiB/day).

        --disable-http2

        This stops rclone from trying to use HTTP/2 if available. This can sometimes speed up transfers due to a problem in the Go standard library.

        @@ -4610,6 +6489,22 @@

        --immutable

        With this option set, files will be created and deleted as requested, but existing files will never be updated. If an existing file does not match between the source and destination, rclone will give the error Source and destination exist but do not match: immutable file modified.

        Note that only commands which transfer files (e.g. sync, copy, move) are affected by this behavior, and only modification is disallowed. Files may still be deleted explicitly (e.g. delete, purge) or implicitly (e.g. sync, move). Use copy --immutable if it is desired to avoid deletion as well as modification.

        This can be useful as an additional layer of protection for immutable or append-only data sets (notably backup archives), where modification implies corruption and should not be propagated.

        +

        --inplace

        +

        The --inplace flag changes the behaviour of rclone when uploading files to some backends (backends with the PartialUploads feature flag set) such as:

        +
          +
        • local
        • +
        • ftp
        • +
        • sftp
        • +
        +

        Without --inplace (the default) rclone will first upload to a temporary file with an extension like this, where XXXXXX represents a random string and .partial is --partial-suffix value (.partial by default).

        +
        original-file-name.XXXXXX.partial
        +

        (rclone will make sure the final name is no longer than 100 characters by truncating the original-file-name part if necessary).

        +

        When the upload is complete, rclone will rename the .partial file to the correct name, overwriting any existing file at that point. If the upload fails then the .partial file will be deleted.

        +

        This prevents other users of the backend from seeing partially uploaded files in their new names and prevents overwriting the old file until the new one is completely uploaded.

        +

        If the --inplace flag is supplied, rclone will upload directly to the final name without creating a .partial file.

        +

        This means that an incomplete file will be visible in the directory listings while the upload is in progress and any existing files will be overwritten as soon as the upload starts. If the transfer fails then the file will be deleted. This can cause data loss of the existing file if the transfer fails.

        +

        Note that on the local file system if you don't use --inplace hard links (Unix only) will be broken. And if you do use --inplace you won't be able to update in use executables.

        +

        Note also that versions of rclone prior to v1.63.0 behave as if the --inplace flag is always supplied.

        -i, --interactive

        This flag can be used to tell rclone that you wish a manual confirmation before destructive operations.

        It is recommended that you use this flag while learning rclone especially with rclone sync.

        @@ -4669,46 +6564,119 @@

        --max-depth=N

        You can use this command to disable recursion (with --max-depth 1).

        Note that if you use this with sync and --delete-excluded the files not recursed through are considered excluded and will be deleted on the destination. Test first with --dry-run if you are not sure what will happen.

        --max-duration=TIME

        -

        Rclone will stop scheduling new transfers when it has run for the duration specified.

        -

        Defaults to off.

        -

        When the limit is reached any existing transfers will complete.

        -

        Rclone won't exit with an error if the transfer limit is reached.

        +

        Rclone will stop transferring when it has run for the duration specified. Defaults to off.

        +

        When the limit is reached all transfers will stop immediately. Use --cutoff-mode to modify this behaviour.

        +

        Rclone will exit with exit code 10 if the duration limit is reached.

        --max-transfer=SIZE

        Rclone will stop transferring when it has reached the size specified. Defaults to off.

        -

        When the limit is reached all transfers will stop immediately.

        +

        When the limit is reached all transfers will stop immediately. Use --cutoff-mode to modify this behaviour.

        Rclone will exit with exit code 8 if the transfer limit is reached.

        -

        -M, --metadata

        -

        Setting this flag enables rclone to copy the metadata from the source to the destination. For local backends this is ownership, permissions, xattr etc. See the #metadata for more info.

        -

        --metadata-set key=value

        -

        Add metadata key = value when uploading. This can be repeated as many times as required. See the #metadata for more info.

        --cutoff-mode=hard|soft|cautious

        -

        This modifies the behavior of --max-transfer Defaults to --cutoff-mode=hard.

        +

        This modifies the behavior of --max-transfer and --max-duration Defaults to --cutoff-mode=hard.

        Specifying --cutoff-mode=hard will stop transferring immediately when Rclone reaches the limit.

        Specifying --cutoff-mode=soft will stop starting new transfers when Rclone reaches the limit.

        -

        Specifying --cutoff-mode=cautious will try to prevent Rclone from reaching the limit.

        +

        Specifying --cutoff-mode=cautious will try to prevent Rclone from reaching the limit. Only applicable for --max-transfer

        +

        -M, --metadata

        +

        Setting this flag enables rclone to copy the metadata from the source to the destination. For local backends this is ownership, permissions, xattr etc. See the metadata section for more info.

        +

        --metadata-mapper SpaceSepList

        +

        If you supply the parameter --metadata-mapper /path/to/program then rclone will use that program to map metadata from source object to destination object.

        +

        The argument to this flag should be a command with an optional space separated list of arguments. If one of the arguments has a space in then enclose it in ", if you want a literal " in an argument then enclose the argument in " and double the ". See CSV encoding for more info.

        +
        --metadata-mapper "python bin/test_metadata_mapper.py"
        +--metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"'
        +--metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"'
        +

        This uses a simple JSON based protocol with input on STDIN and output on STDOUT. This will be called for every file and directory copied and may be called concurrently.

        +

        The program's job is to take a metadata blob on the input and turn it into a metadata blob on the output suitable for the destination backend.

        +

        Input to the program (via STDIN) might look like this. This provides some context for the Metadata which may be important.

        +
          +
        • SrcFs is the config string for the remote that the object is currently on.
        • +
        • SrcFsType is the name of the source backend.
        • +
        • DstFs is the config string for the remote that the object is being copied to
        • +
        • DstFsType is the name of the destination backend.
        • +
        • Remote is the path of the file relative to the root.
        • +
        • Size, MimeType, ModTime are attributes of the file.
        • +
        • IsDir is true if this is a directory (not yet implemented).
        • +
        • ID is the source ID of the file if known.
        • +
        • Metadata is the backend specific metadata as described in the backend docs.
        • +
        +
        {
        +    "SrcFs": "gdrive:",
        +    "SrcFsType": "drive",
        +    "DstFs": "newdrive:user",
        +    "DstFsType": "onedrive",
        +    "Remote": "test.txt",
        +    "Size": 6,
        +    "MimeType": "text/plain; charset=utf-8",
        +    "ModTime": "2022-10-11T17:53:10.286745272+01:00",
        +    "IsDir": false,
        +    "ID": "xyz",
        +    "Metadata": {
        +        "btime": "2022-10-11T16:53:11Z",
        +        "content-type": "text/plain; charset=utf-8",
        +        "mtime": "2022-10-11T17:53:10.286745272+01:00",
        +        "owner": "user1@domain1.com",
        +        "permissions": "...",
        +        "description": "my nice file",
        +        "starred": "false"
        +    }
        +}
        +

        The program should then modify the input as desired and send it to STDOUT. The returned Metadata field will be used in its entirety for the destination object. Any other fields will be ignored. Note in this example we translate user names and permissions and add something to the description:

        +
        {
        +    "Metadata": {
        +        "btime": "2022-10-11T16:53:11Z",
        +        "content-type": "text/plain; charset=utf-8",
        +        "mtime": "2022-10-11T17:53:10.286745272+01:00",
        +        "owner": "user1@domain2.com",
        +        "permissions": "...",
        +        "description": "my nice file [migrated from domain1]",
        +        "starred": "false"
        +    }
        +}
        +

        Metadata can be removed here too.

        +

        An example python program might look something like this to implement the above transformations.

        +
        import sys, json
        +
        +i = json.load(sys.stdin)
        +metadata = i["Metadata"]
        +# Add tag to description
        +if "description" in metadata:
        +    metadata["description"] += " [migrated from domain1]"
        +else:
        +    metadata["description"] = "[migrated from domain1]"
        +# Modify owner
        +if "owner" in metadata:
        +    metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com")
        +o = { "Metadata": metadata }
        +json.dump(o, sys.stdout, indent="\t")
        +

        You can find this example (slightly expanded) in the rclone source code at bin/test_metadata_mapper.py.

        +

        If you want to see the input to the metadata mapper and the output returned from it in the log you can use -vv --dump mapper.

        +

        See the metadata section for more info.

        +

        --metadata-set key=value

        +

        Add metadata key = value when uploading. This can be repeated as many times as required. See the metadata section for more info.

        --modify-window=TIME

        When checking whether a file has been modified, this is the maximum allowed time difference that a file can have and still be considered equivalent.

        The default is 1ns unless this is overridden by a remote. For example OS X only stores modification times to the nearest second so if you are reading and writing to an OS X filing system this will be 1s by default.

        This command line flag allows you to override that computed default.

        -

        --multi-thread-cutoff=SIZE

        -

        When downloading files to the local backend above this size, rclone will use multiple threads to download the file (default 250M).

        -

        Rclone preallocates the file (using fallocate(FALLOC_FL_KEEP_SIZE) on unix or NTSetInformationFile on Windows both of which takes no time) then each thread writes directly into the file at the correct place. This means that rclone won't create fragmented or sparse files and there won't be any assembly time at the end of the transfer.

        -

        The number of threads used to download is controlled by --multi-thread-streams.

        +

        --multi-thread-write-buffer-size=SIZE

        +

        When transferring with multiple threads, rclone will buffer SIZE bytes in memory before writing to disk for each thread.

        +

        This can improve performance if the underlying filesystem does not deal well with a lot of small writes in different positions of the file, so if you see transfers being limited by disk write speed, you might want to experiment with different values. Specially for magnetic drives and remote file systems a higher value can be useful.

        +

        Nevertheless, the default of 128k should be fine for almost all use cases, so before changing it ensure that network is not really your bottleneck.

        +

        As a final hint, size is not the only factor: block size (or similar concept) can have an impact. In one case, we observed that exact multiples of 16k performed much better than other values.

        +

        --multi-thread-chunk-size=SizeSuffix

        +

        Normally the chunk size for multi thread transfers is set by the backend. However some backends such as local and smb (which implement OpenWriterAt but not OpenChunkWriter) don't have a natural chunk size.

        +

        In this case the value of this option is used (default 64Mi).

        +

        --multi-thread-cutoff=SIZE

        +

        When transferring files above SIZE to capable backends, rclone will use multiple threads to transfer the file (default 256M).

        +

        Capable backends are marked in the overview as MultithreadUpload. (They need to implement either the OpenWriterAt or OpenChunkedWriter internal interfaces). These include include, local, s3, azureblob, b2, oracleobjectstorage and smb at the time of writing.

        +

        On the local disk, rclone preallocates the file (using fallocate(FALLOC_FL_KEEP_SIZE) on unix or NTSetInformationFile on Windows both of which takes no time) then each thread writes directly into the file at the correct place. This means that rclone won't create fragmented or sparse files and there won't be any assembly time at the end of the transfer.

        +

        The number of threads used to transfer is controlled by --multi-thread-streams.

        Use -vv if you wish to see info about the threads.

        -

        This will work with the sync/copy/move commands and friends copyto/moveto. Multi thread downloads will be used with rclone mount and rclone serve if --vfs-cache-mode is set to writes or above.

        -

        NB that this only works for a local destination but will work with any source.

        -

        NB that multi thread copies are disabled for local to local copies as they are faster without unless --multi-thread-streams is set explicitly.

        -

        NB on Windows using multi-thread downloads will cause the resulting files to be sparse. Use --local-no-sparse to disable sparse files (which may cause long delays at the start of downloads) or disable multi-thread downloads with --multi-thread-streams 0

        +

        This will work with the sync/copy/move commands and friends copyto/moveto. Multi thread transfers will be used with rclone mount and rclone serve if --vfs-cache-mode is set to writes or above.

        +

        NB that this only works with supported backends as the destination but will work with any backend as the source.

        +

        NB that multi-thread copies are disabled for local to local copies as they are faster without unless --multi-thread-streams is set explicitly.

        +

        NB on Windows using multi-thread transfers to the local disk will cause the resulting files to be sparse. Use --local-no-sparse to disable sparse files (which may cause long delays at the start of transfers) or disable multi-thread transfers with --multi-thread-streams 0

        --multi-thread-streams=N

        -

        When using multi thread downloads (see above --multi-thread-cutoff) this sets the maximum number of streams to use. Set to 0 to disable multi thread downloads (Default 4).

        -

        Exactly how many streams rclone uses for the download depends on the size of the file. To calculate the number of download streams Rclone divides the size of the file by the --multi-thread-cutoff and rounds up, up to the maximum set with --multi-thread-streams.

        -

        So if --multi-thread-cutoff 250M and --multi-thread-streams 4 are in effect (the defaults):

        -
          -
        • 0..250 MiB files will be downloaded with 1 stream
        • -
        • 250..500 MiB files will be downloaded with 2 streams
        • -
        • 500..750 MiB files will be downloaded with 3 streams
        • -
        • 750+ MiB files will be downloaded with 4 streams
        • -
        +

        When using multi thread transfers (see above --multi-thread-cutoff) this sets the number of streams to use. Set to 0 to disable multi thread transfers (Default 4).

        +

        If the backend has a --backend-upload-concurrency setting (eg --s3-upload-concurrency) then this setting will be used as the number of transfers instead if it is larger than the value of --multi-thread-streams or --multi-thread-streams isn't set.

        --no-check-dest

        The --no-check-dest can be used with move or copy and it causes rclone not to check the destination at all when copying files.

        This means that:

        @@ -4758,7 +6726,7 @@

        --order-by string

      • --order-by name - send the files with alphabetically by path first

      If the --order-by flag is not supplied or it is supplied with an empty string then the default ordering will be used which is as scanned. With --checkers 1 this is mostly alphabetical, however with the default --checkers 8 it is somewhat random.

      -

      Limitations

      +

      Limitations

      The --order-by flag does not do a separate pass over the data. This means that it may transfer some files out of the order specified if

      • there are no files in the backlog or the source has not been fully scanned yet
      • @@ -4766,13 +6734,17 @@

        Limitations

      Rclone will do its best to transfer the best file it has so in practice this should not cause a problem. Think of --order-by as being more of a best efforts flag rather than a perfect ordering.

      If you want perfect ordering then you will need to specify --check-first which will find all the files which need transferring first before transferring any.

      +

      --partial-suffix

      +

      When --inplace is not used, it causes rclone to use the --partial-suffix as suffix for temporary files.

      +

      Suffix length limit is 16 characters.

      +

      The default is .partial.

      --password-command SpaceSepList

      This flag supplies a program which should supply the config password when run. This is an alternative to rclone prompting for the password or setting the RCLONE_CONFIG_PASS variable.

      The argument to this should be a command with a space separated list of arguments. If one of the arguments has a space in then enclose it in ", if you want a literal " in an argument then enclose the argument in " and double the ". See CSV encoding for more info.

      Eg

      -
      --password-command echo hello
      ---password-command echo "hello with space"
      ---password-command echo "hello with ""quotes"" and space"
      +
      --password-command "echo hello"
      +--password-command 'echo "hello with space"'
      +--password-command 'echo "hello with ""quotes"" and space"'

      See the Configuration Encryption for more info.

      See a Windows PowerShell example on the Wiki.

      -P, --progress

      @@ -4843,6 +6815,7 @@

      --suffix=SUFFIX

      --suffix-keep-extension

      When using --suffix, setting this causes rclone put the SUFFIX before the extension of the files that it backs up rather than after.

      So let's say we had --suffix -2019-01-01, without the flag file.txt would be backed up to file.txt-2019-01-01 and with the flag it would be backed up to file-2019-01-01.txt. This can be helpful to make sure the suffixed files can still be opened.

      +

      If a file has two (or more) extensions and the second (or subsequent) extension is recognised as a valid mime type, then the suffix will go before that extension. So file.tar.gz would be backed up to file-2019-01-01.tar.gz whereas file.badextension.gz would be backed up to file.badextension-2019-01-01.gz.

      --syslog

      On capable OSes (not Windows or Plan9) send all log output to syslog.

      This can be useful for running rclone in a script or rclone mount.

      @@ -4894,18 +6867,12 @@

      --delete-(before,during,after)

      Specifying --delete-during will delete files while checking and uploading files. This is the fastest option and uses the least memory.

      Specifying --delete-after (the default value) will delay deletion of files until all new/updated files have been successfully transferred. The files to be deleted are collected in the copy pass then deleted after the copy pass has completed successfully. The files to be deleted are held in memory so this mode may use more memory. This is the safest mode as it will only delete files if there have been no errors subsequent to that. If there have been errors before the deletions start then you will get the message not deleting files as there were IO errors.

      --fast-list

      -

      When doing anything which involves a directory listing (e.g. sync, copy, ls - in fact nearly every command), rclone normally lists a directory and processes it before using more directory lists to process any subdirectories. This can be parallelised and works very quickly using the least amount of memory.

      -

      However, some remotes have a way of listing all files beneath a directory in one (or a small number) of transactions. These tend to be the bucket-based remotes (e.g. S3, B2, GCS, Swift).

      -

      If you use the --fast-list flag then rclone will use this method for listing directories. This will have the following consequences for the listing:

      -
        -
      • It will use fewer transactions (important if you pay for them)
      • -
      • It will use more memory. Rclone has to load the whole listing into memory.
      • -
      • It may be faster because it uses fewer transactions
      • -
      • It may be slower because it can't be parallelized
      • -
      -

      rclone should always give identical results with and without --fast-list.

      -

      If you pay for transactions and can fit your entire sync listing into memory then --fast-list is recommended. If you have a very big sync to do then don't use --fast-list otherwise you will run out of memory.

      -

      If you use --fast-list on a remote which doesn't support it, then rclone will just ignore it.

      +

      When doing anything which involves a directory listing (e.g. sync, copy, ls - in fact nearly every command), rclone has different strategies to choose from.

      +

      The basic strategy is to list one directory and processes it before using more directory lists to process any subdirectories. This is a mandatory backend feature, called List, which means it is supported by all backends. This strategy uses small amount of memory, and because it can be parallelised it is fast for operations involving processing of the list results.

      +

      Some backends provide the support for an alternative strategy, where all files beneath a directory can be listed in one (or a small number) of transactions. Rclone supports this alternative strategy through an optional backend feature called ListR. You can see in the storage system overview documentation's optional features section which backends it is enabled for (these tend to be the bucket-based ones, e.g. S3, B2, GCS, Swift). This strategy requires fewer transactions for highly recursive operations, which is important on backends where this is charged or heavily rate limited. It may be faster (due to fewer transactions) or slower (because it can't be parallelized) depending on different parameters, and may require more memory if rclone has to keep the whole listing in memory.

      +

      Which listing strategy rclone picks for a given operation is complicated, but in general it tries to choose the best possible. It will prefer ListR in situations where it doesn't need to store the listed files in memory, e.g. for unlimited recursive ls command variants. In other situations it will prefer List, e.g. for sync and copy, where it needs to keep the listed files in memory, and is performing operations on them where parallelization may be a huge advantage.

      +

      Rclone is not able to take all relevant parameters into account for deciding the best strategy, and therefore allows you to influence the choice in two ways: You can stop rclone from using ListR by disabling the feature, using the --disable option (--disable ListR), or you can allow rclone to use ListR where it would normally choose not to do so due to higher memory usage, using the --fast-list option. Rclone should always produce identical results either way. Using --disable ListR or --fast-list on a remote which doesn't support ListR does nothing, rclone will just ignore it.

      +

      A rule of thumb is that if you pay for transactions and can fit your entire sync listing into memory, then --fast-list is recommended. If you have a very big sync to do, then don't use --fast-list, otherwise you will run out of memory. Run some tests and compare before you decide, and if in doubt then just leave the default, let rclone decide, i.e. not use --fast-list.

      --timeout=TIME

      This sets the IO idle timeout. If a transfer has started but then becomes idle for this long it is considered broken and disconnected.

      The default is 5m. Set to 0 to disable.

      @@ -5022,6 +6989,8 @@

      --dump goroutines

      This dumps a list of the running go-routines at the end of the command to standard output.

      --dump openfiles

      This dumps a list of the open files at the end of the command. It uses the lsof command to do that so you'll need that installed to use it.

      +

      --dump mapper

      +

      This shows the JSON blobs being sent to the program supplied with --metadata-mapper and received from it. It can be useful for debugging the metadata mapper interface.

      --memprofile=FILE

      Write memory profile to file. This can be analysed with go tool pprof.

      Filtering

      @@ -5084,10 +7053,11 @@

      List of exit codes

    • 7 - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors)
    • 8 - Transfer exceeded - limit set by --max-transfer reached
    • 9 - Operation successful, but no files transferred
    • +
    • 10 - Duration exceeded - limit set by --max-duration reached

    Environment Variables

    Rclone can be configured entirely using environment variables. These can be used to set defaults for options or config file entries.

    -

    Options

    +

    Options

    Every option in rclone can have its default set by environment variable.

    To find the name of the environment variable, first, take the long option name, strip the leading --, change - to _, make upper case and prepend RCLONE_.

    For example, to always set --stats 5s, set the environment variable RCLONE_STATS=5s. If you set stats on the command line this will override the environment variable setting.

    @@ -5097,7 +7067,7 @@

    Options

    The options set by environment variables can be seen with the -vv flag, e.g. rclone version -vv.

    Config file

    You can set defaults for values in the config file on an individual remote basis. The names of the config items are documented in the page for each backend.

    -

    To find the name of the environment variable, you need to set, take RCLONE_CONFIG_ + name of remote + _ + name of config file option and make it all uppercase.

    +

    To find the name of the environment variable, you need to set, take RCLONE_CONFIG_ + name of remote + _ + name of config file option and make it all uppercase. Note one implication here is the remote's name must be convertible into a valid environment variable name, so it can only contain letters, digits, or the _ (underscore) character.

    For example, to configure an S3 remote named mys3: without a config file (using unix ways of setting environment variables):

    $ export RCLONE_CONFIG_MYS3_TYPE=s3
     $ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX
    @@ -5224,7 +7194,7 @@ 

    Filtering, includes and excludes

    To test filters without risk of damage to data, apply them to rclone ls, or with the --dry-run and -vv flags.

    Rclone filter patterns can only be used in filter command line options, not in the specification of a remote.

    E.g. rclone copy "remote:dir*.jpg" /path/to/dir does not have a filter effect. rclone copy remote:dir /path/to/dir --include "*.jpg" does.

    -

    Important Avoid mixing any two of --include..., --exclude... or --filter... flags in an rclone command. The results may not be what you expect. Instead use a --filter... flag.

    +

    Important Avoid mixing any two of --include..., --exclude... or --filter... flags in an rclone command. The results might not be what you expect. Instead use a --filter... flag.

    Patterns for matching path/file names

    Pattern syntax

    Here is a formal definition of the pattern syntax, examples are below.

    @@ -5261,7 +7231,7 @@

    Pattern syntax

    /file.jpg - matches "file.jpg" in the root directory of the remote - doesn't match "afile.jpg" - doesn't match "directory/file.jpg"
    -

    The top level of the remote may not be the top level of the drive.

    +

    The top level of the remote might not be the top level of the drive.

    E.g. for a Microsoft Windows local directory structure

    F:
     ├── bkp
    @@ -5296,7 +7266,7 @@ 

    Using regular expressions in filter patterns

    Not

    {{start.*end\.jpg}}

    Which will match a directory called start with a file called end.jpg in it as the .* will match / characters.

    -

    Note that you can use -vv --dump filters to show the filter patterns in regexp format - rclone implements the glob patters by transforming them into regular expressions.

    +

    Note that you can use -vv --dump filters to show the filter patterns in regexp format - rclone implements the glob patterns by transforming them into regular expressions.

    Filter pattern examples

    @@ -5490,7 +7460,7 @@

    --exclude - Exclu

    --exclude has no effect when combined with --files-from or --files-from-raw flags.

    E.g. rclone ls remote: --exclude *.bak excludes all .bak files from listing.

    E.g. rclone size remote: "--exclude /dir/**" returns the total size of all files on remote: excluding those in root directory dir and sub directories.

    -

    E.g. on Microsoft Windows rclone ls remote: --exclude "*\[{JP,KR,HK}\]*" lists the files in remote: with [JP] or [KR] or [HK] in their name. Quotes prevent the shell from interpreting the \ characters.\ characters escape the [ and ] so an rclone filter treats them literally rather than as a character-range. The { and } define an rclone pattern list. For other operating systems single quotes are required ie rclone ls remote: --exclude '*\[{JP,KR,HK}\]*'

    +

    E.g. on Microsoft Windows rclone ls remote: --exclude "*\[{JP,KR,HK}\]*" lists the files in remote: without [JP] or [KR] or [HK] in their name. Quotes prevent the shell from interpreting the \ characters.\ characters escape the [ and ] so an rclone filter treats them literally rather than as a character-range. The { and } define an rclone pattern list. For other operating systems single quotes are required ie rclone ls remote: --exclude '*\[{JP,KR,HK}\]*'

    --exclude-from - Read exclude patterns from file

    Excludes path/file names from an rclone command based on rules in a named file. The file contains a list of remarks and pattern rules.

    For an example exclude-file.txt:

    @@ -5901,7 +7871,7 @@

    Setting config flags with _config

    For example, if you wished to run a sync with the --checksum parameter, you would pass this parameter in your JSON blob.

    "_config":{"CheckSum": true}

    If using rclone rc this could be passed as

    -
    rclone rc operations/sync ... _config='{"CheckSum": true}'
    +
    rclone rc sync/sync ... _config='{"CheckSum": true}'

    Any config parameters you don't set will inherit the global defaults which were set with command line flags or environment variables.

    Note that it is possible to set some values as strings or integers - see data types for more info. Here is an example setting the equivalent of --buffer-size in string or integer format.

    "_config":{"BufferSize": "42M"}
    @@ -6052,7 +8022,7 @@ 

    config/get: Get a remote in the config file.

    See the config dump command for more information on the above.

    Authentication is required for this call.

    -

    config/listremotes: Lists the remotes in the config file.

    +

    config/listremotes: Lists the remotes in the config file and defined in environment variables.

    Returns - remotes - array of remote names

    See the listremotes command for more information on the above.

    Authentication is required for this call.

    @@ -6164,6 +8134,21 @@

    core/command: Run a rclone terminal command over rc.

    }

    Authentication is required for this call.

    +

    core/du: Returns disk usage of a locally attached disk.

    +

    This returns the disk usage for the local directory passed in as dir.

    +

    If the directory is not passed in, it defaults to the directory pointed to by --cache-dir.

    +
      +
    • dir - string (optional)
    • +
    +

    Returns:

    +
    {
    +    "dir": "/",
    +    "info": {
    +        "Available": 361769115648,
    +        "Free": 361785892864,
    +        "Total": 982141468672
    +    }
    +}

    core/gc: Runs a garbage collection.

    This tells the go runtime to do a garbage collection run. It isn't necessary to call this normally, but it can be useful for debugging memory problems.

    core/group-list: Returns list of stats.

    @@ -6215,6 +8200,10 @@

    core/stats: Returns stats about current transfers.

    "lastError": last error string, "renames" : number of files renamed, "retryError": boolean showing whether there has been at least one non-NoRetryError, + "serverSideCopies": number of server side copies done, + "serverSideCopyBytes": number bytes server side copied, + "serverSideMoves": number of server side moves done, + "serverSideMoveBytes": number bytes server side moved, "speed": average speed in bytes per second since start of the group, "totalBytes": total number of bytes in the group, "totalChecks": total number of checks in the group, @@ -6340,7 +8329,8 @@

    job/list: Lists the IDs of the running jobs

    Parameters: None.

    Results:

      -
    • jobids - array of integer job ids.
    • +
    • executeId - string id of rclone executing (change after restart)
    • +
    • jobids - array of integer job ids (starting at 1 on each restart)

    job/status: Reads the status of the job ID

    Parameters:

    @@ -6430,6 +8420,40 @@

    operations/about: Return the space used on the remote<

    The result is as returned from rclone about --json

    See the about command for more information on the above.

    Authentication is required for this call.

    +

    operations/check: check the source and destination are the same

    +

    Checks the files in the source and destination match. It compares sizes and hashes and logs a report of files that don't match. It doesn't alter the source or destination.

    +

    This takes the following parameters:

    +
      +
    • srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem
    • +
    • dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem
    • +
    • download - check by downloading rather than with hash
    • +
    • checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type
    • +
    • checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type
    • +
    • checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type
    • +
    • oneWay - check one way only, source files must exist on remote
    • +
    • combined - make a combined report of changes (default false)
    • +
    • missingOnSrc - report all files missing from the source (default true)
    • +
    • missingOnDst - report all files missing from the destination (default true)
    • +
    • match - report all matching files (default false)
    • +
    • differ - report all non-matching files (default true)
    • +
    • error - report all files with errors (hashing or reading) (default true)
    • +
    +

    If you supply the download flag, it will download the data from both remotes and check them against each other on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data.

    +

    If you supply the size-only global flag, it will only compare the sizes not the hashes as well. Use this for a quick check.

    +

    If you supply the checkFileHash option with a valid hash name, the checkFileFs:checkFileRemote must point to a text file in the SUM format. This treats the checksum file as the source and dstFs as the destination. Note that srcFs is not used and should not be supplied in this case.

    +

    Returns:

    +
      +
    • success - true if no error, false otherwise
    • +
    • status - textual summary of check, OK or text string
    • +
    • hashType - hash used in check, may be missing
    • +
    • combined - array of strings of combined report of changes
    • +
    • missingOnSrc - array of strings of all files missing from the source
    • +
    • missingOnDst - array of strings of all files missing from the destination
    • +
    • match - array of strings of all matching files
    • +
    • differ - array of strings of all non-matching files
    • +
    • error - array of strings of all files with errors (hashing or reading)
    • +
    +

    Authentication is required for this call.

    operations/cleanup: Remove trashed files in the remote or path

    This takes the following parameters:

      @@ -6440,9 +8464,9 @@

      operations/cleanup: Remove trashed files in the remo

      operations/copyfile: Copy a file from source remote to destination remote

      This takes the following parameters:

        -
      • srcFs - a remote name string e.g. "drive:" for the source
      • +
      • srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem
      • srcRemote - a path within that remote e.g. "file.txt" for the source
      • -
      • dstFs - a remote name string e.g. "drive2:" for the destination
      • +
      • dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem
      • dstRemote - a path within that remote e.g. "file2.txt" for the destination

      Authentication is required for this call.

      @@ -6617,9 +8641,9 @@

      operations/mkdir: Make a destination directory or cont

      operations/movefile: Move a file from source remote to destination remote

      This takes the following parameters:

        -
      • srcFs - a remote name string e.g. "drive:" for the source
      • +
      • srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem
      • srcRemote - a path within that remote e.g. "file.txt" for the source
      • -
      • dstFs - a remote name string e.g. "drive2:" for the destination
      • +
      • dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem
      • dstRemote - a path within that remote e.g. "file2.txt" for the destination

      Authentication is required for this call.

      @@ -6662,6 +8686,21 @@

      operations/rmdirs: Remove all the empty directories i

    See the rmdirs command for more information on the above.

    Authentication is required for this call.

    +

    operations/settier: Changes storage tier or class on all files in the path

    +

    This takes the following parameters:

    +
      +
    • fs - a remote name string e.g. "drive:"
    • +
    +

    See the settier command for more information on the above.

    +

    Authentication is required for this call.

    +

    operations/settierfile: Changes storage tier or class on the single file pointed to

    +

    This takes the following parameters:

    +
      +
    • fs - a remote name string e.g. "drive:"
    • +
    • remote - a path within that remote e.g. "dir"
    • +
    +

    See the settierfile command for more information on the above.

    +

    Authentication is required for this call.

    operations/size: Count the number of bytes and files in remote

    This takes the following parameters:

      @@ -6809,10 +8848,13 @@

      sync/bisync: Perform bidirectional synchronization between
    • checkAccess - abort if RCLONE_TEST files are not found on both filesystems
    • checkFilename - file name for checkAccess (default: RCLONE_TEST)
    • maxDelete - abort sync if percentage of deleted files is above this threshold (default: 50)
    • -
    • force - maxDelete safety check and run the sync
    • +
    • force - Bypass maxDelete safety check and run the sync
    • checkSync - true by default, false disables comparison of final listings, only will skip sync, only compare listings from the last run
    • +
    • createEmptySrcDirs - Sync creation and deletion of empty directories. (Not compatible with --remove-empty-dirs)
    • removeEmptyDirs - remove empty directories at the final cleanup step
    • filtersFile - read filtering patterns from a file
    • +
    • ignoreListingChecksum - Do not use checksums for listings
    • +
    • resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. Use at your own risk!
    • workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync)
    • noCleanup - retain working files
    @@ -7140,7 +9182,7 @@

    Features

    - + @@ -7199,7 +9241,7 @@

    Features

    - + @@ -7211,6 +9253,15 @@

    Features

    + + + + + + + + + @@ -7219,7 +9270,7 @@

    Features

    - + @@ -7228,7 +9279,7 @@

    Features

    - + @@ -7237,7 +9288,7 @@

    Features

    - + @@ -7246,6 +9297,15 @@

    Features

    + + + + + + + + + @@ -7292,6 +9352,15 @@

    Features

    + + + + + + + + + @@ -7300,7 +9369,7 @@

    Features

    - + @@ -7309,6 +9378,15 @@

    Features

    + + + + + + + + + @@ -7319,6 +9397,15 @@

    Features

    + + + + + + + + + @@ -7327,7 +9414,7 @@

    Features

    - + @@ -7336,7 +9423,7 @@

    Features

    - + @@ -7345,16 +9432,16 @@

    Features

    - + - + - + @@ -7363,7 +9450,7 @@

    Features

    - + @@ -7372,7 +9459,7 @@

    Features

    - + @@ -7381,7 +9468,7 @@

    Features

    - + @@ -7390,7 +9477,7 @@

    Features

    - + @@ -7399,7 +9486,7 @@

    Features

    - + @@ -7408,7 +9495,7 @@

    Features

    - + @@ -7419,17 +9506,16 @@

    Features

    Google DriveMD5MD5, SHA1, SHA256 R/W No Yes Yes No R-RW
    Koofr -
    Linkbox-RNoNo--
    Mail.ru Cloud Mailru ⁶ R/W - -
    Mega - - - -
    Memory MD5 R/W - -
    Microsoft Azure Blob Storage MD5 R/W R/W -
    Microsoft Azure Files StorageMD5R/WYesNoR/W-
    Microsoft OneDrive QuickXorHash ⁵ -
    PikPakMD5RNoNoR-
    premiumize.me - - R -
    put.io CRC-32 R/W R -
    Proton DriveSHA1R/WNoNoR-
    QingStor MD5 -
    Quatrix by Maytech-R/WNoNo--
    Seafile - - - -
    SFTP MD5, SHA1 ² R/W - -
    Sia - - - -
    SMB --R/W Yes No - -
    SugarSync - - - -
    Storj - R - -
    Uptobox - - - -
    WebDAV MD5, SHA1 ³ R ⁴ - -
    Yandex Disk MD5 R/W R -
    Zoho WorkDrive - - - -
    The local filesystem All R/W
    -

    Notes

    ¹ Dropbox supports its own custom hash. This is an SHA256 sum of all the 4 MiB block SHA256s.

    ² SFTP supports checksums if the same login has shell access and md5sum or sha1sum as well as echo are in the remote's PATH.

    -

    ³ WebDAV supports hashes when used with Owncloud and Nextcloud only.

    -

    ⁴ WebDAV supports modtimes when used with Owncloud and Nextcloud only.

    +

    ³ WebDAV supports hashes when used with Fastmail Files, Owncloud and Nextcloud only.

    +

    ⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and Nextcloud only.

    QuickXorHash is Microsoft's own hash.

    ⁶ Mail.ru uses its own modified SHA1 hash

    ⁷ pCloud only supports SHA1 (not MD5) in its EU region

    ⁸ Opendrive does not support creation of duplicate files using their web client interface or other stock clients, but the underlying storage platform has been determined to allow duplicate files, and it is possible to create them with rclone. It may be that this is a mistake or an unsupported feature.

    ⁹ QingStor does not support SetModTime for objects bigger than 5 GiB.

    -

    ¹⁰ FTP supports modtimes for the major FTP servers, and also others if they advertised required protocol extensions. See this for more details.

    +

    ¹⁰ FTP supports modtimes for the major FTP servers, and also others if they advertised required protocol extensions. See this for more details.

    ¹¹ Internet Archive requires option wait_archive to be set to a non-zero value for full modtime support.

    ¹² HiDrive supports its own custom hash. It combines SHA1 sums for each 4 KiB block hierarchically to a single top-level sum.

    Hash

    @@ -7885,7 +9971,21 @@

    Metadata

    See the metadata docs for more info.

    Optional Features

    All rclone remotes support a base command set. Other features depend upon backend-specific capabilities.

    - +
    ++++++++++++++ @@ -7896,6 +9996,7 @@

    Optional Features

    + @@ -7911,6 +10012,7 @@

    Optional Features

    + @@ -7924,6 +10026,7 @@

    Optional Features

    + @@ -7937,6 +10040,7 @@

    Optional Features

    + @@ -7950,6 +10054,7 @@

    Optional Features

    + @@ -7963,6 +10068,7 @@

    Optional Features

    + @@ -7973,9 +10079,10 @@

    Optional Features

    - + + @@ -7988,7 +10095,8 @@

    Optional Features

    - + + @@ -8002,6 +10110,7 @@

    Optional Features

    + @@ -8015,6 +10124,7 @@

    Optional Features

    + @@ -8028,6 +10138,7 @@

    Optional Features

    + @@ -8041,6 +10152,7 @@

    Optional Features

    + @@ -8054,6 +10166,7 @@

    Optional Features

    + @@ -8067,6 +10180,7 @@

    Optional Features

    + @@ -8080,6 +10194,7 @@

    Optional Features

    + @@ -8093,6 +10208,7 @@

    Optional Features

    + @@ -8106,6 +10222,7 @@

    Optional Features

    + @@ -8119,6 +10236,7 @@

    Optional Features

    + @@ -8132,6 +10250,7 @@

    Optional Features

    + @@ -8145,6 +10264,7 @@

    Optional Features

    + @@ -8158,6 +10278,7 @@

    Optional Features

    + @@ -8171,6 +10292,7 @@

    Optional Features

    + @@ -8184,6 +10306,7 @@

    Optional Features

    + @@ -8197,24 +10320,40 @@

    Optional Features

    + + + + + + + + + + + + + + + + - + - + @@ -8223,24 +10362,26 @@

    Optional Features

    + - + - + + - + @@ -8249,11 +10390,12 @@

    Optional Features

    + - + @@ -8262,6 +10404,21 @@

    Optional Features

    + + + + + + + + + + + + + + + @@ -8275,6 +10432,7 @@

    Optional Features

    + @@ -8288,11 +10446,26 @@

    Optional Features

    + + + + + + + + + + + + + + + @@ -8301,9 +10474,24 @@

    Optional Features

    + + + + + + + + + + + + + + + @@ -8314,6 +10502,7 @@

    Optional Features

    + @@ -8321,12 +10510,13 @@

    Optional Features

    - + + @@ -8340,6 +10530,7 @@

    Optional Features

    + @@ -8353,6 +10544,7 @@

    Optional Features

    + @@ -8366,19 +10558,21 @@

    Optional Features

    + - + + @@ -8392,6 +10586,7 @@

    Optional Features

    + @@ -8404,7 +10599,8 @@

    Optional Features

    - + + @@ -8418,6 +10614,7 @@

    Optional Features

    + @@ -8431,6 +10628,7 @@

    Optional Features

    + @@ -8444,17 +10642,20 @@

    Optional Features

    +
    Name CleanUp ListR StreamUploadMultithreadUpload LinkSharing About EmptyDir No No NoNo Yes No Yes No Yes YesNo No No Yes No No NoNo No No Yes Yes Yes YesYes Yes No No Yes Yes YesYes Yes No No Yes Yes YesYes ‡‡Yes No YesNo Yes Yes Yes Yes No NoYesNoNo No No Yes No No YesNo Yes Yes Yes Yes No NoNo No No Yes No No YesNo No No Yes No Yes YesNo No No No Yes Yes YesNo Yes Yes Yes No No NoNo No No No No No YesNo No Yes Yes No No YesNo No No Yes No No NoNo No No Yes Yes Yes NoNo Yes Yes No Yes Yes NoNo Yes Yes Yes No No YesNo Yes Yes Yes Yes No NoNo Yes Yes Yes Yes No NoNo Yes Yes Yes No Yes YesNo No No No No Yes YesYes No No No
    Microsoft Azure Files StorageNoYesYesYesNoNoYesYesNoYesYes
    Microsoft OneDrive Yes Yes Yes Yes YesYes ⁵ NoNoNo Yes Yes Yes
    OpenDrive Yes Yes No No NoNo No No Yes
    OpenStack SwiftYes †Yes ¹ Yes No No No Yes YesNo No Yes No
    Oracle Object Storage No Yes Yes Yes YesYes No No No
    pCloud Yes Yes Yes No NoNoYesYesYes
    PikPakYesYesYesYesYesNoNoNo Yes Yes Yes No No NoNo Yes Yes Yes Yes No YesNo No Yes Yes
    Proton DriveYesNoYesYesYesNoNoNoNoYesYes
    QingStor No Yes Yes Yes NoNoNoNoNo
    Quatrix by MaytechYesYesYesYesNo No NoNo NoYesYes
    Seafile Yes Yes YesNo Yes Yes Yes
    SFTP NoNoYes ⁴ Yes Yes No No YesNo No Yes Yes No No YesNo No No Yes No No YesYes No No Yes No No YesNo Yes No Yes
    StorjYes ☨Yes ² Yes Yes No No Yes YesNo Yes No No No No NoNo No No No Yes No NoYes ‡Yes ³No No Yes Yes Yes No YesNo Yes Yes Yes No No NoNo No Yes Yes No No YesYes No Yes Yes
    +

    ¹ Note Swift implements this in order to delete directory markers but it doesn't actually have a quicker way of deleting files other than deleting them individually.

    +

    ² Storj implements this efficiently only for entire buckets. If purging a directory inside a bucket, files are deleted individually.

    +

    ³ StreamUpload is not supported with Nextcloud

    +

    ⁴ Use the --sftp-copy-is-hardlink flag to enable.

    +

    ⁵ Use the --onedrive-delta flag to enable.

    Purge

    This deletes a directory quicker than just deleting all the files in the directory.

    -

    † Note Swift implements this in order to delete directory markers but they don't actually have a quicker way of deleting files other than deleting them individually.

    -

    ☨ Storj implements this efficiently only for entire buckets. If purging a directory inside a bucket, files are deleted individually.

    -

    ‡ StreamUpload is not supported with Nextcloud

    Copy

    Used when copying an object to and from the same remote. This known as a server-side copy so you can copy a file without downloading it and uploading it again. It is used if you use rclone copy or rclone move if the remote doesn't support Move directly.

    If the server doesn't support Copy directly then for copy operations the file is downloaded then re-uploaded.

    @@ -8471,6 +10672,8 @@

    ListR

    The remote supports a recursive list to list all the contents beneath a directory quickly. This enables the --fast-list flag to work. See the rclone docs for more details.

    StreamUpload

    Some remotes allow files to be uploaded without knowing the file size in advance. This allows certain operations to work without spooling the file to local disk first, e.g. rclone rcat.

    +

    MultithreadUpload

    +

    Some remotes allow transfers to the remote to be sent as chunks in parallel. If this is supported then rclone will use multi-thread copying to transfer files much faster.

    LinkSharing

    Sets the necessary permissions on a file or folder and prints a link that allows others to access them, even if they don't have an account on the particular cloud provider.

    About

    @@ -8481,719 +10684,876 @@

    About

    EmptyDir

    The remote supports empty directories. See Limitations for details. Most Object/Bucket-based remotes do not support this.

    Global Flags

    -

    This describes the global flags available to every rclone command split into two groups, non backend and backend flags.

    -

    Non Backend Flags

    -

    These flags are available for every command.

    -
          --ask-password                         Allow prompt for password for encrypted configuration (default true)
    -      --auto-confirm                         If enabled, do not request console confirmation
    -      --backup-dir string                    Make backups into hierarchy based in DIR
    -      --bind string                          Local address to bind to for outgoing connections, IPv4, IPv6 or name
    -      --buffer-size SizeSuffix               In memory buffer size when reading files for each --transfer (default 16Mi)
    -      --bwlimit BwTimetable                  Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable
    -      --bwlimit-file BwTimetable             Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable
    -      --ca-cert stringArray                  CA certificate used to verify servers
    -      --cache-dir string                     Directory rclone will use for caching (default "$HOME/.cache/rclone")
    -      --check-first                          Do all the checks before starting transfers
    -      --checkers int                         Number of checkers to run in parallel (default 8)
    -  -c, --checksum                             Skip based on checksum (if available) & size, not mod-time & size
    -      --client-cert string                   Client SSL certificate (PEM) for mutual TLS auth
    -      --client-key string                    Client SSL private key (PEM) for mutual TLS auth
    -      --color string                         When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO")
    -      --compare-dest stringArray             Include additional comma separated server-side paths during comparison
    -      --config string                        Config file (default "$HOME/.config/rclone/rclone.conf")
    -      --contimeout Duration                  Connect timeout (default 1m0s)
    -      --copy-dest stringArray                Implies --compare-dest but also copies files from paths into destination
    -      --cpuprofile string                    Write cpu profile to file
    -      --cutoff-mode string                   Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD")
    -      --delete-after                         When synchronizing, delete files on destination after transferring (default)
    -      --delete-before                        When synchronizing, delete files on destination before transferring
    -      --delete-during                        When synchronizing, delete files during transfer
    -      --delete-excluded                      Delete files on dest excluded from sync
    -      --disable string                       Disable a comma separated list of features (use --disable help to see a list)
    -      --disable-http-keep-alives             Disable HTTP keep-alives and use each connection once.
    -      --disable-http2                        Disable HTTP/2 in the global transport
    -  -n, --dry-run                              Do a trial run with no permanent changes
    -      --dscp string                          Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21
    -      --dump DumpFlags                       List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles
    -      --dump-bodies                          Dump HTTP headers and bodies - may contain sensitive info
    -      --dump-headers                         Dump HTTP headers - may contain sensitive info
    -      --error-on-no-transfer                 Sets exit code 9 if no files are transferred, useful in scripts
    -      --exclude stringArray                  Exclude files matching pattern
    -      --exclude-from stringArray             Read file exclude patterns from file (use - to read from stdin)
    -      --exclude-if-present stringArray       Exclude directories if filename is present
    -      --expect-continue-timeout Duration     Timeout when using expect / 100-continue in HTTP (default 1s)
    -      --fast-list                            Use recursive list if available; uses more memory but fewer transactions
    -      --files-from stringArray               Read list of source-file names from file (use - to read from stdin)
    -      --files-from-raw stringArray           Read list of source-file names from file without any processing of lines (use - to read from stdin)
    -  -f, --filter stringArray                   Add a file filtering rule
    -      --filter-from stringArray              Read file filtering patterns from a file (use - to read from stdin)
    -      --fs-cache-expire-duration Duration    Cache remotes for this long (0 to disable caching) (default 5m0s)
    -      --fs-cache-expire-interval Duration    Interval to check for expired remotes (default 1m0s)
    -      --header stringArray                   Set HTTP header for all transactions
    -      --header-download stringArray          Set HTTP header for download transactions
    -      --header-upload stringArray            Set HTTP header for upload transactions
    -      --human-readable                       Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi
    -      --ignore-case                          Ignore case in filters (case insensitive)
    -      --ignore-case-sync                     Ignore case when synchronizing
    -      --ignore-checksum                      Skip post copy check of checksums
    -      --ignore-errors                        Delete even if there are I/O errors
    -      --ignore-existing                      Skip all files that exist on destination
    -      --ignore-size                          Ignore size when skipping use mod-time or checksum
    -  -I, --ignore-times                         Don't skip files that match size and time - transfer all files
    -      --immutable                            Do not modify files, fail if existing files have been modified
    -      --include stringArray                  Include files matching pattern
    -      --include-from stringArray             Read file include patterns from file (use - to read from stdin)
    -  -i, --interactive                          Enable interactive mode
    -      --kv-lock-time Duration                Maximum time to keep key-value database locked by process (default 1s)
    -      --log-file string                      Log everything to this file
    -      --log-format string                    Comma separated list of log format options (default "date,time")
    -      --log-level string                     Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE")
    -      --log-systemd                          Activate systemd integration for the logger
    -      --low-level-retries int                Number of low level retries to do (default 10)
    -      --max-age Duration                     Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    -      --max-backlog int                      Maximum number of objects in sync or check backlog (default 10000)
    -      --max-delete int                       When synchronizing, limit the number of deletes (default -1)
    -      --max-delete-size SizeSuffix           When synchronizing, limit the total size of deletes (default off)
    -      --max-depth int                        If set limits the recursion depth to this (default -1)
    -      --max-duration Duration                Maximum duration rclone will transfer data for (default 0s)
    -      --max-size SizeSuffix                  Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    -      --max-stats-groups int                 Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000)
    -      --max-transfer SizeSuffix              Maximum size of data to transfer (default off)
    -      --memprofile string                    Write memory profile to file
    -  -M, --metadata                             If set, preserve metadata when copying objects
    -      --metadata-exclude stringArray         Exclude metadatas matching pattern
    -      --metadata-exclude-from stringArray    Read metadata exclude patterns from file (use - to read from stdin)
    -      --metadata-filter stringArray          Add a metadata filtering rule
    -      --metadata-filter-from stringArray     Read metadata filtering patterns from a file (use - to read from stdin)
    -      --metadata-include stringArray         Include metadatas matching pattern
    -      --metadata-include-from stringArray    Read metadata include patterns from file (use - to read from stdin)
    -      --metadata-set stringArray             Add metadata key=value when uploading
    -      --min-age Duration                     Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    -      --min-size SizeSuffix                  Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    -      --modify-window Duration               Max time diff to be considered the same (default 1ns)
    -      --multi-thread-cutoff SizeSuffix       Use multi-thread downloads for files above this size (default 250Mi)
    -      --multi-thread-streams int             Max number of streams to use for multi-thread downloads (default 4)
    -      --no-check-certificate                 Do not verify the server SSL certificate (insecure)
    -      --no-check-dest                        Don't check the destination, copy regardless
    -      --no-console                           Hide console window (supported on Windows only)
    -      --no-gzip-encoding                     Don't set Accept-Encoding: gzip
    -      --no-traverse                          Don't traverse destination file system on copy
    -      --no-unicode-normalization             Don't normalize unicode characters in filenames
    -      --no-update-modtime                    Don't update destination mod-time if files identical
    -      --order-by string                      Instructions on how to order the transfers, e.g. 'size,descending'
    -      --password-command SpaceSepList        Command for supplying password for encrypted configuration
    -  -P, --progress                             Show progress during transfer
    -      --progress-terminal-title              Show progress on the terminal title (requires -P/--progress)
    -  -q, --quiet                                Print as little stuff as possible
    -      --rc                                   Enable the remote control server
    -      --rc-addr stringArray                  IPaddress:Port or :Port to bind server to (default [localhost:5572])
    -      --rc-allow-origin string               Set the allowed origin for CORS
    -      --rc-baseurl string                    Prefix for URLs - leave blank for root
    -      --rc-cert string                       TLS PEM key (concatenation of certificate and CA certificate)
    -      --rc-client-ca string                  Client certificate authority to verify clients with
    -      --rc-enable-metrics                    Enable prometheus metrics on /metrics
    -      --rc-files string                      Path to local files to serve on the HTTP server
    -      --rc-htpasswd string                   A htpasswd file - if not provided no authentication is done
    -      --rc-job-expire-duration Duration      Expire finished async jobs older than this value (default 1m0s)
    -      --rc-job-expire-interval Duration      Interval to check for expired async jobs (default 10s)
    -      --rc-key string                        TLS PEM Private key
    -      --rc-max-header-bytes int              Maximum size of request header (default 4096)
    -      --rc-min-tls-version string            Minimum TLS version that is acceptable (default "tls1.0")
    -      --rc-no-auth                           Don't require auth for certain methods
    -      --rc-pass string                       Password for authentication
    -      --rc-realm string                      Realm for authentication
    -      --rc-salt string                       Password hashing salt (default "dlPL2MqE")
    -      --rc-serve                             Enable the serving of remote objects
    -      --rc-server-read-timeout Duration      Timeout for server reading data (default 1h0m0s)
    -      --rc-server-write-timeout Duration     Timeout for server writing data (default 1h0m0s)
    -      --rc-template string                   User-specified template
    -      --rc-user string                       User name for authentication
    -      --rc-web-fetch-url string              URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest")
    -      --rc-web-gui                           Launch WebGUI on localhost
    -      --rc-web-gui-force-update              Force update to latest version of web gui
    -      --rc-web-gui-no-open-browser           Don't open the browser automatically
    -      --rc-web-gui-update                    Check and update to latest version of web gui
    -      --refresh-times                        Refresh the modtime of remote files
    -      --retries int                          Retry operations this many times if they fail (default 3)
    -      --retries-sleep Duration               Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s)
    -      --server-side-across-configs           Allow server-side operations (e.g. copy) to work across different configs
    -      --size-only                            Skip based on size only, not mod-time or checksum
    -      --stats Duration                       Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s)
    -      --stats-file-name-length int           Max file name length in stats (0 for no limit) (default 45)
    -      --stats-log-level string               Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO")
    -      --stats-one-line                       Make the stats fit on one line
    -      --stats-one-line-date                  Enable --stats-one-line and add current date/time prefix
    -      --stats-one-line-date-format string    Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format
    -      --stats-unit string                    Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes")
    -      --streaming-upload-cutoff SizeSuffix   Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
    -      --suffix string                        Suffix to add to changed files
    -      --suffix-keep-extension                Preserve the extension when using --suffix
    -      --syslog                               Use Syslog for logging
    -      --syslog-facility string               Facility for syslog, e.g. KERN,USER,... (default "DAEMON")
    -      --temp-dir string                      Directory rclone will use for temporary files (default "/tmp")
    -      --timeout Duration                     IO idle timeout (default 5m0s)
    -      --tpslimit float                       Limit HTTP transactions per second to this
    -      --tpslimit-burst int                   Max burst of transactions for --tpslimit (default 1)
    -      --track-renames                        When synchronizing, track file renames and do a server-side move if possible
    -      --track-renames-strategy string        Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash")
    -      --transfers int                        Number of file transfers to run in parallel (default 4)
    -  -u, --update                               Skip files that are newer on the destination
    -      --use-cookies                          Enable session cookiejar
    -      --use-json-log                         Use json log format
    -      --use-mmap                             Use mmap allocator (see docs)
    -      --use-server-modtime                   Use server modified time instead of object metadata
    -      --user-agent string                    Set the user-agent to a specified string (default "rclone/v1.62.0")
    -  -v, --verbose count                        Print lots more stuff (repeat for more)
    -

    Backend Flags

    -

    These flags are available for every command. They control the backends and may be set in the config file.

    -
          --acd-auth-url string                            Auth server URL
    -      --acd-client-id string                           OAuth Client Id
    -      --acd-client-secret string                       OAuth Client Secret
    -      --acd-encoding MultiEncoder                      The encoding for the backend (default Slash,InvalidUtf8,Dot)
    -      --acd-templink-threshold SizeSuffix              Files >= this size will be downloaded via their tempLink (default 9Gi)
    -      --acd-token string                               OAuth Access Token as a JSON blob
    -      --acd-token-url string                           Token server url
    -      --acd-upload-wait-per-gb Duration                Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s)
    -      --alias-remote string                            Remote or path to alias
    -      --azureblob-access-tier string                   Access tier of blob: hot, cool or archive
    -      --azureblob-account string                       Azure Storage Account Name
    -      --azureblob-archive-tier-delete                  Delete archive tier blobs before overwriting
    -      --azureblob-chunk-size SizeSuffix                Upload chunk size (default 4Mi)
    -      --azureblob-client-certificate-password string   Password for the certificate file (optional) (obscured)
    -      --azureblob-client-certificate-path string       Path to a PEM or PKCS12 certificate file including the private key
    -      --azureblob-client-id string                     The ID of the client in use
    -      --azureblob-client-secret string                 One of the service principal's client secrets
    -      --azureblob-client-send-certificate-chain        Send the certificate chain when using certificate auth
    -      --azureblob-disable-checksum                     Don't store MD5 checksum with object metadata
    -      --azureblob-encoding MultiEncoder                The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8)
    -      --azureblob-endpoint string                      Endpoint for the service
    -      --azureblob-env-auth                             Read credentials from runtime (environment variables, CLI or MSI)
    -      --azureblob-key string                           Storage Account Shared Key
    -      --azureblob-list-chunk int                       Size of blob list (default 5000)
    -      --azureblob-memory-pool-flush-time Duration      How often internal memory buffer pools will be flushed (default 1m0s)
    -      --azureblob-memory-pool-use-mmap                 Whether to use mmap buffers in internal memory pool
    -      --azureblob-msi-client-id string                 Object ID of the user-assigned MSI to use, if any
    -      --azureblob-msi-mi-res-id string                 Azure resource ID of the user-assigned MSI to use, if any
    -      --azureblob-msi-object-id string                 Object ID of the user-assigned MSI to use, if any
    -      --azureblob-no-check-container                   If set, don't attempt to check the container exists or create it
    -      --azureblob-no-head-object                       If set, do not do HEAD before GET when getting objects
    -      --azureblob-password string                      The user's password (obscured)
    -      --azureblob-public-access string                 Public access level of a container: blob or container
    -      --azureblob-sas-url string                       SAS URL for container level access only
    -      --azureblob-service-principal-file string        Path to file containing credentials for use with a service principal
    -      --azureblob-tenant string                        ID of the service principal's tenant. Also called its directory ID
    -      --azureblob-upload-concurrency int               Concurrency for multipart uploads (default 16)
    -      --azureblob-upload-cutoff string                 Cutoff for switching to chunked upload (<= 256 MiB) (deprecated)
    -      --azureblob-use-emulator                         Uses local storage emulator if provided as 'true'
    -      --azureblob-use-msi                              Use a managed service identity to authenticate (only works in Azure)
    -      --azureblob-username string                      User name (usually an email address)
    -      --b2-account string                              Account ID or Application Key ID
    -      --b2-chunk-size SizeSuffix                       Upload chunk size (default 96Mi)
    -      --b2-copy-cutoff SizeSuffix                      Cutoff for switching to multipart copy (default 4Gi)
    -      --b2-disable-checksum                            Disable checksums for large (> upload cutoff) files
    -      --b2-download-auth-duration Duration             Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w)
    -      --b2-download-url string                         Custom endpoint for downloads
    -      --b2-encoding MultiEncoder                       The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    -      --b2-endpoint string                             Endpoint for the service
    -      --b2-hard-delete                                 Permanently delete files on remote removal, otherwise hide files
    -      --b2-key string                                  Application Key
    -      --b2-memory-pool-flush-time Duration             How often internal memory buffer pools will be flushed (default 1m0s)
    -      --b2-memory-pool-use-mmap                        Whether to use mmap buffers in internal memory pool
    -      --b2-test-mode string                            A flag string for X-Bz-Test-Mode header for debugging
    -      --b2-upload-cutoff SizeSuffix                    Cutoff for switching to chunked upload (default 200Mi)
    -      --b2-version-at Time                             Show file versions as they were at the specified time (default off)
    -      --b2-versions                                    Include old versions in directory listings
    -      --box-access-token string                        Box App Primary Access Token
    -      --box-auth-url string                            Auth server URL
    -      --box-box-config-file string                     Box App config.json location
    -      --box-box-sub-type string                         (default "user")
    -      --box-client-id string                           OAuth Client Id
    -      --box-client-secret string                       OAuth Client Secret
    -      --box-commit-retries int                         Max number of times to try committing a multipart file (default 100)
    -      --box-encoding MultiEncoder                      The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot)
    -      --box-list-chunk int                             Size of listing chunk 1-1000 (default 1000)
    -      --box-owned-by string                            Only show items owned by the login (email address) passed in
    -      --box-root-folder-id string                      Fill in for rclone to use a non root folder as its starting point
    -      --box-token string                               OAuth Access Token as a JSON blob
    -      --box-token-url string                           Token server url
    -      --box-upload-cutoff SizeSuffix                   Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi)
    -      --cache-chunk-clean-interval Duration            How often should the cache perform cleanups of the chunk storage (default 1m0s)
    -      --cache-chunk-no-memory                          Disable the in-memory cache for storing chunks during streaming
    -      --cache-chunk-path string                        Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend")
    -      --cache-chunk-size SizeSuffix                    The size of a chunk (partial file data) (default 5Mi)
    -      --cache-chunk-total-size SizeSuffix              The total size that the chunks can take up on the local disk (default 10Gi)
    -      --cache-db-path string                           Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend")
    -      --cache-db-purge                                 Clear all the cached data for this remote on start
    -      --cache-db-wait-time Duration                    How long to wait for the DB to be available - 0 is unlimited (default 1s)
    -      --cache-info-age Duration                        How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s)
    -      --cache-plex-insecure string                     Skip all certificate verification when connecting to the Plex server
    -      --cache-plex-password string                     The password of the Plex user (obscured)
    -      --cache-plex-url string                          The URL of the Plex server
    -      --cache-plex-username string                     The username of the Plex user
    -      --cache-read-retries int                         How many times to retry a read from a cache storage (default 10)
    -      --cache-remote string                            Remote to cache
    -      --cache-rps int                                  Limits the number of requests per second to the source FS (-1 to disable) (default -1)
    -      --cache-tmp-upload-path string                   Directory to keep temporary files until they are uploaded
    -      --cache-tmp-wait-time Duration                   How long should files be stored in local cache before being uploaded (default 15s)
    -      --cache-workers int                              How many workers should run in parallel to download chunks (default 4)
    -      --cache-writes                                   Cache file data on writes through the FS
    -      --chunker-chunk-size SizeSuffix                  Files larger than chunk size will be split in chunks (default 2Gi)
    -      --chunker-fail-hard                              Choose how chunker should handle files with missing or invalid chunks
    -      --chunker-hash-type string                       Choose how chunker handles hash sums (default "md5")
    -      --chunker-remote string                          Remote to chunk/unchunk
    -      --combine-upstreams SpaceSepList                 Upstreams for combining
    -      --compress-level int                             GZIP compression level (-2 to 9) (default -1)
    -      --compress-mode string                           Compression mode (default "gzip")
    -      --compress-ram-cache-limit SizeSuffix            Some remotes don't allow the upload of files with unknown size (default 20Mi)
    -      --compress-remote string                         Remote to compress
    -  -L, --copy-links                                     Follow symlinks and copy the pointed to item
    -      --crypt-directory-name-encryption                Option to either encrypt directory names or leave them intact (default true)
    -      --crypt-filename-encoding string                 How to encode the encrypted filename to text string (default "base32")
    -      --crypt-filename-encryption string               How to encrypt the filenames (default "standard")
    -      --crypt-no-data-encryption                       Option to either encrypt file data or leave it unencrypted
    -      --crypt-password string                          Password or pass phrase for encryption (obscured)
    -      --crypt-password2 string                         Password or pass phrase for salt (obscured)
    -      --crypt-remote string                            Remote to encrypt/decrypt
    -      --crypt-server-side-across-configs               Allow server-side operations (e.g. copy) to work across different crypt configs
    -      --crypt-show-mapping                             For all files listed show how the names encrypt
    -      --drive-acknowledge-abuse                        Set to allow files which return cannotDownloadAbusiveFile to be downloaded
    -      --drive-allow-import-name-change                 Allow the filetype to change when uploading Google docs
    -      --drive-auth-owner-only                          Only consider files owned by the authenticated user
    -      --drive-auth-url string                          Auth server URL
    -      --drive-chunk-size SizeSuffix                    Upload chunk size (default 8Mi)
    -      --drive-client-id string                         Google Application Client Id
    -      --drive-client-secret string                     OAuth Client Secret
    -      --drive-copy-shortcut-content                    Server side copy contents of shortcuts instead of the shortcut
    -      --drive-disable-http2                            Disable drive using http2 (default true)
    -      --drive-encoding MultiEncoder                    The encoding for the backend (default InvalidUtf8)
    -      --drive-export-formats string                    Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg")
    -      --drive-formats string                           Deprecated: See export_formats
    -      --drive-impersonate string                       Impersonate this user when using a service account
    -      --drive-import-formats string                    Comma separated list of preferred formats for uploading Google docs
    -      --drive-keep-revision-forever                    Keep new head revision of each file forever
    -      --drive-list-chunk int                           Size of listing chunk 100-1000, 0 to disable (default 1000)
    -      --drive-pacer-burst int                          Number of API calls to allow without sleeping (default 100)
    -      --drive-pacer-min-sleep Duration                 Minimum time to sleep between API calls (default 100ms)
    -      --drive-resource-key string                      Resource key for accessing a link-shared file
    -      --drive-root-folder-id string                    ID of the root folder
    -      --drive-scope string                             Scope that rclone should use when requesting access from drive
    -      --drive-server-side-across-configs               Allow server-side operations (e.g. copy) to work across different drive configs
    -      --drive-service-account-credentials string       Service Account Credentials JSON blob
    -      --drive-service-account-file string              Service Account Credentials JSON file path
    -      --drive-shared-with-me                           Only show files that are shared with me
    -      --drive-size-as-quota                            Show sizes as storage quota usage, not actual size
    -      --drive-skip-checksum-gphotos                    Skip MD5 checksum on Google photos and videos only
    -      --drive-skip-dangling-shortcuts                  If set skip dangling shortcut files
    -      --drive-skip-gdocs                               Skip google documents in all listings
    -      --drive-skip-shortcuts                           If set skip shortcut files
    -      --drive-starred-only                             Only show files that are starred
    -      --drive-stop-on-download-limit                   Make download limit errors be fatal
    -      --drive-stop-on-upload-limit                     Make upload limit errors be fatal
    -      --drive-team-drive string                        ID of the Shared Drive (Team Drive)
    -      --drive-token string                             OAuth Access Token as a JSON blob
    -      --drive-token-url string                         Token server url
    -      --drive-trashed-only                             Only show files that are in the trash
    -      --drive-upload-cutoff SizeSuffix                 Cutoff for switching to chunked upload (default 8Mi)
    -      --drive-use-created-date                         Use file created date instead of modified date
    -      --drive-use-shared-date                          Use date file was shared instead of modified date
    -      --drive-use-trash                                Send files to the trash instead of deleting permanently (default true)
    -      --drive-v2-download-min-size SizeSuffix          If Object's are greater, use drive v2 API to download (default off)
    -      --dropbox-auth-url string                        Auth server URL
    -      --dropbox-batch-commit-timeout Duration          Max time to wait for a batch to finish committing (default 10m0s)
    -      --dropbox-batch-mode string                      Upload file batching sync|async|off (default "sync")
    -      --dropbox-batch-size int                         Max number of files in upload batch
    -      --dropbox-batch-timeout Duration                 Max time to allow an idle upload batch before uploading (default 0s)
    -      --dropbox-chunk-size SizeSuffix                  Upload chunk size (< 150Mi) (default 48Mi)
    -      --dropbox-client-id string                       OAuth Client Id
    -      --dropbox-client-secret string                   OAuth Client Secret
    -      --dropbox-encoding MultiEncoder                  The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot)
    -      --dropbox-impersonate string                     Impersonate this user when using a business account
    -      --dropbox-shared-files                           Instructs rclone to work on individual shared files
    -      --dropbox-shared-folders                         Instructs rclone to work on shared folders
    -      --dropbox-token string                           OAuth Access Token as a JSON blob
    -      --dropbox-token-url string                       Token server url
    -      --fichier-api-key string                         Your API Key, get it from https://1fichier.com/console/params.pl
    -      --fichier-encoding MultiEncoder                  The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot)
    -      --fichier-file-password string                   If you want to download a shared file that is password protected, add this parameter (obscured)
    -      --fichier-folder-password string                 If you want to list the files in a shared folder that is password protected, add this parameter (obscured)
    -      --fichier-shared-folder string                   If you want to download a shared folder, add this parameter
    -      --filefabric-encoding MultiEncoder               The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot)
    -      --filefabric-permanent-token string              Permanent Authentication Token
    -      --filefabric-root-folder-id string               ID of the root folder
    -      --filefabric-token string                        Session Token
    -      --filefabric-token-expiry string                 Token expiry time
    -      --filefabric-url string                          URL of the Enterprise File Fabric to connect to
    -      --filefabric-version string                      Version read from the file fabric
    -      --ftp-ask-password                               Allow asking for FTP password when needed
    -      --ftp-close-timeout Duration                     Maximum time to wait for a response to close (default 1m0s)
    -      --ftp-concurrency int                            Maximum number of FTP simultaneous connections, 0 for unlimited
    -      --ftp-disable-epsv                               Disable using EPSV even if server advertises support
    -      --ftp-disable-mlsd                               Disable using MLSD even if server advertises support
    -      --ftp-disable-tls13                              Disable TLS 1.3 (workaround for FTP servers with buggy TLS)
    -      --ftp-disable-utf8                               Disable using UTF-8 even if server advertises support
    -      --ftp-encoding MultiEncoder                      The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot)
    -      --ftp-explicit-tls                               Use Explicit FTPS (FTP over TLS)
    -      --ftp-force-list-hidden                          Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD
    -      --ftp-host string                                FTP host to connect to
    -      --ftp-idle-timeout Duration                      Max time before closing idle connections (default 1m0s)
    -      --ftp-no-check-certificate                       Do not verify the TLS certificate of the server
    -      --ftp-pass string                                FTP password (obscured)
    -      --ftp-port int                                   FTP port number (default 21)
    -      --ftp-shut-timeout Duration                      Maximum time to wait for data connection closing status (default 1m0s)
    -      --ftp-tls                                        Use Implicit FTPS (FTP over TLS)
    -      --ftp-tls-cache-size int                         Size of TLS session cache for all control and data connections (default 32)
    -      --ftp-user string                                FTP username (default "$USER")
    -      --ftp-writing-mdtm                               Use MDTM to set modification time (VsFtpd quirk)
    -      --gcs-anonymous                                  Access public buckets and objects without credentials
    -      --gcs-auth-url string                            Auth server URL
    -      --gcs-bucket-acl string                          Access Control List for new buckets
    -      --gcs-bucket-policy-only                         Access checks should use bucket-level IAM policies
    -      --gcs-client-id string                           OAuth Client Id
    -      --gcs-client-secret string                       OAuth Client Secret
    -      --gcs-decompress                                 If set this will decompress gzip encoded objects
    -      --gcs-encoding MultiEncoder                      The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot)
    -      --gcs-endpoint string                            Endpoint for the service
    -      --gcs-env-auth                                   Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars)
    -      --gcs-location string                            Location for the newly created buckets
    -      --gcs-no-check-bucket                            If set, don't attempt to check the bucket exists or create it
    -      --gcs-object-acl string                          Access Control List for new objects
    -      --gcs-project-number string                      Project number
    -      --gcs-service-account-file string                Service Account Credentials JSON file path
    -      --gcs-storage-class string                       The storage class to use when storing objects in Google Cloud Storage
    -      --gcs-token string                               OAuth Access Token as a JSON blob
    -      --gcs-token-url string                           Token server url
    -      --gphotos-auth-url string                        Auth server URL
    -      --gphotos-client-id string                       OAuth Client Id
    -      --gphotos-client-secret string                   OAuth Client Secret
    -      --gphotos-encoding MultiEncoder                  The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot)
    -      --gphotos-include-archived                       Also view and download archived media
    -      --gphotos-read-only                              Set to make the Google Photos backend read only
    -      --gphotos-read-size                              Set to read the size of media items
    -      --gphotos-start-year int                         Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000)
    -      --gphotos-token string                           OAuth Access Token as a JSON blob
    -      --gphotos-token-url string                       Token server url
    -      --hasher-auto-size SizeSuffix                    Auto-update checksum for files smaller than this size (disabled by default)
    -      --hasher-hashes CommaSepList                     Comma separated list of supported checksum types (default md5,sha1)
    -      --hasher-max-age Duration                        Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off)
    -      --hasher-remote string                           Remote to cache checksums for (e.g. myRemote:path)
    -      --hdfs-data-transfer-protection string           Kerberos data transfer protection: authentication|integrity|privacy
    -      --hdfs-encoding MultiEncoder                     The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot)
    -      --hdfs-namenode string                           Hadoop name node and port
    -      --hdfs-service-principal-name string             Kerberos service principal name for the namenode
    -      --hdfs-username string                           Hadoop user name
    -      --hidrive-auth-url string                        Auth server URL
    -      --hidrive-chunk-size SizeSuffix                  Chunksize for chunked uploads (default 48Mi)
    -      --hidrive-client-id string                       OAuth Client Id
    -      --hidrive-client-secret string                   OAuth Client Secret
    -      --hidrive-disable-fetching-member-count          Do not fetch number of objects in directories unless it is absolutely necessary
    -      --hidrive-encoding MultiEncoder                  The encoding for the backend (default Slash,Dot)
    -      --hidrive-endpoint string                        Endpoint for the service (default "https://api.hidrive.strato.com/2.1")
    -      --hidrive-root-prefix string                     The root/parent folder for all paths (default "/")
    -      --hidrive-scope-access string                    Access permissions that rclone should use when requesting access from HiDrive (default "rw")
    -      --hidrive-scope-role string                      User-level that rclone should use when requesting access from HiDrive (default "user")
    -      --hidrive-token string                           OAuth Access Token as a JSON blob
    -      --hidrive-token-url string                       Token server url
    -      --hidrive-upload-concurrency int                 Concurrency for chunked uploads (default 4)
    -      --hidrive-upload-cutoff SizeSuffix               Cutoff/Threshold for chunked uploads (default 96Mi)
    -      --http-headers CommaSepList                      Set HTTP headers for all transactions
    -      --http-no-head                                   Don't use HEAD requests
    -      --http-no-slash                                  Set this if the site doesn't end directories with /
    -      --http-url string                                URL of HTTP host to connect to
    -      --internetarchive-access-key-id string           IAS3 Access Key
    -      --internetarchive-disable-checksum               Don't ask the server to test against MD5 checksum calculated by rclone (default true)
    -      --internetarchive-encoding MultiEncoder          The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot)
    -      --internetarchive-endpoint string                IAS3 Endpoint (default "https://s3.us.archive.org")
    -      --internetarchive-front-endpoint string          Host of InternetArchive Frontend (default "https://archive.org")
    -      --internetarchive-secret-access-key string       IAS3 Secret Key (password)
    -      --internetarchive-wait-archive Duration          Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s)
    -      --jottacloud-encoding MultiEncoder               The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot)
    -      --jottacloud-hard-delete                         Delete files permanently rather than putting them into the trash
    -      --jottacloud-md5-memory-limit SizeSuffix         Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi)
    -      --jottacloud-no-versions                         Avoid server side versioning by deleting files and recreating files instead of overwriting them
    -      --jottacloud-trashed-only                        Only show files that are in the trash
    -      --jottacloud-upload-resume-limit SizeSuffix      Files bigger than this can be resumed if the upload fail's (default 10Mi)
    -      --koofr-encoding MultiEncoder                    The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    -      --koofr-endpoint string                          The Koofr API endpoint to use
    -      --koofr-mountid string                           Mount ID of the mount to use
    -      --koofr-password string                          Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured)
    -      --koofr-provider string                          Choose your storage provider
    -      --koofr-setmtime                                 Does the backend support setting modification time (default true)
    -      --koofr-user string                              Your user name
    -  -l, --links                                          Translate symlinks to/from regular files with a '.rclonelink' extension
    -      --local-case-insensitive                         Force the filesystem to report itself as case insensitive
    -      --local-case-sensitive                           Force the filesystem to report itself as case sensitive
    -      --local-encoding MultiEncoder                    The encoding for the backend (default Slash,Dot)
    -      --local-no-check-updated                         Don't check to see if the files change during upload
    -      --local-no-preallocate                           Disable preallocation of disk space for transferred files
    -      --local-no-set-modtime                           Disable setting modtime
    -      --local-no-sparse                                Disable sparse files for multi-thread downloads
    -      --local-nounc                                    Disable UNC (long path names) conversion on Windows
    -      --local-unicode-normalization                    Apply unicode NFC normalization to paths and filenames
    -      --local-zero-size-links                          Assume the Stat size of links is zero (and read them instead) (deprecated)
    -      --mailru-check-hash                              What should copy do if file checksum is mismatched or invalid (default true)
    -      --mailru-encoding MultiEncoder                   The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    -      --mailru-pass string                             Password (obscured)
    -      --mailru-speedup-enable                          Skip full upload if there is another file with same data hash (default true)
    -      --mailru-speedup-file-patterns string            Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf")
    -      --mailru-speedup-max-disk SizeSuffix             This option allows you to disable speedup (put by hash) for large files (default 3Gi)
    -      --mailru-speedup-max-memory SizeSuffix           Files larger than the size given below will always be hashed on disk (default 32Mi)
    -      --mailru-user string                             User name (usually email)
    -      --mega-debug                                     Output more debug from Mega
    -      --mega-encoding MultiEncoder                     The encoding for the backend (default Slash,InvalidUtf8,Dot)
    -      --mega-hard-delete                               Delete files permanently rather than putting them into the trash
    -      --mega-pass string                               Password (obscured)
    -      --mega-use-https                                 Use HTTPS for transfers
    -      --mega-user string                               User name
    -      --netstorage-account string                      Set the NetStorage account name
    -      --netstorage-host string                         Domain+path of NetStorage host to connect to
    -      --netstorage-protocol string                     Select between HTTP or HTTPS protocol (default "https")
    -      --netstorage-secret string                       Set the NetStorage account secret/G2O key for authentication (obscured)
    -  -x, --one-file-system                                Don't cross filesystem boundaries (unix/macOS only)
    -      --onedrive-access-scopes SpaceSepList            Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access)
    -      --onedrive-auth-url string                       Auth server URL
    -      --onedrive-chunk-size SizeSuffix                 Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi)
    -      --onedrive-client-id string                      OAuth Client Id
    -      --onedrive-client-secret string                  OAuth Client Secret
    -      --onedrive-drive-id string                       The ID of the drive to use
    -      --onedrive-drive-type string                     The type of the drive (personal | business | documentLibrary)
    -      --onedrive-encoding MultiEncoder                 The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot)
    -      --onedrive-expose-onenote-files                  Set to make OneNote files show up in directory listings
    -      --onedrive-hash-type string                      Specify the hash in use for the backend (default "auto")
    -      --onedrive-link-password string                  Set the password for links created by the link command
    -      --onedrive-link-scope string                     Set the scope of the links created by the link command (default "anonymous")
    -      --onedrive-link-type string                      Set the type of the links created by the link command (default "view")
    -      --onedrive-list-chunk int                        Size of listing chunk (default 1000)
    -      --onedrive-no-versions                           Remove all versions on modifying operations
    -      --onedrive-region string                         Choose national cloud region for OneDrive (default "global")
    -      --onedrive-root-folder-id string                 ID of the root folder
    -      --onedrive-server-side-across-configs            Allow server-side operations (e.g. copy) to work across different onedrive configs
    -      --onedrive-token string                          OAuth Access Token as a JSON blob
    -      --onedrive-token-url string                      Token server url
    -      --oos-chunk-size SizeSuffix                      Chunk size to use for uploading (default 5Mi)
    -      --oos-compartment string                         Object storage compartment OCID
    -      --oos-config-file string                         Path to OCI config file (default "~/.oci/config")
    -      --oos-config-profile string                      Profile name inside the oci config file (default "Default")
    -      --oos-copy-cutoff SizeSuffix                     Cutoff for switching to multipart copy (default 4.656Gi)
    -      --oos-copy-timeout Duration                      Timeout for copy (default 1m0s)
    -      --oos-disable-checksum                           Don't store MD5 checksum with object metadata
    -      --oos-encoding MultiEncoder                      The encoding for the backend (default Slash,InvalidUtf8,Dot)
    -      --oos-endpoint string                            Endpoint for Object storage API
    -      --oos-leave-parts-on-error                       If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery
    -      --oos-namespace string                           Object storage namespace
    -      --oos-no-check-bucket                            If set, don't attempt to check the bucket exists or create it
    -      --oos-provider string                            Choose your Auth Provider (default "env_auth")
    -      --oos-region string                              Object storage Region
    -      --oos-sse-customer-algorithm string              If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm
    -      --oos-sse-customer-key string                    To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to
    -      --oos-sse-customer-key-file string               To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated
    -      --oos-sse-customer-key-sha256 string             If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption
    -      --oos-sse-kms-key-id string                      if using using your own master key in vault, this header specifies the
    -      --oos-storage-tier string                        The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard")
    -      --oos-upload-concurrency int                     Concurrency for multipart uploads (default 10)
    -      --oos-upload-cutoff SizeSuffix                   Cutoff for switching to chunked upload (default 200Mi)
    -      --opendrive-chunk-size SizeSuffix                Files will be uploaded in chunks this size (default 10Mi)
    -      --opendrive-encoding MultiEncoder                The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot)
    -      --opendrive-password string                      Password (obscured)
    -      --opendrive-username string                      Username
    -      --pcloud-auth-url string                         Auth server URL
    -      --pcloud-client-id string                        OAuth Client Id
    -      --pcloud-client-secret string                    OAuth Client Secret
    -      --pcloud-encoding MultiEncoder                   The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    -      --pcloud-hostname string                         Hostname to connect to (default "api.pcloud.com")
    -      --pcloud-password string                         Your pcloud password (obscured)
    -      --pcloud-root-folder-id string                   Fill in for rclone to use a non root folder as its starting point (default "d0")
    -      --pcloud-token string                            OAuth Access Token as a JSON blob
    -      --pcloud-token-url string                        Token server url
    -      --pcloud-username string                         Your pcloud username
    -      --premiumizeme-encoding MultiEncoder             The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    -      --putio-encoding MultiEncoder                    The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    -      --qingstor-access-key-id string                  QingStor Access Key ID
    -      --qingstor-chunk-size SizeSuffix                 Chunk size to use for uploading (default 4Mi)
    -      --qingstor-connection-retries int                Number of connection retries (default 3)
    -      --qingstor-encoding MultiEncoder                 The encoding for the backend (default Slash,Ctl,InvalidUtf8)
    -      --qingstor-endpoint string                       Enter an endpoint URL to connection QingStor API
    -      --qingstor-env-auth                              Get QingStor credentials from runtime
    -      --qingstor-secret-access-key string              QingStor Secret Access Key (password)
    -      --qingstor-upload-concurrency int                Concurrency for multipart uploads (default 1)
    -      --qingstor-upload-cutoff SizeSuffix              Cutoff for switching to chunked upload (default 200Mi)
    -      --qingstor-zone string                           Zone to connect to
    -      --s3-access-key-id string                        AWS Access Key ID
    -      --s3-acl string                                  Canned ACL used when creating buckets and storing or copying objects
    -      --s3-bucket-acl string                           Canned ACL used when creating buckets
    -      --s3-chunk-size SizeSuffix                       Chunk size to use for uploading (default 5Mi)
    -      --s3-copy-cutoff SizeSuffix                      Cutoff for switching to multipart copy (default 4.656Gi)
    -      --s3-decompress                                  If set this will decompress gzip encoded objects
    -      --s3-disable-checksum                            Don't store MD5 checksum with object metadata
    -      --s3-disable-http2                               Disable usage of http2 for S3 backends
    -      --s3-download-url string                         Custom endpoint for downloads
    -      --s3-encoding MultiEncoder                       The encoding for the backend (default Slash,InvalidUtf8,Dot)
    -      --s3-endpoint string                             Endpoint for S3 API
    -      --s3-env-auth                                    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars)
    -      --s3-force-path-style                            If true use path style access if false use virtual hosted style (default true)
    -      --s3-leave-parts-on-error                        If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery
    -      --s3-list-chunk int                              Size of listing chunk (response list for each ListObject S3 request) (default 1000)
    -      --s3-list-url-encode Tristate                    Whether to url encode listings: true/false/unset (default unset)
    -      --s3-list-version int                            Version of ListObjects to use: 1,2 or 0 for auto
    -      --s3-location-constraint string                  Location constraint - must be set to match the Region
    -      --s3-max-upload-parts int                        Maximum number of parts in a multipart upload (default 10000)
    -      --s3-memory-pool-flush-time Duration             How often internal memory buffer pools will be flushed (default 1m0s)
    -      --s3-memory-pool-use-mmap                        Whether to use mmap buffers in internal memory pool
    -      --s3-might-gzip Tristate                         Set this if the backend might gzip objects (default unset)
    -      --s3-no-check-bucket                             If set, don't attempt to check the bucket exists or create it
    -      --s3-no-head                                     If set, don't HEAD uploaded objects to check integrity
    -      --s3-no-head-object                              If set, do not do HEAD before GET when getting objects
    -      --s3-no-system-metadata                          Suppress setting and reading of system metadata
    -      --s3-profile string                              Profile to use in the shared credentials file
    -      --s3-provider string                             Choose your S3 provider
    -      --s3-region string                               Region to connect to
    -      --s3-requester-pays                              Enables requester pays option when interacting with S3 bucket
    -      --s3-secret-access-key string                    AWS Secret Access Key (password)
    -      --s3-server-side-encryption string               The server-side encryption algorithm used when storing this object in S3
    -      --s3-session-token string                        An AWS session token
    -      --s3-shared-credentials-file string              Path to the shared credentials file
    -      --s3-sse-customer-algorithm string               If using SSE-C, the server-side encryption algorithm used when storing this object in S3
    -      --s3-sse-customer-key string                     To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data
    -      --s3-sse-customer-key-base64 string              If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data
    -      --s3-sse-customer-key-md5 string                 If using SSE-C you may provide the secret encryption key MD5 checksum (optional)
    -      --s3-sse-kms-key-id string                       If using KMS ID you must provide the ARN of Key
    -      --s3-storage-class string                        The storage class to use when storing new objects in S3
    -      --s3-sts-endpoint string                         Endpoint for STS
    -      --s3-upload-concurrency int                      Concurrency for multipart uploads (default 4)
    -      --s3-upload-cutoff SizeSuffix                    Cutoff for switching to chunked upload (default 200Mi)
    -      --s3-use-accelerate-endpoint                     If true use the AWS S3 accelerated endpoint
    -      --s3-use-multipart-etag Tristate                 Whether to use ETag in multipart uploads for verification (default unset)
    -      --s3-use-presigned-request                       Whether to use a presigned request or PutObject for single part uploads
    -      --s3-v2-auth                                     If true use v2 authentication
    -      --s3-version-at Time                             Show file versions as they were at the specified time (default off)
    -      --s3-versions                                    Include old versions in directory listings
    -      --seafile-2fa                                    Two-factor authentication ('true' if the account has 2FA enabled)
    -      --seafile-create-library                         Should rclone create a library if it doesn't exist
    -      --seafile-encoding MultiEncoder                  The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8)
    -      --seafile-library string                         Name of the library
    -      --seafile-library-key string                     Library password (for encrypted libraries only) (obscured)
    -      --seafile-pass string                            Password (obscured)
    -      --seafile-url string                             URL of seafile host to connect to
    -      --seafile-user string                            User name (usually email address)
    -      --sftp-ask-password                              Allow asking for SFTP password when needed
    -      --sftp-chunk-size SizeSuffix                     Upload and download chunk size (default 32Ki)
    -      --sftp-ciphers SpaceSepList                      Space separated list of ciphers to be used for session encryption, ordered by preference
    -      --sftp-concurrency int                           The maximum number of outstanding requests for one file (default 64)
    -      --sftp-disable-concurrent-reads                  If set don't use concurrent reads
    -      --sftp-disable-concurrent-writes                 If set don't use concurrent writes
    -      --sftp-disable-hashcheck                         Disable the execution of SSH commands to determine if remote file hashing is available
    -      --sftp-host string                               SSH host to connect to
    -      --sftp-idle-timeout Duration                     Max time before closing idle connections (default 1m0s)
    -      --sftp-key-exchange SpaceSepList                 Space separated list of key exchange algorithms, ordered by preference
    -      --sftp-key-file string                           Path to PEM-encoded private key file
    -      --sftp-key-file-pass string                      The passphrase to decrypt the PEM-encoded private key file (obscured)
    -      --sftp-key-pem string                            Raw PEM-encoded private key
    -      --sftp-key-use-agent                             When set forces the usage of the ssh-agent
    -      --sftp-known-hosts-file string                   Optional path to known_hosts file
    -      --sftp-macs SpaceSepList                         Space separated list of MACs (message authentication code) algorithms, ordered by preference
    -      --sftp-md5sum-command string                     The command used to read md5 hashes
    -      --sftp-pass string                               SSH password, leave blank to use ssh-agent (obscured)
    -      --sftp-path-override string                      Override path used by SSH shell commands
    -      --sftp-port int                                  SSH port number (default 22)
    -      --sftp-pubkey-file string                        Optional path to public key file
    -      --sftp-server-command string                     Specifies the path or command to run a sftp server on the remote host
    -      --sftp-set-env SpaceSepList                      Environment variables to pass to sftp and commands
    -      --sftp-set-modtime                               Set the modified time on the remote if set (default true)
    -      --sftp-sha1sum-command string                    The command used to read sha1 hashes
    -      --sftp-shell-type string                         The type of SSH shell on remote server, if any
    -      --sftp-skip-links                                Set to skip any symlinks and any other non regular files
    -      --sftp-subsystem string                          Specifies the SSH2 subsystem on the remote host (default "sftp")
    -      --sftp-use-fstat                                 If set use fstat instead of stat
    -      --sftp-use-insecure-cipher                       Enable the use of insecure ciphers and key exchange methods
    -      --sftp-user string                               SSH username (default "$USER")
    -      --sharefile-chunk-size SizeSuffix                Upload chunk size (default 64Mi)
    -      --sharefile-encoding MultiEncoder                The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot)
    -      --sharefile-endpoint string                      Endpoint for API calls
    -      --sharefile-root-folder-id string                ID of the root folder
    -      --sharefile-upload-cutoff SizeSuffix             Cutoff for switching to multipart upload (default 128Mi)
    -      --sia-api-password string                        Sia Daemon API Password (obscured)
    -      --sia-api-url string                             Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980")
    -      --sia-encoding MultiEncoder                      The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot)
    -      --sia-user-agent string                          Siad User Agent (default "Sia-Agent")
    -      --skip-links                                     Don't warn about skipped symlinks
    -      --smb-case-insensitive                           Whether the server is configured to be case-insensitive (default true)
    -      --smb-domain string                              Domain name for NTLM authentication (default "WORKGROUP")
    -      --smb-encoding MultiEncoder                      The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot)
    -      --smb-hide-special-share                         Hide special shares (e.g. print$) which users aren't supposed to access (default true)
    -      --smb-host string                                SMB server hostname to connect to
    -      --smb-idle-timeout Duration                      Max time before closing idle connections (default 1m0s)
    -      --smb-pass string                                SMB password (obscured)
    -      --smb-port int                                   SMB port number (default 445)
    -      --smb-spn string                                 Service principal name
    -      --smb-user string                                SMB username (default "$USER")
    -      --storj-access-grant string                      Access grant
    -      --storj-api-key string                           API key
    -      --storj-passphrase string                        Encryption passphrase
    -      --storj-provider string                          Choose an authentication method (default "existing")
    -      --storj-satellite-address string                 Satellite address (default "us1.storj.io")
    -      --sugarsync-access-key-id string                 Sugarsync Access Key ID
    -      --sugarsync-app-id string                        Sugarsync App ID
    -      --sugarsync-authorization string                 Sugarsync authorization
    -      --sugarsync-authorization-expiry string          Sugarsync authorization expiry
    -      --sugarsync-deleted-id string                    Sugarsync deleted folder id
    -      --sugarsync-encoding MultiEncoder                The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot)
    -      --sugarsync-hard-delete                          Permanently delete files if true
    -      --sugarsync-private-access-key string            Sugarsync Private Access Key
    -      --sugarsync-refresh-token string                 Sugarsync refresh token
    -      --sugarsync-root-id string                       Sugarsync root id
    -      --sugarsync-user string                          Sugarsync user
    -      --swift-application-credential-id string         Application Credential ID (OS_APPLICATION_CREDENTIAL_ID)
    -      --swift-application-credential-name string       Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME)
    -      --swift-application-credential-secret string     Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET)
    -      --swift-auth string                              Authentication URL for server (OS_AUTH_URL)
    -      --swift-auth-token string                        Auth Token from alternate authentication - optional (OS_AUTH_TOKEN)
    -      --swift-auth-version int                         AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION)
    -      --swift-chunk-size SizeSuffix                    Above this size files will be chunked into a _segments container (default 5Gi)
    -      --swift-domain string                            User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)
    -      --swift-encoding MultiEncoder                    The encoding for the backend (default Slash,InvalidUtf8)
    -      --swift-endpoint-type string                     Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public")
    -      --swift-env-auth                                 Get swift credentials from environment variables in standard OpenStack form
    -      --swift-key string                               API key or password (OS_PASSWORD)
    -      --swift-leave-parts-on-error                     If true avoid calling abort upload on a failure
    -      --swift-no-chunk                                 Don't chunk files during streaming upload
    -      --swift-no-large-objects                         Disable support for static and dynamic large objects
    -      --swift-region string                            Region name - optional (OS_REGION_NAME)
    -      --swift-storage-policy string                    The storage policy to use when creating a new container
    -      --swift-storage-url string                       Storage URL - optional (OS_STORAGE_URL)
    -      --swift-tenant string                            Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME)
    -      --swift-tenant-domain string                     Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME)
    -      --swift-tenant-id string                         Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID)
    -      --swift-user string                              User name to log in (OS_USERNAME)
    -      --swift-user-id string                           User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID)
    -      --union-action-policy string                     Policy to choose upstream on ACTION category (default "epall")
    -      --union-cache-time int                           Cache time of usage and free space (in seconds) (default 120)
    -      --union-create-policy string                     Policy to choose upstream on CREATE category (default "epmfs")
    -      --union-min-free-space SizeSuffix                Minimum viable free space for lfs/eplfs policies (default 1Gi)
    -      --union-search-policy string                     Policy to choose upstream on SEARCH category (default "ff")
    -      --union-upstreams string                         List of space separated upstreams
    -      --uptobox-access-token string                    Your access token
    -      --uptobox-encoding MultiEncoder                  The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot)
    -      --webdav-bearer-token string                     Bearer token instead of user/pass (e.g. a Macaroon)
    -      --webdav-bearer-token-command string             Command to run to get a bearer token
    -      --webdav-encoding string                         The encoding for the backend
    -      --webdav-headers CommaSepList                    Set HTTP headers for all transactions
    -      --webdav-pass string                             Password (obscured)
    -      --webdav-url string                              URL of http host to connect to
    -      --webdav-user string                             User name
    -      --webdav-vendor string                           Name of the WebDAV site/service/software you are using
    -      --yandex-auth-url string                         Auth server URL
    -      --yandex-client-id string                        OAuth Client Id
    -      --yandex-client-secret string                    OAuth Client Secret
    -      --yandex-encoding MultiEncoder                   The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot)
    -      --yandex-hard-delete                             Delete files permanently rather than putting them into the trash
    -      --yandex-token string                            OAuth Access Token as a JSON blob
    -      --yandex-token-url string                        Token server url
    -      --zoho-auth-url string                           Auth server URL
    -      --zoho-client-id string                          OAuth Client Id
    -      --zoho-client-secret string                      OAuth Client Secret
    -      --zoho-encoding MultiEncoder                     The encoding for the backend (default Del,Ctl,InvalidUtf8)
    -      --zoho-region string                             Zoho region to connect to
    -      --zoho-token string                              OAuth Access Token as a JSON blob
    -      --zoho-token-url string                          Token server url
    +

    This describes the global flags available to every rclone command split into groups.

    +

    Copy

    +

    Flags for anything which can Copy a file.

    +
          --check-first                                 Do all the checks before starting transfers
    +  -c, --checksum                                    Check for changes with size & checksum (if available, or fallback to size only).
    +      --compare-dest stringArray                    Include additional comma separated server-side paths during comparison
    +      --copy-dest stringArray                       Implies --compare-dest but also copies files from paths into destination
    +      --cutoff-mode HARD|SOFT|CAUTIOUS              Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD)
    +      --ignore-case-sync                            Ignore case when synchronizing
    +      --ignore-checksum                             Skip post copy check of checksums
    +      --ignore-existing                             Skip all files that exist on destination
    +      --ignore-size                                 Ignore size when skipping use modtime or checksum
    +  -I, --ignore-times                                Don't skip files that match size and time - transfer all files
    +      --immutable                                   Do not modify files, fail if existing files have been modified
    +      --inplace                                     Download directly to destination file instead of atomic download to temp/rename
    +      --max-backlog int                             Maximum number of objects in sync or check backlog (default 10000)
    +      --max-duration Duration                       Maximum duration rclone will transfer data for (default 0s)
    +      --max-transfer SizeSuffix                     Maximum size of data to transfer (default off)
    +  -M, --metadata                                    If set, preserve metadata when copying objects
    +      --modify-window Duration                      Max time diff to be considered the same (default 1ns)
    +      --multi-thread-chunk-size SizeSuffix          Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi)
    +      --multi-thread-cutoff SizeSuffix              Use multi-thread downloads for files above this size (default 256Mi)
    +      --multi-thread-streams int                    Number of streams to use for multi-thread downloads (default 4)
    +      --multi-thread-write-buffer-size SizeSuffix   In memory buffer size for writing when in multi-thread mode (default 128Ki)
    +      --no-check-dest                               Don't check the destination, copy regardless
    +      --no-traverse                                 Don't traverse destination file system on copy
    +      --no-update-modtime                           Don't update destination modtime if files identical
    +      --order-by string                             Instructions on how to order the transfers, e.g. 'size,descending'
    +      --partial-suffix string                       Add partial-suffix to temporary file name when --inplace is not used (default ".partial")
    +      --refresh-times                               Refresh the modtime of remote files
    +      --server-side-across-configs                  Allow server-side operations (e.g. copy) to work across different configs
    +      --size-only                                   Skip based on size only, not modtime or checksum
    +      --streaming-upload-cutoff SizeSuffix          Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
    +  -u, --update                                      Skip files that are newer on the destination
    +

    Sync

    +

    Flags just used for rclone sync.

    +
          --backup-dir string               Make backups into hierarchy based in DIR
    +      --delete-after                    When synchronizing, delete files on destination after transferring (default)
    +      --delete-before                   When synchronizing, delete files on destination before transferring
    +      --delete-during                   When synchronizing, delete files during transfer
    +      --ignore-errors                   Delete even if there are I/O errors
    +      --max-delete int                  When synchronizing, limit the number of deletes (default -1)
    +      --max-delete-size SizeSuffix      When synchronizing, limit the total size of deletes (default off)
    +      --suffix string                   Suffix to add to changed files
    +      --suffix-keep-extension           Preserve the extension when using --suffix
    +      --track-renames                   When synchronizing, track file renames and do a server-side move if possible
    +      --track-renames-strategy string   Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash")
    +

    Important

    +

    Important flags useful for most commands.

    +
      -n, --dry-run         Do a trial run with no permanent changes
    +  -i, --interactive     Enable interactive mode
    +  -v, --verbose count   Print lots more stuff (repeat for more)
    +

    Check

    +

    Flags used for rclone check.

    +
          --max-backlog int   Maximum number of objects in sync or check backlog (default 10000)
    +

    Networking

    +

    General networking and HTTP stuff.

    +
          --bind string                        Local address to bind to for outgoing connections, IPv4, IPv6 or name
    +      --bwlimit BwTimetable                Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable
    +      --bwlimit-file BwTimetable           Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable
    +      --ca-cert stringArray                CA certificate used to verify servers
    +      --client-cert string                 Client SSL certificate (PEM) for mutual TLS auth
    +      --client-key string                  Client SSL private key (PEM) for mutual TLS auth
    +      --contimeout Duration                Connect timeout (default 1m0s)
    +      --disable-http-keep-alives           Disable HTTP keep-alives and use each connection once.
    +      --disable-http2                      Disable HTTP/2 in the global transport
    +      --dscp string                        Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21
    +      --expect-continue-timeout Duration   Timeout when using expect / 100-continue in HTTP (default 1s)
    +      --header stringArray                 Set HTTP header for all transactions
    +      --header-download stringArray        Set HTTP header for download transactions
    +      --header-upload stringArray          Set HTTP header for upload transactions
    +      --no-check-certificate               Do not verify the server SSL certificate (insecure)
    +      --no-gzip-encoding                   Don't set Accept-Encoding: gzip
    +      --timeout Duration                   IO idle timeout (default 5m0s)
    +      --tpslimit float                     Limit HTTP transactions per second to this
    +      --tpslimit-burst int                 Max burst of transactions for --tpslimit (default 1)
    +      --use-cookies                        Enable session cookiejar
    +      --user-agent string                  Set the user-agent to a specified string (default "rclone/v1.65.0")
    +

    Performance

    +

    Flags helpful for increasing performance.

    +
          --buffer-size SizeSuffix   In memory buffer size when reading files for each --transfer (default 16Mi)
    +      --checkers int             Number of checkers to run in parallel (default 8)
    +      --transfers int            Number of file transfers to run in parallel (default 4)
    +

    Config

    +

    General configuration of rclone.

    +
          --ask-password                        Allow prompt for password for encrypted configuration (default true)
    +      --auto-confirm                        If enabled, do not request console confirmation
    +      --cache-dir string                    Directory rclone will use for caching (default "$HOME/.cache/rclone")
    +      --color AUTO|NEVER|ALWAYS             When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO)
    +      --config string                       Config file (default "$HOME/.config/rclone/rclone.conf")
    +      --default-time Time                   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --disable string                      Disable a comma separated list of features (use --disable help to see a list)
    +  -n, --dry-run                             Do a trial run with no permanent changes
    +      --error-on-no-transfer                Sets exit code 9 if no files are transferred, useful in scripts
    +      --fs-cache-expire-duration Duration   Cache remotes for this long (0 to disable caching) (default 5m0s)
    +      --fs-cache-expire-interval Duration   Interval to check for expired remotes (default 1m0s)
    +      --human-readable                      Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi
    +  -i, --interactive                         Enable interactive mode
    +      --kv-lock-time Duration               Maximum time to keep key-value database locked by process (default 1s)
    +      --low-level-retries int               Number of low level retries to do (default 10)
    +      --no-console                          Hide console window (supported on Windows only)
    +      --no-unicode-normalization            Don't normalize unicode characters in filenames
    +      --password-command SpaceSepList       Command for supplying password for encrypted configuration
    +      --retries int                         Retry operations this many times if they fail (default 3)
    +      --retries-sleep Duration              Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s)
    +      --temp-dir string                     Directory rclone will use for temporary files (default "/tmp")
    +      --use-mmap                            Use mmap allocator (see docs)
    +      --use-server-modtime                  Use server modified time instead of object metadata
    +

    Debugging

    +

    Flags for developers.

    +
          --cpuprofile string   Write cpu profile to file
    +      --dump DumpFlags      List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper
    +      --dump-bodies         Dump HTTP headers and bodies - may contain sensitive info
    +      --dump-headers        Dump HTTP headers - may contain sensitive info
    +      --memprofile string   Write memory profile to file
    +

    Filter

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    Listing

    +

    Flags for listing directories.

    +
          --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
    +      --fast-list           Use recursive list if available; uses more memory but fewer transactions
    +

    Logging

    +

    Logging and statistics.

    +
          --log-file string                     Log everything to this file
    +      --log-format string                   Comma separated list of log format options (default "date,time")
    +      --log-level LogLevel                  Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE)
    +      --log-systemd                         Activate systemd integration for the logger
    +      --max-stats-groups int                Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000)
    +  -P, --progress                            Show progress during transfer
    +      --progress-terminal-title             Show progress on the terminal title (requires -P/--progress)
    +  -q, --quiet                               Print as little stuff as possible
    +      --stats Duration                      Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s)
    +      --stats-file-name-length int          Max file name length in stats (0 for no limit) (default 45)
    +      --stats-log-level LogLevel            Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO)
    +      --stats-one-line                      Make the stats fit on one line
    +      --stats-one-line-date                 Enable --stats-one-line and add current date/time prefix
    +      --stats-one-line-date-format string   Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format
    +      --stats-unit string                   Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes")
    +      --syslog                              Use Syslog for logging
    +      --syslog-facility string              Facility for syslog, e.g. KERN,USER,... (default "DAEMON")
    +      --use-json-log                        Use json log format
    +  -v, --verbose count                       Print lots more stuff (repeat for more)
    +

    Metadata

    +

    Flags to control metadata.

    +
      -M, --metadata                            If set, preserve metadata when copying objects
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --metadata-mapper SpaceSepList        Program to run to transforming metadata before upload
    +      --metadata-set stringArray            Add metadata key=value when uploading
    +

    RC

    +

    Flags to control the Remote Control API.

    +
          --rc                                 Enable the remote control server
    +      --rc-addr stringArray                IPaddress:Port or :Port to bind server to (default [localhost:5572])
    +      --rc-allow-origin string             Origin which cross-domain request (CORS) can be executed from
    +      --rc-baseurl string                  Prefix for URLs - leave blank for root
    +      --rc-cert string                     TLS PEM key (concatenation of certificate and CA certificate)
    +      --rc-client-ca string                Client certificate authority to verify clients with
    +      --rc-enable-metrics                  Enable prometheus metrics on /metrics
    +      --rc-files string                    Path to local files to serve on the HTTP server
    +      --rc-htpasswd string                 A htpasswd file - if not provided no authentication is done
    +      --rc-job-expire-duration Duration    Expire finished async jobs older than this value (default 1m0s)
    +      --rc-job-expire-interval Duration    Interval to check for expired async jobs (default 10s)
    +      --rc-key string                      TLS PEM Private key
    +      --rc-max-header-bytes int            Maximum size of request header (default 4096)
    +      --rc-min-tls-version string          Minimum TLS version that is acceptable (default "tls1.0")
    +      --rc-no-auth                         Don't require auth for certain methods
    +      --rc-pass string                     Password for authentication
    +      --rc-realm string                    Realm for authentication
    +      --rc-salt string                     Password hashing salt (default "dlPL2MqE")
    +      --rc-serve                           Enable the serving of remote objects
    +      --rc-server-read-timeout Duration    Timeout for server reading data (default 1h0m0s)
    +      --rc-server-write-timeout Duration   Timeout for server writing data (default 1h0m0s)
    +      --rc-template string                 User-specified template
    +      --rc-user string                     User name for authentication
    +      --rc-web-fetch-url string            URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest")
    +      --rc-web-gui                         Launch WebGUI on localhost
    +      --rc-web-gui-force-update            Force update to latest version of web gui
    +      --rc-web-gui-no-open-browser         Don't open the browser automatically
    +      --rc-web-gui-update                  Check and update to latest version of web gui
    +

    Backend

    +

    Backend only flags. These can be set in the config file also.

    +
          --acd-auth-url string                                 Auth server URL
    +      --acd-client-id string                                OAuth Client Id
    +      --acd-client-secret string                            OAuth Client Secret
    +      --acd-encoding Encoding                               The encoding for the backend (default Slash,InvalidUtf8,Dot)
    +      --acd-templink-threshold SizeSuffix                   Files >= this size will be downloaded via their tempLink (default 9Gi)
    +      --acd-token string                                    OAuth Access Token as a JSON blob
    +      --acd-token-url string                                Token server url
    +      --acd-upload-wait-per-gb Duration                     Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s)
    +      --alias-remote string                                 Remote or path to alias
    +      --azureblob-access-tier string                        Access tier of blob: hot, cool, cold or archive
    +      --azureblob-account string                            Azure Storage Account Name
    +      --azureblob-archive-tier-delete                       Delete archive tier blobs before overwriting
    +      --azureblob-chunk-size SizeSuffix                     Upload chunk size (default 4Mi)
    +      --azureblob-client-certificate-password string        Password for the certificate file (optional) (obscured)
    +      --azureblob-client-certificate-path string            Path to a PEM or PKCS12 certificate file including the private key
    +      --azureblob-client-id string                          The ID of the client in use
    +      --azureblob-client-secret string                      One of the service principal's client secrets
    +      --azureblob-client-send-certificate-chain             Send the certificate chain when using certificate auth
    +      --azureblob-directory-markers                         Upload an empty object with a trailing slash when a new directory is created
    +      --azureblob-disable-checksum                          Don't store MD5 checksum with object metadata
    +      --azureblob-encoding Encoding                         The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8)
    +      --azureblob-endpoint string                           Endpoint for the service
    +      --azureblob-env-auth                                  Read credentials from runtime (environment variables, CLI or MSI)
    +      --azureblob-key string                                Storage Account Shared Key
    +      --azureblob-list-chunk int                            Size of blob list (default 5000)
    +      --azureblob-msi-client-id string                      Object ID of the user-assigned MSI to use, if any
    +      --azureblob-msi-mi-res-id string                      Azure resource ID of the user-assigned MSI to use, if any
    +      --azureblob-msi-object-id string                      Object ID of the user-assigned MSI to use, if any
    +      --azureblob-no-check-container                        If set, don't attempt to check the container exists or create it
    +      --azureblob-no-head-object                            If set, do not do HEAD before GET when getting objects
    +      --azureblob-password string                           The user's password (obscured)
    +      --azureblob-public-access string                      Public access level of a container: blob or container
    +      --azureblob-sas-url string                            SAS URL for container level access only
    +      --azureblob-service-principal-file string             Path to file containing credentials for use with a service principal
    +      --azureblob-tenant string                             ID of the service principal's tenant. Also called its directory ID
    +      --azureblob-upload-concurrency int                    Concurrency for multipart uploads (default 16)
    +      --azureblob-upload-cutoff string                      Cutoff for switching to chunked upload (<= 256 MiB) (deprecated)
    +      --azureblob-use-emulator                              Uses local storage emulator if provided as 'true'
    +      --azureblob-use-msi                                   Use a managed service identity to authenticate (only works in Azure)
    +      --azureblob-username string                           User name (usually an email address)
    +      --azurefiles-account string                           Azure Storage Account Name
    +      --azurefiles-chunk-size SizeSuffix                    Upload chunk size (default 4Mi)
    +      --azurefiles-client-certificate-password string       Password for the certificate file (optional) (obscured)
    +      --azurefiles-client-certificate-path string           Path to a PEM or PKCS12 certificate file including the private key
    +      --azurefiles-client-id string                         The ID of the client in use
    +      --azurefiles-client-secret string                     One of the service principal's client secrets
    +      --azurefiles-client-send-certificate-chain            Send the certificate chain when using certificate auth
    +      --azurefiles-connection-string string                 Azure Files Connection String
    +      --azurefiles-encoding Encoding                        The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot)
    +      --azurefiles-endpoint string                          Endpoint for the service
    +      --azurefiles-env-auth                                 Read credentials from runtime (environment variables, CLI or MSI)
    +      --azurefiles-key string                               Storage Account Shared Key
    +      --azurefiles-max-stream-size SizeSuffix               Max size for streamed files (default 10Gi)
    +      --azurefiles-msi-client-id string                     Object ID of the user-assigned MSI to use, if any
    +      --azurefiles-msi-mi-res-id string                     Azure resource ID of the user-assigned MSI to use, if any
    +      --azurefiles-msi-object-id string                     Object ID of the user-assigned MSI to use, if any
    +      --azurefiles-password string                          The user's password (obscured)
    +      --azurefiles-sas-url string                           SAS URL
    +      --azurefiles-service-principal-file string            Path to file containing credentials for use with a service principal
    +      --azurefiles-share-name string                        Azure Files Share Name
    +      --azurefiles-tenant string                            ID of the service principal's tenant. Also called its directory ID
    +      --azurefiles-upload-concurrency int                   Concurrency for multipart uploads (default 16)
    +      --azurefiles-use-msi                                  Use a managed service identity to authenticate (only works in Azure)
    +      --azurefiles-username string                          User name (usually an email address)
    +      --b2-account string                                   Account ID or Application Key ID
    +      --b2-chunk-size SizeSuffix                            Upload chunk size (default 96Mi)
    +      --b2-copy-cutoff SizeSuffix                           Cutoff for switching to multipart copy (default 4Gi)
    +      --b2-disable-checksum                                 Disable checksums for large (> upload cutoff) files
    +      --b2-download-auth-duration Duration                  Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w)
    +      --b2-download-url string                              Custom endpoint for downloads
    +      --b2-encoding Encoding                                The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --b2-endpoint string                                  Endpoint for the service
    +      --b2-hard-delete                                      Permanently delete files on remote removal, otherwise hide files
    +      --b2-key string                                       Application Key
    +      --b2-lifecycle int                                    Set the number of days deleted files should be kept when creating a bucket
    +      --b2-test-mode string                                 A flag string for X-Bz-Test-Mode header for debugging
    +      --b2-upload-concurrency int                           Concurrency for multipart uploads (default 4)
    +      --b2-upload-cutoff SizeSuffix                         Cutoff for switching to chunked upload (default 200Mi)
    +      --b2-version-at Time                                  Show file versions as they were at the specified time (default off)
    +      --b2-versions                                         Include old versions in directory listings
    +      --box-access-token string                             Box App Primary Access Token
    +      --box-auth-url string                                 Auth server URL
    +      --box-box-config-file string                          Box App config.json location
    +      --box-box-sub-type string                              (default "user")
    +      --box-client-id string                                OAuth Client Id
    +      --box-client-secret string                            OAuth Client Secret
    +      --box-commit-retries int                              Max number of times to try committing a multipart file (default 100)
    +      --box-encoding Encoding                               The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot)
    +      --box-impersonate string                              Impersonate this user ID when using a service account
    +      --box-list-chunk int                                  Size of listing chunk 1-1000 (default 1000)
    +      --box-owned-by string                                 Only show items owned by the login (email address) passed in
    +      --box-root-folder-id string                           Fill in for rclone to use a non root folder as its starting point
    +      --box-token string                                    OAuth Access Token as a JSON blob
    +      --box-token-url string                                Token server url
    +      --box-upload-cutoff SizeSuffix                        Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi)
    +      --cache-chunk-clean-interval Duration                 How often should the cache perform cleanups of the chunk storage (default 1m0s)
    +      --cache-chunk-no-memory                               Disable the in-memory cache for storing chunks during streaming
    +      --cache-chunk-path string                             Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend")
    +      --cache-chunk-size SizeSuffix                         The size of a chunk (partial file data) (default 5Mi)
    +      --cache-chunk-total-size SizeSuffix                   The total size that the chunks can take up on the local disk (default 10Gi)
    +      --cache-db-path string                                Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend")
    +      --cache-db-purge                                      Clear all the cached data for this remote on start
    +      --cache-db-wait-time Duration                         How long to wait for the DB to be available - 0 is unlimited (default 1s)
    +      --cache-info-age Duration                             How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s)
    +      --cache-plex-insecure string                          Skip all certificate verification when connecting to the Plex server
    +      --cache-plex-password string                          The password of the Plex user (obscured)
    +      --cache-plex-url string                               The URL of the Plex server
    +      --cache-plex-username string                          The username of the Plex user
    +      --cache-read-retries int                              How many times to retry a read from a cache storage (default 10)
    +      --cache-remote string                                 Remote to cache
    +      --cache-rps int                                       Limits the number of requests per second to the source FS (-1 to disable) (default -1)
    +      --cache-tmp-upload-path string                        Directory to keep temporary files until they are uploaded
    +      --cache-tmp-wait-time Duration                        How long should files be stored in local cache before being uploaded (default 15s)
    +      --cache-workers int                                   How many workers should run in parallel to download chunks (default 4)
    +      --cache-writes                                        Cache file data on writes through the FS
    +      --chunker-chunk-size SizeSuffix                       Files larger than chunk size will be split in chunks (default 2Gi)
    +      --chunker-fail-hard                                   Choose how chunker should handle files with missing or invalid chunks
    +      --chunker-hash-type string                            Choose how chunker handles hash sums (default "md5")
    +      --chunker-remote string                               Remote to chunk/unchunk
    +      --combine-upstreams SpaceSepList                      Upstreams for combining
    +      --compress-level int                                  GZIP compression level (-2 to 9) (default -1)
    +      --compress-mode string                                Compression mode (default "gzip")
    +      --compress-ram-cache-limit SizeSuffix                 Some remotes don't allow the upload of files with unknown size (default 20Mi)
    +      --compress-remote string                              Remote to compress
    +  -L, --copy-links                                          Follow symlinks and copy the pointed to item
    +      --crypt-directory-name-encryption                     Option to either encrypt directory names or leave them intact (default true)
    +      --crypt-filename-encoding string                      How to encode the encrypted filename to text string (default "base32")
    +      --crypt-filename-encryption string                    How to encrypt the filenames (default "standard")
    +      --crypt-no-data-encryption                            Option to either encrypt file data or leave it unencrypted
    +      --crypt-pass-bad-blocks                               If set this will pass bad blocks through as all 0
    +      --crypt-password string                               Password or pass phrase for encryption (obscured)
    +      --crypt-password2 string                              Password or pass phrase for salt (obscured)
    +      --crypt-remote string                                 Remote to encrypt/decrypt
    +      --crypt-server-side-across-configs                    Deprecated: use --server-side-across-configs instead
    +      --crypt-show-mapping                                  For all files listed show how the names encrypt
    +      --crypt-suffix string                                 If this is set it will override the default suffix of ".bin" (default ".bin")
    +      --drive-acknowledge-abuse                             Set to allow files which return cannotDownloadAbusiveFile to be downloaded
    +      --drive-allow-import-name-change                      Allow the filetype to change when uploading Google docs
    +      --drive-auth-owner-only                               Only consider files owned by the authenticated user
    +      --drive-auth-url string                               Auth server URL
    +      --drive-chunk-size SizeSuffix                         Upload chunk size (default 8Mi)
    +      --drive-client-id string                              Google Application Client Id
    +      --drive-client-secret string                          OAuth Client Secret
    +      --drive-copy-shortcut-content                         Server side copy contents of shortcuts instead of the shortcut
    +      --drive-disable-http2                                 Disable drive using http2 (default true)
    +      --drive-encoding Encoding                             The encoding for the backend (default InvalidUtf8)
    +      --drive-env-auth                                      Get IAM credentials from runtime (environment variables or instance meta data if no env vars)
    +      --drive-export-formats string                         Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg")
    +      --drive-fast-list-bug-fix                             Work around a bug in Google Drive listing (default true)
    +      --drive-formats string                                Deprecated: See export_formats
    +      --drive-impersonate string                            Impersonate this user when using a service account
    +      --drive-import-formats string                         Comma separated list of preferred formats for uploading Google docs
    +      --drive-keep-revision-forever                         Keep new head revision of each file forever
    +      --drive-list-chunk int                                Size of listing chunk 100-1000, 0 to disable (default 1000)
    +      --drive-metadata-labels Bits                          Control whether labels should be read or written in metadata (default off)
    +      --drive-metadata-owner Bits                           Control whether owner should be read or written in metadata (default read)
    +      --drive-metadata-permissions Bits                     Control whether permissions should be read or written in metadata (default off)
    +      --drive-pacer-burst int                               Number of API calls to allow without sleeping (default 100)
    +      --drive-pacer-min-sleep Duration                      Minimum time to sleep between API calls (default 100ms)
    +      --drive-resource-key string                           Resource key for accessing a link-shared file
    +      --drive-root-folder-id string                         ID of the root folder
    +      --drive-scope string                                  Comma separated list of scopes that rclone should use when requesting access from drive
    +      --drive-server-side-across-configs                    Deprecated: use --server-side-across-configs instead
    +      --drive-service-account-credentials string            Service Account Credentials JSON blob
    +      --drive-service-account-file string                   Service Account Credentials JSON file path
    +      --drive-shared-with-me                                Only show files that are shared with me
    +      --drive-show-all-gdocs                                Show all Google Docs including non-exportable ones in listings
    +      --drive-size-as-quota                                 Show sizes as storage quota usage, not actual size
    +      --drive-skip-checksum-gphotos                         Skip checksums on Google photos and videos only
    +      --drive-skip-dangling-shortcuts                       If set skip dangling shortcut files
    +      --drive-skip-gdocs                                    Skip google documents in all listings
    +      --drive-skip-shortcuts                                If set skip shortcut files
    +      --drive-starred-only                                  Only show files that are starred
    +      --drive-stop-on-download-limit                        Make download limit errors be fatal
    +      --drive-stop-on-upload-limit                          Make upload limit errors be fatal
    +      --drive-team-drive string                             ID of the Shared Drive (Team Drive)
    +      --drive-token string                                  OAuth Access Token as a JSON blob
    +      --drive-token-url string                              Token server url
    +      --drive-trashed-only                                  Only show files that are in the trash
    +      --drive-upload-cutoff SizeSuffix                      Cutoff for switching to chunked upload (default 8Mi)
    +      --drive-use-created-date                              Use file created date instead of modified date
    +      --drive-use-shared-date                               Use date file was shared instead of modified date
    +      --drive-use-trash                                     Send files to the trash instead of deleting permanently (default true)
    +      --drive-v2-download-min-size SizeSuffix               If Object's are greater, use drive v2 API to download (default off)
    +      --dropbox-auth-url string                             Auth server URL
    +      --dropbox-batch-commit-timeout Duration               Max time to wait for a batch to finish committing (default 10m0s)
    +      --dropbox-batch-mode string                           Upload file batching sync|async|off (default "sync")
    +      --dropbox-batch-size int                              Max number of files in upload batch
    +      --dropbox-batch-timeout Duration                      Max time to allow an idle upload batch before uploading (default 0s)
    +      --dropbox-chunk-size SizeSuffix                       Upload chunk size (< 150Mi) (default 48Mi)
    +      --dropbox-client-id string                            OAuth Client Id
    +      --dropbox-client-secret string                        OAuth Client Secret
    +      --dropbox-encoding Encoding                           The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot)
    +      --dropbox-impersonate string                          Impersonate this user when using a business account
    +      --dropbox-pacer-min-sleep Duration                    Minimum time to sleep between API calls (default 10ms)
    +      --dropbox-shared-files                                Instructs rclone to work on individual shared files
    +      --dropbox-shared-folders                              Instructs rclone to work on shared folders
    +      --dropbox-token string                                OAuth Access Token as a JSON blob
    +      --dropbox-token-url string                            Token server url
    +      --fichier-api-key string                              Your API Key, get it from https://1fichier.com/console/params.pl
    +      --fichier-cdn                                         Set if you wish to use CDN download links
    +      --fichier-encoding Encoding                           The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot)
    +      --fichier-file-password string                        If you want to download a shared file that is password protected, add this parameter (obscured)
    +      --fichier-folder-password string                      If you want to list the files in a shared folder that is password protected, add this parameter (obscured)
    +      --fichier-shared-folder string                        If you want to download a shared folder, add this parameter
    +      --filefabric-encoding Encoding                        The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot)
    +      --filefabric-permanent-token string                   Permanent Authentication Token
    +      --filefabric-root-folder-id string                    ID of the root folder
    +      --filefabric-token string                             Session Token
    +      --filefabric-token-expiry string                      Token expiry time
    +      --filefabric-url string                               URL of the Enterprise File Fabric to connect to
    +      --filefabric-version string                           Version read from the file fabric
    +      --ftp-ask-password                                    Allow asking for FTP password when needed
    +      --ftp-close-timeout Duration                          Maximum time to wait for a response to close (default 1m0s)
    +      --ftp-concurrency int                                 Maximum number of FTP simultaneous connections, 0 for unlimited
    +      --ftp-disable-epsv                                    Disable using EPSV even if server advertises support
    +      --ftp-disable-mlsd                                    Disable using MLSD even if server advertises support
    +      --ftp-disable-tls13                                   Disable TLS 1.3 (workaround for FTP servers with buggy TLS)
    +      --ftp-disable-utf8                                    Disable using UTF-8 even if server advertises support
    +      --ftp-encoding Encoding                               The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot)
    +      --ftp-explicit-tls                                    Use Explicit FTPS (FTP over TLS)
    +      --ftp-force-list-hidden                               Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD
    +      --ftp-host string                                     FTP host to connect to
    +      --ftp-idle-timeout Duration                           Max time before closing idle connections (default 1m0s)
    +      --ftp-no-check-certificate                            Do not verify the TLS certificate of the server
    +      --ftp-pass string                                     FTP password (obscured)
    +      --ftp-port int                                        FTP port number (default 21)
    +      --ftp-shut-timeout Duration                           Maximum time to wait for data connection closing status (default 1m0s)
    +      --ftp-socks-proxy string                              Socks 5 proxy host
    +      --ftp-tls                                             Use Implicit FTPS (FTP over TLS)
    +      --ftp-tls-cache-size int                              Size of TLS session cache for all control and data connections (default 32)
    +      --ftp-user string                                     FTP username (default "$USER")
    +      --ftp-writing-mdtm                                    Use MDTM to set modification time (VsFtpd quirk)
    +      --gcs-anonymous                                       Access public buckets and objects without credentials
    +      --gcs-auth-url string                                 Auth server URL
    +      --gcs-bucket-acl string                               Access Control List for new buckets
    +      --gcs-bucket-policy-only                              Access checks should use bucket-level IAM policies
    +      --gcs-client-id string                                OAuth Client Id
    +      --gcs-client-secret string                            OAuth Client Secret
    +      --gcs-decompress                                      If set this will decompress gzip encoded objects
    +      --gcs-directory-markers                               Upload an empty object with a trailing slash when a new directory is created
    +      --gcs-encoding Encoding                               The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot)
    +      --gcs-endpoint string                                 Endpoint for the service
    +      --gcs-env-auth                                        Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars)
    +      --gcs-location string                                 Location for the newly created buckets
    +      --gcs-no-check-bucket                                 If set, don't attempt to check the bucket exists or create it
    +      --gcs-object-acl string                               Access Control List for new objects
    +      --gcs-project-number string                           Project number
    +      --gcs-service-account-file string                     Service Account Credentials JSON file path
    +      --gcs-storage-class string                            The storage class to use when storing objects in Google Cloud Storage
    +      --gcs-token string                                    OAuth Access Token as a JSON blob
    +      --gcs-token-url string                                Token server url
    +      --gcs-user-project string                             User project
    +      --gphotos-auth-url string                             Auth server URL
    +      --gphotos-batch-commit-timeout Duration               Max time to wait for a batch to finish committing (default 10m0s)
    +      --gphotos-batch-mode string                           Upload file batching sync|async|off (default "sync")
    +      --gphotos-batch-size int                              Max number of files in upload batch
    +      --gphotos-batch-timeout Duration                      Max time to allow an idle upload batch before uploading (default 0s)
    +      --gphotos-client-id string                            OAuth Client Id
    +      --gphotos-client-secret string                        OAuth Client Secret
    +      --gphotos-encoding Encoding                           The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot)
    +      --gphotos-include-archived                            Also view and download archived media
    +      --gphotos-read-only                                   Set to make the Google Photos backend read only
    +      --gphotos-read-size                                   Set to read the size of media items
    +      --gphotos-start-year int                              Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000)
    +      --gphotos-token string                                OAuth Access Token as a JSON blob
    +      --gphotos-token-url string                            Token server url
    +      --hasher-auto-size SizeSuffix                         Auto-update checksum for files smaller than this size (disabled by default)
    +      --hasher-hashes CommaSepList                          Comma separated list of supported checksum types (default md5,sha1)
    +      --hasher-max-age Duration                             Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off)
    +      --hasher-remote string                                Remote to cache checksums for (e.g. myRemote:path)
    +      --hdfs-data-transfer-protection string                Kerberos data transfer protection: authentication|integrity|privacy
    +      --hdfs-encoding Encoding                              The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot)
    +      --hdfs-namenode CommaSepList                          Hadoop name nodes and ports
    +      --hdfs-service-principal-name string                  Kerberos service principal name for the namenode
    +      --hdfs-username string                                Hadoop user name
    +      --hidrive-auth-url string                             Auth server URL
    +      --hidrive-chunk-size SizeSuffix                       Chunksize for chunked uploads (default 48Mi)
    +      --hidrive-client-id string                            OAuth Client Id
    +      --hidrive-client-secret string                        OAuth Client Secret
    +      --hidrive-disable-fetching-member-count               Do not fetch number of objects in directories unless it is absolutely necessary
    +      --hidrive-encoding Encoding                           The encoding for the backend (default Slash,Dot)
    +      --hidrive-endpoint string                             Endpoint for the service (default "https://api.hidrive.strato.com/2.1")
    +      --hidrive-root-prefix string                          The root/parent folder for all paths (default "/")
    +      --hidrive-scope-access string                         Access permissions that rclone should use when requesting access from HiDrive (default "rw")
    +      --hidrive-scope-role string                           User-level that rclone should use when requesting access from HiDrive (default "user")
    +      --hidrive-token string                                OAuth Access Token as a JSON blob
    +      --hidrive-token-url string                            Token server url
    +      --hidrive-upload-concurrency int                      Concurrency for chunked uploads (default 4)
    +      --hidrive-upload-cutoff SizeSuffix                    Cutoff/Threshold for chunked uploads (default 96Mi)
    +      --http-headers CommaSepList                           Set HTTP headers for all transactions
    +      --http-no-head                                        Don't use HEAD requests
    +      --http-no-slash                                       Set this if the site doesn't end directories with /
    +      --http-url string                                     URL of HTTP host to connect to
    +      --imagekit-encoding Encoding                          The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket)
    +      --imagekit-endpoint string                            You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
    +      --imagekit-only-signed Restrict unsigned image URLs   If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true
    +      --imagekit-private-key string                         You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
    +      --imagekit-public-key string                          You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
    +      --imagekit-upload-tags string                         Tags to add to the uploaded files, e.g. "tag1,tag2"
    +      --imagekit-versions                                   Include old versions in directory listings
    +      --internetarchive-access-key-id string                IAS3 Access Key
    +      --internetarchive-disable-checksum                    Don't ask the server to test against MD5 checksum calculated by rclone (default true)
    +      --internetarchive-encoding Encoding                   The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot)
    +      --internetarchive-endpoint string                     IAS3 Endpoint (default "https://s3.us.archive.org")
    +      --internetarchive-front-endpoint string               Host of InternetArchive Frontend (default "https://archive.org")
    +      --internetarchive-secret-access-key string            IAS3 Secret Key (password)
    +      --internetarchive-wait-archive Duration               Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s)
    +      --jottacloud-auth-url string                          Auth server URL
    +      --jottacloud-client-id string                         OAuth Client Id
    +      --jottacloud-client-secret string                     OAuth Client Secret
    +      --jottacloud-encoding Encoding                        The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot)
    +      --jottacloud-hard-delete                              Delete files permanently rather than putting them into the trash
    +      --jottacloud-md5-memory-limit SizeSuffix              Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi)
    +      --jottacloud-no-versions                              Avoid server side versioning by deleting files and recreating files instead of overwriting them
    +      --jottacloud-token string                             OAuth Access Token as a JSON blob
    +      --jottacloud-token-url string                         Token server url
    +      --jottacloud-trashed-only                             Only show files that are in the trash
    +      --jottacloud-upload-resume-limit SizeSuffix           Files bigger than this can be resumed if the upload fail's (default 10Mi)
    +      --koofr-encoding Encoding                             The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --koofr-endpoint string                               The Koofr API endpoint to use
    +      --koofr-mountid string                                Mount ID of the mount to use
    +      --koofr-password string                               Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured)
    +      --koofr-provider string                               Choose your storage provider
    +      --koofr-setmtime                                      Does the backend support setting modification time (default true)
    +      --koofr-user string                                   Your user name
    +      --linkbox-token string                                Token from https://www.linkbox.to/admin/account
    +  -l, --links                                               Translate symlinks to/from regular files with a '.rclonelink' extension
    +      --local-case-insensitive                              Force the filesystem to report itself as case insensitive
    +      --local-case-sensitive                                Force the filesystem to report itself as case sensitive
    +      --local-encoding Encoding                             The encoding for the backend (default Slash,Dot)
    +      --local-no-check-updated                              Don't check to see if the files change during upload
    +      --local-no-preallocate                                Disable preallocation of disk space for transferred files
    +      --local-no-set-modtime                                Disable setting modtime
    +      --local-no-sparse                                     Disable sparse files for multi-thread downloads
    +      --local-nounc                                         Disable UNC (long path names) conversion on Windows
    +      --local-unicode-normalization                         Apply unicode NFC normalization to paths and filenames
    +      --local-zero-size-links                               Assume the Stat size of links is zero (and read them instead) (deprecated)
    +      --mailru-auth-url string                              Auth server URL
    +      --mailru-check-hash                                   What should copy do if file checksum is mismatched or invalid (default true)
    +      --mailru-client-id string                             OAuth Client Id
    +      --mailru-client-secret string                         OAuth Client Secret
    +      --mailru-encoding Encoding                            The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --mailru-pass string                                  Password (obscured)
    +      --mailru-speedup-enable                               Skip full upload if there is another file with same data hash (default true)
    +      --mailru-speedup-file-patterns string                 Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf")
    +      --mailru-speedup-max-disk SizeSuffix                  This option allows you to disable speedup (put by hash) for large files (default 3Gi)
    +      --mailru-speedup-max-memory SizeSuffix                Files larger than the size given below will always be hashed on disk (default 32Mi)
    +      --mailru-token string                                 OAuth Access Token as a JSON blob
    +      --mailru-token-url string                             Token server url
    +      --mailru-user string                                  User name (usually email)
    +      --mega-debug                                          Output more debug from Mega
    +      --mega-encoding Encoding                              The encoding for the backend (default Slash,InvalidUtf8,Dot)
    +      --mega-hard-delete                                    Delete files permanently rather than putting them into the trash
    +      --mega-pass string                                    Password (obscured)
    +      --mega-use-https                                      Use HTTPS for transfers
    +      --mega-user string                                    User name
    +      --netstorage-account string                           Set the NetStorage account name
    +      --netstorage-host string                              Domain+path of NetStorage host to connect to
    +      --netstorage-protocol string                          Select between HTTP or HTTPS protocol (default "https")
    +      --netstorage-secret string                            Set the NetStorage account secret/G2O key for authentication (obscured)
    +  -x, --one-file-system                                     Don't cross filesystem boundaries (unix/macOS only)
    +      --onedrive-access-scopes SpaceSepList                 Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access)
    +      --onedrive-auth-url string                            Auth server URL
    +      --onedrive-av-override                                Allows download of files the server thinks has a virus
    +      --onedrive-chunk-size SizeSuffix                      Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi)
    +      --onedrive-client-id string                           OAuth Client Id
    +      --onedrive-client-secret string                       OAuth Client Secret
    +      --onedrive-delta                                      If set rclone will use delta listing to implement recursive listings
    +      --onedrive-drive-id string                            The ID of the drive to use
    +      --onedrive-drive-type string                          The type of the drive (personal | business | documentLibrary)
    +      --onedrive-encoding Encoding                          The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot)
    +      --onedrive-expose-onenote-files                       Set to make OneNote files show up in directory listings
    +      --onedrive-hash-type string                           Specify the hash in use for the backend (default "auto")
    +      --onedrive-link-password string                       Set the password for links created by the link command
    +      --onedrive-link-scope string                          Set the scope of the links created by the link command (default "anonymous")
    +      --onedrive-link-type string                           Set the type of the links created by the link command (default "view")
    +      --onedrive-list-chunk int                             Size of listing chunk (default 1000)
    +      --onedrive-no-versions                                Remove all versions on modifying operations
    +      --onedrive-region string                              Choose national cloud region for OneDrive (default "global")
    +      --onedrive-root-folder-id string                      ID of the root folder
    +      --onedrive-server-side-across-configs                 Deprecated: use --server-side-across-configs instead
    +      --onedrive-token string                               OAuth Access Token as a JSON blob
    +      --onedrive-token-url string                           Token server url
    +      --oos-attempt-resume-upload                           If true attempt to resume previously started multipart upload for the object
    +      --oos-chunk-size SizeSuffix                           Chunk size to use for uploading (default 5Mi)
    +      --oos-compartment string                              Object storage compartment OCID
    +      --oos-config-file string                              Path to OCI config file (default "~/.oci/config")
    +      --oos-config-profile string                           Profile name inside the oci config file (default "Default")
    +      --oos-copy-cutoff SizeSuffix                          Cutoff for switching to multipart copy (default 4.656Gi)
    +      --oos-copy-timeout Duration                           Timeout for copy (default 1m0s)
    +      --oos-disable-checksum                                Don't store MD5 checksum with object metadata
    +      --oos-encoding Encoding                               The encoding for the backend (default Slash,InvalidUtf8,Dot)
    +      --oos-endpoint string                                 Endpoint for Object storage API
    +      --oos-leave-parts-on-error                            If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery
    +      --oos-max-upload-parts int                            Maximum number of parts in a multipart upload (default 10000)
    +      --oos-namespace string                                Object storage namespace
    +      --oos-no-check-bucket                                 If set, don't attempt to check the bucket exists or create it
    +      --oos-provider string                                 Choose your Auth Provider (default "env_auth")
    +      --oos-region string                                   Object storage Region
    +      --oos-sse-customer-algorithm string                   If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm
    +      --oos-sse-customer-key string                         To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to
    +      --oos-sse-customer-key-file string                    To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated
    +      --oos-sse-customer-key-sha256 string                  If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption
    +      --oos-sse-kms-key-id string                           if using your own master key in vault, this header specifies the
    +      --oos-storage-tier string                             The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard")
    +      --oos-upload-concurrency int                          Concurrency for multipart uploads (default 10)
    +      --oos-upload-cutoff SizeSuffix                        Cutoff for switching to chunked upload (default 200Mi)
    +      --opendrive-chunk-size SizeSuffix                     Files will be uploaded in chunks this size (default 10Mi)
    +      --opendrive-encoding Encoding                         The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot)
    +      --opendrive-password string                           Password (obscured)
    +      --opendrive-username string                           Username
    +      --pcloud-auth-url string                              Auth server URL
    +      --pcloud-client-id string                             OAuth Client Id
    +      --pcloud-client-secret string                         OAuth Client Secret
    +      --pcloud-encoding Encoding                            The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --pcloud-hostname string                              Hostname to connect to (default "api.pcloud.com")
    +      --pcloud-password string                              Your pcloud password (obscured)
    +      --pcloud-root-folder-id string                        Fill in for rclone to use a non root folder as its starting point (default "d0")
    +      --pcloud-token string                                 OAuth Access Token as a JSON blob
    +      --pcloud-token-url string                             Token server url
    +      --pcloud-username string                              Your pcloud username
    +      --pikpak-auth-url string                              Auth server URL
    +      --pikpak-client-id string                             OAuth Client Id
    +      --pikpak-client-secret string                         OAuth Client Secret
    +      --pikpak-encoding Encoding                            The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot)
    +      --pikpak-hash-memory-limit SizeSuffix                 Files bigger than this will be cached on disk to calculate hash if required (default 10Mi)
    +      --pikpak-pass string                                  Pikpak password (obscured)
    +      --pikpak-root-folder-id string                        ID of the root folder
    +      --pikpak-token string                                 OAuth Access Token as a JSON blob
    +      --pikpak-token-url string                             Token server url
    +      --pikpak-trashed-only                                 Only show files that are in the trash
    +      --pikpak-use-trash                                    Send files to the trash instead of deleting permanently (default true)
    +      --pikpak-user string                                  Pikpak username
    +      --premiumizeme-auth-url string                        Auth server URL
    +      --premiumizeme-client-id string                       OAuth Client Id
    +      --premiumizeme-client-secret string                   OAuth Client Secret
    +      --premiumizeme-encoding Encoding                      The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --premiumizeme-token string                           OAuth Access Token as a JSON blob
    +      --premiumizeme-token-url string                       Token server url
    +      --protondrive-2fa string                              The 2FA code
    +      --protondrive-app-version string                      The app version string (default "macos-drive@1.0.0-alpha.1+rclone")
    +      --protondrive-enable-caching                          Caches the files and folders metadata to reduce API calls (default true)
    +      --protondrive-encoding Encoding                       The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot)
    +      --protondrive-mailbox-password string                 The mailbox password of your two-password proton account (obscured)
    +      --protondrive-original-file-size                      Return the file size before encryption (default true)
    +      --protondrive-password string                         The password of your proton account (obscured)
    +      --protondrive-replace-existing-draft                  Create a new revision when filename conflict is detected
    +      --protondrive-username string                         The username of your proton account
    +      --putio-auth-url string                               Auth server URL
    +      --putio-client-id string                              OAuth Client Id
    +      --putio-client-secret string                          OAuth Client Secret
    +      --putio-encoding Encoding                             The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --putio-token string                                  OAuth Access Token as a JSON blob
    +      --putio-token-url string                              Token server url
    +      --qingstor-access-key-id string                       QingStor Access Key ID
    +      --qingstor-chunk-size SizeSuffix                      Chunk size to use for uploading (default 4Mi)
    +      --qingstor-connection-retries int                     Number of connection retries (default 3)
    +      --qingstor-encoding Encoding                          The encoding for the backend (default Slash,Ctl,InvalidUtf8)
    +      --qingstor-endpoint string                            Enter an endpoint URL to connection QingStor API
    +      --qingstor-env-auth                                   Get QingStor credentials from runtime
    +      --qingstor-secret-access-key string                   QingStor Secret Access Key (password)
    +      --qingstor-upload-concurrency int                     Concurrency for multipart uploads (default 1)
    +      --qingstor-upload-cutoff SizeSuffix                   Cutoff for switching to chunked upload (default 200Mi)
    +      --qingstor-zone string                                Zone to connect to
    +      --quatrix-api-key string                              API key for accessing Quatrix account
    +      --quatrix-effective-upload-time string                Wanted upload time for one chunk (default "4s")
    +      --quatrix-encoding Encoding                           The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot)
    +      --quatrix-hard-delete                                 Delete files permanently rather than putting them into the trash
    +      --quatrix-host string                                 Host name of Quatrix account
    +      --quatrix-maximal-summary-chunk-size SizeSuffix       The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi)
    +      --quatrix-minimal-chunk-size SizeSuffix               The minimal size for one chunk (default 9.537Mi)
    +      --s3-access-key-id string                             AWS Access Key ID
    +      --s3-acl string                                       Canned ACL used when creating buckets and storing or copying objects
    +      --s3-bucket-acl string                                Canned ACL used when creating buckets
    +      --s3-chunk-size SizeSuffix                            Chunk size to use for uploading (default 5Mi)
    +      --s3-copy-cutoff SizeSuffix                           Cutoff for switching to multipart copy (default 4.656Gi)
    +      --s3-decompress                                       If set this will decompress gzip encoded objects
    +      --s3-directory-markers                                Upload an empty object with a trailing slash when a new directory is created
    +      --s3-disable-checksum                                 Don't store MD5 checksum with object metadata
    +      --s3-disable-http2                                    Disable usage of http2 for S3 backends
    +      --s3-download-url string                              Custom endpoint for downloads
    +      --s3-encoding Encoding                                The encoding for the backend (default Slash,InvalidUtf8,Dot)
    +      --s3-endpoint string                                  Endpoint for S3 API
    +      --s3-env-auth                                         Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars)
    +      --s3-force-path-style                                 If true use path style access if false use virtual hosted style (default true)
    +      --s3-leave-parts-on-error                             If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery
    +      --s3-list-chunk int                                   Size of listing chunk (response list for each ListObject S3 request) (default 1000)
    +      --s3-list-url-encode Tristate                         Whether to url encode listings: true/false/unset (default unset)
    +      --s3-list-version int                                 Version of ListObjects to use: 1,2 or 0 for auto
    +      --s3-location-constraint string                       Location constraint - must be set to match the Region
    +      --s3-max-upload-parts int                             Maximum number of parts in a multipart upload (default 10000)
    +      --s3-might-gzip Tristate                              Set this if the backend might gzip objects (default unset)
    +      --s3-no-check-bucket                                  If set, don't attempt to check the bucket exists or create it
    +      --s3-no-head                                          If set, don't HEAD uploaded objects to check integrity
    +      --s3-no-head-object                                   If set, do not do HEAD before GET when getting objects
    +      --s3-no-system-metadata                               Suppress setting and reading of system metadata
    +      --s3-profile string                                   Profile to use in the shared credentials file
    +      --s3-provider string                                  Choose your S3 provider
    +      --s3-region string                                    Region to connect to
    +      --s3-requester-pays                                   Enables requester pays option when interacting with S3 bucket
    +      --s3-secret-access-key string                         AWS Secret Access Key (password)
    +      --s3-server-side-encryption string                    The server-side encryption algorithm used when storing this object in S3
    +      --s3-session-token string                             An AWS session token
    +      --s3-shared-credentials-file string                   Path to the shared credentials file
    +      --s3-sse-customer-algorithm string                    If using SSE-C, the server-side encryption algorithm used when storing this object in S3
    +      --s3-sse-customer-key string                          To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data
    +      --s3-sse-customer-key-base64 string                   If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data
    +      --s3-sse-customer-key-md5 string                      If using SSE-C you may provide the secret encryption key MD5 checksum (optional)
    +      --s3-sse-kms-key-id string                            If using KMS ID you must provide the ARN of Key
    +      --s3-storage-class string                             The storage class to use when storing new objects in S3
    +      --s3-sts-endpoint string                              Endpoint for STS
    +      --s3-upload-concurrency int                           Concurrency for multipart uploads (default 4)
    +      --s3-upload-cutoff SizeSuffix                         Cutoff for switching to chunked upload (default 200Mi)
    +      --s3-use-accelerate-endpoint                          If true use the AWS S3 accelerated endpoint
    +      --s3-use-accept-encoding-gzip Accept-Encoding: gzip   Whether to send Accept-Encoding: gzip header (default unset)
    +      --s3-use-already-exists Tristate                      Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset)
    +      --s3-use-multipart-etag Tristate                      Whether to use ETag in multipart uploads for verification (default unset)
    +      --s3-use-multipart-uploads Tristate                   Set if rclone should use multipart uploads (default unset)
    +      --s3-use-presigned-request                            Whether to use a presigned request or PutObject for single part uploads
    +      --s3-v2-auth                                          If true use v2 authentication
    +      --s3-version-at Time                                  Show file versions as they were at the specified time (default off)
    +      --s3-versions                                         Include old versions in directory listings
    +      --seafile-2fa                                         Two-factor authentication ('true' if the account has 2FA enabled)
    +      --seafile-create-library                              Should rclone create a library if it doesn't exist
    +      --seafile-encoding Encoding                           The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8)
    +      --seafile-library string                              Name of the library
    +      --seafile-library-key string                          Library password (for encrypted libraries only) (obscured)
    +      --seafile-pass string                                 Password (obscured)
    +      --seafile-url string                                  URL of seafile host to connect to
    +      --seafile-user string                                 User name (usually email address)
    +      --sftp-ask-password                                   Allow asking for SFTP password when needed
    +      --sftp-chunk-size SizeSuffix                          Upload and download chunk size (default 32Ki)
    +      --sftp-ciphers SpaceSepList                           Space separated list of ciphers to be used for session encryption, ordered by preference
    +      --sftp-concurrency int                                The maximum number of outstanding requests for one file (default 64)
    +      --sftp-copy-is-hardlink                               Set to enable server side copies using hardlinks
    +      --sftp-disable-concurrent-reads                       If set don't use concurrent reads
    +      --sftp-disable-concurrent-writes                      If set don't use concurrent writes
    +      --sftp-disable-hashcheck                              Disable the execution of SSH commands to determine if remote file hashing is available
    +      --sftp-host string                                    SSH host to connect to
    +      --sftp-host-key-algorithms SpaceSepList               Space separated list of host key algorithms, ordered by preference
    +      --sftp-idle-timeout Duration                          Max time before closing idle connections (default 1m0s)
    +      --sftp-key-exchange SpaceSepList                      Space separated list of key exchange algorithms, ordered by preference
    +      --sftp-key-file string                                Path to PEM-encoded private key file
    +      --sftp-key-file-pass string                           The passphrase to decrypt the PEM-encoded private key file (obscured)
    +      --sftp-key-pem string                                 Raw PEM-encoded private key
    +      --sftp-key-use-agent                                  When set forces the usage of the ssh-agent
    +      --sftp-known-hosts-file string                        Optional path to known_hosts file
    +      --sftp-macs SpaceSepList                              Space separated list of MACs (message authentication code) algorithms, ordered by preference
    +      --sftp-md5sum-command string                          The command used to read md5 hashes
    +      --sftp-pass string                                    SSH password, leave blank to use ssh-agent (obscured)
    +      --sftp-path-override string                           Override path used by SSH shell commands
    +      --sftp-port int                                       SSH port number (default 22)
    +      --sftp-pubkey-file string                             Optional path to public key file
    +      --sftp-server-command string                          Specifies the path or command to run a sftp server on the remote host
    +      --sftp-set-env SpaceSepList                           Environment variables to pass to sftp and commands
    +      --sftp-set-modtime                                    Set the modified time on the remote if set (default true)
    +      --sftp-sha1sum-command string                         The command used to read sha1 hashes
    +      --sftp-shell-type string                              The type of SSH shell on remote server, if any
    +      --sftp-skip-links                                     Set to skip any symlinks and any other non regular files
    +      --sftp-socks-proxy string                             Socks 5 proxy host
    +      --sftp-ssh SpaceSepList                               Path and arguments to external ssh binary
    +      --sftp-subsystem string                               Specifies the SSH2 subsystem on the remote host (default "sftp")
    +      --sftp-use-fstat                                      If set use fstat instead of stat
    +      --sftp-use-insecure-cipher                            Enable the use of insecure ciphers and key exchange methods
    +      --sftp-user string                                    SSH username (default "$USER")
    +      --sharefile-auth-url string                           Auth server URL
    +      --sharefile-chunk-size SizeSuffix                     Upload chunk size (default 64Mi)
    +      --sharefile-client-id string                          OAuth Client Id
    +      --sharefile-client-secret string                      OAuth Client Secret
    +      --sharefile-encoding Encoding                         The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot)
    +      --sharefile-endpoint string                           Endpoint for API calls
    +      --sharefile-root-folder-id string                     ID of the root folder
    +      --sharefile-token string                              OAuth Access Token as a JSON blob
    +      --sharefile-token-url string                          Token server url
    +      --sharefile-upload-cutoff SizeSuffix                  Cutoff for switching to multipart upload (default 128Mi)
    +      --sia-api-password string                             Sia Daemon API Password (obscured)
    +      --sia-api-url string                                  Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980")
    +      --sia-encoding Encoding                               The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot)
    +      --sia-user-agent string                               Siad User Agent (default "Sia-Agent")
    +      --skip-links                                          Don't warn about skipped symlinks
    +      --smb-case-insensitive                                Whether the server is configured to be case-insensitive (default true)
    +      --smb-domain string                                   Domain name for NTLM authentication (default "WORKGROUP")
    +      --smb-encoding Encoding                               The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot)
    +      --smb-hide-special-share                              Hide special shares (e.g. print$) which users aren't supposed to access (default true)
    +      --smb-host string                                     SMB server hostname to connect to
    +      --smb-idle-timeout Duration                           Max time before closing idle connections (default 1m0s)
    +      --smb-pass string                                     SMB password (obscured)
    +      --smb-port int                                        SMB port number (default 445)
    +      --smb-spn string                                      Service principal name
    +      --smb-user string                                     SMB username (default "$USER")
    +      --storj-access-grant string                           Access grant
    +      --storj-api-key string                                API key
    +      --storj-passphrase string                             Encryption passphrase
    +      --storj-provider string                               Choose an authentication method (default "existing")
    +      --storj-satellite-address string                      Satellite address (default "us1.storj.io")
    +      --sugarsync-access-key-id string                      Sugarsync Access Key ID
    +      --sugarsync-app-id string                             Sugarsync App ID
    +      --sugarsync-authorization string                      Sugarsync authorization
    +      --sugarsync-authorization-expiry string               Sugarsync authorization expiry
    +      --sugarsync-deleted-id string                         Sugarsync deleted folder id
    +      --sugarsync-encoding Encoding                         The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot)
    +      --sugarsync-hard-delete                               Permanently delete files if true
    +      --sugarsync-private-access-key string                 Sugarsync Private Access Key
    +      --sugarsync-refresh-token string                      Sugarsync refresh token
    +      --sugarsync-root-id string                            Sugarsync root id
    +      --sugarsync-user string                               Sugarsync user
    +      --swift-application-credential-id string              Application Credential ID (OS_APPLICATION_CREDENTIAL_ID)
    +      --swift-application-credential-name string            Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME)
    +      --swift-application-credential-secret string          Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET)
    +      --swift-auth string                                   Authentication URL for server (OS_AUTH_URL)
    +      --swift-auth-token string                             Auth Token from alternate authentication - optional (OS_AUTH_TOKEN)
    +      --swift-auth-version int                              AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION)
    +      --swift-chunk-size SizeSuffix                         Above this size files will be chunked into a _segments container (default 5Gi)
    +      --swift-domain string                                 User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)
    +      --swift-encoding Encoding                             The encoding for the backend (default Slash,InvalidUtf8)
    +      --swift-endpoint-type string                          Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public")
    +      --swift-env-auth                                      Get swift credentials from environment variables in standard OpenStack form
    +      --swift-key string                                    API key or password (OS_PASSWORD)
    +      --swift-leave-parts-on-error                          If true avoid calling abort upload on a failure
    +      --swift-no-chunk                                      Don't chunk files during streaming upload
    +      --swift-no-large-objects                              Disable support for static and dynamic large objects
    +      --swift-region string                                 Region name - optional (OS_REGION_NAME)
    +      --swift-storage-policy string                         The storage policy to use when creating a new container
    +      --swift-storage-url string                            Storage URL - optional (OS_STORAGE_URL)
    +      --swift-tenant string                                 Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME)
    +      --swift-tenant-domain string                          Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME)
    +      --swift-tenant-id string                              Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID)
    +      --swift-user string                                   User name to log in (OS_USERNAME)
    +      --swift-user-id string                                User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID)
    +      --union-action-policy string                          Policy to choose upstream on ACTION category (default "epall")
    +      --union-cache-time int                                Cache time of usage and free space (in seconds) (default 120)
    +      --union-create-policy string                          Policy to choose upstream on CREATE category (default "epmfs")
    +      --union-min-free-space SizeSuffix                     Minimum viable free space for lfs/eplfs policies (default 1Gi)
    +      --union-search-policy string                          Policy to choose upstream on SEARCH category (default "ff")
    +      --union-upstreams string                              List of space separated upstreams
    +      --uptobox-access-token string                         Your access token
    +      --uptobox-encoding Encoding                           The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot)
    +      --uptobox-private                                     Set to make uploaded files private
    +      --webdav-bearer-token string                          Bearer token instead of user/pass (e.g. a Macaroon)
    +      --webdav-bearer-token-command string                  Command to run to get a bearer token
    +      --webdav-encoding string                              The encoding for the backend
    +      --webdav-headers CommaSepList                         Set HTTP headers for all transactions
    +      --webdav-nextcloud-chunk-size SizeSuffix              Nextcloud upload chunk size (default 10Mi)
    +      --webdav-pacer-min-sleep Duration                     Minimum time to sleep between API calls (default 10ms)
    +      --webdav-pass string                                  Password (obscured)
    +      --webdav-url string                                   URL of http host to connect to
    +      --webdav-user string                                  User name
    +      --webdav-vendor string                                Name of the WebDAV site/service/software you are using
    +      --yandex-auth-url string                              Auth server URL
    +      --yandex-client-id string                             OAuth Client Id
    +      --yandex-client-secret string                         OAuth Client Secret
    +      --yandex-encoding Encoding                            The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot)
    +      --yandex-hard-delete                                  Delete files permanently rather than putting them into the trash
    +      --yandex-token string                                 OAuth Access Token as a JSON blob
    +      --yandex-token-url string                             Token server url
    +      --zoho-auth-url string                                Auth server URL
    +      --zoho-client-id string                               OAuth Client Id
    +      --zoho-client-secret string                           OAuth Client Secret
    +      --zoho-encoding Encoding                              The encoding for the backend (default Del,Ctl,InvalidUtf8)
    +      --zoho-region string                                  Zoho region to connect to
    +      --zoho-token string                                   OAuth Access Token as a JSON blob
    +      --zoho-token-url string                               Token server url

    Docker Volume Plugin

    Introduction

    Docker 1.9 has added support for creating named volumes via command-line interface and mounting them in containers as a way to share data between them. Since Docker 1.10 you can create named volumes with Docker Compose by descriptions in docker-compose.yml files for use by container groups on a single host. As of Docker 1.12 volumes are supported by Docker Swarm included with Docker Engine and created from descriptions in swarm compose v3 files for use with swarm stacks across multiple cluster nodes.

    @@ -9449,10 +11809,16 @@

    Command line syntax

    If exceeded, the bisync run will abort. (default: 50%) --force Bypass `--max-delete` safety check and run the sync. Consider using with `--verbose` + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) --remove-empty-dirs Remove empty directories at the final cleanup step. -1, --resync Performs the resync run. Warning: Path1 files may overwrite Path2 versions. Consider using `--verbose` or `--dry-run` first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! --localtime Use local time in listings (default: UTC) --no-cleanup Retain working files (useful for troubleshooting and testing). --workdir PATH Use custom working directory (useful for testing). @@ -9464,31 +11830,54 @@

    Command line syntax

    Arbitrary rclone flags may be specified on the bisync command line, for example rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s Note that interactions of various rclone flags with bisync process flow has not been fully tested yet.

    Paths

    Path1 and Path2 arguments may be references to any mix of local directory paths (absolute or relative), UNC paths (//server/share/path), Windows drive paths (with a drive letter and :) or configured remotes with optional subdirectory paths. Cloud references are distinguished by having a : in the argument (see Windows support below).

    -

    Path1 and Path2 are treated equally, in that neither has priority for file changes, and access efficiency does not change whether a remote is on Path1 or Path2.

    +

    Path1 and Path2 are treated equally, in that neither has priority for file changes (except during --resync), and access efficiency does not change whether a remote is on Path1 or Path2.

    The listings in bisync working directory (default: ~/.cache/rclone/bisync) are named based on the Path1 and Path2 arguments so that separate syncs to individual directories within the tree may be set up, e.g.: path_to_local_tree..dropbox_subdir.lst.

    -

    Any empty directories after the sync on both the Path1 and Path2 filesystems are not deleted by default. If the --remove-empty-dirs flag is specified, then both paths will have any empty directories purged as the last step in the process.

    +

    Any empty directories after the sync on both the Path1 and Path2 filesystems are not deleted by default, unless --create-empty-src-dirs is specified. If the --remove-empty-dirs flag is specified, then both paths will have ALL empty directories purged as the last step in the process.

    Command-line flags

    --resync

    -

    This will effectively make both Path1 and Path2 filesystems contain a matching superset of all files. Path2 files that do not exist in Path1 will be copied to Path1, and the process will then sync the Path1 tree to Path2.

    -

    The base directories on the both Path1 and Path2 filesystems must exist or bisync will fail. This is required for safety - that bisync can verify that both paths are valid.

    -

    When using --resync, a newer version of a file either on Path1 or Path2 filesystem, will overwrite the file on the other path (only the last version will be kept). Carefully evaluate deltas using --dry-run.

    +

    This will effectively make both Path1 and Path2 filesystems contain a matching superset of all files. Path2 files that do not exist in Path1 will be copied to Path1, and the process will then copy the Path1 tree to Path2.

    +

    The --resync sequence is roughly equivalent to:

    +
    rclone copy Path2 Path1 --ignore-existing
    +rclone copy Path1 Path2
    +

    Or, if using --create-empty-src-dirs:

    +
    rclone copy Path2 Path1 --ignore-existing
    +rclone copy Path1 Path2 --create-empty-src-dirs
    +rclone copy Path2 Path1 --create-empty-src-dirs
    +

    The base directories on both Path1 and Path2 filesystems must exist or bisync will fail. This is required for safety - that bisync can verify that both paths are valid.

    +

    When using --resync, a newer version of a file on the Path2 filesystem will be overwritten by the Path1 filesystem version. (Note that this is NOT entirely symmetrical.) Carefully evaluate deltas using --dry-run.

    For a resync run, one of the paths may be empty (no files in the path tree). The resync run should result in files on both paths, else a normal non-resync run will fail.

    For a non-resync run, either path being empty (no files in the tree) fails with Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst This is a safety check that an unexpected empty path does not result in deleting everything in the other path.

    --check-access

    -

    Access check files are an additional safety measure against data loss. bisync will ensure it can find matching RCLONE_TEST files in the same places in the Path1 and Path2 filesystems. RCLONE_TEST files are not generated automatically. For --check-accessto succeed, you must first either: A) Place one or more RCLONE_TEST files in the Path1 or Path2 filesystem and then do either a run without --check-access or a --resync to set matching files on both filesystems, or B) Set --check-filename to a filename already in use in various locations throughout your sync'd fileset. Time stamps and file contents are not important, just the names and locations. If you have symbolic links in your sync tree it is recommended to place RCLONE_TEST files in the linked-to directory tree to protect against bisync assuming a bunch of deleted files if the linked-to tree should not be accessible. See also the --check-filename flag.

    +

    Access check files are an additional safety measure against data loss. bisync will ensure it can find matching RCLONE_TEST files in the same places in the Path1 and Path2 filesystems. RCLONE_TEST files are not generated automatically. For --check-access to succeed, you must first either: A) Place one or more RCLONE_TEST files in both systems, or B) Set --check-filename to a filename already in use in various locations throughout your sync'd fileset. Recommended methods for A) include: * rclone touch Path1/RCLONE_TEST (create a new file) * rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST (copy an existing file) * rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST" (copy multiple files at once, recursively) * create the files manually (outside of rclone) * run bisync once without --check-access to set matching files on both filesystems will also work, but is not preferred, due to potential for user error (you are temporarily disabling the safety feature).

    +

    Note that --check-access is still enforced on --resync, so bisync --resync --check-access will not work as a method of initially setting the files (this is to ensure that bisync can't inadvertently circumvent its own safety switch.)

    +

    Time stamps and file contents for RCLONE_TEST files are not important, just the names and locations. If you have symbolic links in your sync tree it is recommended to place RCLONE_TEST files in the linked-to directory tree to protect against bisync assuming a bunch of deleted files if the linked-to tree should not be accessible. See also the --check-filename flag.

    --check-filename

    Name of the file(s) used in access health validation. The default --check-filename is RCLONE_TEST. One or more files having this filename must exist, synchronized between your source and destination filesets, in order for --check-access to succeed. See --check-access for additional details.

    --max-delete

    -

    As a safety check, if greater than the --max-delete percent of files were deleted on either the Path1 or Path2 filesystem, then bisync will abort with a warning message, without making any changes. The default --max-delete is 50%. One way to trigger this limit is to rename a directory that contains more than half of your files. This will appear to bisync as a bunch of deleted files and a bunch of new files. This safety check is intended to block bisync from deleting all of the files on both filesystems due to a temporary network access issue, or if the user had inadvertently deleted the files on one side or the other. To force the sync either set a different delete percentage limit, e.g. --max-delete 75 (allows up to 75% deletion), or use --force to bypass the check.

    +

    As a safety check, if greater than the --max-delete percent of files were deleted on either the Path1 or Path2 filesystem, then bisync will abort with a warning message, without making any changes. The default --max-delete is 50%. One way to trigger this limit is to rename a directory that contains more than half of your files. This will appear to bisync as a bunch of deleted files and a bunch of new files. This safety check is intended to block bisync from deleting all of the files on both filesystems due to a temporary network access issue, or if the user had inadvertently deleted the files on one side or the other. To force the sync, either set a different delete percentage limit, e.g. --max-delete 75 (allows up to 75% deletion), or use --force to bypass the check.

    Also see the all files changed check.

    --filters-file

    By using rclone filter features you can exclude file types or directory sub-trees from the sync. See the bisync filters section and generic --filter-from documentation. An example filters file contains filters for non-allowed files for synching with Dropbox.

    -

    If you make changes to your filters file then bisync requires a run with --resync. This is a safety feature, which avoids existing files on the Path1 and/or Path2 side from seeming to disappear from view (since they are excluded in the new listings), which would fool bisync into seeing them as deleted (as compared to the prior run listings), and then bisync would proceed to delete them for real.

    -

    To block this from happening bisync calculates an MD5 hash of the filters file and stores the hash in a .md5 file in the same place as your filters file. On the next runs with --filters-file set, bisync re-calculates the MD5 hash of the current filters file and compares it to the hash stored in .md5 file. If they don't match the run aborts with a critical error and thus forces you to do a --resync, likely avoiding a disaster.

    +

    If you make changes to your filters file then bisync requires a run with --resync. This is a safety feature, which prevents existing files on the Path1 and/or Path2 side from seeming to disappear from view (since they are excluded in the new listings), which would fool bisync into seeing them as deleted (as compared to the prior run listings), and then bisync would proceed to delete them for real.

    +

    To block this from happening, bisync calculates an MD5 hash of the filters file and stores the hash in a .md5 file in the same place as your filters file. On the next run with --filters-file set, bisync re-calculates the MD5 hash of the current filters file and compares it to the hash stored in the .md5 file. If they don't match, the run aborts with a critical error and thus forces you to do a --resync, likely avoiding a disaster.

    --check-sync

    Enabled by default, the check-sync function checks that all of the same files exist in both the Path1 and Path2 history listings. This check-sync integrity check is performed at the end of the sync run by default. Any untrapped failing copy/deletes between the two paths might result in differences between the two listings and in the untracked file content differences between the two paths. A resync run would correct the error.

    Note that the default-enabled integrity check locally executes a load of both the final Path1 and Path2 listings, and thus adds to the run time of a sync. Using --check-sync=false will disable it and may significantly reduce the sync run times for very large numbers of files.

    The check may be run manually with --check-sync=only. It runs only the integrity check and terminates without actually synching.

    +

    See also: Concurrent modifications

    +

    --ignore-listing-checksum

    +

    By default, bisync will retrieve (or generate) checksums (for backends that support them) when creating the listings for both paths, and store the checksums in the listing files. --ignore-listing-checksum will disable this behavior, which may speed things up considerably, especially on backends (such as local) where hashes must be computed on the fly instead of retrieved. Please note the following:

    +
      +
    • While checksums are (by default) generated and stored in the listing files, they are NOT currently used for determining diffs (deltas). It is anticipated that full checksum support will be added in a future version.
    • +
    • --ignore-listing-checksum is NOT the same as --ignore-checksum, and you may wish to use one or the other, or both. In a nutshell: --ignore-listing-checksum controls whether checksums are considered when scanning for diffs, while --ignore-checksum controls whether checksums are considered during the copy/sync operations that follow, if there ARE diffs.
    • +
    • Unless --ignore-listing-checksum is passed, bisync currently computes hashes for one path even when there's no common hash with the other path (for example, a crypt remote.)
    • +
    • If both paths support checksums and have a common hash, AND --ignore-listing-checksum was not specified when creating the listings, --check-sync=only can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) However, --check-sync=only will NOT include checksums if the previous listings were generated on a run using --ignore-listing-checksum. For a more robust integrity check of the current state, consider using check (or cryptcheck, if at least one path is a crypt remote.)
    • +
    +

    --resilient

    +

    Caution: this is an experimental feature. Use at your own risk!

    +

    By default, most errors or interruptions will cause bisync to abort and require --resync to recover. This is a safety feature, to prevent bisync from running again until a user checks things out. However, in some cases, bisync can go too far and enforce a lockout when one isn't actually necessary, like for certain less-serious errors that might resolve themselves on the next run. When --resilient is specified, bisync tries its best to recover and self-correct, and only requires --resync as a last resort when a human's involvement is absolutely necessary. The intended use case is for running bisync as a background process (such as via scheduled cron).

    +

    When using --resilient mode, bisync will still report the error and abort, however it will not lock out future runs -- allowing the possibility of retrying at the next normally scheduled time, without requiring a --resync first. Examples of such retryable errors include access test failures, missing listing files, and filter change detections. These safety features will still prevent the current run from proceeding -- the difference is that if conditions have improved by the time of the next run, that next run will be allowed to proceed. Certain more serious errors will still enforce a --resync lockout, even in --resilient mode, to prevent data loss.

    +

    Behavior of --resilient may change in a future version.

    Operation

    Runtime flow details

    bisync retains the listings of the Path1 and Path2 filesystems from the prior run. On each successive run it will:

    @@ -9589,30 +11978,36 @@

    Unusual sync checks

    +Path1 new/changed AND Path2 new/changed AND Path1 == Path2 +File is new/changed on Path1 AND new/changed on Path2 AND Path1 version is currently identical to Path2 +No change +None + + Path1 new AND Path2 new -File is new on Path1 AND new on Path2 +File is new on Path1 AND new on Path2 (and Path1 version is NOT identical to Path2) Files renamed to _Path1 and _Path2 rclone copy _Path2 file to Path1, rclone copy _Path1 file to Path2 - + Path2 newer AND Path1 changed -File is newer on Path2 AND also changed (newer/older/size) on Path1 +File is newer on Path2 AND also changed (newer/older/size) on Path1 (and Path1 version is NOT identical to Path2) Files renamed to _Path1 and _Path2 rclone copy _Path2 file to Path1, rclone copy _Path1 file to Path2 - + Path2 newer AND Path1 deleted File is newer on Path2 AND also deleted on Path1 Path2 version survives rclone copy Path2 to Path1 - + Path2 deleted AND Path1 changed File is deleted on Path2 AND changed (newer/older/size) on Path1 Path1 version survives rclone copy Path1 to Path2 - + Path1 deleted AND Path2 changed File is deleted on Path1 AND changed (newer/older/size) on Path2 Path2 version survives @@ -9620,9 +12015,10 @@

    Unusual sync checks

    +

    As of rclone v1.64, bisync is now better at detecting false positive sync conflicts, which would previously have resulted in unnecessary renames and duplicates. Now, when bisync comes to a file that it wants to rename (because it is new/changed on both sides), it first checks whether the Path1 and Path2 versions are currently identical (using the same underlying function as check.) If bisync concludes that the files are identical, it will skip them and move on. Otherwise, it will create renamed ..Path1 and ..Path2 duplicates, as before. This behavior also improves the experience of renaming directories, as a --resync is no longer required, so long as the same change has been made on both sides.

    All files changed check

    -

    if all prior existing files on either of the filesystems have changed (e.g. timestamps have changed due to changing the system's timezone) then bisync will abort without making any changes. Any new files are not considered for this check. You could use --force to force the sync (whichever side has the changed timestamp files wins). Alternately, a --resync may be used (Path1 versions will be pushed to Path2). Consider the situation carefully and perhaps use --dry-run before you commit to the changes.

    -

    Modification time

    +

    If all prior existing files on either of the filesystems have changed (e.g. timestamps have changed due to changing the system's timezone) then bisync will abort without making any changes. Any new files are not considered for this check. You could use --force to force the sync (whichever side has the changed timestamp files wins). Alternately, a --resync may be used (Path1 versions will be pushed to Path2). Consider the situation carefully and perhaps use --dry-run before you commit to the changes.

    +

    Modification times

    Bisync relies on file timestamps to identify changed files and will refuse to operate if backend lacks the modification time support.

    If you or your application should change the content of a file without changing the modification time then bisync will not notice the change, and thus will not copy it to the other side.

    Note that on some cloud storage systems it is not possible to have file timestamps that match precisely between the local and other filesystems.

    @@ -9630,30 +12026,48 @@

    Modification time

    Error handling

    Certain bisync critical errors, such as file copy/move failing, will result in a bisync lockout of following runs. The lockout is asserted because the sync status and history of the Path1 and Path2 filesystems cannot be trusted, so it is safer to block any further changes until someone checks things out. The recovery is to do a --resync again.

    It is recommended to use --resync --dry-run --verbose initially and carefully review what changes will be made before running the --resync without --dry-run.

    -

    Most of these events come up due to a error status from an internal call. On such a critical error the {...}.path1.lst and {...}.path2.lst listing files are renamed to extension .lst-err, which blocks any future bisync runs (since the normal .lst files are not found). Bisync keeps them under bisync subdirectory of the rclone cache directory, typically at ${HOME}/.cache/rclone/bisync/ on Linux.

    +

    Most of these events come up due to an error status from an internal call. On such a critical error the {...}.path1.lst and {...}.path2.lst listing files are renamed to extension .lst-err, which blocks any future bisync runs (since the normal .lst files are not found). Bisync keeps them under bisync subdirectory of the rclone cache directory, typically at ${HOME}/.cache/rclone/bisync/ on Linux.

    Some errors are considered temporary and re-running the bisync is not blocked. The critical return blocks further bisync runs.

    +

    See also: --resilient

    Lock file

    When bisync is running, a lock file is created in the bisync working directory, typically at ~/.cache/rclone/bisync/PATH1..PATH2.lck on Linux. If bisync should crash or hang, the lock file will remain in place and block any further runs of bisync for the same paths. Delete the lock file as part of debugging the situation. The lock file effectively blocks follow-on (e.g., scheduled by cron) runs when the prior invocation is taking a long time. The lock file contains PID of the blocking process, which may help in debug.

    Note that while concurrent bisync runs are allowed, be very cautious that there is no overlap in the trees being synched between concurrent runs, lest there be replicated files, deleted files and general mayhem.

    Return codes

    rclone bisync returns the following codes to calling program: - 0 on a successful run, - 1 for a non-critical failing run (a rerun may be successful), - 2 for a critically aborted run (requires a --resync to recover).

    -

    Limitations

    +

    Limitations

    Supported backends

    Bisync is considered BETA and has been tested with the following backends: - Local filesystem - Google Drive - Dropbox - OneDrive - S3 - SFTP - Yandex Disk

    It has not been fully tested with other services yet. If it works, or sorta works, please let us know and we'll update the list. Run the test suite to check for proper operation as described below.

    -

    First release of rclone bisync requires that underlying backend supported the modification time feature and will refuse to run otherwise. This limitation will be lifted in a future rclone bisync release.

    +

    First release of rclone bisync requires that underlying backend supports the modification time feature and will refuse to run otherwise. This limitation will be lifted in a future rclone bisync release.

    Concurrent modifications

    When using Local, FTP or SFTP remotes rclone does not create temporary files at the destination when copying, and thus if the connection is lost the created file may be corrupt, which will likely propagate back to the original path on the next sync, resulting in data loss. This will be solved in a future release, there is no workaround at the moment.

    -

    Files that change during a bisync run may result in data loss. This has been seen in a highly dynamic environment, where the filesystem is getting hammered by running processes during the sync. The solution is to sync at quiet times or filter out unnecessary directories and files.

    +

    Files that change during a bisync run may result in data loss. This has been seen in a highly dynamic environment, where the filesystem is getting hammered by running processes during the sync. The currently recommended solution is to sync at quiet times or filter out unnecessary directories and files.

    +

    As an alternative approach, consider using --check-sync=false (and possibly --resilient) to make bisync more forgiving of filesystems that change during the sync. Be advised that this may cause bisync to miss events that occur during a bisync run, so it is a good idea to supplement this with a periodic independent integrity check, and corrective sync if diffs are found. For example, a possible sequence could look like this:

    +
      +
    1. Normally scheduled bisync run:
    2. +
    +
    rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient
    +
      +
    1. Periodic independent integrity check (perhaps scheduled nightly or weekly):
    2. +
    +
    rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt
    +
      +
    1. If diffs are found, you have some choices to correct them. If one side is more up-to-date and you want to make the other side match it, you could run:
    2. +
    +
    rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v  
    +

    (or switch Path1 and Path2 to make Path2 the source-of-truth)

    +

    Or, if neither side is totally up-to-date, you could run a --resync to bring them back into agreement (but remember that this could cause deleted files to re-appear.)

    +

    *Note also that rclone check does not currently include empty directories, so if you want to know if any empty directories are out of sync, consider alternatively running the above rclone sync command with --dry-run added.

    Empty directories

    -

    New empty directories on one path are not propagated to the other side. This is because bisync (and rclone) natively works on files not directories. The following sequence is a workaround but will not propagate the delete of an empty directory to the other side:

    -
    rclone bisync PATH1 PATH2
    -rclone copy PATH1 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs
    -rclone copy PATH2 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs
    +

    By default, new/deleted empty directories on one path are not propagated to the other side. This is because bisync (and rclone) natively works on files, not directories. However, this can be changed with the --create-empty-src-dirs flag, which works in much the same way as in sync and copy. When used, empty directories created or deleted on one side will also be created or deleted on the other side. The following should be noted: * --create-empty-src-dirs is not compatible with --remove-empty-dirs. Use only one or the other (or neither). * It is not recommended to switch back and forth between --create-empty-src-dirs and the default (no --create-empty-src-dirs) without running --resync. This is because it may appear as though all directories (not just the empty ones) were created/deleted, when actually you've just toggled between making them visible/invisible to bisync. It looks scarier than it is, but it's still probably best to stick to one or the other, and use --resync when you need to switch.

    Renamed directories

    -

    Renaming a folder on the Path1 side results is deleting all files on the Path2 side and then copying all files again from Path1 to Path2. Bisync sees this as all files in the old directory name as deleted and all files in the new directory name as new. Similarly, renaming a directory on both sides to the same name will result in creating ..path1 and ..path2 files on both sides. Currently the most effective and efficient method of renaming a directory is to rename it on both sides, then do a --resync.

    +

    Renaming a folder on the Path1 side results in deleting all files on the Path2 side and then copying all files again from Path1 to Path2. Bisync sees this as all files in the old directory name as deleted and all files in the new directory name as new. Currently, the most effective and efficient method of renaming a directory is to rename it to the same name on both sides. (As of rclone v1.64, a --resync is no longer required after doing so, as bisync will automatically detect that Path1 and Path2 are in agreement.)

    +

    --fast-list used by default

    +

    Unlike most other rclone commands, bisync uses --fast-list by default, for backends that support it. In many cases this is desirable, however, there are some scenarios in which bisync could be faster without --fast-list, and there is also a known issue concerning Google Drive users with many empty directories. For now, the recommended way to avoid using --fast-list is to add --disable ListR to all bisync commands. The default behavior may change in a future version.

    +

    Overridden Configs

    +

    When rclone detects an overridden config, it adds a suffix like {ABCDE} on the fly to the internal name of the remote. Bisync follows suit by including this suffix in its listing filenames. However, this suffix does not necessarily persist from run to run, especially if different flags are provided. So if next time the suffix assigned is {FGHIJ}, bisync will get confused, because it's looking for a listing file with {FGHIJ}, when the file it wants has {ABCDE}. As a result, it throws Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run and refuses to run again until the user runs a --resync (unless using --resilient). The best workaround at the moment is to set any backend-specific flags in the config file instead of specifying them with command flags. (You can still override them as needed for other rclone commands.)

    Case sensitivity

    -

    Synching with case-insensitive filesystems, such as Windows or Box, can result in file name conflicts. This will be fixed in a future release. The near term workaround is to make sure that files on both sides don't have spelling case differences (Smile.jpg vs. smile.jpg).

    +

    Synching with case-insensitive filesystems, such as Windows or Box, can result in file name conflicts. This will be fixed in a future release. The near-term workaround is to make sure that files on both sides don't have spelling case differences (Smile.jpg vs. smile.jpg).

    Windows support

    Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows GitHub runners.

    Drive letters are allowed, including drive letters mapped to network drives (rclone bisync J:\localsync GDrive:). If a drive letter is omitted, the shell current drive is the default. Drive letters are a single character follows by :, so cloud names must be more than one character long.

    @@ -9678,7 +12092,7 @@

    Filters file writing guidelines

  • Excluding such dirs first will make rclone operations (much) faster.
  • Specific files may also be excluded, as with the Dropbox exclusions example below.
  • -
  • Decide if its easier (or cleaner) to: +
  • Decide if it's easier (or cleaner) to:
    • Include select directories and therefore exclude everything else -- or --
    • Exclude select directories and therefore include everything else
    • @@ -9695,7 +12109,7 @@

      Filters file writing guidelines

    • Exclude select directories:
      • Add more lines like in step 1. For example: -/Desktop/tempfiles/, or `- /testdir/. Again, a**` on the end is not necessary.
      • -
      • Do not add a `- **` in the file. Without this line, everything will be included that has not be explicitly excluded.
      • +
      • Do not add a `- **` in the file. Without this line, everything will be included that has not been explicitly excluded.
      • Disregard step 3.
    • @@ -9743,7 +12157,7 @@

      Example filters file for Dropbox

      # NOTICE: If you make changes to this file you MUST do a --resync run. # Run with --dry-run to see what changes will be made. -# Dropbox wont sync some files so filter them away here. +# Dropbox won't sync some files so filter them away here. # See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing - .dropbox.attr - ~*.tmp @@ -9783,11 +12197,11 @@

      Reading bisync logs

      2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" 2021/05/16 00:36:52 INFO : Bisync successful
  • Dry run oddity

    -

    The --dry-run messages may indicate that it would try to delete some files. For example, if a file is new on Path2 and does not exist on Path1 then it would normally be copied to Path1, but with --dry-run enabled those copies don't happen, which leads to the attempted delete on the Path2, blocked again by --dry-run: ... Not deleting as --dry-run.

    +

    The --dry-run messages may indicate that it would try to delete some files. For example, if a file is new on Path2 and does not exist on Path1 then it would normally be copied to Path1, but with --dry-run enabled those copies don't happen, which leads to the attempted delete on Path2, blocked again by --dry-run: ... Not deleting as --dry-run.

    This whole confusing situation is an artifact of the --dry-run flag. Scrutinize the proposed deletes carefully, and if the files would have been copied to Path1 then the threatened deletes on Path2 may be disregarded.

    Retries

    -

    Rclone has built in retries. If you run with --verbose you'll see error and retry messages such as shown below. This is usually not a bug. If at the end of the run you see Bisync successful and not Bisync critical error or Bisync aborted then the run was successful, and you can ignore the error messages.

    -

    The following run shows an intermittent fail. Lines 5 and _6- are low level messages. Line 6 is a bubbled-up warning message, conveying the error. Rclone normally retries failing commands, so there may be numerous such messages in the log.

    +

    Rclone has built-in retries. If you run with --verbose you'll see error and retry messages such as shown below. This is usually not a bug. If at the end of the run, you see Bisync successful and not Bisync critical error or Bisync aborted then the run was successful, and you can ignore the error messages.

    +

    The following run shows an intermittent fail. Lines 5 and _6- are low-level messages. Line 6 is a bubbled-up warning message, conveying the error. Rclone normally retries failing commands, so there may be numerous such messages in the log.

    Since there are no final error/warning messages on line 7, rclone has recovered from failure after a retry, and the overall sync was successful.

    1: 2021/05/14 00:44:12 INFO  : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:"
     2: 2021/05/14 00:44:12 INFO  : Path1 checking for diffs
    @@ -9823,7 +12237,7 @@ 

    Cron

    # Day of Week (0-6 or Sun-Sat) # Command */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log
    -

    See crontab syntax). for the details of crontab time interval expressions.

    +

    See crontab syntax for the details of crontab time interval expressions.

    If you run rclone bisync as a cron job, redirect stdout/stderr to a file. The 2nd example runs a sync to Dropbox every hour and logs all stdout (via the >>) and stderr (via 2>&1) to a log file.

    0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1

    Sharing an encrypted folder tree between hosts

    @@ -9912,7 +12326,7 @@

    Notes about testing

  • path1 and/or path2 subdirectories are created in a temporary directory under the respective local or cloud test remote.
  • By default, the Path1 and Path2 test dirs and workdir will be deleted after each test run. The -no-cleanup flag disables purging these directories when validating and debugging a given test. These directories will be flushed before running another test, independent of the -no-cleanup usage.
  • You will likely want to add `- /testdir/to your normal bisync--filters-fileso that normal syncs do not attempt to sync the test temporary directories, which may haveRCLONE_TESTmiscompares in some testcases which would otherwise trip the--check-accesssystem. The--check-accessmechanism is hard-coded to ignoreRCLONE_TESTfiles beneathbisync/testdata`, so the test cases may reside on the synched tree even if there are check file mismatches in the test tree.
  • -
  • Some Dropbox tests can fail, notably printing the following message: src and dst identical but can't set mod time without deleting and re-uploading This is expected and happens due a way Dropbox handles modification times. You should use the -refresh-times test flag to make up for this.
  • +
  • Some Dropbox tests can fail, notably printing the following message: src and dst identical but can't set mod time without deleting and re-uploading This is expected and happens due to the way Dropbox handles modification times. You should use the -refresh-times test flag to make up for this.
  • If Dropbox tests hit request limit for you and print error message too_many_requests/...: Too many requests or write operations. then follow the Dropbox App ID instructions.
  • Updating golden results

    @@ -9933,7 +12347,7 @@

    Supported test commands

  • move-listings <prefix> Similar to copy-listings but removes the source
  • purge-children <dir> This will delete all child files and purge all child subdirs under given directory but keep the parent intact. This behavior is important for tests with Google Drive because removing and re-creating the parent would change its ID.
  • delete-file <file> Delete a single file.
  • -
  • delete-glob <dir> <pattern> Delete a group of files located one level deep in the given directory with names maching a given glob pattern.
  • +
  • delete-glob <dir> <pattern> Delete a group of files located one level deep in the given directory with names matching a given glob pattern.
  • touch-glob YYYY-MM-DD <dir> <pattern> Change modification time on a group of files.
  • touch-copy YYYY-MM-DD <source-file> <dest-dir> Change file modification time then copy it to destination.
  • copy-file <source-file> <dest-dir> Copy a single file to given directory.
  • @@ -10023,8 +12437,111 @@

    References

  • jwink3101/syncrclone
  • DavideRossi/upback
  • -

    Bisync adopts the differential synchronization technique, which is based on keeping history of changes performed by both synchronizing sides. See the Dual Shadow Method section in the Neil Fraser's article.

    +

    Bisync adopts the differential synchronization technique, which is based on keeping history of changes performed by both synchronizing sides. See the Dual Shadow Method section in Neil Fraser's article.

    Also note a number of academic publications by Benjamin Pierce about Unison and synchronization in general.

    +

    Changelog

    +

    v1.64

    + +

    Release signing

    +

    The hashes of the binary artefacts of the rclone release are signed with a public PGP/GPG key. This can be verified manually as described below.

    +

    The same mechanism is also used by rclone selfupdate to verify that the release has not been tampered with before the new update is installed. This checks the SHA256 hash and the signature with a public key compiled into the rclone binary.

    +

    Release signing key

    +

    You may obtain the release signing key from:

    +
      +
    • From KEYS on this website - this file contains all past signing keys also.
    • +
    • The git repository hosted on GitHub - https://github.com/rclone/rclone/blob/master/docs/content/KEYS
    • +
    • gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com
    • +
    • gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com
    • +
    • https://www.craig-wood.com/nick/pub/pgp-key.txt
    • +
    +

    After importing the key, verify that the fingerprint of one of the keys matches: FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA as this key is used for signing.

    +

    We recommend that you cross-check the fingerprint shown above through the domains listed below. By cross-checking the integrity of the fingerprint across multiple domains you can be confident that you obtained the correct key.

    + +

    If you find anything that doesn't not match, please contact the developers at once.

    +

    How to verify the release

    +

    In the release directory you will see the release files and some files called MD5SUMS, SHA1SUMS and SHA256SUMS.

    +
    $ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http:
    +MD5SUMS
    +SHA1SUMS
    +SHA256SUMS
    +rclone-v1.63.1-freebsd-386.zip
    +rclone-v1.63.1-freebsd-amd64.zip
    +...
    +rclone-v1.63.1-windows-arm64.zip
    +rclone-v1.63.1.tar.gz
    +version.txt
    +

    The MD5SUMS, SHA1SUMS and SHA256SUMS contain hashes of the binary files in the release directory along with a signature.

    +

    For example:

    +
    $ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS
    +-----BEGIN PGP SIGNED MESSAGE-----
    +Hash: SHA1
    +
    +f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113  rclone-v1.63.1-freebsd-386.zip
    +7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e  rclone-v1.63.1-freebsd-amd64.zip
    +...
    +66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73  rclone-v1.63.1-windows-amd64.zip
    +bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0  rclone-v1.63.1-windows-arm64.zip
    +-----BEGIN PGP SIGNATURE-----
    +
    +iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU
    ++pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g=
    +=8qrL
    +-----END PGP SIGNATURE-----
    +

    Download the files

    +

    The first step is to download the binary and SUMs file and verify that the SUMs you have downloaded match. Here we download rclone-v1.63.1-windows-amd64.zip - choose the binary (or binaries) appropriate to your architecture. We've also chosen the SHA256SUMS as these are the most secure. You could verify the other types of hash also for extra security. rclone selfupdate verifies just the SHA256SUMS.

    +
    $ mkdir /tmp/check
    +$ cd /tmp/check
    +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS .
    +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip .
    +

    Verify the signatures

    +

    First verify the signatures on the SHA256 file.

    +

    Import the key. See above for ways to verify this key is correct.

    +
    $ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA
    +gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood <nick@craig-wood.com>" imported
    +gpg: Total number processed: 1
    +gpg:               imported: 1
    +

    Then check the signature:

    +
    $ gpg --verify SHA256SUMS 
    +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST
    +gpg:                using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA
    +gpg: Good signature from "Nick Craig-Wood <nick@craig-wood.com>" [ultimate]
    +

    Verify the signature was good and is using the fingerprint shown above.

    +

    Repeat for MD5SUMS and SHA1SUMS if desired.

    +

    Verify the hashes

    +

    Now that we know the signatures on the hashes are OK we can verify the binaries match the hashes, completing the verification.

    +
    $ sha256sum -c SHA256SUMS 2>&1 | grep OK
    +rclone-v1.63.1-windows-amd64.zip: OK
    +

    Or do the check with rclone

    +
    $ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip 
    +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0
    +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1
    +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49
    +2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed...
    += rclone-v1.63.1-windows-amd64.zip
    +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found
    +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files
    +

    Verify signatures and hashes together

    +

    You can verify the signatures and hashes in one command line like this:

    +
    $ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing
    +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST
    +gpg:                using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA
    +gpg: Good signature from "Nick Craig-Wood <nick@craig-wood.com>" [ultimate]
    +gpg:                 aka "Nick Craig-Wood <nick@memset.com>" [unknown]
    +rclone-v1.63.1-windows-amd64.zip: OK

    1Fichier

    This is a backend for the 1fichier cloud storage service. Note that a Premium subscription is required to use the API.

    Paths are specified as remote:path

    @@ -10075,7 +12592,7 @@

    Configuration

    rclone ls remote:

    To copy a local directory to a 1Fichier directory called backup

    rclone copy /home/source remote:backup
    -

    Modified time and hashes

    +

    Modification times and hashes

    1Fichier does not support modification times. It supports the Whirlpool hash algorithm.

    Duplicated files

    1Fichier can have two files with exactly the same name and path (unlike a normal file system).

    @@ -10188,6 +12705,15 @@

    --fichier-folder-password

  • Type: string
  • Required: false
  • +

    --fichier-cdn

    +

    Set if you wish to use CDN download links.

    +

    Properties:

    +
      +
    • Config: cdn
    • +
    • Env Var: RCLONE_FICHIER_CDN
    • +
    • Type: bool
    • +
    • Default: false
    • +

    --fichier-encoding

    The encoding for the backend.

    See the encoding section in the overview for more info.

    @@ -10195,10 +12721,10 @@

    --fichier-encoding

    • Config: encoding
    • Env Var: RCLONE_FICHIER_ENCODING
    • -
    • Type: MultiEncoder
    • +
    • Type: Encoding
    • Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot
    -

    Limitations

    +

    Limitations

    rclone about is not supported by the 1Fichier backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    See List of backends that do not support rclone about and rclone about

    Alias

    @@ -10341,9 +12867,9 @@

    Configuration

    rclone ls remote:

    To copy a local directory to an Amazon Drive directory called backup

    rclone copy /home/source remote:backup
    -

    Modified time and MD5SUMs

    +

    Modification times and hashes

    Amazon Drive doesn't allow modification times to be changed via the API so these won't be accurate or used for syncing.

    -

    It does store MD5SUMs so for a more accurate sync, you can use the --checksum flag.

    +

    It does support the MD5 hash algorithm, so for a more accurate sync, you can use the --checksum flag.

    Restricted filename characters

    @@ -10465,10 +12991,10 @@

    --acd-encoding

    • Config: encoding
    • Env Var: RCLONE_ACD_ENCODING
    • -
    • Type: MultiEncoder
    • +
    • Type: Encoding
    • Default: Slash,InvalidUtf8,Dot
    -

    Limitations

    +

    Limitations

    Note that Amazon Drive is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    Amazon Drive has rate limiting so you may notice errors in the sync (429 errors). rclone will automatically retry the sync up to 3 times by default (see --retries flag) which should hopefully work around this problem.

    Amazon Drive has an internal limit of file sizes that can be uploaded to the service. This limit is not officially published, but all files larger than this will fail.

    @@ -10487,19 +13013,25 @@

    Amazon S3 Storage Providers

  • Arvan Cloud Object Storage (AOS)
  • DigitalOcean Spaces
  • Dreamhost
  • +
  • GCS
  • Huawei OBS
  • IBM COS S3
  • IDrive e2
  • IONOS Cloud
  • +
  • Leviia Object Storage
  • Liara Object Storage
  • +
  • Linode Object Storage
  • Minio
  • +
  • Petabox
  • Qiniu Cloud Object Storage (Kodo)
  • RackCorp Object Storage
  • +
  • Rclone Serve S3
  • Scaleway
  • Seagate Lyve Cloud
  • SeaweedFS
  • StackPath
  • Storj
  • +
  • Synology C2 Object Storage
  • Tencent Cloud Object Storage (COS)
  • Wasabi
  • @@ -10712,10 +13244,18 @@

    Configuration

    e) Edit this remote d) Delete this remote y/e/d> -

    Modified time

    +

    Modification times and hashes

    +

    Modification times

    The modified time is stored as metadata on the object as X-Amz-Meta-Mtime as floating point since the epoch, accurate to 1 ns.

    If the modification time needs to be updated rclone will attempt to perform a server side copy to update the modification if the object can be copied in a single part. In the case the object is larger than 5Gb or is in Glacier or Glacier Deep Archive storage the object will be uploaded rather than copied.

    Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

    +

    Hashes

    +

    For small objects which weren't uploaded as multipart uploads (objects sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the ETag: header as an MD5 checksum.

    +

    However for objects which were uploaded as multipart uploads or with server side encryption (SSE-AWS or SSE-C) the ETag header is no longer the MD5 sum of the data, so rclone adds an additional piece of metadata X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same format as is required for Content-MD5). You can use base64 -d and hexdump to check this value manually:

    +
    echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump
    +

    or you can use rclone check to verify the hashes are OK.

    +

    For large objects, calculating this hash can take some time so the addition of this hash can be disabled with --s3-disable-checksum. This will mean that these objects do not have an MD5 checksum.

    +

    Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

    Reducing costs

    Avoiding HEAD requests to read the modification time

    By default, rclone will use the modification time of objects stored in S3 for syncing. This is stored in object metadata which unfortunately takes an extra HEAD request to read which can be expensive (in time and money).

    @@ -10762,11 +13302,6 @@

    Avoiding HEAD requests after PUT

    By default, rclone will HEAD every object it uploads. It does this to check the object got uploaded correctly.

    You can disable this with the --s3-no-head option - see there for more details.

    Setting this flag increases the chance for undetected upload failures.

    -

    Hashes

    -

    For small objects which weren't uploaded as multipart uploads (objects sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the ETag: header as an MD5 checksum.

    -

    However for objects which were uploaded as multipart uploads or with server side encryption (SSE-AWS or SSE-C) the ETag header is no longer the MD5 sum of the data, so rclone adds an additional piece of metadata X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same format as is required for Content-MD5).

    -

    For large objects, calculating this hash can take some time so the addition of this hash can be disabled with --s3-disable-checksum. This will mean that these objects do not have an MD5 checksum.

    -

    Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

    Versions

    When bucket versioning is enabled (this can be done with rclone with the rclone backend versioning command) when rclone uploads a new version of a file it creates a new version of it Likewise when you delete a file, the old version will be marked hidden and still be available.

    Old versions of files, where available, are visible using the --s3-versions flag.

    @@ -10797,6 +13332,12 @@

    Versions

    $ rclone -q --s3-versions ls s3:cleanup-test 9 one.txt +

    Versions naming caveat

    +

    When using --s3-versions flag rclone is relying on the file name to work out whether the objects are versions or not. Versions' names are created by inserting timestamp between file name and its extension.

    +
            9 file.txt
    +        8 file-v2023-07-17-161032-000.txt
    +       16 file-v2023-06-15-141003-000.txt
    +

    If there are real files present with the same names as versions, then behaviour of --s3-versions can be unpredictable.

    Cleanup

    If you run rclone cleanup s3:bucket then it will remove all pending multipart uploads older than 24 hours. You can use the --interactive/i or --dry-run flag to see exactly what it will do. If you want more control over the expiry date then run rclone backend cleanup s3:bucket -o max-age=1h to expire all uploads older than one hour. You can use rclone backend list-multipart-uploads s3:bucket to see the pending multipart uploads.

    Restricted filename characters

    @@ -10870,7 +13411,7 @@

    Authentication

  • Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY
  • Session Token: AWS_SESSION_TOKEN (optional)
  • -
  • Or, use a named profile: +
  • Or, use a named profile:
    • Profile files are standard files used by AWS CLI tools
    • By default it will use the profile in your home directory (e.g. ~/.aws/credentials on unix based systems) file and the "default" profile, to change set these environment variables: @@ -10941,9 +13482,9 @@

      Object-lock enabled S3 bucket

      If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header.

      -

      As mentioned in the Hashes section, small files that are not uploaded as multipart, use a different tag, causing the upload to fail. A simple solution is to set the --s3-upload-cutoff 0 and force all the files to be uploaded as multipart.

      +

      As mentioned in the Modification times and hashes section, small files that are not uploaded as multipart, use a different tag, causing the upload to fail. A simple solution is to set the --s3-upload-cutoff 0 and force all the files to be uploaded as multipart.

      Standard options

      -

      Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi).

      +

      Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others).

      --s3-provider

      Choose your S3 provider.

      Properties:

      @@ -10962,6 +13503,10 @@

      --s3-provider

      • Alibaba Cloud Object Storage System (OSS) formerly Aliyun
    • +
    • "ArvanCloud" +
        +
      • Arvan Cloud Object Storage (AOS)
      • +
    • "Ceph"
      • Ceph Object Storage
      • @@ -10974,10 +13519,6 @@

        --s3-provider

        • Cloudflare R2 Storage
        -
      • "ArvanCloud" -
          -
        • Arvan Cloud Object Storage (AOS)
        • -
      • "DigitalOcean"
        • DigitalOcean Spaces
        • @@ -10986,6 +13527,10 @@

          --s3-provider

          • Dreamhost DreamObjects
          +
        • "GCS" +
            +
          • Google Cloud Storage
          • +
        • "HuaweiOBS"
          • Huawei Object Storage Service
          • @@ -11006,10 +13551,18 @@

            --s3-provider

            • Seagate Lyve Cloud
            +
          • "Leviia" +
              +
            • Leviia Object Storage
            • +
          • "Liara"
            • Liara Object Storage
          • +
          • "Linode" +
              +
            • Linode Object Storage
            • +
          • "Minio"
            • Minio Object Storage
            • @@ -11018,10 +13571,18 @@

              --s3-provider

              • Netease Object Storage (NOS)
              +
            • "Petabox" +
                +
              • Petabox Object Storage
              • +
            • "RackCorp"
              • RackCorp Object Storage
            • +
            • "Rclone" +
                +
              • Rclone S3 Server
              • +
            • "Scaleway"
              • Scaleway Object Storage
              • @@ -11038,6 +13599,10 @@

                --s3-provider

                • Storj (S3 Compatible Gateway)
                +
              • "Synology" +
                  +
                • Synology C2 Object Storage
                • +
              • "TencentCOS"
                • Tencent Cloud Object Storage (COS)
                • @@ -11236,15951 +13801,19685 @@

                  --s3-region

            -

            --s3-region

            -

            region - the location where your bucket will be created and your data stored.

            +

            --s3-endpoint

            +

            Endpoint for S3 API.

            +

            Leave blank if using AWS to use the default endpoint for the region.

            Properties:

              -
            • Config: region
            • -
            • Env Var: RCLONE_S3_REGION
            • -
            • Provider: RackCorp
            • +
            • Config: endpoint
            • +
            • Env Var: RCLONE_S3_ENDPOINT
            • +
            • Provider: AWS
            • +
            • Type: string
            • +
            • Required: false
            • +
            +

            --s3-location-constraint

            +

            Location constraint - must be set to match the Region.

            +

            Used when creating buckets only.

            +

            Properties:

            +
              +
            • Config: location_constraint
            • +
            • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
            • +
            • Provider: AWS
            • Type: string
            • Required: false
            • Examples:
                -
              • "global" +
              • ""
                  -
                • Global CDN (All locations) Region
                • +
                • Empty for US Region, Northern Virginia, or Pacific Northwest
              • -
              • "au" +
              • "us-east-2"
                  -
                • Australia (All states)
                • +
                • US East (Ohio) Region
              • -
              • "au-nsw" +
              • "us-west-1"
                  -
                • NSW (Australia) Region
                • +
                • US West (Northern California) Region
              • -
              • "au-qld" +
              • "us-west-2"
                  -
                • QLD (Australia) Region
                • +
                • US West (Oregon) Region
              • -
              • "au-vic" +
              • "ca-central-1"
                  -
                • VIC (Australia) Region
                • +
                • Canada (Central) Region
              • -
              • "au-wa" +
              • "eu-west-1"
                  -
                • Perth (Australia) Region
                • +
                • EU (Ireland) Region
              • -
              • "ph" +
              • "eu-west-2"
                  -
                • Manila (Philippines) Region
                • +
                • EU (London) Region
              • -
              • "th" +
              • "eu-west-3"
                  -
                • Bangkok (Thailand) Region
                • +
                • EU (Paris) Region
              • -
              • "hk" +
              • "eu-north-1"
                  -
                • HK (Hong Kong) Region
                • +
                • EU (Stockholm) Region
              • -
              • "mn" +
              • "eu-south-1"
                  -
                • Ulaanbaatar (Mongolia) Region
                • +
                • EU (Milan) Region
              • -
              • "kg" +
              • "EU"
                  -
                • Bishkek (Kyrgyzstan) Region
                • +
                • EU Region
              • -
              • "id" +
              • "ap-southeast-1"
                  -
                • Jakarta (Indonesia) Region
                • +
                • Asia Pacific (Singapore) Region
              • -
              • "jp" +
              • "ap-southeast-2"
                  -
                • Tokyo (Japan) Region
                • +
                • Asia Pacific (Sydney) Region
              • -
              • "sg" +
              • "ap-northeast-1"
                  -
                • SG (Singapore) Region
                • +
                • Asia Pacific (Tokyo) Region
              • -
              • "de" +
              • "ap-northeast-2"
                  -
                • Frankfurt (Germany) Region
                • +
                • Asia Pacific (Seoul) Region
              • -
              • "us" +
              • "ap-northeast-3"
                  -
                • USA (AnyCast) Region
                • +
                • Asia Pacific (Osaka-Local) Region
              • -
              • "us-east-1" +
              • "ap-south-1"
                  -
                • New York (USA) Region
                • +
                • Asia Pacific (Mumbai) Region
              • -
              • "us-west-1" +
              • "ap-east-1"
                  -
                • Freemont (USA) Region
                • +
                • Asia Pacific (Hong Kong) Region
              • -
              • "nz" +
              • "sa-east-1"
                  -
                • Auckland (New Zealand) Region
                • +
                • South America (Sao Paulo) Region
              • +
              • "me-south-1" +
                  +
                • Middle East (Bahrain) Region
              • -
              -

              --s3-region

              -

              Region to connect to.

              -

              Properties:

              +
            • "af-south-1"
                -
              • Config: region
              • -
              • Env Var: RCLONE_S3_REGION
              • -
              • Provider: Scaleway
              • -
              • Type: string
              • -
              • Required: false
              • -
              • Examples: +
              • Africa (Cape Town) Region
              • +
            • +
            • "cn-north-1"
                -
              • "nl-ams" +
              • China (Beijing) Region
              • +
            • +
            • "cn-northwest-1"
                -
              • Amsterdam, The Netherlands
              • +
              • China (Ningxia) Region
            • -
            • "fr-par" +
            • "us-gov-east-1"
                -
              • Paris, France
              • +
              • AWS GovCloud (US-East) Region
            • -
            • "pl-waw" +
            • "us-gov-west-1"
                -
              • Warsaw, Poland
              • +
              • AWS GovCloud (US) Region
          -

          --s3-region

          -

          Region to connect to. - the location where your bucket will be created and your data stored. Need bo be same with your endpoint.

          +

          --s3-acl

          +

          Canned ACL used when creating buckets and storing or copying objects.

          +

          This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.

          +

          For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

          +

          Note that this ACL is applied when server-side copying objects as S3 doesn't copy the ACL from the source but rather writes a fresh one.

          +

          If the acl is an empty string then no X-Amz-Acl: header is added and the default (private) will be used.

          Properties:

            -
          • Config: region
          • -
          • Env Var: RCLONE_S3_REGION
          • -
          • Provider: HuaweiOBS
          • +
          • Config: acl
          • +
          • Env Var: RCLONE_S3_ACL
          • +
          • Provider: !Storj,Synology,Cloudflare
          • Type: string
          • Required: false
          • Examples:
              -
            • "af-south-1" +
            • "default"
                -
              • AF-Johannesburg
              • +
              • Owner gets Full_CONTROL.
              • +
              • No one else has access rights (default).
            • -
            • "ap-southeast-2" +
            • "private"
                -
              • AP-Bangkok
              • +
              • Owner gets FULL_CONTROL.
              • +
              • No one else has access rights (default).
            • -
            • "ap-southeast-3" +
            • "public-read"
                -
              • AP-Singapore
              • +
              • Owner gets FULL_CONTROL.
              • +
              • The AllUsers group gets READ access.
            • -
            • "cn-east-3" +
            • "public-read-write"
                -
              • CN East-Shanghai1
              • +
              • Owner gets FULL_CONTROL.
              • +
              • The AllUsers group gets READ and WRITE access.
              • +
              • Granting this on a bucket is generally not recommended.
            • -
            • "cn-east-2" +
            • "authenticated-read"
                -
              • CN East-Shanghai2
              • +
              • Owner gets FULL_CONTROL.
              • +
              • The AuthenticatedUsers group gets READ access.
            • -
            • "cn-north-1" +
            • "bucket-owner-read"
                -
              • CN North-Beijing1
              • +
              • Object owner gets FULL_CONTROL.
              • +
              • Bucket owner gets READ access.
              • +
              • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
            • -
            • "cn-north-4" +
            • "bucket-owner-full-control"
                -
              • CN North-Beijing4
              • +
              • Both the object owner and the bucket owner get FULL_CONTROL over the object.
              • +
              • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
            • -
            • "cn-south-1" +
            • "private"
                -
              • CN South-Guangzhou
              • +
              • Owner gets FULL_CONTROL.
              • +
              • No one else has access rights (default).
              • +
              • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS.
            • -
            • "ap-southeast-1" +
            • "public-read"
                -
              • CN-Hong Kong
              • +
              • Owner gets FULL_CONTROL.
              • +
              • The AllUsers group gets READ access.
              • +
              • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS.
            • -
            • "sa-argentina-1" +
            • "public-read-write"
                -
              • LA-Buenos Aires1
              • +
              • Owner gets FULL_CONTROL.
              • +
              • The AllUsers group gets READ and WRITE access.
              • +
              • This acl is available on IBM Cloud (Infra), On-Premise IBM COS.
            • -
            • "sa-peru-1" +
            • "authenticated-read"
                -
              • LA-Lima1
              • +
              • Owner gets FULL_CONTROL.
              • +
              • The AuthenticatedUsers group gets READ access.
              • +
              • Not supported on Buckets.
              • +
              • This acl is available on IBM Cloud (Infra) and On-Premise IBM COS.
            • -
            • "na-mexico-1" -
                -
              • LA-Mexico City1
            • -
            • "sa-chile-1" +
            +

            --s3-server-side-encryption

            +

            The server-side encryption algorithm used when storing this object in S3.

            +

            Properties:

            +
              +
            • Config: server_side_encryption
            • +
            • Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION
            • +
            • Provider: AWS,Ceph,ChinaMobile,Minio
            • +
            • Type: string
            • +
            • Required: false
            • +
            • Examples: +
                +
              • ""
                  -
                • LA-Santiago2
                • +
                • None
              • -
              • "sa-brazil-1" +
              • "AES256"
                  -
                • LA-Sao Paulo1
                • +
                • AES256
              • -
              • "ru-northwest-2" +
              • "aws:kms"
                  -
                • RU-Moscow2
                • +
                • aws:kms
            -

            --s3-region

            -

            Region to connect to.

            +

            --s3-sse-kms-key-id

            +

            If using KMS ID you must provide the ARN of Key.

            Properties:

              -
            • Config: region
            • -
            • Env Var: RCLONE_S3_REGION
            • -
            • Provider: Cloudflare
            • +
            • Config: sse_kms_key_id
            • +
            • Env Var: RCLONE_S3_SSE_KMS_KEY_ID
            • +
            • Provider: AWS,Ceph,Minio
            • Type: string
            • Required: false
            • Examples:
                -
              • "auto" +
              • "" +
                  +
                • None
                • +
              • +
              • "arn:aws:kms:us-east-1:*"
                  -
                • R2 buckets are automatically distributed across Cloudflare's data centers for low latency.
                • +
                • arn:aws:kms:*
            -

            --s3-region

            -

            Region to connect to.

            +

            --s3-storage-class

            +

            The storage class to use when storing new objects in S3.

            Properties:

              -
            • Config: region
            • -
            • Env Var: RCLONE_S3_REGION
            • -
            • Provider: Qiniu
            • +
            • Config: storage_class
            • +
            • Env Var: RCLONE_S3_STORAGE_CLASS
            • +
            • Provider: AWS
            • Type: string
            • Required: false
            • Examples:
                -
              • "cn-east-1" +
              • ""
                  -
                • The default endpoint - a good choice if you are unsure.
                • -
                • East China Region 1.
                • -
                • Needs location constraint cn-east-1.
                • +
                • Default
              • -
              • "cn-east-2" +
              • "STANDARD"
                  -
                • East China Region 2.
                • -
                • Needs location constraint cn-east-2.
                • +
                • Standard storage class
              • -
              • "cn-north-1" +
              • "REDUCED_REDUNDANCY"
                  -
                • North China Region 1.
                • -
                • Needs location constraint cn-north-1.
                • +
                • Reduced redundancy storage class
                • +
              • +
              • "STANDARD_IA" +
                  +
                • Standard Infrequent Access storage class
              • -
              • "cn-south-1" +
              • "ONEZONE_IA"
                  -
                • South China Region 1.
                • -
                • Needs location constraint cn-south-1.
                • +
                • One Zone Infrequent Access storage class
              • -
              • "us-north-1" +
              • "GLACIER"
                  -
                • North America Region.
                • -
                • Needs location constraint us-north-1.
                • +
                • Glacier storage class
              • -
              • "ap-southeast-1" +
              • "DEEP_ARCHIVE"
                  -
                • Southeast Asia Region 1.
                • -
                • Needs location constraint ap-southeast-1.
                • +
                • Glacier Deep Archive storage class
              • -
              • "ap-northeast-1" +
              • "INTELLIGENT_TIERING"
                  -
                • Northeast Asia Region 1.
                • -
                • Needs location constraint ap-northeast-1.
                • +
                • Intelligent-Tiering storage class
                • +
              • +
              • "GLACIER_IR" +
                  +
                • Glacier Instant Retrieval storage class
            -

            --s3-region

            -

            Region where your bucket will be created and your data stored.

            +

            Advanced options

            +

            Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others).

            +

            --s3-bucket-acl

            +

            Canned ACL used when creating buckets.

            +

            For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

            +

            Note that this ACL is applied when only when creating buckets. If it isn't set then "acl" is used instead.

            +

            If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: header is added and the default (private) will be used.

            Properties:

              -
            • Config: region
            • -
            • Env Var: RCLONE_S3_REGION
            • -
            • Provider: IONOS
            • +
            • Config: bucket_acl
            • +
            • Env Var: RCLONE_S3_BUCKET_ACL
            • Type: string
            • Required: false
            • Examples:
                -
              • "de" +
              • "private" +
                  +
                • Owner gets FULL_CONTROL.
                • +
                • No one else has access rights (default).
                • +
              • +
              • "public-read"
                  -
                • Frankfurt, Germany
                • +
                • Owner gets FULL_CONTROL.
                • +
                • The AllUsers group gets READ access.
              • -
              • "eu-central-2" +
              • "public-read-write"
                  -
                • Berlin, Germany
                • +
                • Owner gets FULL_CONTROL.
                • +
                • The AllUsers group gets READ and WRITE access.
                • +
                • Granting this on a bucket is generally not recommended.
              • -
              • "eu-south-2" +
              • "authenticated-read"
                  -
                • Logrono, Spain
                • +
                • Owner gets FULL_CONTROL.
                • +
                • The AuthenticatedUsers group gets READ access.
            -

            --s3-region

            -

            Region to connect to.

            -

            Leave blank if you are using an S3 clone and you don't have a region.

            +

            --s3-requester-pays

            +

            Enables requester pays option when interacting with S3 bucket.

            Properties:

              -
            • Config: region
            • -
            • Env Var: RCLONE_S3_REGION
            • -
            • Provider: !AWS,Alibaba,ChinaMobile,Cloudflare,IONOS,ArvanCloud,Liara,Qiniu,RackCorp,Scaleway,Storj,TencentCOS,HuaweiOBS,IDrive
            • +
            • Config: requester_pays
            • +
            • Env Var: RCLONE_S3_REQUESTER_PAYS
            • +
            • Provider: AWS
            • +
            • Type: bool
            • +
            • Default: false
            • +
            +

            --s3-sse-customer-algorithm

            +

            If using SSE-C, the server-side encryption algorithm used when storing this object in S3.

            +

            Properties:

            +
              +
            • Config: sse_customer_algorithm
            • +
            • Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM
            • +
            • Provider: AWS,Ceph,ChinaMobile,Minio
            • Type: string
            • Required: false
            • Examples:
              • ""
                  -
                • Use this if unsure.
                • -
                • Will use v4 signatures and an empty region.
                • +
                • None
              • -
              • "other-v2-signature" +
              • "AES256"
                  -
                • Use this only if v4 signatures don't work.
                • -
                • E.g. pre Jewel/v10 CEPH.
                • +
                • AES256
            -

            --s3-endpoint

            -

            Endpoint for S3 API.

            -

            Leave blank if using AWS to use the default endpoint for the region.

            +

            --s3-sse-customer-key

            +

            To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data.

            +

            Alternatively you can provide --sse-customer-key-base64.

            Properties:

              -
            • Config: endpoint
            • -
            • Env Var: RCLONE_S3_ENDPOINT
            • -
            • Provider: AWS
            • +
            • Config: sse_customer_key
            • +
            • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY
            • +
            • Provider: AWS,Ceph,ChinaMobile,Minio
            • Type: string
            • Required: false
            • +
            • Examples: +
                +
              • "" +
                  +
                • None
                • +
              • +
            -

            --s3-endpoint

            -

            Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API.

            +

            --s3-sse-customer-key-base64

            +

            If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data.

            +

            Alternatively you can provide --sse-customer-key.

            Properties:

              -
            • Config: endpoint
            • -
            • Env Var: RCLONE_S3_ENDPOINT
            • -
            • Provider: ChinaMobile
            • +
            • Config: sse_customer_key_base64
            • +
            • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64
            • +
            • Provider: AWS,Ceph,ChinaMobile,Minio
            • Type: string
            • Required: false
            • Examples:
                -
              • "eos-wuxi-1.cmecloud.cn" +
              • ""
                  -
                • The default endpoint - a good choice if you are unsure.
                • -
                • East China (Suzhou)
                • +
                • None
              • -
              • "eos-jinan-1.cmecloud.cn" -
                  -
                • East China (Jinan)
              • -
              • "eos-ningbo-1.cmecloud.cn" -
                  -
                • East China (Hangzhou)
                • -
              • -
              • "eos-shanghai-1.cmecloud.cn" -
                  -
                • East China (Shanghai-1)
                • -
              • -
              • "eos-zhengzhou-1.cmecloud.cn" -
                  -
                • Central China (Zhengzhou)
                • -
              • -
              • "eos-hunan-1.cmecloud.cn" -
                  -
                • Central China (Changsha-1)
                • -
              • -
              • "eos-zhuzhou-1.cmecloud.cn" -
                  -
                • Central China (Changsha-2)
                • -
              • -
              • "eos-guangzhou-1.cmecloud.cn" -
                  -
                • South China (Guangzhou-2)
                • -
              • -
              • "eos-dongguan-1.cmecloud.cn" -
                  -
                • South China (Guangzhou-3)
                • -
              • -
              • "eos-beijing-1.cmecloud.cn" -
                  -
                • North China (Beijing-1)
                • -
              • -
              • "eos-beijing-2.cmecloud.cn" -
                  -
                • North China (Beijing-2)
                • -
              • -
              • "eos-beijing-4.cmecloud.cn" -
                  -
                • North China (Beijing-3)
                • -
              • -
              • "eos-huhehaote-1.cmecloud.cn" -
                  -
                • North China (Huhehaote)
                • -
              • -
              • "eos-chengdu-1.cmecloud.cn" -
                  -
                • Southwest China (Chengdu)
                • -
              • -
              • "eos-chongqing-1.cmecloud.cn" -
                  -
                • Southwest China (Chongqing)
                • -
              • -
              • "eos-guiyang-1.cmecloud.cn" -
                  -
                • Southwest China (Guiyang)
                • -
              • -
              • "eos-xian-1.cmecloud.cn" -
                  -
                • Nouthwest China (Xian)
                • -
              • -
              • "eos-yunnan.cmecloud.cn" -
                  -
                • Yunnan China (Kunming)
                • -
              • -
              • "eos-yunnan-2.cmecloud.cn" -
                  -
                • Yunnan China (Kunming-2)
                • -
              • -
              • "eos-tianjin-1.cmecloud.cn" -
                  -
                • Tianjin China (Tianjin)
                • -
              • -
              • "eos-jilin-1.cmecloud.cn" -
                  -
                • Jilin China (Changchun)
                • -
              • -
              • "eos-hubei-1.cmecloud.cn" +
              +

              --s3-sse-customer-key-md5

              +

              If using SSE-C you may provide the secret encryption key MD5 checksum (optional).

              +

              If you leave it blank, this is calculated automatically from the sse_customer_key provided.

              +

              Properties:

                -
              • Hubei China (Xiangyan)
              • -
            • -
            • "eos-jiangxi-1.cmecloud.cn" +
            • Config: sse_customer_key_md5
            • +
            • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5
            • +
            • Provider: AWS,Ceph,ChinaMobile,Minio
            • +
            • Type: string
            • +
            • Required: false
            • +
            • Examples:
                -
              • Jiangxi China (Nanchang)
              • -
            • -
            • "eos-gansu-1.cmecloud.cn" +
            • ""
                -
              • Gansu China (Lanzhou)
              • +
              • None
            • -
            • "eos-shanxi-1.cmecloud.cn" -
                -
              • Shanxi China (Taiyuan)
            • -
            • "eos-liaoning-1.cmecloud.cn" +
            +

            --s3-upload-cutoff

            +

            Cutoff for switching to chunked upload.

            +

            Any files larger than this will be uploaded in chunks of chunk_size. The minimum is 0 and the maximum is 5 GiB.

            +

            Properties:

              -
            • Liaoning China (Shenyang)
            • -
          • -
          • "eos-hebei-1.cmecloud.cn" +
          • Config: upload_cutoff
          • +
          • Env Var: RCLONE_S3_UPLOAD_CUTOFF
          • +
          • Type: SizeSuffix
          • +
          • Default: 200Mi
          • +
          +

          --s3-chunk-size

          +

          Chunk size to use for uploading.

          +

          When uploading files larger than upload_cutoff or files with unknown size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google photos or google docs) they will be uploaded as multipart uploads using this chunk size.

          +

          Note that "--s3-upload-concurrency" chunks of this size are buffered in memory per transfer.

          +

          If you are transferring large files over high-speed links and you have enough memory, then increasing this will speed up the transfers.

          +

          Rclone will automatically increase the chunk size when uploading a large file of known size to stay below the 10,000 chunks limit.

          +

          Files of unknown size are uploaded with the configured chunk_size. Since the default chunk size is 5 MiB and there can be at most 10,000 chunks, this means that by default the maximum size of a file you can stream upload is 48 GiB. If you wish to stream upload larger files then you will need to increase chunk_size.

          +

          Increasing the chunk size decreases the accuracy of the progress statistics displayed with "-P" flag. Rclone treats chunk as sent when it's buffered by the AWS SDK, when in fact it may still be uploading. A bigger chunk size means a bigger AWS SDK buffer and progress reporting more deviating from the truth.

          +

          Properties:

            -
          • Hebei China (Shijiazhuang)
          • -
        • -
        • "eos-fujian-1.cmecloud.cn" +
        • Config: chunk_size
        • +
        • Env Var: RCLONE_S3_CHUNK_SIZE
        • +
        • Type: SizeSuffix
        • +
        • Default: 5Mi
        • +
        +

        --s3-max-upload-parts

        +

        Maximum number of parts in a multipart upload.

        +

        This option defines the maximum number of multipart chunks to use when doing a multipart upload.

        +

        This can be useful if a service does not support the AWS S3 specification of 10,000 chunks.

        +

        Rclone will automatically increase the chunk size when uploading a large file of a known size to stay below this number of chunks limit.

        +

        Properties:

          -
        • Fujian China (Xiamen)
        • -
      • -
      • "eos-guangxi-1.cmecloud.cn" +
      • Config: max_upload_parts
      • +
      • Env Var: RCLONE_S3_MAX_UPLOAD_PARTS
      • +
      • Type: int
      • +
      • Default: 10000
      • +
      +

      --s3-copy-cutoff

      +

      Cutoff for switching to multipart copy.

      +

      Any files larger than this that need to be server-side copied will be copied in chunks of this size.

      +

      The minimum is 0 and the maximum is 5 GiB.

      +

      Properties:

        -
      • Guangxi China (Nanning)
      • -
    • -
    • "eos-anhui-1.cmecloud.cn" +
    • Config: copy_cutoff
    • +
    • Env Var: RCLONE_S3_COPY_CUTOFF
    • +
    • Type: SizeSuffix
    • +
    • Default: 4.656Gi
    • +
    +

    --s3-disable-checksum

    +

    Don't store MD5 checksum with object metadata.

    +

    Normally rclone will calculate the MD5 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

    +

    Properties:

      -
    • Anhui China (Huainan)
    • -
  • - +
  • Config: disable_checksum
  • +
  • Env Var: RCLONE_S3_DISABLE_CHECKSUM
  • +
  • Type: bool
  • +
  • Default: false
  • -

    --s3-endpoint

    -

    Endpoint for Arvan Cloud Object Storage (AOS) API.

    +

    --s3-shared-credentials-file

    +

    Path to the shared credentials file.

    +

    If env_auth = true then rclone can use a shared credentials file.

    +

    If this variable is empty rclone will look for the "AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty it will default to the current user's home directory.

    +
    Linux/OSX: "$HOME/.aws/credentials"
    +Windows:   "%USERPROFILE%\.aws\credentials"

    Properties:

      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: ArvanCloud
    • +
    • Config: shared_credentials_file
    • +
    • Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE
    • Type: string
    • Required: false
    • -
    • Examples: -
        -
      • "s3.ir-thr-at1.arvanstorage.com" -
          -
        • The default endpoint - a good choice if you are unsure.
        • -
        • Tehran Iran (Asiatech)
        • -
      • -
      • "s3.ir-tbz-sh1.arvanstorage.com" +
      +

      --s3-profile

      +

      Profile to use in the shared credentials file.

      +

      If env_auth = true then rclone can use a shared credentials file. This variable controls which profile is used in that file.

      +

      If empty it will default to the environment variable "AWS_PROFILE" or "default" if that environment variable is also not set.

      +

      Properties:

        -
      • Tabriz Iran (Shahriar)
      • -
    • -
    +
  • Config: profile
  • +
  • Env Var: RCLONE_S3_PROFILE
  • +
  • Type: string
  • +
  • Required: false
  • -

    --s3-endpoint

    -

    Endpoint for IBM COS S3 API.

    -

    Specify if using an IBM COS On Premise.

    +

    --s3-session-token

    +

    An AWS session token.

    Properties:

      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: IBMCOS
    • +
    • Config: session_token
    • +
    • Env Var: RCLONE_S3_SESSION_TOKEN
    • Type: string
    • Required: false
    • -
    • Examples: +
    +

    --s3-upload-concurrency

    +

    Concurrency for multipart uploads.

    +

    This is the number of chunks of the same file that are uploaded concurrently.

    +

    If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

    +

    Properties:

      -
    • "s3.us.cloud-object-storage.appdomain.cloud" +
    • Config: upload_concurrency
    • +
    • Env Var: RCLONE_S3_UPLOAD_CONCURRENCY
    • +
    • Type: int
    • +
    • Default: 4
    • +
    +

    --s3-force-path-style

    +

    If true use path style access if false use virtual hosted style.

    +

    If this is true (the default) then rclone will use path style access, if false then rclone will use virtual path style. See the AWS S3 docs for more info.

    +

    Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to false - rclone will do this automatically based on the provider setting.

    +

    Properties:

      -
    • US Cross Region Endpoint
    • -
    -
  • "s3.dal.us.cloud-object-storage.appdomain.cloud" +
  • Config: force_path_style
  • +
  • Env Var: RCLONE_S3_FORCE_PATH_STYLE
  • +
  • Type: bool
  • +
  • Default: true
  • + +

    --s3-v2-auth

    +

    If true use v2 authentication.

    +

    If this is false (the default) then rclone will use v4 authentication. If it is set then rclone will use v2 authentication.

    +

    Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH.

    +

    Properties:

      -
    • US Cross Region Dallas Endpoint
    • -
    -
  • "s3.wdc.us.cloud-object-storage.appdomain.cloud" +
  • Config: v2_auth
  • +
  • Env Var: RCLONE_S3_V2_AUTH
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-use-accelerate-endpoint

    +

    If true use the AWS S3 accelerated endpoint.

    +

    See: AWS S3 Transfer acceleration

    +

    Properties:

      -
    • US Cross Region Washington DC Endpoint
    • -
    -
  • "s3.sjc.us.cloud-object-storage.appdomain.cloud" +
  • Config: use_accelerate_endpoint
  • +
  • Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT
  • +
  • Provider: AWS
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-leave-parts-on-error

    +

    If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery.

    +

    It should be set to true for resuming uploads across different sessions.

    +

    WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up.

    +

    Properties:

      -
    • US Cross Region San Jose Endpoint
    • -
    -
  • "s3.private.us.cloud-object-storage.appdomain.cloud" +
  • Config: leave_parts_on_error
  • +
  • Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR
  • +
  • Provider: AWS
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-list-chunk

    +

    Size of listing chunk (response list for each ListObject S3 request).

    +

    This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. Most services truncate the response list to 1000 objects even if requested more than that. In AWS S3 this is a global maximum and cannot be changed, see AWS S3. In Ceph, this can be increased with the "rgw list buckets max chunk" option.

    +

    Properties:

      -
    • US Cross Region Private Endpoint
    • -
    -
  • "s3.private.dal.us.cloud-object-storage.appdomain.cloud" +
  • Config: list_chunk
  • +
  • Env Var: RCLONE_S3_LIST_CHUNK
  • +
  • Type: int
  • +
  • Default: 1000
  • + +

    --s3-list-version

    +

    Version of ListObjects to use: 1,2 or 0 for auto.

    +

    When S3 originally launched it only provided the ListObjects call to enumerate objects in a bucket.

    +

    However in May 2016 the ListObjectsV2 call was introduced. This is much higher performance and should be used if at all possible.

    +

    If set to the default, 0, rclone will guess according to the provider set which list objects method to call. If it guesses wrong, then it may be set manually here.

    +

    Properties:

      -
    • US Cross Region Dallas Private Endpoint
    • -
    -
  • "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" +
  • Config: list_version
  • +
  • Env Var: RCLONE_S3_LIST_VERSION
  • +
  • Type: int
  • +
  • Default: 0
  • + +

    --s3-list-url-encode

    +

    Whether to url encode listings: true/false/unset

    +

    Some providers support URL encoding listings and where this is available this is more reliable when using control characters in file names. If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

    +

    Properties:

      -
    • US Cross Region Washington DC Private Endpoint
    • -
    -
  • "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" +
  • Config: list_url_encode
  • +
  • Env Var: RCLONE_S3_LIST_URL_ENCODE
  • +
  • Type: Tristate
  • +
  • Default: unset
  • + +

    --s3-no-check-bucket

    +

    If set, don't attempt to check the bucket exists or create it.

    +

    This can be useful when trying to minimise the number of transactions rclone does if you know the bucket exists already.

    +

    It can also be needed if the user you are using does not have bucket creation permissions. Before v1.52.0 this would have passed silently due to a bug.

    +

    Properties:

      -
    • US Cross Region San Jose Private Endpoint
    • -
    -
  • "s3.us-east.cloud-object-storage.appdomain.cloud" +
  • Config: no_check_bucket
  • +
  • Env Var: RCLONE_S3_NO_CHECK_BUCKET
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-no-head

    +

    If set, don't HEAD uploaded objects to check integrity.

    +

    This can be useful when trying to minimise the number of transactions rclone does.

    +

    Setting it means that if rclone receives a 200 OK message after uploading an object with PUT then it will assume that it got uploaded properly.

    +

    In particular it will assume:

      -
    • US Region East Endpoint
    • -
    -
  • "s3.private.us-east.cloud-object-storage.appdomain.cloud" +
  • the metadata, including modtime, storage class and content type was as uploaded
  • +
  • the size was as uploaded
  • + +

    It reads the following items from the response for a single part PUT:

      -
    • US Region East Private Endpoint
    • -
    -
  • "s3.us-south.cloud-object-storage.appdomain.cloud" -
      -
    • US Region South Endpoint
    • -
  • -
  • "s3.private.us-south.cloud-object-storage.appdomain.cloud" -
      -
    • US Region South Private Endpoint
    • -
  • -
  • "s3.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Endpoint
    • -
  • -
  • "s3.fra.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Frankfurt Endpoint
    • -
  • -
  • "s3.mil.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Milan Endpoint
    • -
  • -
  • "s3.ams.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Amsterdam Endpoint
    • -
  • -
  • "s3.private.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Private Endpoint
    • -
  • -
  • "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Frankfurt Private Endpoint
    • -
  • -
  • "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Milan Private Endpoint
    • -
  • -
  • "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" -
      -
    • EU Cross Region Amsterdam Private Endpoint
    • -
  • -
  • "s3.eu-gb.cloud-object-storage.appdomain.cloud" -
      -
    • Great Britain Endpoint
    • -
  • -
  • "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" -
      -
    • Great Britain Private Endpoint
    • -
  • -
  • "s3.eu-de.cloud-object-storage.appdomain.cloud" -
      -
    • EU Region DE Endpoint
    • -
  • -
  • "s3.private.eu-de.cloud-object-storage.appdomain.cloud" -
      -
    • EU Region DE Private Endpoint
    • -
  • -
  • "s3.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional Endpoint
    • -
  • -
  • "s3.tok.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional Tokyo Endpoint
    • -
  • -
  • "s3.hkg.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional HongKong Endpoint
    • -
  • -
  • "s3.seo.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional Seoul Endpoint
    • -
  • -
  • "s3.private.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional Private Endpoint
    • -
  • -
  • "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional Tokyo Private Endpoint
    • -
  • -
  • "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional HongKong Private Endpoint
    • -
  • -
  • "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Cross Regional Seoul Private Endpoint
    • -
  • -
  • "s3.jp-tok.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Region Japan Endpoint
    • -
  • -
  • "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Region Japan Private Endpoint
    • -
  • -
  • "s3.au-syd.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Region Australia Endpoint
    • -
  • -
  • "s3.private.au-syd.cloud-object-storage.appdomain.cloud" -
      -
    • APAC Region Australia Private Endpoint
    • -
  • -
  • "s3.ams03.cloud-object-storage.appdomain.cloud" -
      -
    • Amsterdam Single Site Endpoint
    • -
  • -
  • "s3.private.ams03.cloud-object-storage.appdomain.cloud" -
      -
    • Amsterdam Single Site Private Endpoint
    • -
  • -
  • "s3.che01.cloud-object-storage.appdomain.cloud" -
      -
    • Chennai Single Site Endpoint
    • -
  • -
  • "s3.private.che01.cloud-object-storage.appdomain.cloud" -
      -
    • Chennai Single Site Private Endpoint
    • -
  • -
  • "s3.mel01.cloud-object-storage.appdomain.cloud" -
      -
    • Melbourne Single Site Endpoint
    • -
  • -
  • "s3.private.mel01.cloud-object-storage.appdomain.cloud" -
      -
    • Melbourne Single Site Private Endpoint
    • -
  • -
  • "s3.osl01.cloud-object-storage.appdomain.cloud" -
      -
    • Oslo Single Site Endpoint
    • -
  • -
  • "s3.private.osl01.cloud-object-storage.appdomain.cloud" -
      -
    • Oslo Single Site Private Endpoint
    • -
  • -
  • "s3.tor01.cloud-object-storage.appdomain.cloud" -
      -
    • Toronto Single Site Endpoint
    • -
  • -
  • "s3.private.tor01.cloud-object-storage.appdomain.cloud" -
      -
    • Toronto Single Site Private Endpoint
    • -
  • -
  • "s3.seo01.cloud-object-storage.appdomain.cloud" -
      -
    • Seoul Single Site Endpoint
    • -
  • -
  • "s3.private.seo01.cloud-object-storage.appdomain.cloud" -
      -
    • Seoul Single Site Private Endpoint
    • -
  • -
  • "s3.mon01.cloud-object-storage.appdomain.cloud" -
      -
    • Montreal Single Site Endpoint
    • -
  • -
  • "s3.private.mon01.cloud-object-storage.appdomain.cloud" -
      -
    • Montreal Single Site Private Endpoint
    • -
  • -
  • "s3.mex01.cloud-object-storage.appdomain.cloud" -
      -
    • Mexico Single Site Endpoint
    • -
  • -
  • "s3.private.mex01.cloud-object-storage.appdomain.cloud" +
  • the MD5SUM
  • +
  • The uploaded date
  • + +

    For multipart uploads these items aren't read.

    +

    If an source object of unknown length is uploaded then rclone will do a HEAD request.

    +

    Setting this flag increases the chance for undetected upload failures, in particular an incorrect size, so it isn't recommended for normal operation. In practice the chance of an undetected upload failure is very small even with this flag.

    +

    Properties:

      -
    • Mexico Single Site Private Endpoint
    • -
    -
  • "s3.sjc04.cloud-object-storage.appdomain.cloud" +
  • Config: no_head
  • +
  • Env Var: RCLONE_S3_NO_HEAD
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-no-head-object

    +

    If set, do not do HEAD before GET when getting objects.

    +

    Properties:

      -
    • San Jose Single Site Endpoint
    • -
    -
  • "s3.private.sjc04.cloud-object-storage.appdomain.cloud" +
  • Config: no_head_object
  • +
  • Env Var: RCLONE_S3_NO_HEAD_OBJECT
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-encoding

    +

    The encoding for the backend.

    +

    See the encoding section in the overview for more info.

    +

    Properties:

      -
    • San Jose Single Site Private Endpoint
    • -
    -
  • "s3.mil01.cloud-object-storage.appdomain.cloud" +
  • Config: encoding
  • +
  • Env Var: RCLONE_S3_ENCODING
  • +
  • Type: Encoding
  • +
  • Default: Slash,InvalidUtf8,Dot
  • + +

    --s3-memory-pool-flush-time

    +

    How often internal memory buffer pools will be flushed. (no longer used)

    +

    Properties:

      -
    • Milan Single Site Endpoint
    • -
    -
  • "s3.private.mil01.cloud-object-storage.appdomain.cloud" +
  • Config: memory_pool_flush_time
  • +
  • Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME
  • +
  • Type: Duration
  • +
  • Default: 1m0s
  • + +

    --s3-memory-pool-use-mmap

    +

    Whether to use mmap buffers in internal memory pool. (no longer used)

    +

    Properties:

      -
    • Milan Single Site Private Endpoint
    • -
    -
  • "s3.hkg02.cloud-object-storage.appdomain.cloud" +
  • Config: memory_pool_use_mmap
  • +
  • Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-disable-http2

    +

    Disable usage of http2 for S3 backends.

    +

    There is currently an unsolved issue with the s3 (specifically minio) backend and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be disabled here. When the issue is solved this flag will be removed.

    +

    See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631

    +

    Properties:

      -
    • Hong Kong Single Site Endpoint
    • -
    -
  • "s3.private.hkg02.cloud-object-storage.appdomain.cloud" +
  • Config: disable_http2
  • +
  • Env Var: RCLONE_S3_DISABLE_HTTP2
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-download-url

    +

    Custom endpoint for downloads. This is usually set to a CloudFront CDN URL as AWS S3 offers cheaper egress for data downloaded through the CloudFront network.

    +

    Properties:

      -
    • Hong Kong Single Site Private Endpoint
    • -
    -
  • "s3.par01.cloud-object-storage.appdomain.cloud" +
  • Config: download_url
  • +
  • Env Var: RCLONE_S3_DOWNLOAD_URL
  • +
  • Type: string
  • +
  • Required: false
  • + +

    --s3-directory-markers

    +

    Upload an empty object with a trailing slash when a new directory is created

    +

    Empty folders are unsupported for bucket based remotes, this option creates an empty object ending with "/", to persist the folder.

    +

    Properties:

      -
    • Paris Single Site Endpoint
    • -
    -
  • "s3.private.par01.cloud-object-storage.appdomain.cloud" +
  • Config: directory_markers
  • +
  • Env Var: RCLONE_S3_DIRECTORY_MARKERS
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-use-multipart-etag

    +

    Whether to use ETag in multipart uploads for verification

    +

    This should be true, false or left unset to use the default for the provider.

    +

    Properties:

      -
    • Paris Single Site Private Endpoint
    • -
    -
  • "s3.sng01.cloud-object-storage.appdomain.cloud" +
  • Config: use_multipart_etag
  • +
  • Env Var: RCLONE_S3_USE_MULTIPART_ETAG
  • +
  • Type: Tristate
  • +
  • Default: unset
  • + +

    --s3-use-presigned-request

    +

    Whether to use a presigned request or PutObject for single part uploads

    +

    If this is false rclone will use PutObject from the AWS SDK to upload an object.

    +

    Versions of rclone < 1.59 use presigned requests to upload a single part object and setting this flag to true will re-enable that functionality. This shouldn't be necessary except in exceptional circumstances or for testing.

    +

    Properties:

      -
    • Singapore Single Site Endpoint
    • -
    -
  • "s3.private.sng01.cloud-object-storage.appdomain.cloud" +
  • Config: use_presigned_request
  • +
  • Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST
  • +
  • Type: bool
  • +
  • Default: false
  • + +

    --s3-versions

    +

    Include old versions in directory listings.

    +

    Properties:

      -
    • Singapore Single Site Private Endpoint
    • -
    - +
  • Config: versions
  • +
  • Env Var: RCLONE_S3_VERSIONS
  • +
  • Type: bool
  • +
  • Default: false
  • -

    --s3-endpoint

    -

    Endpoint for IONOS S3 Object Storage.

    -

    Specify the endpoint from the same region.

    +

    --s3-version-at

    +

    Show file versions as they were at the specified time.

    +

    The parameter should be a date, "2006-01-02", datetime "2006-01-02 15:04:05" or a duration for that long ago, eg "100d" or "1h".

    +

    Note that when using this no file write operations are permitted, so you can't upload files or delete them.

    +

    See the time option docs for valid formats.

    Properties:

      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: IONOS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: +
    • Config: version_at
    • +
    • Env Var: RCLONE_S3_VERSION_AT
    • +
    • Type: Time
    • +
    • Default: off
    • +
    +

    --s3-decompress

    +

    If set this will decompress gzip encoded objects.

    +

    It is possible to upload objects to S3 with "Content-Encoding: gzip" set. Normally rclone will download these files as compressed objects.

    +

    If this flag is set then rclone will decompress these files with "Content-Encoding: gzip" as they are received. This means that rclone can't check the size and hash but the file contents will be decompressed.

    +

    Properties:

      -
    • "s3-eu-central-1.ionoscloud.com" +
    • Config: decompress
    • +
    • Env Var: RCLONE_S3_DECOMPRESS
    • +
    • Type: bool
    • +
    • Default: false
    • +
    +

    --s3-might-gzip

    +

    Set this if the backend might gzip objects.

    +

    Normally providers will not alter objects when they are downloaded. If an object was not uploaded with Content-Encoding: gzip then it won't be set on download.

    +

    However some providers may gzip objects even if they weren't uploaded with Content-Encoding: gzip (eg Cloudflare).

    +

    A symptom of this would be receiving errors like

    +
    ERROR corrupted on transfer: sizes differ NNN vs MMM
    +

    If you set this flag and rclone downloads an object with Content-Encoding: gzip set and chunked transfer encoding, then rclone will decompress the object on the fly.

    +

    If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

    +

    Properties:

      -
    • Frankfurt, Germany
    • -
    -
  • "s3-eu-central-2.ionoscloud.com" +
  • Config: might_gzip
  • +
  • Env Var: RCLONE_S3_MIGHT_GZIP
  • +
  • Type: Tristate
  • +
  • Default: unset
  • + +

    --s3-use-accept-encoding-gzip

    +

    Whether to send Accept-Encoding: gzip header.

    +

    By default, rclone will append Accept-Encoding: gzip to the request to download compressed objects whenever possible.

    +

    However some providers such as Google Cloud Storage may alter the HTTP headers, breaking the signature of the request.

    +

    A symptom of this would be receiving errors like

    +
    SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided.
    +

    In this case, you might want to try disabling this option.

    +

    Properties:

      -
    • Berlin, Germany
    • -
    -
  • "s3-eu-south-2.ionoscloud.com" +
  • Config: use_accept_encoding_gzip
  • +
  • Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP
  • +
  • Type: Tristate
  • +
  • Default: unset
  • + +

    --s3-no-system-metadata

    +

    Suppress setting and reading of system metadata

    +

    Properties:

      -
    • Logrono, Spain
    • -
    - +
  • Config: no_system_metadata
  • +
  • Env Var: RCLONE_S3_NO_SYSTEM_METADATA
  • +
  • Type: bool
  • +
  • Default: false
  • -

    --s3-endpoint

    -

    Endpoint for Liara Object Storage API.

    +

    --s3-sts-endpoint

    +

    Endpoint for STS.

    +

    Leave blank if using AWS to use the default endpoint for the region.

    Properties:

      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: Liara
    • +
    • Config: sts_endpoint
    • +
    • Env Var: RCLONE_S3_STS_ENDPOINT
    • +
    • Provider: AWS
    • Type: string
    • Required: false
    • -
    • Examples: -
        -
      • "storage.iran.liara.space" +
      +

      --s3-use-already-exists

      +

      Set if rclone should report BucketAlreadyExists errors on bucket creation.

      +

      At some point during the evolution of the s3 protocol, AWS started returning an AlreadyOwnedByYou error when attempting to create a bucket that the user already owned, rather than a BucketAlreadyExists error.

      +

      Unfortunately exactly what has been implemented by s3 clones is a little inconsistent, some return AlreadyOwnedByYou, some return BucketAlreadyExists and some return no error at all.

      +

      This is important to rclone because it ensures the bucket exists by creating it on quite a lot of operations (unless --s3-no-check-bucket is used).

      +

      If rclone knows the provider can return AlreadyOwnedByYou or returns no error then it can report BucketAlreadyExists errors when the user attempts to create a bucket not owned by them. Otherwise rclone ignores the BucketAlreadyExists error which can lead to confusion.

      +

      This should be automatically set correctly for all providers rclone knows about - please make a bug report if not.

      +

      Properties:

        -
      • The default endpoint
      • -
      • Iran
      • -
    • -
    +
  • Config: use_already_exists
  • +
  • Env Var: RCLONE_S3_USE_ALREADY_EXISTS
  • +
  • Type: Tristate
  • +
  • Default: unset
  • -

    --s3-endpoint

    -

    Endpoint for OSS API.

    +

    --s3-use-multipart-uploads

    +

    Set if rclone should use multipart uploads.

    +

    You can change this if you want to disable the use of multipart uploads. This shouldn't be necessary in normal operation.

    +

    This should be automatically set correctly for all providers rclone knows about - please make a bug report if not.

    Properties:

      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: Alibaba
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "oss-accelerate.aliyuncs.com" -
          -
        • Global Accelerate
        • -
      • -
      • "oss-accelerate-overseas.aliyuncs.com" -
          -
        • Global Accelerate (outside mainland China)
        • -
      • -
      • "oss-cn-hangzhou.aliyuncs.com" -
          -
        • East China 1 (Hangzhou)
        • -
      • -
      • "oss-cn-shanghai.aliyuncs.com" -
          -
        • East China 2 (Shanghai)
        • -
      • -
      • "oss-cn-qingdao.aliyuncs.com" -
          -
        • North China 1 (Qingdao)
        • -
      • -
      • "oss-cn-beijing.aliyuncs.com" -
          -
        • North China 2 (Beijing)
        • -
      • -
      • "oss-cn-zhangjiakou.aliyuncs.com" -
          -
        • North China 3 (Zhangjiakou)
        • -
      • -
      • "oss-cn-huhehaote.aliyuncs.com" -
          -
        • North China 5 (Hohhot)
        • -
      • -
      • "oss-cn-wulanchabu.aliyuncs.com" -
          -
        • North China 6 (Ulanqab)
        • -
      • -
      • "oss-cn-shenzhen.aliyuncs.com" -
          -
        • South China 1 (Shenzhen)
        • -
      • -
      • "oss-cn-heyuan.aliyuncs.com" -
          -
        • South China 2 (Heyuan)
        • -
      • -
      • "oss-cn-guangzhou.aliyuncs.com" -
          -
        • South China 3 (Guangzhou)
        • -
      • -
      • "oss-cn-chengdu.aliyuncs.com" -
          -
        • West China 1 (Chengdu)
        • -
      • -
      • "oss-cn-hongkong.aliyuncs.com" -
          -
        • Hong Kong (Hong Kong)
        • -
      • -
      • "oss-us-west-1.aliyuncs.com" -
          -
        • US West 1 (Silicon Valley)
        • -
      • -
      • "oss-us-east-1.aliyuncs.com" -
          -
        • US East 1 (Virginia)
        • -
      • -
      • "oss-ap-southeast-1.aliyuncs.com" -
          -
        • Southeast Asia Southeast 1 (Singapore)
        • -
      • -
      • "oss-ap-southeast-2.aliyuncs.com" -
          -
        • Asia Pacific Southeast 2 (Sydney)
        • -
      • -
      • "oss-ap-southeast-3.aliyuncs.com" -
          -
        • Southeast Asia Southeast 3 (Kuala Lumpur)
        • -
      • -
      • "oss-ap-southeast-5.aliyuncs.com" -
          -
        • Asia Pacific Southeast 5 (Jakarta)
        • -
      • -
      • "oss-ap-northeast-1.aliyuncs.com" -
          -
        • Asia Pacific Northeast 1 (Japan)
        • -
      • -
      • "oss-ap-south-1.aliyuncs.com" -
          -
        • Asia Pacific South 1 (Mumbai)
        • -
      • -
      • "oss-eu-central-1.aliyuncs.com" -
          -
        • Central Europe 1 (Frankfurt)
        • -
      • -
      • "oss-eu-west-1.aliyuncs.com" -
          -
        • West Europe (London)
        • -
      • -
      • "oss-me-east-1.aliyuncs.com" -
          -
        • Middle East 1 (Dubai)
        • -
      • -
    • -
    -

    --s3-endpoint

    -

    Endpoint for OBS API.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: HuaweiOBS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "obs.af-south-1.myhuaweicloud.com" -
          -
        • AF-Johannesburg
        • -
      • -
      • "obs.ap-southeast-2.myhuaweicloud.com" -
          -
        • AP-Bangkok
        • -
      • -
      • "obs.ap-southeast-3.myhuaweicloud.com" -
          -
        • AP-Singapore
        • -
      • -
      • "obs.cn-east-3.myhuaweicloud.com" -
          -
        • CN East-Shanghai1
        • -
      • -
      • "obs.cn-east-2.myhuaweicloud.com" -
          -
        • CN East-Shanghai2
        • -
      • -
      • "obs.cn-north-1.myhuaweicloud.com" -
          -
        • CN North-Beijing1
        • -
      • -
      • "obs.cn-north-4.myhuaweicloud.com" -
          -
        • CN North-Beijing4
        • -
      • -
      • "obs.cn-south-1.myhuaweicloud.com" -
          -
        • CN South-Guangzhou
        • -
      • -
      • "obs.ap-southeast-1.myhuaweicloud.com" -
          -
        • CN-Hong Kong
        • -
      • -
      • "obs.sa-argentina-1.myhuaweicloud.com" -
          -
        • LA-Buenos Aires1
        • -
      • -
      • "obs.sa-peru-1.myhuaweicloud.com" -
          -
        • LA-Lima1
        • -
      • -
      • "obs.na-mexico-1.myhuaweicloud.com" -
          -
        • LA-Mexico City1
        • -
      • -
      • "obs.sa-chile-1.myhuaweicloud.com" -
          -
        • LA-Santiago2
        • -
      • -
      • "obs.sa-brazil-1.myhuaweicloud.com" -
          -
        • LA-Sao Paulo1
        • -
      • -
      • "obs.ru-northwest-2.myhuaweicloud.com" -
          -
        • RU-Moscow2
        • -
      • -
    • -
    -

    --s3-endpoint

    -

    Endpoint for Scaleway Object Storage.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: Scaleway
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "s3.nl-ams.scw.cloud" -
          -
        • Amsterdam Endpoint
        • -
      • -
      • "s3.fr-par.scw.cloud" -
          -
        • Paris Endpoint
        • -
      • -
      • "s3.pl-waw.scw.cloud" -
          -
        • Warsaw Endpoint
        • -
      • -
    • +
    • Config: use_multipart_uploads
    • +
    • Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS
    • +
    • Type: Tristate
    • +
    • Default: unset
    -

    --s3-endpoint

    -

    Endpoint for StackPath Object Storage.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: StackPath
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "s3.us-east-2.stackpathstorage.com" -
          -
        • US East Endpoint
        • -
      • -
      • "s3.us-west-1.stackpathstorage.com" -
          -
        • US West Endpoint
        • -
      • -
      • "s3.eu-central-1.stackpathstorage.com" +

        Metadata

        +

        User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case.

        +

        Here are the possible system metadata items for the s3 backend.

        +
    +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameHelpTypeExampleRead Only
    btimeTime of file birth (creation) read from Last-Modified headerRFC 33392006-01-02T15:04:05.999999999Z07:00Y
    cache-controlCache-Control headerstringno-cacheN
    content-dispositionContent-Disposition headerstringinlineN
    content-encodingContent-Encoding headerstringgzipN
    content-languageContent-Language headerstringen-USN
    content-typeContent-Type headerstringtext/plainN
    mtimeTime of last modification, read from rclone metadataRFC 33392006-01-02T15:04:05.999999999Z07:00N
    tierTier of the objectstringGLACIERY
    +

    See the metadata docs for more info.

    +

    Backend commands

    +

    Here are the commands specific to the s3 backend.

    +

    Run them with

    +
    rclone backend COMMAND remote:
    +

    The help below will explain what arguments each command takes.

    +

    See the backend command for more info on how to pass options and arguments.

    +

    These can be run on a running backend using the rc command backend/command.

    +

    restore

    +

    Restore objects from GLACIER to normal storage

    +
    rclone backend restore remote: [options] [<arguments>+]
    +

    This command can be used to restore one or more objects from GLACIER to normal storage.

    +

    Usage Examples:

    +
    rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS
    +rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS
    +rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS
    +

    This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags

    +
    rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1
    +

    All the objects shown will be marked for restore, then

    +
    rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1
    +

    It returns a list of status dictionaries with Remote and Status keys. The Status will be OK if it was successful or an error message if not.

    +
    [
    +    {
    +        "Status": "OK",
    +        "Remote": "test.txt"
    +    },
    +    {
    +        "Status": "OK",
    +        "Remote": "test/file4.txt"
    +    }
    +]
    +

    Options:

      -
    • EU Endpoint
    • -
    - +
  • "description": The optional description for the job.
  • +
  • "lifetime": Lifetime of the active copy in days
  • +
  • "priority": Priority of restore: Standard|Expedited|Bulk
  • -

    --s3-endpoint

    -

    Endpoint for Storj Gateway.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: Storj
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "gateway.storjshare.io" +

        restore-status

        +

        Show the restore status for objects being restored from GLACIER to normal storage

        +
        rclone backend restore-status remote: [options] [<arguments>+]
        +

        This command can be used to show the status for objects being restored from GLACIER to normal storage.

        +

        Usage Examples:

        +
        rclone backend restore-status s3:bucket/path/to/object
        +rclone backend restore-status s3:bucket/path/to/directory
        +rclone backend restore-status -o all s3:bucket/path/to/directory
        +

        This command does not obey the filters.

        +

        It returns a list of status dictionaries.

        +
        [
        +    {
        +        "Remote": "file.txt",
        +        "VersionID": null,
        +        "RestoreStatus": {
        +            "IsRestoreInProgress": true,
        +            "RestoreExpiryDate": "2023-09-06T12:29:19+01:00"
        +        },
        +        "StorageClass": "GLACIER"
        +    },
        +    {
        +        "Remote": "test.pdf",
        +        "VersionID": null,
        +        "RestoreStatus": {
        +            "IsRestoreInProgress": false,
        +            "RestoreExpiryDate": "2023-09-06T12:29:19+01:00"
        +        },
        +        "StorageClass": "DEEP_ARCHIVE"
        +    }
        +]
        +

        Options:

          -
        • Global Hosted Gateway
        • -
      • -
    • +
    • "all": if set then show all objects, not just ones with restore status
    -

    --s3-endpoint

    -

    Endpoint for Tencent COS API.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: TencentCOS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "cos.ap-beijing.myqcloud.com" -
          -
        • Beijing Region
        • -
      • -
      • "cos.ap-nanjing.myqcloud.com" -
          -
        • Nanjing Region
        • -
      • -
      • "cos.ap-shanghai.myqcloud.com" -
          -
        • Shanghai Region
        • -
      • -
      • "cos.ap-guangzhou.myqcloud.com" -
          -
        • Guangzhou Region
        • -
      • -
      • "cos.ap-nanjing.myqcloud.com" -
          -
        • Nanjing Region
        • -
      • -
      • "cos.ap-chengdu.myqcloud.com" -
          -
        • Chengdu Region
        • -
      • -
      • "cos.ap-chongqing.myqcloud.com" -
          -
        • Chongqing Region
        • -
      • -
      • "cos.ap-hongkong.myqcloud.com" -
          -
        • Hong Kong (China) Region
        • -
      • -
      • "cos.ap-singapore.myqcloud.com" -
          -
        • Singapore Region
        • -
      • -
      • "cos.ap-mumbai.myqcloud.com" -
          -
        • Mumbai Region
        • -
      • -
      • "cos.ap-seoul.myqcloud.com" -
          -
        • Seoul Region
        • -
      • -
      • "cos.ap-bangkok.myqcloud.com" -
          -
        • Bangkok Region
        • -
      • -
      • "cos.ap-tokyo.myqcloud.com" -
          -
        • Tokyo Region
        • -
      • -
      • "cos.na-siliconvalley.myqcloud.com" -
          -
        • Silicon Valley Region
        • -
      • -
      • "cos.na-ashburn.myqcloud.com" -
          -
        • Virginia Region
        • -
      • -
      • "cos.na-toronto.myqcloud.com" -
          -
        • Toronto Region
        • -
      • -
      • "cos.eu-frankfurt.myqcloud.com" -
          -
        • Frankfurt Region
        • -
      • -
      • "cos.eu-moscow.myqcloud.com" -
          -
        • Moscow Region
        • -
      • -
      • "cos.accelerate.myqcloud.com" -
          -
        • Use Tencent COS Accelerate Endpoint
        • -
      • -
    • -
    -

    --s3-endpoint

    -

    Endpoint for RackCorp Object Storage.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: RackCorp
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "s3.rackcorp.com" -
          -
        • Global (AnyCast) Endpoint
        • -
      • -
      • "au.s3.rackcorp.com" -
          -
        • Australia (Anycast) Endpoint
        • -
      • -
      • "au-nsw.s3.rackcorp.com" -
          -
        • Sydney (Australia) Endpoint
        • -
      • -
      • "au-qld.s3.rackcorp.com" -
          -
        • Brisbane (Australia) Endpoint
        • -
      • -
      • "au-vic.s3.rackcorp.com" -
          -
        • Melbourne (Australia) Endpoint
        • -
      • -
      • "au-wa.s3.rackcorp.com" -
          -
        • Perth (Australia) Endpoint
        • -
      • -
      • "ph.s3.rackcorp.com" -
          -
        • Manila (Philippines) Endpoint
        • -
      • -
      • "th.s3.rackcorp.com" -
          -
        • Bangkok (Thailand) Endpoint
        • -
      • -
      • "hk.s3.rackcorp.com" -
          -
        • HK (Hong Kong) Endpoint
        • -
      • -
      • "mn.s3.rackcorp.com" -
          -
        • Ulaanbaatar (Mongolia) Endpoint
        • -
      • -
      • "kg.s3.rackcorp.com" -
          -
        • Bishkek (Kyrgyzstan) Endpoint
        • -
      • -
      • "id.s3.rackcorp.com" -
          -
        • Jakarta (Indonesia) Endpoint
        • -
      • -
      • "jp.s3.rackcorp.com" -
          -
        • Tokyo (Japan) Endpoint
        • -
      • -
      • "sg.s3.rackcorp.com" -
          -
        • SG (Singapore) Endpoint
        • -
      • -
      • "de.s3.rackcorp.com" -
          -
        • Frankfurt (Germany) Endpoint
        • -
      • -
      • "us.s3.rackcorp.com" -
          -
        • USA (AnyCast) Endpoint
        • -
      • -
      • "us-east-1.s3.rackcorp.com" -
          -
        • New York (USA) Endpoint
        • -
      • -
      • "us-west-1.s3.rackcorp.com" -
          -
        • Freemont (USA) Endpoint
        • -
      • -
      • "nz.s3.rackcorp.com" -
          -
        • Auckland (New Zealand) Endpoint
        • -
      • -
    • -
    -

    --s3-endpoint

    -

    Endpoint for Qiniu Object Storage.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: Qiniu
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "s3-cn-east-1.qiniucs.com" -
          -
        • East China Endpoint 1
        • -
      • -
      • "s3-cn-east-2.qiniucs.com" -
          -
        • East China Endpoint 2
        • -
      • -
      • "s3-cn-north-1.qiniucs.com" -
          -
        • North China Endpoint 1
        • -
      • -
      • "s3-cn-south-1.qiniucs.com" -
          -
        • South China Endpoint 1
        • -
      • -
      • "s3-us-north-1.qiniucs.com" -
          -
        • North America Endpoint 1
        • -
      • -
      • "s3-ap-southeast-1.qiniucs.com" -
          -
        • Southeast Asia Endpoint 1
        • -
      • -
      • "s3-ap-northeast-1.qiniucs.com" -
          -
        • Northeast Asia Endpoint 1
        • -
      • -
    • -
    -

    --s3-endpoint

    -

    Endpoint for S3 API.

    -

    Required when using an S3 clone.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_S3_ENDPOINT
    • -
    • Provider: !AWS,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,Liara,ArvanCloud,Scaleway,StackPath,Storj,RackCorp,Qiniu
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "objects-us-east-1.dream.io" -
          -
        • Dream Objects endpoint
        • -
      • -
      • "syd1.digitaloceanspaces.com" -
          -
        • DigitalOcean Spaces Sydney 1
        • -
      • -
      • "sfo3.digitaloceanspaces.com" -
          -
        • DigitalOcean Spaces San Francisco 3
        • -
      • -
      • "fra1.digitaloceanspaces.com" -
          -
        • DigitalOcean Spaces Frankfurt 1
        • -
      • -
      • "nyc3.digitaloceanspaces.com" -
          -
        • DigitalOcean Spaces New York 3
        • -
      • -
      • "ams3.digitaloceanspaces.com" -
          -
        • DigitalOcean Spaces Amsterdam 3
        • -
      • -
      • "sgp1.digitaloceanspaces.com" -
          -
        • DigitalOcean Spaces Singapore 1
        • -
      • -
      • "localhost:8333" -
          -
        • SeaweedFS S3 localhost
        • -
      • -
      • "s3.us-east-1.lyvecloud.seagate.com" -
          -
        • Seagate Lyve Cloud US East 1 (Virginia)
        • -
      • -
      • "s3.us-west-1.lyvecloud.seagate.com" -
          -
        • Seagate Lyve Cloud US West 1 (California)
        • -
      • -
      • "s3.ap-southeast-1.lyvecloud.seagate.com" -
          -
        • Seagate Lyve Cloud AP Southeast 1 (Singapore)
        • -
      • -
      • "s3.wasabisys.com" -
          -
        • Wasabi US East 1 (N. Virginia)
        • -
      • -
      • "s3.us-east-2.wasabisys.com" -
          -
        • Wasabi US East 2 (N. Virginia)
        • -
      • -
      • "s3.us-central-1.wasabisys.com" -
          -
        • Wasabi US Central 1 (Texas)
        • -
      • -
      • "s3.us-west-1.wasabisys.com" -
          -
        • Wasabi US West 1 (Oregon)
        • -
      • -
      • "s3.ca-central-1.wasabisys.com" -
          -
        • Wasabi CA Central 1 (Toronto)
        • -
      • -
      • "s3.eu-central-1.wasabisys.com" -
          -
        • Wasabi EU Central 1 (Amsterdam)
        • -
      • -
      • "s3.eu-central-2.wasabisys.com" -
          -
        • Wasabi EU Central 2 (Frankfurt)
        • -
      • -
      • "s3.eu-west-1.wasabisys.com" -
          -
        • Wasabi EU West 1 (London)
        • -
      • -
      • "s3.eu-west-2.wasabisys.com" -
          -
        • Wasabi EU West 2 (Paris)
        • -
      • -
      • "s3.ap-northeast-1.wasabisys.com" -
          -
        • Wasabi AP Northeast 1 (Tokyo) endpoint
        • -
      • -
      • "s3.ap-northeast-2.wasabisys.com" -
          -
        • Wasabi AP Northeast 2 (Osaka) endpoint
        • -
      • -
      • "s3.ap-southeast-1.wasabisys.com" -
          -
        • Wasabi AP Southeast 1 (Singapore)
        • -
      • -
      • "s3.ap-southeast-2.wasabisys.com" -
          -
        • Wasabi AP Southeast 2 (Sydney)
        • -
      • -
      • "storage.iran.liara.space" -
          -
        • Liara Iran endpoint
        • -
      • -
      • "s3.ir-thr-at1.arvanstorage.com" +

        list-multipart-uploads

        +

        List the unfinished multipart uploads

        +
        rclone backend list-multipart-uploads remote: [options] [<arguments>+]
        +

        This command lists the unfinished multipart uploads in JSON format.

        +
        rclone backend list-multipart s3:bucket/path/to/object
        +

        It returns a dictionary of buckets with values as lists of unfinished multipart uploads.

        +

        You can call it with no bucket in which case it lists all bucket, with a bucket or with a bucket and path.

        +
        {
        +  "rclone": [
        +    {
        +      "Initiated": "2020-06-26T14:20:36Z",
        +      "Initiator": {
        +        "DisplayName": "XXX",
        +        "ID": "arn:aws:iam::XXX:user/XXX"
        +      },
        +      "Key": "KEY",
        +      "Owner": {
        +        "DisplayName": null,
        +        "ID": "XXX"
        +      },
        +      "StorageClass": "STANDARD",
        +      "UploadId": "XXX"
        +    }
        +  ],
        +  "rclone-1000files": [],
        +  "rclone-dst": []
        +}
        +

        cleanup

        +

        Remove unfinished multipart uploads.

        +
        rclone backend cleanup remote: [options] [<arguments>+]
        +

        This command removes unfinished multipart uploads of age greater than max-age which defaults to 24 hours.

        +

        Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

        +
        rclone backend cleanup s3:bucket/path/to/object
        +rclone backend cleanup -o max-age=7w s3:bucket/path/to/object
        +

        Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.

        +

        Options:

          -
        • ArvanCloud Tehran Iran (Asiatech) endpoint
        • -
      • -
    • +
    • "max-age": Max age of upload to delete
    -

    --s3-location-constraint

    -

    Location constraint - must be set to match the Region.

    -

    Used when creating buckets only.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: AWS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Empty for US Region, Northern Virginia, or Pacific Northwest
        • -
      • -
      • "us-east-2" -
          -
        • US East (Ohio) Region
        • -
      • -
      • "us-west-1" -
          -
        • US West (Northern California) Region
        • -
      • -
      • "us-west-2" -
          -
        • US West (Oregon) Region
        • -
      • -
      • "ca-central-1" -
          -
        • Canada (Central) Region
        • -
      • -
      • "eu-west-1" -
          -
        • EU (Ireland) Region
        • -
      • -
      • "eu-west-2" -
          -
        • EU (London) Region
        • -
      • -
      • "eu-west-3" -
          -
        • EU (Paris) Region
        • -
      • -
      • "eu-north-1" -
          -
        • EU (Stockholm) Region
        • -
      • -
      • "eu-south-1" -
          -
        • EU (Milan) Region
        • -
      • -
      • "EU" -
          -
        • EU Region
        • -
      • -
      • "ap-southeast-1" -
          -
        • Asia Pacific (Singapore) Region
        • -
      • -
      • "ap-southeast-2" -
          -
        • Asia Pacific (Sydney) Region
        • -
      • -
      • "ap-northeast-1" -
          -
        • Asia Pacific (Tokyo) Region
        • -
      • -
      • "ap-northeast-2" -
          -
        • Asia Pacific (Seoul) Region
        • -
      • -
      • "ap-northeast-3" -
          -
        • Asia Pacific (Osaka-Local) Region
        • -
      • -
      • "ap-south-1" -
          -
        • Asia Pacific (Mumbai) Region
        • -
      • -
      • "ap-east-1" -
          -
        • Asia Pacific (Hong Kong) Region
        • -
      • -
      • "sa-east-1" -
          -
        • South America (Sao Paulo) Region
        • -
      • -
      • "me-south-1" -
          -
        • Middle East (Bahrain) Region
        • -
      • -
      • "af-south-1" -
          -
        • Africa (Cape Town) Region
        • -
      • -
      • "cn-north-1" -
          -
        • China (Beijing) Region
        • -
      • -
      • "cn-northwest-1" -
          -
        • China (Ningxia) Region
        • -
      • -
      • "us-gov-east-1" -
          -
        • AWS GovCloud (US-East) Region
        • -
      • -
      • "us-gov-west-1" -
          -
        • AWS GovCloud (US) Region
        • -
      • -
    • -
    -

    --s3-location-constraint

    -

    Location constraint - must match endpoint.

    -

    Used when creating buckets only.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: ChinaMobile
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "wuxi1" -
          -
        • East China (Suzhou)
        • -
      • -
      • "jinan1" -
          -
        • East China (Jinan)
        • -
      • -
      • "ningbo1" -
          -
        • East China (Hangzhou)
        • -
      • -
      • "shanghai1" -
          -
        • East China (Shanghai-1)
        • -
      • -
      • "zhengzhou1" -
          -
        • Central China (Zhengzhou)
        • -
      • -
      • "hunan1" -
          -
        • Central China (Changsha-1)
        • -
      • -
      • "zhuzhou1" -
          -
        • Central China (Changsha-2)
        • -
      • -
      • "guangzhou1" -
          -
        • South China (Guangzhou-2)
        • -
      • -
      • "dongguan1" -
          -
        • South China (Guangzhou-3)
        • -
      • -
      • "beijing1" -
          -
        • North China (Beijing-1)
        • -
      • -
      • "beijing2" -
          -
        • North China (Beijing-2)
        • -
      • -
      • "beijing4" -
          -
        • North China (Beijing-3)
        • -
      • -
      • "huhehaote1" -
          -
        • North China (Huhehaote)
        • -
      • -
      • "chengdu1" -
          -
        • Southwest China (Chengdu)
        • -
      • -
      • "chongqing1" -
          -
        • Southwest China (Chongqing)
        • -
      • -
      • "guiyang1" -
          -
        • Southwest China (Guiyang)
        • -
      • -
      • "xian1" -
          -
        • Nouthwest China (Xian)
        • -
      • -
      • "yunnan" -
          -
        • Yunnan China (Kunming)
        • -
      • -
      • "yunnan2" -
          -
        • Yunnan China (Kunming-2)
        • -
      • -
      • "tianjin1" -
          -
        • Tianjin China (Tianjin)
        • -
      • -
      • "jilin1" -
          -
        • Jilin China (Changchun)
        • -
      • -
      • "hubei1" -
          -
        • Hubei China (Xiangyan)
        • -
      • -
      • "jiangxi1" -
          -
        • Jiangxi China (Nanchang)
        • -
      • -
      • "gansu1" -
          -
        • Gansu China (Lanzhou)
        • -
      • -
      • "shanxi1" -
          -
        • Shanxi China (Taiyuan)
        • -
      • -
      • "liaoning1" -
          -
        • Liaoning China (Shenyang)
        • -
      • -
      • "hebei1" -
          -
        • Hebei China (Shijiazhuang)
        • -
      • -
      • "fujian1" -
          -
        • Fujian China (Xiamen)
        • -
      • -
      • "guangxi1" -
          -
        • Guangxi China (Nanning)
        • -
      • -
      • "anhui1" -
          -
        • Anhui China (Huainan)
        • -
      • -
    • -
    -

    --s3-location-constraint

    -

    Location constraint - must match endpoint.

    -

    Used when creating buckets only.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: ArvanCloud
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "ir-thr-at1" -
          -
        • Tehran Iran (Asiatech)
        • -
      • -
      • "ir-tbz-sh1" -
          -
        • Tabriz Iran (Shahriar)
        • -
      • -
    • -
    -

    --s3-location-constraint

    -

    Location constraint - must match endpoint when using IBM Cloud Public.

    -

    For on-prem COS, do not make a selection from this list, hit enter.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: IBMCOS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "us-standard" -
          -
        • US Cross Region Standard
        • -
      • -
      • "us-vault" -
          -
        • US Cross Region Vault
        • -
      • -
      • "us-cold" -
          -
        • US Cross Region Cold
        • -
      • -
      • "us-flex" -
          -
        • US Cross Region Flex
        • -
      • -
      • "us-east-standard" -
          -
        • US East Region Standard
        • -
      • -
      • "us-east-vault" -
          -
        • US East Region Vault
        • -
      • -
      • "us-east-cold" -
          -
        • US East Region Cold
        • -
      • -
      • "us-east-flex" -
          -
        • US East Region Flex
        • -
      • -
      • "us-south-standard" -
          -
        • US South Region Standard
        • -
      • -
      • "us-south-vault" -
          -
        • US South Region Vault
        • -
      • -
      • "us-south-cold" -
          -
        • US South Region Cold
        • -
      • -
      • "us-south-flex" -
          -
        • US South Region Flex
        • -
      • -
      • "eu-standard" -
          -
        • EU Cross Region Standard
        • -
      • -
      • "eu-vault" -
          -
        • EU Cross Region Vault
        • -
      • -
      • "eu-cold" -
          -
        • EU Cross Region Cold
        • -
      • -
      • "eu-flex" -
          -
        • EU Cross Region Flex
        • -
      • -
      • "eu-gb-standard" -
          -
        • Great Britain Standard
        • -
      • -
      • "eu-gb-vault" -
          -
        • Great Britain Vault
        • -
      • -
      • "eu-gb-cold" -
          -
        • Great Britain Cold
        • -
      • -
      • "eu-gb-flex" -
          -
        • Great Britain Flex
        • -
      • -
      • "ap-standard" -
          -
        • APAC Standard
        • -
      • -
      • "ap-vault" -
          -
        • APAC Vault
        • -
      • -
      • "ap-cold" -
          -
        • APAC Cold
        • -
      • -
      • "ap-flex" -
          -
        • APAC Flex
        • -
      • -
      • "mel01-standard" -
          -
        • Melbourne Standard
        • -
      • -
      • "mel01-vault" -
          -
        • Melbourne Vault
        • -
      • -
      • "mel01-cold" -
          -
        • Melbourne Cold
        • -
      • -
      • "mel01-flex" -
          -
        • Melbourne Flex
        • -
      • -
      • "tor01-standard" -
          -
        • Toronto Standard
        • -
      • -
      • "tor01-vault" -
          -
        • Toronto Vault
        • -
      • -
      • "tor01-cold" -
          -
        • Toronto Cold
        • -
      • -
      • "tor01-flex" -
          -
        • Toronto Flex
        • -
      • -
    • -
    -

    --s3-location-constraint

    -

    Location constraint - the location where your bucket will be located and your data stored.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: RackCorp
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "global" -
          -
        • Global CDN Region
        • -
      • -
      • "au" -
          -
        • Australia (All locations)
        • -
      • -
      • "au-nsw" -
          -
        • NSW (Australia) Region
        • -
      • -
      • "au-qld" -
          -
        • QLD (Australia) Region
        • -
      • -
      • "au-vic" -
          -
        • VIC (Australia) Region
        • -
      • -
      • "au-wa" -
          -
        • Perth (Australia) Region
        • -
      • -
      • "ph" -
          -
        • Manila (Philippines) Region
        • -
      • -
      • "th" -
          -
        • Bangkok (Thailand) Region
        • -
      • -
      • "hk" -
          -
        • HK (Hong Kong) Region
        • -
      • -
      • "mn" -
          -
        • Ulaanbaatar (Mongolia) Region
        • -
      • -
      • "kg" -
          -
        • Bishkek (Kyrgyzstan) Region
        • -
      • -
      • "id" -
          -
        • Jakarta (Indonesia) Region
        • -
      • -
      • "jp" -
          -
        • Tokyo (Japan) Region
        • -
      • -
      • "sg" -
          -
        • SG (Singapore) Region
        • -
      • -
      • "de" -
          -
        • Frankfurt (Germany) Region
        • -
      • -
      • "us" -
          -
        • USA (AnyCast) Region
        • -
      • -
      • "us-east-1" -
          -
        • New York (USA) Region
        • -
      • -
      • "us-west-1" -
          -
        • Freemont (USA) Region
        • -
      • -
      • "nz" -
          -
        • Auckland (New Zealand) Region
        • -
      • -
    • -
    -

    --s3-location-constraint

    -

    Location constraint - must be set to match the Region.

    -

    Used when creating buckets only.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: Qiniu
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "cn-east-1" -
          -
        • East China Region 1
        • -
      • -
      • "cn-east-2" -
          -
        • East China Region 2
        • -
      • -
      • "cn-north-1" -
          -
        • North China Region 1
        • -
      • -
      • "cn-south-1" -
          -
        • South China Region 1
        • -
      • -
      • "us-north-1" -
          -
        • North America Region 1
        • -
      • -
      • "ap-southeast-1" -
          -
        • Southeast Asia Region 1
        • -
      • -
      • "ap-northeast-1" -
          -
        • Northeast Asia Region 1
        • -
      • -
    • -
    -

    --s3-location-constraint

    -

    Location constraint - must be set to match the Region.

    -

    Leave blank if not sure. Used when creating buckets only.

    -

    Properties:

    -
      -
    • Config: location_constraint
    • -
    • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
    • -
    • Provider: !AWS,Alibaba,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Liara,ArvanCloud,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-acl

    -

    Canned ACL used when creating buckets and storing or copying objects.

    -

    This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.

    -

    For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

    -

    Note that this ACL is applied when server-side copying objects as S3 doesn't copy the ACL from the source but rather writes a fresh one.

    -

    If the acl is an empty string then no X-Amz-Acl: header is added and the default (private) will be used.

    -

    Properties:

    -
      -
    • Config: acl
    • -
    • Env Var: RCLONE_S3_ACL
    • -
    • Provider: !Storj,Cloudflare
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "default" -
          -
        • Owner gets Full_CONTROL.
        • -
        • No one else has access rights (default).
        • -
      • -
      • "private" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • No one else has access rights (default).
        • -
      • -
      • "public-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ access.
        • -
      • -
      • "public-read-write" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ and WRITE access.
        • -
        • Granting this on a bucket is generally not recommended.
        • -
      • -
      • "authenticated-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AuthenticatedUsers group gets READ access.
        • -
      • -
      • "bucket-owner-read" -
          -
        • Object owner gets FULL_CONTROL.
        • -
        • Bucket owner gets READ access.
        • -
        • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
        • -
      • -
      • "bucket-owner-full-control" -
          -
        • Both the object owner and the bucket owner get FULL_CONTROL over the object.
        • -
        • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
        • -
      • -
      • "private" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • No one else has access rights (default).
        • -
        • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS.
        • -
      • -
      • "public-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ access.
        • -
        • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS.
        • -
      • -
      • "public-read-write" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ and WRITE access.
        • -
        • This acl is available on IBM Cloud (Infra), On-Premise IBM COS.
        • -
      • -
      • "authenticated-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AuthenticatedUsers group gets READ access.
        • -
        • Not supported on Buckets.
        • -
        • This acl is available on IBM Cloud (Infra) and On-Premise IBM COS.
        • -
      • -
    • -
    -

    --s3-server-side-encryption

    -

    The server-side encryption algorithm used when storing this object in S3.

    -

    Properties:

    -
      -
    • Config: server_side_encryption
    • -
    • Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
      • "AES256" -
          -
        • AES256
        • -
      • -
      • "aws:kms" -
          -
        • aws:kms
        • -
      • -
    • -
    -

    --s3-sse-kms-key-id

    -

    If using KMS ID you must provide the ARN of Key.

    -

    Properties:

    -
      -
    • Config: sse_kms_key_id
    • -
    • Env Var: RCLONE_S3_SSE_KMS_KEY_ID
    • -
    • Provider: AWS,Ceph,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
      • "arn:aws:kms:us-east-1:*" -
          -
        • arn:aws:kms:*
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in S3.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: AWS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "REDUCED_REDUNDANCY" -
          -
        • Reduced redundancy storage class
        • -
      • -
      • "STANDARD_IA" -
          -
        • Standard Infrequent Access storage class
        • -
      • -
      • "ONEZONE_IA" -
          -
        • One Zone Infrequent Access storage class
        • -
      • -
      • "GLACIER" -
          -
        • Glacier storage class
        • -
      • -
      • "DEEP_ARCHIVE" -
          -
        • Glacier Deep Archive storage class
        • -
      • -
      • "INTELLIGENT_TIERING" -
          -
        • Intelligent-Tiering storage class
        • -
      • -
      • "GLACIER_IR" -
          -
        • Glacier Instant Retrieval storage class
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in OSS.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Alibaba
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "GLACIER" -
          -
        • Archive storage mode
        • -
      • -
      • "STANDARD_IA" -
          -
        • Infrequent access storage mode
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in ChinaMobile.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: ChinaMobile
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "GLACIER" -
          -
        • Archive storage mode
        • -
      • -
      • "STANDARD_IA" -
          -
        • Infrequent access storage mode
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in Liara

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Liara
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in ArvanCloud.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: ArvanCloud
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in Tencent COS.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: TencentCOS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "ARCHIVE" -
          -
        • Archive storage mode
        • -
      • -
      • "STANDARD_IA" -
          -
        • Infrequent access storage mode
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in S3.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Scaleway
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default.
        • -
      • -
      • "STANDARD" -
          -
        • The Standard class for any upload.
        • -
        • Suitable for on-demand content like streaming or CDN.
        • -
      • -
      • "GLACIER" -
          -
        • Archived storage.
        • -
        • Prices are lower, but it needs to be restored first to be accessed.
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in Qiniu.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Qiniu
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "LINE" -
          -
        • Infrequent access storage mode
        • -
      • -
      • "GLACIER" -
          -
        • Archive storage mode
        • -
      • -
      • "DEEP_ARCHIVE" -
          -
        • Deep archive storage mode
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi).

    -

    --s3-bucket-acl

    -

    Canned ACL used when creating buckets.

    -

    For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

    -

    Note that this ACL is applied when only when creating buckets. If it isn't set then "acl" is used instead.

    -

    If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: header is added and the default (private) will be used.

    -

    Properties:

    -
      -
    • Config: bucket_acl
    • -
    • Env Var: RCLONE_S3_BUCKET_ACL
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "private" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • No one else has access rights (default).
        • -
      • -
      • "public-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ access.
        • -
      • -
      • "public-read-write" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ and WRITE access.
        • -
        • Granting this on a bucket is generally not recommended.
        • -
      • -
      • "authenticated-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AuthenticatedUsers group gets READ access.
        • -
      • -
    • -
    -

    --s3-requester-pays

    -

    Enables requester pays option when interacting with S3 bucket.

    -

    Properties:

    -
      -
    • Config: requester_pays
    • -
    • Env Var: RCLONE_S3_REQUESTER_PAYS
    • -
    • Provider: AWS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-sse-customer-algorithm

    -

    If using SSE-C, the server-side encryption algorithm used when storing this object in S3.

    -

    Properties:

    -
      -
    • Config: sse_customer_algorithm
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
      • "AES256" -
          -
        • AES256
        • -
      • -
    • -
    -

    --s3-sse-customer-key

    -

    To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data.

    -

    Alternatively you can provide --sse-customer-key-base64.

    -

    Properties:

    -
      -
    • Config: sse_customer_key
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
    • -
    -

    --s3-sse-customer-key-base64

    -

    If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data.

    -

    Alternatively you can provide --sse-customer-key.

    -

    Properties:

    -
      -
    • Config: sse_customer_key_base64
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
    • -
    -

    --s3-sse-customer-key-md5

    -

    If using SSE-C you may provide the secret encryption key MD5 checksum (optional).

    -

    If you leave it blank, this is calculated automatically from the sse_customer_key provided.

    -

    Properties:

    -
      -
    • Config: sse_customer_key_md5
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
    • -
    -

    --s3-upload-cutoff

    -

    Cutoff for switching to chunked upload.

    -

    Any files larger than this will be uploaded in chunks of chunk_size. The minimum is 0 and the maximum is 5 GiB.

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_S3_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 200Mi
    • -
    -

    --s3-chunk-size

    -

    Chunk size to use for uploading.

    -

    When uploading files larger than upload_cutoff or files with unknown size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google photos or google docs) they will be uploaded as multipart uploads using this chunk size.

    -

    Note that "--s3-upload-concurrency" chunks of this size are buffered in memory per transfer.

    -

    If you are transferring large files over high-speed links and you have enough memory, then increasing this will speed up the transfers.

    -

    Rclone will automatically increase the chunk size when uploading a large file of known size to stay below the 10,000 chunks limit.

    -

    Files of unknown size are uploaded with the configured chunk_size. Since the default chunk size is 5 MiB and there can be at most 10,000 chunks, this means that by default the maximum size of a file you can stream upload is 48 GiB. If you wish to stream upload larger files then you will need to increase chunk_size.

    -

    Increasing the chunk size decreases the accuracy of the progress statistics displayed with "-P" flag. Rclone treats chunk as sent when it's buffered by the AWS SDK, when in fact it may still be uploading. A bigger chunk size means a bigger AWS SDK buffer and progress reporting more deviating from the truth.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_S3_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 5Mi
    • -
    -

    --s3-max-upload-parts

    -

    Maximum number of parts in a multipart upload.

    -

    This option defines the maximum number of multipart chunks to use when doing a multipart upload.

    -

    This can be useful if a service does not support the AWS S3 specification of 10,000 chunks.

    -

    Rclone will automatically increase the chunk size when uploading a large file of a known size to stay below this number of chunks limit.

    -

    Properties:

    -
      -
    • Config: max_upload_parts
    • -
    • Env Var: RCLONE_S3_MAX_UPLOAD_PARTS
    • -
    • Type: int
    • -
    • Default: 10000
    • -
    -

    --s3-copy-cutoff

    -

    Cutoff for switching to multipart copy.

    -

    Any files larger than this that need to be server-side copied will be copied in chunks of this size.

    -

    The minimum is 0 and the maximum is 5 GiB.

    -

    Properties:

    -
      -
    • Config: copy_cutoff
    • -
    • Env Var: RCLONE_S3_COPY_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 4.656Gi
    • -
    -

    --s3-disable-checksum

    -

    Don't store MD5 checksum with object metadata.

    -

    Normally rclone will calculate the MD5 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

    -

    Properties:

    -
      -
    • Config: disable_checksum
    • -
    • Env Var: RCLONE_S3_DISABLE_CHECKSUM
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-shared-credentials-file

    -

    Path to the shared credentials file.

    -

    If env_auth = true then rclone can use a shared credentials file.

    -

    If this variable is empty rclone will look for the "AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty it will default to the current user's home directory.

    -
    Linux/OSX: "$HOME/.aws/credentials"
    -Windows:   "%USERPROFILE%\.aws\credentials"
    -

    Properties:

    -
      -
    • Config: shared_credentials_file
    • -
    • Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-profile

    -

    Profile to use in the shared credentials file.

    -

    If env_auth = true then rclone can use a shared credentials file. This variable controls which profile is used in that file.

    -

    If empty it will default to the environment variable "AWS_PROFILE" or "default" if that environment variable is also not set.

    -

    Properties:

    -
      -
    • Config: profile
    • -
    • Env Var: RCLONE_S3_PROFILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-session-token

    -

    An AWS session token.

    -

    Properties:

    -
      -
    • Config: session_token
    • -
    • Env Var: RCLONE_S3_SESSION_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-upload-concurrency

    -

    Concurrency for multipart uploads.

    -

    This is the number of chunks of the same file that are uploaded concurrently.

    -

    If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

    -

    Properties:

    -
      -
    • Config: upload_concurrency
    • -
    • Env Var: RCLONE_S3_UPLOAD_CONCURRENCY
    • -
    • Type: int
    • -
    • Default: 4
    • -
    -

    --s3-force-path-style

    -

    If true use path style access if false use virtual hosted style.

    -

    If this is true (the default) then rclone will use path style access, if false then rclone will use virtual path style. See the AWS S3 docs for more info.

    -

    Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to false - rclone will do this automatically based on the provider setting.

    -

    Properties:

    -
      -
    • Config: force_path_style
    • -
    • Env Var: RCLONE_S3_FORCE_PATH_STYLE
    • -
    • Type: bool
    • -
    • Default: true
    • -
    -

    --s3-v2-auth

    -

    If true use v2 authentication.

    -

    If this is false (the default) then rclone will use v4 authentication. If it is set then rclone will use v2 authentication.

    -

    Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH.

    -

    Properties:

    -
      -
    • Config: v2_auth
    • -
    • Env Var: RCLONE_S3_V2_AUTH
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-use-accelerate-endpoint

    -

    If true use the AWS S3 accelerated endpoint.

    -

    See: AWS S3 Transfer acceleration

    -

    Properties:

    -
      -
    • Config: use_accelerate_endpoint
    • -
    • Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT
    • -
    • Provider: AWS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-leave-parts-on-error

    -

    If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery.

    -

    It should be set to true for resuming uploads across different sessions.

    -

    WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up.

    -

    Properties:

    -
      -
    • Config: leave_parts_on_error
    • -
    • Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR
    • -
    • Provider: AWS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-list-chunk

    -

    Size of listing chunk (response list for each ListObject S3 request).

    -

    This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. Most services truncate the response list to 1000 objects even if requested more than that. In AWS S3 this is a global maximum and cannot be changed, see AWS S3. In Ceph, this can be increased with the "rgw list buckets max chunk" option.

    -

    Properties:

    -
      -
    • Config: list_chunk
    • -
    • Env Var: RCLONE_S3_LIST_CHUNK
    • -
    • Type: int
    • -
    • Default: 1000
    • -
    -

    --s3-list-version

    -

    Version of ListObjects to use: 1,2 or 0 for auto.

    -

    When S3 originally launched it only provided the ListObjects call to enumerate objects in a bucket.

    -

    However in May 2016 the ListObjectsV2 call was introduced. This is much higher performance and should be used if at all possible.

    -

    If set to the default, 0, rclone will guess according to the provider set which list objects method to call. If it guesses wrong, then it may be set manually here.

    -

    Properties:

    -
      -
    • Config: list_version
    • -
    • Env Var: RCLONE_S3_LIST_VERSION
    • -
    • Type: int
    • -
    • Default: 0
    • -
    -

    --s3-list-url-encode

    -

    Whether to url encode listings: true/false/unset

    -

    Some providers support URL encoding listings and where this is available this is more reliable when using control characters in file names. If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

    -

    Properties:

    -
      -
    • Config: list_url_encode
    • -
    • Env Var: RCLONE_S3_LIST_URL_ENCODE
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-no-check-bucket

    -

    If set, don't attempt to check the bucket exists or create it.

    -

    This can be useful when trying to minimise the number of transactions rclone does if you know the bucket exists already.

    -

    It can also be needed if the user you are using does not have bucket creation permissions. Before v1.52.0 this would have passed silently due to a bug.

    -

    Properties:

    -
      -
    • Config: no_check_bucket
    • -
    • Env Var: RCLONE_S3_NO_CHECK_BUCKET
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-no-head

    -

    If set, don't HEAD uploaded objects to check integrity.

    -

    This can be useful when trying to minimise the number of transactions rclone does.

    -

    Setting it means that if rclone receives a 200 OK message after uploading an object with PUT then it will assume that it got uploaded properly.

    -

    In particular it will assume:

    -
      -
    • the metadata, including modtime, storage class and content type was as uploaded
    • -
    • the size was as uploaded
    • -
    -

    It reads the following items from the response for a single part PUT:

    -
      -
    • the MD5SUM
    • -
    • The uploaded date
    • -
    -

    For multipart uploads these items aren't read.

    -

    If an source object of unknown length is uploaded then rclone will do a HEAD request.

    -

    Setting this flag increases the chance for undetected upload failures, in particular an incorrect size, so it isn't recommended for normal operation. In practice the chance of an undetected upload failure is very small even with this flag.

    -

    Properties:

    -
      -
    • Config: no_head
    • -
    • Env Var: RCLONE_S3_NO_HEAD
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-no-head-object

    -

    If set, do not do HEAD before GET when getting objects.

    -

    Properties:

    -
      -
    • Config: no_head_object
    • -
    • Env Var: RCLONE_S3_NO_HEAD_OBJECT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_S3_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,InvalidUtf8,Dot
    • -
    -

    --s3-memory-pool-flush-time

    -

    How often internal memory buffer pools will be flushed.

    -

    Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. This option controls how often unused buffers will be removed from the pool.

    -

    Properties:

    -
      -
    • Config: memory_pool_flush_time
    • -
    • Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --s3-memory-pool-use-mmap

    -

    Whether to use mmap buffers in internal memory pool.

    -

    Properties:

    -
      -
    • Config: memory_pool_use_mmap
    • -
    • Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-disable-http2

    -

    Disable usage of http2 for S3 backends.

    -

    There is currently an unsolved issue with the s3 (specifically minio) backend and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be disabled here. When the issue is solved this flag will be removed.

    -

    See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631

    -

    Properties:

    -
      -
    • Config: disable_http2
    • -
    • Env Var: RCLONE_S3_DISABLE_HTTP2
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-download-url

    -

    Custom endpoint for downloads. This is usually set to a CloudFront CDN URL as AWS S3 offers cheaper egress for data downloaded through the CloudFront network.

    -

    Properties:

    -
      -
    • Config: download_url
    • -
    • Env Var: RCLONE_S3_DOWNLOAD_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-use-multipart-etag

    -

    Whether to use ETag in multipart uploads for verification

    -

    This should be true, false or left unset to use the default for the provider.

    -

    Properties:

    -
      -
    • Config: use_multipart_etag
    • -
    • Env Var: RCLONE_S3_USE_MULTIPART_ETAG
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-use-presigned-request

    -

    Whether to use a presigned request or PutObject for single part uploads

    -

    If this is false rclone will use PutObject from the AWS SDK to upload an object.

    -

    Versions of rclone < 1.59 use presigned requests to upload a single part object and setting this flag to true will re-enable that functionality. This shouldn't be necessary except in exceptional circumstances or for testing.

    -

    Properties:

    -
      -
    • Config: use_presigned_request
    • -
    • Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-versions

    -

    Include old versions in directory listings.

    -

    Properties:

    -
      -
    • Config: versions
    • -
    • Env Var: RCLONE_S3_VERSIONS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-version-at

    -

    Show file versions as they were at the specified time.

    -

    The parameter should be a date, "2006-01-02", datetime "2006-01-02 15:04:05" or a duration for that long ago, eg "100d" or "1h".

    -

    Note that when using this no file write operations are permitted, so you can't upload files or delete them.

    -

    See the time option docs for valid formats.

    -

    Properties:

    -
      -
    • Config: version_at
    • -
    • Env Var: RCLONE_S3_VERSION_AT
    • -
    • Type: Time
    • -
    • Default: off
    • -
    -

    --s3-decompress

    -

    If set this will decompress gzip encoded objects.

    -

    It is possible to upload objects to S3 with "Content-Encoding: gzip" set. Normally rclone will download these files as compressed objects.

    -

    If this flag is set then rclone will decompress these files with "Content-Encoding: gzip" as they are received. This means that rclone can't check the size and hash but the file contents will be decompressed.

    -

    Properties:

    -
      -
    • Config: decompress
    • -
    • Env Var: RCLONE_S3_DECOMPRESS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-might-gzip

    -

    Set this if the backend might gzip objects.

    -

    Normally providers will not alter objects when they are downloaded. If an object was not uploaded with Content-Encoding: gzip then it won't be set on download.

    -

    However some providers may gzip objects even if they weren't uploaded with Content-Encoding: gzip (eg Cloudflare).

    -

    A symptom of this would be receiving errors like

    -
    ERROR corrupted on transfer: sizes differ NNN vs MMM
    -

    If you set this flag and rclone downloads an object with Content-Encoding: gzip set and chunked transfer encoding, then rclone will decompress the object on the fly.

    -

    If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

    -

    Properties:

    -
      -
    • Config: might_gzip
    • -
    • Env Var: RCLONE_S3_MIGHT_GZIP
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-no-system-metadata

    -

    Suppress setting and reading of system metadata

    -

    Properties:

    -
      -
    • Config: no_system_metadata
    • -
    • Env Var: RCLONE_S3_NO_SYSTEM_METADATA
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-sts-endpoint

    -

    Endpoint for STS.

    -

    Leave blank if using AWS to use the default endpoint for the region.

    -

    Properties:

    -
      -
    • Config: sts_endpoint
    • -
    • Env Var: RCLONE_S3_STS_ENDPOINT
    • -
    • Provider: AWS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Metadata

    -

    User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case.

    -

    Here are the possible system metadata items for the s3 backend.

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameHelpTypeExampleRead Only
    btimeTime of file birth (creation) read from Last-Modified headerRFC 33392006-01-02T15:04:05.999999999Z07:00Y
    cache-controlCache-Control headerstringno-cacheN
    content-dispositionContent-Disposition headerstringinlineN
    content-encodingContent-Encoding headerstringgzipN
    content-languageContent-Language headerstringen-USN
    content-typeContent-Type headerstringtext/plainN
    mtimeTime of last modification, read from rclone metadataRFC 33392006-01-02T15:04:05.999999999Z07:00N
    tierTier of the objectstringGLACIERY
    -

    See the metadata docs for more info.

    -

    Backend commands

    -

    Here are the commands specific to the s3 backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    restore

    -

    Restore objects from GLACIER to normal storage

    -
    rclone backend restore remote: [options] [<arguments>+]
    -

    This command can be used to restore one or more objects from GLACIER to normal storage.

    -

    Usage Examples:

    -
    rclone backend restore s3:bucket/path/to/object [-o priority=PRIORITY] [-o lifetime=DAYS]
    -rclone backend restore s3:bucket/path/to/directory [-o priority=PRIORITY] [-o lifetime=DAYS]
    -rclone backend restore s3:bucket [-o priority=PRIORITY] [-o lifetime=DAYS]
    -

    This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags

    -
    rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard
    -

    All the objects shown will be marked for restore, then

    -
    rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard
    -

    It returns a list of status dictionaries with Remote and Status keys. The Status will be OK if it was successful or an error message if not.

    -
    [
    -    {
    -        "Status": "OK",
    -        "Path": "test.txt"
    -    },
    -    {
    -        "Status": "OK",
    -        "Path": "test/file4.txt"
    -    }
    -]
    -

    Options:

    -
      -
    • "description": The optional description for the job.
    • -
    • "lifetime": Lifetime of the active copy in days
    • -
    • "priority": Priority of restore: Standard|Expedited|Bulk
    • -
    -

    list-multipart-uploads

    -

    List the unfinished multipart uploads

    -
    rclone backend list-multipart-uploads remote: [options] [<arguments>+]
    -

    This command lists the unfinished multipart uploads in JSON format.

    -
    rclone backend list-multipart s3:bucket/path/to/object
    -

    It returns a dictionary of buckets with values as lists of unfinished multipart uploads.

    -

    You can call it with no bucket in which case it lists all bucket, with a bucket or with a bucket and path.

    -
    {
    -  "rclone": [
    -    {
    -      "Initiated": "2020-06-26T14:20:36Z",
    -      "Initiator": {
    -        "DisplayName": "XXX",
    -        "ID": "arn:aws:iam::XXX:user/XXX"
    -      },
    -      "Key": "KEY",
    -      "Owner": {
    -        "DisplayName": null,
    -        "ID": "XXX"
    -      },
    -      "StorageClass": "STANDARD",
    -      "UploadId": "XXX"
    -    }
    -  ],
    -  "rclone-1000files": [],
    -  "rclone-dst": []
    -}
    -

    cleanup

    -

    Remove unfinished multipart uploads.

    -
    rclone backend cleanup remote: [options] [<arguments>+]
    -

    This command removes unfinished multipart uploads of age greater than max-age which defaults to 24 hours.

    -

    Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

    -
    rclone backend cleanup s3:bucket/path/to/object
    -rclone backend cleanup -o max-age=7w s3:bucket/path/to/object
    -

    Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.

    -

    Options:

    -
      -
    • "max-age": Max age of upload to delete
    • -
    -

    cleanup-hidden

    -

    Remove old versions of files.

    -
    rclone backend cleanup-hidden remote: [options] [<arguments>+]
    -

    This command removes any old hidden versions of files on a versions enabled bucket.

    -

    Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

    -
    rclone backend cleanup-hidden s3:bucket/path/to/dir
    -

    versioning

    -

    Set/get versioning support for a bucket.

    -
    rclone backend versioning remote: [options] [<arguments>+]
    -

    This command sets versioning support if a parameter is passed and then returns the current versioning status for the bucket supplied.

    -
    rclone backend versioning s3:bucket # read status only
    -rclone backend versioning s3:bucket Enabled
    -rclone backend versioning s3:bucket Suspended
    -

    It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning has been enabled the status can't be set back to "Unversioned".

    -

    Anonymous access to public buckets

    -

    If you want to use rclone to access a public bucket, configure with a blank access_key_id and secret_access_key. Your config should end up looking like this:

    -
    [anons3]
    -type = s3
    -provider = AWS
    -env_auth = false
    -access_key_id =
    -secret_access_key =
    -region = us-east-1
    -endpoint =
    -location_constraint =
    -acl = private
    -server_side_encryption =
    -storage_class =
    -

    Then use it as normal with the name of the public bucket, e.g.

    -
    rclone lsd anons3:1000genomes
    -

    You will be able to list and copy data but not upload it.

    -

    Providers

    -

    AWS S3

    -

    This is the provider used as main example and described in the configuration section above.

    -

    AWS Snowball Edge

    -

    AWS Snowball is a hardware appliance used for transferring bulk data back to AWS. Its main software interface is S3 object storage.

    -

    To use rclone with AWS Snowball Edge devices, configure as standard for an 'S3 Compatible Service'.

    -

    If using rclone pre v1.59 be sure to set upload_cutoff = 0 otherwise you will run into authentication header issues as the snowball device does not support query parameter based authentication.

    -

    With rclone v1.59 or later setting upload_cutoff should not be necessary.

    -

    eg.

    -
    [snowball]
    -type = s3
    -provider = Other
    -access_key_id = YOUR_ACCESS_KEY
    -secret_access_key = YOUR_SECRET_KEY
    -endpoint = http://[IP of Snowball]:8080
    -upload_cutoff = 0
    -

    Ceph

    -

    Ceph is an open-source, unified, distributed storage system designed for excellent performance, reliability and scalability. It has an S3 compatible object storage interface.

    -

    To use rclone with Ceph, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    -
    [ceph]
    -type = s3
    -provider = Ceph
    -env_auth = false
    -access_key_id = XXX
    -secret_access_key = YYY
    -region =
    -endpoint = https://ceph.endpoint.example.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a version of rclone before v1.59 then you may need to supply the parameter --s3-upload-cutoff 0 or put this in the config file as upload_cutoff 0 to work around a bug which causes uploading of small files to fail.

    -

    Note also that Ceph sometimes puts / in the passwords it gives users. If you read the secret access key using the command line tools you will get a JSON blob with the / escaped as \/. Make sure you only write / in the secret access key.

    -

    Eg the dump from Ceph looks something like this (irrelevant keys removed).

    -
    {
    -    "user_id": "xxx",
    -    "display_name": "xxxx",
    -    "keys": [
    -        {
    -            "user": "xxx",
    -            "access_key": "xxxxxx",
    -            "secret_key": "xxxxxx\/xxxx"
    -        }
    -    ],
    -}
    -

    Because this is a json dump, it is encoding the / as \/, so if you use the secret key as xxxxxx/xxxx it will work fine.

    -

    Cloudflare R2

    -

    Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.

    -

    Here is an example of making a Cloudflare R2 configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -

    Note that all buckets are private, and all are stored in the same "auto" region. It is necessary to use Cloudflare workers to share the content of a bucket publicly.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> r2
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -...
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
    -   \ (s3)
    -...
    -Storage> s3
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -...
    -XX / Cloudflare R2 Storage
    -   \ (Cloudflare)
    -...
    -provider> Cloudflare
    -Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth> 1
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> ACCESS_KEY
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> SECRET_ACCESS_KEY
    -Option region.
    -Region to connect to.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency.
    -   \ (auto)
    -region> 1
    -Option endpoint.
    -Endpoint for S3 API.
    -Required when using an S3 clone.
    -Enter a value. Press Enter to leave empty.
    -endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave your config looking something like:

    -
    [r2]
    -type = s3
    -provider = Cloudflare
    -access_key_id = ACCESS_KEY
    -secret_access_key = SECRET_ACCESS_KEY
    -region = auto
    -endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com
    -acl = private
    -

    Now run rclone lsf r2: to see your buckets and rclone lsf r2:bucket to look within a bucket.

    -

    Dreamhost

    -

    Dreamhost DreamObjects is an object storage system based on CEPH.

    -

    To use rclone with Dreamhost, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    -
    [dreamobjects]
    -type = s3
    -provider = DreamHost
    -env_auth = false
    -access_key_id = your_access_key
    -secret_access_key = your_secret_key
    -region =
    -endpoint = objects-us-west-1.dream.io
    -location_constraint =
    -acl = private
    -server_side_encryption =
    -storage_class =
    -

    DigitalOcean Spaces

    -

    Spaces is an S3-interoperable object storage service from cloud provider DigitalOcean.

    -

    To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "Applications & API" page of the DigitalOcean control panel. They will be needed when prompted by rclone config for your access_key_id and secret_access_key.

    -

    When prompted for a region or location_constraint, press enter to use the default value. The region must be included in the endpoint setting (e.g. nyc3.digitaloceanspaces.com). The default values can be used for other settings.

    -

    Going through the whole process of creating a new remote by running rclone config, each prompt should be answered as shown below:

    -
    Storage> s3
    -env_auth> 1
    -access_key_id> YOUR_ACCESS_KEY
    -secret_access_key> YOUR_SECRET_KEY
    -region>
    -endpoint> nyc3.digitaloceanspaces.com
    -location_constraint>
    -acl>
    -storage_class>
    -

    The resulting configuration file should look like:

    -
    [spaces]
    -type = s3
    -provider = DigitalOcean
    -env_auth = false
    -access_key_id = YOUR_ACCESS_KEY
    -secret_access_key = YOUR_SECRET_KEY
    -region =
    -endpoint = nyc3.digitaloceanspaces.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    Once configured, you can create a new Space and begin copying files. For example:

    -
    rclone mkdir spaces:my-new-space
    -rclone copy /path/to/files spaces:my-new-space
    -

    Huawei OBS

    -

    Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere.

    -

    OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file.

    -
    [obs]
    -type = s3
    -provider = HuaweiOBS
    -access_key_id = your-access-key-id
    -secret_access_key = your-secret-access-key
    -region = af-south-1
    -endpoint = obs.af-south-1.myhuaweicloud.com
    -acl = private
    -

    Or you can also configure via the interactive command line:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> obs
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> 5
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    - 9 / Huawei Object Storage Service
    -   \ (HuaweiOBS)
    -[snip]
    -provider> 9
    -Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth> 1
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> your-access-key-id
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> your-secret-access-key
    -Option region.
    -Region to connect to.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / AF-Johannesburg
    -   \ (af-south-1)
    - 2 / AP-Bangkok
    -   \ (ap-southeast-2)
    -[snip]
    -region> 1
    -Option endpoint.
    -Endpoint for OBS API.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / AF-Johannesburg
    -   \ (obs.af-south-1.myhuaweicloud.com)
    - 2 / AP-Bangkok
    -   \ (obs.ap-southeast-2.myhuaweicloud.com)
    -[snip]
    -endpoint> 1
    -Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -[snip]
    -acl> 1
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n>
    ---------------------
    -[obs]
    -type = s3
    -provider = HuaweiOBS
    -access_key_id = your-access-key-id
    -secret_access_key = your-secret-access-key
    -region = af-south-1
    -endpoint = obs.af-south-1.myhuaweicloud.com
    -acl = private
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    -
    -Name                 Type
    -====                 ====
    -obs                  s3
    -
    -e) Edit existing remote
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> q
    -

    IBM COS (S3)

    -

    Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage)

    -

    To configure access to IBM COS S3, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
        2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults
    -    No remotes found, make a new one?
    -    n) New remote
    -    s) Set configuration password
    -    q) Quit config
    -    n/s/q> n
    -
      -
    1. Enter the name for the configuration
    2. -
    -
        name> <YOUR NAME>
    -
      -
    1. Select "s3" storage.
    2. -
    -
    Choose a number from below, or type in your own value
    -    1 / Alias for an existing remote
    -    \ "alias"
    -    2 / Amazon Drive
    -    \ "amazon cloud drive"
    -    3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS)
    -    \ "s3"
    -    4 / Backblaze B2
    -    \ "b2"
    -[snip]
    -    23 / HTTP
    -    \ "http"
    -Storage> 3
    -
      -
    1. Select IBM COS as the S3 Storage Provider.
    2. -
    -
    Choose the S3 provider.
    -Choose a number from below, or type in your own value
    -     1 / Choose this option to configure Storage to AWS S3
    -       \ "AWS"
    -     2 / Choose this option to configure Storage to Ceph Systems
    -     \ "Ceph"
    -     3 /  Choose this option to configure Storage to Dreamhost
    -     \ "Dreamhost"
    -   4 / Choose this option to the configure Storage to IBM COS S3
    -     \ "IBMCOS"
    -     5 / Choose this option to the configure Storage to Minio
    -     \ "Minio"
    -     Provider>4
    -
      -
    1. Enter the Access Key and Secret.
    2. -
    -
        AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    -    access_key_id> <>
    -    AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -    secret_access_key> <>
    -
      -
    1. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address.
    2. -
    -
        Endpoint for IBM COS S3 API.
    -    Specify if using an IBM COS On Premise.
    -    Choose a number from below, or type in your own value
    -     1 / US Cross Region Endpoint
    -       \ "s3-api.us-geo.objectstorage.softlayer.net"
    -     2 / US Cross Region Dallas Endpoint
    -       \ "s3-api.dal.us-geo.objectstorage.softlayer.net"
    -     3 / US Cross Region Washington DC Endpoint
    -       \ "s3-api.wdc-us-geo.objectstorage.softlayer.net"
    -     4 / US Cross Region San Jose Endpoint
    -       \ "s3-api.sjc-us-geo.objectstorage.softlayer.net"
    -     5 / US Cross Region Private Endpoint
    -       \ "s3-api.us-geo.objectstorage.service.networklayer.com"
    -     6 / US Cross Region Dallas Private Endpoint
    -       \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com"
    -     7 / US Cross Region Washington DC Private Endpoint
    -       \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com"
    -     8 / US Cross Region San Jose Private Endpoint
    -       \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com"
    -     9 / US Region East Endpoint
    -       \ "s3.us-east.objectstorage.softlayer.net"
    -    10 / US Region East Private Endpoint
    -       \ "s3.us-east.objectstorage.service.networklayer.com"
    -    11 / US Region South Endpoint
    -[snip]
    -    34 / Toronto Single Site Private Endpoint
    -       \ "s3.tor01.objectstorage.service.networklayer.com"
    -    endpoint>1
    -
      -
    1. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter
    2. -
    -
         1 / US Cross Region Standard
    -       \ "us-standard"
    -     2 / US Cross Region Vault
    -       \ "us-vault"
    -     3 / US Cross Region Cold
    -       \ "us-cold"
    -     4 / US Cross Region Flex
    -       \ "us-flex"
    -     5 / US East Region Standard
    -       \ "us-east-standard"
    -     6 / US East Region Vault
    -       \ "us-east-vault"
    -     7 / US East Region Cold
    -       \ "us-east-cold"
    -     8 / US East Region Flex
    -       \ "us-east-flex"
    -     9 / US South Region Standard
    -       \ "us-south-standard"
    -    10 / US South Region Vault
    -       \ "us-south-vault"
    -[snip]
    -    32 / Toronto Flex
    -       \ "tor01-flex"
    -location_constraint>1
    -
      -
    1. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs.
    2. -
    -
    Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    -      1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS
    -      \ "private"
    -      2  / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS
    -      \ "public-read"
    -      3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS
    -      \ "public-read-write"
    -      4  / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS
    -      \ "authenticated-read"
    -acl> 1
    -
      -
    1. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this
    2. -
    -
        [xxx]
    -    type = s3
    -    Provider = IBMCOS
    -    access_key_id = xxx
    -    secret_access_key = yyy
    -    endpoint = s3-api.us-geo.objectstorage.softlayer.net
    -    location_constraint = us-standard
    -    acl = private
    -
      -
    1. Execute rclone commands
    2. -
    -
        1)  Create a bucket.
    -        rclone mkdir IBM-COS-XREGION:newbucket
    -    2)  List available buckets.
    -        rclone lsd IBM-COS-XREGION:
    -        -1 2017-11-08 21:16:22        -1 test
    -        -1 2018-02-14 20:16:39        -1 newbucket
    -    3)  List contents of a bucket.
    -        rclone ls IBM-COS-XREGION:newbucket
    -        18685952 test.exe
    -    4)  Copy a file from local to remote.
    -        rclone copy /Users/file.txt IBM-COS-XREGION:newbucket
    -    5)  Copy a file from remote to local.
    -        rclone copy IBM-COS-XREGION:newbucket/file.txt .
    -    6)  Delete a file on remote.
    -        rclone delete IBM-COS-XREGION:newbucket/file.txt
    -

    IDrive e2

    -

    Here is an example of making an IDrive e2 configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -
    -Enter name for new remote.
    -name> e2
    -
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    -
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    -XX / IDrive e2
    -   \ (IDrive)
    -[snip]
    -provider> IDrive
    -
    -Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth> 
    -
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> YOUR_ACCESS_KEY
    -
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> YOUR_SECRET_KEY
    -
    -Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -   / Owner gets FULL_CONTROL.
    - 3 | The AllUsers group gets READ and WRITE access.
    -   | Granting this on a bucket is generally not recommended.
    -   \ (public-read-write)
    -   / Owner gets FULL_CONTROL.
    - 4 | The AuthenticatedUsers group gets READ access.
    -   \ (authenticated-read)
    -   / Object owner gets FULL_CONTROL.
    - 5 | Bucket owner gets READ access.
    -   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    -   \ (bucket-owner-read)
    -   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
    - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    -   \ (bucket-owner-full-control)
    -acl> 
    -
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> 
    -
    -Configuration complete.
    -Options:
    -- type: s3
    -- provider: IDrive
    -- access_key_id: YOUR_ACCESS_KEY
    -- secret_access_key: YOUR_SECRET_KEY
    -- endpoint: q9d9.la12.idrivee2-5.com
    -Keep this "e2" remote?
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    IONOS Cloud

    -

    IONOS S3 Object Storage is a service offered by IONOS for storing and accessing unstructured data. To connect to the service, you will need an access key and a secret key. These can be found in the Data Center Designer, by selecting Manager resources > Object Storage Key Manager.

    -

    Here is an example of a configuration. First, run rclone config. This will walk you through an interactive setup process. Type n to add the new remote, and then enter a name:

    -
    Enter name for new remote.
    -name> ionos-fra
    -

    Type s3 to choose the connection type:

    -
    Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    -

    Type IONOS:

    -
    Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    -XX / IONOS Cloud
    -   \ (IONOS)
    -[snip]
    -provider> IONOS
    -

    Press Enter to choose the default option Enter AWS credentials in the next step:

    -
    Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth>
    -

    Enter your Access Key and Secret key. These can be retrieved in the Data Center Designer, click on the menu “Manager resources” / "Object Storage Key Manager".

    -
    Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> YOUR_ACCESS_KEY
    -
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> YOUR_SECRET_KEY
    -

    Choose the region where your bucket is located:

    -
    Option region.
    -Region where your bucket will be created and your data stored.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Frankfurt, Germany
    -   \ (de)
    - 2 / Berlin, Germany
    -   \ (eu-central-2)
    - 3 / Logrono, Spain
    -   \ (eu-south-2)
    -region> 2
    -

    Choose the endpoint from the same region:

    -
    Option endpoint.
    -Endpoint for IONOS S3 Object Storage.
    -Specify the endpoint from the same region.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Frankfurt, Germany
    -   \ (s3-eu-central-1.ionoscloud.com)
    - 2 / Berlin, Germany
    -   \ (s3-eu-central-2.ionoscloud.com)
    - 3 / Logrono, Spain
    -   \ (s3-eu-south-2.ionoscloud.com)
    -endpoint> 1
    -

    Press Enter to choose the default option or choose the desired ACL setting:

    -
    Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    -[snip]
    -acl>
    -

    Press Enter to skip the advanced config:

    -
    Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n>
    -

    Press Enter to save the configuration, and then q to quit the configuration process:

    -
    Configuration complete.
    -Options:
    -- type: s3
    -- provider: IONOS
    -- access_key_id: YOUR_ACCESS_KEY
    -- secret_access_key: YOUR_SECRET_KEY
    -- endpoint: s3-eu-central-1.ionoscloud.com
    -Keep this "ionos-fra" remote?
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Done! Now you can try some commands (for macOS, use ./rclone instead of rclone).

    -
      -
    1. Create a bucket (the name must be unique within the whole IONOS S3)
    2. -
    -
    rclone mkdir ionos-fra:my-bucket
    -
      -
    1. List available buckets
    2. -
    -
    rclone lsd ionos-fra:
    -
      -
    1. Copy a file from local to remote
    2. -
    -
    rclone copy /Users/file.txt ionos-fra:my-bucket
    -
      -
    1. List contents of a bucket
    2. -
    -
    rclone ls ionos-fra:my-bucket
    -
      -
    1. Copy a file from remote to local
    2. -
    -
    rclone copy ionos-fra:my-bucket/file.txt
    -

    Minio

    -

    Minio is an object storage server built for cloud application developers and devops.

    -

    It is very easy to install and provides an S3 compatible server which can be used by rclone.

    -

    To use it, install Minio following the instructions here.

    -

    When it configures itself Minio will print something like this

    -
    Endpoint:  http://192.168.1.106:9000  http://172.23.0.1:9000
    -AccessKey: USWUXHGYZQYFYFFIT3RE
    -SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -Region:    us-east-1
    -SQS ARNs:  arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis
    -
    -Browser Access:
    -   http://192.168.1.106:9000  http://172.23.0.1:9000
    -
    -Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
    -   $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -
    -Object API (Amazon S3 compatible):
    -   Go:         https://docs.minio.io/docs/golang-client-quickstart-guide
    -   Java:       https://docs.minio.io/docs/java-client-quickstart-guide
    -   Python:     https://docs.minio.io/docs/python-client-quickstart-guide
    -   JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
    -   .NET:       https://docs.minio.io/docs/dotnet-client-quickstart-guide
    -
    -Drive Capacity: 26 GiB Free, 165 GiB Total
    -

    These details need to go into rclone config like this. Note that it is important to put the region in as stated above.

    -
    env_auth> 1
    -access_key_id> USWUXHGYZQYFYFFIT3RE
    -secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -region> us-east-1
    -endpoint> http://192.168.1.106:9000
    -location_constraint>
    -server_side_encryption>
    -

    Which makes the config file look like this

    -
    [minio]
    -type = s3
    -provider = Minio
    -env_auth = false
    -access_key_id = USWUXHGYZQYFYFFIT3RE
    -secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -region = us-east-1
    -endpoint = http://192.168.1.106:9000
    -location_constraint =
    -server_side_encryption =
    -

    So once set up, for example, to copy files into a bucket

    -
    rclone copy /path/to/files minio:bucket
    -

    Qiniu Cloud Object Storage (Kodo)

    -

    Qiniu Cloud Object Storage (Kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management.

    -

    To configure access to Qiniu Kodo, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
    rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -
      -
    1. Give the name of the configuration. For example, name it 'qiniu'.
    2. -
    -
    name> qiniu
    -
      -
    1. Select s3 storage.
    2. -
    -
    Choose a number from below, or type in your own value
    - 1 / 1Fichier
    -   \ (fichier)
    - 2 / Akamai NetStorage
    -   \ (netstorage)
    - 3 / Alias for an existing remote
    -   \ (alias)
    - 4 / Amazon Drive
    -   \ (amazon cloud drive)
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    -
      -
    1. Select Qiniu provider.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    -[snip]
    -22 / Qiniu Object Storage (Kodo)
    -   \ (Qiniu)
    -[snip]
    -provider> Qiniu
    -
      -
    1. Enter your SecretId and SecretKey of Qiniu Kodo.
    2. -
    -
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -Choose a number from below, or type in your own value
    - 1 / Enter AWS credentials in the next step
    -   \ "false"
    - 2 / Get AWS credentials from the environment (env vars or IAM)
    -   \ "true"
    -env_auth> 1
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> AKIDxxxxxxxxxx
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> xxxxxxxxxxx
    -
      -
    1. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region.
    2. -
    -
       / The default endpoint - a good choice if you are unsure.
    - 1 | East China Region 1.
    -   | Needs location constraint cn-east-1.
    -   \ (cn-east-1)
    -   / East China Region 2.
    - 2 | Needs location constraint cn-east-2.
    -   \ (cn-east-2)
    -   / North China Region 1.
    - 3 | Needs location constraint cn-north-1.
    -   \ (cn-north-1)
    -   / South China Region 1.
    - 4 | Needs location constraint cn-south-1.
    -   \ (cn-south-1)
    -   / North America Region.
    - 5 | Needs location constraint us-north-1.
    -   \ (us-north-1)
    -   / Southeast Asia Region 1.
    - 6 | Needs location constraint ap-southeast-1.
    -   \ (ap-southeast-1)
    -   / Northeast Asia Region 1.
    - 7 | Needs location constraint ap-northeast-1.
    -   \ (ap-northeast-1)
    -[snip]
    -endpoint> 1
    -
    -Option endpoint.
    -Endpoint for Qiniu Object Storage.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / East China Endpoint 1
    -   \ (s3-cn-east-1.qiniucs.com)
    - 2 / East China Endpoint 2
    -   \ (s3-cn-east-2.qiniucs.com)
    - 3 / North China Endpoint 1
    -   \ (s3-cn-north-1.qiniucs.com)
    - 4 / South China Endpoint 1
    -   \ (s3-cn-south-1.qiniucs.com)
    - 5 / North America Endpoint 1
    -   \ (s3-us-north-1.qiniucs.com)
    - 6 / Southeast Asia Endpoint 1
    -   \ (s3-ap-southeast-1.qiniucs.com)
    - 7 / Northeast Asia Endpoint 1
    -   \ (s3-ap-northeast-1.qiniucs.com)
    -endpoint> 1
    -
    -Option location_constraint.
    -Location constraint - must be set to match the Region.
    -Used when creating buckets only.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / East China Region 1
    -   \ (cn-east-1)
    - 2 / East China Region 2
    -   \ (cn-east-2)
    - 3 / North China Region 1
    -   \ (cn-north-1)
    - 4 / South China Region 1
    -   \ (cn-south-1)
    - 5 / North America Region 1
    -   \ (us-north-1)
    - 6 / Southeast Asia Region 1
    -   \ (ap-southeast-1)
    - 7 / Northeast Asia Region 1
    -   \ (ap-northeast-1)
    -location_constraint> 1
    -
      -
    1. Choose acl and storage class.
    2. -
    -
    Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -[snip]
    -acl> 2
    -The storage class to use when storing new objects in Tencent COS.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Standard storage class
    -   \ (STANDARD)
    - 2 / Infrequent access storage mode
    -   \ (LINE)
    - 3 / Archive storage mode
    -   \ (GLACIER)
    - 4 / Deep archive storage mode
    -   \ (DEEP_ARCHIVE)
    -[snip]
    -storage_class> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[qiniu]
    -- type: s3
    -- provider: Qiniu
    -- access_key_id: xxx
    -- secret_access_key: xxx
    -- region: cn-east-1
    -- endpoint: s3-cn-east-1.qiniucs.com
    -- location_constraint: cn-east-1
    -- acl: public-read
    -- storage_class: STANDARD
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    -
    -Name                 Type
    -====                 ====
    -qiniu                s3
    -

    RackCorp

    -

    RackCorp Object Storage is an S3 compatible object storage platform from your friendly cloud provider RackCorp. The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty.

    -

    Before you can use RackCorp Object Storage, you'll need to "sign up" for an account on our "portal". Next you can create an access key, a secret key and buckets, in your location of choice with ease. These details are required for the next steps of configuration, when rclone config asks for your access_key_id and secret_access_key.

    -

    Your config should end up looking a bit like this:

    -
    [RCS3-demo-config]
    -type = s3
    -provider = RackCorp
    -env_auth = true
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region = au-nsw
    -endpoint = s3.rackcorp.com
    -location_constraint = au-nsw
    -

    Scaleway

    -

    Scaleway The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool.

    -

    Scaleway provides an S3 interface which can be configured for use with rclone like this:

    -
    [scaleway]
    -type = s3
    -provider = Scaleway
    -env_auth = false
    -endpoint = s3.nl-ams.scw.cloud
    -access_key_id = SCWXXXXXXXXXXXXXX
    -secret_access_key = 1111111-2222-3333-44444-55555555555555
    -region = nl-ams
    -location_constraint =
    -acl = private
    -server_side_encryption =
    -storage_class =
    -

    C14 Cold Storage is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" storage_class. So you can configure your remote with the storage_class = GLACIER option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above)

    -

    Seagate Lyve Cloud

    -

    Seagate Lyve Cloud is an S3 compatible object storage platform from Seagate intended for enterprise use.

    -

    Here is a config run through for a remote called remote - you may choose a different name of course. Note that to create an access key and secret key you will need to create a service account first.

    -
    $ rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -

    Choose s3 backend

    -
    Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    -   \ (s3)
    -[snip]
    -Storage> s3
    -

    Choose LyveCloud as S3 provider

    -
    Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    -XX / Seagate Lyve Cloud
    -   \ (LyveCloud)
    -[snip]
    -provider> LyveCloud
    -

    Take the default (just press enter) to enter access key and secret in the config file.

    -
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth>
    -
    AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> XXX
    -
    AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> YYY
    -

    Leave region blank

    -
    Region to connect to.
    -Leave blank if you are using an S3 clone and you don't have a region.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Use this if unsure.
    - 1 | Will use v4 signatures and an empty region.
    -   \ ()
    -   / Use this only if v4 signatures don't work.
    - 2 | E.g. pre Jewel/v10 CEPH.
    -   \ (other-v2-signature)
    -region>
    -

    Choose an endpoint from the list

    -
    Endpoint for S3 API.
    -Required when using an S3 clone.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Seagate Lyve Cloud US East 1 (Virginia)
    -   \ (s3.us-east-1.lyvecloud.seagate.com)
    - 2 / Seagate Lyve Cloud US West 1 (California)
    -   \ (s3.us-west-1.lyvecloud.seagate.com)
    - 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore)
    -   \ (s3.ap-southeast-1.lyvecloud.seagate.com)
    -endpoint> 1
    -

    Leave location constraint blank

    -
    Location constraint - must be set to match the Region.
    -Leave blank if not sure. Used when creating buckets only.
    -Enter a value. Press Enter to leave empty.
    -location_constraint>
    -

    Choose default ACL (private).

    -
    Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -[snip]
    -acl>
    -

    And the config file should end up looking like this:

    -
    [remote]
    -type = s3
    -provider = LyveCloud
    -access_key_id = XXX
    -secret_access_key = YYY
    -endpoint = s3.us-east-1.lyvecloud.seagate.com
    -

    SeaweedFS

    -

    SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. It has an S3 compatible object storage interface. SeaweedFS can also act as a gateway to remote S3 compatible object store to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost.

    -

    Assuming the SeaweedFS are configured with weed shell as such:

    -
    > s3.bucket.create -name foo
    -> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply
    -{
    -  "identities": [
    -    {
    -      "name": "me",
    -      "credentials": [
    -        {
    -          "accessKey": "any",
    -          "secretKey": "any"
    -        }
    -      ],
    -      "actions": [
    -        "Read:foo",
    -        "Write:foo",
    -        "List:foo",
    -        "Tagging:foo",
    -        "Admin:foo"
    -      ]
    -    }
    -  ]
    -}
    -

    To use rclone with SeaweedFS, above configuration should end up with something like this in your config:

    -
    [seaweedfs_s3]
    -type = s3
    -provider = SeaweedFS
    -access_key_id = any
    -secret_access_key = any
    -endpoint = localhost:8333
    -

    So once set up, for example to copy files into a bucket

    -
    rclone copy /path/to/files seaweedfs_s3:foo
    -

    Wasabi

    -

    Wasabi is a cloud-based object storage service for a broad range of applications and use cases. Wasabi is designed for individuals and organizations that require a high-performance, reliable, and secure data storage infrastructure at minimal cost.

    -

    Wasabi provides an S3 interface which can be configured for use with rclone like this.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -n/s> n
    -name> wasabi
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara)
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own value
    - 1 / Enter AWS credentials in the next step
    -   \ "false"
    - 2 / Get AWS credentials from the environment (env vars or IAM)
    -   \ "true"
    -env_auth> 1
    -AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    -access_key_id> YOURACCESSKEY
    -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -secret_access_key> YOURSECRETACCESSKEY
    -Region to connect to.
    -Choose a number from below, or type in your own value
    -   / The default endpoint - a good choice if you are unsure.
    - 1 | US Region, Northern Virginia, or Pacific Northwest.
    -   | Leave location constraint empty.
    -   \ "us-east-1"
    -[snip]
    -region> us-east-1
    -Endpoint for S3 API.
    -Leave blank if using AWS to use the default endpoint for the region.
    -Specify if using an S3 clone such as Ceph.
    -endpoint> s3.wasabisys.com
    -Location constraint - must be set to match the Region. Used when creating buckets only.
    -Choose a number from below, or type in your own value
    - 1 / Empty for US Region, Northern Virginia, or Pacific Northwest.
    -   \ ""
    -[snip]
    -location_constraint>
    -Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    -[snip]
    -acl>
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value
    - 1 / None
    -   \ ""
    - 2 / AES256
    -   \ "AES256"
    -server_side_encryption>
    -The storage class to use when storing objects in S3.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    - 3 / Reduced redundancy storage class
    -   \ "REDUCED_REDUNDANCY"
    - 4 / Standard Infrequent Access storage class
    -   \ "STANDARD_IA"
    -storage_class>
    -Remote config
    ---------------------
    -[wasabi]
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region = us-east-1
    -endpoint = s3.wasabisys.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave the config file looking like this.

    -
    [wasabi]
    -type = s3
    -provider = Wasabi
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region =
    -endpoint = s3.wasabisys.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    Alibaba OSS

    -

    Here is an example of making an Alibaba Cloud (Aliyun) OSS configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> oss
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Choose your S3 provider.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    - 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
    -   \ "Alibaba"
    - 3 / Ceph Object Storage
    -   \ "Ceph"
    -[snip]
    -provider> Alibaba
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -Choose a number from below, or type in your own value
    - 1 / Enter AWS credentials in the next step
    -   \ "false"
    - 2 / Get AWS credentials from the environment (env vars or IAM)
    -   \ "true"
    -env_auth> 1
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> accesskeyid
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> secretaccesskey
    -Endpoint for OSS API.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / East China 1 (Hangzhou)
    -   \ "oss-cn-hangzhou.aliyuncs.com"
    - 2 / East China 2 (Shanghai)
    -   \ "oss-cn-shanghai.aliyuncs.com"
    - 3 / North China 1 (Qingdao)
    -   \ "oss-cn-qingdao.aliyuncs.com"
    -[snip]
    -endpoint> 1
    -Canned ACL used when creating buckets and storing or copying objects.
    -
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access.
    -   \ "public-read"
    -   / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access.
    -[snip]
    -acl> 1
    -The storage class to use when storing new objects in OSS.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    - 3 / Archive storage mode.
    -   \ "GLACIER"
    - 4 / Infrequent access storage mode.
    -   \ "STANDARD_IA"
    -storage_class> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    ---------------------
    -[oss]
    -type = s3
    -provider = Alibaba
    -env_auth = false
    -access_key_id = accesskeyid
    -secret_access_key = secretaccesskey
    -endpoint = oss-cn-hangzhou.aliyuncs.com
    -acl = private
    -storage_class = Standard
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    China Mobile Ecloud Elastic Object Storage (EOS)

    -

    Here is an example of making an China Mobile Ecloud Elastic Object Storage (EOS) configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> ChinaMobile
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    - ...
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    -   \ (s3)
    - ...
    -Storage> s3
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - ...
    - 4 / China Mobile Ecloud Elastic Object Storage (EOS)
    -   \ (ChinaMobile)
    - ...
    -provider> ChinaMobile
    -Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth>
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> accesskeyid
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> secretaccesskey
    -Option endpoint.
    -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / The default endpoint - a good choice if you are unsure.
    - 1 | East China (Suzhou)
    -   \ (eos-wuxi-1.cmecloud.cn)
    - 2 / East China (Jinan)
    -   \ (eos-jinan-1.cmecloud.cn)
    - 3 / East China (Hangzhou)
    -   \ (eos-ningbo-1.cmecloud.cn)
    - 4 / East China (Shanghai-1)
    -   \ (eos-shanghai-1.cmecloud.cn)
    - 5 / Central China (Zhengzhou)
    -   \ (eos-zhengzhou-1.cmecloud.cn)
    - 6 / Central China (Changsha-1)
    -   \ (eos-hunan-1.cmecloud.cn)
    - 7 / Central China (Changsha-2)
    -   \ (eos-zhuzhou-1.cmecloud.cn)
    - 8 / South China (Guangzhou-2)
    -   \ (eos-guangzhou-1.cmecloud.cn)
    - 9 / South China (Guangzhou-3)
    -   \ (eos-dongguan-1.cmecloud.cn)
    -10 / North China (Beijing-1)
    -   \ (eos-beijing-1.cmecloud.cn)
    -11 / North China (Beijing-2)
    -   \ (eos-beijing-2.cmecloud.cn)
    -12 / North China (Beijing-3)
    -   \ (eos-beijing-4.cmecloud.cn)
    -13 / North China (Huhehaote)
    -   \ (eos-huhehaote-1.cmecloud.cn)
    -14 / Southwest China (Chengdu)
    -   \ (eos-chengdu-1.cmecloud.cn)
    -15 / Southwest China (Chongqing)
    -   \ (eos-chongqing-1.cmecloud.cn)
    -16 / Southwest China (Guiyang)
    -   \ (eos-guiyang-1.cmecloud.cn)
    -17 / Nouthwest China (Xian)
    -   \ (eos-xian-1.cmecloud.cn)
    -18 / Yunnan China (Kunming)
    -   \ (eos-yunnan.cmecloud.cn)
    -19 / Yunnan China (Kunming-2)
    -   \ (eos-yunnan-2.cmecloud.cn)
    -20 / Tianjin China (Tianjin)
    -   \ (eos-tianjin-1.cmecloud.cn)
    -21 / Jilin China (Changchun)
    -   \ (eos-jilin-1.cmecloud.cn)
    -22 / Hubei China (Xiangyan)
    -   \ (eos-hubei-1.cmecloud.cn)
    -23 / Jiangxi China (Nanchang)
    -   \ (eos-jiangxi-1.cmecloud.cn)
    -24 / Gansu China (Lanzhou)
    -   \ (eos-gansu-1.cmecloud.cn)
    -25 / Shanxi China (Taiyuan)
    -   \ (eos-shanxi-1.cmecloud.cn)
    -26 / Liaoning China (Shenyang)
    -   \ (eos-liaoning-1.cmecloud.cn)
    -27 / Hebei China (Shijiazhuang)
    -   \ (eos-hebei-1.cmecloud.cn)
    -28 / Fujian China (Xiamen)
    -   \ (eos-fujian-1.cmecloud.cn)
    -29 / Guangxi China (Nanning)
    -   \ (eos-guangxi-1.cmecloud.cn)
    -30 / Anhui China (Huainan)
    -   \ (eos-anhui-1.cmecloud.cn)
    -endpoint> 1
    -Option location_constraint.
    -Location constraint - must match endpoint.
    -Used when creating buckets only.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / East China (Suzhou)
    -   \ (wuxi1)
    - 2 / East China (Jinan)
    -   \ (jinan1)
    - 3 / East China (Hangzhou)
    -   \ (ningbo1)
    - 4 / East China (Shanghai-1)
    -   \ (shanghai1)
    - 5 / Central China (Zhengzhou)
    -   \ (zhengzhou1)
    - 6 / Central China (Changsha-1)
    -   \ (hunan1)
    - 7 / Central China (Changsha-2)
    -   \ (zhuzhou1)
    - 8 / South China (Guangzhou-2)
    -   \ (guangzhou1)
    - 9 / South China (Guangzhou-3)
    -   \ (dongguan1)
    -10 / North China (Beijing-1)
    -   \ (beijing1)
    -11 / North China (Beijing-2)
    -   \ (beijing2)
    -12 / North China (Beijing-3)
    -   \ (beijing4)
    -13 / North China (Huhehaote)
    -   \ (huhehaote1)
    -14 / Southwest China (Chengdu)
    -   \ (chengdu1)
    -15 / Southwest China (Chongqing)
    -   \ (chongqing1)
    -16 / Southwest China (Guiyang)
    -   \ (guiyang1)
    -17 / Nouthwest China (Xian)
    -   \ (xian1)
    -18 / Yunnan China (Kunming)
    -   \ (yunnan)
    -19 / Yunnan China (Kunming-2)
    -   \ (yunnan2)
    -20 / Tianjin China (Tianjin)
    -   \ (tianjin1)
    -21 / Jilin China (Changchun)
    -   \ (jilin1)
    -22 / Hubei China (Xiangyan)
    -   \ (hubei1)
    -23 / Jiangxi China (Nanchang)
    -   \ (jiangxi1)
    -24 / Gansu China (Lanzhou)
    -   \ (gansu1)
    -25 / Shanxi China (Taiyuan)
    -   \ (shanxi1)
    -26 / Liaoning China (Shenyang)
    -   \ (liaoning1)
    -27 / Hebei China (Shijiazhuang)
    -   \ (hebei1)
    -28 / Fujian China (Xiamen)
    -   \ (fujian1)
    -29 / Guangxi China (Nanning)
    -   \ (guangxi1)
    -30 / Anhui China (Huainan)
    -   \ (anhui1)
    -location_constraint> 1
    -Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -   / Owner gets FULL_CONTROL.
    - 3 | The AllUsers group gets READ and WRITE access.
    -   | Granting this on a bucket is generally not recommended.
    -   \ (public-read-write)
    -   / Owner gets FULL_CONTROL.
    - 4 | The AuthenticatedUsers group gets READ access.
    -   \ (authenticated-read)
    -   / Object owner gets FULL_CONTROL.
    -acl> private
    -Option server_side_encryption.
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / None
    -   \ ()
    - 2 / AES256
    -   \ (AES256)
    -server_side_encryption>
    -Option storage_class.
    -The storage class to use when storing new objects in ChinaMobile.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Default
    -   \ ()
    - 2 / Standard storage class
    -   \ (STANDARD)
    - 3 / Archive storage mode
    -   \ (GLACIER)
    - 4 / Infrequent access storage mode
    -   \ (STANDARD_IA)
    -storage_class>
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    ---------------------
    -[ChinaMobile]
    -type = s3
    -provider = ChinaMobile
    -access_key_id = accesskeyid
    -secret_access_key = secretaccesskey
    -endpoint = eos-wuxi-1.cmecloud.cn
    -location_constraint = wuxi1
    -acl = private
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Liara

    -

    Here is an example of making a Liara Object Storage configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -n/s> n
    -name> Liara
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own value
    - 1 / Enter AWS credentials in the next step
    -   \ "false"
    - 2 / Get AWS credentials from the environment (env vars or IAM)
    -   \ "true"
    -env_auth> 1
    -AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    -access_key_id> YOURACCESSKEY
    -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -secret_access_key> YOURSECRETACCESSKEY
    -Region to connect to.
    -Choose a number from below, or type in your own value
    -   / The default endpoint
    - 1 | US Region, Northern Virginia, or Pacific Northwest.
    -   | Leave location constraint empty.
    -   \ "us-east-1"
    -[snip]
    -region>
    -Endpoint for S3 API.
    -Leave blank if using Liara to use the default endpoint for the region.
    -Specify if using an S3 clone such as Ceph.
    -endpoint> storage.iran.liara.space
    -Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    -[snip]
    -acl>
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value
    - 1 / None
    -   \ ""
    - 2 / AES256
    -   \ "AES256"
    -server_side_encryption>
    -The storage class to use when storing objects in S3.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    -storage_class>
    -Remote config
    ---------------------
    -[Liara]
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -endpoint = storage.iran.liara.space
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave the config file looking like this.

    -
    [Liara]
    -type = s3
    -provider = Liara
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region =
    -endpoint = storage.iran.liara.space
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    ArvanCloud

    -

    ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional file storage. It gives you access to backup and archived files and allows sharing. Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service.

    -

    ArvanCloud provides an S3 interface which can be configured for use with rclone like this.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -n/s> n
    -name> ArvanCloud
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own value
    - 1 / Enter AWS credentials in the next step
    -   \ "false"
    - 2 / Get AWS credentials from the environment (env vars or IAM)
    -   \ "true"
    -env_auth> 1
    -AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    -access_key_id> YOURACCESSKEY
    -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -secret_access_key> YOURSECRETACCESSKEY
    -Region to connect to.
    -Choose a number from below, or type in your own value
    -   / The default endpoint - a good choice if you are unsure.
    - 1 | US Region, Northern Virginia, or Pacific Northwest.
    -   | Leave location constraint empty.
    -   \ "us-east-1"
    -[snip]
    -region> 
    -Endpoint for S3 API.
    -Leave blank if using ArvanCloud to use the default endpoint for the region.
    -Specify if using an S3 clone such as Ceph.
    -endpoint> s3.arvanstorage.com
    -Location constraint - must be set to match the Region. Used when creating buckets only.
    -Choose a number from below, or type in your own value
    - 1 / Empty for Iran-Tehran Region.
    -   \ ""
    -[snip]
    -location_constraint>
    -Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    -[snip]
    -acl>
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value
    - 1 / None
    -   \ ""
    - 2 / AES256
    -   \ "AES256"
    -server_side_encryption>
    -The storage class to use when storing objects in S3.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    -storage_class>
    -Remote config
    ---------------------
    -[ArvanCloud]
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region = ir-thr-at1
    -endpoint = s3.arvanstorage.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave the config file looking like this.

    -
    [ArvanCloud]
    -type = s3
    -provider = ArvanCloud
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region =
    -endpoint = s3.arvanstorage.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    Tencent COS

    -

    Tencent Cloud Object Storage (COS) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost.

    -

    To configure access to Tencent COS, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
    rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -
      -
    1. Give the name of the configuration. For example, name it 'cos'.
    2. -
    -
    name> cos
    -
      -
    1. Select s3 storage.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / 1Fichier
    -   \ "fichier"
    - 2 / Alias for an existing remote
    -   \ "alias"
    - 3 / Amazon Drive
    -   \ "amazon cloud drive"
    - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    -   \ "s3"
    -[snip]
    -Storage> s3
    -
      -
    1. Select TencentCOS provider.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    -[snip]
    -11 / Tencent Cloud Object Storage (COS)
    -   \ "TencentCOS"
    -[snip]
    -provider> TencentCOS
    -
      -
    1. Enter your SecretId and SecretKey of Tencent Cloud.
    2. -
    -
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -Choose a number from below, or type in your own value
    - 1 / Enter AWS credentials in the next step
    -   \ "false"
    - 2 / Get AWS credentials from the environment (env vars or IAM)
    -   \ "true"
    -env_auth> 1
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> AKIDxxxxxxxxxx
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> xxxxxxxxxxx
    -
      -
    1. Select endpoint for Tencent COS. This is the standard endpoint for different region.
    2. -
    -
     1 / Beijing Region.
    -   \ "cos.ap-beijing.myqcloud.com"
    - 2 / Nanjing Region.
    -   \ "cos.ap-nanjing.myqcloud.com"
    - 3 / Shanghai Region.
    -   \ "cos.ap-shanghai.myqcloud.com"
    - 4 / Guangzhou Region.
    -   \ "cos.ap-guangzhou.myqcloud.com"
    -[snip]
    -endpoint> 4
    -
      -
    1. Choose acl and storage class.
    2. -
    -
    Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Owner gets Full_CONTROL. No one else has access rights (default).
    -   \ "default"
    -[snip]
    -acl> 1
    -The storage class to use when storing new objects in Tencent COS.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    -[snip]
    -storage_class> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[cos]
    -type = s3
    -provider = TencentCOS
    -env_auth = false
    -access_key_id = xxx
    -secret_access_key = xxx
    -endpoint = cos.ap-guangzhou.myqcloud.com
    -acl = default
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    -
    -Name                 Type
    -====                 ====
    -cos                  s3
    -

    Netease NOS

    -

    For Netease NOS configure as per the configurator rclone config setting the provider Netease. This will automatically set force_path_style = false which is necessary for it to run properly.

    -

    Storj

    -

    Storj is a decentralized cloud storage which can be used through its native protocol or an S3 compatible gateway.

    -

    The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Storj. Here is an example run of the configurator.

    -
    Type of storage to configure.
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Choose a number from below, or type in your own boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth> 1
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> XXXX (as shown when creating the access grant)
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> XXXX (as shown when creating the access grant)
    -Option endpoint.
    -Endpoint of the Shared Gateway.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / EU1 Shared Gateway
    -   \ (gateway.eu1.storjshare.io)
    - 2 / US1 Shared Gateway
    -   \ (gateway.us1.storjshare.io)
    - 3 / Asia-Pacific Shared Gateway
    -   \ (gateway.ap1.storjshare.io)
    -endpoint> 1 (as shown when creating the access grant)
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    -

    Note that s3 credentials are generated when you create an access grant.

    -

    Backend quirks

    -
      -
    • --chunk-size is forced to be 64 MiB or greater. This will use more memory than the default of 5 MiB.
    • -
    • Server side copy is disabled as it isn't currently supported in the gateway.
    • -
    • GetTier and SetTier are not supported.
    • -
    -

    Backend bugs

    -

    Due to issue #39 uploading multipart files via the S3 gateway causes them to lose their metadata. For rclone's purpose this means that the modification time is not stored, nor is any MD5SUM (if one is available from the source).

    -

    This has the following consequences:

    -
      -
    • Using rclone rcat will fail as the medatada doesn't match after upload
    • -
    • Uploading files with rclone mount will fail for the same reason -
        -
      • This can worked around by using --vfs-cache-mode writes or --vfs-cache-mode full or setting --s3-upload-cutoff large
      • -
    • -
    • Files uploaded via a multipart upload won't have their modtimes -
        -
      • This will mean that rclone sync will likely keep trying to upload files bigger than --s3-upload-cutoff
      • -
      • This can be worked around with --checksum or --size-only or setting --s3-upload-cutoff large
      • -
      • The maximum value for --s3-upload-cutoff is 5GiB though
      • -
    • -
    -

    One general purpose workaround is to set --s3-upload-cutoff 5G. This means that rclone will upload files smaller than 5GiB as single parts. Note that this can be set in the config file with upload_cutoff = 5G or configured in the advanced settings. If you regularly transfer files larger than 5G then using --checksum or --size-only in rclone sync is the recommended workaround.

    -

    Comparison with the native protocol

    -

    Use the the native protocol to take advantage of client-side encryption as well as to achieve the best possible download performance. Uploads will be erasure-coded locally, thus a 1gb upload will result in 2.68gb of data being uploaded to storage nodes across the network.

    -

    Use this backend and the S3 compatible Hosted Gateway to increase upload performance and reduce the load on your systems and network. Uploads will be encrypted and erasure-coded server-side, thus a 1GB upload will result in only in 1GB of data being uploaded to storage nodes across the network.

    -

    For more detailed comparison please check the documentation of the storj backend.

    -

    Limitations

    -

    rclone about is not supported by the S3 backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Backblaze B2

    -

    B2 is Backblaze's cloud storage system.

    -

    Paths are specified as remote:bucket (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:bucket/path/to/dir.

    -

    Configuration

    -

    Here is an example of making a b2 configuration. First run

    -
    rclone config
    -

    This will guide you through an interactive setup process. To authenticate you will either need your Account ID (a short hex number) and Master Application Key (a long hex number) OR an Application Key, which is the recommended method. See below for further details on generating and using an Application Key.

    -
    No remotes found, make a new one?
    -n) New remote
    -q) Quit config
    -n/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Backblaze B2
    -   \ "b2"
    -[snip]
    -Storage> b2
    -Account ID or Application Key ID
    -account> 123456789abc
    -Application Key
    -key> 0123456789abcdef0123456789abcdef0123456789
    -Endpoint for the service - leave blank normally.
    -endpoint>
    -Remote config
    ---------------------
    -[remote]
    -account = 123456789abc
    -key = 0123456789abcdef0123456789abcdef0123456789
    -endpoint =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This remote is called remote and can now be used like this

    -

    See all buckets

    -
    rclone lsd remote:
    -

    Create a new bucket

    -
    rclone mkdir remote:bucket
    -

    List the contents of a bucket

    -
    rclone ls remote:bucket
    -

    Sync /home/local/directory to the remote bucket, deleting any excess files in the bucket.

    -
    rclone sync --interactive /home/local/directory remote:bucket
    -

    Application Keys

    -

    B2 supports multiple Application Keys for different access permission to B2 Buckets.

    -

    You can use these with rclone too; you will need to use rclone version 1.43 or later.

    -

    Follow Backblaze's docs to create an Application Key with the required permission and add the applicationKeyId as the account and the Application Key itself as the key.

    -

    Note that you must put the applicationKeyId as the account – you can't use the master Account ID. If you try then B2 will return 401 errors.

    -

    --fast-list

    -

    This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

    -

    Modified time

    -

    The modified time is stored as metadata on the object as X-Bz-Info-src_last_modified_millis as milliseconds since 1970-01-01 in the Backblaze standard. Other tools should be able to use this as a modified time.

    -

    Modified times are used in syncing and are fully supported. Note that if a modification time needs to be updated on an object then it will create a new version of the object.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    \0x5C
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Note that in 2020-05 Backblaze started allowing  characters in file names. Rclone hasn't changed its encoding as this could cause syncs to re-transfer files. If you want rclone not to replace  then see the --b2-encoding flag below and remove the BackSlash from the string. This can be set in the config.

    -

    SHA1 checksums

    -

    The SHA1 checksums of the files are checked on upload and download and will be used in the syncing process.

    -

    Large files (bigger than the limit in --b2-upload-cutoff) which are uploaded in chunks will store their SHA1 on the object as X-Bz-Info-large_file_sha1 as recommended by Backblaze.

    -

    For a large file to be uploaded with an SHA1 checksum, the source needs to support SHA1 checksums. The local disk supports SHA1 checksums so large file transfers from local disk will have an SHA1. See the overview for exactly which remotes support SHA1.

    -

    Sources which don't support SHA1, in particular crypt will upload large files without SHA1 checksums. This may be fixed in the future (see #1767).

    -

    Files sizes below --b2-upload-cutoff will always have an SHA1 regardless of the source.

    -

    Transfers

    -

    Backblaze recommends that you do lots of transfers simultaneously for maximum speed. In tests from my SSD equipped laptop the optimum setting is about --transfers 32 though higher numbers may be used for a slight speed improvement. The optimum number for you may vary depending on your hardware, how big the files are, how much you want to load your computer, etc. The default of --transfers 4 is definitely too low for Backblaze B2 though.

    -

    Note that uploading big files (bigger than 200 MiB by default) will use a 96 MiB RAM buffer by default. There can be at most --transfers of these in use at any moment, so this sets the upper limit on the memory used.

    -

    Versions

    -

    When rclone uploads a new version of a file it creates a new version of it. Likewise when you delete a file, the old version will be marked hidden and still be available. Conversely, you may opt in to a "hard delete" of files with the --b2-hard-delete flag which would permanently remove the file instead of hiding it.

    -

    Old versions of files, where available, are visible using the --b2-versions flag.

    -

    It is also possible to view a bucket as it was at a certain point in time, using the --b2-version-at flag. This will show the file versions as they were at that time, showing files that have been deleted afterwards, and hiding files that were created since.

    -

    If you wish to remove all the old versions then you can use the rclone cleanup remote:bucket command which will delete all the old versions of files, leaving the current ones intact. You can also supply a path and only old versions under that path will be deleted, e.g. rclone cleanup remote:bucket/path/to/stuff.

    -

    Note that cleanup will remove partially uploaded files from the bucket if they are more than a day old.

    -

    When you purge a bucket, the current and the old versions will be deleted then the bucket will be deleted.

    -

    However delete will cause the current versions of the files to become hidden old versions.

    -

    Here is a session showing the listing and retrieval of an old version followed by a cleanup of the old versions.

    -

    Show current version and all the versions with --b2-versions flag.

    -
    $ rclone -q ls b2:cleanup-test
    -        9 one.txt
    -
    -$ rclone -q --b2-versions ls b2:cleanup-test
    -        9 one.txt
    -        8 one-v2016-07-04-141032-000.txt
    -       16 one-v2016-07-04-141003-000.txt
    -       15 one-v2016-07-02-155621-000.txt
    -

    Retrieve an old version

    -
    $ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp
    -
    -$ ls -l /tmp/one-v2016-07-04-141003-000.txt
    --rw-rw-r-- 1 ncw ncw 16 Jul  2 17:46 /tmp/one-v2016-07-04-141003-000.txt
    -

    Clean up all the old versions and show that they've gone.

    -
    $ rclone -q cleanup b2:cleanup-test
    -
    -$ rclone -q ls b2:cleanup-test
    -        9 one.txt
    -
    -$ rclone -q --b2-versions ls b2:cleanup-test
    -        9 one.txt
    -

    Data usage

    -

    It is useful to know how many requests are sent to the server in different scenarios.

    -

    All copy commands send the following 4 requests:

    -
    /b2api/v1/b2_authorize_account
    -/b2api/v1/b2_create_bucket
    -/b2api/v1/b2_list_buckets
    -/b2api/v1/b2_list_file_names
    -

    The b2_list_file_names request will be sent once for every 1k files in the remote path, providing the checksum and modification time of the listed files. As of version 1.33 issue #818 causes extra requests to be sent when using B2 with Crypt. When a copy operation does not require any files to be uploaded, no more requests will be sent.

    -

    Uploading files that do not require chunking, will send 2 requests per file upload:

    -
    /b2api/v1/b2_get_upload_url
    -/b2api/v1/b2_upload_file/
    -

    Uploading files requiring chunking, will send 2 requests (one each to start and finish the upload) and another 2 requests for each chunk:

    -
    /b2api/v1/b2_start_large_file
    -/b2api/v1/b2_get_upload_part_url
    -/b2api/v1/b2_upload_part/
    -/b2api/v1/b2_finish_large_file
    -

    Versions

    -

    Versions can be viewed with the --b2-versions flag. When it is set rclone will show and act on older versions of files. For example

    -

    Listing without --b2-versions

    -
    $ rclone -q ls b2:cleanup-test
    -        9 one.txt
    -

    And with

    -
    $ rclone -q --b2-versions ls b2:cleanup-test
    -        9 one.txt
    -        8 one-v2016-07-04-141032-000.txt
    -       16 one-v2016-07-04-141003-000.txt
    -       15 one-v2016-07-02-155621-000.txt
    -

    Showing that the current version is unchanged but older versions can be seen. These have the UTC date that they were uploaded to the server to the nearest millisecond appended to them.

    -

    Note that when using --b2-versions no file write operations are permitted, so you can't upload files or delete them.

    - -

    Rclone supports generating file share links for private B2 buckets. They can either be for a file for example:

    -
    ./rclone link B2:bucket/path/to/file.txt
    -https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx
    -
    -

    or if run on a directory you will get:

    -
    ./rclone link B2:bucket/path
    -https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx
    -

    you can then use the authorization token (the part of the url from the ?Authorization= on) on any file path under that directory. For example:

    -
    https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx
    -https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx
    -https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx
    -
    -

    Standard options

    -

    Here are the Standard options specific to b2 (Backblaze B2).

    -

    --b2-account

    -

    Account ID or Application Key ID.

    -

    Properties:

    -
      -
    • Config: account
    • -
    • Env Var: RCLONE_B2_ACCOUNT
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --b2-key

    -

    Application Key.

    -

    Properties:

    -
      -
    • Config: key
    • -
    • Env Var: RCLONE_B2_KEY
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --b2-hard-delete

    -

    Permanently delete files on remote removal, otherwise hide files.

    -

    Properties:

    -
      -
    • Config: hard_delete
    • -
    • Env Var: RCLONE_B2_HARD_DELETE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to b2 (Backblaze B2).

    -

    --b2-endpoint

    -

    Endpoint for the service.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_B2_ENDPOINT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --b2-test-mode

    -

    A flag string for X-Bz-Test-Mode header for debugging.

    -

    This is for debugging purposes only. Setting it to one of the strings below will cause b2 to return specific errors:

    -
      -
    • "fail_some_uploads"
    • -
    • "expire_some_account_authorization_tokens"
    • -
    • "force_cap_exceeded"
    • -
    -

    These will be set in the "X-Bz-Test-Mode" header which is documented in the b2 integrations checklist.

    -

    Properties:

    -
      -
    • Config: test_mode
    • -
    • Env Var: RCLONE_B2_TEST_MODE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --b2-versions

    -

    Include old versions in directory listings.

    -

    Note that when using this no file write operations are permitted, so you can't upload files or delete them.

    -

    Properties:

    -
      -
    • Config: versions
    • -
    • Env Var: RCLONE_B2_VERSIONS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --b2-version-at

    -

    Show file versions as they were at the specified time.

    -

    Note that when using this no file write operations are permitted, so you can't upload files or delete them.

    -

    Properties:

    -
      -
    • Config: version_at
    • -
    • Env Var: RCLONE_B2_VERSION_AT
    • -
    • Type: Time
    • -
    • Default: off
    • -
    -

    --b2-upload-cutoff

    -

    Cutoff for switching to chunked upload.

    -

    Files above this size will be uploaded in chunks of "--b2-chunk-size".

    -

    This value should be set no larger than 4.657 GiB (== 5 GB).

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_B2_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 200Mi
    • -
    -

    --b2-copy-cutoff

    -

    Cutoff for switching to multipart copy.

    -

    Any files larger than this that need to be server-side copied will be copied in chunks of this size.

    -

    The minimum is 0 and the maximum is 4.6 GiB.

    -

    Properties:

    -
      -
    • Config: copy_cutoff
    • -
    • Env Var: RCLONE_B2_COPY_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 4Gi
    • -
    -

    --b2-chunk-size

    -

    Upload chunk size.

    -

    When uploading large files, chunk the file into this size.

    -

    Must fit in memory. These chunks are buffered in memory and there might a maximum of "--transfers" chunks in progress at once.

    -

    5,000,000 Bytes is the minimum size.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_B2_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 96Mi
    • -
    -

    --b2-disable-checksum

    -

    Disable checksums for large (> upload cutoff) files.

    -

    Normally rclone will calculate the SHA1 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

    -

    Properties:

    -
      -
    • Config: disable_checksum
    • -
    • Env Var: RCLONE_B2_DISABLE_CHECKSUM
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --b2-download-url

    -

    Custom endpoint for downloads.

    -

    This is usually set to a Cloudflare CDN URL as Backblaze offers free egress for data downloaded through the Cloudflare network. Rclone works with private buckets by sending an "Authorization" header. If the custom endpoint rewrites the requests for authentication, e.g., in Cloudflare Workers, this header needs to be handled properly. Leave blank if you want to use the endpoint provided by Backblaze.

    -

    The URL provided here SHOULD have the protocol and SHOULD NOT have a trailing slash or specify the /file/bucket subpath as rclone will request files with "{download_url}/file/{bucket_name}/{path}".

    -

    Example: > https://mysubdomain.mydomain.tld (No trailing "/", "file" or "bucket")

    -

    Properties:

    -
      -
    • Config: download_url
    • -
    • Env Var: RCLONE_B2_DOWNLOAD_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --b2-download-auth-duration

    -

    Time before the authorization token will expire in s or suffix ms|s|m|h|d.

    -

    The duration before the download authorization token will expire. The minimum value is 1 second. The maximum value is one week.

    -

    Properties:

    -
      -
    • Config: download_auth_duration
    • -
    • Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION
    • -
    • Type: Duration
    • -
    • Default: 1w
    • -
    -

    --b2-memory-pool-flush-time

    -

    How often internal memory buffer pools will be flushed. Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. This option controls how often unused buffers will be removed from the pool.

    -

    Properties:

    -
      -
    • Config: memory_pool_flush_time
    • -
    • Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --b2-memory-pool-use-mmap

    -

    Whether to use mmap buffers in internal memory pool.

    -

    Properties:

    -
      -
    • Config: memory_pool_use_mmap
    • -
    • Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --b2-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_B2_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    rclone about is not supported by the B2 backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Box

    -

    Paths are specified as remote:path

    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    The initial setup for Box involves getting a token from Box which you can do either in your browser, or with a config.json downloaded from Box to use JWT authentication. rclone config walks you through it.

    -

    Configuration

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Box
    -   \ "box"
    -[snip]
    -Storage> box
    -Box App Client Id - leave blank normally.
    -client_id> 
    -Box App Client Secret - leave blank normally.
    -client_secret>
    -Box App config.json location
    -Leave blank normally.
    -Enter a string value. Press Enter for the default ("").
    -box_config_file>
    -Box App Primary Access Token
    -Leave blank normally.
    -Enter a string value. Press Enter for the default ("").
    -access_token>
    -
    -Enter a string value. Press Enter for the default ("user").
    -Choose a number from below, or type in your own value
    - 1 / Rclone should act on behalf of a user
    -   \ "user"
    - 2 / Rclone should act on behalf of a service account
    -   \ "enterprise"
    -box_sub_type>
    -Remote config
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    ---------------------
    -[remote]
    -client_id = 
    -client_secret = 
    -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"}
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Box. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall.

    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your Box

    -
    rclone lsd remote:
    -

    List all the files in your Box

    -
    rclone ls remote:
    -

    To copy a local directory to an Box directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Using rclone with an Enterprise account with SSO

    -

    If you have an "Enterprise" account type with Box with single sign on (SSO), you need to create a password to use Box with rclone. This can be done at your Enterprise Box account by going to Settings, "Account" Tab, and then set the password in the "Authentication" field.

    -

    Once you have done this, you can setup your Enterprise Box account using the same procedure detailed above in the, using the password you have just set.

    -

    Invalid refresh token

    -

    According to the box docs:

    -
    -

    Each refresh_token is valid for one use in 60 days.

    -
    -

    This means that if you

    -
      -
    • Don't use the box remote for 60 days
    • -
    • Copy the config file with a box refresh token in and use it in two places
    • -
    • Get an error on a token refresh
    • -
    -

    then rclone will return an error which includes the text Invalid refresh token.

    -

    To fix this you will need to use oauth2 again to update the refresh token. You can use the methods in the remote setup docs, bearing in mind that if you use the copy the config file method, you should not use that remote on the computer you did the authentication on.

    -

    Here is how to do it.

    -
    $ rclone config
    -Current remotes:
    -
    -Name                 Type
    -====                 ====
    -remote               box
    -
    -e) Edit existing remote
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> e
    -Choose a number from below, or type in an existing value
    - 1 > remote
    -remote> remote
    ---------------------
    -[remote]
    -type = box
    -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"}
    ---------------------
    -Edit remote
    -Value "client_id" = ""
    -Edit? (y/n)>
    -y) Yes
    -n) No
    -y/n> n
    -Value "client_secret" = ""
    -Edit? (y/n)>
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    -Already have a token - refresh?
    -y) Yes
    -n) No
    -y/n> y
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    ---------------------
    -[remote]
    -type = box
    -token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"}
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Modified time and hashes

    -

    Box allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not.

    -

    Box supports SHA1 type hashes, so you can use the --checksum flag.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    \0x5C
    -

    File names can also not end with the following characters. These only get replaced if they are the last character in the name:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    SP0x20
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Transfers

    -

    For files above 50 MiB rclone will use a chunked transfer. Rclone will upload up to --transfers chunks at the same time (shared among all the multipart uploads). Chunks are buffered in memory and are normally 8 MiB so increasing --transfers will increase memory use.

    -

    Deleting files

    -

    Depending on the enterprise settings for your user, the item will either be actually deleted from Box or moved to the trash.

    -

    Emptying the trash is supported via the rclone however cleanup command however this deletes every trashed file and folder individually so it may take a very long time. Emptying the trash via the WebUI does not have this limitation so it is advised to empty the trash via the WebUI.

    -

    Root folder ID

    -

    You can set the root_folder_id for rclone. This is the directory (identified by its Folder ID) that rclone considers to be the root of your Box drive.

    -

    Normally you will leave this blank and rclone will determine the correct root to use itself.

    -

    However you can set this to restrict rclone to a specific folder hierarchy.

    -

    In order to do this you will have to find the Folder ID of the directory you wish rclone to display. This will be the last segment of the URL when you open the relevant folder in the Box web interface.

    -

    So if the folder you want rclone to use has a URL which looks like https://app.box.com/folder/11xxxxxxxxx8 in the browser, then you use 11xxxxxxxxx8 as the root_folder_id in the config.

    -

    Standard options

    -

    Here are the Standard options specific to box (Box).

    -

    --box-client-id

    -

    OAuth Client Id.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_BOX_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_BOX_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-box-config-file

    -

    Box App config.json location

    -

    Leave blank normally.

    -

    Leading ~ will be expanded in the file name as will environment variables such as ${RCLONE_CONFIG_DIR}.

    -

    Properties:

    -
      -
    • Config: box_config_file
    • -
    • Env Var: RCLONE_BOX_BOX_CONFIG_FILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-access-token

    -

    Box App Primary Access Token

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: access_token
    • -
    • Env Var: RCLONE_BOX_ACCESS_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-box-sub-type

    -

    Properties:

    -
      -
    • Config: box_sub_type
    • -
    • Env Var: RCLONE_BOX_BOX_SUB_TYPE
    • -
    • Type: string
    • -
    • Default: "user"
    • -
    • Examples: -
        -
      • "user" -
          -
        • Rclone should act on behalf of a user.
        • -
      • -
      • "enterprise" -
          -
        • Rclone should act on behalf of a service account.
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to box (Box).

    -

    --box-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_BOX_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_BOX_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_BOX_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-root-folder-id

    -

    Fill in for rclone to use a non root folder as its starting point.

    -

    Properties:

    -
      -
    • Config: root_folder_id
    • -
    • Env Var: RCLONE_BOX_ROOT_FOLDER_ID
    • -
    • Type: string
    • -
    • Default: "0"
    • -
    -

    --box-upload-cutoff

    -

    Cutoff for switching to multipart upload (>= 50 MiB).

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_BOX_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 50Mi
    • -
    -

    --box-commit-retries

    -

    Max number of times to try committing a multipart file.

    -

    Properties:

    -
      -
    • Config: commit_retries
    • -
    • Env Var: RCLONE_BOX_COMMIT_RETRIES
    • -
    • Type: int
    • -
    • Default: 100
    • -
    -

    --box-list-chunk

    -

    Size of listing chunk 1-1000.

    -

    Properties:

    -
      -
    • Config: list_chunk
    • -
    • Env Var: RCLONE_BOX_LIST_CHUNK
    • -
    • Type: int
    • -
    • Default: 1000
    • -
    -

    --box-owned-by

    -

    Only show items owned by the login (email address) passed in.

    -

    Properties:

    -
      -
    • Config: owned_by
    • -
    • Env Var: RCLONE_BOX_OWNED_BY
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --box-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_BOX_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    Note that Box is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    Box file names can't have the \ character in. rclone maps this to and from an identical looking unicode equivalent (U+FF3C Fullwidth Reverse Solidus).

    -

    Box only supports filenames up to 255 characters in length.

    -

    Box has API rate limits that sometimes reduce the speed of rclone.

    -

    rclone about is not supported by the Box backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Cache

    -

    The cache remote wraps another existing remote and stores file structure and its data for long running tasks like rclone mount.

    -

    Status

    -

    The cache backend code is working but it currently doesn't have a maintainer so there are outstanding bugs which aren't getting fixed.

    -

    The cache backend is due to be phased out in favour of the VFS caching layer eventually which is more tightly integrated into rclone.

    -

    Until this happens we recommend only using the cache backend if you find you can't work without it. There are many docs online describing the use of the cache backend to minimize API hits and by-and-large these are out of date and the cache backend isn't needed in those scenarios any more.

    -

    Configuration

    -

    To get started you just need to have an existing remote which can be configured with cache.

    -

    Here is an example of how to make a remote called test-cache. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -n/r/c/s/q> n
    -name> test-cache
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Cache a remote
    -   \ "cache"
    -[snip]
    -Storage> cache
    -Remote to cache.
    -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
    -"myremote:bucket" or maybe "myremote:" (not recommended).
    -remote> local:/test
    -Optional: The URL of the Plex server
    -plex_url> http://127.0.0.1:32400
    -Optional: The username of the Plex user
    -plex_username> dummyusername
    -Optional: The password of the Plex user
    -y) Yes type in my own password
    -g) Generate random password
    -n) No leave this optional password blank
    -y/g/n> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -The size of a chunk. Lower value good for slow connections but can affect seamless reading.
    -Default: 5M
    -Choose a number from below, or type in your own value
    - 1 / 1 MiB
    -   \ "1M"
    - 2 / 5 MiB
    -   \ "5M"
    - 3 / 10 MiB
    -   \ "10M"
    -chunk_size> 2
    -How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache.
    -Accepted units are: "s", "m", "h".
    -Default: 5m
    -Choose a number from below, or type in your own value
    - 1 / 1 hour
    -   \ "1h"
    - 2 / 24 hours
    -   \ "24h"
    - 3 / 24 hours
    -   \ "48h"
    -info_age> 2
    -The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted.
    -Default: 10G
    -Choose a number from below, or type in your own value
    - 1 / 500 MiB
    -   \ "500M"
    - 2 / 1 GiB
    -   \ "1G"
    - 3 / 10 GiB
    -   \ "10G"
    -chunk_total_size> 3
    -Remote config
    ---------------------
    -[test-cache]
    -remote = local:/test
    -plex_url = http://127.0.0.1:32400
    -plex_username = dummyusername
    -plex_password = *** ENCRYPTED ***
    -chunk_size = 5M
    -info_age = 48h
    -chunk_total_size = 10G
    -

    You can then use it like this,

    -

    List directories in top level of your drive

    -
    rclone lsd test-cache:
    -

    List all the files in your drive

    -
    rclone ls test-cache:
    -

    To start a cached mount

    -
    rclone mount --allow-other test-cache: /var/tmp/test-cache
    -

    Write Features

    -

    Offline uploading

    -

    In an effort to make writing through cache more reliable, the backend now supports this feature which can be activated by specifying a cache-tmp-upload-path.

    -

    A files goes through these states when using this feature:

    -
      -
    1. An upload is started (usually by copying a file on the cache remote)
    2. -
    3. When the copy to the temporary location is complete the file is part of the cached remote and looks and behaves like any other file (reading included)
    4. -
    5. After cache-tmp-wait-time passes and the file is next in line, rclone move is used to move the file to the cloud provider
    6. -
    7. Reading the file still works during the upload but most modifications on it will be prohibited
    8. -
    9. Once the move is complete the file is unlocked for modifications as it becomes as any other regular file
    10. -
    11. If the file is being read through cache when it's actually deleted from the temporary path then cache will simply swap the source to the cloud provider without interrupting the reading (small blip can happen though)
    12. -
    -

    Files are uploaded in sequence and only one file is uploaded at a time. Uploads will be stored in a queue and be processed based on the order they were added. The queue and the temporary storage is persistent across restarts but can be cleared on startup with the --cache-db-purge flag.

    -

    Write Support

    -

    Writes are supported through cache. One caveat is that a mounted cache remote does not add any retry or fallback mechanism to the upload operation. This will depend on the implementation of the wrapped remote. Consider using Offline uploading for reliable writes.

    -

    One special case is covered with cache-writes which will cache the file data at the same time as the upload when it is enabled making it available from the cache store immediately once the upload is finished.

    -

    Read Features

    -

    Multiple connections

    -

    To counter the high latency between a local PC where rclone is running and cloud providers, the cache remote can split multiple requests to the cloud provider for smaller file chunks and combines them together locally where they can be available almost immediately before the reader usually needs them.

    -

    This is similar to buffering when media files are played online. Rclone will stay around the current marker but always try its best to stay ahead and prepare the data before.

    -

    Plex Integration

    -

    There is a direct integration with Plex which allows cache to detect during reading if the file is in playback or not. This helps cache to adapt how it queries the cloud provider depending on what is needed for.

    -

    Scans will have a minimum amount of workers (1) while in a confirmed playback cache will deploy the configured number of workers.

    -

    This integration opens the doorway to additional performance improvements which will be explored in the near future.

    -

    Note: If Plex options are not configured, cache will function with its configured options without adapting any of its settings.

    -

    How to enable? Run rclone config and add all the Plex options (endpoint, username and password) in your remote and it will be automatically enabled.

    -

    Affected settings: - cache-workers: Configured value during confirmed playback or 1 all the other times

    -
    Certificate Validation
    -

    When the Plex server is configured to only accept secure connections, it is possible to use .plex.direct URLs to ensure certificate validation succeeds. These URLs are used by Plex internally to connect to the Plex server securely.

    -

    The format for these URLs is the following:

    -

    https://ip-with-dots-replaced.server-hash.plex.direct:32400/

    -

    The ip-with-dots-replaced part can be any IPv4 address, where the dots have been replaced with dashes, e.g. 127.0.0.1 becomes 127-0-0-1.

    -

    To get the server-hash part, the easiest way is to visit

    -

    https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token

    -

    This page will list all the available Plex servers for your account with at least one .plex.direct link for each. Copy one URL and replace the IP address with the desired address. This can be used as the plex_url value.

    -

    Known issues

    -

    Mount and --dir-cache-time

    -

    --dir-cache-time controls the first layer of directory caching which works at the mount layer. Being an independent caching mechanism from the cache backend, it will manage its own entries based on the configured time.

    -

    To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct one, try to set --dir-cache-time to a lower time than --cache-info-age. Default values are already configured in this way.

    -

    Windows support - Experimental

    -

    There are a couple of issues with Windows mount functionality that still require some investigations. It should be considered as experimental thus far as fixes come in for this OS.

    -

    Most of the issues seem to be related to the difference between filesystems on Linux flavors and Windows as cache is heavily dependent on them.

    -

    Any reports or feedback on how cache behaves on this OS is greatly appreciated.

    -
      -
    • https://github.com/rclone/rclone/issues/1935
    • -
    • https://github.com/rclone/rclone/issues/1907
    • -
    • https://github.com/rclone/rclone/issues/1834
    • -
    -

    Risk of throttling

    -

    Future iterations of the cache backend will make use of the pooling functionality of the cloud provider to synchronize and at the same time make writing through it more tolerant to failures.

    -

    There are a couple of enhancements in track to add these but in the meantime there is a valid concern that the expiring cache listings can lead to cloud provider throttles or bans due to repeated queries on it for very large mounts.

    -

    Some recommendations: - don't use a very small interval for entry information (--cache-info-age) - while writes aren't yet optimised, you can still write through cache which gives you the advantage of adding the file in the cache at the same time if configured to do so.

    -

    Future enhancements:

    -
      -
    • https://github.com/rclone/rclone/issues/1937
    • -
    • https://github.com/rclone/rclone/issues/1936
    • -
    -

    cache and crypt

    -

    One common scenario is to keep your data encrypted in the cloud provider using the crypt remote. crypt uses a similar technique to wrap around an existing remote and handles this translation in a seamless way.

    -

    There is an issue with wrapping the remotes in this order: cloud remote -> crypt -> cache

    -

    During testing, I experienced a lot of bans with the remotes in this order. I suspect it might be related to how crypt opens files on the cloud provider which makes it think we're downloading the full file instead of small chunks. Organizing the remotes in this order yields better results: cloud remote -> cache -> crypt

    -

    absolute remote paths

    -

    cache can not differentiate between relative and absolute paths for the wrapped remote. Any path given in the remote config setting and on the command line will be passed to the wrapped remote as is, but for storing the chunks on disk the path will be made relative by removing any leading / character.

    -

    This behavior is irrelevant for most backend types, but there are backends where a leading / changes the effective directory, e.g. in the sftp backend paths starting with a / are relative to the root of the SSH server and paths without are relative to the user home directory. As a result sftp:bin and sftp:/bin will share the same cache folder, even if they represent a different directory on the SSH server.

    -

    Cache and Remote Control (--rc)

    -

    Cache supports the new --rc mode in rclone and can be remote controlled through the following end points: By default, the listener is disabled if you do not add the flag.

    -

    rc cache/expire

    -

    Purge a remote from the cache backend. Supports either a directory or a file. It supports both encrypted and unencrypted file names if cache is wrapped by crypt.

    -

    Params: - remote = path to remote (required) - withData = true/false to delete cached data (chunks) as well (optional, false by default)

    -

    Standard options

    -

    Here are the Standard options specific to cache (Cache a remote).

    -

    --cache-remote

    -

    Remote to cache.

    -

    Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended).

    -

    Properties:

    -
      -
    • Config: remote
    • -
    • Env Var: RCLONE_CACHE_REMOTE
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --cache-plex-url

    -

    The URL of the Plex server.

    -

    Properties:

    -
      -
    • Config: plex_url
    • -
    • Env Var: RCLONE_CACHE_PLEX_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --cache-plex-username

    -

    The username of the Plex user.

    -

    Properties:

    -
      -
    • Config: plex_username
    • -
    • Env Var: RCLONE_CACHE_PLEX_USERNAME
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --cache-plex-password

    -

    The password of the Plex user.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: plex_password
    • -
    • Env Var: RCLONE_CACHE_PLEX_PASSWORD
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --cache-chunk-size

    -

    The size of a chunk (partial file data).

    -

    Use lower numbers for slower connections. If the chunk size is changed, any downloaded chunks will be invalid and cache-chunk-path will need to be cleared or unexpected EOF errors will occur.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_CACHE_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 5Mi
    • -
    • Examples: -
        -
      • "1M" -
          -
        • 1 MiB
        • -
      • -
      • "5M" -
          -
        • 5 MiB
        • -
      • -
      • "10M" -
          -
        • 10 MiB
        • -
      • -
    • -
    -

    --cache-info-age

    -

    How long to cache file structure information (directory listings, file size, times, etc.). If all write operations are done through the cache then you can safely make this value very large as the cache store will also be updated in real time.

    -

    Properties:

    -
      -
    • Config: info_age
    • -
    • Env Var: RCLONE_CACHE_INFO_AGE
    • -
    • Type: Duration
    • -
    • Default: 6h0m0s
    • -
    • Examples: -
        -
      • "1h" -
          -
        • 1 hour
        • -
      • -
      • "24h" -
          -
        • 24 hours
        • -
      • -
      • "48h" -
          -
        • 48 hours
        • -
      • -
    • -
    -

    --cache-chunk-total-size

    -

    The total size that the chunks can take up on the local disk.

    -

    If the cache exceeds this value then it will start to delete the oldest chunks until it goes under this value.

    -

    Properties:

    -
      -
    • Config: chunk_total_size
    • -
    • Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 10Gi
    • -
    • Examples: -
        -
      • "500M" -
          -
        • 500 MiB
        • -
      • -
      • "1G" -
          -
        • 1 GiB
        • -
      • -
      • "10G" -
          -
        • 10 GiB
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to cache (Cache a remote).

    -

    --cache-plex-token

    -

    The plex token for authentication - auto set normally.

    -

    Properties:

    -
      -
    • Config: plex_token
    • -
    • Env Var: RCLONE_CACHE_PLEX_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --cache-plex-insecure

    -

    Skip all certificate verification when connecting to the Plex server.

    -

    Properties:

    -
      -
    • Config: plex_insecure
    • -
    • Env Var: RCLONE_CACHE_PLEX_INSECURE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --cache-db-path

    -

    Directory to store file structure metadata DB.

    -

    The remote name is used as the DB file name.

    -

    Properties:

    -
      -
    • Config: db_path
    • -
    • Env Var: RCLONE_CACHE_DB_PATH
    • -
    • Type: string
    • -
    • Default: "$HOME/.cache/rclone/cache-backend"
    • -
    -

    --cache-chunk-path

    -

    Directory to cache chunk files.

    -

    Path to where partial file data (chunks) are stored locally. The remote name is appended to the final path.

    -

    This config follows the "--cache-db-path". If you specify a custom location for "--cache-db-path" and don't specify one for "--cache-chunk-path" then "--cache-chunk-path" will use the same path as "--cache-db-path".

    -

    Properties:

    -
      -
    • Config: chunk_path
    • -
    • Env Var: RCLONE_CACHE_CHUNK_PATH
    • -
    • Type: string
    • -
    • Default: "$HOME/.cache/rclone/cache-backend"
    • -
    -

    --cache-db-purge

    -

    Clear all the cached data for this remote on start.

    -

    Properties:

    -
      -
    • Config: db_purge
    • -
    • Env Var: RCLONE_CACHE_DB_PURGE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --cache-chunk-clean-interval

    -

    How often should the cache perform cleanups of the chunk storage.

    -

    The default value should be ok for most people. If you find that the cache goes over "cache-chunk-total-size" too often then try to lower this value to force it to perform cleanups more often.

    -

    Properties:

    -
      -
    • Config: chunk_clean_interval
    • -
    • Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --cache-read-retries

    -

    How many times to retry a read from a cache storage.

    -

    Since reading from a cache stream is independent from downloading file data, readers can get to a point where there's no more data in the cache. Most of the times this can indicate a connectivity issue if cache isn't able to provide file data anymore.

    -

    For really slow connections, increase this to a point where the stream is able to provide data but your experience will be very stuttering.

    -

    Properties:

    -
      -
    • Config: read_retries
    • -
    • Env Var: RCLONE_CACHE_READ_RETRIES
    • -
    • Type: int
    • -
    • Default: 10
    • -
    -

    --cache-workers

    -

    How many workers should run in parallel to download chunks.

    -

    Higher values will mean more parallel processing (better CPU needed) and more concurrent requests on the cloud provider. This impacts several aspects like the cloud provider API limits, more stress on the hardware that rclone runs on but it also means that streams will be more fluid and data will be available much more faster to readers.

    -

    Note: If the optional Plex integration is enabled then this setting will adapt to the type of reading performed and the value specified here will be used as a maximum number of workers to use.

    -

    Properties:

    -
      -
    • Config: workers
    • -
    • Env Var: RCLONE_CACHE_WORKERS
    • -
    • Type: int
    • -
    • Default: 4
    • -
    -

    --cache-chunk-no-memory

    -

    Disable the in-memory cache for storing chunks during streaming.

    -

    By default, cache will keep file data during streaming in RAM as well to provide it to readers as fast as possible.

    -

    This transient data is evicted as soon as it is read and the number of chunks stored doesn't exceed the number of workers. However, depending on other settings like "cache-chunk-size" and "cache-workers" this footprint can increase if there are parallel streams too (multiple files being read at the same time).

    -

    If the hardware permits it, use this feature to provide an overall better performance during streaming but it can also be disabled if RAM is not available on the local machine.

    -

    Properties:

    -
      -
    • Config: chunk_no_memory
    • -
    • Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --cache-rps

    -

    Limits the number of requests per second to the source FS (-1 to disable).

    -

    This setting places a hard limit on the number of requests per second that cache will be doing to the cloud provider remote and try to respect that value by setting waits between reads.

    -

    If you find that you're getting banned or limited on the cloud provider through cache and know that a smaller number of requests per second will allow you to work with it then you can use this setting for that.

    -

    A good balance of all the other settings should make this setting useless but it is available to set for more special cases.

    -

    NOTE: This will limit the number of requests during streams but other API calls to the cloud provider like directory listings will still pass.

    -

    Properties:

    -
      -
    • Config: rps
    • -
    • Env Var: RCLONE_CACHE_RPS
    • -
    • Type: int
    • -
    • Default: -1
    • -
    -

    --cache-writes

    -

    Cache file data on writes through the FS.

    -

    If you need to read files immediately after you upload them through cache you can enable this flag to have their data stored in the cache store at the same time during upload.

    -

    Properties:

    -
      -
    • Config: writes
    • -
    • Env Var: RCLONE_CACHE_WRITES
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --cache-tmp-upload-path

    -

    Directory to keep temporary files until they are uploaded.

    -

    This is the path where cache will use as a temporary storage for new files that need to be uploaded to the cloud provider.

    -

    Specifying a value will enable this feature. Without it, it is completely disabled and files will be uploaded directly to the cloud provider

    -

    Properties:

    -
      -
    • Config: tmp_upload_path
    • -
    • Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --cache-tmp-wait-time

    -

    How long should files be stored in local cache before being uploaded.

    -

    This is the duration that a file must wait in the temporary location cache-tmp-upload-path before it is selected for upload.

    -

    Note that only one file is uploaded at a time and it can take longer to start the upload if a queue formed for this purpose.

    -

    Properties:

    -
      -
    • Config: tmp_wait_time
    • -
    • Env Var: RCLONE_CACHE_TMP_WAIT_TIME
    • -
    • Type: Duration
    • -
    • Default: 15s
    • -
    -

    --cache-db-wait-time

    -

    How long to wait for the DB to be available - 0 is unlimited.

    -

    Only one process can have the DB open at any one time, so rclone waits for this duration for the DB to become available before it gives an error.

    -

    If you set it to 0 then it will wait forever.

    -

    Properties:

    -
      -
    • Config: db_wait_time
    • -
    • Env Var: RCLONE_CACHE_DB_WAIT_TIME
    • -
    • Type: Duration
    • -
    • Default: 1s
    • -
    -

    Backend commands

    -

    Here are the commands specific to the cache backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    stats

    -

    Print stats on the cache backend in JSON format.

    -
    rclone backend stats remote: [options] [<arguments>+]
    -

    Chunker

    -

    The chunker overlay transparently splits large files into smaller chunks during upload to wrapped remote and transparently assembles them back when the file is downloaded. This allows to effectively overcome size limits imposed by storage providers.

    -

    Configuration

    -

    To use it, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote.

    -

    First check your chosen remote is working - we'll call it remote:path here. Note that anything inside remote:path will be chunked and anything outside won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) then you should probably put the bucket in the remote s3:bucket.

    -

    Now configure chunker using rclone config. We will call this one overlay to separate it from the remote itself.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> overlay
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Transparently chunk/split large files
    -   \ "chunker"
    -[snip]
    -Storage> chunker
    -Remote to chunk/unchunk.
    -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
    -"myremote:bucket" or maybe "myremote:" (not recommended).
    -Enter a string value. Press Enter for the default ("").
    -remote> remote:path
    -Files larger than chunk size will be split in chunks.
    -Enter a size with suffix K,M,G,T. Press Enter for the default ("2G").
    -chunk_size> 100M
    -Choose how chunker handles hash sums. All modes but "none" require metadata.
    -Enter a string value. Press Enter for the default ("md5").
    -Choose a number from below, or type in your own value
    - 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise
    -   \ "none"
    - 2 / MD5 for composite files
    -   \ "md5"
    - 3 / SHA1 for composite files
    -   \ "sha1"
    - 4 / MD5 for all files
    -   \ "md5all"
    - 5 / SHA1 for all files
    -   \ "sha1all"
    - 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported
    -   \ "md5quick"
    - 7 / Similar to "md5quick" but prefers SHA1 over MD5
    -   \ "sha1quick"
    -hash_type> md5
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    ---------------------
    -[overlay]
    -type = chunker
    -remote = remote:bucket
    -chunk_size = 100M
    -hash_type = md5
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Specifying the remote

    -

    In normal use, make sure the remote has a : in. If you specify the remote without a : then rclone will use a local directory of that name. So if you use a remote of /path/to/secret/files then rclone will chunk stuff in that directory. If you use a remote of name then rclone will put files in a directory called name in the current directory.

    -

    Chunking

    -

    When rclone starts a file upload, chunker checks the file size. If it doesn't exceed the configured chunk size, chunker will just pass the file to the wrapped remote. If a file is large, chunker will transparently cut data in pieces with temporary names and stream them one by one, on the fly. Each data chunk will contain the specified number of bytes, except for the last one which may have less data. If file size is unknown in advance (this is called a streaming upload), chunker will internally create a temporary copy, record its size and repeat the above process.

    -

    When upload completes, temporary chunk files are finally renamed. This scheme guarantees that operations can be run in parallel and look from outside as atomic. A similar method with hidden temporary chunks is used for other operations (copy/move/rename, etc.). If an operation fails, hidden chunks are normally destroyed, and the target composite file stays intact.

    -

    When a composite file download is requested, chunker transparently assembles it by concatenating data chunks in order. As the split is trivial one could even manually concatenate data chunks together to obtain the original content.

    -

    When the list rclone command scans a directory on wrapped remote, the potential chunk files are accounted for, grouped and assembled into composite directory entries. Any temporary chunks are hidden.

    -

    List and other commands can sometimes come across composite files with missing or invalid chunks, e.g. shadowed by like-named directory or another file. This usually means that wrapped file system has been directly tampered with or damaged. If chunker detects a missing chunk it will by default print warning, skip the whole incomplete group of chunks but proceed with current command. You can set the --chunker-fail-hard flag to have commands abort with error message in such cases.

    -

    Chunk names

    -

    The default chunk name format is *.rclone_chunk.###, hence by default chunk names are BIG_FILE_NAME.rclone_chunk.001, BIG_FILE_NAME.rclone_chunk.002 etc. You can configure another name format using the name_format configuration file option. The format uses asterisk * as a placeholder for the base file name and one or more consecutive hash characters # as a placeholder for sequential chunk number. There must be one and only one asterisk. The number of consecutive hash characters defines the minimum length of a string representing a chunk number. If decimal chunk number has less digits than the number of hashes, it is left-padded by zeros. If the decimal string is longer, it is left intact. By default numbering starts from 1 but there is another option that allows user to start from 0, e.g. for compatibility with legacy software.

    -

    For example, if name format is big_*-##.part and original file name is data.txt and numbering starts from 0, then the first chunk will be named big_data.txt-00.part, the 99th chunk will be big_data.txt-98.part and the 302nd chunk will become big_data.txt-301.part.

    -

    Note that list assembles composite directory entries only when chunk names match the configured format and treats non-conforming file names as normal non-chunked files.

    -

    When using norename transactions, chunk names will additionally have a unique file version suffix. For example, BIG_FILE_NAME.rclone_chunk.001_bp562k.

    -

    Metadata

    -

    Besides data chunks chunker will by default create metadata object for a composite file. The object is named after the original file. Chunker allows user to disable metadata completely (the none format). Note that metadata is normally not created for files smaller than the configured chunk size. This may change in future rclone releases.

    -

    Simple JSON metadata format

    -

    This is the default format. It supports hash sums and chunk validation for composite files. Meta objects carry the following fields:

    -
      -
    • ver - version of format, currently 1
    • -
    • size - total size of composite file
    • -
    • nchunks - number of data chunks in file
    • -
    • md5 - MD5 hashsum of composite file (if present)
    • -
    • sha1 - SHA1 hashsum (if present)
    • -
    • txn - identifies current version of the file
    • -
    -

    There is no field for composite file name as it's simply equal to the name of meta object on the wrapped remote. Please refer to respective sections for details on hashsums and modified time handling.

    -

    No metadata

    -

    You can disable meta objects by setting the meta format option to none. In this mode chunker will scan directory for all files that follow configured chunk name format, group them by detecting chunks with the same base name and show group names as virtual composite files. This method is more prone to missing chunk errors (especially missing last chunk) than format with metadata enabled.

    -

    Hashsums

    -

    Chunker supports hashsums only when a compatible metadata is present. Hence, if you choose metadata format of none, chunker will report hashsum as UNSUPPORTED.

    -

    Please note that by default metadata is stored only for composite files. If a file is smaller than configured chunk size, chunker will transparently redirect hash requests to wrapped remote, so support depends on that. You will see the empty string as a hashsum of requested type for small files if the wrapped remote doesn't support it.

    -

    Many storage backends support MD5 and SHA1 hash types, so does chunker. With chunker you can choose one or another but not both. MD5 is set by default as the most supported type. Since chunker keeps hashes for composite files and falls back to the wrapped remote hash for non-chunked ones, we advise you to choose the same hash type as supported by wrapped remote so that your file listings look coherent.

    -

    If your storage backend does not support MD5 or SHA1 but you need consistent file hashing, configure chunker with md5all or sha1all. These two modes guarantee given hash for all files. If wrapped remote doesn't support it, chunker will then add metadata to all files, even small. However, this can double the amount of small files in storage and incur additional service charges. You can even use chunker to force md5/sha1 support in any other remote at expense of sidecar meta objects by setting e.g. chunk_type=sha1all to force hashsums and chunk_size=1P to effectively disable chunking.

    -

    Normally, when a file is copied to chunker controlled remote, chunker will ask the file source for compatible file hash and revert to on-the-fly calculation if none is found. This involves some CPU overhead but provides a guarantee that given hashsum is available. Also, chunker will reject a server-side copy or move operation if source and destination hashsum types are different resulting in the extra network bandwidth, too. In some rare cases this may be undesired, so chunker provides two optional choices: sha1quick and md5quick. If the source does not support primary hash type and the quick mode is enabled, chunker will try to fall back to the secondary type. This will save CPU and bandwidth but can result in empty hashsums at destination. Beware of consequences: the sync command will revert (sometimes silently) to time/size comparison if compatible hashsums between source and target are not found.

    -

    Modified time

    -

    Chunker stores modification times using the wrapped remote so support depends on that. For a small non-chunked file the chunker overlay simply manipulates modification time of the wrapped remote file. For a composite file with metadata chunker will get and set modification time of the metadata object on the wrapped remote. If file is chunked but metadata format is none then chunker will use modification time of the first data chunk.

    -

    Migrations

    -

    The idiomatic way to migrate to a different chunk size, hash type, transaction style or chunk naming scheme is to:

    -
      -
    • Collect all your chunked files under a directory and have your chunker remote point to it.
    • -
    • Create another directory (most probably on the same cloud storage) and configure a new remote with desired metadata format, hash type, chunk naming etc.
    • -
    • Now run rclone sync --interactive oldchunks: newchunks: and all your data will be transparently converted in transfer. This may take some time, yet chunker will try server-side copy if possible.
    • -
    • After checking data integrity you may remove configuration section of the old remote.
    • -
    -

    If rclone gets killed during a long operation on a big composite file, hidden temporary chunks may stay in the directory. They will not be shown by the list command but will eat up your account quota. Please note that the deletefile command deletes only active chunks of a file. As a workaround, you can use remote of the wrapped file system to see them. An easy way to get rid of hidden garbage is to copy littered directory somewhere using the chunker remote and purge the original directory. The copy command will copy only active chunks while the purge will remove everything including garbage.

    -

    Caveats and Limitations

    -

    Chunker requires wrapped remote to support server-side move (or copy + delete) operations, otherwise it will explicitly refuse to start. This is because it internally renames temporary chunk files to their final names when an operation completes successfully.

    -

    Chunker encodes chunk number in file name, so with default name_format setting it adds 17 characters. Also chunker adds 7 characters of temporary suffix during operations. Many file systems limit base file name without path by 255 characters. Using rclone's crypt remote as a base file system limits file name by 143 characters. Thus, maximum name length is 231 for most files and 119 for chunker-over-crypt. A user in need can change name format to e.g. *.rcc## and save 10 characters (provided at most 99 chunks per file).

    -

    Note that a move implemented using the copy-and-delete method may incur double charging with some cloud storage providers.

    -

    Chunker will not automatically rename existing chunks when you run rclone config on a live remote and change the chunk name format. Beware that in result of this some files which have been treated as chunks before the change can pop up in directory listings as normal files and vice versa. The same warning holds for the chunk size. If you desperately need to change critical chunking settings, you should run data migration as described above.

    -

    If wrapped remote is case insensitive, the chunker overlay will inherit that property (so you can't have a file called "Hello.doc" and "hello.doc" in the same directory).

    -

    Chunker included in rclone releases up to v1.54 can sometimes fail to detect metadata produced by recent versions of rclone. We recommend users to keep rclone up-to-date to avoid data corruption.

    -

    Changing transactions is dangerous and requires explicit migration.

    -

    Standard options

    -

    Here are the Standard options specific to chunker (Transparently chunk/split large files).

    -

    --chunker-remote

    -

    Remote to chunk/unchunk.

    -

    Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended).

    -

    Properties:

    -
      -
    • Config: remote
    • -
    • Env Var: RCLONE_CHUNKER_REMOTE
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --chunker-chunk-size

    -

    Files larger than chunk size will be split in chunks.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_CHUNKER_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 2Gi
    • -
    -

    --chunker-hash-type

    -

    Choose how chunker handles hash sums.

    -

    All modes but "none" require metadata.

    -

    Properties:

    -
      -
    • Config: hash_type
    • -
    • Env Var: RCLONE_CHUNKER_HASH_TYPE
    • -
    • Type: string
    • -
    • Default: "md5"
    • -
    • Examples: -
        -
      • "none" -
          -
        • Pass any hash supported by wrapped remote for non-chunked files.
        • -
        • Return nothing otherwise.
        • -
      • -
      • "md5" -
          -
        • MD5 for composite files.
        • -
      • -
      • "sha1" -
          -
        • SHA1 for composite files.
        • -
      • -
      • "md5all" -
          -
        • MD5 for all files.
        • -
      • -
      • "sha1all" -
          -
        • SHA1 for all files.
        • -
      • -
      • "md5quick" -
          -
        • Copying a file to chunker will request MD5 from the source.
        • -
        • Falling back to SHA1 if unsupported.
        • -
      • -
      • "sha1quick" -
          -
        • Similar to "md5quick" but prefers SHA1 over MD5.
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to chunker (Transparently chunk/split large files).

    -

    --chunker-name-format

    -

    String format of chunk file names.

    -

    The two placeholders are: base file name (*) and chunk number (#...). There must be one and only one asterisk and one or more consecutive hash characters. If chunk number has less digits than the number of hashes, it is left-padded by zeros. If there are more digits in the number, they are left as is. Possible chunk files are ignored if their name does not match given format.

    -

    Properties:

    -
      -
    • Config: name_format
    • -
    • Env Var: RCLONE_CHUNKER_NAME_FORMAT
    • -
    • Type: string
    • -
    • Default: "*.rclone_chunk.###"
    • -
    -

    --chunker-start-from

    -

    Minimum valid chunk number. Usually 0 or 1.

    -

    By default chunk numbers start from 1.

    -

    Properties:

    -
      -
    • Config: start_from
    • -
    • Env Var: RCLONE_CHUNKER_START_FROM
    • -
    • Type: int
    • -
    • Default: 1
    • -
    -

    --chunker-meta-format

    -

    Format of the metadata object or "none".

    -

    By default "simplejson". Metadata is a small JSON file named after the composite file.

    -

    Properties:

    -
      -
    • Config: meta_format
    • -
    • Env Var: RCLONE_CHUNKER_META_FORMAT
    • -
    • Type: string
    • -
    • Default: "simplejson"
    • -
    • Examples: -
        -
      • "none" -
          -
        • Do not use metadata files at all.
        • -
        • Requires hash type "none".
        • -
      • -
      • "simplejson" -
          -
        • Simple JSON supports hash sums and chunk validation.
        • -
        • -
        • It has the following fields: ver, size, nchunks, md5, sha1.
        • -
      • -
    • -
    -

    --chunker-fail-hard

    -

    Choose how chunker should handle files with missing or invalid chunks.

    -

    Properties:

    -
      -
    • Config: fail_hard
    • -
    • Env Var: RCLONE_CHUNKER_FAIL_HARD
    • -
    • Type: bool
    • -
    • Default: false
    • -
    • Examples: -
        -
      • "true" -
          -
        • Report errors and abort current command.
        • -
      • -
      • "false" -
          -
        • Warn user, skip incomplete file and proceed.
        • -
      • -
    • -
    -

    --chunker-transactions

    -

    Choose how chunker should handle temporary files during transactions.

    -

    Properties:

    -
      -
    • Config: transactions
    • -
    • Env Var: RCLONE_CHUNKER_TRANSACTIONS
    • -
    • Type: string
    • -
    • Default: "rename"
    • -
    • Examples: -
        -
      • "rename" -
          -
        • Rename temporary files after a successful transaction.
        • -
      • -
      • "norename" -
          -
        • Leave temporary file names and write transaction ID to metadata file.
        • -
        • Metadata is required for no rename transactions (meta format cannot be "none").
        • -
        • If you are using norename transactions you should be careful not to downgrade Rclone
        • -
        • as older versions of Rclone don't support this transaction style and will misinterpret
        • -
        • files manipulated by norename transactions.
        • -
        • This method is EXPERIMENTAL, don't use on production systems.
        • -
      • -
      • "auto" -
          -
        • Rename or norename will be used depending on capabilities of the backend.
        • -
        • If meta format is set to "none", rename transactions will always be used.
        • -
        • This method is EXPERIMENTAL, don't use on production systems.
        • -
      • -
    • -
    -

    Citrix ShareFile

    -

    Citrix ShareFile is a secure file sharing and transfer service aimed as business.

    -

    Configuration

    -

    The initial setup for Citrix ShareFile involves getting a token from Citrix ShareFile which you can in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -XX / Citrix Sharefile
    -   \ "sharefile"
    -Storage> sharefile
    -** See help for sharefile backend at: https://rclone.org/sharefile/ **
    -
    -ID of the root folder
    -
    -Leave blank to access "Personal Folders".  You can use one of the
    -standard values here or any folder ID (long hex number ID).
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Access the Personal Folders. (Default)
    -   \ ""
    - 2 / Access the Favorites folder.
    -   \ "favorites"
    - 3 / Access all the shared folders.
    -   \ "allshared"
    - 4 / Access all the individual connectors.
    -   \ "connectors"
    - 5 / Access the home, favorites, and shared folders as well as the connectors.
    -   \ "top"
    -root_folder_id> 
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXX
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    ---------------------
    -[remote]
    -type = sharefile
    -endpoint = https://XXX.sharefile.com
    -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"}
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Citrix ShareFile. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall.

    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your ShareFile

    -
    rclone lsd remote:
    -

    List all the files in your ShareFile

    -
    rclone ls remote:
    -

    To copy a local directory to an ShareFile directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    Modified time and hashes

    -

    ShareFile allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not.

    -

    ShareFile supports MD5 type hashes, so you can use the --checksum flag.

    -

    Transfers

    -

    For files above 128 MiB rclone will use a chunked transfer. Rclone will upload up to --transfers chunks at the same time (shared among all the multipart uploads). Chunks are buffered in memory and are normally 64 MiB so increasing --transfers will increase memory use.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    \0x5C
    *0x2A
    <0x3C
    >0x3E
    ?0x3F
    :0x3A
    |0x7C
    "0x22
    -

    File names can also not start or end with the following characters. These only get replaced if they are the first or last character in the name:

    - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    SP0x20
    .0x2E
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Standard options

    -

    Here are the Standard options specific to sharefile (Citrix Sharefile).

    -

    --sharefile-root-folder-id

    -

    ID of the root folder.

    -

    Leave blank to access "Personal Folders". You can use one of the standard values here or any folder ID (long hex number ID).

    -

    Properties:

    -
      -
    • Config: root_folder_id
    • -
    • Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Access the Personal Folders (default).
        • -
      • -
      • "favorites" -
          -
        • Access the Favorites folder.
        • -
      • -
      • "allshared" -
          -
        • Access all the shared folders.
        • -
      • -
      • "connectors" -
          -
        • Access all the individual connectors.
        • -
      • -
      • "top" -
          -
        • Access the home, favorites, and shared folders as well as the connectors.
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to sharefile (Citrix Sharefile).

    -

    --sharefile-upload-cutoff

    -

    Cutoff for switching to multipart upload.

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 128Mi
    • -
    -

    --sharefile-chunk-size

    -

    Upload chunk size.

    -

    Must a power of 2 >= 256k.

    -

    Making this larger will improve performance, but note that each chunk is buffered in memory one per transfer.

    -

    Reducing this will reduce memory usage but decrease performance.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_SHAREFILE_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 64Mi
    • -
    -

    --sharefile-endpoint

    -

    Endpoint for API calls.

    -

    This is usually auto discovered as part of the oauth process, but can be set manually to something like: https://XXX.sharefile.com

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_SHAREFILE_ENDPOINT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --sharefile-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_SHAREFILE_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    Note that ShareFile is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    ShareFile only supports filenames up to 256 characters in length.

    -

    rclone about is not supported by the Citrix ShareFile backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Crypt

    -

    Rclone crypt remotes encrypt and decrypt other remotes.

    -

    A remote of type crypt does not access a storage system directly, but instead wraps another remote, which in turn accesses the storage system. This is similar to how alias, union, chunker and a few others work. It makes the usage very flexible, as you can add a layer, in this case an encryption layer, on top of any other backend, even in multiple layers. Rclone's functionality can be used as with any other remote, for example you can mount a crypt remote.

    -

    Accessing a storage system through a crypt remote realizes client-side encryption, which makes it safe to keep your data in a location you do not trust will not get compromised. When working against the crypt remote, rclone will automatically encrypt (before uploading) and decrypt (after downloading) on your local system as needed on the fly, leaving the data encrypted at rest in the wrapped remote. If you access the storage system using an application other than rclone, or access the wrapped remote directly using rclone, there will not be any encryption/decryption: Downloading existing content will just give you the encrypted (scrambled) format, and anything you upload will not become encrypted.

    -

    The encryption is a secret-key encryption (also called symmetric key encryption) algorithm, where a password (or pass phrase) is used to generate real encryption key. The password can be supplied by user, or you may chose to let rclone generate one. It will be stored in the configuration file, in a lightly obscured form. If you are in an environment where you are not able to keep your configuration secured, you should add configuration encryption as protection. As long as you have this configuration file, you will be able to decrypt your data. Without the configuration file, as long as you remember the password (or keep it in a safe place), you can re-create the configuration and gain access to the existing data. You may also configure a corresponding remote in a different installation to access the same data. See below for guidance to changing password.

    -

    Encryption uses cryptographic salt, to permute the encryption key so that the same string may be encrypted in different ways. When configuring the crypt remote it is optional to enter a salt, or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. Normally in cryptography, the salt is stored together with the encrypted content, and do not have to be memorized by the user. This is not the case in rclone, because rclone does not store any additional information on the remotes. Use of custom salt is effectively a second password that must be memorized.

    -

    File content encryption is performed using NaCl SecretBox, based on XSalsa20 cipher and Poly1305 for integrity. Names (file- and directory names) are also encrypted by default, but this has some implications and is therefore possible to be turned off.

    -

    Configuration

    -

    Here is an example of how to make a remote called secret.

    -

    To use crypt, first set up the underlying remote. Follow the rclone config instructions for the specific backend.

    -

    Before configuring the crypt remote, check the underlying remote is working. In this example the underlying remote is called remote. We will configure a path path within this remote to contain the encrypted content. Anything inside remote:path will be encrypted and anything outside will not.

    -

    Configure crypt using rclone config. In this example the crypt remote is called secret, to differentiate it from the underlying remote.

    -

    When you are done you can use the crypt remote named secret just as you would with any other remote, e.g. rclone copy D:\docs secret:\docs, and rclone will encrypt and decrypt as needed on the fly. If you access the wrapped remote remote:path directly you will bypass the encryption, and anything you read will be in encrypted form, and anything you write will be unencrypted. To avoid issues it is best to configure a dedicated path for encrypted content, and access it exclusively through a crypt remote.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> secret
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Encrypt/Decrypt a remote
    -   \ "crypt"
    -[snip]
    -Storage> crypt
    -** See help for crypt backend at: https://rclone.org/crypt/ **
    -
    -Remote to encrypt/decrypt.
    -Normally should contain a ':' and a path, eg "myremote:path/to/dir",
    -"myremote:bucket" or maybe "myremote:" (not recommended).
    -Enter a string value. Press Enter for the default ("").
    -remote> remote:path
    -How to encrypt the filenames.
    -Enter a string value. Press Enter for the default ("standard").
    -Choose a number from below, or type in your own value.
    -   / Encrypt the filenames.
    - 1 | See the docs for the details.
    -   \ "standard"
    - 2 / Very simple filename obfuscation.
    -   \ "obfuscate"
    -   / Don't encrypt the file names.
    - 3 | Adds a ".bin" extension only.
    -   \ "off"
    -filename_encryption>
    -Option to either encrypt directory names or leave them intact.
    -
    -NB If filename_encryption is "off" then this option will do nothing.
    -Enter a boolean value (true or false). Press Enter for the default ("true").
    -Choose a number from below, or type in your own value
    - 1 / Encrypt directory names.
    -   \ "true"
    - 2 / Don't encrypt directory names, leave them intact.
    -   \ "false"
    -directory_name_encryption>
    -Password or pass phrase for encryption.
    -y) Yes type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Password or pass phrase for salt. Optional but recommended.
    -Should be different to the previous password.
    -y) Yes type in my own password
    -g) Generate random password
    -n) No leave this optional password blank (default)
    -y/g/n> g
    -Password strength in bits.
    -64 is just about memorable
    -128 is secure
    -1024 is the maximum
    -Bits> 128
    -Your password is: JAsJvRcgR-_veXNfy_sGmQ
    -Use this password? Please note that an obscured version of this
    -password (and not the password itself) will be stored under your
    -configuration file, so keep this generated password in a safe place.
    -y) Yes (default)
    -n) No
    -y/n>
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n>
    -Remote config
    ---------------------
    -[secret]
    -type = crypt
    -remote = remote:path
    -password = *** ENCRYPTED ***
    -password2 = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d>
    -

    Important The crypt password stored in rclone.conf is lightly obscured. That only protects it from cursory inspection. It is not secure unless configuration encryption of rclone.conf is specified.

    -

    A long passphrase is recommended, or rclone config can generate a random one.

    -

    The obscured password is created using AES-CTR with a static key. The salt is stored verbatim at the beginning of the obscured password. This static key is shared between all versions of rclone.

    -

    If you reconfigure rclone with the same passwords/passphrases elsewhere it will be compatible, but the obscured version will be different due to the different salt.

    -

    Rclone does not encrypt

    -
      -
    • file length - this can be calculated within 16 bytes
    • -
    • modification time - used for syncing
    • -
    -

    Specifying the remote

    -

    When configuring the remote to encrypt/decrypt, you may specify any string that rclone accepts as a source/destination of other commands.

    -

    The primary use case is to specify the path into an already configured remote (e.g. remote:path/to/dir or remote:bucket), such that data in a remote untrusted location can be stored encrypted.

    -

    You may also specify a local filesystem path, such as /path/to/dir on Linux, C:\path\to\dir on Windows. By creating a crypt remote pointing to such a local filesystem path, you can use rclone as a utility for pure local file encryption, for example to keep encrypted files on a removable USB drive.

    -

    Note: A string which do not contain a : will by rclone be treated as a relative path in the local filesystem. For example, if you enter the name remote without the trailing :, it will be treated as a subdirectory of the current directory with name "remote".

    -

    If a path remote:path/to/dir is specified, rclone stores encrypted files in path/to/dir on the remote. With file name encryption, files saved to secret:subdir/subfile are stored in the unencrypted path path/to/dir but the subdir/subpath element is encrypted.

    -

    The path you specify does not have to exist, rclone will create it when needed.

    -

    If you intend to use the wrapped remote both directly for keeping unencrypted content, as well as through a crypt remote for encrypted content, it is recommended to point the crypt remote to a separate directory within the wrapped remote. If you use a bucket-based storage system (e.g. Swift, S3, Google Compute Storage, B2) it is generally advisable to wrap the crypt remote around a specific bucket (s3:bucket). If wrapping around the entire root of the storage (s3:), and use the optional file name encryption, rclone will encrypt the bucket name.

    -

    Changing password

    -

    Should the password, or the configuration file containing a lightly obscured form of the password, be compromised, you need to re-encrypt your data with a new password. Since rclone uses secret-key encryption, where the encryption key is generated directly from the password kept on the client, it is not possible to change the password/key of already encrypted content. Just changing the password configured for an existing crypt remote means you will no longer able to decrypt any of the previously encrypted content. The only possibility is to re-upload everything via a crypt remote configured with your new password.

    -

    Depending on the size of your data, your bandwidth, storage quota etc, there are different approaches you can take: - If you have everything in a different location, for example on your local system, you could remove all of the prior encrypted files, change the password for your configured crypt remote (or delete and re-create the crypt configuration), and then re-upload everything from the alternative location. - If you have enough space on the storage system you can create a new crypt remote pointing to a separate directory on the same backend, and then use rclone to copy everything from the original crypt remote to the new, effectively decrypting everything on the fly using the old password and re-encrypting using the new password. When done, delete the original crypt remote directory and finally the rclone crypt configuration with the old password. All data will be streamed from the storage system and back, so you will get half the bandwidth and be charged twice if you have upload and download quota on the storage system.

    -

    Note: A security problem related to the random password generator was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 (released 2020-10-26) are not considered secure and should be changed. If you made up your own password, or used rclone version older than 1.49.0 or newer than 1.53.2 to generate it, you are not affected by this issue. See issue #4783 for more details, and a tool you can use to check if you are affected.

    -

    Example

    -

    Create the following file structure using "standard" file name encryption.

    -
    plaintext/
    -├── file0.txt
    -├── file1.txt
    -└── subdir
    -    ├── file2.txt
    -    ├── file3.txt
    -    └── subsubdir
    -        └── file4.txt
    -

    Copy these to the remote, and list them

    -
    $ rclone -q copy plaintext secret:
    -$ rclone -q ls secret:
    -        7 file1.txt
    -        6 file0.txt
    -        8 subdir/file2.txt
    -       10 subdir/subsubdir/file4.txt
    -        9 subdir/file3.txt
    -

    The crypt remote looks like

    -
    $ rclone -q ls remote:path
    -       55 hagjclgavj2mbiqm6u6cnjjqcg
    -       54 v05749mltvv1tf4onltun46gls
    -       57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo
    -       58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc
    -       56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps
    -

    The directory structure is preserved

    -
    $ rclone -q ls secret:subdir
    -        8 file2.txt
    -        9 file3.txt
    -       10 subsubdir/file4.txt
    -

    Without file name encryption .bin extensions are added to underlying names. This prevents the cloud provider attempting to interpret file content.

    -
    $ rclone -q ls remote:path
    -       54 file0.txt.bin
    -       57 subdir/file3.txt.bin
    -       56 subdir/file2.txt.bin
    -       58 subdir/subsubdir/file4.txt.bin
    -       55 file1.txt.bin
    -

    File name encryption modes

    -

    Off

    -
      -
    • doesn't hide file names or directory structure
    • -
    • allows for longer file names (~246 characters)
    • -
    • can use sub paths and copy single files
    • -
    -

    Standard

    -
      -
    • file names encrypted
    • -
    • file names can't be as long (~143 characters)
    • -
    • can use sub paths and copy single files
    • -
    • directory structure visible
    • -
    • identical files names will have identical uploaded names
    • -
    • can use shortcuts to shorten the directory recursion
    • -
    -

    Obfuscation

    -

    This is a simple "rotate" of the filename, with each file having a rot distance based on the filename. Rclone stores the distance at the beginning of the filename. A file called "hello" may become "53.jgnnq".

    -

    Obfuscation is not a strong encryption of filenames, but hinders automated scanning tools picking up on filename patterns. It is an intermediate between "off" and "standard" which allows for longer path segment names.

    -

    There is a possibility with some unicode based filenames that the obfuscation is weak and may map lower case characters to upper case equivalents.

    -

    Obfuscation cannot be relied upon for strong protection.

    -
      -
    • file names very lightly obfuscated
    • -
    • file names can be longer than standard encryption
    • -
    • can use sub paths and copy single files
    • -
    • directory structure visible
    • -
    • identical files names will have identical uploaded names
    • -
    -

    Cloud storage systems have limits on file name length and total path length which rclone is more likely to breach using "Standard" file name encryption. Where file names are less than 156 characters in length issues should not be encountered, irrespective of cloud storage provider.

    -

    An experimental advanced option filename_encoding is now provided to address this problem to a certain degree. For cloud storage systems with case sensitive file names (e.g. Google Drive), base64 can be used to reduce file name length. For cloud storage systems using UTF-16 to store file names internally (e.g. OneDrive), base32768 can be used to drastically reduce file name length.

    -

    An alternative, future rclone file name encryption mode may tolerate backend provider path length limits.

    -

    Directory name encryption

    -

    Crypt offers the option of encrypting dir names or leaving them intact. There are two options:

    -

    True

    -

    Encrypts the whole file path including directory names Example: 1/12/123.txt is encrypted to p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0

    -

    False

    -

    Only encrypts file names, skips directory names Example: 1/12/123.txt is encrypted to 1/12/qgm4avr35m5loi1th53ato71v0

    -

    Modified time and hashes

    -

    Crypt stores modification times using the underlying remote so support depends on that.

    -

    Hashes are not stored for crypt. However the data integrity is protected by an extremely strong crypto authenticator.

    -

    Use the rclone cryptcheck command to check the integrity of a crypted remote instead of rclone check which can't check the checksums properly.

    -

    Standard options

    -

    Here are the Standard options specific to crypt (Encrypt/Decrypt a remote).

    -

    --crypt-remote

    -

    Remote to encrypt/decrypt.

    -

    Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended).

    -

    Properties:

    -
      -
    • Config: remote
    • -
    • Env Var: RCLONE_CRYPT_REMOTE
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --crypt-filename-encryption

    -

    How to encrypt the filenames.

    -

    Properties:

    -
      -
    • Config: filename_encryption
    • -
    • Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION
    • -
    • Type: string
    • -
    • Default: "standard"
    • -
    • Examples: -
        -
      • "standard" -
          -
        • Encrypt the filenames.
        • -
        • See the docs for the details.
        • -
      • -
      • "obfuscate" -
          -
        • Very simple filename obfuscation.
        • -
      • -
      • "off" -
          -
        • Don't encrypt the file names.
        • -
        • Adds a ".bin" extension only.
        • -
      • -
    • -
    -

    --crypt-directory-name-encryption

    -

    Option to either encrypt directory names or leave them intact.

    -

    NB If filename_encryption is "off" then this option will do nothing.

    -

    Properties:

    -
      -
    • Config: directory_name_encryption
    • -
    • Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION
    • -
    • Type: bool
    • -
    • Default: true
    • -
    • Examples: -
        -
      • "true" -
          -
        • Encrypt directory names.
        • -
      • -
      • "false" -
          -
        • Don't encrypt directory names, leave them intact.
        • -
      • -
    • -
    -

    --crypt-password

    -

    Password or pass phrase for encryption.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: password
    • -
    • Env Var: RCLONE_CRYPT_PASSWORD
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --crypt-password2

    -

    Password or pass phrase for salt.

    -

    Optional but recommended. Should be different to the previous password.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: password2
    • -
    • Env Var: RCLONE_CRYPT_PASSWORD2
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote).

    -

    --crypt-server-side-across-configs

    -

    Allow server-side operations (e.g. copy) to work across different crypt configs.

    -

    Normally this option is not what you want, but if you have two crypts pointing to the same backend you can use it.

    -

    This can be used, for example, to change file name encryption type without re-uploading all the data. Just make two crypt backends pointing to two different directories with the single changed parameter and use rclone move to move the files between the crypt remotes.

    -

    Properties:

    -
      -
    • Config: server_side_across_configs
    • -
    • Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --crypt-show-mapping

    -

    For all files listed show how the names encrypt.

    -

    If this flag is set then for each file that the remote is asked to list, it will log (at level INFO) a line stating the decrypted file name and the encrypted file name.

    -

    This is so you can work out which encrypted names are which decrypted names just in case you need to do something with the encrypted file names, or for debugging purposes.

    -

    Properties:

    -
      -
    • Config: show_mapping
    • -
    • Env Var: RCLONE_CRYPT_SHOW_MAPPING
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --crypt-no-data-encryption

    -

    Option to either encrypt file data or leave it unencrypted.

    -

    Properties:

    -
      -
    • Config: no_data_encryption
    • -
    • Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION
    • -
    • Type: bool
    • -
    • Default: false
    • -
    • Examples: -
        -
      • "true" -
          -
        • Don't encrypt file data, leave it unencrypted.
        • -
      • -
      • "false" -
          -
        • Encrypt file data.
        • -
      • -
    • -
    -

    --crypt-filename-encoding

    -

    How to encode the encrypted filename to text string.

    -

    This option could help with shortening the encrypted filename. The suitable option would depend on the way your remote count the filename length and if it's case sensitive.

    -

    Properties:

    -
      -
    • Config: filename_encoding
    • -
    • Env Var: RCLONE_CRYPT_FILENAME_ENCODING
    • -
    • Type: string
    • -
    • Default: "base32"
    • -
    • Examples: -
        -
      • "base32" -
          -
        • Encode using base32. Suitable for all remote.
        • -
      • -
      • "base64" -
          -
        • Encode using base64. Suitable for case sensitive remote.
        • -
      • -
      • "base32768" -
          -
        • Encode using base32768. Suitable if your remote counts UTF-16 or
        • -
        • Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive)
        • -
      • -
    • -
    -

    Metadata

    -

    Any metadata supported by the underlying remote is read and written.

    -

    See the metadata docs for more info.

    -

    Backend commands

    -

    Here are the commands specific to the crypt backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    encode

    -

    Encode the given filename(s)

    -
    rclone backend encode remote: [options] [<arguments>+]
    -

    This encodes the filenames given as arguments returning a list of strings of the encoded results.

    -

    Usage Example:

    -
    rclone backend encode crypt: file1 [file2...]
    -rclone rc backend/command command=encode fs=crypt: file1 [file2...]
    -

    decode

    -

    Decode the given filename(s)

    -
    rclone backend decode remote: [options] [<arguments>+]
    -

    This decodes the filenames given as arguments returning a list of strings of the decoded results. It will return an error if any of the inputs are invalid.

    -

    Usage Example:

    -
    rclone backend decode crypt: encryptedfile1 [encryptedfile2...]
    -rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...]
    -

    Backing up a crypted remote

    -

    If you wish to backup a crypted remote, it is recommended that you use rclone sync on the encrypted files, and make sure the passwords are the same in the new encrypted remote.

    -

    This will have the following advantages

    -
      -
    • rclone sync will check the checksums while copying
    • -
    • you can use rclone check between the encrypted remotes
    • -
    • you don't decrypt and encrypt unnecessarily
    • -
    -

    For example, let's say you have your original remote at remote: with the encrypted version at eremote: with path remote:crypt. You would then set up the new remote remote2: and then the encrypted version eremote2: with path remote2:crypt using the same passwords as eremote:.

    -

    To sync the two remotes you would do

    -
    rclone sync --interactive remote:crypt remote2:crypt
    -

    And to check the integrity you would do

    -
    rclone check remote:crypt remote2:crypt
    -

    File formats

    -

    File encryption

    -

    Files are encrypted 1:1 source file to destination object. The file has a header and is divided into chunks.

    -

    Header

    -
      -
    • 8 bytes magic string RCLONE\x00\x00
    • -
    • 24 bytes Nonce (IV)
    • -
    -

    The initial nonce is generated from the operating systems crypto strong random number generator. The nonce is incremented for each chunk read making sure each nonce is unique for each block written. The chance of a nonce being re-used is minuscule. If you wrote an exabyte of data (10¹⁸ bytes) you would have a probability of approximately 2×10⁻³² of re-using a nonce.

    -

    Chunk

    -

    Each chunk will contain 64 KiB of data, except for the last one which may have less data. The data chunk is in standard NaCl SecretBox format. SecretBox uses XSalsa20 and Poly1305 to encrypt and authenticate messages.

    -

    Each chunk contains:

    -
      -
    • 16 Bytes of Poly1305 authenticator
    • -
    • 1 - 65536 bytes XSalsa20 encrypted data
    • -
    -

    64k chunk size was chosen as the best performing chunk size (the authenticator takes too much time below this and the performance drops off due to cache effects above this). Note that these chunks are buffered in memory so they can't be too big.

    -

    This uses a 32 byte (256 bit key) key derived from the user password.

    -

    Examples

    -

    1 byte file will encrypt to

    -
      -
    • 32 bytes header
    • -
    • 17 bytes data chunk
    • -
    -

    49 bytes total

    -

    1 MiB (1048576 bytes) file will encrypt to

    -
      -
    • 32 bytes header
    • -
    • 16 chunks of 65568 bytes
    • -
    -

    1049120 bytes total (a 0.05% overhead). This is the overhead for big files.

    -

    Name encryption

    -

    File names are encrypted segment by segment - the path is broken up into / separated strings and these are encrypted individually.

    -

    File segments are padded using PKCS#7 to a multiple of 16 bytes before encryption.

    -

    They are then encrypted with EME using AES with 256 bit key. EME (ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway.

    -

    This makes for deterministic encryption which is what we want - the same filename must encrypt to the same thing otherwise we can't find it on the cloud storage system.

    -

    This means that

    -
      -
    • filenames with the same name will encrypt the same
    • -
    • filenames which start the same won't have a common prefix
    • -
    -

    This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of which are derived from the user password.

    -

    After encryption they are written out using a modified version of standard base32 encoding as described in RFC4648. The standard encoding is modified in two ways:

    -
      -
    • it becomes lower case (no-one likes upper case filenames!)
    • -
    • we strip the padding character =
    • -
    -

    base32 is used rather than the more efficient base64 so rclone can be used on case insensitive remotes (e.g. Windows, Amazon Drive).

    -

    Key derivation

    -

    Rclone uses scrypt with parameters N=16384, r=8, p=1 with an optional user supplied salt (password2) to derive the 32+32+16 = 80 bytes of key material required. If the user doesn't supply a salt then rclone uses an internal one.

    -

    scrypt makes it impractical to mount a dictionary attack on rclone encrypted data. For full protection against this you should always use a salt.

    -

    SEE ALSO

    - -

    Compress

    -

    Warning

    -

    This remote is currently experimental. Things may break and data may be lost. Anything you do with this remote is at your own risk. Please understand the risks associated with using experimental code and don't use this remote in critical applications.

    -

    The Compress remote adds compression to another remote. It is best used with remotes containing many large compressible files.

    -

    Configuration

    -

    To use this remote, all you need to do is specify another remote and a compression mode to use:

    -
    Current remotes:
    -
    -Name                 Type
    -====                 ====
    -remote_to_press      sometype
    -
    -e) Edit existing remote
    -$ rclone config
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> n
    -name> compress
    -...
    - 8 / Compress a remote
    -   \ "compress"
    -...
    -Storage> compress
    -** See help for compress backend at: https://rclone.org/compress/ **
    -
    -Remote to compress.
    -Enter a string value. Press Enter for the default ("").
    -remote> remote_to_press:subdir 
    -Compression mode.
    -Enter a string value. Press Enter for the default ("gzip").
    -Choose a number from below, or type in your own value
    - 1 / Gzip compression balanced for speed and compression strength.
    -   \ "gzip"
    -compression_mode> gzip
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[compress]
    -type = compress
    -remote = remote_to_press:subdir
    -compression_mode = gzip
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Compression Modes

    -

    Currently only gzip compression is supported. It provides a decent balance between speed and size and is well supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no compression and 9 is strongest compression.

    -

    File types

    -

    If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to the compression algorithm you chose. These files are standard files that can be opened by various archive programs, but they have some hidden metadata that allows them to be used by rclone. While you may download and decompress these files at will, do not manually delete or rename files. Files without correct metadata files will not be recognized by rclone.

    -

    File names

    -

    The compressed files will be named *.###########.gz where * is the base file and the # part is base64 encoded size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend.

    -

    Standard options

    -

    Here are the Standard options specific to compress (Compress a remote).

    -

    --compress-remote

    -

    Remote to compress.

    -

    Properties:

    -
      -
    • Config: remote
    • -
    • Env Var: RCLONE_COMPRESS_REMOTE
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --compress-mode

    -

    Compression mode.

    -

    Properties:

    -
      -
    • Config: mode
    • -
    • Env Var: RCLONE_COMPRESS_MODE
    • -
    • Type: string
    • -
    • Default: "gzip"
    • -
    • Examples: -
        -
      • "gzip" -
          -
        • Standard gzip compression with fastest parameters.
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to compress (Compress a remote).

    -

    --compress-level

    -

    GZIP compression level (-2 to 9).

    -

    Generally -1 (default, equivalent to 5) is recommended. Levels 1 to 9 increase compression at the cost of speed. Going past 6 generally offers very little return.

    -

    Level -2 uses Huffman encoding only. Only use if you know what you are doing. Level 0 turns off compression.

    -

    Properties:

    -
      -
    • Config: level
    • -
    • Env Var: RCLONE_COMPRESS_LEVEL
    • -
    • Type: int
    • -
    • Default: -1
    • -
    -

    --compress-ram-cache-limit

    -

    Some remotes don't allow the upload of files with unknown size. In this case the compressed file will need to be cached to determine it's size.

    -

    Files smaller than this limit will be cached in RAM, files larger than this limit will be cached on disk.

    -

    Properties:

    -
      -
    • Config: ram_cache_limit
    • -
    • Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT
    • -
    • Type: SizeSuffix
    • -
    • Default: 20Mi
    • -
    -

    Metadata

    -

    Any metadata supported by the underlying remote is read and written.

    -

    See the metadata docs for more info.

    -

    Combine

    -

    The combine backend joins remotes together into a single directory tree.

    -

    For example you might have a remote for images on one provider:

    -
    $ rclone tree s3:imagesbucket
    -/
    -├── image1.jpg
    -└── image2.jpg
    -

    And a remote for files on another:

    -
    $ rclone tree drive:important/files
    -/
    -├── file1.txt
    -└── file2.txt
    -

    The combine backend can join these together into a synthetic directory structure like this:

    -
    $ rclone tree combined:
    -/
    -├── files
    -│   ├── file1.txt
    -│   └── file2.txt
    -└── images
    -    ├── image1.jpg
    -    └── image2.jpg
    -

    You'd do this by specifying an upstreams parameter in the config like this

    -
    upstreams = images=s3:imagesbucket files=drive:important/files
    -

    During the initial setup with rclone config you will specify the upstreams remotes as a space separated list. The upstream remotes can either be a local paths or other remotes.

    -

    Configuration

    -

    Here is an example of how to make a combine called remote for the example above. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -...
    -XX / Combine several remotes into one
    -   \ (combine)
    -...
    -Storage> combine
    -Option upstreams.
    -Upstreams for combining
    -These should be in the form
    -    dir=remote:path dir2=remote2:path
    -Where before the = is specified the root directory and after is the remote to
    -put there.
    -Embedded spaces can be added using quotes
    -    "dir=remote:path with space" "dir2=remote2:path with space"
    -Enter a fs.SpaceSepList value.
    -upstreams> images=s3:imagesbucket files=drive:important/files
    ---------------------
    -[remote]
    -type = combine
    -upstreams = images=s3:imagesbucket files=drive:important/files
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Configuring for Google Drive Shared Drives

    -

    Rclone has a convenience feature for making a combine backend for all the shared drives you have access to.

    -

    Assuming your main (non shared drive) Google drive remote is called drive: you would run

    -
    rclone backend -o config drives drive:
    -

    This would produce something like this:

    -
    [My Drive]
    -type = alias
    -remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
    -
    -[Test Drive]
    -type = alias
    -remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
    -
    -[AllDrives]
    -type = combine
    -upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
    -

    If you then add that config to your config file (find it with rclone config file) then you can access all the shared drives in one place with the AllDrives: remote.

    -

    See the Google Drive docs for full info.

    -

    Standard options

    -

    Here are the Standard options specific to combine (Combine several remotes into one).

    -

    --combine-upstreams

    -

    Upstreams for combining

    -

    These should be in the form

    -
    dir=remote:path dir2=remote2:path
    -

    Where before the = is specified the root directory and after is the remote to put there.

    -

    Embedded spaces can be added using quotes

    -
    "dir=remote:path with space" "dir2=remote2:path with space"
    -

    Properties:

    -
      -
    • Config: upstreams
    • -
    • Env Var: RCLONE_COMBINE_UPSTREAMS
    • -
    • Type: SpaceSepList
    • -
    • Default:
    • -
    -

    Metadata

    -

    Any metadata supported by the underlying remote is read and written.

    -

    See the metadata docs for more info.

    -

    Dropbox

    -

    Paths are specified as remote:path

    -

    Dropbox paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    Configuration

    -

    The initial setup for dropbox involves getting a token from Dropbox which you need to do in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    n) New remote
    -d) Delete remote
    -q) Quit config
    -e/n/d/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Dropbox
    -   \ "dropbox"
    -[snip]
    -Storage> dropbox
    -Dropbox App Key - leave blank normally.
    -app_key>
    -Dropbox App Secret - leave blank normally.
    -app_secret>
    -Remote config
    -Please visit:
    -https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code
    -Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX
    ---------------------
    -[remote]
    -app_key =
    -app_secret =
    -token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Dropbox. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and it may require you to unblock it temporarily if you are running a host firewall, or use manual mode.

    -

    You can then use it like this,

    -

    List directories in top level of your dropbox

    -
    rclone lsd remote:
    -

    List all the files in your dropbox

    -
    rclone ls remote:
    -

    To copy a local directory to a dropbox directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Dropbox for business

    -

    Rclone supports Dropbox for business and Team Folders.

    -

    When using Dropbox for business remote: and remote:path/to/file will refer to your personal folder.

    -

    If you wish to see Team Folders you must use a leading / in the path, so rclone lsd remote:/ will refer to the root and show you all Team Folders and your User Folder.

    -

    You can then use team folders like this remote:/TeamFolder and remote:/TeamFolder/path/to/file.

    -

    A leading / for a Dropbox personal account will do nothing, but it will take an extra HTTP transaction so it should be avoided.

    -

    Modified time and Hashes

    -

    Dropbox supports modified times, but the only way to set a modification time is to re-upload the file.

    -

    This means that if you uploaded your data with an older version of rclone which didn't support the v2 API and modified times, rclone will decide to upload all your old data to fix the modification times. If you don't want this to happen use --size-only or --checksum flag to stop it.

    -

    Dropbox supports its own hash type which is checked for all transfers.

    -

    Restricted filename characters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    NUL0x00
    /0x2F
    DEL0x7F
    \0x5C
    -

    File names can also not end with the following characters. These only get replaced if they are the last character in the name:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    SP0x20
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Batch mode uploads

    -

    Using batch mode uploads is very important for performance when using the Dropbox API. See the dropbox performance guide for more info.

    -

    There are 3 modes rclone can use for uploads.

    -

    --dropbox-batch-mode off

    -

    In this mode rclone will not use upload batching. This was the default before rclone v1.55. It has the disadvantage that it is very likely to encounter too_many_requests errors like this

    -
    NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds.
    -

    When rclone receives these it has to wait for 15s or sometimes 300s before continuing which really slows down transfers.

    -

    This will happen especially if --transfers is large, so this mode isn't recommended except for compatibility or investigating problems.

    -

    --dropbox-batch-mode sync

    -

    In this mode rclone will batch up uploads to the size specified by --dropbox-batch-size and commit them together.

    -

    Using this mode means you can use a much higher --transfers parameter (32 or 64 works fine) without receiving too_many_requests errors.

    -

    This mode ensures full data integrity.

    -

    Note that there may be a pause when quitting rclone while rclone finishes up the last batch using this mode.

    -

    --dropbox-batch-mode async

    -

    In this mode rclone will batch up uploads to the size specified by --dropbox-batch-size and commit them together.

    -

    However it will not wait for the status of the batch to be returned to the caller. This means rclone can use a much bigger batch size (much bigger than --transfers), at the cost of not being able to check the status of the upload.

    -

    This provides the maximum possible upload speed especially with lots of small files, however rclone can't check the file got uploaded properly using this mode.

    -

    If you are using this mode then using "rclone check" after the transfer completes is recommended. Or you could do an initial transfer with --dropbox-batch-mode async then do a final transfer with --dropbox-batch-mode sync (the default).

    -

    Note that there may be a pause when quitting rclone while rclone finishes up the last batch using this mode.

    -

    Standard options

    -

    Here are the Standard options specific to dropbox (Dropbox).

    -

    --dropbox-client-id

    -

    OAuth Client Id.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_DROPBOX_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --dropbox-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_DROPBOX_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to dropbox (Dropbox).

    -

    --dropbox-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_DROPBOX_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --dropbox-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_DROPBOX_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --dropbox-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_DROPBOX_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --dropbox-chunk-size

    -

    Upload chunk size (< 150Mi).

    -

    Any files larger than this will be uploaded in chunks of this size.

    -

    Note that chunks are buffered in memory (one at a time) so rclone can deal with retries. Setting this larger will increase the speed slightly (at most 10% for 128 MiB in tests) at the cost of using more memory. It can be set smaller if you are tight on memory.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_DROPBOX_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 48Mi
    • -
    -

    --dropbox-impersonate

    -

    Impersonate this user when using a business account.

    -

    Note that if you want to use impersonate, you should make sure this flag is set when running "rclone config" as this will cause rclone to request the "members.read" scope which it won't normally. This is needed to lookup a members email address into the internal ID that dropbox uses in the API.

    -

    Using the "members.read" scope will require a Dropbox Team Admin to approve during the OAuth flow.

    -

    You will have to use your own App (setting your own client_id and client_secret) to use this option as currently rclone's default set of permissions doesn't include "members.read". This can be added once v1.55 or later is in use everywhere.

    -

    Properties:

    -
      -
    • Config: impersonate
    • -
    • Env Var: RCLONE_DROPBOX_IMPERSONATE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --dropbox-shared-files

    -

    Instructs rclone to work on individual shared files.

    -

    In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) operations and read operations (e.g. downloading) are supported in this mode. All other operations will be disabled.

    -

    Properties:

    -
      -
    • Config: shared_files
    • -
    • Env Var: RCLONE_DROPBOX_SHARED_FILES
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --dropbox-shared-folders

    -

    Instructs rclone to work on shared folders.

    -

    When this flag is used with no path only the List operation is supported and all available shared folders will be listed. If you specify a path the first part will be interpreted as the name of shared folder. Rclone will then try to mount this shared to the root namespace. On success shared folder rclone proceeds normally. The shared folder is now pretty much a normal folder and all normal operations are supported.

    -

    Note that we don't unmount the shared folder afterwards so the --dropbox-shared-folders can be omitted after the first use of a particular shared folder.

    -

    Properties:

    -
      -
    • Config: shared_folders
    • -
    • Env Var: RCLONE_DROPBOX_SHARED_FOLDERS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --dropbox-batch-mode

    -

    Upload file batching sync|async|off.

    -

    This sets the batch mode used by rclone.

    -

    For full info see the main docs

    -

    This has 3 possible values

    -
      -
    • off - no batching
    • -
    • sync - batch uploads and check completion (default)
    • -
    • async - batch upload and don't check completion
    • -
    -

    Rclone will close any outstanding batches when it exits which may make a delay on quit.

    -

    Properties:

    -
      -
    • Config: batch_mode
    • -
    • Env Var: RCLONE_DROPBOX_BATCH_MODE
    • -
    • Type: string
    • -
    • Default: "sync"
    • -
    -

    --dropbox-batch-size

    -

    Max number of files in upload batch.

    -

    This sets the batch size of files to upload. It has to be less than 1000.

    -

    By default this is 0 which means rclone which calculate the batch size depending on the setting of batch_mode.

    -
      -
    • batch_mode: async - default batch_size is 100
    • -
    • batch_mode: sync - default batch_size is the same as --transfers
    • -
    • batch_mode: off - not in use
    • -
    -

    Rclone will close any outstanding batches when it exits which may make a delay on quit.

    -

    Setting this is a great idea if you are uploading lots of small files as it will make them a lot quicker. You can use --transfers 32 to maximise throughput.

    -

    Properties:

    -
      -
    • Config: batch_size
    • -
    • Env Var: RCLONE_DROPBOX_BATCH_SIZE
    • -
    • Type: int
    • -
    • Default: 0
    • -
    -

    --dropbox-batch-timeout

    -

    Max time to allow an idle upload batch before uploading.

    -

    If an upload batch is idle for more than this long then it will be uploaded.

    -

    The default for this is 0 which means rclone will choose a sensible default based on the batch_mode in use.

    -
      -
    • batch_mode: async - default batch_timeout is 500ms
    • -
    • batch_mode: sync - default batch_timeout is 10s
    • -
    • batch_mode: off - not in use
    • -
    -

    Properties:

    -
      -
    • Config: batch_timeout
    • -
    • Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT
    • -
    • Type: Duration
    • -
    • Default: 0s
    • -
    -

    --dropbox-batch-commit-timeout

    -

    Max time to wait for a batch to finish committing

    -

    Properties:

    -
      -
    • Config: batch_commit_timeout
    • -
    • Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT
    • -
    • Type: Duration
    • -
    • Default: 10m0s
    • -
    -

    --dropbox-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_DROPBOX_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    Note that Dropbox is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    There are some file names such as thumbs.db which Dropbox can't store. There is a full list of them in the "Ignored Files" section of this document. Rclone will issue an error message File name disallowed - not uploading if it attempts to upload one of those file names, but the sync won't fail.

    -

    Some errors may occur if you try to sync copyright-protected files because Dropbox has its own copyright detector that prevents this sort of file being downloaded. This will return the error ERROR : /path/to/your/file: Failed to copy: failed to open source object: path/restricted_content/.

    -

    If you have more than 10,000 files in a directory then rclone purge dropbox:dir will return the error Failed to purge: There are too many files involved in this operation. As a work-around do an rclone delete dropbox:dir followed by an rclone rmdir dropbox:dir.

    -

    When using rclone link you'll need to set --expire if using a non-personal account otherwise the visibility may not be correct. (Note that --expire isn't supported on personal accounts). See the forum discussion and the dropbox SDK issue.

    -

    Get your own Dropbox App ID

    -

    When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users.

    -

    Here is how to create your own Dropbox App ID for rclone:

    -
      -
    1. Log into the Dropbox App console with your Dropbox Account (It need not to be the same account as the Dropbox you want to access)

    2. -
    3. Choose an API => Usually this should be Dropbox API

    4. -
    5. Choose the type of access you want to use => Full Dropbox or App Folder

    6. -
    7. Name your App. The app name is global, so you can't use rclone for example

    8. -
    9. Click the button Create App

    10. -
    11. Switch to the Permissions tab. Enable at least the following permissions: account_info.read, files.metadata.write, files.content.write, files.content.read, sharing.write. The files.metadata.read and sharing.read checkboxes will be marked too. Click Submit

    12. -
    13. Switch to the Settings tab. Fill OAuth2 - Redirect URIs as http://localhost:53682/

    14. -
    15. Find the App key and App secret values on the Settings tab. Use these values in rclone config to add a new remote or edit an existing remote. The App key setting corresponds to client_id in rclone config, the App secret corresponds to client_secret

    16. -
    -

    Enterprise File Fabric

    -

    This backend supports Storage Made Easy's Enterprise File Fabric™ which provides a software solution to integrate and unify File and Object Storage accessible through a global file system.

    -

    Configuration

    -

    The initial setup for the Enterprise File Fabric backend involves getting a token from the Enterprise File Fabric which you need to do in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Enterprise File Fabric
    -   \ "filefabric"
    -[snip]
    -Storage> filefabric
    -** See help for filefabric backend at: https://rclone.org/filefabric/ **
    -
    -URL of the Enterprise File Fabric to connect to
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Storage Made Easy US
    -   \ "https://storagemadeeasy.com"
    - 2 / Storage Made Easy EU
    -   \ "https://eu.storagemadeeasy.com"
    - 3 / Connect to your Enterprise File Fabric
    -   \ "https://yourfabric.smestorage.com"
    -url> https://yourfabric.smestorage.com/
    -ID of the root folder
    -Leave blank normally.
    -
    -Fill in to make rclone start with directory of a given ID.
    -
    -Enter a string value. Press Enter for the default ("").
    -root_folder_id> 
    -Permanent Authentication Token
    -
    -A Permanent Authentication Token can be created in the Enterprise File
    -Fabric, on the users Dashboard under Security, there is an entry
    -you'll see called "My Authentication Tokens". Click the Manage button
    -to create one.
    -
    -These tokens are normally valid for several years.
    -
    -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens
    -
    -Enter a string value. Press Enter for the default ("").
    -permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[remote]
    -type = filefabric
    -url = https://yourfabric.smestorage.com/
    -permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your Enterprise File Fabric

    -
    rclone lsd remote:
    -

    List all the files in your Enterprise File Fabric

    -
    rclone ls remote:
    -

    To copy a local directory to an Enterprise File Fabric directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Modified time and hashes

    -

    The Enterprise File Fabric allows modification times to be set on files accurate to 1 second. These will be used to detect whether objects need syncing or not.

    -

    The Enterprise File Fabric does not support any data hashes at this time.

    -

    Restricted filename characters

    -

    The default restricted characters set will be replaced.

    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Empty files

    -

    Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore upload an empty file as a single space with a mime type of application/vnd.rclone.empty.file and files with that mime type are treated as empty.

    -

    Root folder ID

    -

    You can set the root_folder_id for rclone. This is the directory (identified by its Folder ID) that rclone considers to be the root of your Enterprise File Fabric.

    -

    Normally you will leave this blank and rclone will determine the correct root to use itself.

    -

    However you can set this to restrict rclone to a specific folder hierarchy.

    -

    In order to do this you will have to find the Folder ID of the directory you wish rclone to display. These aren't displayed in the web interface, but you can use rclone lsf to find them, for example

    -
    $ rclone lsf --dirs-only -Fip --csv filefabric:
    -120673758,Burnt PDFs/
    -120673759,My Quick Uploads/
    -120673755,My Syncs/
    -120673756,My backups/
    -120673757,My contacts/
    -120673761,S3 Storage/
    -

    The ID for "S3 Storage" would be 120673761.

    -

    Standard options

    -

    Here are the Standard options specific to filefabric (Enterprise File Fabric).

    -

    --filefabric-url

    -

    URL of the Enterprise File Fabric to connect to.

    -

    Properties:

    -
      -
    • Config: url
    • -
    • Env Var: RCLONE_FILEFABRIC_URL
    • -
    • Type: string
    • -
    • Required: true
    • -
    • Examples: -
        -
      • "https://storagemadeeasy.com" -
          -
        • Storage Made Easy US
        • -
      • -
      • "https://eu.storagemadeeasy.com" -
          -
        • Storage Made Easy EU
        • -
      • -
      • "https://yourfabric.smestorage.com" -
          -
        • Connect to your Enterprise File Fabric
        • -
      • -
    • -
    -

    --filefabric-root-folder-id

    -

    ID of the root folder.

    -

    Leave blank normally.

    -

    Fill in to make rclone start with directory of a given ID.

    -

    Properties:

    -
      -
    • Config: root_folder_id
    • -
    • Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --filefabric-permanent-token

    -

    Permanent Authentication Token.

    -

    A Permanent Authentication Token can be created in the Enterprise File Fabric, on the users Dashboard under Security, there is an entry you'll see called "My Authentication Tokens". Click the Manage button to create one.

    -

    These tokens are normally valid for several years.

    -

    For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens

    -

    Properties:

    -
      -
    • Config: permanent_token
    • -
    • Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to filefabric (Enterprise File Fabric).

    -

    --filefabric-token

    -

    Session Token.

    -

    This is a session token which rclone caches in the config file. It is usually valid for 1 hour.

    -

    Don't set this value - rclone will set it automatically.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_FILEFABRIC_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --filefabric-token-expiry

    -

    Token expiry time.

    -

    Don't set this value - rclone will set it automatically.

    -

    Properties:

    -
      -
    • Config: token_expiry
    • -
    • Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --filefabric-version

    -

    Version read from the file fabric.

    -

    Don't set this value - rclone will set it automatically.

    -

    Properties:

    -
      -
    • Config: version
    • -
    • Env Var: RCLONE_FILEFABRIC_VERSION
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --filefabric-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_FILEFABRIC_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    FTP

    -

    FTP is the File Transfer Protocol. Rclone FTP support is provided using the github.com/jlaffaye/ftp package.

    -

    Limitations of Rclone's FTP backend

    -

    Paths are specified as remote:path. If the path does not begin with a / it is relative to the home directory of the user. An empty path remote: refers to the user's home directory.

    -

    Configuration

    -

    To create an FTP configuration named remote, run

    -
    rclone config
    -

    Rclone config guides you through an interactive setup process. A minimal rclone FTP remote definition only requires host, username and password. For an anonymous FTP server, see below.

    -
    No remotes found, make a new one?
    -n) New remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -n/r/c/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / FTP
    -   \ "ftp"
    -[snip]
    -Storage> ftp
    -** See help for ftp backend at: https://rclone.org/ftp/ **
    -
    -FTP host to connect to
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Connect to ftp.example.com
    -   \ "ftp.example.com"
    -host> ftp.example.com
    -FTP username
    -Enter a string value. Press Enter for the default ("$USER").
    -user> 
    -FTP port number
    -Enter a signed integer. Press Enter for the default (21).
    -port> 
    -FTP password
    -y) Yes type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Use FTP over TLS (Implicit)
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -tls> 
    -Use FTP over TLS (Explicit)
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -explicit_tls> 
    -Remote config
    ---------------------
    -[remote]
    -type = ftp
    -host = ftp.example.com
    -pass = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    To see all directories in the home directory of remote

    -
    rclone lsd remote:
    -

    Make a new directory

    -
    rclone mkdir remote:path/to/directory
    -

    List the contents of a directory

    -
    rclone ls remote:path/to/directory
    -

    Sync /home/local/directory to the remote directory, deleting any excess files in the directory.

    -
    rclone sync --interactive /home/local/directory remote:directory
    -

    Anonymous FTP

    -

    When connecting to a FTP server that allows anonymous login, you can use the special "anonymous" username. Traditionally, this user account accepts any string as a password, although it is common to use either the password "anonymous" or "guest". Some servers require the use of a valid e-mail address as password.

    -

    Using on-the-fly or connection string remotes makes it easy to access such servers, without requiring any configuration in advance. The following are examples of that:

    -
    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy)
    -rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy):
    -

    The above examples work in Linux shells and in PowerShell, but not Windows Command Prompt. They execute the rclone obscure command to create a password string in the format required by the pass option. The following examples are exactly the same, except use an already obscured string representation of the same password "dummy", and therefore works even in Windows Command Prompt:

    -
    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM
    -rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM:
    -

    Implicit TLS

    -

    Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to be enabled in the FTP backend config for the remote, or with --ftp-tls. The default FTPS port is 990, not 21 and can be set with --ftp-port.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    -

    File names cannot end with the following characters. Replacement is limited to the last character in a file name:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    SP0x20
    -

    Not all FTP servers can have all characters in file names, for example:

    - - - - - - - - - - - - - - - - - -
    FTP ServerForbidden characters
    proftpd*
    pureftpd\ [ ]
    -

    This backend's interactive configuration wizard provides a selection of sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. Just hit a selection number when prompted.

    -

    Standard options

    -

    Here are the Standard options specific to ftp (FTP).

    -

    --ftp-host

    -

    FTP host to connect to.

    -

    E.g. "ftp.example.com".

    -

    Properties:

    -
      -
    • Config: host
    • -
    • Env Var: RCLONE_FTP_HOST
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --ftp-user

    -

    FTP username.

    -

    Properties:

    -
      -
    • Config: user
    • -
    • Env Var: RCLONE_FTP_USER
    • -
    • Type: string
    • -
    • Default: "$USER"
    • -
    -

    --ftp-port

    -

    FTP port number.

    -

    Properties:

    -
      -
    • Config: port
    • -
    • Env Var: RCLONE_FTP_PORT
    • -
    • Type: int
    • -
    • Default: 21
    • -
    -

    --ftp-pass

    -

    FTP password.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: pass
    • -
    • Env Var: RCLONE_FTP_PASS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --ftp-tls

    -

    Use Implicit FTPS (FTP over TLS).

    -

    When using implicit FTP over TLS the client connects using TLS right from the start which breaks compatibility with non-TLS-aware servers. This is usually served over port 990 rather than port 21. Cannot be used in combination with explicit FTPS.

    -

    Properties:

    -
      -
    • Config: tls
    • -
    • Env Var: RCLONE_FTP_TLS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-explicit-tls

    -

    Use Explicit FTPS (FTP over TLS).

    -

    When using explicit FTP over TLS the client explicitly requests security from the server in order to upgrade a plain text connection to an encrypted one. Cannot be used in combination with implicit FTPS.

    -

    Properties:

    -
      -
    • Config: explicit_tls
    • -
    • Env Var: RCLONE_FTP_EXPLICIT_TLS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to ftp (FTP).

    -

    --ftp-concurrency

    -

    Maximum number of FTP simultaneous connections, 0 for unlimited.

    -

    Note that setting this is very likely to cause deadlocks so it should be used with care.

    -

    If you are doing a sync or copy then make sure concurrency is one more than the sum of --transfers and --checkers.

    -

    If you use --check-first then it just needs to be one more than the maximum of --checkers and --transfers.

    -

    So for concurrency 3 you'd use --checkers 2 --transfers 2 --check-first or --checkers 1 --transfers 1.

    -

    Properties:

    -
      -
    • Config: concurrency
    • -
    • Env Var: RCLONE_FTP_CONCURRENCY
    • -
    • Type: int
    • -
    • Default: 0
    • -
    -

    --ftp-no-check-certificate

    -

    Do not verify the TLS certificate of the server.

    -

    Properties:

    -
      -
    • Config: no_check_certificate
    • -
    • Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-disable-epsv

    -

    Disable using EPSV even if server advertises support.

    -

    Properties:

    -
      -
    • Config: disable_epsv
    • -
    • Env Var: RCLONE_FTP_DISABLE_EPSV
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-disable-mlsd

    -

    Disable using MLSD even if server advertises support.

    -

    Properties:

    -
      -
    • Config: disable_mlsd
    • -
    • Env Var: RCLONE_FTP_DISABLE_MLSD
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-disable-utf8

    -

    Disable using UTF-8 even if server advertises support.

    -

    Properties:

    -
      -
    • Config: disable_utf8
    • -
    • Env Var: RCLONE_FTP_DISABLE_UTF8
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-writing-mdtm

    -

    Use MDTM to set modification time (VsFtpd quirk)

    -

    Properties:

    -
      -
    • Config: writing_mdtm
    • -
    • Env Var: RCLONE_FTP_WRITING_MDTM
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-force-list-hidden

    -

    Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD.

    -

    Properties:

    -
      -
    • Config: force_list_hidden
    • -
    • Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-idle-timeout

    -

    Max time before closing idle connections.

    -

    If no connections have been returned to the connection pool in the time given, rclone will empty the connection pool.

    -

    Set to 0 to keep connections indefinitely.

    -

    Properties:

    -
      -
    • Config: idle_timeout
    • -
    • Env Var: RCLONE_FTP_IDLE_TIMEOUT
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --ftp-close-timeout

    -

    Maximum time to wait for a response to close.

    -

    Properties:

    -
      -
    • Config: close_timeout
    • -
    • Env Var: RCLONE_FTP_CLOSE_TIMEOUT
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --ftp-tls-cache-size

    -

    Size of TLS session cache for all control and data connections.

    -

    TLS cache allows to resume TLS sessions and reuse PSK between connections. Increase if default size is not enough resulting in TLS resumption errors. Enabled by default. Use 0 to disable.

    -

    Properties:

    -
      -
    • Config: tls_cache_size
    • -
    • Env Var: RCLONE_FTP_TLS_CACHE_SIZE
    • -
    • Type: int
    • -
    • Default: 32
    • -
    -

    --ftp-disable-tls13

    -

    Disable TLS 1.3 (workaround for FTP servers with buggy TLS)

    -

    Properties:

    -
      -
    • Config: disable_tls13
    • -
    • Env Var: RCLONE_FTP_DISABLE_TLS13
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-shut-timeout

    -

    Maximum time to wait for data connection closing status.

    -

    Properties:

    -
      -
    • Config: shut_timeout
    • -
    • Env Var: RCLONE_FTP_SHUT_TIMEOUT
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --ftp-ask-password

    -

    Allow asking for FTP password when needed.

    -

    If this is set and no password is supplied then rclone will ask for a password

    -

    Properties:

    -
      -
    • Config: ask_password
    • -
    • Env Var: RCLONE_FTP_ASK_PASSWORD
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --ftp-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_FTP_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,Del,Ctl,RightSpace,Dot
    • -
    • Examples: -
        -
      • "Asterisk,Ctl,Dot,Slash" -
          -
        • ProFTPd can't handle '*' in file names
        • -
      • -
      • "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" -
          -
        • PureFTPd can't handle '[]' or '*' in file names
        • -
      • -
      • "Ctl,LeftPeriod,Slash" -
          -
        • VsFTPd can't handle file names starting with dot
        • -
      • -
    • -
    -

    Limitations

    -

    FTP servers acting as rclone remotes must support passive mode. The mode cannot be configured as passive is the only supported one. Rclone's FTP implementation is not compatible with active mode as the library it uses doesn't support it. This will likely never be supported due to security concerns.

    -

    Rclone's FTP backend does not support any checksums but can compare file sizes.

    -

    rclone about is not supported by the FTP backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    The implementation of : --dump headers, --dump bodies, --dump auth for debugging isn't the same as for rclone HTTP based backends - it has less fine grained control.

    -

    --timeout isn't supported (but --contimeout is).

    -

    --bind isn't supported.

    -

    Rclone's FTP backend could support server-side move but does not at present.

    -

    The ftp_proxy environment variable is not currently supported.

    -

    Modified time

    -

    File modification time (timestamps) is supported to 1 second resolution for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. The VsFTPd server has non-standard implementation of time related protocol commands and needs a special configuration setting: writing_mdtm = true.

    -

    Support for precise file time with other FTP servers varies depending on what protocol extensions they advertise. If all the MLSD, MDTM and MFTM extensions are present, rclone will use them together to provide precise time. Otherwise the times you see on the FTP server through rclone are those of the last file upload.

    -

    You can use the following command to check whether rclone can use precise time with your FTP server: rclone backend features your_ftp_remote: (the trailing colon is important). Look for the number in the line tagged by Precision designating the remote time precision expressed as nanoseconds. A value of 1000000000 means that file time precision of 1 second is available. A value of 3153600000000000000 (or another large number) means "unsupported".

    -

    Google Cloud Storage

    -

    Paths are specified as remote:bucket (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:bucket/path/to/dir.

    -

    Configuration

    -

    The initial setup for google cloud storage involves getting a token from Google Cloud Storage which you need to do in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    n) New remote
    -d) Delete remote
    -q) Quit config
    -e/n/d/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Google Cloud Storage (this is not Google Drive)
    -   \ "google cloud storage"
    -[snip]
    -Storage> google cloud storage
    -Google Application Client Id - leave blank normally.
    -client_id>
    -Google Application Client Secret - leave blank normally.
    -client_secret>
    -Project number optional - needed only for list/create/delete buckets - see your developer console.
    -project_number> 12345678
    -Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login.
    -service_account_file>
    -Access Control List for new objects.
    -Choose a number from below, or type in your own value
    - 1 / Object owner gets OWNER access, and all Authenticated Users get READER access.
    -   \ "authenticatedRead"
    - 2 / Object owner gets OWNER access, and project team owners get OWNER access.
    -   \ "bucketOwnerFullControl"
    - 3 / Object owner gets OWNER access, and project team owners get READER access.
    -   \ "bucketOwnerRead"
    - 4 / Object owner gets OWNER access [default if left blank].
    -   \ "private"
    - 5 / Object owner gets OWNER access, and project team members get access according to their roles.
    -   \ "projectPrivate"
    - 6 / Object owner gets OWNER access, and all Users get READER access.
    -   \ "publicRead"
    -object_acl> 4
    -Access Control List for new buckets.
    -Choose a number from below, or type in your own value
    - 1 / Project team owners get OWNER access, and all Authenticated Users get READER access.
    -   \ "authenticatedRead"
    - 2 / Project team owners get OWNER access [default if left blank].
    -   \ "private"
    - 3 / Project team members get access according to their roles.
    -   \ "projectPrivate"
    - 4 / Project team owners get OWNER access, and all Users get READER access.
    -   \ "publicRead"
    - 5 / Project team owners get OWNER access, and all Users get WRITER access.
    -   \ "publicReadWrite"
    -bucket_acl> 2
    -Location for the newly created buckets.
    -Choose a number from below, or type in your own value
    - 1 / Empty for default location (US).
    -   \ ""
    - 2 / Multi-regional location for Asia.
    -   \ "asia"
    - 3 / Multi-regional location for Europe.
    -   \ "eu"
    - 4 / Multi-regional location for United States.
    -   \ "us"
    - 5 / Taiwan.
    -   \ "asia-east1"
    - 6 / Tokyo.
    -   \ "asia-northeast1"
    - 7 / Singapore.
    -   \ "asia-southeast1"
    - 8 / Sydney.
    -   \ "australia-southeast1"
    - 9 / Belgium.
    -   \ "europe-west1"
    -10 / London.
    -   \ "europe-west2"
    -11 / Iowa.
    -   \ "us-central1"
    -12 / South Carolina.
    -   \ "us-east1"
    -13 / Northern Virginia.
    -   \ "us-east4"
    -14 / Oregon.
    -   \ "us-west1"
    -location> 12
    -The storage class to use when storing objects in Google Cloud Storage.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Multi-regional storage class
    -   \ "MULTI_REGIONAL"
    - 3 / Regional storage class
    -   \ "REGIONAL"
    - 4 / Nearline storage class
    -   \ "NEARLINE"
    - 5 / Coldline storage class
    -   \ "COLDLINE"
    - 6 / Durable reduced availability storage class
    -   \ "DURABLE_REDUCED_AVAILABILITY"
    -storage_class> 5
    -Remote config
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    ---------------------
    -[remote]
    -type = google cloud storage
    -client_id =
    -client_secret =
    -token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null}
    -project_number = 12345678
    -object_acl = private
    -bucket_acl = private
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall, or use manual mode.

    -

    This remote is called remote and can now be used like this

    -

    See all the buckets in your project

    -
    rclone lsd remote:
    -

    Make a new bucket

    -
    rclone mkdir remote:bucket
    -

    List the contents of a bucket

    -
    rclone ls remote:bucket
    -

    Sync /home/local/directory to the remote bucket, deleting any excess files in the bucket.

    -
    rclone sync --interactive /home/local/directory remote:bucket
    -

    Service Account support

    -

    You can set up rclone with Google Cloud Storage in an unattended mode, i.e. not tied to a specific end-user Google account. This is useful when you want to synchronise files onto machines that don't have actively logged-in users, for example build machines.

    -

    To get credentials for Google Cloud Platform IAM Service Accounts, please head to the Service Account section of the Google Developer Console. Service Accounts behave just like normal User permissions in Google Cloud Storage ACLs, so you can limit their access (e.g. make them read only). After creating an account, a JSON file containing the Service Account's credentials will be downloaded onto your machines. These credentials are what rclone will use for authentication.

    -

    To use a Service Account instead of OAuth2 token flow, enter the path to your Service Account credentials at the service_account_file prompt and rclone won't use the browser based authentication flow. If you'd rather stuff the contents of the credentials file into the rclone config file, you can set service_account_credentials with the actual contents of the file instead, or set the equivalent environment variable.

    -

    Anonymous Access

    -

    For downloads of objects that permit public access you can configure rclone to use anonymous access by setting anonymous to true. With unauthorized access you can't write or create files but only read or list those buckets and objects that have public read access.

    -

    Application Default Credentials

    -

    If no other source of credentials is provided, rclone will fall back to Application Default Credentials this is useful both when you already have configured authentication for your developer account, or in production when running on a google compute host. Note that if running in docker, you may need to run additional commands on your google compute machine - see this page.

    -

    Note that in the case application default credentials are used, there is no need to explicitly configure a project number.

    -

    --fast-list

    -

    This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

    -

    Custom upload headers

    -

    You can set custom upload headers with the --header-upload flag. Google Cloud Storage supports the headers as described in the working with metadata documentation

    -
      -
    • Cache-Control
    • -
    • Content-Disposition
    • -
    • Content-Encoding
    • -
    • Content-Language
    • -
    • Content-Type
    • -
    • X-Goog-Storage-Class
    • -
    • X-Goog-Meta-
    • -
    -

    Eg --header-upload "Content-Type text/potato"

    -

    Note that the last of these is for setting custom metadata in the form --header-upload "x-goog-meta-key: value"

    -

    Modification time

    -

    Google Cloud Storage stores md5sum natively. Google's gsutil tool stores modification time with one-second precision as goog-reserved-file-mtime in file metadata.

    -

    To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. mtime uses RFC3339 format with one-nanosecond precision. goog-reserved-file-mtime uses Unix timestamp format with one-second precision. To get modification time from object metadata, rclone reads the metadata in the following order: mtime, goog-reserved-file-mtime, object updated time.

    -

    Note that rclone's default modify window is 1ns. Files uploaded by gsutil only contain timestamps with one-second precision. If you use rclone to sync files previously uploaded by gsutil, rclone will attempt to update modification time for all these files. To avoid these possibly unnecessary updates, use --modify-window 1s.

    -

    Restricted filename characters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    NUL0x00
    LF0x0A
    CR0x0D
    /0x2F
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Standard options

    -

    Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).

    -

    --gcs-client-id

    -

    OAuth Client Id.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_GCS_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_GCS_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-project-number

    -

    Project number.

    -

    Optional - needed only for list/create/delete buckets - see your developer console.

    -

    Properties:

    -
      -
    • Config: project_number
    • -
    • Env Var: RCLONE_GCS_PROJECT_NUMBER
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-service-account-file

    -

    Service Account Credentials JSON file path.

    -

    Leave blank normally. Needed only if you want use SA instead of interactive login.

    -

    Leading ~ will be expanded in the file name as will environment variables such as ${RCLONE_CONFIG_DIR}.

    -

    Properties:

    -
      -
    • Config: service_account_file
    • -
    • Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-service-account-credentials

    -

    Service Account Credentials JSON blob.

    -

    Leave blank normally. Needed only if you want use SA instead of interactive login.

    -

    Properties:

    -
      -
    • Config: service_account_credentials
    • -
    • Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-anonymous

    -

    Access public buckets and objects without credentials.

    -

    Set to 'true' if you just want to download files and don't configure credentials.

    -

    Properties:

    -
      -
    • Config: anonymous
    • -
    • Env Var: RCLONE_GCS_ANONYMOUS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --gcs-object-acl

    -

    Access Control List for new objects.

    -

    Properties:

    -
      -
    • Config: object_acl
    • -
    • Env Var: RCLONE_GCS_OBJECT_ACL
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "authenticatedRead" -
          -
        • Object owner gets OWNER access.
        • -
        • All Authenticated Users get READER access.
        • -
      • -
      • "bucketOwnerFullControl" -
          -
        • Object owner gets OWNER access.
        • -
        • Project team owners get OWNER access.
        • -
      • -
      • "bucketOwnerRead" -
          -
        • Object owner gets OWNER access.
        • -
        • Project team owners get READER access.
        • -
      • -
      • "private" -
          -
        • Object owner gets OWNER access.
        • -
        • Default if left blank.
        • -
      • -
      • "projectPrivate" -
          -
        • Object owner gets OWNER access.
        • -
        • Project team members get access according to their roles.
        • -
      • -
      • "publicRead" -
          -
        • Object owner gets OWNER access.
        • -
        • All Users get READER access.
        • -
      • -
    • -
    -

    --gcs-bucket-acl

    -

    Access Control List for new buckets.

    -

    Properties:

    -
      -
    • Config: bucket_acl
    • -
    • Env Var: RCLONE_GCS_BUCKET_ACL
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "authenticatedRead" -
          -
        • Project team owners get OWNER access.
        • -
        • All Authenticated Users get READER access.
        • -
      • -
      • "private" -
          -
        • Project team owners get OWNER access.
        • -
        • Default if left blank.
        • -
      • -
      • "projectPrivate" -
          -
        • Project team members get access according to their roles.
        • -
      • -
      • "publicRead" -
          -
        • Project team owners get OWNER access.
        • -
        • All Users get READER access.
        • -
      • -
      • "publicReadWrite" -
          -
        • Project team owners get OWNER access.
        • -
        • All Users get WRITER access.
        • -
      • -
    • -
    -

    --gcs-bucket-policy-only

    -

    Access checks should use bucket-level IAM policies.

    -

    If you want to upload objects to a bucket with Bucket Policy Only set then you will need to set this.

    -

    When it is set, rclone:

    -
      -
    • ignores ACLs set on buckets
    • -
    • ignores ACLs set on objects
    • -
    • creates buckets with Bucket Policy Only set
    • -
    -

    Docs: https://cloud.google.com/storage/docs/bucket-policy-only

    -

    Properties:

    -
      -
    • Config: bucket_policy_only
    • -
    • Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --gcs-location

    -

    Location for the newly created buckets.

    -

    Properties:

    -
      -
    • Config: location
    • -
    • Env Var: RCLONE_GCS_LOCATION
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Empty for default location (US)
        • -
      • -
      • "asia" -
          -
        • Multi-regional location for Asia
        • -
      • -
      • "eu" -
          -
        • Multi-regional location for Europe
        • -
      • -
      • "us" -
          -
        • Multi-regional location for United States
        • -
      • -
      • "asia-east1" -
          -
        • Taiwan
        • -
      • -
      • "asia-east2" -
          -
        • Hong Kong
        • -
      • -
      • "asia-northeast1" -
          -
        • Tokyo
        • -
      • -
      • "asia-northeast2" -
          -
        • Osaka
        • -
      • -
      • "asia-northeast3" -
          -
        • Seoul
        • -
      • -
      • "asia-south1" -
          -
        • Mumbai
        • -
      • -
      • "asia-south2" -
          -
        • Delhi
        • -
      • -
      • "asia-southeast1" -
          -
        • Singapore
        • -
      • -
      • "asia-southeast2" -
          -
        • Jakarta
        • -
      • -
      • "australia-southeast1" -
          -
        • Sydney
        • -
      • -
      • "australia-southeast2" -
          -
        • Melbourne
        • -
      • -
      • "europe-north1" -
          -
        • Finland
        • -
      • -
      • "europe-west1" -
          -
        • Belgium
        • -
      • -
      • "europe-west2" -
          -
        • London
        • -
      • -
      • "europe-west3" -
          -
        • Frankfurt
        • -
      • -
      • "europe-west4" -
          -
        • Netherlands
        • -
      • -
      • "europe-west6" -
          -
        • Zürich
        • -
      • -
      • "europe-central2" -
          -
        • Warsaw
        • -
      • -
      • "us-central1" -
          -
        • Iowa
        • -
      • -
      • "us-east1" -
          -
        • South Carolina
        • -
      • -
      • "us-east4" -
          -
        • Northern Virginia
        • -
      • -
      • "us-west1" -
          -
        • Oregon
        • -
      • -
      • "us-west2" -
          -
        • California
        • -
      • -
      • "us-west3" -
          -
        • Salt Lake City
        • -
      • -
      • "us-west4" -
          -
        • Las Vegas
        • -
      • -
      • "northamerica-northeast1" -
          -
        • Montréal
        • -
      • -
      • "northamerica-northeast2" -
          -
        • Toronto
        • -
      • -
      • "southamerica-east1" -
          -
        • São Paulo
        • -
      • -
      • "southamerica-west1" -
          -
        • Santiago
        • -
      • -
      • "asia1" -
          -
        • Dual region: asia-northeast1 and asia-northeast2.
        • -
      • -
      • "eur4" -
          -
        • Dual region: europe-north1 and europe-west4.
        • -
      • -
      • "nam4" -
          -
        • Dual region: us-central1 and us-east1.
        • -
      • -
    • -
    -

    --gcs-storage-class

    -

    The storage class to use when storing objects in Google Cloud Storage.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_GCS_STORAGE_CLASS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "MULTI_REGIONAL" -
          -
        • Multi-regional storage class
        • -
      • -
      • "REGIONAL" -
          -
        • Regional storage class
        • -
      • -
      • "NEARLINE" -
          -
        • Nearline storage class
        • -
      • -
      • "COLDLINE" -
          -
        • Coldline storage class
        • -
      • -
      • "ARCHIVE" -
          -
        • Archive storage class
        • -
      • -
      • "DURABLE_REDUCED_AVAILABILITY" -
          -
        • Durable reduced availability storage class
        • -
      • -
    • -
    -

    --gcs-env-auth

    -

    Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars).

    -

    Only applies if service_account_file and service_account_credentials is blank.

    -

    Properties:

    -
      -
    • Config: env_auth
    • -
    • Env Var: RCLONE_GCS_ENV_AUTH
    • -
    • Type: bool
    • -
    • Default: false
    • -
    • Examples: -
        -
      • "false" -
          -
        • Enter credentials in the next step.
        • -
      • -
      • "true" -
          -
        • Get GCP IAM credentials from the environment (env vars or IAM).
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).

    -

    --gcs-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_GCS_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_GCS_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_GCS_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-no-check-bucket

    -

    If set, don't attempt to check the bucket exists or create it.

    -

    This can be useful when trying to minimise the number of transactions rclone does if you know the bucket exists already.

    -

    Properties:

    -
      -
    • Config: no_check_bucket
    • -
    • Env Var: RCLONE_GCS_NO_CHECK_BUCKET
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --gcs-decompress

    -

    If set this will decompress gzip encoded objects.

    -

    It is possible to upload objects to GCS with "Content-Encoding: gzip" set. Normally rclone will download these files as compressed objects.

    -

    If this flag is set then rclone will decompress these files with "Content-Encoding: gzip" as they are received. This means that rclone can't check the size and hash but the file contents will be decompressed.

    -

    Properties:

    -
      -
    • Config: decompress
    • -
    • Env Var: RCLONE_GCS_DECOMPRESS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --gcs-endpoint

    -

    Endpoint for the service.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_GCS_ENDPOINT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gcs-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_GCS_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,CrLf,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    rclone about is not supported by the Google Cloud Storage backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Google Drive

    -

    Paths are specified as drive:path

    -

    Drive paths may be as deep as required, e.g. drive:directory/subdirectory.

    -

    Configuration

    -

    The initial setup for drive involves getting a token from Google drive which you need to do in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -n/r/c/s/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Google Drive
    -   \ "drive"
    -[snip]
    -Storage> drive
    -Google Application Client Id - leave blank normally.
    -client_id>
    -Google Application Client Secret - leave blank normally.
    -client_secret>
    -Scope that rclone should use when requesting access from drive.
    -Choose a number from below, or type in your own value
    - 1 / Full access all files, excluding Application Data Folder.
    -   \ "drive"
    - 2 / Read-only access to file metadata and file contents.
    -   \ "drive.readonly"
    -   / Access to files created by rclone only.
    - 3 | These are visible in the drive website.
    -   | File authorization is revoked when the user deauthorizes the app.
    -   \ "drive.file"
    -   / Allows read and write access to the Application Data folder.
    - 4 | This is not visible in the drive website.
    -   \ "drive.appfolder"
    -   / Allows read-only access to file metadata but
    - 5 | does not allow any access to read or download file content.
    -   \ "drive.metadata.readonly"
    -scope> 1
    -Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login.
    -service_account_file>
    -Remote config
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    -Configure this as a Shared Drive (Team Drive)?
    -y) Yes
    -n) No
    -y/n> n
    ---------------------
    -[remote]
    -client_id = 
    -client_secret = 
    -scope = drive
    -root_folder_id = 
    -service_account_file =
    -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"}
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and it may require you to unblock it temporarily if you are running a host firewall, or use manual mode.

    -

    You can then use it like this,

    -

    List directories in top level of your drive

    -
    rclone lsd remote:
    -

    List all the files in your drive

    -
    rclone ls remote:
    -

    To copy a local directory to a drive directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Scopes

    -

    Rclone allows you to select which scope you would like for rclone to use. This changes what type of token is granted to rclone. The scopes are defined here.

    -

    The scope are

    -

    drive

    -

    This is the default scope and allows full access to all files, except for the Application Data Folder (see below).

    -

    Choose this one if you aren't sure.

    -

    drive.readonly

    -

    This allows read only access to all files. Files may be listed and downloaded but not uploaded, renamed or deleted.

    -

    drive.file

    -

    With this scope rclone can read/view/modify only those files and folders it creates.

    -

    So if you uploaded files to drive via the web interface (or any other means) they will not be visible to rclone.

    -

    This can be useful if you are using rclone to backup data and you want to be sure confidential data on your drive is not visible to rclone.

    -

    Files created with this scope are visible in the web interface.

    -

    drive.appfolder

    -

    This gives rclone its own private area to store files. Rclone will not be able to see any other files on your drive and you won't be able to see rclone's files from the web interface either.

    -

    drive.metadata.readonly

    -

    This allows read only access to file names only. It does not allow rclone to download or upload data, or rename or delete files or directories.

    -

    Root folder ID

    -

    This option has been moved to the advanced section. You can set the root_folder_id for rclone. This is the directory (identified by its Folder ID) that rclone considers to be the root of your drive.

    -

    Normally you will leave this blank and rclone will determine the correct root to use itself.

    -

    However you can set this to restrict rclone to a specific folder hierarchy or to access data within the "Computers" tab on the drive web interface (where files from Google's Backup and Sync desktop program go).

    -

    In order to do this you will have to find the Folder ID of the directory you wish rclone to display. This will be the last segment of the URL when you open the relevant folder in the drive web interface.

    -

    So if the folder you want rclone to use has a URL which looks like https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh in the browser, then you use 1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh as the root_folder_id in the config.

    -

    NB folders under the "Computers" tab seem to be read only (drive gives a 500 error) when using rclone.

    -

    There doesn't appear to be an API to discover the folder IDs of the "Computers" tab - please contact us if you know otherwise!

    -

    Note also that rclone can't access any data under the "Backups" tab on the google drive web interface yet.

    -

    Service Account support

    -

    You can set up rclone with Google Drive in an unattended mode, i.e. not tied to a specific end-user Google account. This is useful when you want to synchronise files onto machines that don't have actively logged-in users, for example build machines.

    -

    To use a Service Account instead of OAuth2 token flow, enter the path to your Service Account credentials at the service_account_file prompt during rclone config and rclone won't use the browser based authentication flow. If you'd rather stuff the contents of the credentials file into the rclone config file, you can set service_account_credentials with the actual contents of the file instead, or set the equivalent environment variable.

    -

    Use case - Google Apps/G-suite account and individual Drive

    -

    Let's say that you are the administrator of a Google Apps (old) or G-suite account. The goal is to store data on an individual's Drive account, who IS a member of the domain. We'll call the domain example.com, and the user foo@example.com.

    -

    There's a few steps we need to go through to accomplish this:

    -
    1. Create a service account for example.com
    -
      -
    • To create a service account and obtain its credentials, go to the Google Developer Console.
    • -
    • You must have a project - create one if you don't.
    • -
    • Then go to "IAM & admin" -> "Service Accounts".
    • -
    • Use the "Create Credentials" button. Fill in "Service account name" with something that identifies your client. "Role" can be empty.
    • -
    • Tick "Furnish a new private key" - select "Key type JSON".
    • -
    • Tick "Enable G Suite Domain-wide Delegation". This option makes "impersonation" possible, as documented here: Delegating domain-wide authority to the service account
    • -
    • These credentials are what rclone will use for authentication. If you ever need to remove access, press the "Delete service account key" button.
    • -
    -
    2. Allowing API access to example.com Google Drive
    -
      -
    • Go to example.com's admin console
    • -
    • Go into "Security" (or use the search bar)
    • -
    • Select "Show more" and then "Advanced settings"
    • -
    • Select "Manage API client access" in the "Authentication" section
    • -
    • In the "Client Name" field enter the service account's "Client ID" - this can be found in the Developer Console under "IAM & Admin" -> "Service Accounts", then "View Client ID" for the newly created service account. It is a ~21 character numerical string.
    • -
    • In the next field, "One or More API Scopes", enter https://www.googleapis.com/auth/drive to grant access to Google Drive specifically.
    • -
    -
    3. Configure rclone, assuming a new install
    -
    rclone config
    -
    -n/s/q> n         # New
    -name>gdrive      # Gdrive is an example name
    -Storage>         # Select the number shown for Google Drive
    -client_id>       # Can be left blank
    -client_secret>   # Can be left blank
    -scope>           # Select your scope, 1 for example
    -root_folder_id>  # Can be left blank
    -service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes!
    -y/n>             # Auto config, n
    -
    -
    4. Verify that it's working
    -
      -
    • rclone -v --drive-impersonate foo@example.com lsf gdrive:backup
    • -
    • The arguments do: -
        -
      • -v - verbose logging
      • -
      • --drive-impersonate foo@example.com - this is what does the magic, pretending to be user foo.
      • -
      • lsf - list files in a parsing friendly way
      • -
      • gdrive:backup - use the remote called gdrive, work in the folder named backup.
      • -
    • -
    -

    Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using --drive-impersonate, do this instead: - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 - use rclone without specifying the --drive-impersonate option, like this: rclone -v lsf gdrive:backup

    -

    Shared drives (team drives)

    -

    If you want to configure the remote to point to a Google Shared Drive (previously known as Team Drives) then answer y to the question Configure this as a Shared Drive (Team Drive)?.

    -

    This will fetch the list of Shared Drives from google and allow you to configure which one you want to use. You can also type in a Shared Drive ID if you prefer.

    -

    For example:

    -
    Configure this as a Shared Drive (Team Drive)?
    -y) Yes
    -n) No
    -y/n> y
    -Fetching Shared Drive list...
    -Choose a number from below, or type in your own value
    - 1 / Rclone Test
    -   \ "xxxxxxxxxxxxxxxxxxxx"
    - 2 / Rclone Test 2
    -   \ "yyyyyyyyyyyyyyyyyyyy"
    - 3 / Rclone Test 3
    -   \ "zzzzzzzzzzzzzzzzzzzz"
    -Enter a Shared Drive ID> 1
    ---------------------
    -[remote]
    -client_id =
    -client_secret =
    -token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null}
    -team_drive = xxxxxxxxxxxxxxxxxxxx
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    --fast-list

    -

    This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

    -

    It does this by combining multiple list calls into a single API request.

    -

    This works by combining many '%s' in parents filters into one expression. To list the contents of directories a, b and c, the following requests will be send by the regular List function:

    -
    trashed=false and 'a' in parents
    -trashed=false and 'b' in parents
    -trashed=false and 'c' in parents
    -

    These can now be combined into a single request:

    -
    trashed=false and ('a' in parents or 'b' in parents or 'c' in parents)
    -

    The implementation of ListR will put up to 50 parents filters into one request. It will use the --checkers value to specify the number of requests to run in parallel.

    -

    In tests, these batch requests were up to 20x faster than the regular method. Running the following command against different sized folders gives:

    -
    rclone lsjson -vv -R --checkers=6 gdrive:folder
    -

    small folder (220 directories, 700 files):

    -
      -
    • without --fast-list: 38s
    • -
    • with --fast-list: 10s
    • -
    -

    large folder (10600 directories, 39000 files):

    -
      -
    • without --fast-list: 22:05 min
    • -
    • with --fast-list: 58s
    • -
    -

    Modified time

    -

    Google drive stores modification times accurate to 1 ms.

    -

    Restricted filename characters

    -

    Only Invalid UTF-8 bytes will be replaced, as they can't be used in JSON strings.

    -

    In contrast to other backends, / can also be used in names and . or .. are valid names.

    -

    Revisions

    -

    Google drive stores revisions of files. When you upload a change to an existing file to google drive using rclone it will create a new revision of that file.

    -

    Revisions follow the standard google policy which at time of writing was

    -
      -
    • They are deleted after 30 days or 100 revisions (whatever comes first).
    • -
    • They do not count towards a user storage quota.
    • -
    -

    Deleting files

    -

    By default rclone will send all files to the trash when deleting files. If deleting them permanently is required then use the --drive-use-trash=false flag, or set the equivalent environment variable.

    -

    Shortcuts

    -

    In March 2020 Google introduced a new feature in Google Drive called drive shortcuts (API). These will (by September 2020) replace the ability for files or folders to be in multiple folders at once.

    -

    Shortcuts are files that link to other files on Google Drive somewhat like a symlink in unix, except they point to the underlying file data (e.g. the inode in unix terms) so they don't break if the source is renamed or moved about.

    -

    Be default rclone treats these as follows.

    -

    For shortcuts pointing to files:

    -
      -
    • When listing a file shortcut appears as the destination file.
    • -
    • When downloading the contents of the destination file is downloaded.
    • -
    • When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut.
    • -
    • When server-side moving (renaming) the shortcut is renamed, not the destination file.
    • -
    • When server-side copying the shortcut is copied, not the contents of the shortcut. (unless --drive-copy-shortcut-content is in use in which case the contents of the shortcut gets copied).
    • -
    • When deleting the shortcut is deleted not the linked file.
    • -
    • When setting the modification time, the modification time of the linked file will be set.
    • -
    -

    For shortcuts pointing to folders:

    -
      -
    • When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders)
    • -
    • When downloading the contents of the linked folder and sub contents are downloaded
    • -
    • When uploading to a shortcut folder the file will be placed in the linked folder
    • -
    • When server-side moving (renaming) the shortcut is renamed, not the destination folder
    • -
    • When server-side copying the contents of the linked folder is copied, not the shortcut.
    • -
    • When deleting with rclone rmdir or rclone purge the shortcut is deleted not the linked folder.
    • -
    • NB When deleting with rclone remove or rclone mount the contents of the linked folder will be deleted.
    • -
    -

    The rclone backend command can be used to create shortcuts.

    -

    Shortcuts can be completely ignored with the --drive-skip-shortcuts flag or the corresponding skip_shortcuts configuration setting.

    -

    Emptying trash

    -

    If you wish to empty your trash you can use the rclone cleanup remote: command which will permanently delete all your trashed files. This command does not take any path arguments.

    -

    Note that Google Drive takes some time (minutes to days) to empty the trash even though the command returns within a few seconds. No output is echoed, so there will be no confirmation even using -v or -vv.

    -

    Quota information

    -

    To view your current quota you can use the rclone about remote: command which will display your usage limit (quota), the usage in Google Drive, the size of all files in the Trash and the space used by other Google services such as Gmail. This command does not take any path arguments.

    -

    Import/Export of google documents

    -

    Google documents can be exported from and uploaded to Google Drive.

    -

    When rclone downloads a Google doc it chooses a format to download depending upon the --drive-export-formats setting. By default the export formats are docx,xlsx,pptx,svg which are a sensible default for an editable document.

    -

    When choosing a format, rclone runs down the list provided in order and chooses the first file format the doc can be exported as from the list. If the file can't be exported to a format on the formats list, then rclone will choose a format from the default list.

    -

    If you prefer an archive copy then you might use --drive-export-formats pdf, or if you prefer openoffice/libreoffice formats you might use --drive-export-formats ods,odt,odp.

    -

    Note that rclone adds the extension to the google doc, so if it is called My Spreadsheet on google docs, it will be exported as My Spreadsheet.xlsx or My Spreadsheet.pdf etc.

    -

    When importing files into Google Drive, rclone will convert all files with an extension in --drive-import-formats to their associated document type. rclone will not convert any files by default, since the conversion is lossy process.

    -

    The conversion must result in a file with the same extension when the --drive-export-formats rules are applied to the uploaded document.

    -

    Here are some examples for allowed and prohibited conversions.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    export-formatsimport-formatsUpload ExtDocument ExtAllowed
    odtodtodtodtYes
    odtdocx,odtodtodtYes
    docxdocxdocxYes
    odtodtdocxNo
    odt,docxdocx,odtdocxodtNo
    docx,odtdocx,odtdocxdocxYes
    docx,odtdocx,odtodtdocxNo
    -

    This limitation can be disabled by specifying --drive-allow-import-name-change. When using this flag, rclone can convert multiple files types resulting in the same document type at once, e.g. with --drive-import-formats docx,odt,txt, all files having these extension would result in a document represented as a docx file. This brings the additional risk of overwriting a document, if multiple files have the same stem. Many rclone operations will not handle this name change in any way. They assume an equal name when copying files and might copy the file again or delete them when the name changes.

    -

    Here are the possible export extensions with their corresponding mime types. Most of these can also be used for importing, but there more that are not listed here. Some of these additional ones might only be available when the operating system provides the correct MIME type entries.

    -

    This list can be changed by Google Drive at any time and might not represent the currently available conversions.

    - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ExtensionMime TypeDescription
    bmpimage/bmpWindows Bitmap format
    csvtext/csvStandard CSV format for Spreadsheets
    docapplication/mswordClassic Word file
    docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentMicrosoft Office Document
    epubapplication/epub+zipE-book format
    htmltext/htmlAn HTML Document
    jpgimage/jpegA JPEG Image File
    jsonapplication/vnd.google-apps.script+jsonJSON Text Format for Google Apps scripts
    odpapplication/vnd.oasis.opendocument.presentationOpenoffice Presentation
    odsapplication/vnd.oasis.opendocument.spreadsheetOpenoffice Spreadsheet
    odsapplication/x-vnd.oasis.opendocument.spreadsheetOpenoffice Spreadsheet
    odtapplication/vnd.oasis.opendocument.textOpenoffice Document
    pdfapplication/pdfAdobe PDF Format
    pjpegimage/pjpegProgressive JPEG Image
    pngimage/pngPNG Image Format
    pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentationMicrosoft Office Powerpoint
    rtfapplication/rtfRich Text Format
    svgimage/svg+xmlScalable Vector Graphics Format
    tsvtext/tab-separated-valuesStandard TSV format for spreadsheets
    txttext/plainPlain Text
    wmfapplication/x-msmetafileWindows Meta File
    xlsapplication/vnd.ms-excelClassic Excel file
    xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetMicrosoft Office Spreadsheet
    zipapplication/zipA ZIP file of HTML, Images CSS
    -

    Google documents can also be exported as link files. These files will open a browser window for the Google Docs website of that document when opened. The link file extension has to be specified as a --drive-export-formats parameter. They will match all available Google Documents.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ExtensionDescriptionOS Support
    desktopfreedesktop.org specified desktop entryLinux
    link.htmlAn HTML Document with a redirectAll
    urlINI style link filemacOS, Windows
    weblocmacOS specific XML formatmacOS
    -

    Standard options

    -

    Here are the Standard options specific to drive (Google Drive).

    -

    --drive-client-id

    -

    Google Application Client Id Setting your own is recommended. See https://rclone.org/drive/#making-your-own-client-id for how to create your own. If you leave this blank, it will use an internal key which is low performance.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_DRIVE_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_DRIVE_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-scope

    -

    Scope that rclone should use when requesting access from drive.

    -

    Properties:

    -
      -
    • Config: scope
    • -
    • Env Var: RCLONE_DRIVE_SCOPE
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "drive" -
          -
        • Full access all files, excluding Application Data Folder.
        • -
      • -
      • "drive.readonly" -
          -
        • Read-only access to file metadata and file contents.
        • -
      • -
      • "drive.file" -
          -
        • Access to files created by rclone only.
        • -
        • These are visible in the drive website.
        • -
        • File authorization is revoked when the user deauthorizes the app.
        • -
      • -
      • "drive.appfolder" -
          -
        • Allows read and write access to the Application Data folder.
        • -
        • This is not visible in the drive website.
        • -
      • -
      • "drive.metadata.readonly" -
          -
        • Allows read-only access to file metadata but
        • -
        • does not allow any access to read or download file content.
        • -
      • -
    • -
    -

    --drive-service-account-file

    -

    Service Account Credentials JSON file path.

    -

    Leave blank normally. Needed only if you want use SA instead of interactive login.

    -

    Leading ~ will be expanded in the file name as will environment variables such as ${RCLONE_CONFIG_DIR}.

    -

    Properties:

    -
      -
    • Config: service_account_file
    • -
    • Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-alternate-export

    -

    Deprecated: No longer needed.

    -

    Properties:

    -
      -
    • Config: alternate_export
    • -
    • Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to drive (Google Drive).

    -

    --drive-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_DRIVE_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_DRIVE_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_DRIVE_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-root-folder-id

    -

    ID of the root folder. Leave blank normally.

    -

    Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point.

    -

    Properties:

    -
      -
    • Config: root_folder_id
    • -
    • Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-service-account-credentials

    -

    Service Account Credentials JSON blob.

    -

    Leave blank normally. Needed only if you want use SA instead of interactive login.

    -

    Properties:

    -
      -
    • Config: service_account_credentials
    • -
    • Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-team-drive

    -

    ID of the Shared Drive (Team Drive).

    -

    Properties:

    -
      -
    • Config: team_drive
    • -
    • Env Var: RCLONE_DRIVE_TEAM_DRIVE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-auth-owner-only

    -

    Only consider files owned by the authenticated user.

    -

    Properties:

    -
      -
    • Config: auth_owner_only
    • -
    • Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-use-trash

    -

    Send files to the trash instead of deleting permanently.

    -

    Defaults to true, namely sending files to the trash. Use --drive-use-trash=false to delete files permanently instead.

    -

    Properties:

    -
      -
    • Config: use_trash
    • -
    • Env Var: RCLONE_DRIVE_USE_TRASH
    • -
    • Type: bool
    • -
    • Default: true
    • -
    -

    --drive-copy-shortcut-content

    -

    Server side copy contents of shortcuts instead of the shortcut.

    -

    When doing server side copies, normally rclone will copy shortcuts as shortcuts.

    -

    If this flag is used then rclone will copy the contents of shortcuts rather than shortcuts themselves when doing server side copies.

    -

    Properties:

    -
      -
    • Config: copy_shortcut_content
    • -
    • Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-skip-gdocs

    -

    Skip google documents in all listings.

    -

    If given, gdocs practically become invisible to rclone.

    -

    Properties:

    -
      -
    • Config: skip_gdocs
    • -
    • Env Var: RCLONE_DRIVE_SKIP_GDOCS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-skip-checksum-gphotos

    -

    Skip MD5 checksum on Google photos and videos only.

    -

    Use this if you get checksum errors when transferring Google photos or videos.

    -

    Setting this flag will cause Google photos and videos to return a blank MD5 checksum.

    -

    Google photos are identified by being in the "photos" space.

    -

    Corrupted checksums are caused by Google modifying the image/video but not updating the checksum.

    -

    Properties:

    -
      -
    • Config: skip_checksum_gphotos
    • -
    • Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-shared-with-me

    -

    Only show files that are shared with me.

    -

    Instructs rclone to operate on your "Shared with me" folder (where Google Drive lets you access the files and folders others have shared with you).

    -

    This works both with the "list" (lsd, lsl, etc.) and the "copy" commands (copy, sync, etc.), and with all other commands too.

    -

    Properties:

    -
      -
    • Config: shared_with_me
    • -
    • Env Var: RCLONE_DRIVE_SHARED_WITH_ME
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-trashed-only

    -

    Only show files that are in the trash.

    -

    This will show trashed files in their original directory structure.

    -

    Properties:

    -
      -
    • Config: trashed_only
    • -
    • Env Var: RCLONE_DRIVE_TRASHED_ONLY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-starred-only

    -

    Only show files that are starred.

    -

    Properties:

    -
      -
    • Config: starred_only
    • -
    • Env Var: RCLONE_DRIVE_STARRED_ONLY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-formats

    -

    Deprecated: See export_formats.

    -

    Properties:

    -
      -
    • Config: formats
    • -
    • Env Var: RCLONE_DRIVE_FORMATS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-export-formats

    -

    Comma separated list of preferred formats for downloading Google docs.

    -

    Properties:

    -
      -
    • Config: export_formats
    • -
    • Env Var: RCLONE_DRIVE_EXPORT_FORMATS
    • -
    • Type: string
    • -
    • Default: "docx,xlsx,pptx,svg"
    • -
    -

    --drive-import-formats

    -

    Comma separated list of preferred formats for uploading Google docs.

    -

    Properties:

    -
      -
    • Config: import_formats
    • -
    • Env Var: RCLONE_DRIVE_IMPORT_FORMATS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-allow-import-name-change

    -

    Allow the filetype to change when uploading Google docs.

    -

    E.g. file.doc to file.docx. This will confuse sync and reupload every time.

    -

    Properties:

    -
      -
    • Config: allow_import_name_change
    • -
    • Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-use-created-date

    -

    Use file created date instead of modified date.

    -

    Useful when downloading data and you want the creation date used in place of the last modified date.

    -

    WARNING: This flag may have some unexpected consequences.

    -

    When uploading to your drive all files will be overwritten unless they haven't been modified since their creation. And the inverse will occur while downloading. This side effect can be avoided by using the "--checksum" flag.

    -

    This feature was implemented to retain photos capture date as recorded by google photos. You will first need to check the "Create a Google Photos folder" option in your google drive settings. You can then copy or move the photos locally and use the date the image was taken (created) set as the modification date.

    -

    Properties:

    -
      -
    • Config: use_created_date
    • -
    • Env Var: RCLONE_DRIVE_USE_CREATED_DATE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-use-shared-date

    -

    Use date file was shared instead of modified date.

    -

    Note that, as with "--drive-use-created-date", this flag may have unexpected consequences when uploading/downloading files.

    -

    If both this flag and "--drive-use-created-date" are set, the created date is used.

    -

    Properties:

    -
      -
    • Config: use_shared_date
    • -
    • Env Var: RCLONE_DRIVE_USE_SHARED_DATE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-list-chunk

    -

    Size of listing chunk 100-1000, 0 to disable.

    -

    Properties:

    -
      -
    • Config: list_chunk
    • -
    • Env Var: RCLONE_DRIVE_LIST_CHUNK
    • -
    • Type: int
    • -
    • Default: 1000
    • -
    -

    --drive-impersonate

    -

    Impersonate this user when using a service account.

    -

    Properties:

    -
      -
    • Config: impersonate
    • -
    • Env Var: RCLONE_DRIVE_IMPERSONATE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-upload-cutoff

    -

    Cutoff for switching to chunked upload.

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 8Mi
    • -
    -

    --drive-chunk-size

    -

    Upload chunk size.

    -

    Must a power of 2 >= 256k.

    -

    Making this larger will improve performance, but note that each chunk is buffered in memory one per transfer.

    -

    Reducing this will reduce memory usage but decrease performance.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_DRIVE_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 8Mi
    • -
    -

    --drive-acknowledge-abuse

    -

    Set to allow files which return cannotDownloadAbusiveFile to be downloaded.

    -

    If downloading a file returns the error "This file has been identified as malware or spam and cannot be downloaded" with the error code "cannotDownloadAbusiveFile" then supply this flag to rclone to indicate you acknowledge the risks of downloading the file and rclone will download it anyway.

    -

    Note that if you are using service account it will need Manager permission (not Content Manager) to for this flag to work. If the SA does not have the right permission, Google will just ignore the flag.

    -

    Properties:

    -
      -
    • Config: acknowledge_abuse
    • -
    • Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-keep-revision-forever

    -

    Keep new head revision of each file forever.

    -

    Properties:

    -
      -
    • Config: keep_revision_forever
    • -
    • Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-size-as-quota

    -

    Show sizes as storage quota usage, not actual size.

    -

    Show the size of a file as the storage quota used. This is the current version plus any older versions that have been set to keep forever.

    -

    WARNING: This flag may have some unexpected consequences.

    -

    It is not recommended to set this flag in your config - the recommended usage is using the flag form --drive-size-as-quota when doing rclone ls/lsl/lsf/lsjson/etc only.

    -

    If you do use this flag for syncing (not recommended) then you will need to use --ignore size also.

    -

    Properties:

    -
      -
    • Config: size_as_quota
    • -
    • Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-v2-download-min-size

    -

    If Object's are greater, use drive v2 API to download.

    -

    Properties:

    -
      -
    • Config: v2_download_min_size
    • -
    • Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: off
    • -
    -

    --drive-pacer-min-sleep

    -

    Minimum time to sleep between API calls.

    -

    Properties:

    -
      -
    • Config: pacer_min_sleep
    • -
    • Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP
    • -
    • Type: Duration
    • -
    • Default: 100ms
    • -
    -

    --drive-pacer-burst

    -

    Number of API calls to allow without sleeping.

    -

    Properties:

    -
      -
    • Config: pacer_burst
    • -
    • Env Var: RCLONE_DRIVE_PACER_BURST
    • -
    • Type: int
    • -
    • Default: 100
    • -
    -

    --drive-server-side-across-configs

    -

    Allow server-side operations (e.g. copy) to work across different drive configs.

    -

    This can be useful if you wish to do a server-side copy between two different Google drives. Note that this isn't enabled by default because it isn't easy to tell if it will work between any two configurations.

    -

    Properties:

    -
      -
    • Config: server_side_across_configs
    • -
    • Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-disable-http2

    -

    Disable drive using http2.

    -

    There is currently an unsolved issue with the google drive backend and HTTP/2. HTTP/2 is therefore disabled by default for the drive backend but can be re-enabled here. When the issue is solved this flag will be removed.

    -

    See: https://github.com/rclone/rclone/issues/3631

    -

    Properties:

    -
      -
    • Config: disable_http2
    • -
    • Env Var: RCLONE_DRIVE_DISABLE_HTTP2
    • -
    • Type: bool
    • -
    • Default: true
    • -
    -

    --drive-stop-on-upload-limit

    -

    Make upload limit errors be fatal.

    -

    At the time of writing it is only possible to upload 750 GiB of data to Google Drive a day (this is an undocumented limit). When this limit is reached Google Drive produces a slightly different error message. When this flag is set it causes these errors to be fatal. These will stop the in-progress sync.

    -

    Note that this detection is relying on error message strings which Google don't document so it may break in the future.

    -

    See: https://github.com/rclone/rclone/issues/3857

    -

    Properties:

    -
      -
    • Config: stop_on_upload_limit
    • -
    • Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-stop-on-download-limit

    -

    Make download limit errors be fatal.

    -

    At the time of writing it is only possible to download 10 TiB of data from Google Drive a day (this is an undocumented limit). When this limit is reached Google Drive produces a slightly different error message. When this flag is set it causes these errors to be fatal. These will stop the in-progress sync.

    -

    Note that this detection is relying on error message strings which Google don't document so it may break in the future.

    -

    Properties:

    -
      -
    • Config: stop_on_download_limit
    • -
    • Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-skip-shortcuts

    -

    If set skip shortcut files.

    -

    Normally rclone dereferences shortcut files making them appear as if they are the original file (see the shortcuts section). If this flag is set then rclone will ignore shortcut files completely.

    -

    Properties:

    -
      -
    • Config: skip_shortcuts
    • -
    • Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-skip-dangling-shortcuts

    -

    If set skip dangling shortcut files.

    -

    If this is set then rclone will not show any dangling shortcuts in listings.

    -

    Properties:

    -
      -
    • Config: skip_dangling_shortcuts
    • -
    • Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --drive-resource-key

    -

    Resource key for accessing a link-shared file.

    -

    If you need to access files shared with a link like this

    -
    https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing
    -

    Then you will need to use the first part "XXX" as the "root_folder_id" and the second part "YYY" as the "resource_key" otherwise you will get 404 not found errors when trying to access the directory.

    -

    See: https://developers.google.com/drive/api/guides/resource-keys

    -

    This resource key requirement only applies to a subset of old files.

    -

    Note also that opening the folder once in the web interface (with the user you've authenticated rclone with) seems to be enough so that the resource key is no needed.

    -

    Properties:

    -
      -
    • Config: resource_key
    • -
    • Env Var: RCLONE_DRIVE_RESOURCE_KEY
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --drive-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_DRIVE_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: InvalidUtf8
    • -
    -

    Backend commands

    -

    Here are the commands specific to the drive backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    get

    -

    Get command for fetching the drive config parameters

    -
    rclone backend get remote: [options] [<arguments>+]
    -

    This is a get command which will be used to fetch the various drive config parameters

    -

    Usage Examples:

    -
    rclone backend get drive: [-o service_account_file] [-o chunk_size]
    -rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size]
    -

    Options:

    -
      -
    • "chunk_size": show the current upload chunk size
    • -
    • "service_account_file": show the current service account file
    • -
    -

    set

    -

    Set command for updating the drive config parameters

    -
    rclone backend set remote: [options] [<arguments>+]
    -

    This is a set command which will be used to update the various drive config parameters

    -

    Usage Examples:

    -
    rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
    -rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
    -

    Options:

    -
      -
    • "chunk_size": update the current upload chunk size
    • -
    • "service_account_file": update the current service account file
    • -
    -

    shortcut

    -

    Create shortcuts from files or directories

    -
    rclone backend shortcut remote: [options] [<arguments>+]
    -

    This command creates shortcuts from files or directories.

    -

    Usage:

    -
    rclone backend shortcut drive: source_item destination_shortcut
    -rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut
    -

    In the first example this creates a shortcut from the "source_item" which can be a file or a directory to the "destination_shortcut". The "source_item" and the "destination_shortcut" should be relative paths from "drive:"

    -

    In the second example this creates a shortcut from the "source_item" relative to "drive:" to the "destination_shortcut" relative to "drive2:". This may fail with a permission error if the user authenticated with "drive2:" can't read files from "drive:".

    -

    Options:

    -
      -
    • "target": optional target remote for the shortcut destination
    • -
    -

    drives

    -

    List the Shared Drives available to this account

    -
    rclone backend drives remote: [options] [<arguments>+]
    -

    This command lists the Shared Drives (Team Drives) available to this account.

    -

    Usage:

    -
    rclone backend [-o config] drives drive:
    -

    This will return a JSON list of objects like this

    -
    [
    -    {
    -        "id": "0ABCDEF-01234567890",
    -        "kind": "drive#teamDrive",
    -        "name": "My Drive"
    -    },
    -    {
    -        "id": "0ABCDEFabcdefghijkl",
    -        "kind": "drive#teamDrive",
    -        "name": "Test Drive"
    -    }
    -]
    -

    With the -o config parameter it will output the list in a format suitable for adding to a config file to make aliases for all the drives found and a combined drive.

    -
    [My Drive]
    -type = alias
    -remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
    -
    -[Test Drive]
    -type = alias
    -remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
    -
    -[AllDrives]
    -type = combine
    -upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
    -

    Adding this to the rclone config file will cause those team drives to be accessible with the aliases shown. Any illegal characters will be substituted with "_" and duplicate names will have numbers suffixed. It will also add a remote called AllDrives which shows all the shared drives combined into one directory tree.

    -

    untrash

    -

    Untrash files and directories

    -
    rclone backend untrash remote: [options] [<arguments>+]
    -

    This command untrashes all the files and directories in the directory passed in recursively.

    -

    Usage:

    -

    This takes an optional directory to trash which make this easier to use via the API.

    -
    rclone backend untrash drive:directory
    -rclone backend --interactive untrash drive:directory subdir
    -

    Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it.

    -

    Result:

    -
    {
    -    "Untrashed": 17,
    -    "Errors": 0
    -}
    -

    copyid

    -

    Copy files by ID

    -
    rclone backend copyid remote: [options] [<arguments>+]
    -

    This command copies files by ID

    -

    Usage:

    -
    rclone backend copyid drive: ID path
    -rclone backend copyid drive: ID1 path1 ID2 path2
    -

    It copies the drive file with ID given to the path (an rclone path which will be passed internally to rclone copyto). The ID and path pairs can be repeated.

    -

    The path should end with a / to indicate copy the file as named to this directory. If it doesn't end with a / then the last path component will be used as the file name.

    -

    If the destination is a drive backend then server-side copying will be attempted if possible.

    -

    Use the --interactive/-i or --dry-run flag to see what would be copied before copying.

    -

    exportformats

    -

    Dump the export formats for debug purposes

    -
    rclone backend exportformats remote: [options] [<arguments>+]
    -

    importformats

    -

    Dump the import formats for debug purposes

    -
    rclone backend importformats remote: [options] [<arguments>+]
    -

    Limitations

    -

    Drive has quite a lot of rate limiting. This causes rclone to be limited to transferring about 2 files per second only. Individual files may be transferred much faster at 100s of MiB/s but lots of small files can take a long time.

    -

    Server side copies are also subject to a separate rate limit. If you see User rate limit exceeded errors, wait at least 24 hours and retry. You can disable server-side copies with --disable copy to download and upload the files if you prefer.

    -

    Limitations of Google Docs

    -

    Google docs will appear as size -1 in rclone ls, rclone ncdu etc, and as size 0 in anything which uses the VFS layer, e.g. rclone mount and rclone serve. When calculating directory totals, e.g. in rclone size and rclone ncdu, they will be counted in as empty files.

    -

    This is because rclone can't find out the size of the Google docs without downloading them.

    -

    Google docs will transfer correctly with rclone sync, rclone copy etc as rclone knows to ignore the size when doing the transfer.

    -

    However an unfortunate consequence of this is that you may not be able to download Google docs using rclone mount. If it doesn't work you will get a 0 sized file. If you try again the doc may gain its correct size and be downloadable. Whether it will work on not depends on the application accessing the mount and the OS you are running - experiment to find out if it does work for you!

    -

    Duplicated files

    -

    Sometimes, for no reason I've been able to track down, drive will duplicate a file that rclone uploads. Drive unlike all the other remotes can have duplicated files.

    -

    Duplicated files cause problems with the syncing and you will see messages in the log about duplicates.

    -

    Use rclone dedupe to fix duplicated files.

    -

    Note that this isn't just a problem with rclone, even Google Photos on Android duplicates files on drive sometimes.

    -

    Rclone appears to be re-copying files it shouldn't

    -

    The most likely cause of this is the duplicated file issue above - run rclone dedupe and check your logs for duplicate object or directory messages.

    -

    This can also be caused by a delay/caching on google drive's end when comparing directory listings. Specifically with team drives used in combination with --fast-list. Files that were uploaded recently may not appear on the directory list sent to rclone when using --fast-list.

    -

    Waiting a moderate period of time between attempts (estimated to be approximately 1 hour) and/or not using --fast-list both seem to be effective in preventing the problem.

    -

    Making your own client_id

    -

    When you use rclone with Google drive in its default configuration you are using rclone's client_id. This is shared between all the rclone users. There is a global rate limit on the number of queries per second that each client_id can do set by Google. rclone already has a high quota and I will continue to make sure it is high enough by contacting Google.

    -

    It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower.

    -

    Here is how to create your own Google Drive client ID for rclone:

    -
      -
    1. Log into the Google API Console with your Google account. It doesn't matter what Google account you use. (It need not be the same account as the Google Drive you want to access)

    2. -
    3. Select a project or create a new project.

    4. -
    5. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the "Google Drive API".

    6. -
    7. Click "Credentials" in the left-side panel (not "Create credentials", which opens the wizard), then "Create credentials"

    8. -
    9. If you already configured an "Oauth Consent Screen", then skip to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button (near the top right corner of the right panel), then select "External" and click on "CREATE"; on the next screen, enter an "Application name" ("rclone" is OK); enter "User Support Email" (your own email is OK); enter "Developer Contact Email" (your own email is OK); then click on "Save" (all other data is optional). You will also have to add some scopes, including .../auth/docs and .../auth/drive in order to be able to edit, create and delete files with RClone. You may also want to include the ../auth/drive.metadata.readonly scope. After adding scopes, click "Save and continue" to add test users. Be sure to add your own account to the test users. Once you've added yourself as a test user and saved the changes, click again on "Credentials" on the left panel to go back to the "Credentials" screen.

      -

      (PS: if you are a GSuite user, you could also select "Internal" instead of "External" above, but this will restrict API use to Google Workspace users in your organisation).

    10. -
    11. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, then select "OAuth client ID".

    12. -
    13. Choose an application type of "Desktop app" and click "Create". (the default name is fine)

    14. -
    15. It will show you a client ID and client secret. Make a note of these.

      -

      (If you selected "External" at Step 5 continue to Step 9. If you chose "Internal" you don't need to publish and can skip straight to Step 10 but your destination drive must be part of the same Google Workspace.)

    16. -
    17. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. You will also want to add yourself as a test user.

    18. -
    19. Provide the noted client ID and client secret to rclone.

    20. -
    -

    Be aware that, due to the "enhanced security" recently introduced by Google, you are theoretically expected to "submit your app for verification" and then wait a few weeks(!) for their response; in practice, you can go right ahead and use the client ID and client secret with rclone, the only issue will be a very scary confirmation screen shown when you connect via your browser for rclone to be able to get its token-id (but as this only happens during the remote configuration, it's not such a big deal). Keeping the application in "Testing" will work as well, but the limitation is that any grants will expire after a week, which can be annoying to refresh constantly. If, for whatever reason, a short grant time is not a problem, then keeping the application in testing mode would also be sufficient.

    -

    (Thanks to @balazer on github for these instructions.)

    -

    Sometimes, creation of an OAuth consent in Google API Console fails due to an error message “The request failed because changes to one of the field of the resource is not supported”. As a convenient workaround, the necessary Google Drive API key can be created on the Python Quickstart page. Just push the Enable the Drive API button to receive the Client ID and Secret. Note that it will automatically create a new project in the API Console.

    -

    Google Photos

    -

    The rclone backend for Google Photos is a specialized backend for transferring photos and videos to and from Google Photos.

    -

    NB The Google Photos API which rclone uses has quite a few limitations, so please read the limitations section carefully to make sure it is suitable for your use.

    -

    Configuration

    -

    The initial setup for google cloud storage involves getting a token from Google Photos which you need to do in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Google Photos
    -   \ "google photos"
    -[snip]
    -Storage> google photos
    -** See help for google photos backend at: https://rclone.org/googlephotos/ **
    -
    -Google Application Client Id
    -Leave blank normally.
    -Enter a string value. Press Enter for the default ("").
    -client_id> 
    -Google Application Client Secret
    -Leave blank normally.
    -Enter a string value. Press Enter for the default ("").
    -client_secret> 
    -Set to make the Google Photos backend read only.
    -
    -If you choose read only then rclone will only request read only access
    -to your photos, otherwise rclone will request full access.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -read_only> 
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    -
    -*** IMPORTANT: All media items uploaded to Google Photos with rclone
    -*** are stored in full resolution at original quality.  These uploads
    -*** will count towards storage in your Google Account.
    -
    ---------------------
    -[remote]
    -type = google photos
    -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"}
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode.

    -

    This remote is called remote and can now be used like this

    -

    See all the albums in your photos

    -
    rclone lsd remote:album
    -

    Make a new album

    -
    rclone mkdir remote:album/newAlbum
    -

    List the contents of an album

    -
    rclone ls remote:album/newAlbum
    -

    Sync /home/local/images to the Google Photos, removing any excess files in the album.

    -
    rclone sync --interactive /home/local/image remote:album/newAlbum
    -

    Layout

    -

    As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it.

    -

    The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.)

    -

    Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums.

    -
    /
    -- upload
    -    - file1.jpg
    -    - file2.jpg
    -    - ...
    -- media
    -    - all
    -        - file1.jpg
    -        - file2.jpg
    -        - ...
    -    - by-year
    -        - 2000
    -            - file1.jpg
    -            - ...
    -        - 2001
    -            - file2.jpg
    -            - ...
    -        - ...
    -    - by-month
    -        - 2000
    -            - 2000-01
    -                - file1.jpg
    -                - ...
    -            - 2000-02
    -                - file2.jpg
    -                - ...
    -        - ...
    -    - by-day
    -        - 2000
    -            - 2000-01-01
    -                - file1.jpg
    -                - ...
    -            - 2000-01-02
    -                - file2.jpg
    -                - ...
    -        - ...
    -- album
    -    - album name
    -    - album name/sub
    -- shared-album
    -    - album name
    -    - album name/sub
    -- feature
    -    - favorites
    -        - file1.jpg
    -        - file2.jpg
    -

    There are two writable parts of the tree, the upload directory and sub directories of the album directory.

    -

    The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better.

    -

    Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do

    -
    rclone copy /path/to/images remote:album/images
    -

    and the images directory contains

    -
    images
    -    - file1.jpg
    -    dir
    -        file2.jpg
    -    dir2
    -        dir3
    -            file3.jpg
    -

    Then rclone will create the following albums with the following files in

    -
      -
    • images -
        -
      • file1.jpg
      • -
    • -
    • images/dir -
        -
      • file2.jpg
      • -
    • -
    • images/dir2/dir3 -
        -
      • file3.jpg
      • -
    • -
    -

    This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing.

    -

    The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface.

    -

    Standard options

    -

    Here are the Standard options specific to google photos (Google Photos).

    -

    --gphotos-client-id

    -

    OAuth Client Id.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_GPHOTOS_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gphotos-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_GPHOTOS_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gphotos-read-only

    -

    Set to make the Google Photos backend read only.

    -

    If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access.

    -

    Properties:

    -
      -
    • Config: read_only
    • -
    • Env Var: RCLONE_GPHOTOS_READ_ONLY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to google photos (Google Photos).

    -

    --gphotos-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_GPHOTOS_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gphotos-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_GPHOTOS_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gphotos-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_GPHOTOS_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --gphotos-read-size

    -

    Set to read the size of media items.

    -

    Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media.

    -

    Properties:

    -
      -
    • Config: read_size
    • -
    • Env Var: RCLONE_GPHOTOS_READ_SIZE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --gphotos-start-year

    -

    Year limits the photos to be downloaded to those which are uploaded after the given year.

    -

    Properties:

    -
      -
    • Config: start_year
    • -
    • Env Var: RCLONE_GPHOTOS_START_YEAR
    • -
    • Type: int
    • -
    • Default: 2000
    • -
    -

    --gphotos-include-archived

    -

    Also view and download archived media.

    -

    By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred.

    -

    Note that media in albums is always visible and synced, no matter their archive status.

    -

    With this flag, archived media are always visible in directory listings and transferred.

    -

    Without this flag, archived media will not be visible in directory listings and won't be transferred.

    -

    Properties:

    -
      -
    • Config: include_archived
    • -
    • Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --gphotos-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_GPHOTOS_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,CrLf,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item.

    -

    Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode..

    -

    rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about See rclone about

    -

    Downloading Images

    -

    When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115.

    -

    The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort

    -

    Downloading Videos

    -

    When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044.

    -

    Duplicates

    -

    If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!).

    -

    If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause too many problems.

    -

    Modified time

    -

    The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known.

    -

    This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes.

    -

    Size

    -

    The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check.

    -

    It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter.

    -

    If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag.

    -

    Albums

    -

    Rclone can only upload files to albums it created. This is a limitation of the Google Photos API.

    -

    Rclone can remove files it uploaded from albums it created only.

    -

    Deleting files

    -

    Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781.

    -

    Rclone cannot delete files anywhere except under album.

    -

    Deleting albums

    -

    The Google Photos API does not support deleting albums - see bug #135714733.

    -

    Hasher

    -

    Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files

    -

    Getting started

    -

    To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working.

    -

    Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket.

    -

    Now proceed to interactive or manual configuration.

    -

    Interactive configuration

    -

    Run rclone config:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> Hasher1
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Handle checksums for other remotes
    -   \ "hasher"
    -[snip]
    -Storage> hasher
    -Remote to cache checksums for, like myremote:mypath.
    -Enter a string value. Press Enter for the default ("").
    -remote> myRemote:path
    -Comma separated list of supported checksum types.
    -Enter a string value. Press Enter for the default ("md5,sha1").
    -hashsums> md5
    -Maximum time to keep checksums in cache. 0 = no cache, off = cache forever.
    -max_age> off
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    ---------------------
    -[Hasher1]
    -type = hasher
    -remote = myRemote:path
    -hashsums = md5
    -max_age = off
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Manual configuration

    -

    Run rclone config path to see the path of current active config file, usually YOURHOME/.config/rclone/rclone.conf. Open it in your favorite text editor, find section for the base remote and create new section for hasher like in the following examples:

    -
    [Hasher1]
    -type = hasher
    -remote = myRemote:path
    -hashes = md5
    -max_age = off
    -
    -[Hasher2]
    -type = hasher
    -remote = /local/path
    -hashes = dropbox,sha1
    -max_age = 24h
    -

    Hasher takes basically the following parameters: - remote is required, - hashes is a comma separated list of supported checksums (by default md5,sha1), - max_age - maximum time to keep a checksum value in the cache, 0 will disable caching completely, off will cache "forever" (that is until the files get changed).

    -

    Make sure the remote has : (colon) in. If you specify the remote without a colon then rclone will use a local directory of that name. So if you use a remote of /local/path then rclone will handle hashes for that directory. If you use remote = name literally then rclone will put files in a directory called name located under current directory.

    -

    Usage

    -

    Basic operations

    -

    Now you can use it as Hasher2:subdir/file instead of base remote. Hasher will transparently update cache with new checksums when a file is fully read or overwritten, like:

    -
    rclone copy External:path/file Hasher:dest/path
    -
    -rclone cat Hasher:path/to/file > /dev/null
    -

    The way to refresh all cached checksums (even unsupported by the base backend) for a subtree is to re-download all files in the subtree. For example, use hashsum --download using any supported hashsum on the command line (we just care to re-read):

    -
    rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null
    -
    -rclone backend dump Hasher:path/to/subtree
    -

    You can print or drop hashsum cache using custom backend commands:

    -
    rclone backend dump Hasher:dir/subdir
    -
    -rclone backend drop Hasher:
    -

    Pre-Seed from a SUM File

    -

    Hasher supports two backend commands: generic SUM file import and faster but less consistent stickyimport.

    -
    rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4]
    -

    Instead of SHA1 it can be any hash supported by the remote. The last argument can point to either a local or an other-remote:path text file in SUM format. The command will parse the SUM file, then walk down the path given by the first argument, snapshot current fingerprints and fill in the cache entries correspondingly. - Paths in the SUM file are treated as relative to hasher:dir/subdir. - The command will not check that supplied values are correct. You must know what you are doing. - This is a one-time action. The SUM file will not get "attached" to the remote. Cache entries can still be overwritten later, should the object's fingerprint change. - The tree walk can take long depending on the tree size. You can increase --checkers to make it faster. Or use stickyimport if you don't care about fingerprints and consistency.

    -
    rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1
    -

    stickyimport is similar to import but works much faster because it does not need to stat existing files and skips initial tree walk. Instead of binding cache entries to file fingerprints it creates sticky entries bound to the file name alone ignoring size, modification time etc. Such hash entries can be replaced only by purge, delete, backend drop or by full re-read/re-write of the files.

    -

    Configuration reference

    -

    Standard options

    -

    Here are the Standard options specific to hasher (Better checksums for other remotes).

    -

    --hasher-remote

    -

    Remote to cache checksums for (e.g. myRemote:path).

    -

    Properties:

    -
      -
    • Config: remote
    • -
    • Env Var: RCLONE_HASHER_REMOTE
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --hasher-hashes

    -

    Comma separated list of supported checksum types.

    -

    Properties:

    -
      -
    • Config: hashes
    • -
    • Env Var: RCLONE_HASHER_HASHES
    • -
    • Type: CommaSepList
    • -
    • Default: md5,sha1
    • -
    -

    --hasher-max-age

    -

    Maximum time to keep checksums in cache (0 = no cache, off = cache forever).

    -

    Properties:

    -
      -
    • Config: max_age
    • -
    • Env Var: RCLONE_HASHER_MAX_AGE
    • -
    • Type: Duration
    • -
    • Default: off
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to hasher (Better checksums for other remotes).

    -

    --hasher-auto-size

    -

    Auto-update checksum for files smaller than this size (disabled by default).

    -

    Properties:

    -
      -
    • Config: auto_size
    • -
    • Env Var: RCLONE_HASHER_AUTO_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 0
    • -
    -

    Metadata

    -

    Any metadata supported by the underlying remote is read and written.

    -

    See the metadata docs for more info.

    -

    Backend commands

    -

    Here are the commands specific to the hasher backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    drop

    -

    Drop cache

    -
    rclone backend drop remote: [options] [<arguments>+]
    -

    Completely drop checksum cache. Usage Example: rclone backend drop hasher:

    -

    dump

    -

    Dump the database

    -
    rclone backend dump remote: [options] [<arguments>+]
    -

    Dump cache records covered by the current remote

    -

    fulldump

    -

    Full dump of the database

    -
    rclone backend fulldump remote: [options] [<arguments>+]
    -

    Dump all cache records in the database

    -

    import

    -

    Import a SUM file

    -
    rclone backend import remote: [options] [<arguments>+]
    -

    Amend hash cache from a SUM file and bind checksums to files by size/time. Usage Example: rclone backend import hasher:subdir md5 /path/to/sum.md5

    -

    stickyimport

    -

    Perform fast import of a SUM file

    -
    rclone backend stickyimport remote: [options] [<arguments>+]
    -

    Fill hash cache from a SUM file without verifying file fingerprints. Usage Example: rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5

    -

    Implementation details (advanced)

    -

    This section explains how various rclone operations work on a hasher remote.

    -

    Disclaimer. This section describes current implementation which can change in future rclone versions!.

    -

    Hashsum command

    -

    The rclone hashsum (or md5sum or sha1sum) command will:

    -
      -
    1. if requested hash is supported by lower level, just pass it.
    2. -
    3. if object size is below auto_size then download object and calculate requested hashes on the fly.
    4. -
    5. if unsupported and the size is big enough, build object fingerprint (including size, modtime if supported, first-found other hash if any).
    6. -
    7. if the strict match is found in cache for the requested remote, return the stored hash.
    8. -
    9. if remote found but fingerprint mismatched, then purge the entry and proceed to step 6.
    10. -
    11. if remote not found or had no requested hash type or after step 5: download object, calculate all supported hashes on the fly and store in cache; return requested hash.
    12. -
    -

    Other operations

    -
      -
    • whenever a file is uploaded or downloaded in full, capture the stream to calculate all supported hashes on the fly and update database
    • -
    • server-side move will update keys of existing cache entries
    • -
    • deletefile will remove a single cache entry
    • -
    • purge will remove all cache entries under the purged path
    • -
    -

    Note that setting max_age = 0 will disable checksum caching completely.

    -

    If you set max_age = off, checksums in cache will never age, unless you fully rewrite or delete the file.

    -

    Cache storage

    -

    Cached checksums are stored as bolt database files under rclone cache directory, usually ~/.cache/rclone/kv/. Databases are maintained one per base backend, named like BaseRemote~hasher.bolt. Checksums for multiple alias-es into a single base backend will be stored in the single database. All local paths are treated as aliases into the local backend (unless crypted or chunked) and stored in ~/.cache/rclone/kv/local~hasher.bolt. Databases can be shared between multiple rclone processes.

    -

    HDFS

    -

    HDFS is a distributed file-system, part of the Apache Hadoop framework.

    -

    Paths are specified as remote: or remote:path/to/dir.

    -

    Configuration

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[skip]
    -XX / Hadoop distributed file system
    -   \ "hdfs"
    -[skip]
    -Storage> hdfs
    -** See help for hdfs backend at: https://rclone.org/hdfs/ **
    -
    -hadoop name node and port
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Connect to host namenode at port 8020
    -   \ "namenode:8020"
    -namenode> namenode.hadoop:8020
    -hadoop user name
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Connect to hdfs as root
    -   \ "root"
    -username> root
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[remote]
    -type = hdfs
    -namenode = namenode.hadoop:8020
    -username = root
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    -
    -Name                 Type
    -====                 ====
    -hadoop               hdfs
    -
    -e) Edit existing remote
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> q
    -

    This remote is called remote and can now be used like this

    -

    See all the top level directories

    -
    rclone lsd remote:
    -

    List the contents of a directory

    -
    rclone ls remote:directory
    -

    Sync the remote directory to /home/local/directory, deleting any excess files.

    -
    rclone sync --interactive remote:directory /home/local/directory
    -

    Setting up your own HDFS instance for testing

    -

    You may start with a manual setup or use the docker image from the tests:

    -

    If you want to build the docker image

    -
    git clone https://github.com/rclone/rclone.git
    -cd rclone/fstest/testserver/images/test-hdfs
    -docker build --rm -t rclone/test-hdfs .
    -

    Or you can just use the latest one pushed

    -
    docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs
    -

    NB it need few seconds to startup.

    -

    For this docker image the remote needs to be configured like this:

    -
    [remote]
    -type = hdfs
    -namenode = 127.0.0.1:8020
    -username = root
    -

    You can stop this image with docker kill rclone-hdfs (NB it does not use volumes, so all data uploaded will be lost.)

    -

    Modified time

    -

    Time accurate to 1 second is stored.

    -

    Checksum

    -

    No checksums are implemented.

    -

    Usage information

    -

    You can use the rclone about remote: command which will display filesystem size and current usage.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    :0x3A
    -

    Invalid UTF-8 bytes will also be replaced.

    -

    Standard options

    -

    Here are the Standard options specific to hdfs (Hadoop distributed file system).

    -

    --hdfs-namenode

    -

    Hadoop name node and port.

    -

    E.g. "namenode:8020" to connect to host namenode at port 8020.

    -

    Properties:

    -
      -
    • Config: namenode
    • -
    • Env Var: RCLONE_HDFS_NAMENODE
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --hdfs-username

    -

    Hadoop user name.

    -

    Properties:

    -
      -
    • Config: username
    • -
    • Env Var: RCLONE_HDFS_USERNAME
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "root" -
          -
        • Connect to hdfs as root.
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to hdfs (Hadoop distributed file system).

    -

    --hdfs-service-principal-name

    -

    Kerberos service principal name for the namenode.

    -

    Enables KERBEROS authentication. Specifies the Service Principal Name (SERVICE/FQDN) for the namenode. E.g. "hdfs/namenode.hadoop.docker" for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'.

    -

    Properties:

    -
      -
    • Config: service_principal_name
    • -
    • Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --hdfs-data-transfer-protection

    -

    Kerberos data transfer protection: authentication|integrity|privacy.

    -

    Specifies whether or not authentication, data signature integrity checks, and wire encryption is required when communicating the the datanodes. Possible values are 'authentication', 'integrity' and 'privacy'. Used only with KERBEROS enabled.

    -

    Properties:

    -
      -
    • Config: data_transfer_protection
    • -
    • Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "privacy" -
          -
        • Ensure authentication, integrity and encryption enabled.
        • -
      • -
    • -
    -

    --hdfs-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_HDFS_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    Limitations

    -
      -
    • No server-side Move or DirMove.
    • -
    • Checksums not implemented.
    • -
    -

    HiDrive

    -

    Paths are specified as remote:path

    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    The initial setup for hidrive involves getting a token from HiDrive which you need to do in your browser. rclone config walks you through it.

    -

    Configuration

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found - make a new one
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / HiDrive
    -   \ "hidrive"
    -[snip]
    -Storage> hidrive
    -OAuth Client Id - Leave blank normally.
    -client_id>
    -OAuth Client Secret - Leave blank normally.
    -client_secret>
    -Access permissions that rclone should use when requesting access from HiDrive.
    -Leave blank normally.
    -scope_access>
    -Edit advanced config?
    -y/n> n
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    ---------------------
    -[remote]
    -type = hidrive
    -token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"}
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    You should be aware that OAuth-tokens can be used to access your account and hence should not be shared with other persons. See the below section for more information.

    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from HiDrive. This only runs from the moment it opens your browser to the moment you get back the verification code. The webserver runs on http://127.0.0.1:53682/. If local port 53682 is protected by a firewall you may need to temporarily unblock the firewall to complete authorization.

    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your HiDrive root folder

    -
    rclone lsd remote:
    -

    List all the files in your HiDrive filesystem

    -
    rclone ls remote:
    -

    To copy a local directory to a HiDrive directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Keeping your tokens safe

    -

    Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. Therefore you should make sure no one else can access your configuration.

    -

    It is possible to encrypt rclone's configuration file. You can find information on securing your configuration file by viewing the configuration encryption docs.

    -

    Invalid refresh token

    -

    As can be verified here, each refresh_token (for Native Applications) is valid for 60 days. If used to access HiDrivei, its validity will be automatically extended.

    -

    This means that if you

    -
      -
    • Don't use the HiDrive remote for 60 days
    • -
    -

    then rclone will return an error which includes a text that implies the refresh token is invalid or expired.

    -

    To fix this you will need to authorize rclone to access your HiDrive account again.

    -

    Using

    -
    rclone config reconnect remote:
    -

    the process is very similar to the process of initial setup exemplified before.

    -

    Modified time and hashes

    -

    HiDrive allows modification times to be set on objects accurate to 1 second.

    -

    HiDrive supports its own hash type which is used to verify the integrity of file contents after successful transfers.

    -

    Restricted filename characters

    -

    HiDrive cannot store files or folders that include / (0x2F) or null-bytes (0x00) in their name. Any other characters can be used in the names of files or folders. Additionally, files or folders cannot be named either of the following: . or ..

    -

    Therefore rclone will automatically replace these characters, if files or folders are stored or accessed with such names.

    -

    You can read about how this filename encoding works in general here.

    -

    Keep in mind that HiDrive only supports file or folder names with a length of 255 characters or less.

    -

    Transfers

    -

    HiDrive limits file sizes per single request to a maximum of 2 GiB. To allow storage of larger files and allow for better upload performance, the hidrive backend will use a chunked transfer for files larger than 96 MiB. Rclone will upload multiple parts/chunks of the file at the same time. Chunks in the process of being uploaded are buffered in memory, so you may want to restrict this behaviour on systems with limited resources.

    -

    You can customize this behaviour using the following options:

    -
      -
    • chunk_size: size of file parts
    • -
    • upload_cutoff: files larger or equal to this in size will use a chunked transfer
    • -
    • upload_concurrency: number of file-parts to upload at the same time
    • -
    -

    See the below section about configuration options for more details.

    -

    Root folder

    -

    You can set the root folder for rclone. This is the directory that rclone considers to be the root of your HiDrive.

    -

    Usually, you will leave this blank, and rclone will use the root of the account.

    -

    However, you can set this to restrict rclone to a specific folder hierarchy.

    -

    This works by prepending the contents of the root_prefix option to any paths accessed by rclone. For example, the following two ways to access the home directory are equivalent:

    -
    rclone lsd --hidrive-root-prefix="/users/test/" remote:path
    -
    -rclone lsd remote:/users/test/path
    -

    See the below section about configuration options for more details.

    -

    Directory member count

    -

    By default, rclone will know the number of directory members contained in a directory. For example, rclone lsd uses this information.

    -

    The acquisition of this information will result in additional time costs for HiDrive's API. When dealing with large directory structures, it may be desirable to circumvent this time cost, especially when this information is not explicitly needed. For this, the disable_fetching_member_count option can be used.

    -

    See the below section about configuration options for more details.

    -

    Standard options

    -

    Here are the Standard options specific to hidrive (HiDrive).

    -

    --hidrive-client-id

    -

    OAuth Client Id.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_HIDRIVE_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --hidrive-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_HIDRIVE_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --hidrive-scope-access

    -

    Access permissions that rclone should use when requesting access from HiDrive.

    -

    Properties:

    -
      -
    • Config: scope_access
    • -
    • Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS
    • -
    • Type: string
    • -
    • Default: "rw"
    • -
    • Examples: -
        -
      • "rw" -
          -
        • Read and write access to resources.
        • -
      • -
      • "ro" -
          -
        • Read-only access to resources.
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to hidrive (HiDrive).

    -

    --hidrive-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_HIDRIVE_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --hidrive-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_HIDRIVE_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --hidrive-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_HIDRIVE_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --hidrive-scope-role

    -

    User-level that rclone should use when requesting access from HiDrive.

    -

    Properties:

    -
      -
    • Config: scope_role
    • -
    • Env Var: RCLONE_HIDRIVE_SCOPE_ROLE
    • -
    • Type: string
    • -
    • Default: "user"
    • -
    • Examples: -
        -
      • "user" -
          -
        • User-level access to management permissions.
        • -
        • This will be sufficient in most cases.
        • -
      • -
      • "admin" -
          -
        • Extensive access to management permissions.
        • -
      • -
      • "owner" -
          -
        • Full access to management permissions.
        • -
      • -
    • -
    -

    --hidrive-root-prefix

    -

    The root/parent folder for all paths.

    -

    Fill in to use the specified folder as the parent for all paths given to the remote. This way rclone can use any folder as its starting point.

    -

    Properties:

    -
      -
    • Config: root_prefix
    • -
    • Env Var: RCLONE_HIDRIVE_ROOT_PREFIX
    • -
    • Type: string
    • -
    • Default: "/"
    • -
    • Examples: -
        -
      • "/" -
          -
        • The topmost directory accessible by rclone.
        • -
        • This will be equivalent with "root" if rclone uses a regular HiDrive user account.
        • -
      • -
      • "root" -
          -
        • The topmost directory of the HiDrive user account
        • -
      • -
      • "" -
          -
        • This specifies that there is no root-prefix for your paths.
        • -
        • When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir".
        • -
      • -
    • -
    -

    --hidrive-endpoint

    -

    Endpoint for the service.

    -

    This is the URL that API-calls will be made to.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_HIDRIVE_ENDPOINT
    • -
    • Type: string
    • -
    • Default: "https://api.hidrive.strato.com/2.1"
    • -
    -

    --hidrive-disable-fetching-member-count

    -

    Do not fetch number of objects in directories unless it is absolutely necessary.

    -

    Requests may be faster if the number of objects in subdirectories is not fetched.

    -

    Properties:

    -
      -
    • Config: disable_fetching_member_count
    • -
    • Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --hidrive-chunk-size

    -

    Chunksize for chunked uploads.

    -

    Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size.

    -

    The upper limit for this is 2147483647 bytes (about 2.000Gi). That is the maximum amount of bytes a single upload-operation will support. Setting this above the upper limit or to a negative value will cause uploads to fail.

    -

    Setting this to larger values may increase the upload speed at the cost of using more memory. It can be set to smaller values smaller to save on memory.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_HIDRIVE_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 48Mi
    • -
    -

    --hidrive-upload-cutoff

    -

    Cutoff/Threshold for chunked uploads.

    -

    Any files larger than this will be uploaded in chunks of the configured chunksize.

    -

    The upper limit for this is 2147483647 bytes (about 2.000Gi). That is the maximum amount of bytes a single upload-operation will support. Setting this above the upper limit will cause uploads to fail.

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 96Mi
    • -
    -

    --hidrive-upload-concurrency

    -

    Concurrency for chunked uploads.

    -

    This is the upper limit for how many transfers for the same file are running concurrently. Setting this above to a value smaller than 1 will cause uploads to deadlock.

    -

    If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

    -

    Properties:

    -
      -
    • Config: upload_concurrency
    • -
    • Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY
    • -
    • Type: int
    • -
    • Default: 4
    • -
    -

    --hidrive-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_HIDRIVE_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,Dot
    • -
    -

    Limitations

    - -

    HiDrive is able to store symbolic links (symlinks) by design, for example, when unpacked from a zip archive.

    -

    There exists no direct mechanism to manage native symlinks in remotes. As such this implementation has chosen to ignore any native symlinks present in the remote. rclone will not be able to access or show any symlinks stored in the hidrive-remote. This means symlinks cannot be individually removed, copied, or moved, except when removing, copying, or moving the parent folder.

    -

    This does not affect the .rclonelink-files that rclone uses to encode and store symbolic links.

    -

    Sparse files

    -

    It is possible to store sparse files in HiDrive.

    -

    Note that copying a sparse file will expand the holes into null-byte (0x00) regions that will then consume disk space. Likewise, when downloading a sparse file, the resulting file will have null-byte regions in the place of file holes.

    -

    HTTP

    -

    The HTTP remote is a read only remote for reading files of a webserver. The webserver should provide file listings which rclone will read and turn into a remote. This has been tested with common webservers such as Apache/Nginx/Caddy and will likely work with file listings from most web servers. (If it doesn't then please file an issue, or send a pull request!)

    -

    Paths are specified as remote: or remote:path.

    -

    The remote: represents the configured url, and any path following it will be resolved relative to this url, according to the URL standard. This means with remote url https://beta.rclone.org/branch and path fix, the resolved URL will be https://beta.rclone.org/branch/fix, while with path /fix the resolved URL will be https://beta.rclone.org/fix as the absolute path is resolved from the root of the domain.

    -

    If the path following the remote: ends with / it will be assumed to point to a directory. If the path does not end with /, then a HEAD request is sent and the response used to decide if it it is treated as a file or a directory (run with -vv to see details). When --http-no-head is specified, a path without ending / is always assumed to be a file. If rclone incorrectly assumes the path is a file, the solution is to specify the path with ending /. When you know the path is a directory, ending it with / is always better as it avoids the initial HEAD request.

    -

    To just download a single file it is easier to use copyurl.

    -

    Configuration

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / HTTP
    -   \ "http"
    -[snip]
    -Storage> http
    -URL of http host to connect to
    -Choose a number from below, or type in your own value
    - 1 / Connect to example.com
    -   \ "https://example.com"
    -url> https://beta.rclone.org
    -Remote config
    ---------------------
    -[remote]
    -url = https://beta.rclone.org
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    -
    -Name                 Type
    -====                 ====
    -remote               http
    -
    -e) Edit existing remote
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> q
    -

    This remote is called remote and can now be used like this

    -

    See all the top level directories

    -
    rclone lsd remote:
    -

    List the contents of a directory

    -
    rclone ls remote:directory
    -

    Sync the remote directory to /home/local/directory, deleting any excess files.

    -
    rclone sync --interactive remote:directory /home/local/directory
    -

    Read only

    -

    This remote is read only - you can't upload files to an HTTP server.

    -

    Modified time

    -

    Most HTTP servers store time accurate to 1 second.

    -

    Checksum

    -

    No checksums are stored.

    -

    Usage without a config file

    -

    Since the http remote only has one config parameter it is easy to use without a config file:

    -
    rclone lsd --http-url https://beta.rclone.org :http:
    -

    or:

    -
    rclone lsd :http,url='https://beta.rclone.org':
    -

    Standard options

    -

    Here are the Standard options specific to http (HTTP).

    -

    --http-url

    -

    URL of HTTP host to connect to.

    -

    E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password.

    -

    Properties:

    -
      -
    • Config: url
    • -
    • Env Var: RCLONE_HTTP_URL
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to http (HTTP).

    -

    --http-headers

    -

    Set HTTP headers for all transactions.

    -

    Use this to set additional HTTP headers for all transactions.

    -

    The input format is comma separated list of key,value pairs. Standard CSV encoding may be used.

    -

    For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'.

    -

    You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'.

    -

    Properties:

    -
      -
    • Config: headers
    • -
    • Env Var: RCLONE_HTTP_HEADERS
    • -
    • Type: CommaSepList
    • -
    • Default:
    • -
    -

    --http-no-slash

    -

    Set this if the site doesn't end directories with /.

    -

    Use this if your target website does not use / on the end of directories.

    -

    A / on the end of a path is how rclone normally tells the difference between files and directories. If this flag is set, then rclone will treat all files with Content-Type: text/html as directories and read URLs from them rather than downloading them.

    -

    Note that this may cause rclone to confuse genuine HTML files with directories.

    -

    Properties:

    -
      -
    • Config: no_slash
    • -
    • Env Var: RCLONE_HTTP_NO_SLASH
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --http-no-head

    -

    Don't use HEAD requests.

    -

    HEAD requests are mainly used to find file sizes in dir listing. If your site is being very slow to load then you can try this option. Normally rclone does a HEAD request for each potential file in a directory listing to:

    -
      -
    • find its size
    • -
    • check it really exists
    • -
    • check to see if it is a directory
    • -
    -

    If you set this option, rclone will not do the HEAD request. This will mean that directory listings are much quicker, but rclone won't have the times or sizes of any files, and some files that don't exist may be in the listing.

    -

    Properties:

    -
      -
    • Config: no_head
    • -
    • Env Var: RCLONE_HTTP_NO_HEAD
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    Limitations

    -

    rclone about is not supported by the HTTP backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Internet Archive

    -

    The Internet Archive backend utilizes Items on archive.org

    -

    Refer to IAS3 API documentation for the API this backend uses.

    -

    Paths are specified as remote:bucket (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:item/path/to/dir.

    -

    Unlike S3, listing up all items uploaded by you isn't supported.

    -

    Once you have made a remote, you can use it like this:

    -

    Make a new item

    -
    rclone mkdir remote:item
    -

    List the contents of a item

    -
    rclone ls remote:item
    -

    Sync /home/local/directory to the remote item, deleting any excess files in the item.

    -
    rclone sync --interactive /home/local/directory remote:item
    -

    Notes

    -

    Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. The per-item queue is enqueued to an another queue, Item Deriver Queue. You can check the status of Item Deriver Queue here. This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior.

    -

    You can optionally wait for the server's processing to finish, by setting non-zero value to wait_archive key. By making it wait, rclone can do normal file comparison. Make sure to set a large enough value (e.g. 30m0s for smaller files) as it can take a long time depending on server's queue.

    -

    About metadata

    -

    This backend supports setting, updating and reading metadata of each file. The metadata will appear as file metadata on Internet Archive. However, some fields are reserved by both Internet Archive and rclone.

    -

    The following are reserved by Internet Archive: - name - source - size - md5 - crc32 - sha1 - format - old_version - viruscheck - summation

    -

    Trying to set values to these keys is ignored with a warning. Only setting mtime is an exception. Doing so make it the identical behavior as setting ModTime.

    -

    rclone reserves all the keys starting with rclone-. Setting value for these keys will give you warnings, but values are set according to request.

    -

    If there are multiple values for a key, only the first one is returned. This is a limitation of rclone, that supports one value per one key. It can be triggered when you did a server-side copy.

    -

    Reading metadata will also provide custom (non-standard nor reserved) ones.

    -

    Filtering auto generated files

    -

    The Internet Archive automatically creates metadata files after upload. These can cause problems when doing an rclone sync as rclone will try, and fail, to delete them. These metadata files are not changeable, as they are created by the Internet Archive automatically.

    -

    These auto-created files can be excluded from the sync using metadata filtering.

    -
    rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata"
    -

    Which excludes from the sync any files which have the source=metadata or format=Metadata flags which are added to Internet Archive auto-created files.

    -

    Configuration

    -

    Here is an example of making an internetarchive configuration. Most applies to the other providers as well, any differences are described below.

    -

    First run

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -XX / InternetArchive Items
    -   \ (internetarchive)
    -Storage> internetarchive
    -Option access_key_id.
    -IAS3 Access Key.
    -Leave blank for anonymous access.
    -You can find one here: https://archive.org/account/s3.php
    -Enter a value. Press Enter to leave empty.
    -access_key_id> XXXX
    -Option secret_access_key.
    -IAS3 Secret Key (password).
    -Leave blank for anonymous access.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> XXXX
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> y
    -Option endpoint.
    -IAS3 Endpoint.
    -Leave blank for default value.
    -Enter a string value. Press Enter for the default (https://s3.us.archive.org).
    -endpoint> 
    -Option front_endpoint.
    -Host of InternetArchive Frontend.
    -Leave blank for default value.
    -Enter a string value. Press Enter for the default (https://archive.org).
    -front_endpoint> 
    -Option disable_checksum.
    -Don't store MD5 checksum with object metadata.
    -Normally rclone will calculate the MD5 checksum of the input before
    -uploading it so it can ask the server to check the object against checksum.
    -This is great for data integrity checking but can cause long delays for
    -large files to start uploading.
    -Enter a boolean value (true or false). Press Enter for the default (true).
    -disable_checksum> true
    -Option encoding.
    -The encoding for the backend.
    -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
    -Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot).
    -encoding> 
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    ---------------------
    -[remote]
    -type = internetarchive
    -access_key_id = XXXX
    -secret_access_key = XXXX
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Standard options

    -

    Here are the Standard options specific to internetarchive (Internet Archive).

    -

    --internetarchive-access-key-id

    -

    IAS3 Access Key.

    -

    Leave blank for anonymous access. You can find one here: https://archive.org/account/s3.php

    -

    Properties:

    -
      -
    • Config: access_key_id
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --internetarchive-secret-access-key

    -

    IAS3 Secret Key (password).

    -

    Leave blank for anonymous access.

    -

    Properties:

    -
      -
    • Config: secret_access_key
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to internetarchive (Internet Archive).

    -

    --internetarchive-endpoint

    -

    IAS3 Endpoint.

    -

    Leave blank for default value.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT
    • -
    • Type: string
    • -
    • Default: "https://s3.us.archive.org"
    • -
    -

    --internetarchive-front-endpoint

    -

    Host of InternetArchive Frontend.

    -

    Leave blank for default value.

    -

    Properties:

    -
      -
    • Config: front_endpoint
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT
    • -
    • Type: string
    • -
    • Default: "https://archive.org"
    • -
    -

    --internetarchive-disable-checksum

    -

    Don't ask the server to test against MD5 checksum calculated by rclone. Normally rclone will calculate the MD5 checksum of the input before uploading it so it can ask the server to check the object against checksum. This is great for data integrity checking but can cause long delays for large files to start uploading.

    -

    Properties:

    -
      -
    • Config: disable_checksum
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM
    • -
    • Type: bool
    • -
    • Default: true
    • -
    -

    --internetarchive-wait-archive

    -

    Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. Only enable if you need to be guaranteed to be reflected after write operations. 0 to disable waiting. No errors to be thrown in case of timeout.

    -

    Properties:

    -
      -
    • Config: wait_archive
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE
    • -
    • Type: Duration
    • -
    • Default: 0s
    • -
    -

    --internetarchive-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_INTERNETARCHIVE_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    Metadata

    -

    Metadata fields provided by Internet Archive. If there are multiple values for a key, only the first one is returned. This is a limitation of Rclone, that supports one value per one key.

    -

    Owner is able to add custom keys. Metadata feature grabs all the keys including them.

    -

    Here are the possible system metadata items for the internetarchive backend.

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameHelpTypeExampleRead Only
    crc32CRC32 calculated by Internet Archivestring01234567Y
    formatName of format identified by Internet ArchivestringComma-Separated ValuesY
    md5MD5 hash calculated by Internet Archivestring01234567012345670123456701234567Y
    mtimeTime of last modification, managed by RcloneRFC 33392006-01-02T15:04:05.999999999ZY
    nameFull file path, without the bucket partfilenamebackend/internetarchive/internetarchive.goY
    old_versionWhether the file was replaced and moved by keep-old-version flagbooleantrueY
    rclone-ia-mtimeTime of last modification, managed by Internet ArchiveRFC 33392006-01-02T15:04:05.999999999ZN
    rclone-mtimeTime of last modification, managed by RcloneRFC 33392006-01-02T15:04:05.999999999ZN
    rclone-update-trackRandom value used by Rclone for tracking changes inside Internet ArchivestringaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaN
    sha1SHA1 hash calculated by Internet Archivestring0123456701234567012345670123456701234567Y
    sizeFile size in bytesdecimal number123456Y
    sourceThe source of the filestringoriginalY
    summationCheck https://forum.rclone.org/t/31922 for how it is usedstringmd5Y
    viruscheckThe last time viruscheck process was run for the file (?)unixtime1654191352Y
    -

    See the metadata docs for more info.

    -

    Jottacloud

    -

    Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters in Norway. In addition to the official service at jottacloud.com, it also provides white-label solutions to different companies, such as: * Telia * Telia Cloud (cloud.telia.se) * Telia Sky (sky.telia.no) * Tele2 * Tele2 Cloud (mittcloud.tele2.se) * Elkjøp (with subsidiaries): * Elkjøp Cloud (cloud.elkjop.no) * Elgiganten Sweden (cloud.elgiganten.se) * Elgiganten Denmark (cloud.elgiganten.dk) * Giganti Cloud (cloud.gigantti.fi) * ELKO Cloud (cloud.elko.is)

    -

    Most of the white-label versions are supported by this backend, although may require different authentication setup - described below.

    -

    Paths are specified as remote:path

    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    Authentication types

    -

    Some of the whitelabel versions uses a different authentication method than the official service, and you have to choose the correct one when setting up the remote.

    -

    Standard authentication

    -

    The standard authentication method used by the official service (jottacloud.com), as well as some of the whitelabel services, requires you to generate a single-use personal login token from the account security settings in the service's web interface. Log in to your account, go to "Settings" and then "Security", or use the direct link presented to you by rclone when configuring the remote: https://www.jottacloud.com/web/secure. Scroll down to the section "Personal login token", and click the "Generate" button. Note that if you are using a whitelabel service you probably can't use the direct link, you need to find the same page in their dedicated web interface, and also it may be in a different location than described above.

    -

    To access your account from multiple instances of rclone, you need to configure each of them with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one location, and copy the configuration file to a second location where you also want to run rclone and access the same remote. Then you need to replace the token for one of them, using the config reconnect command, which requires you to generate a new personal login token and supply as input. If you do not do this, the token may easily end up being invalidated, resulting in both instances failing with an error message something along the lines of:

    -
    oauth2: cannot fetch token: 400 Bad Request
    -Response: {"error":"invalid_grant","error_description":"Stale token"}
    -

    When this happens, you need to replace the token as described above to be able to use your remote again.

    -

    All personal login tokens you have taken into use will be listed in the web interface under "My logged in devices", and from the right side of that list you can click the "X" button to revoke individual tokens.

    -

    Legacy authentication

    -

    If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select yes when the setup asks for legacy authentication and enter your username and password. The rest of the setup is identical to the default setup.

    -

    Telia Cloud authentication

    -

    Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and additionally uses a separate authentication flow where the username is generated internally. To setup rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is identical to the default setup.

    -

    Tele2 Cloud authentication

    -

    As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup.

    -

    Configuration

    -

    Here is an example of how to make a remote called remote with the default setup. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Jottacloud
    -   \ (jottacloud)
    -[snip]
    -Storage> jottacloud
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    -Option config_type.
    -Select authentication type.
    -Choose a number from below, or type in an existing string value.
    -Press Enter for the default (standard).
    -   / Standard authentication.
    - 1 | Use this if you're a normal Jottacloud user.
    -   \ (standard)
    -   / Legacy authentication.
    - 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users.
    -   \ (legacy)
    -   / Telia Cloud authentication.
    - 3 | Use this if you are using Telia Cloud.
    -   \ (telia)
    -   / Tele2 Cloud authentication.
    - 4 | Use this if you are using Tele2 Cloud.
    -   \ (tele2)
    -config_type> 1
    -Personal login token.
    -Generate here: https://www.jottacloud.com/web/secure
    -Login Token> <your token here>
    -Use a non-standard device/mountpoint?
    -Choosing no, the default, will let you access the storage used for the archive
    -section of the official Jottacloud client. If you instead want to access the
    -sync or the backup section, for example, you must choose yes.
    -y) Yes
    -n) No (default)
    -y/n> y
    -Option config_device.
    -The device to use. In standard setup the built-in Jotta device is used,
    -which contains predefined mountpoints for archive, sync etc. All other devices
    -are treated as backup devices by the official Jottacloud client. You may create
    -a new by entering a unique name.
    -Choose a number from below, or type in your own string value.
    -Press Enter for the default (DESKTOP-3H31129).
    - 1 > DESKTOP-3H31129
    - 2 > Jotta
    -config_device> 2
    -Option config_mountpoint.
    -The mountpoint to use for the built-in device Jotta.
    -The standard setup is to use the Archive mountpoint. Most other mountpoints
    -have very limited support in rclone and should generally be avoided.
    -Choose a number from below, or type in an existing string value.
    -Press Enter for the default (Archive).
    - 1 > Archive
    - 2 > Shared
    - 3 > Sync
    -config_mountpoint> 1
    ---------------------
    -[remote]
    -type = jottacloud
    -configVersion = 1
    -client_id = jottacli
    -client_secret =
    -tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token
    -token = {........}
    -username = 2940e57271a93d987d6f8a21
    -device = Jotta
    -mountpoint = Archive
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your Jottacloud

    -
    rclone lsd remote:
    -

    List all the files in your Jottacloud

    -
    rclone ls remote:
    -

    To copy a local directory to an Jottacloud directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Devices and Mountpoints

    -

    The official Jottacloud client registers a device for each computer you install it on, and shows them in the backup section of the user interface. For each folder you select for backup it will create a mountpoint within this device. A built-in device called Jotta is special, and contains mountpoints Archive, Sync and some others, used for corresponding features in official clients.

    -

    With rclone you'll want to use the standard Jotta/Archive device/mountpoint in most cases. However, you may for example want to access files from the sync or backup functionality provided by the official clients, and rclone therefore provides the option to select other devices and mountpoints during config.

    -

    You are allowed to create new devices and mountpoints. All devices except the built-in Jotta device are treated as backup devices by official Jottacloud clients, and the mountpoints on them are individual backup sets.

    -

    With the built-in Jotta device, only existing, built-in, mountpoints can be selected. In addition to the mentioned Archive and Sync, it may contain several other mountpoints such as: Latest, Links, Shared and Trash. All of these are special mountpoints with a different internal representation than the "regular" mountpoints. Rclone will only to a very limited degree support them. Generally you should avoid these, unless you know what you are doing.

    -

    --fast-list

    -

    This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

    -

    Note that the implementation in Jottacloud always uses only a single API request to get the entire list, so for large folders this could lead to long wait time before the first results are shown.

    -

    Note also that with rclone version 1.58 and newer information about MIME types are not available when using --fast-list.

    -

    Modified time and hashes

    -

    Jottacloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not.

    -

    Jottacloud supports MD5 type hashes, so you can use the --checksum flag.

    -

    Note that Jottacloud requires the MD5 hash before upload so if the source does not have an MD5 checksum then the file will be cached temporarily on disk (in location given by --temp-dir) before it is uploaded. Small files will be cached in memory - see the --jottacloud-md5-memory-limit flag. When uploading from local disk the source checksum is always available, so this does not apply. Starting with rclone version 1.52 the same is true for crypted remotes (in older versions the crypt backend would not calculate hashes for uploads from local disk, so the Jottacloud backend had to do it as described above).

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    "0x22
    *0x2A
    :0x3A
    <0x3C
    >0x3E
    ?0x3F
    |0x7C
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in XML strings.

    -

    Deleting files

    -

    By default, rclone will send all files to the trash when deleting files. They will be permanently deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately by using the --jottacloud-hard-delete flag, or set the equivalent environment variable. Emptying the trash is supported by the cleanup command.

    -

    Versions

    -

    Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website.

    -

    Versioning can be disabled by --jottacloud-no-versions option. This is achieved by deleting the remote file prior to uploading a new version. If the upload the fails no version of the file will be available in the remote.

    -

    Quota information

    -

    To view your current quota you can use the rclone about remote: command which will display your usage limit (unless it is unlimited) and the current usage.

    -

    Advanced options

    -

    Here are the Advanced options specific to jottacloud (Jottacloud).

    -

    --jottacloud-md5-memory-limit

    -

    Files bigger than this will be cached on disk to calculate the MD5 if required.

    -

    Properties:

    -
      -
    • Config: md5_memory_limit
    • -
    • Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT
    • -
    • Type: SizeSuffix
    • -
    • Default: 10Mi
    • -
    -

    --jottacloud-trashed-only

    -

    Only show files that are in the trash.

    -

    This will show trashed files in their original directory structure.

    -

    Properties:

    -
      -
    • Config: trashed_only
    • -
    • Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --jottacloud-hard-delete

    -

    Delete files permanently rather than putting them into the trash.

    -

    Properties:

    -
      -
    • Config: hard_delete
    • -
    • Env Var: RCLONE_JOTTACLOUD_HARD_DELETE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --jottacloud-upload-resume-limit

    -

    Files bigger than this can be resumed if the upload fail's.

    -

    Properties:

    -
      -
    • Config: upload_resume_limit
    • -
    • Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT
    • -
    • Type: SizeSuffix
    • -
    • Default: 10Mi
    • -
    -

    --jottacloud-no-versions

    -

    Avoid server side versioning by deleting files and recreating files instead of overwriting them.

    -

    Properties:

    -
      -
    • Config: no_versions
    • -
    • Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --jottacloud-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_JOTTACLOUD_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    Note that Jottacloud is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead.

    -

    Jottacloud only supports filenames up to 255 characters in length.

    -

    Troubleshooting

    -

    Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove operations to previously deleted paths to fail. Emptying the trash should help in such cases.

    -

    Koofr

    -

    Paths are specified as remote:path

    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    Configuration

    -

    The initial setup for Koofr involves creating an application password for rclone. You can do that by opening the Koofr web application, giving the password a nice name like rclone and clicking on generate.

    -

    Here is an example of how to make a remote called koofr. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> koofr
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -22 / Koofr, Digi Storage and other Koofr-compatible storage providers
    -   \ (koofr)
    -[snip]
    -Storage> koofr
    -Option provider.
    -Choose your storage provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Koofr, https://app.koofr.net/
    -   \ (koofr)
    - 2 / Digi Storage, https://storage.rcs-rds.ro/
    -   \ (digistorage)
    - 3 / Any other Koofr API compatible storage service
    -   \ (other)
    -provider> 1    
    -Option user.
    -Your user name.
    -Enter a value.
    -user> USERNAME
    -Option password.
    -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password).
    -Choose an alternative below.
    -y) Yes, type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[koofr]
    -type = koofr
    -provider = koofr
    -user = USERNAME
    -password = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    You can choose to edit advanced config in order to enter your own service URL if you use an on-premise or white label Koofr instance, or choose an alternative mount instead of your primary storage.

    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your Koofr

    -
    rclone lsd koofr:
    -

    List all the files in your Koofr

    -
    rclone ls koofr:
    -

    To copy a local directory to an Koofr directory called backup

    -
    rclone copy /home/source koofr:backup
    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    \0x5C
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in XML strings.

    -

    Standard options

    -

    Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).

    -

    --koofr-provider

    -

    Choose your storage provider.

    -

    Properties:

    -
      -
    • Config: provider
    • -
    • Env Var: RCLONE_KOOFR_PROVIDER
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "koofr" -
          -
        • Koofr, https://app.koofr.net/
        • -
      • -
      • "digistorage" -
          -
        • Digi Storage, https://storage.rcs-rds.ro/
        • -
      • -
      • "other" -
          -
        • Any other Koofr API compatible storage service
        • -
      • -
    • -
    -

    --koofr-endpoint

    -

    The Koofr API endpoint to use.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_KOOFR_ENDPOINT
    • -
    • Provider: other
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --koofr-user

    -

    Your user name.

    -

    Properties:

    -
      -
    • Config: user
    • -
    • Env Var: RCLONE_KOOFR_USER
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --koofr-password

    -

    Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password).

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: password
    • -
    • Env Var: RCLONE_KOOFR_PASSWORD
    • -
    • Provider: koofr
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --koofr-password

    -

    Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password).

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: password
    • -
    • Env Var: RCLONE_KOOFR_PASSWORD
    • -
    • Provider: digistorage
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --koofr-password

    -

    Your password for rclone (generate one at your service's settings page).

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: password
    • -
    • Env Var: RCLONE_KOOFR_PASSWORD
    • -
    • Provider: other
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).

    -

    --koofr-mountid

    -

    Mount ID of the mount to use.

    -

    If omitted, the primary mount is used.

    -

    Properties:

    -
      -
    • Config: mountid
    • -
    • Env Var: RCLONE_KOOFR_MOUNTID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --koofr-setmtime

    -

    Does the backend support setting modification time.

    -

    Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend.

    -

    Properties:

    -
      -
    • Config: setmtime
    • -
    • Env Var: RCLONE_KOOFR_SETMTIME
    • -
    • Type: bool
    • -
    • Default: true
    • -
    -

    --koofr-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_KOOFR_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    Note that Koofr is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    Providers

    -

    Koofr

    -

    This is the original Koofr storage provider used as main example and described in the configuration section above.

    -

    Digi Storage

    -

    Digi Storage is a cloud storage service run by Digi.ro that provides a Koofr API.

    -

    Here is an example of how to make a remote called ds. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> ds
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -22 / Koofr, Digi Storage and other Koofr-compatible storage providers
    -   \ (koofr)
    -[snip]
    -Storage> koofr
    -Option provider.
    -Choose your storage provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Koofr, https://app.koofr.net/
    -   \ (koofr)
    - 2 / Digi Storage, https://storage.rcs-rds.ro/
    -   \ (digistorage)
    - 3 / Any other Koofr API compatible storage service
    -   \ (other)
    -provider> 2
    -Option user.
    -Your user name.
    -Enter a value.
    -user> USERNAME
    -Option password.
    -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password).
    -Choose an alternative below.
    -y) Yes, type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    ---------------------
    -[ds]
    -type = koofr
    -provider = digistorage
    -user = USERNAME
    -password = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Other

    -

    You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to.

    -

    Here is an example of how to make a remote called other. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> other
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -22 / Koofr, Digi Storage and other Koofr-compatible storage providers
    -   \ (koofr)
    -[snip]
    -Storage> koofr
    -Option provider.
    -Choose your storage provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Koofr, https://app.koofr.net/
    -   \ (koofr)
    - 2 / Digi Storage, https://storage.rcs-rds.ro/
    -   \ (digistorage)
    - 3 / Any other Koofr API compatible storage service
    -   \ (other)
    -provider> 3
    -Option endpoint.
    -The Koofr API endpoint to use.
    -Enter a value.
    -endpoint> https://koofr.other.org
    -Option user.
    -Your user name.
    -Enter a value.
    -user> USERNAME
    -Option password.
    -Your password for rclone (generate one at your service's settings page).
    -Choose an alternative below.
    -y) Yes, type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    ---------------------
    -[other]
    -type = koofr
    -provider = other
    -endpoint = https://koofr.other.org
    -user = USERNAME
    -password = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Mail.ru Cloud

    -

    Mail.ru Cloud is a cloud storage provided by a Russian internet company Mail.Ru Group. The official desktop client is Disk-O:, available on Windows and Mac OS.

    -

    Currently it is recommended to disable 2FA on Mail.ru accounts intended for rclone until it gets eventually implemented.

    -

    Features highlights

    -
      -
    • Paths may be as deep as required, e.g. remote:directory/subdirectory
    • -
    • Files have a last modified time property, directories don't
    • -
    • Deleted files are by default moved to the trash
    • -
    • Files and directories can be shared via public links
    • -
    • Partial uploads or streaming are not supported, file size must be known before upload
    • -
    • Maximum file size is limited to 2G for a free account, unlimited for paid accounts
    • -
    • Storage keeps hash for all files and performs transparent deduplication, the hash algorithm is a modified SHA1
    • -
    • If a particular file is already present in storage, one can quickly submit file hash instead of long file upload (this optimization is supported by rclone)
    • -
    -

    Configuration

    -

    Here is an example of making a mailru configuration.

    -

    First create a Mail.ru Cloud account and choose a tariff.

    -

    You will need to log in and create an app password for rclone. Rclone will not work with your normal username and password - it will give an error like oauth2: server response missing access_token.

    -
      -
    • Click on your user icon in the top right
    • -
    • Go to Security / "Пароль и безопасность"
    • -
    • Click password for apps / "Пароли для внешних приложений"
    • -
    • Add the password - give it a name - eg "rclone"
    • -
    • Copy the password and use this password below - your normal login password won't work.
    • -
    -

    Now run

    -
    rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Mail.ru Cloud
    -   \ "mailru"
    -[snip]
    -Storage> mailru
    -User name (usually email)
    -Enter a string value. Press Enter for the default ("").
    -user> username@mail.ru
    -Password
    -
    -This must be an app password - rclone will not work with your normal
    -password. See the Configuration section in the docs for how to make an
    -app password.
    -y) Yes type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Skip full upload if there is another file with same data hash.
    -This feature is called "speedup" or "put by hash". It is especially efficient
    -in case of generally available files like popular books, video or audio clips
    -[snip]
    -Enter a boolean value (true or false). Press Enter for the default ("true").
    -Choose a number from below, or type in your own value
    - 1 / Enable
    -   \ "true"
    - 2 / Disable
    -   \ "false"
    -speedup_enable> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    ---------------------
    -[remote]
    -type = mailru
    -user = username@mail.ru
    -pass = *** ENCRYPTED ***
    -speedup_enable = true
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Configuration of this backend does not require a local web browser. You can use the configured backend as shown below:

    -

    See top level directories

    -
    rclone lsd remote:
    -

    Make a new directory

    -
    rclone mkdir remote:directory
    -

    List the contents of a directory

    -
    rclone ls remote:directory
    -

    Sync /home/local/directory to the remote path, deleting any excess files in the path.

    -
    rclone sync --interactive /home/local/directory remote:directory
    -

    Modified time

    -

    Files support a modification time attribute with up to 1 second precision. Directories do not have a modification time, which is shown as "Jan 1 1970".

    -

    Hash checksums

    -

    Hash sums use a custom Mail.ru algorithm based on SHA1. If file size is less than or equal to the SHA1 block size (20 bytes), its hash is simply its data right-padded with zero bytes. Hash sum of a larger file is computed as a SHA1 sum of the file data bytes concatenated with a decimal representation of the data length.

    -

    Emptying Trash

    -

    Removing a file or directory actually moves it to the trash, which is not visible to rclone but can be seen in a web browser. The trashed file still occupies part of total quota. If you wish to empty your trash and free some quota, you can use the rclone cleanup remote: command, which will permanently delete all your trashed files. This command does not take any path arguments.

    -

    Quota information

    -

    To view your current quota you can use the rclone about remote: command which will display your usage limit (quota) and the current usage.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    "0x22
    *0x2A
    :0x3A
    <0x3C
    >0x3E
    ?0x3F
    \0x5C
    |0x7C
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Standard options

    -

    Here are the Standard options specific to mailru (Mail.ru Cloud).

    -

    --mailru-user

    -

    User name (usually email).

    -

    Properties:

    -
      -
    • Config: user
    • -
    • Env Var: RCLONE_MAILRU_USER
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --mailru-pass

    -

    Password.

    -

    This must be an app password - rclone will not work with your normal password. See the Configuration section in the docs for how to make an app password.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: pass
    • -
    • Env Var: RCLONE_MAILRU_PASS
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --mailru-speedup-enable

    -

    Skip full upload if there is another file with same data hash.

    -

    This feature is called "speedup" or "put by hash". It is especially efficient in case of generally available files like popular books, video or audio clips, because files are searched by hash in all accounts of all mailru users. It is meaningless and ineffective if source file is unique or encrypted. Please note that rclone may need local memory and disk space to calculate content hash in advance and decide whether full upload is required. Also, if rclone does not know file size in advance (e.g. in case of streaming or partial uploads), it will not even try this optimization.

    -

    Properties:

    -
      -
    • Config: speedup_enable
    • -
    • Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE
    • -
    • Type: bool
    • -
    • Default: true
    • -
    • Examples: -
        -
      • "true" -
          -
        • Enable
        • -
      • -
      • "false" -
          -
        • Disable
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to mailru (Mail.ru Cloud).

    -

    --mailru-speedup-file-patterns

    -

    Comma separated list of file name patterns eligible for speedup (put by hash).

    -

    Patterns are case insensitive and can contain '*' or '?' meta characters.

    -

    Properties:

    -
      -
    • Config: speedup_file_patterns
    • -
    • Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS
    • -
    • Type: string
    • -
    • Default: ".mkv,.avi,.mp4,.mp3,.zip,.gz,.rar,.pdf"
    • -
    • Examples: -
        -
      • "" -
          -
        • Empty list completely disables speedup (put by hash).
        • -
      • -
      • "*" -
          -
        • All files will be attempted for speedup.
        • -
      • -
      • ".mkv,.avi,.mp4,.mp3" -
          -
        • Only common audio/video files will be tried for put by hash.
        • -
      • -
      • ".zip,.gz,.rar,.pdf" -
          -
        • Only common archives or PDF books will be tried for speedup.
        • -
      • -
    • -
    -

    --mailru-speedup-max-disk

    -

    This option allows you to disable speedup (put by hash) for large files.

    -

    Reason is that preliminary hashing can exhaust your RAM or disk space.

    -

    Properties:

    -
      -
    • Config: speedup_max_disk
    • -
    • Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK
    • -
    • Type: SizeSuffix
    • -
    • Default: 3Gi
    • -
    • Examples: -
        -
      • "0" -
          -
        • Completely disable speedup (put by hash).
        • -
      • -
      • "1G" -
          -
        • Files larger than 1Gb will be uploaded directly.
        • -
      • -
      • "3G" -
          -
        • Choose this option if you have less than 3Gb free on local disk.
        • -
      • -
    • -
    -

    --mailru-speedup-max-memory

    -

    Files larger than the size given below will always be hashed on disk.

    -

    Properties:

    -
      -
    • Config: speedup_max_memory
    • -
    • Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY
    • -
    • Type: SizeSuffix
    • -
    • Default: 32Mi
    • -
    • Examples: -
        -
      • "0" -
          -
        • Preliminary hashing will always be done in a temporary disk location.
        • -
      • -
      • "32M" -
          -
        • Do not dedicate more than 32Mb RAM for preliminary hashing.
        • -
      • -
      • "256M" -
          -
        • You have at most 256Mb RAM free for hash calculations.
        • -
      • -
    • -
    -

    --mailru-check-hash

    -

    What should copy do if file checksum is mismatched or invalid.

    -

    Properties:

    -
      -
    • Config: check_hash
    • -
    • Env Var: RCLONE_MAILRU_CHECK_HASH
    • -
    • Type: bool
    • -
    • Default: true
    • -
    • Examples: -
        -
      • "true" -
          -
        • Fail with error.
        • -
      • -
      • "false" -
          -
        • Ignore and continue.
        • -
      • -
    • -
    -

    --mailru-user-agent

    -

    HTTP user agent used internally by client.

    -

    Defaults to "rclone/VERSION" or "--user-agent" provided on command line.

    -

    Properties:

    -
      -
    • Config: user_agent
    • -
    • Env Var: RCLONE_MAILRU_USER_AGENT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --mailru-quirks

    -

    Comma separated list of internal maintenance flags.

    -

    This option must not be used by an ordinary user. It is intended only to facilitate remote troubleshooting of backend issues. Strict meaning of flags is not documented and not guaranteed to persist between releases. Quirks will be removed when the backend grows stable. Supported quirks: atomicmkdir binlist unknowndirs

    -

    Properties:

    -
      -
    • Config: quirks
    • -
    • Env Var: RCLONE_MAILRU_QUIRKS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --mailru-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_MAILRU_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    File size limits depend on your account. A single file size is limited by 2G for a free account and unlimited for paid tariffs. Please refer to the Mail.ru site for the total uploaded size limits.

    -

    Note that Mailru is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    Mega

    -

    Mega is a cloud storage and file hosting service known for its security feature where all files are encrypted locally before they are uploaded. This prevents anyone (including employees of Mega) from accessing the files without knowledge of the key used for encryption.

    -

    This is an rclone backend for Mega which supports the file transfer features of Mega using the same client side encryption.

    -

    Paths are specified as remote:path

    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    Configuration

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Mega
    -   \ "mega"
    -[snip]
    -Storage> mega
    -User name
    -user> you@example.com
    -Password.
    -y) Yes type in my own password
    -g) Generate random password
    -n) No leave this optional password blank
    -y/g/n> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -Remote config
    ---------------------
    -[remote]
    -type = mega
    -user = you@example.com
    -pass = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    NOTE: The encryption keys need to have been already generated after a regular login via the browser, otherwise attempting to use the credentials in rclone will fail.

    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your Mega

    -
    rclone lsd remote:
    -

    List all the files in your Mega

    -
    rclone ls remote:
    -

    To copy a local directory to an Mega directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Modified time and hashes

    -

    Mega does not support modification times or hashes yet.

    -

    Restricted filename characters

    - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    NUL0x00
    /0x2F
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Duplicated files

    -

    Mega can have two files with exactly the same name and path (unlike a normal file system).

    -

    Duplicated files cause problems with the syncing and you will see messages in the log about duplicates.

    -

    Use rclone dedupe to fix duplicated files.

    -

    Failure to log-in

    -

    Object not found

    -

    If you are connecting to your Mega remote for the first time, to test access and synchronization, you may receive an error such as

    -
    Failed to create file system for "my-mega-remote:": 
    -couldn't login: Object (typically, node or user) not found
    -

    The diagnostic steps often recommended in the rclone forum start with the MEGAcmd utility. Note that this refers to the official C++ command from https://github.com/meganz/MEGAcmd and not the go language built command from t3rm1n4l/megacmd that is no longer maintained.

    -

    Follow the instructions for installing MEGAcmd and try accessing your remote as they recommend. You can establish whether or not you can log in using MEGAcmd, and obtain diagnostic information to help you, and search or work with others in the forum.

    -
    MEGA CMD> login me@example.com
    -Password:
    -Fetching nodes ...
    -Loading transfers from local cache
    -Login complete as me@example.com
    -me@example.com:/$ 
    -

    Note that some have found issues with passwords containing special characters. If you can not log on with rclone, but MEGAcmd logs on just fine, then consider changing your password temporarily to pure alphanumeric characters, in case that helps.

    -

    Repeated commands blocks access

    -

    Mega remotes seem to get blocked (reject logins) under "heavy use". We haven't worked out the exact blocking rules but it seems to be related to fast paced, successive rclone commands.

    -

    For example, executing this command 90 times in a row rclone link remote:file will cause the remote to become "blocked". This is not an abnormal situation, for example if you wish to get the public links of a directory with hundred of files... After more or less a week, the remote will remote accept rclone logins normally again.

    -

    You can mitigate this issue by mounting the remote it with rclone mount. This will log-in when mounting and a log-out when unmounting only. You can also run rclone rcd and then use rclone rc to run the commands over the API to avoid logging in each time.

    -

    Rclone does not currently close mega sessions (you can see them in the web interface), however closing the sessions does not solve the issue.

    -

    If you space rclone commands by 3 seconds it will avoid blocking the remote. We haven't identified the exact blocking rules, so perhaps one could execute the command 80 times without waiting and avoid blocking by waiting 3 seconds, then continuing...

    -

    Note that this has been observed by trial and error and might not be set in stone.

    -

    Other tools seem not to produce this blocking effect, as they use a different working approach (state-based, using sessionIDs instead of log-in) which isn't compatible with the current stateless rclone approach.

    -

    Note that once blocked, the use of other tools (such as megacmd) is not a sure workaround: following megacmd login times have been observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 min, 30min. Web access looks unaffected though.

    -

    Investigation is continuing in relation to workarounds based on timeouts, pacers, retrials and tpslimits - if you discover something relevant, please post on the forum.

    -

    So, if rclone was working nicely and suddenly you are unable to log-in and you are sure the user and the password are correct, likely you have got the remote blocked for a while.

    -

    Standard options

    -

    Here are the Standard options specific to mega (Mega).

    -

    --mega-user

    -

    User name.

    -

    Properties:

    -
      -
    • Config: user
    • -
    • Env Var: RCLONE_MEGA_USER
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --mega-pass

    -

    Password.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: pass
    • -
    • Env Var: RCLONE_MEGA_PASS
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to mega (Mega).

    -

    --mega-debug

    -

    Output more debug from Mega.

    -

    If this flag is set (along with -vv) it will print further debugging information from the mega backend.

    -

    Properties:

    -
      -
    • Config: debug
    • -
    • Env Var: RCLONE_MEGA_DEBUG
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --mega-hard-delete

    -

    Delete files permanently rather than putting them into the trash.

    -

    Normally the mega backend will put all deletions into the trash rather than permanently deleting them. If you specify this then rclone will permanently delete objects instead.

    -

    Properties:

    -
      -
    • Config: hard_delete
    • -
    • Env Var: RCLONE_MEGA_HARD_DELETE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --mega-use-https

    -

    Use HTTPS for transfers.

    -

    MEGA uses plain text HTTP connections by default. Some ISPs throttle HTTP connections, this causes transfers to become very slow. Enabling this will force MEGA to use HTTPS for all transfers. HTTPS is normally not necesary since all data is already encrypted anyway. Enabling it will increase CPU usage and add network overhead.

    -

    Properties:

    -
      -
    • Config: use_https
    • -
    • Env Var: RCLONE_MEGA_USE_HTTPS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --mega-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_MEGA_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    This backend uses the go-mega go library which is an opensource go library implementing the Mega API. There doesn't appear to be any documentation for the mega protocol beyond the mega C++ SDK source code so there are likely quite a few errors still remaining in this library.

    -

    Mega allows duplicate files which may confuse rclone.

    -

    Memory

    -

    The memory backend is an in RAM backend. It does not persist its data - use the local backend for that.

    -

    The memory backend behaves like a bucket-based remote (e.g. like s3). Because it has no parameters you can just use it with the :memory: remote name.

    -

    Configuration

    -

    You can configure it as a remote like this with rclone config too if you want to:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Memory
    -   \ "memory"
    -[snip]
    -Storage> memory
    -** See help for memory backend at: https://rclone.org/memory/ **
    -
    -Remote config
    -
    ---------------------
    -[remote]
    -type = memory
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Because the memory backend isn't persistent it is most useful for testing or with an rclone server or rclone mount, e.g.

    -
    rclone mount :memory: /mnt/tmp
    -rclone serve webdav :memory:
    -rclone serve sftp :memory:
    -

    Modified time and hashes

    -

    The memory backend supports MD5 hashes and modification times accurate to 1 nS.

    -

    Restricted filename characters

    -

    The memory backend replaces the default restricted characters set.

    -

    Akamai NetStorage

    -

    Paths are specified as remote: You may put subdirectories in too, e.g. remote:/path/to/dir. If you have a CP code you can use that as the folder after the domain such as <domain>/<cpcode>/<internal directories within cpcode>.

    -

    For example, this is commonly configured with or without a CP code: * With a CP code. [your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/ * Without a CP code. [your-domain-prefix]-nsu.akamaihd.net

    -

    See all buckets rclone lsd remote: The initial setup for Netstorage involves getting an account and secret. Use rclone config to walk you through the setup process.

    -

    Configuration

    -

    Here's an example of how to make a remote called ns1.

    -
      -
    1. To begin the interactive configuration process, enter this command:
    2. -
    -
    rclone config
    -
      -
    1. Type n to create a new remote.
    2. -
    -
    n) New remote
    -d) Delete remote
    -q) Quit config
    -e/n/d/q> n
    -
      -
    1. For this example, enter ns1 when you reach the name> prompt.
    2. -
    -
    name> ns1
    -
      -
    1. Enter netstorage as the type of storage to configure.
    2. -
    -
    Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -XX / NetStorage
    -   \ "netstorage"
    -Storage> netstorage
    -
      -
    1. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes.
    2. -
    -
    Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / HTTP protocol
    -   \ "http"
    - 2 / HTTPS protocol
    -   \ "https"
    -protocol> 1
    -
      -
    1. Specify your NetStorage host, CP code, and any necessary content paths using this format: <domain>/<cpcode>/<content>/
    2. -
    -
    Enter a string value. Press Enter for the default ("").
    -host> baseball-nsu.akamaihd.net/123456/content/
    -
      -
    1. Set the netstorage account name
    2. -
    -
    Enter a string value. Press Enter for the default ("").
    -account> username
    -
      -
    1. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the y option to set your own password then enter your secret. Note: The secret is stored in the rclone.conf file with hex-encoded encryption.
    2. -
    -
    y) Yes type in my own password
    -g) Generate random password
    -y/g> y
    -Enter the password:
    -password:
    -Confirm the password:
    -password:
    -
      -
    1. View the summary and confirm your remote configuration.
    2. -
    -
    [ns1]
    -type = netstorage
    -protocol = http
    -host = baseball-nsu.akamaihd.net/123456/content/
    -account = username
    -secret = *** ENCRYPTED ***
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This remote is called ns1 and can now be used.

    -

    Example operations

    -

    Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/.

    -

    See contents of a directory in your project

    -
    rclone lsd ns1:/974012/testing/
    -

    Sync the contents local with remote

    -
    rclone sync . ns1:/974012/testing/
    -

    Upload local content to remote

    -
    rclone copy notes.txt ns1:/974012/testing/
    -

    Delete content on remote

    -
    rclone delete ns1:/974012/testing/notes.txt
    -

    Move or copy content between CP codes.

    -

    Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes.

    -
    rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/
    -

    Features

    - -

    The Netstorage backend changes the rclone --links, -l behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote.

    -

    This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below.

    -

    Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink.

    -

    Note: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote.

    -

    Implicit vs. Explicit Directories

    -

    With NetStorage, directories can exist in one of two forms:

    -
      -
    1. Explicit Directory. This is an actual, physical directory that you have created in a storage group.
    2. -
    3. Implicit Directory. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file.
    4. -
    -

    Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly.

    -

    --fast-list / ListR support

    -

    NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered.

    -
      -
    • Rclone will use the ListR method for some commands by default. Commands such as lsf -R will use ListR by default. To disable this, include the --disable listR option to use the non-recursive method of listing objects.

    • -
    • Rclone will not use the ListR method for some commands. Commands such as sync don't use ListR by default. To force using the ListR method, include the --fast-list option.

    • -
    -

    There are pros and cons of using the ListR method, refer to rclone documentation. In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster.

    -

    Note: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output.

    -

    Purge

    -

    NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method.

    -

    Note: Read the NetStorage Usage API for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible.

    -

    Standard options

    -

    Here are the Standard options specific to netstorage (Akamai NetStorage).

    -

    --netstorage-host

    -

    Domain+path of NetStorage host to connect to.

    -

    Format should be <domain>/<internal folders>

    -

    Properties:

    -
      -
    • Config: host
    • -
    • Env Var: RCLONE_NETSTORAGE_HOST
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --netstorage-account

    -

    Set the NetStorage account name

    -

    Properties:

    -
      -
    • Config: account
    • -
    • Env Var: RCLONE_NETSTORAGE_ACCOUNT
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    --netstorage-secret

    -

    Set the NetStorage account secret/G2O key for authentication.

    -

    Please choose the 'y' option to set your own password then enter your secret.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: secret
    • -
    • Env Var: RCLONE_NETSTORAGE_SECRET
    • -
    • Type: string
    • -
    • Required: true
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to netstorage (Akamai NetStorage).

    -

    --netstorage-protocol

    -

    Select between HTTP or HTTPS protocol.

    -

    Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes.

    -

    Properties:

    -
      -
    • Config: protocol
    • -
    • Env Var: RCLONE_NETSTORAGE_PROTOCOL
    • -
    • Type: string
    • -
    • Default: "https"
    • -
    • Examples: -
        -
      • "http" -
          -
        • HTTP protocol
        • -
      • -
      • "https" -
          -
        • HTTPS protocol
        • -
      • -
    • -
    -

    Backend commands

    -

    Here are the commands specific to the netstorage backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    du

    -

    Return disk usage information for a specified directory

    -
    rclone backend du remote: [options] [<arguments>+]
    -

    The usage information returned, includes the targeted directory as well as all files stored in any sub-directories that may exist.

    - -

    You can create a symbolic link in ObjectStore with the symlink action.

    -
    rclone backend symlink remote: [options] [<arguments>+]
    -

    The desired path location (including applicable sub-directories) ending in the object that will be the target of the symlink (for example, /links/mylink). Include the file extension for the object, if applicable. rclone backend symlink <src> <path>

    -

    Microsoft Azure Blob Storage

    -

    Paths are specified as remote:container (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:container/path/to/dir.

    -

    Configuration

    -

    Here is an example of making a Microsoft Azure Blob Storage configuration. For a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Microsoft Azure Blob Storage
    -   \ "azureblob"
    -[snip]
    -Storage> azureblob
    -Storage Account Name
    -account> account_name
    -Storage Account Key
    -key> base64encodedkey==
    -Endpoint for the service - leave blank normally.
    -endpoint> 
    -Remote config
    ---------------------
    -[remote]
    -account = account_name
    -key = base64encodedkey==
    -endpoint = 
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See all containers

    -
    rclone lsd remote:
    -

    Make a new container

    -
    rclone mkdir remote:container
    -

    List the contents of a container

    -
    rclone ls remote:container
    -

    Sync /home/local/directory to the remote container, deleting any excess files in the container.

    -
    rclone sync --interactive /home/local/directory remote:container
    -

    --fast-list

    -

    This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

    -

    Modified time

    -

    The modified time is stored as metadata on the object with the mtime key. It is stored using RFC3339 Format time with nanosecond precision. The metadata is supplied during directory listings so there is no performance overhead to using it.

    -

    If you wish to use the Azure standard LastModified time stored on the object as the modified time, then use the --use-server-modtime flag. Note that rclone can't set LastModified, so using the --update flag when syncing is recommended if using --use-server-modtime.

    -

    Performance

    -

    When uploading large files, increasing the value of --azureblob-upload-concurrency will increase performance at the cost of using more memory. The default of 16 is set quite conservatively to use less memory. It maybe be necessary raise it to 64 or higher to fully utilize a 1 GBit/s link with a single file transfer.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    /0x2F
    \0x5C
    -

    File names can also not end with the following characters. These only get replaced if they are the last character in the name:

    - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    .0x2E
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Hashes

    -

    MD5 hashes are stored with blobs. However blobs that were uploaded in chunks only have an MD5 if the source remote was capable of MD5 hashes, e.g. the local disk.

    -

    Authentication

    -

    There are a number of ways of supplying credentials for Azure Blob Storage. Rclone tries them in the order of the sections below.

    -

    Env Auth

    -

    If the env_auth config parameter is true then rclone will pull credentials from the environment or runtime.

    -

    It tries these authentication methods in this order:

    -
      -
    1. Environment Variables
    2. -
    3. Managed Service Identity Credentials
    4. -
    5. Azure CLI credentials (as used by the az tool)
    6. -
    -

    These are described in the following sections

    -
    Env Auth: 1. Environment Variables
    -

    If env_auth is set and environment variables are present rclone authenticates a service principal with a secret or certificate, or a user with a password, depending on which environment variable are set. It reads configuration from these variables, in the following order:

    -
      -
    1. Service principal with client secret -
        -
      • AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID.
      • -
      • AZURE_CLIENT_ID: the service principal's client ID
      • -
      • AZURE_CLIENT_SECRET: one of the service principal's client secrets
      • -
    2. -
    3. Service principal with certificate -
        -
      • AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID.
      • -
      • AZURE_CLIENT_ID: the service principal's client ID
      • -
      • AZURE_CLIENT_CERTIFICATE_PATH: path to a PEM or PKCS12 certificate file including the private key.
      • -
      • AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the certificate file.
      • -
      • AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
      • -
    4. -
    5. User with username and password -
        -
      • AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations".
      • -
      • AZURE_CLIENT_ID: client ID of the application the user will authenticate to
      • -
      • AZURE_USERNAME: a username (usually an email address)
      • -
      • AZURE_PASSWORD: the user's password
      • -
    6. -
    -
    Env Auth: 2. Managed Service Identity Credentials
    -

    When using Managed Service Identity if the VM(SS) on which this program is running has a system-assigned identity, it will be used by default. If the resource has no system-assigned but exactly one user-assigned identity, the user-assigned identity will be used by default.

    -

    If the resource has multiple user-assigned identities you will need to unset env_auth and set use_msi instead. See the use_msi section.

    -
    Env Auth: 3. Azure CLI credentials (as used by the az tool)
    -

    Credentials created with the az tool can be picked up using env_auth.

    -

    For example if you were to login with a service principal like this:

    -
    az login --service-principal -u XXX -p XXX --tenant XXX
    -

    Then you could access rclone resources like this:

    -
    rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER
    -

    Or

    -
    rclone lsf --azureblob-env-auth --azureblob-acccount=ACCOUNT :azureblob:CONTAINER
    -

    Which is analogous to using the az tool:

    -
    az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login
    -

    Account and Shared Key

    -

    This is the most straight forward and least flexible way. Just fill in the account and key lines and leave the rest blank.

    -

    SAS URL

    -

    This can be an account level SAS URL or container level SAS URL.

    -

    To use it leave account and key blank and fill in sas_url.

    -

    An account level SAS URL or container level SAS URL can be obtained from the Azure portal or the Azure Storage Explorer. To get a container level SAS URL right click on a container in the Azure Blob explorer in the Azure portal.

    -

    If you use a container level SAS URL, rclone operations are permitted only on a particular container, e.g.

    -
    rclone ls azureblob:container
    -

    You can also list the single container from the root. This will only show the container specified by the SAS URL.

    -
    $ rclone lsd azureblob:
    -container/
    -

    Note that you can't see or access any other containers - this will fail

    -
    rclone ls azureblob:othercontainer
    -

    Container level SAS URLs are useful for temporarily allowing third parties access to a single container or putting credentials into an untrusted environment such as a CI build server.

    -

    Service principal with client secret

    -

    If these variables are set, rclone will authenticate with a service principal with a client secret.

    -
      -
    • tenant: ID of the service principal's tenant. Also called its "directory" ID.
    • -
    • client_id: the service principal's client ID
    • -
    • client_secret: one of the service principal's client secrets
    • -
    -

    The credentials can also be placed in a file using the service_principal_file configuration option.

    -

    Service principal with certificate

    -

    If these variables are set, rclone will authenticate with a service principal with certificate.

    -
      -
    • tenant: ID of the service principal's tenant. Also called its "directory" ID.
    • -
    • client_id: the service principal's client ID
    • -
    • client_certificate_path: path to a PEM or PKCS12 certificate file including the private key.
    • -
    • client_certificate_password: (optional) password for the certificate file.
    • -
    • client_send_certificate_chain: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
    • -
    -

    NB client_certificate_password must be obscured - see rclone obscure.

    -

    User with username and password

    -

    If these variables are set, rclone will authenticate with username and password.

    -
      -
    • tenant: (optional) tenant to authenticate in. Defaults to "organizations".
    • -
    • client_id: client ID of the application the user will authenticate to
    • -
    • username: a username (usually an email address)
    • -
    • password: the user's password
    • -
    -

    Microsoft doesn't recommend this kind of authentication, because it's less secure than other authentication flows. This method is not interactive, so it isn't compatible with any form of multi-factor authentication, and the application must already have user or admin consent. This credential can only authenticate work and school accounts; it can't authenticate Microsoft accounts.

    -

    NB password must be obscured - see rclone obscure.

    -

    Managed Service Identity Credentials

    -

    If use_msi is set then managed service identity credentials are used. This authentication only works when running in an Azure service. env_auth needs to be unset to use this.

    -

    However if you have multiple user identities to choose from these must be explicitly specified using exactly one of the msi_object_id, msi_client_id, or msi_mi_res_id parameters.

    -

    If none of msi_object_id, msi_client_id, or msi_mi_res_id is set, this is is equivalent to using env_auth.

    -

    Standard options

    -

    Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage).

    -

    --azureblob-account

    -

    Azure Storage Account Name.

    -

    Set this to the Azure Storage Account Name in use.

    -

    Leave blank to use SAS URL or Emulator, otherwise it needs to be set.

    -

    If this is blank and if env_auth is set it will be read from the environment variable AZURE_STORAGE_ACCOUNT_NAME if possible.

    -

    Properties:

    -
      -
    • Config: account
    • -
    • Env Var: RCLONE_AZUREBLOB_ACCOUNT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-env-auth

    -

    Read credentials from runtime (environment variables, CLI or MSI).

    -

    See the authentication docs for full info.

    -

    Properties:

    -
      -
    • Config: env_auth
    • -
    • Env Var: RCLONE_AZUREBLOB_ENV_AUTH
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-key

    -

    Storage Account Shared Key.

    -

    Leave blank to use SAS URL or Emulator.

    -

    Properties:

    -
      -
    • Config: key
    • -
    • Env Var: RCLONE_AZUREBLOB_KEY
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-sas-url

    -

    SAS URL for container level access only.

    -

    Leave blank if using account/key or Emulator.

    -

    Properties:

    -
      -
    • Config: sas_url
    • -
    • Env Var: RCLONE_AZUREBLOB_SAS_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-tenant

    -

    ID of the service principal's tenant. Also called its directory ID.

    -

    Set this if using - Service principal with client secret - Service principal with certificate - User with username and password

    -

    Properties:

    -
      -
    • Config: tenant
    • -
    • Env Var: RCLONE_AZUREBLOB_TENANT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-client-id

    -

    The ID of the client in use.

    -

    Set this if using - Service principal with client secret - Service principal with certificate - User with username and password

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_AZUREBLOB_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-client-secret

    -

    One of the service principal's client secrets

    -

    Set this if using - Service principal with client secret

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-client-certificate-path

    -

    Path to a PEM or PKCS12 certificate file including the private key.

    -

    Set this if using - Service principal with certificate

    -

    Properties:

    -
      -
    • Config: client_certificate_path
    • -
    • Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-client-certificate-password

    -

    Password for the certificate file (optional).

    -

    Optionally set this if using - Service principal with certificate

    -

    And the certificate has a password.

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: client_certificate_password
    • -
    • Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage).

    -

    --azureblob-client-send-certificate-chain

    -

    Send the certificate chain when using certificate auth.

    -

    Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to true, authentication requests include the x5c header.

    -

    Optionally set this if using - Service principal with certificate

    -

    Properties:

    -
      -
    • Config: client_send_certificate_chain
    • -
    • Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-username

    -

    User name (usually an email address)

    -

    Set this if using - User with username and password

    -

    Properties:

    -
      -
    • Config: username
    • -
    • Env Var: RCLONE_AZUREBLOB_USERNAME
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-password

    -

    The user's password

    -

    Set this if using - User with username and password

    -

    NB Input to this must be obscured - see rclone obscure.

    -

    Properties:

    -
      -
    • Config: password
    • -
    • Env Var: RCLONE_AZUREBLOB_PASSWORD
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-service-principal-file

    -

    Path to file containing credentials for use with a service principal.

    -

    Leave blank normally. Needed only if you want to use a service principal instead of interactive login.

    -
    $ az ad sp create-for-rbac --name "<name>" \
    -  --role "Storage Blob Data Owner" \
    -  --scopes "/subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>" \
    -  > azure-principal.json
    -

    See "Create an Azure service principal" and "Assign an Azure role for access to blob data" pages for more details.

    -

    It may be more convenient to put the credentials directly into the rclone config file under the client_id, tenant and client_secret keys instead of setting service_principal_file.

    -

    Properties:

    -
      -
    • Config: service_principal_file
    • -
    • Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-use-msi

    -

    Use a managed service identity to authenticate (only works in Azure).

    -

    When true, use a managed service identity to authenticate to Azure Storage instead of a SAS token or account key.

    -

    If the VM(SS) on which this program is running has a system-assigned identity, it will be used by default. If the resource has no system-assigned but exactly one user-assigned identity, the user-assigned identity will be used by default. If the resource has multiple user-assigned identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, msi_client_id, or msi_mi_res_id parameters.

    -

    Properties:

    -
      -
    • Config: use_msi
    • -
    • Env Var: RCLONE_AZUREBLOB_USE_MSI
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-msi-object-id

    -

    Object ID of the user-assigned MSI to use, if any.

    -

    Leave blank if msi_client_id or msi_mi_res_id specified.

    -

    Properties:

    -
      -
    • Config: msi_object_id
    • -
    • Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-msi-client-id

    -

    Object ID of the user-assigned MSI to use, if any.

    -

    Leave blank if msi_object_id or msi_mi_res_id specified.

    -

    Properties:

    -
      -
    • Config: msi_client_id
    • -
    • Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-msi-mi-res-id

    -

    Azure resource ID of the user-assigned MSI to use, if any.

    -

    Leave blank if msi_client_id or msi_object_id specified.

    -

    Properties:

    -
      -
    • Config: msi_mi_res_id
    • -
    • Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-use-emulator

    -

    Uses local storage emulator if provided as 'true'.

    -

    Leave blank if using real azure storage endpoint.

    -

    Properties:

    -
      -
    • Config: use_emulator
    • -
    • Env Var: RCLONE_AZUREBLOB_USE_EMULATOR
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-endpoint

    -

    Endpoint for the service.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: endpoint
    • -
    • Env Var: RCLONE_AZUREBLOB_ENDPOINT
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-upload-cutoff

    -

    Cutoff for switching to chunked upload (<= 256 MiB) (deprecated).

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-chunk-size

    -

    Upload chunk size.

    -

    Note that this is stored in memory and there may be up to "--transfers" * "--azureblob-upload-concurrency" chunks stored at once in memory.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 4Mi
    • -
    -

    --azureblob-upload-concurrency

    -

    Concurrency for multipart uploads.

    -

    This is the number of chunks of the same file that are uploaded concurrently.

    -

    If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

    -

    In tests, upload speed increases almost linearly with upload concurrency. For example to fill a gigabit pipe it may be necessary to raise this to 64. Note that this will use more memory.

    -

    Note that chunks are stored in memory and there may be up to "--transfers" * "--azureblob-upload-concurrency" chunks stored at once in memory.

    -

    Properties:

    -
      -
    • Config: upload_concurrency
    • -
    • Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY
    • -
    • Type: int
    • -
    • Default: 16
    • -
    -

    --azureblob-list-chunk

    -

    Size of blob list.

    -

    This sets the number of blobs requested in each listing chunk. Default is the maximum, 5000. "List blobs" requests are permitted 2 minutes per megabyte to complete. If an operation is taking longer than 2 minutes per megabyte on average, it will time out ( source ). This can be used to limit the number of blobs items to return, to avoid the time out.

    -

    Properties:

    -
      -
    • Config: list_chunk
    • -
    • Env Var: RCLONE_AZUREBLOB_LIST_CHUNK
    • -
    • Type: int
    • -
    • Default: 5000
    • -
    -

    --azureblob-access-tier

    -

    Access tier of blob: hot, cool or archive.

    -

    Archived blobs can be restored by setting access tier to hot or cool. Leave blank if you intend to use default access tier, which is set at account level

    -

    If there is no "access tier" specified, rclone doesn't apply any tier. rclone performs "Set Tier" operation on blobs while uploading, if objects are not modified, specifying "access tier" to new one will have no effect. If blobs are in "archive tier" at remote, trying to perform data transfer operations from remote will not be allowed. User should first restore by tiering blob to "Hot" or "Cool".

    -

    Properties:

    -
      -
    • Config: access_tier
    • -
    • Env Var: RCLONE_AZUREBLOB_ACCESS_TIER
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --azureblob-archive-tier-delete

    -

    Delete archive tier blobs before overwriting.

    -

    Archive tier blobs cannot be updated. So without this flag, if you attempt to update an archive tier blob, then rclone will produce the error:

    -
    can't update archive tier blob without --azureblob-archive-tier-delete
    -

    With this flag set then before rclone attempts to overwrite an archive tier blob, it will delete the existing blob before uploading its replacement. This has the potential for data loss if the upload fails (unlike updating a normal blob) and also may cost more since deleting archive tier blobs early may be chargable.

    -

    Properties:

    -
      -
    • Config: archive_tier_delete
    • -
    • Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-disable-checksum

    -

    Don't store MD5 checksum with object metadata.

    -

    Normally rclone will calculate the MD5 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

    -

    Properties:

    -
      -
    • Config: disable_checksum
    • -
    • Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-memory-pool-flush-time

    -

    How often internal memory buffer pools will be flushed.

    -

    Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. This option controls how often unused buffers will be removed from the pool.

    -

    Properties:

    -
      -
    • Config: memory_pool_flush_time
    • -
    • Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --azureblob-memory-pool-use-mmap

    -

    Whether to use mmap buffers in internal memory pool.

    -

    Properties:

    -
      -
    • Config: memory_pool_use_mmap
    • -
    • Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_AZUREBLOB_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8
    • -
    -

    --azureblob-public-access

    -

    Public access level of a container: blob or container.

    -

    Properties:

    -
      -
    • Config: public_access
    • -
    • Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • The container and its blobs can be accessed only with an authorized request.
        • -
        • It's a default value.
        • -
      • -
      • "blob" -
          -
        • Blob data within this container can be read via anonymous request.
        • -
      • -
      • "container" -
          -
        • Allow full public read access for container and blob data.
        • -
      • -
    • -
    -

    --azureblob-no-check-container

    -

    If set, don't attempt to check the container exists or create it.

    -

    This can be useful when trying to minimise the number of transactions rclone does if you know the container exists already.

    -

    Properties:

    -
      -
    • Config: no_check_container
    • -
    • Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --azureblob-no-head-object

    -

    If set, do not do HEAD before GET when getting objects.

    -

    Properties:

    -
      -
    • Config: no_head_object
    • -
    • Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    Custom upload headers

    -

    You can set custom upload headers with the --header-upload flag.

    -
      -
    • Cache-Control
    • -
    • Content-Disposition
    • -
    • Content-Encoding
    • -
    • Content-Language
    • -
    • Content-Type
    • -
    -

    Eg --header-upload "Content-Type: text/potato"

    -

    Limitations

    -

    MD5 sums are only uploaded with chunked files if the source has an MD5 sum. This will always be the case for a local to azure copy.

    -

    rclone about is not supported by the Microsoft Azure Blob storage backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    -

    See List of backends that do not support rclone about and rclone about

    -

    Azure Storage Emulator Support

    -

    You can run rclone with the storage emulator (usually azurite).

    -

    To do this, just set up a new remote with rclone config following the instructions in the introduction and set use_emulator in the advanced settings as true. You do not need to provide a default account name nor an account key. But you can override them in the account and key options. (Prior to v1.61 they were hard coded to azurite's devstoreaccount1.)

    -

    Also, if you want to access a storage emulator instance running on a different machine, you can override the endpoint parameter in the advanced settings, setting it to http(s)://<host>:<port>/devstoreaccount1 (e.g. http://10.254.2.5:10000/devstoreaccount1).

    -

    Microsoft OneDrive

    -

    Paths are specified as remote:path

    -

    Paths may be as deep as required, e.g. remote:directory/subdirectory.

    -

    Configuration

    -

    The initial setup for OneDrive involves getting a token from Microsoft which you need to do in your browser. rclone config walks you through it.

    -

    Here is an example of how to make a remote called remote. First run:

    -
     rclone config
    -

    This will guide you through an interactive setup process:

    -
    e) Edit existing remote
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> n
    -name> remote
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Microsoft OneDrive
    -   \ "onedrive"
    -[snip]
    -Storage> onedrive
    -Microsoft App Client Id
    -Leave blank normally.
    -Enter a string value. Press Enter for the default ("").
    -client_id>
    -Microsoft App Client Secret
    -Leave blank normally.
    -Enter a string value. Press Enter for the default ("").
    -client_secret>
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    -Use web browser to automatically authenticate rclone with remote?
    - * Say Y if the machine running rclone has a web browser you can use
    - * Say N if running rclone on a (remote) machine without web browser access
    -If not sure try Y. If Y failed, try N.
    -y) Yes
    -n) No
    -y/n> y
    -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    -Log in and authorize rclone for access
    -Waiting for code...
    -Got code
    -Choose a number from below, or type in an existing value
    - 1 / OneDrive Personal or Business
    -   \ "onedrive"
    - 2 / Sharepoint site
    -   \ "sharepoint"
    - 3 / Type in driveID
    -   \ "driveid"
    - 4 / Type in SiteID
    -   \ "siteid"
    - 5 / Search a Sharepoint site
    -   \ "search"
    -Your choice> 1
    -Found 1 drives, please select the one you want to use:
    -0: OneDrive (business) id=b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk
    -Chose drive to use:> 0
    -Found drive 'root' of type 'business', URL: https://org-my.sharepoint.com/personal/you/Documents
    -Is that okay?
    -y) Yes
    -n) No
    -y/n> y
    ---------------------
    -[remote]
    -type = onedrive
    -token = {"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2018-08-26T22:39:52.486512262+08:00"}
    -drive_id = b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk
    -drive_type = business
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    See the remote setup docs for how to set it up on a machine with no Internet browser available.

    -

    Note that rclone runs a webserver on your local machine to collect the token as returned from Microsoft. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall.

    -

    Once configured you can then use rclone like this,

    -

    List directories in top level of your OneDrive

    -
    rclone lsd remote:
    -

    List all the files in your OneDrive

    -
    rclone ls remote:
    -

    To copy a local directory to an OneDrive directory called backup

    -
    rclone copy /home/source remote:backup
    -

    Getting your own Client ID and Key

    -

    rclone uses a default Client ID when talking to OneDrive, unless a custom client_id is specified in the config. The default Client ID and Key are shared by all rclone users when performing requests.

    -

    You may choose to create and use your own Client ID, in case the default one does not work well for you. For example, you might see throttling.

    -

    Creating Client ID for OneDrive Personal

    -

    To create your own Client ID, please follow these steps:

    -
      -
    1. Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click New registration.
    2. -
    3. Enter a name for your app, choose account type Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox), select Web in Redirect URI, then type (do not copy and paste) http://localhost:53682/ and click Register. Copy and keep the Application (client) ID under the app name for later use.
    4. -
    5. Under manage select Certificates & secrets, click New client secret. Enter a description (can be anything) and set Expires to 24 months. Copy and keep that secret Value for later use (you won't be able to see this value afterwards).
    6. -
    7. Under manage select API permissions, click Add a permission and select Microsoft Graph then select delegated permissions.
    8. -
    9. Search and select the following permissions: Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All, offline_access, User.Read and Sites.Read.All (if custom access scopes are configured, select the permissions accordingly). Once selected click Add permissions at the bottom.
    10. -
    -

    Now the application is complete. Run rclone config to create or edit a OneDrive remote. Supply the app ID and password as Client ID and Secret, respectively. rclone will walk you through the remaining steps.

    -

    The access_scopes option allows you to configure the permissions requested by rclone. See Microsoft Docs for more information about the different scopes.

    -

    The Sites.Read.All permission is required if you need to search SharePoint sites when configuring the remote. However, if that permission is not assigned, you need to exclude Sites.Read.All from your access scopes or set disable_site_permission option to true in the advanced options.

    -

    Creating Client ID for OneDrive Business

    -

    The steps for OneDrive Personal may or may not work for OneDrive Business, depending on the security settings of the organization. A common error is that the publisher of the App is not verified.

    -

    You may try to verify you account, or try to limit the App to your organization only, as shown below.

    -
      -
    1. Make sure to create the App with your business account.
    2. -
    3. Follow the steps above to create an App. However, we need a different account type here: Accounts in this organizational directory only (*** - Single tenant). Note that you can also change the account type after creating the App.
    4. -
    5. Find the tenant ID of your organization.
    6. -
    7. In the rclone config, set auth_url to https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/authorize.
    8. -
    9. In the rclone config, set token_url to https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token.
    10. -
    -

    Note: If you have a special region, you may need a different host in step 4 and 5. Here are some hints.

    -

    Modification time and hashes

    -

    OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not.

    -

    OneDrive Personal, OneDrive for Business and Sharepoint Server support QuickXorHash.

    -

    Before rclone 1.62 the default hash for Onedrive Personal was SHA1. For rclone 1.62 and above the default for all Onedrive backends is QuickXorHash.

    -

    Starting from July 2023 SHA1 support is being phased out in Onedrive Personal in favour of QuickXorHash. If necessary the --onedrive-hash-type flag (or hash_type config option) can be used to select SHA1 during the transition period if this is important your workflow.

    -

    For all types of OneDrive you can use the --checksum flag.

    -

    Restricted filename characters

    -

    In addition to the default restricted characters set the following characters are also replaced:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    "0x22
    *0x2A
    :0x3A
    <0x3C
    >0x3E
    ?0x3F
    \0x5C
    |0x7C
    -

    File names can also not end with the following characters. These only get replaced if they are the last character in the name:

    - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    SP0x20
    .0x2E
    -

    File names can also not begin with the following characters. These only get replaced if they are the first character in the name:

    - - - - - - - - - - - - - - - - - - - - -
    CharacterValueReplacement
    SP0x20
    ~0x7E
    -

    Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

    -

    Deleting files

    -

    Any files you delete with rclone will end up in the trash. Microsoft doesn't provide an API to permanently delete files, nor to empty the trash, so you will have to do that with one of Microsoft's apps or via the OneDrive website.

    -

    Standard options

    -

    Here are the Standard options specific to onedrive (Microsoft OneDrive).

    -

    --onedrive-client-id

    -

    OAuth Client Id.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_id
    • -
    • Env Var: RCLONE_ONEDRIVE_CLIENT_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-client-secret

    -

    OAuth Client Secret.

    -

    Leave blank normally.

    -

    Properties:

    -
      -
    • Config: client_secret
    • -
    • Env Var: RCLONE_ONEDRIVE_CLIENT_SECRET
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-region

    -

    Choose national cloud region for OneDrive.

    -

    Properties:

    -
      -
    • Config: region
    • -
    • Env Var: RCLONE_ONEDRIVE_REGION
    • -
    • Type: string
    • -
    • Default: "global"
    • -
    • Examples: -
        -
      • "global" -
          -
        • Microsoft Cloud Global
        • -
      • -
      • "us" -
          -
        • Microsoft Cloud for US Government
        • -
      • -
      • "de" -
          -
        • Microsoft Cloud Germany
        • -
      • -
      • "cn" -
          -
        • Azure and Office 365 operated by Vnet Group in China
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to onedrive (Microsoft OneDrive).

    -

    --onedrive-token

    -

    OAuth Access Token as a JSON blob.

    -

    Properties:

    -
      -
    • Config: token
    • -
    • Env Var: RCLONE_ONEDRIVE_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-auth-url

    -

    Auth server URL.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: auth_url
    • -
    • Env Var: RCLONE_ONEDRIVE_AUTH_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-token-url

    -

    Token server url.

    -

    Leave blank to use the provider defaults.

    -

    Properties:

    -
      -
    • Config: token_url
    • -
    • Env Var: RCLONE_ONEDRIVE_TOKEN_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-chunk-size

    -

    Chunk size to upload files with - must be multiple of 320k (327,680 bytes).

    -

    Above this size files will be chunked - must be multiple of 320k (327,680 bytes) and should not exceed 250M (262,144,000 bytes) else you may encounter "Microsoft.SharePoint.Client.InvalidClientQueryException: The request message is too big." Note that the chunks will be buffered into memory.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_ONEDRIVE_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 10Mi
    • -
    -

    --onedrive-drive-id

    -

    The ID of the drive to use.

    -

    Properties:

    -
      -
    • Config: drive_id
    • -
    • Env Var: RCLONE_ONEDRIVE_DRIVE_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-drive-type

    -

    The type of the drive (personal | business | documentLibrary).

    -

    Properties:

    -
      -
    • Config: drive_type
    • -
    • Env Var: RCLONE_ONEDRIVE_DRIVE_TYPE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-root-folder-id

    -

    ID of the root folder.

    -

    This isn't normally needed, but in special circumstances you might know the folder ID that you wish to access but not be able to get there through a path traversal.

    -

    Properties:

    -
      -
    • Config: root_folder_id
    • -
    • Env Var: RCLONE_ONEDRIVE_ROOT_FOLDER_ID
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-access-scopes

    -

    Set scopes to be requested by rclone.

    -

    Choose or manually enter a custom space separated list with all scopes, that rclone should request.

    -

    Properties:

    -
      -
    • Config: access_scopes
    • -
    • Env Var: RCLONE_ONEDRIVE_ACCESS_SCOPES
    • -
    • Type: SpaceSepList
    • -
    • Default: Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access
    • -
    • Examples: -
        -
      • "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access" -
          -
        • Read and write access to all resources
        • -
      • -
      • "Files.Read Files.Read.All Sites.Read.All offline_access" -
          -
        • Read only access to all resources
        • -
      • -
      • "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All offline_access" -
          -
        • Read and write access to all resources, without the ability to browse SharePoint sites.
        • -
        • Same as if disable_site_permission was set to true
        • -
      • -
    • -
    -

    --onedrive-disable-site-permission

    -

    Disable the request for Sites.Read.All permission.

    -

    If set to true, you will no longer be able to search for a SharePoint site when configuring drive ID, because rclone will not request Sites.Read.All permission. Set it to true if your organization didn't assign Sites.Read.All permission to the application, and your organization disallows users to consent app permission request on their own.

    -

    Properties:

    -
      -
    • Config: disable_site_permission
    • -
    • Env Var: RCLONE_ONEDRIVE_DISABLE_SITE_PERMISSION
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --onedrive-expose-onenote-files

    -

    Set to make OneNote files show up in directory listings.

    -

    By default, rclone will hide OneNote files in directory listings because operations like "Open" and "Update" won't work on them. But this behaviour may also prevent you from deleting them. If you want to delete OneNote files or otherwise want them to show up in directory listing, set this option.

    -

    Properties:

    -
      -
    • Config: expose_onenote_files
    • -
    • Env Var: RCLONE_ONEDRIVE_EXPOSE_ONENOTE_FILES
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --onedrive-server-side-across-configs

    -

    Allow server-side operations (e.g. copy) to work across different onedrive configs.

    -

    This will only work if you are copying between two OneDrive Personal drives AND the files to copy are already shared between them. In other cases, rclone will fall back to normal copy (which will be slightly slower).

    -

    Properties:

    -
      -
    • Config: server_side_across_configs
    • -
    • Env Var: RCLONE_ONEDRIVE_SERVER_SIDE_ACROSS_CONFIGS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --onedrive-list-chunk

    -

    Size of listing chunk.

    -

    Properties:

    -
      -
    • Config: list_chunk
    • -
    • Env Var: RCLONE_ONEDRIVE_LIST_CHUNK
    • -
    • Type: int
    • -
    • Default: 1000
    • -
    -

    --onedrive-no-versions

    -

    Remove all versions on modifying operations.

    -

    Onedrive for business creates versions when rclone uploads new files overwriting an existing one and when it sets the modification time.

    -

    These versions take up space out of the quota.

    -

    This flag checks for versions after file upload and setting modification time and removes all but the last version.

    -

    NB Onedrive personal can't currently delete versions so don't use this flag there.

    -

    Properties:

    -
      -
    • Config: no_versions
    • -
    • Env Var: RCLONE_ONEDRIVE_NO_VERSIONS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    - -

    Set the scope of the links created by the link command.

    -

    Properties:

    -
      -
    • Config: link_scope
    • -
    • Env Var: RCLONE_ONEDRIVE_LINK_SCOPE
    • -
    • Type: string
    • -
    • Default: "anonymous"
    • -
    • Examples: -
        -
      • "anonymous" -
          -
        • Anyone with the link has access, without needing to sign in.
        • -
        • This may include people outside of your organization.
        • -
        • Anonymous link support may be disabled by an administrator.
        • -
      • -
      • "organization" -
          -
        • Anyone signed into your organization (tenant) can use the link to get access.
        • -
        • Only available in OneDrive for Business and SharePoint.
        • -
      • -
    • -
    - -

    Set the type of the links created by the link command.

    -

    Properties:

    -
      -
    • Config: link_type
    • -
    • Env Var: RCLONE_ONEDRIVE_LINK_TYPE
    • -
    • Type: string
    • -
    • Default: "view"
    • -
    • Examples: -
        -
      • "view" -
          -
        • Creates a read-only link to the item.
        • -
      • -
      • "edit" -
          -
        • Creates a read-write link to the item.
        • -
      • -
      • "embed" -
          -
        • Creates an embeddable link to the item.
        • -
      • -
    • -
    - -

    Set the password for links created by the link command.

    -

    At the time of writing this only works with OneDrive personal paid accounts.

    -

    Properties:

    -
      -
    • Config: link_password
    • -
    • Env Var: RCLONE_ONEDRIVE_LINK_PASSWORD
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --onedrive-hash-type

    -

    Specify the hash in use for the backend.

    -

    This specifies the hash type in use. If set to "auto" it will use the default hash which is is QuickXorHash.

    -

    Before rclone 1.62 an SHA1 hash was used by default for Onedrive Personal. For 1.62 and later the default is to use a QuickXorHash for all onedrive types. If an SHA1 hash is desired then set this option accordingly.

    -

    From July 2023 QuickXorHash will be the only available hash for both OneDrive for Business and OneDriver Personal.

    -

    This can be set to "none" to not use any hashes.

    -

    If the hash requested does not exist on the object, it will be returned as an empty string which is treated as a missing hash by rclone.

    -

    Properties:

    -
      -
    • Config: hash_type
    • -
    • Env Var: RCLONE_ONEDRIVE_HASH_TYPE
    • -
    • Type: string
    • -
    • Default: "auto"
    • -
    • Examples: -
        -
      • "auto" -
          -
        • Rclone chooses the best hash
        • -
      • -
      • "quickxor" -
          -
        • QuickXor
        • -
      • -
      • "sha1" -
          -
        • SHA1
        • -
      • -
      • "sha256" -
          -
        • SHA256
        • -
      • -
      • "crc32" -
          -
        • CRC32
        • -
      • -
      • "none" -
          -
        • None - don't use any hashes
        • -
      • -
    • -
    -

    --onedrive-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_ONEDRIVE_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot
    • -
    -

    Limitations

    -

    If you don't use rclone for 90 days the refresh token will expire. This will result in authorization problems. This is easy to fix by running the rclone config reconnect remote: command to get a new token and refresh token.

    -

    Naming

    -

    Note that OneDrive is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

    -

    There are quite a few characters that can't be in OneDrive file names. These can't occur on Windows platforms, but on non-Windows platforms they are common. Rclone will map these names to and from an identical looking unicode equivalent. For example if a file has a ? in it will be mapped to instead.

    -

    File sizes

    -

    The largest allowed file size is 250 GiB for both OneDrive Personal and OneDrive for Business (Updated 13 Jan 2021).

    -

    Path length

    -

    The entire path, including the file name, must contain fewer than 400 characters for OneDrive, OneDrive for Business and SharePoint Online. If you are encrypting file and folder names with rclone, you may want to pay attention to this limitation because the encrypted names are typically longer than the original ones.

    -

    Number of files

    -

    OneDrive seems to be OK with at least 50,000 files in a folder, but at 100,000 rclone will get errors listing the directory like couldn’t list files: UnknownError:. See #2707 for more info.

    -

    An official document about the limitations for different types of OneDrive can be found here.

    -

    Versions

    -

    Every change in a file OneDrive causes the service to create a new version of the file. This counts against a users quota. For example changing the modification time of a file creates a second version, so the file apparently uses twice the space.

    -

    For example the copy command is affected by this as rclone copies the file and then afterwards sets the modification time to match the source file which uses another version.

    -

    You can use the rclone cleanup command (see below) to remove all old versions.

    -

    Or you can set the no_versions parameter to true and rclone will remove versions after operations which create new versions. This takes extra transactions so only enable it if you need it.

    -

    Note At the time of writing Onedrive Personal creates versions (but not for setting the modification time) but the API for removing them returns "API not found" so cleanup and no_versions should not be used on Onedrive Personal.

    -

    Disabling versioning

    -

    Starting October 2018, users will no longer be able to disable versioning by default. This is because Microsoft has brought an update to the mechanism. To change this new default setting, a PowerShell command is required to be run by a SharePoint admin. If you are an admin, you can run these commands in PowerShell to change that setting:

    +

    cleanup-hidden

    +

    Remove old versions of files.

    +
    rclone backend cleanup-hidden remote: [options] [<arguments>+]
    +

    This command removes any old hidden versions of files on a versions enabled bucket.

    +

    Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

    +
    rclone backend cleanup-hidden s3:bucket/path/to/dir
    +

    versioning

    +

    Set/get versioning support for a bucket.

    +
    rclone backend versioning remote: [options] [<arguments>+]
    +

    This command sets versioning support if a parameter is passed and then returns the current versioning status for the bucket supplied.

    +
    rclone backend versioning s3:bucket # read status only
    +rclone backend versioning s3:bucket Enabled
    +rclone backend versioning s3:bucket Suspended
    +

    It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning has been enabled the status can't be set back to "Unversioned".

    +

    set

    +

    Set command for updating the config parameters.

    +
    rclone backend set remote: [options] [<arguments>+]
    +

    This set command can be used to update the config parameters for a running s3 backend.

    +

    Usage Examples:

    +
    rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
    +rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
    +rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X
    +

    The option keys are named as they are in the config file.

    +

    This rebuilds the connection to the s3 backend when it is called with the new parameters. Only new parameters need be passed as the values will default to those currently in use.

    +

    It doesn't return anything.

    +

    Anonymous access to public buckets

    +

    If you want to use rclone to access a public bucket, configure with a blank access_key_id and secret_access_key. Your config should end up looking like this:

    +
    [anons3]
    +type = s3
    +provider = AWS
    +env_auth = false
    +access_key_id =
    +secret_access_key =
    +region = us-east-1
    +endpoint =
    +location_constraint =
    +acl = private
    +server_side_encryption =
    +storage_class =
    +

    Then use it as normal with the name of the public bucket, e.g.

    +
    rclone lsd anons3:1000genomes
    +

    You will be able to list and copy data but not upload it.

    +

    Providers

    +

    AWS S3

    +

    This is the provider used as main example and described in the configuration section above.

    +

    AWS Snowball Edge

    +

    AWS Snowball is a hardware appliance used for transferring bulk data back to AWS. Its main software interface is S3 object storage.

    +

    To use rclone with AWS Snowball Edge devices, configure as standard for an 'S3 Compatible Service'.

    +

    If using rclone pre v1.59 be sure to set upload_cutoff = 0 otherwise you will run into authentication header issues as the snowball device does not support query parameter based authentication.

    +

    With rclone v1.59 or later setting upload_cutoff should not be necessary.

    +

    eg.

    +
    [snowball]
    +type = s3
    +provider = Other
    +access_key_id = YOUR_ACCESS_KEY
    +secret_access_key = YOUR_SECRET_KEY
    +endpoint = http://[IP of Snowball]:8080
    +upload_cutoff = 0
    +

    Ceph

    +

    Ceph is an open-source, unified, distributed storage system designed for excellent performance, reliability and scalability. It has an S3 compatible object storage interface.

    +

    To use rclone with Ceph, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    +
    [ceph]
    +type = s3
    +provider = Ceph
    +env_auth = false
    +access_key_id = XXX
    +secret_access_key = YYY
    +region =
    +endpoint = https://ceph.endpoint.example.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a version of rclone before v1.59 then you may need to supply the parameter --s3-upload-cutoff 0 or put this in the config file as upload_cutoff 0 to work around a bug which causes uploading of small files to fail.

    +

    Note also that Ceph sometimes puts / in the passwords it gives users. If you read the secret access key using the command line tools you will get a JSON blob with the / escaped as \/. Make sure you only write / in the secret access key.

    +

    Eg the dump from Ceph looks something like this (irrelevant keys removed).

    +
    {
    +    "user_id": "xxx",
    +    "display_name": "xxxx",
    +    "keys": [
    +        {
    +            "user": "xxx",
    +            "access_key": "xxxxxx",
    +            "secret_key": "xxxxxx\/xxxx"
    +        }
    +    ],
    +}
    +

    Because this is a json dump, it is encoding the / as \/, so if you use the secret key as xxxxxx/xxxx it will work fine.

    +

    Cloudflare R2

    +

    Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.

    +

    Here is an example of making a Cloudflare R2 configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +

    Note that all buckets are private, and all are stored in the same "auto" region. It is necessary to use Cloudflare workers to share the content of a bucket publicly.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> r2
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +...
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +...
    +Storage> s3
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +...
    +XX / Cloudflare R2 Storage
    +   \ (Cloudflare)
    +...
    +provider> Cloudflare
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 1
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> ACCESS_KEY
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> SECRET_ACCESS_KEY
    +Option region.
    +Region to connect to.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency.
    +   \ (auto)
    +region> 1
    +Option endpoint.
    +Endpoint for S3 API.
    +Required when using an S3 clone.
    +Enter a value. Press Enter to leave empty.
    +endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> n
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave your config looking something like:

    +
    [r2]
    +type = s3
    +provider = Cloudflare
    +access_key_id = ACCESS_KEY
    +secret_access_key = SECRET_ACCESS_KEY
    +region = auto
    +endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com
    +acl = private
    +

    Now run rclone lsf r2: to see your buckets and rclone lsf r2:bucket to look within a bucket.

    +

    Dreamhost

    +

    Dreamhost DreamObjects is an object storage system based on CEPH.

    +

    To use rclone with Dreamhost, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    +
    [dreamobjects]
    +type = s3
    +provider = DreamHost
    +env_auth = false
    +access_key_id = your_access_key
    +secret_access_key = your_secret_key
    +region =
    +endpoint = objects-us-west-1.dream.io
    +location_constraint =
    +acl = private
    +server_side_encryption =
    +storage_class =
    +

    Google Cloud Storage

    +

    GoogleCloudStorage is an S3-interoperable object storage service from Google Cloud Platform.

    +

    To connect to Google Cloud Storage you will need an access key and secret key. These can be retrieved by creating an HMAC key.

    +
    [gs]
    +type = s3
    +provider = GCS
    +access_key_id = your_access_key
    +secret_access_key = your_secret_key
    +endpoint = https://storage.googleapis.com
    +

    Note that --s3-versions does not work with GCS when it needs to do directory paging. Rclone will return the error:

    +
    s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker
    +

    This is Google bug #312292516.

    +

    DigitalOcean Spaces

    +

    Spaces is an S3-interoperable object storage service from cloud provider DigitalOcean.

    +

    To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "Applications & API" page of the DigitalOcean control panel. They will be needed when prompted by rclone config for your access_key_id and secret_access_key.

    +

    When prompted for a region or location_constraint, press enter to use the default value. The region must be included in the endpoint setting (e.g. nyc3.digitaloceanspaces.com). The default values can be used for other settings.

    +

    Going through the whole process of creating a new remote by running rclone config, each prompt should be answered as shown below:

    +
    Storage> s3
    +env_auth> 1
    +access_key_id> YOUR_ACCESS_KEY
    +secret_access_key> YOUR_SECRET_KEY
    +region>
    +endpoint> nyc3.digitaloceanspaces.com
    +location_constraint>
    +acl>
    +storage_class>
    +

    The resulting configuration file should look like:

    +
    [spaces]
    +type = s3
    +provider = DigitalOcean
    +env_auth = false
    +access_key_id = YOUR_ACCESS_KEY
    +secret_access_key = YOUR_SECRET_KEY
    +region =
    +endpoint = nyc3.digitaloceanspaces.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    Once configured, you can create a new Space and begin copying files. For example:

    +
    rclone mkdir spaces:my-new-space
    +rclone copy /path/to/files spaces:my-new-space
    +

    Huawei OBS

    +

    Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere.

    +

    OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file.

    +
    [obs]
    +type = s3
    +provider = HuaweiOBS
    +access_key_id = your-access-key-id
    +secret_access_key = your-secret-access-key
    +region = af-south-1
    +endpoint = obs.af-south-1.myhuaweicloud.com
    +acl = private
    +

    Or you can also configure via the interactive command line:

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> obs
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> 5
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    + 9 / Huawei Object Storage Service
    +   \ (HuaweiOBS)
    +[snip]
    +provider> 9
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 1
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> your-access-key-id
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> your-secret-access-key
    +Option region.
    +Region to connect to.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / AF-Johannesburg
    +   \ (af-south-1)
    + 2 / AP-Bangkok
    +   \ (ap-southeast-2)
    +[snip]
    +region> 1
    +Option endpoint.
    +Endpoint for OBS API.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / AF-Johannesburg
    +   \ (obs.af-south-1.myhuaweicloud.com)
    + 2 / AP-Bangkok
    +   \ (obs.ap-southeast-2.myhuaweicloud.com)
    +[snip]
    +endpoint> 1
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +[snip]
    +acl> 1
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n>
    +--------------------
    +[obs]
    +type = s3
    +provider = HuaweiOBS
    +access_key_id = your-access-key-id
    +secret_access_key = your-secret-access-key
    +region = af-south-1
    +endpoint = obs.af-south-1.myhuaweicloud.com
    +acl = private
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +Current remotes:
    +
    +Name                 Type
    +====                 ====
    +obs                  s3
    +
    +e) Edit existing remote
    +n) New remote
    +d) Delete remote
    +r) Rename remote
    +c) Copy remote
    +s) Set configuration password
    +q) Quit config
    +e/n/d/r/c/s/q> q
    +

    IBM COS (S3)

    +

    Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage)

    +

    To configure access to IBM COS S3, follow the steps below:

    +
      +
    1. Run rclone config and select n for a new remote.
    2. +
    +
        2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults
    +    No remotes found, make a new one?
    +    n) New remote
    +    s) Set configuration password
    +    q) Quit config
    +    n/s/q> n
    +
      +
    1. Enter the name for the configuration
    2. +
    +
        name> <YOUR NAME>
    +
      +
    1. Select "s3" storage.
    2. +
    +
    Choose a number from below, or type in your own value
    +    1 / Alias for an existing remote
    +    \ "alias"
    +    2 / Amazon Drive
    +    \ "amazon cloud drive"
    +    3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS)
    +    \ "s3"
    +    4 / Backblaze B2
    +    \ "b2"
    +[snip]
    +    23 / HTTP
    +    \ "http"
    +Storage> 3
    +
      +
    1. Select IBM COS as the S3 Storage Provider.
    2. +
    +
    Choose the S3 provider.
    +Choose a number from below, or type in your own value
    +     1 / Choose this option to configure Storage to AWS S3
    +       \ "AWS"
    +     2 / Choose this option to configure Storage to Ceph Systems
    +     \ "Ceph"
    +     3 /  Choose this option to configure Storage to Dreamhost
    +     \ "Dreamhost"
    +   4 / Choose this option to the configure Storage to IBM COS S3
    +     \ "IBMCOS"
    +     5 / Choose this option to the configure Storage to Minio
    +     \ "Minio"
    +     Provider>4
    +
      +
    1. Enter the Access Key and Secret.
    2. +
    +
        AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    +    access_key_id> <>
    +    AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    +    secret_access_key> <>
    +
      +
    1. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address.
    2. +
    +
        Endpoint for IBM COS S3 API.
    +    Specify if using an IBM COS On Premise.
    +    Choose a number from below, or type in your own value
    +     1 / US Cross Region Endpoint
    +       \ "s3-api.us-geo.objectstorage.softlayer.net"
    +     2 / US Cross Region Dallas Endpoint
    +       \ "s3-api.dal.us-geo.objectstorage.softlayer.net"
    +     3 / US Cross Region Washington DC Endpoint
    +       \ "s3-api.wdc-us-geo.objectstorage.softlayer.net"
    +     4 / US Cross Region San Jose Endpoint
    +       \ "s3-api.sjc-us-geo.objectstorage.softlayer.net"
    +     5 / US Cross Region Private Endpoint
    +       \ "s3-api.us-geo.objectstorage.service.networklayer.com"
    +     6 / US Cross Region Dallas Private Endpoint
    +       \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com"
    +     7 / US Cross Region Washington DC Private Endpoint
    +       \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com"
    +     8 / US Cross Region San Jose Private Endpoint
    +       \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com"
    +     9 / US Region East Endpoint
    +       \ "s3.us-east.objectstorage.softlayer.net"
    +    10 / US Region East Private Endpoint
    +       \ "s3.us-east.objectstorage.service.networklayer.com"
    +    11 / US Region South Endpoint
    +[snip]
    +    34 / Toronto Single Site Private Endpoint
    +       \ "s3.tor01.objectstorage.service.networklayer.com"
    +    endpoint>1
    +
      +
    1. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter
    2. +
    +
         1 / US Cross Region Standard
    +       \ "us-standard"
    +     2 / US Cross Region Vault
    +       \ "us-vault"
    +     3 / US Cross Region Cold
    +       \ "us-cold"
    +     4 / US Cross Region Flex
    +       \ "us-flex"
    +     5 / US East Region Standard
    +       \ "us-east-standard"
    +     6 / US East Region Vault
    +       \ "us-east-vault"
    +     7 / US East Region Cold
    +       \ "us-east-cold"
    +     8 / US East Region Flex
    +       \ "us-east-flex"
    +     9 / US South Region Standard
    +       \ "us-south-standard"
    +    10 / US South Region Vault
    +       \ "us-south-vault"
    +[snip]
    +    32 / Toronto Flex
    +       \ "tor01-flex"
    +location_constraint>1
    +
      +
    1. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs.
    2. +
    +
    Canned ACL used when creating buckets and/or storing objects in S3.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Choose a number from below, or type in your own value
    +      1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS
    +      \ "private"
    +      2  / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS
    +      \ "public-read"
    +      3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS
    +      \ "public-read-write"
    +      4  / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS
    +      \ "authenticated-read"
    +acl> 1
    +
      +
    1. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this
    2. +
    +
        [xxx]
    +    type = s3
    +    Provider = IBMCOS
    +    access_key_id = xxx
    +    secret_access_key = yyy
    +    endpoint = s3-api.us-geo.objectstorage.softlayer.net
    +    location_constraint = us-standard
    +    acl = private
    +
      +
    1. Execute rclone commands
    2. +
    +
        1)  Create a bucket.
    +        rclone mkdir IBM-COS-XREGION:newbucket
    +    2)  List available buckets.
    +        rclone lsd IBM-COS-XREGION:
    +        -1 2017-11-08 21:16:22        -1 test
    +        -1 2018-02-14 20:16:39        -1 newbucket
    +    3)  List contents of a bucket.
    +        rclone ls IBM-COS-XREGION:newbucket
    +        18685952 test.exe
    +    4)  Copy a file from local to remote.
    +        rclone copy /Users/file.txt IBM-COS-XREGION:newbucket
    +    5)  Copy a file from remote to local.
    +        rclone copy IBM-COS-XREGION:newbucket/file.txt .
    +    6)  Delete a file on remote.
    +        rclone delete IBM-COS-XREGION:newbucket/file.txt
    +

    IDrive e2

    +

    Here is an example of making an IDrive e2 configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
    +Enter name for new remote.
    +name> e2
    +
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / IDrive e2
    +   \ (IDrive)
    +[snip]
    +provider> IDrive
    +
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 
    +
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> YOUR_ACCESS_KEY
    +
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> YOUR_SECRET_KEY
    +
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +   / Owner gets FULL_CONTROL.
    + 3 | The AllUsers group gets READ and WRITE access.
    +   | Granting this on a bucket is generally not recommended.
    +   \ (public-read-write)
    +   / Owner gets FULL_CONTROL.
    + 4 | The AuthenticatedUsers group gets READ access.
    +   \ (authenticated-read)
    +   / Object owner gets FULL_CONTROL.
    + 5 | Bucket owner gets READ access.
    +   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    +   \ (bucket-owner-read)
    +   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
    + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    +   \ (bucket-owner-full-control)
    +acl> 
    +
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> 
    +
    +Configuration complete.
    +Options:
    +- type: s3
    +- provider: IDrive
    +- access_key_id: YOUR_ACCESS_KEY
    +- secret_access_key: YOUR_SECRET_KEY
    +- endpoint: q9d9.la12.idrivee2-5.com
    +Keep this "e2" remote?
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    IONOS Cloud

    +

    IONOS S3 Object Storage is a service offered by IONOS for storing and accessing unstructured data. To connect to the service, you will need an access key and a secret key. These can be found in the Data Center Designer, by selecting Manager resources > Object Storage Key Manager.

    +

    Here is an example of a configuration. First, run rclone config. This will walk you through an interactive setup process. Type n to add the new remote, and then enter a name:

    +
    Enter name for new remote.
    +name> ionos-fra
    +

    Type s3 to choose the connection type:

    +
    Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +

    Type IONOS:

    +
    Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / IONOS Cloud
    +   \ (IONOS)
    +[snip]
    +provider> IONOS
    +

    Press Enter to choose the default option Enter AWS credentials in the next step:

    +
    Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth>
    +

    Enter your Access Key and Secret key. These can be retrieved in the Data Center Designer, click on the menu “Manager resources” / "Object Storage Key Manager".

    +
    Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> YOUR_ACCESS_KEY
    +
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> YOUR_SECRET_KEY
    +

    Choose the region where your bucket is located:

    +
    Option region.
    +Region where your bucket will be created and your data stored.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Frankfurt, Germany
    +   \ (de)
    + 2 / Berlin, Germany
    +   \ (eu-central-2)
    + 3 / Logrono, Spain
    +   \ (eu-south-2)
    +region> 2
    +

    Choose the endpoint from the same region:

    +
    Option endpoint.
    +Endpoint for IONOS S3 Object Storage.
    +Specify the endpoint from the same region.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Frankfurt, Germany
    +   \ (s3-eu-central-1.ionoscloud.com)
    + 2 / Berlin, Germany
    +   \ (s3-eu-central-2.ionoscloud.com)
    + 3 / Logrono, Spain
    +   \ (s3-eu-south-2.ionoscloud.com)
    +endpoint> 1
    +

    Press Enter to choose the default option or choose the desired ACL setting:

    +
    Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    +[snip]
    +acl>
    +

    Press Enter to skip the advanced config:

    +
    Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n>
    +

    Press Enter to save the configuration, and then q to quit the configuration process:

    +
    Configuration complete.
    +Options:
    +- type: s3
    +- provider: IONOS
    +- access_key_id: YOUR_ACCESS_KEY
    +- secret_access_key: YOUR_SECRET_KEY
    +- endpoint: s3-eu-central-1.ionoscloud.com
    +Keep this "ionos-fra" remote?
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    Done! Now you can try some commands (for macOS, use ./rclone instead of rclone).

    +
      +
    1. Create a bucket (the name must be unique within the whole IONOS S3)
    2. +
    +
    rclone mkdir ionos-fra:my-bucket
    +
      +
    1. List available buckets
    2. +
    +
    rclone lsd ionos-fra:
    +
      +
    1. Copy a file from local to remote
    2. +
    +
    rclone copy /Users/file.txt ionos-fra:my-bucket
    +
      +
    1. List contents of a bucket
    2. +
    +
    rclone ls ionos-fra:my-bucket
    +
      +
    1. Copy a file from remote to local
    2. +
    +
    rclone copy ionos-fra:my-bucket/file.txt
    +

    Minio

    +

    Minio is an object storage server built for cloud application developers and devops.

    +

    It is very easy to install and provides an S3 compatible server which can be used by rclone.

    +

    To use it, install Minio following the instructions here.

    +

    When it configures itself Minio will print something like this

    +
    Endpoint:  http://192.168.1.106:9000  http://172.23.0.1:9000
    +AccessKey: USWUXHGYZQYFYFFIT3RE
    +SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +Region:    us-east-1
    +SQS ARNs:  arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis
    +
    +Browser Access:
    +   http://192.168.1.106:9000  http://172.23.0.1:9000
    +
    +Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
    +   $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +
    +Object API (Amazon S3 compatible):
    +   Go:         https://docs.minio.io/docs/golang-client-quickstart-guide
    +   Java:       https://docs.minio.io/docs/java-client-quickstart-guide
    +   Python:     https://docs.minio.io/docs/python-client-quickstart-guide
    +   JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
    +   .NET:       https://docs.minio.io/docs/dotnet-client-quickstart-guide
    +
    +Drive Capacity: 26 GiB Free, 165 GiB Total
    +

    These details need to go into rclone config like this. Note that it is important to put the region in as stated above.

    +
    env_auth> 1
    +access_key_id> USWUXHGYZQYFYFFIT3RE
    +secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +region> us-east-1
    +endpoint> http://192.168.1.106:9000
    +location_constraint>
    +server_side_encryption>
    +

    Which makes the config file look like this

    +
    [minio]
    +type = s3
    +provider = Minio
    +env_auth = false
    +access_key_id = USWUXHGYZQYFYFFIT3RE
    +secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +region = us-east-1
    +endpoint = http://192.168.1.106:9000
    +location_constraint =
    +server_side_encryption =
    +

    So once set up, for example, to copy files into a bucket

    +
    rclone copy /path/to/files minio:bucket
    +

    Qiniu Cloud Object Storage (Kodo)

    +

    Qiniu Cloud Object Storage (Kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management.

    +

    To configure access to Qiniu Kodo, follow the steps below:

    +
      +
    1. Run rclone config and select n for a new remote.
    2. +
    +
    rclone config
    +No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
      +
    1. Give the name of the configuration. For example, name it 'qiniu'.
    2. +
    +
    name> qiniu
    +
      +
    1. Select s3 storage.
    2. +
    +
    Choose a number from below, or type in your own value
    + 1 / 1Fichier
    +   \ (fichier)
    + 2 / Akamai NetStorage
    +   \ (netstorage)
    + 3 / Alias for an existing remote
    +   \ (alias)
    + 4 / Amazon Drive
    +   \ (amazon cloud drive)
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +
      +
    1. Select Qiniu provider.
    2. +
    +
    Choose a number from below, or type in your own value
    +1 / Amazon Web Services (AWS) S3
    +   \ "AWS"
    +[snip]
    +22 / Qiniu Object Storage (Kodo)
    +   \ (Qiniu)
    +[snip]
    +provider> Qiniu
    +
      +
    1. Enter your SecretId and SecretKey of Qiniu Kodo.
    2. +
    +
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +Choose a number from below, or type in your own value
    + 1 / Enter AWS credentials in the next step
    +   \ "false"
    + 2 / Get AWS credentials from the environment (env vars or IAM)
    +   \ "true"
    +env_auth> 1
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +access_key_id> AKIDxxxxxxxxxx
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +secret_access_key> xxxxxxxxxxx
    +
      +
    1. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region.
    2. +
    +
       / The default endpoint - a good choice if you are unsure.
    + 1 | East China Region 1.
    +   | Needs location constraint cn-east-1.
    +   \ (cn-east-1)
    +   / East China Region 2.
    + 2 | Needs location constraint cn-east-2.
    +   \ (cn-east-2)
    +   / North China Region 1.
    + 3 | Needs location constraint cn-north-1.
    +   \ (cn-north-1)
    +   / South China Region 1.
    + 4 | Needs location constraint cn-south-1.
    +   \ (cn-south-1)
    +   / North America Region.
    + 5 | Needs location constraint us-north-1.
    +   \ (us-north-1)
    +   / Southeast Asia Region 1.
    + 6 | Needs location constraint ap-southeast-1.
    +   \ (ap-southeast-1)
    +   / Northeast Asia Region 1.
    + 7 | Needs location constraint ap-northeast-1.
    +   \ (ap-northeast-1)
    +[snip]
    +endpoint> 1
    +
    +Option endpoint.
    +Endpoint for Qiniu Object Storage.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / East China Endpoint 1
    +   \ (s3-cn-east-1.qiniucs.com)
    + 2 / East China Endpoint 2
    +   \ (s3-cn-east-2.qiniucs.com)
    + 3 / North China Endpoint 1
    +   \ (s3-cn-north-1.qiniucs.com)
    + 4 / South China Endpoint 1
    +   \ (s3-cn-south-1.qiniucs.com)
    + 5 / North America Endpoint 1
    +   \ (s3-us-north-1.qiniucs.com)
    + 6 / Southeast Asia Endpoint 1
    +   \ (s3-ap-southeast-1.qiniucs.com)
    + 7 / Northeast Asia Endpoint 1
    +   \ (s3-ap-northeast-1.qiniucs.com)
    +endpoint> 1
    +
    +Option location_constraint.
    +Location constraint - must be set to match the Region.
    +Used when creating buckets only.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / East China Region 1
    +   \ (cn-east-1)
    + 2 / East China Region 2
    +   \ (cn-east-2)
    + 3 / North China Region 1
    +   \ (cn-north-1)
    + 4 / South China Region 1
    +   \ (cn-south-1)
    + 5 / North America Region 1
    +   \ (us-north-1)
    + 6 / Southeast Asia Region 1
    +   \ (ap-southeast-1)
    + 7 / Northeast Asia Region 1
    +   \ (ap-northeast-1)
    +location_constraint> 1
    +
      +
    1. Choose acl and storage class.
    2. +
    +
    Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +[snip]
    +acl> 2
    +The storage class to use when storing new objects in Tencent COS.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Standard storage class
    +   \ (STANDARD)
    + 2 / Infrequent access storage mode
    +   \ (LINE)
    + 3 / Archive storage mode
    +   \ (GLACIER)
    + 4 / Deep archive storage mode
    +   \ (DEEP_ARCHIVE)
    +[snip]
    +storage_class> 1
    +Edit advanced config? (y/n)
    +y) Yes
    +n) No (default)
    +y/n> n
    +Remote config
    +--------------------
    +[qiniu]
    +- type: s3
    +- provider: Qiniu
    +- access_key_id: xxx
    +- secret_access_key: xxx
    +- region: cn-east-1
    +- endpoint: s3-cn-east-1.qiniucs.com
    +- location_constraint: cn-east-1
    +- acl: public-read
    +- storage_class: STANDARD
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +Current remotes:
    +
    +Name                 Type
    +====                 ====
    +qiniu                s3
    +

    RackCorp

    +

    RackCorp Object Storage is an S3 compatible object storage platform from your friendly cloud provider RackCorp. The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty.

    +

    Before you can use RackCorp Object Storage, you'll need to "sign up" for an account on our "portal". Next you can create an access key, a secret key and buckets, in your location of choice with ease. These details are required for the next steps of configuration, when rclone config asks for your access_key_id and secret_access_key.

    +

    Your config should end up looking a bit like this:

    +
    [RCS3-demo-config]
    +type = s3
    +provider = RackCorp
    +env_auth = true
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region = au-nsw
    +endpoint = s3.rackcorp.com
    +location_constraint = au-nsw
    +

    Rclone Serve S3

    +

    Rclone can serve any remote over the S3 protocol. For details see the rclone serve s3 documentation.

    +

    For example, to serve remote:path over s3, run the server like this:

    +
    rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path
    +

    This will be compatible with an rclone remote which is defined like this:

    +
    [serves3]
    +type = s3
    +provider = Rclone
    +endpoint = http://127.0.0.1:8080/
    +access_key_id = ACCESS_KEY_ID
    +secret_access_key = SECRET_ACCESS_KEY
    +use_multipart_uploads = false
    +

    Note that setting disable_multipart_uploads = true is to work around a bug which will be fixed in due course.

    +

    Scaleway

    +

    Scaleway The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool.

    +

    Scaleway provides an S3 interface which can be configured for use with rclone like this:

    +
    [scaleway]
    +type = s3
    +provider = Scaleway
    +env_auth = false
    +endpoint = s3.nl-ams.scw.cloud
    +access_key_id = SCWXXXXXXXXXXXXXX
    +secret_access_key = 1111111-2222-3333-44444-55555555555555
    +region = nl-ams
    +location_constraint =
    +acl = private
    +server_side_encryption =
    +storage_class =
    +

    C14 Cold Storage is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" storage_class. So you can configure your remote with the storage_class = GLACIER option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above)

    +

    Seagate Lyve Cloud

    +

    Seagate Lyve Cloud is an S3 compatible object storage platform from Seagate intended for enterprise use.

    +

    Here is a config run through for a remote called remote - you may choose a different name of course. Note that to create an access key and secret key you will need to create a service account first.

    +
    $ rclone config
    +No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> remote
    +

    Choose s3 backend

    +
    Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    +   \ (s3)
    +[snip]
    +Storage> s3
    +

    Choose LyveCloud as S3 provider

    +
    Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / Seagate Lyve Cloud
    +   \ (LyveCloud)
    +[snip]
    +provider> LyveCloud
    +

    Take the default (just press enter) to enter access key and secret in the config file.

    +
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth>
    +
    AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> XXX
    +
    AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> YYY
    +

    Leave region blank

    +
    Region to connect to.
    +Leave blank if you are using an S3 clone and you don't have a region.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Use this if unsure.
    + 1 | Will use v4 signatures and an empty region.
    +   \ ()
    +   / Use this only if v4 signatures don't work.
    + 2 | E.g. pre Jewel/v10 CEPH.
    +   \ (other-v2-signature)
    +region>
    +

    Choose an endpoint from the list

    +
    Endpoint for S3 API.
    +Required when using an S3 clone.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Seagate Lyve Cloud US East 1 (Virginia)
    +   \ (s3.us-east-1.lyvecloud.seagate.com)
    + 2 / Seagate Lyve Cloud US West 1 (California)
    +   \ (s3.us-west-1.lyvecloud.seagate.com)
    + 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore)
    +   \ (s3.ap-southeast-1.lyvecloud.seagate.com)
    +endpoint> 1
    +

    Leave location constraint blank

    +
    Location constraint - must be set to match the Region.
    +Leave blank if not sure. Used when creating buckets only.
    +Enter a value. Press Enter to leave empty.
    +location_constraint>
    +

    Choose default ACL (private).

    +
    Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +[snip]
    +acl>
    +

    And the config file should end up looking like this:

    +
    [remote]
    +type = s3
    +provider = LyveCloud
    +access_key_id = XXX
    +secret_access_key = YYY
    +endpoint = s3.us-east-1.lyvecloud.seagate.com
    +

    SeaweedFS

    +

    SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. It has an S3 compatible object storage interface. SeaweedFS can also act as a gateway to remote S3 compatible object store to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost.

    +

    Assuming the SeaweedFS are configured with weed shell as such:

    +
    > s3.bucket.create -name foo
    +> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply
    +{
    +  "identities": [
    +    {
    +      "name": "me",
    +      "credentials": [
    +        {
    +          "accessKey": "any",
    +          "secretKey": "any"
    +        }
    +      ],
    +      "actions": [
    +        "Read:foo",
    +        "Write:foo",
    +        "List:foo",
    +        "Tagging:foo",
    +        "Admin:foo"
    +      ]
    +    }
    +  ]
    +}
    +

    To use rclone with SeaweedFS, above configuration should end up with something like this in your config:

    +
    [seaweedfs_s3]
    +type = s3
    +provider = SeaweedFS
    +access_key_id = any
    +secret_access_key = any
    +endpoint = localhost:8333
    +

    So once set up, for example to copy files into a bucket

    +
    rclone copy /path/to/files seaweedfs_s3:foo
    +

    Wasabi

    +

    Wasabi is a cloud-based object storage service for a broad range of applications and use cases. Wasabi is designed for individuals and organizations that require a high-performance, reliable, and secure data storage infrastructure at minimal cost.

    +

    Wasabi provides an S3 interface which can be configured for use with rclone like this.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +n/s> n
    +name> wasabi
    +Type of storage to configure.
    +Choose a number from below, or type in your own value
    +[snip]
    +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara)
    +   \ "s3"
    +[snip]
    +Storage> s3
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own value
    + 1 / Enter AWS credentials in the next step
    +   \ "false"
    + 2 / Get AWS credentials from the environment (env vars or IAM)
    +   \ "true"
    +env_auth> 1
    +AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    +access_key_id> YOURACCESSKEY
    +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    +secret_access_key> YOURSECRETACCESSKEY
    +Region to connect to.
    +Choose a number from below, or type in your own value
    +   / The default endpoint - a good choice if you are unsure.
    + 1 | US Region, Northern Virginia, or Pacific Northwest.
    +   | Leave location constraint empty.
    +   \ "us-east-1"
    +[snip]
    +region> us-east-1
    +Endpoint for S3 API.
    +Leave blank if using AWS to use the default endpoint for the region.
    +Specify if using an S3 clone such as Ceph.
    +endpoint> s3.wasabisys.com
    +Location constraint - must be set to match the Region. Used when creating buckets only.
    +Choose a number from below, or type in your own value
    + 1 / Empty for US Region, Northern Virginia, or Pacific Northwest.
    +   \ ""
    +[snip]
    +location_constraint>
    +Canned ACL used when creating buckets and/or storing objects in S3.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Choose a number from below, or type in your own value
    + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    +   \ "private"
    +[snip]
    +acl>
    +The server-side encryption algorithm used when storing this object in S3.
    +Choose a number from below, or type in your own value
    + 1 / None
    +   \ ""
    + 2 / AES256
    +   \ "AES256"
    +server_side_encryption>
    +The storage class to use when storing objects in S3.
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    + 2 / Standard storage class
    +   \ "STANDARD"
    + 3 / Reduced redundancy storage class
    +   \ "REDUCED_REDUNDANCY"
    + 4 / Standard Infrequent Access storage class
    +   \ "STANDARD_IA"
    +storage_class>
    +Remote config
    +--------------------
    +[wasabi]
    +env_auth = false
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region = us-east-1
    +endpoint = s3.wasabisys.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +--------------------
    +y) Yes this is OK
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave the config file looking like this.

    +
    [wasabi]
    +type = s3
    +provider = Wasabi
    +env_auth = false
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region =
    +endpoint = s3.wasabisys.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    Alibaba OSS

    +

    Here is an example of making an Alibaba Cloud (Aliyun) OSS configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> oss
    +Type of storage to configure.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    +[snip]
    + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    +   \ "s3"
    +[snip]
    +Storage> s3
    +Choose your S3 provider.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Amazon Web Services (AWS) S3
    +   \ "AWS"
    + 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
    +   \ "Alibaba"
    + 3 / Ceph Object Storage
    +   \ "Ceph"
    +[snip]
    +provider> Alibaba
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +Choose a number from below, or type in your own value
    + 1 / Enter AWS credentials in the next step
    +   \ "false"
    + 2 / Get AWS credentials from the environment (env vars or IAM)
    +   \ "true"
    +env_auth> 1
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +access_key_id> accesskeyid
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +secret_access_key> secretaccesskey
    +Endpoint for OSS API.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / East China 1 (Hangzhou)
    +   \ "oss-cn-hangzhou.aliyuncs.com"
    + 2 / East China 2 (Shanghai)
    +   \ "oss-cn-shanghai.aliyuncs.com"
    + 3 / North China 1 (Qingdao)
    +   \ "oss-cn-qingdao.aliyuncs.com"
    +[snip]
    +endpoint> 1
    +Canned ACL used when creating buckets and storing or copying objects.
    +
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    +   \ "private"
    + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access.
    +   \ "public-read"
    +   / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access.
    +[snip]
    +acl> 1
    +The storage class to use when storing new objects in OSS.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    + 2 / Standard storage class
    +   \ "STANDARD"
    + 3 / Archive storage mode.
    +   \ "GLACIER"
    + 4 / Infrequent access storage mode.
    +   \ "STANDARD_IA"
    +storage_class> 1
    +Edit advanced config? (y/n)
    +y) Yes
    +n) No
    +y/n> n
    +Remote config
    +--------------------
    +[oss]
    +type = s3
    +provider = Alibaba
    +env_auth = false
    +access_key_id = accesskeyid
    +secret_access_key = secretaccesskey
    +endpoint = oss-cn-hangzhou.aliyuncs.com
    +acl = private
    +storage_class = Standard
    +--------------------
    +y) Yes this is OK
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    China Mobile Ecloud Elastic Object Storage (EOS)

    +

    Here is an example of making an China Mobile Ecloud Elastic Object Storage (EOS) configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> ChinaMobile
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    + ...
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    +   \ (s3)
    + ...
    +Storage> s3
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + ...
    + 4 / China Mobile Ecloud Elastic Object Storage (EOS)
    +   \ (ChinaMobile)
    + ...
    +provider> ChinaMobile
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Choose a number from below, or type in your own boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth>
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> accesskeyid
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> secretaccesskey
    +Option endpoint.
    +Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / The default endpoint - a good choice if you are unsure.
    + 1 | East China (Suzhou)
    +   \ (eos-wuxi-1.cmecloud.cn)
    + 2 / East China (Jinan)
    +   \ (eos-jinan-1.cmecloud.cn)
    + 3 / East China (Hangzhou)
    +   \ (eos-ningbo-1.cmecloud.cn)
    + 4 / East China (Shanghai-1)
    +   \ (eos-shanghai-1.cmecloud.cn)
    + 5 / Central China (Zhengzhou)
    +   \ (eos-zhengzhou-1.cmecloud.cn)
    + 6 / Central China (Changsha-1)
    +   \ (eos-hunan-1.cmecloud.cn)
    + 7 / Central China (Changsha-2)
    +   \ (eos-zhuzhou-1.cmecloud.cn)
    + 8 / South China (Guangzhou-2)
    +   \ (eos-guangzhou-1.cmecloud.cn)
    + 9 / South China (Guangzhou-3)
    +   \ (eos-dongguan-1.cmecloud.cn)
    +10 / North China (Beijing-1)
    +   \ (eos-beijing-1.cmecloud.cn)
    +11 / North China (Beijing-2)
    +   \ (eos-beijing-2.cmecloud.cn)
    +12 / North China (Beijing-3)
    +   \ (eos-beijing-4.cmecloud.cn)
    +13 / North China (Huhehaote)
    +   \ (eos-huhehaote-1.cmecloud.cn)
    +14 / Southwest China (Chengdu)
    +   \ (eos-chengdu-1.cmecloud.cn)
    +15 / Southwest China (Chongqing)
    +   \ (eos-chongqing-1.cmecloud.cn)
    +16 / Southwest China (Guiyang)
    +   \ (eos-guiyang-1.cmecloud.cn)
    +17 / Nouthwest China (Xian)
    +   \ (eos-xian-1.cmecloud.cn)
    +18 / Yunnan China (Kunming)
    +   \ (eos-yunnan.cmecloud.cn)
    +19 / Yunnan China (Kunming-2)
    +   \ (eos-yunnan-2.cmecloud.cn)
    +20 / Tianjin China (Tianjin)
    +   \ (eos-tianjin-1.cmecloud.cn)
    +21 / Jilin China (Changchun)
    +   \ (eos-jilin-1.cmecloud.cn)
    +22 / Hubei China (Xiangyan)
    +   \ (eos-hubei-1.cmecloud.cn)
    +23 / Jiangxi China (Nanchang)
    +   \ (eos-jiangxi-1.cmecloud.cn)
    +24 / Gansu China (Lanzhou)
    +   \ (eos-gansu-1.cmecloud.cn)
    +25 / Shanxi China (Taiyuan)
    +   \ (eos-shanxi-1.cmecloud.cn)
    +26 / Liaoning China (Shenyang)
    +   \ (eos-liaoning-1.cmecloud.cn)
    +27 / Hebei China (Shijiazhuang)
    +   \ (eos-hebei-1.cmecloud.cn)
    +28 / Fujian China (Xiamen)
    +   \ (eos-fujian-1.cmecloud.cn)
    +29 / Guangxi China (Nanning)
    +   \ (eos-guangxi-1.cmecloud.cn)
    +30 / Anhui China (Huainan)
    +   \ (eos-anhui-1.cmecloud.cn)
    +endpoint> 1
    +Option location_constraint.
    +Location constraint - must match endpoint.
    +Used when creating buckets only.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / East China (Suzhou)
    +   \ (wuxi1)
    + 2 / East China (Jinan)
    +   \ (jinan1)
    + 3 / East China (Hangzhou)
    +   \ (ningbo1)
    + 4 / East China (Shanghai-1)
    +   \ (shanghai1)
    + 5 / Central China (Zhengzhou)
    +   \ (zhengzhou1)
    + 6 / Central China (Changsha-1)
    +   \ (hunan1)
    + 7 / Central China (Changsha-2)
    +   \ (zhuzhou1)
    + 8 / South China (Guangzhou-2)
    +   \ (guangzhou1)
    + 9 / South China (Guangzhou-3)
    +   \ (dongguan1)
    +10 / North China (Beijing-1)
    +   \ (beijing1)
    +11 / North China (Beijing-2)
    +   \ (beijing2)
    +12 / North China (Beijing-3)
    +   \ (beijing4)
    +13 / North China (Huhehaote)
    +   \ (huhehaote1)
    +14 / Southwest China (Chengdu)
    +   \ (chengdu1)
    +15 / Southwest China (Chongqing)
    +   \ (chongqing1)
    +16 / Southwest China (Guiyang)
    +   \ (guiyang1)
    +17 / Nouthwest China (Xian)
    +   \ (xian1)
    +18 / Yunnan China (Kunming)
    +   \ (yunnan)
    +19 / Yunnan China (Kunming-2)
    +   \ (yunnan2)
    +20 / Tianjin China (Tianjin)
    +   \ (tianjin1)
    +21 / Jilin China (Changchun)
    +   \ (jilin1)
    +22 / Hubei China (Xiangyan)
    +   \ (hubei1)
    +23 / Jiangxi China (Nanchang)
    +   \ (jiangxi1)
    +24 / Gansu China (Lanzhou)
    +   \ (gansu1)
    +25 / Shanxi China (Taiyuan)
    +   \ (shanxi1)
    +26 / Liaoning China (Shenyang)
    +   \ (liaoning1)
    +27 / Hebei China (Shijiazhuang)
    +   \ (hebei1)
    +28 / Fujian China (Xiamen)
    +   \ (fujian1)
    +29 / Guangxi China (Nanning)
    +   \ (guangxi1)
    +30 / Anhui China (Huainan)
    +   \ (anhui1)
    +location_constraint> 1
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +   / Owner gets FULL_CONTROL.
    + 3 | The AllUsers group gets READ and WRITE access.
    +   | Granting this on a bucket is generally not recommended.
    +   \ (public-read-write)
    +   / Owner gets FULL_CONTROL.
    + 4 | The AuthenticatedUsers group gets READ access.
    +   \ (authenticated-read)
    +   / Object owner gets FULL_CONTROL.
    +acl> private
    +Option server_side_encryption.
    +The server-side encryption algorithm used when storing this object in S3.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / None
    +   \ ()
    + 2 / AES256
    +   \ (AES256)
    +server_side_encryption>
    +Option storage_class.
    +The storage class to use when storing new objects in ChinaMobile.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Default
    +   \ ()
    + 2 / Standard storage class
    +   \ (STANDARD)
    + 3 / Archive storage mode
    +   \ (GLACIER)
    + 4 / Infrequent access storage mode
    +   \ (STANDARD_IA)
    +storage_class>
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> n
    +--------------------
    +[ChinaMobile]
    +type = s3
    +provider = ChinaMobile
    +access_key_id = accesskeyid
    +secret_access_key = secretaccesskey
    +endpoint = eos-wuxi-1.cmecloud.cn
    +location_constraint = wuxi1
    +acl = private
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    Leviia Cloud Object Storage

    +

    Leviia Object Storage, backup and secure your data in a 100% French cloud, independent of GAFAM..

    +

    To configure access to Leviia, follow the steps below:

      -
    1. Install-Module -Name Microsoft.Online.SharePoint.PowerShell (in case you haven't installed this already)
    2. -
    3. Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
    4. -
    5. Connect-SPOService -Url https://YOURSITE-admin.sharepoint.com -Credential YOU@YOURSITE.COM (replacing YOURSITE, YOU, YOURSITE.COM with the actual values; this will prompt for your credentials)
    6. -
    7. Set-SPOTenant -EnableMinimumVersionRequirement $False
    8. -
    9. Disconnect-SPOService (to disconnect from the server)
    10. +
    11. Run rclone config and select n for a new remote.
    -

    Below are the steps for normal users to disable versioning. If you don't see the "No Versioning" option, make sure the above requirements are met.

    -

    User Weropol has found a method to disable versioning on OneDrive

    -
      -
    1. Open the settings menu by clicking on the gear symbol at the top of the OneDrive Business page.
    2. -
    3. Click Site settings.
    4. -
    5. Once on the Site settings page, navigate to Site Administration > Site libraries and lists.
    6. -
    7. Click Customize "Documents".
    8. -
    9. Click General Settings > Versioning Settings.
    10. -
    11. Under Document Version History select the option No versioning. Note: This will disable the creation of new file versions, but will not remove any previous versions. Your documents are safe.
    12. -
    13. Apply the changes by clicking OK.
    14. -
    15. Use rclone to upload or modify files. (I also use the --no-update-modtime flag)
    16. -
    17. Restore the versioning settings after using rclone. (Optional)
    18. +
      rclone config
      +No remotes found, make a new one?
      +n) New remote
      +s) Set configuration password
      +q) Quit config
      +n/s/q> n
      +
        +
      1. Give the name of the configuration. For example, name it 'leviia'.
      -

      Cleanup

      -

      OneDrive supports rclone cleanup which causes rclone to look through every file under the path supplied and delete all version but the current version. Because this involves traversing all the files, then querying each file for versions it can be quite slow. Rclone does --checkers tests in parallel. The command also supports --interactive/i or --dry-run which is a great way to see what it would do.

      -
      rclone cleanup --interactive remote:path/subdir # interactively remove all old version for path/subdir
      -rclone cleanup remote:path/subdir               # unconditionally remove all old version for path/subdir
      -

      NB Onedrive personal can't currently delete versions

      -

      Troubleshooting

      -

      Excessive throttling or blocked on SharePoint

      -

      If you experience excessive throttling or is being blocked on SharePoint then it may help to set the user agent explicitly with a flag like this: --user-agent "ISV|rclone.org|rclone/v1.55.1"

      -

      The specific details can be found in the Microsoft document: Avoid getting throttled or blocked in SharePoint Online

      -

      Unexpected file size/hash differences on Sharepoint

      -

      It is a known issue that Sharepoint (not OneDrive or OneDrive for Business) silently modifies uploaded files, mainly Office files (.docx, .xlsx, etc.), causing file size and hash checks to fail. There are also other situations that will cause OneDrive to report inconsistent file sizes. To use rclone with such affected files on Sharepoint, you may disable these checks with the following command line arguments:

      -
      --ignore-checksum --ignore-size
      -

      Alternatively, if you have write access to the OneDrive files, it may be possible to fix this problem for certain files, by attempting the steps below. Open the web interface for OneDrive and find the affected files (which will be in the error messages/log for rclone). Simply click on each of these files, causing OneDrive to open them on the web. This will cause each file to be converted in place to a format that is functionally equivalent but which will no longer trigger the size discrepancy. Once all problematic files are converted you will no longer need the ignore options above.

      -

      Replacing/deleting existing files on Sharepoint gets "item not found"

      -

      It is a known issue that Sharepoint (not OneDrive or OneDrive for Business) may return "item not found" errors when users try to replace or delete uploaded files; this seems to mainly affect Office files (.docx, .xlsx, etc.) and web files (.html, .aspx, etc.). As a workaround, you may use the --backup-dir <BACKUP_DIR> command line argument so rclone moves the files to be replaced/deleted into a given backup directory (instead of directly replacing/deleting them). For example, to instruct rclone to move the files into the directory rclone-backup-dir on backend mysharepoint, you may use:

      -
      --backup-dir mysharepoint:rclone-backup-dir
      -

      access_denied (AADSTS65005)

      -
      Error: access_denied
      -Code: AADSTS65005
      -Description: Using application 'rclone' is currently not supported for your organization [YOUR_ORGANIZATION] because it is in an unmanaged state. An administrator needs to claim ownership of the company by DNS validation of [YOUR_ORGANIZATION] before the application rclone can be provisioned.
      -

      This means that rclone can't use the OneDrive for Business API with your account. You can't do much about it, maybe write an email to your admins.

      -

      However, there are other ways to interact with your OneDrive account. Have a look at the WebDAV backend: https://rclone.org/webdav/#sharepoint

      -

      invalid_grant (AADSTS50076)

      -
      Error: invalid_grant
      -Code: AADSTS50076
      -Description: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '...'.
      -

      If you see the error above after enabling multi-factor authentication for your account, you can fix it by refreshing your OAuth refresh token. To do that, run rclone config, and choose to edit your OneDrive backend. Then, you don't need to actually make any changes until you reach this question: Already have a token - refresh?. For this question, answer y and go through the process to refresh your token, just like the first time the backend is configured. After this, rclone should work again for this backend.

      - -

      On Sharepoint and OneDrive for Business, rclone link may return an "Invalid request" error. A possible cause is that the organisation admin didn't allow public links to be made for the organisation/sharepoint library. To fix the permissions as an admin, take a look at the docs: 1, 2.

      -

      Can not access Shared with me files

      -

      Shared with me files is not supported by rclone currently, but there is a workaround:

      -
        -
      1. Visit https://onedrive.live.com
      2. -
      3. Right click a item in Shared, then click Add shortcut to My files in the context make_shortcut
      4. -
      5. The shortcut will appear in My files, you can access it with rclone, it behaves like a normal folder/file. in_my_files rclone_mount
      6. +
        name> leviia
        +
          +
        1. Select s3 storage.
        -

        Live Photos uploaded from iOS (small video clips in .heic files)

        -

        The iOS OneDrive app introduced upload and storage of Live Photos in 2020. The usage and download of these uploaded Live Photos is unfortunately still work-in-progress and this introduces several issues when copying, synchronising and mounting – both in rclone and in the native OneDrive client on Windows.

        -

        The root cause can easily be seen if you locate one of your Live Photos in the OneDrive web interface. Then download the photo from the web interface. You will then see that the size of downloaded .heic file is smaller than the size displayed in the web interface. The downloaded file is smaller because it only contains a single frame (still photo) extracted from the Live Photo (movie) stored in OneDrive.

        -

        The different sizes will cause rclone copy/sync to repeatedly recopy unmodified photos something like this:

        -
        DEBUG : 20230203_123826234_iOS.heic: Sizes differ (src 4470314 vs dst 1298667)
        -DEBUG : 20230203_123826234_iOS.heic: sha1 = fc2edde7863b7a7c93ca6771498ac797f8460750 OK
        -INFO  : 20230203_123826234_iOS.heic: Copied (replaced existing)
        -

        These recopies can be worked around by adding --ignore-size. Please note that this workaround only syncs the still-picture not the movie clip, and relies on modification dates being correctly updated on all files in all situations.

        -

        The different sizes will also cause rclone check to report size errors something like this:

        -
        ERROR : 20230203_123826234_iOS.heic: sizes differ
        -

        These check errors can be suppressed by adding --ignore-size.

        -

        The different sizes will also cause rclone mount to fail downloading with an error something like this:

        -
        ERROR : 20230203_123826234_iOS.heic: ReadFileHandle.Read error: low level retry 1/10: unexpected EOF
        -

        or like this when using --cache-mode=full:

        -
        INFO  : 20230203_123826234_iOS.heic: vfs cache: downloader: error count now 1: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable:
        -ERROR : 20230203_123826234_iOS.heic: vfs cache: failed to download: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable:
        -

        OpenDrive

        -

        Paths are specified as remote:path

        -

        Paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Configuration

        -

        Here is an example of how to make a remote called remote. First run:

        -
         rclone config
        -

        This will guide you through an interactive setup process:

        -
        n) New remote
        -d) Delete remote
        -q) Quit config
        -e/n/d/q> n
        -name> remote
        +
        Choose a number from below, or type in your own value
        + 1 / 1Fichier
        +   \ (fichier)
        + 2 / Akamai NetStorage
        +   \ (netstorage)
        + 3 / Alias for an existing remote
        +   \ (alias)
        + 4 / Amazon Drive
        +   \ (amazon cloud drive)
        + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
        +   \ (s3)
        +[snip]
        +Storage> s3
        +
          +
        1. Select Leviia provider.
        2. +
        +
        Choose a number from below, or type in your own value
        +1 / Amazon Web Services (AWS) S3
        +   \ "AWS"
        +[snip]
        +15 / Leviia Object Storage
        +   \ (Leviia)
        +[snip]
        +provider> Leviia
        +
          +
        1. Enter your SecretId and SecretKey of Leviia.
        2. +
        +
        Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
        +Only applies if access_key_id and secret_access_key is blank.
        +Enter a boolean value (true or false). Press Enter for the default ("false").
        +Choose a number from below, or type in your own value
        + 1 / Enter AWS credentials in the next step
        +   \ "false"
        + 2 / Get AWS credentials from the environment (env vars or IAM)
        +   \ "true"
        +env_auth> 1
        +AWS Access Key ID.
        +Leave blank for anonymous access or runtime credentials.
        +Enter a string value. Press Enter for the default ("").
        +access_key_id> ZnIx.xxxxxxxxxxxxxxx
        +AWS Secret Access Key (password)
        +Leave blank for anonymous access or runtime credentials.
        +Enter a string value. Press Enter for the default ("").
        +secret_access_key> xxxxxxxxxxx
        +
          +
        1. Select endpoint for Leviia.
        2. +
        +
           / The default endpoint
        + 1 | Leviia.
        +   \ (s3.leviia.com)
        +[snip]
        +endpoint> 1
        +
          +
        1. Choose acl.
        2. +
        +
        Note that this ACL is applied when server-side copying objects as S3
        +doesn't copy the ACL from the source but rather writes a fresh one.
        +Enter a string value. Press Enter for the default ("").
        +Choose a number from below, or type in your own value
        +   / Owner gets FULL_CONTROL.
        + 1 | No one else has access rights (default).
        +   \ (private)
        +   / Owner gets FULL_CONTROL.
        + 2 | The AllUsers group gets READ access.
        +   \ (public-read)
        +[snip]
        +acl> 1
        +Edit advanced config? (y/n)
        +y) Yes
        +n) No (default)
        +y/n> n
        +Remote config
        +--------------------
        +[leviia]
        +- type: s3
        +- provider: Leviia
        +- access_key_id: ZnIx.xxxxxxx
        +- secret_access_key: xxxxxxxx
        +- endpoint: s3.leviia.com
        +- acl: private
        +--------------------
        +y) Yes this is OK (default)
        +e) Edit this remote
        +d) Delete this remote
        +y/e/d> y
        +Current remotes:
        +
        +Name                 Type
        +====                 ====
        +leviia                s3
        +

        Liara

        +

        Here is an example of making a Liara Object Storage configuration. First run:

        +
        rclone config
        +

        This will guide you through an interactive setup process.

        +
        No remotes found, make a new one?
        +n) New remote
        +s) Set configuration password
        +n/s> n
        +name> Liara
         Type of storage to configure.
         Choose a number from below, or type in your own value
         [snip]
        -XX / OpenDrive
        -   \ "opendrive"
        +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
        +   \ "s3"
         [snip]
        -Storage> opendrive
        -Username
        -username>
        -Password
        -y) Yes type in my own password
        -g) Generate random password
        -y/g> y
        -Enter the password:
        -password:
        -Confirm the password:
        -password:
        +Storage> s3
        +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
        +Choose a number from below, or type in your own value
        + 1 / Enter AWS credentials in the next step
        +   \ "false"
        + 2 / Get AWS credentials from the environment (env vars or IAM)
        +   \ "true"
        +env_auth> 1
        +AWS Access Key ID - leave blank for anonymous access or runtime credentials.
        +access_key_id> YOURACCESSKEY
        +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
        +secret_access_key> YOURSECRETACCESSKEY
        +Region to connect to.
        +Choose a number from below, or type in your own value
        +   / The default endpoint
        + 1 | US Region, Northern Virginia, or Pacific Northwest.
        +   | Leave location constraint empty.
        +   \ "us-east-1"
        +[snip]
        +region>
        +Endpoint for S3 API.
        +Leave blank if using Liara to use the default endpoint for the region.
        +Specify if using an S3 clone such as Ceph.
        +endpoint> storage.iran.liara.space
        +Canned ACL used when creating buckets and/or storing objects in S3.
        +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
        +Choose a number from below, or type in your own value
        + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
        +   \ "private"
        +[snip]
        +acl>
        +The server-side encryption algorithm used when storing this object in S3.
        +Choose a number from below, or type in your own value
        + 1 / None
        +   \ ""
        + 2 / AES256
        +   \ "AES256"
        +server_side_encryption>
        +The storage class to use when storing objects in S3.
        +Choose a number from below, or type in your own value
        + 1 / Default
        +   \ ""
        + 2 / Standard storage class
        +   \ "STANDARD"
        +storage_class>
        +Remote config
         --------------------
        -[remote]
        -username =
        -password = *** ENCRYPTED ***
        +[Liara]
        +env_auth = false
        +access_key_id = YOURACCESSKEY
        +secret_access_key = YOURSECRETACCESSKEY
        +endpoint = storage.iran.liara.space
        +location_constraint =
        +acl =
        +server_side_encryption =
        +storage_class =
         --------------------
         y) Yes this is OK
         e) Edit this remote
         d) Delete this remote
         y/e/d> y
        -

        List directories in top level of your OpenDrive

        -
        rclone lsd remote:
        -

        List all the files in your OpenDrive

        -
        rclone ls remote:
        -

        To copy a local directory to an OpenDrive directory called backup

        -
        rclone copy /home/source remote:backup
        -

        Modified time and MD5SUMs

        -

        OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not.

        -

        Restricted filename characters

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CharacterValueReplacement
        NUL0x00
        /0x2F
        "0x22
        *0x2A
        :0x3A
        <0x3C
        >0x3E
        ?0x3F
        \0x5C
        |0x7C
        -

        File names can also not begin or end with the following characters. These only get replaced if they are the first or last character in the name:

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CharacterValueReplacement
        SP0x20
        HT0x09
        LF0x0A
        VT0x0B
        CR0x0D
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Standard options

        -

        Here are the Standard options specific to opendrive (OpenDrive).

        -

        --opendrive-username

        -

        Username.

        -

        Properties:

        -
          -
        • Config: username
        • -
        • Env Var: RCLONE_OPENDRIVE_USERNAME
        • -
        • Type: string
        • -
        • Required: true
        • -
        -

        --opendrive-password

        -

        Password.

        -

        NB Input to this must be obscured - see rclone obscure.

        -

        Properties:

        -
          -
        • Config: password
        • -
        • Env Var: RCLONE_OPENDRIVE_PASSWORD
        • -
        • Type: string
        • -
        • Required: true
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to opendrive (OpenDrive).

        -

        --opendrive-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_OPENDRIVE_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot
        • -
        -

        --opendrive-chunk-size

        -

        Files will be uploaded in chunks this size.

        -

        Note that these chunks are buffered in memory so increasing them will increase memory use.

        -

        Properties:

        -
          -
        • Config: chunk_size
        • -
        • Env Var: RCLONE_OPENDRIVE_CHUNK_SIZE
        • -
        • Type: SizeSuffix
        • -
        • Default: 10Mi
        • -
        -

        Limitations

        -

        Note that OpenDrive is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

        -

        There are quite a few characters that can't be in OpenDrive file names. These can't occur on Windows platforms, but on non-Windows platforms they are common. Rclone will map these names to and from an identical looking unicode equivalent. For example if a file has a ? in it will be mapped to instead.

        -

        rclone about is not supported by the OpenDrive backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

        -

        See List of backends that do not support rclone about and rclone about

        -

        Oracle Object Storage

        -

        Oracle Object Storage Overview

        -

        Oracle Object Storage FAQ

        -

        Paths are specified as remote:bucket (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:bucket/path/to/dir.

        -

        Configuration

        -

        Here is an example of making an oracle object storage configuration. rclone config walks you through it.

        -

        Here is an example of how to make a remote called remote. First run:

        -
         rclone config
        -

        This will guide you through an interactive setup process:

        -
        n) New remote
        -d) Delete remote
        -r) Rename remote
        -c) Copy remote
        +

        This will leave the config file looking like this.

        +
        [Liara]
        +type = s3
        +provider = Liara
        +env_auth = false
        +access_key_id = YOURACCESSKEY
        +secret_access_key = YOURSECRETACCESSKEY
        +region =
        +endpoint = storage.iran.liara.space
        +location_constraint =
        +acl =
        +server_side_encryption =
        +storage_class =
        +

        Linode

        +

        Here is an example of making a Linode Object Storage configuration. First run:

        +
        rclone config
        +

        This will guide you through an interactive setup process.

        +
        No remotes found, make a new one?
        +n) New remote
         s) Set configuration password
         q) Quit config
        -e/n/d/r/c/s/q> n
        +n/s/q> n
         
         Enter name for new remote.
        -name> remote
        +name> linode
         
         Option Storage.
         Type of storage to configure.
         Choose a number from below, or type in your own value.
         [snip]
        -XX / Oracle Cloud Infrastructure Object Storage
        -   \ (oracleobjectstorage)
        -Storage> oracleobjectstorage
        + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others
        +   \ (s3)
        +[snip]
        +Storage> s3
         
         Option provider.
        -Choose your Auth Provider
        -Choose a number from below, or type in your own string value.
        -Press Enter for the default (env_auth).
        - 1 / automatically pickup the credentials from runtime(env), first one to provide auth wins
        -   \ (env_auth)
        -   / use an OCI user and an API key for authentication.
        - 2 | you’ll need to put in a config file your tenancy OCID, user OCID, region, the path, fingerprint to an API key.
        -   | https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm
        -   \ (user_principal_auth)
        -   / use instance principals to authorize an instance to make API calls. 
        - 3 | each instance has its own identity, and authenticates using the certificates that are read from instance metadata. 
        -   | https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm
        -   \ (instance_principal_auth)
        - 4 / use resource principals to make API calls
        -   \ (resource_principal_auth)
        - 5 / no credentials needed, this is typically for reading public buckets
        -   \ (no_auth)
        -provider> 2
        -
        -Option namespace.
        -Object storage namespace
        -Enter a value.
        -namespace> idbamagbg734
        +Choose your S3 provider.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        +[snip]
        +XX / Linode Object Storage
        +   \ (Linode)
        +[snip]
        +provider> Linode
         
        -Option compartment.
        -Object storage compartment OCID
        -Enter a value.
        -compartment> ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba
        +Option env_auth.
        +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
        +Only applies if access_key_id and secret_access_key is blank.
        +Choose a number from below, or type in your own boolean value (true or false).
        +Press Enter for the default (false).
        + 1 / Enter AWS credentials in the next step.
        +   \ (false)
        + 2 / Get AWS credentials from the environment (env vars or IAM).
        +   \ (true)
        +env_auth> 
         
        -Option region.
        -Object storage Region
        -Enter a value.
        -region> us-ashburn-1
        +Option access_key_id.
        +AWS Access Key ID.
        +Leave blank for anonymous access or runtime credentials.
        +Enter a value. Press Enter to leave empty.
        +access_key_id> ACCESS_KEY
         
        -Option endpoint.
        -Endpoint for Object storage API.
        -Leave blank to use the default endpoint for the region.
        +Option secret_access_key.
        +AWS Secret Access Key (password).
        +Leave blank for anonymous access or runtime credentials.
         Enter a value. Press Enter to leave empty.
        -endpoint> 
        -
        -Option config_file.
        -Full Path to OCI config file
        -Choose a number from below, or type in your own string value.
        -Press Enter for the default (~/.oci/config).
        - 1 / oci configuration file location
        -   \ (~/.oci/config)
        -config_file> /etc/oci/dev.conf
        -
        -Option config_profile.
        -Profile name inside OCI config file
        -Choose a number from below, or type in your own string value.
        -Press Enter for the default (Default).
        - 1 / Use the default profile
        -   \ (Default)
        -config_profile> Test
        +secret_access_key> SECRET_ACCESS_KEY
        +
        +Option endpoint.
        +Endpoint for Linode Object Storage API.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        + 1 / Atlanta, GA (USA), us-southeast-1
        +   \ (us-southeast-1.linodeobjects.com)
        + 2 / Chicago, IL (USA), us-ord-1
        +   \ (us-ord-1.linodeobjects.com)
        + 3 / Frankfurt (Germany), eu-central-1
        +   \ (eu-central-1.linodeobjects.com)
        + 4 / Milan (Italy), it-mil-1
        +   \ (it-mil-1.linodeobjects.com)
        + 5 / Newark, NJ (USA), us-east-1
        +   \ (us-east-1.linodeobjects.com)
        + 6 / Paris (France), fr-par-1
        +   \ (fr-par-1.linodeobjects.com)
        + 7 / Seattle, WA (USA), us-sea-1
        +   \ (us-sea-1.linodeobjects.com)
        + 8 / Singapore ap-south-1
        +   \ (ap-south-1.linodeobjects.com)
        + 9 / Stockholm (Sweden), se-sto-1
        +   \ (se-sto-1.linodeobjects.com)
        +10 / Washington, DC, (USA), us-iad-1
        +   \ (us-iad-1.linodeobjects.com)
        +endpoint> 3
        +
        +Option acl.
        +Canned ACL used when creating buckets and storing or copying objects.
        +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
        +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
        +Note that this ACL is applied when server-side copying objects as S3
        +doesn't copy the ACL from the source but rather writes a fresh one.
        +If the acl is an empty string then no X-Amz-Acl: header is added and
        +the default (private) will be used.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        +   / Owner gets FULL_CONTROL.
        + 1 | No one else has access rights (default).
        +   \ (private)
        +[snip]
        +acl> 
         
         Edit advanced config?
         y) Yes
         n) No (default)
         y/n> n
        -
        -Configuration complete.
        -Options:
        -- type: oracleobjectstorage
        -- namespace: idbamagbg734
        -- compartment: ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba
        -- region: us-ashburn-1
        -- provider: user_principal_auth
        -- config_file: /etc/oci/dev.conf
        -- config_profile: Test
        -Keep this "remote" remote?
        -y) Yes this is OK (default)
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -

        See all buckets

        -
        rclone lsd remote:
        -

        Create a new bucket

        -
        rclone mkdir remote:bucket
        -

        List the contents of a bucket

        -
        rclone ls remote:bucket
        -rclone ls remote:bucket --max-depth 1
        -

        OCI Authentication Provider

        -

        OCI has various authentication methods. To learn more about authentication methods please refer oci authentication methods These choices can be specified in the rclone config file.

        -

        Rclone supports the following OCI authentication provider.

        -
        User Principal
        -Instance Principal
        -Resource Principal
        -No authentication
        -

        Authentication provider choice: User Principal

        -

        Sample rclone config file for Authentication Provider User Principal:

        -
        [oos]
        -type = oracleobjectstorage
        -namespace = id<redacted>34
        -compartment = ocid1.compartment.oc1..aa<redacted>ba
        -region = us-ashburn-1
        -provider = user_principal_auth
        -config_file = /home/opc/.oci/config
        -config_profile = Default
        -

        Advantages: - One can use this method from any server within OCI or on-premises or from other cloud provider.

        -

        Considerations: - you need to configure user’s privileges / policy to allow access to object storage - Overhead of managing users and keys. - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials.

        -

        Authentication provider choice: Instance Principal

        -

        An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. With this approach no credentials have to be stored and managed.

        -

        Sample rclone configuration file for Authentication Provider Instance Principal:

        -
        [opc@rclone ~]$ cat ~/.config/rclone/rclone.conf
        -[oos]
        -type = oracleobjectstorage
        -namespace = id<redacted>fn
        -compartment = ocid1.compartment.oc1..aa<redacted>k7a
        -region = us-ashburn-1
        -provider = instance_principal_auth
        -

        Advantages:

        -
          -
        • With instance principals, you don't need to configure user credentials and transfer/ save it to disk in your compute instances or rotate the credentials.
        • -
        • You don’t need to deal with users and keys.
        • -
        • Greatly helps in automation as you don't have to manage access keys, user private keys, storing them in vault, using kms etc.
        • -
        -

        Considerations:

        -
          -
        • You need to configure a dynamic group having this instance as member and add policy to read object storage to that dynamic group.
        • -
        • Everyone who has access to this machine can execute the CLI commands.
        • -
        • It is applicable for oci compute instances only. It cannot be used on external instance or resources.
        • -
        -

        Authentication provider choice: Resource Principal

        -

        Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as serverless functions. To use resource principal ensure Rclone process is started with these environment variables set in its process.

        -
        export OCI_RESOURCE_PRINCIPAL_VERSION=2.2
        -export OCI_RESOURCE_PRINCIPAL_REGION=us-ashburn-1
        -export OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM=/usr/share/model-server/key.pem
        -export OCI_RESOURCE_PRINCIPAL_RPST=/usr/share/model-server/security_token
        -

        Sample rclone configuration file for Authentication Provider Resource Principal:

        -
        [oos]
        -type = oracleobjectstorage
        -namespace = id<redacted>34
        -compartment = ocid1.compartment.oc1..aa<redacted>ba
        -region = us-ashburn-1
        -provider = resource_principal_auth
        -

        Authentication provider choice: No authentication

        -

        Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication:

        -
        [oos]
        -type = oracleobjectstorage
        -namespace = id<redacted>34
        -compartment = ocid1.compartment.oc1..aa<redacted>ba
        -region = us-ashburn-1
        -provider = no_auth
        -

        Options

        -

        Modified time

        -

        The modified time is stored as metadata on the object as opc-meta-mtime as floating point since the epoch, accurate to 1 ns.

        -

        If the modification time needs to be updated rclone will attempt to perform a server side copy to update the modification if the object can be copied in a single part. In the case the object is larger than 5Gb, the object will be uploaded rather than copied.

        -

        Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

        -

        Multipart uploads

        -

        rclone supports multipart uploads with OOS which means that it can upload files bigger than 5 GiB.

        -

        Note that files uploaded both with multipart upload and through crypt remotes do not have MD5 sums.

        -

        rclone switches from single part uploads to multipart uploads at the point specified by --oos-upload-cutoff. This can be a maximum of 5 GiB and a minimum of 0 (ie always upload multipart files).

        -

        The chunk sizes used in the multipart upload are specified by --oos-chunk-size and the number of chunks uploaded concurrently is specified by --oos-upload-concurrency.

        -

        Multipart uploads will use --transfers * --oos-upload-concurrency * --oos-chunk-size extra memory. Single part uploads to not use extra memory.

        -

        Single part transfers can be faster than multipart transfers or slower depending on your latency from oos - the more latency, the more likely single part transfers will be faster.

        -

        Increasing --oos-upload-concurrency will increase throughput (8 would be a sensible value) and increasing --oos-chunk-size also increases throughput (16M would be sensible). Increasing either of these will use more memory. The default values are high enough to gain most of the possible performance without using too much memory.

        -

        Standard options

        -

        Here are the Standard options specific to oracleobjectstorage (Oracle Cloud Infrastructure Object Storage).

        -

        --oos-provider

        -

        Choose your Auth Provider

        -

        Properties:

        -
          -
        • Config: provider
        • -
        • Env Var: RCLONE_OOS_PROVIDER
        • -
        • Type: string
        • -
        • Default: "env_auth"
        • -
        • Examples: -
            -
          • "env_auth" -
              -
            • automatically pickup the credentials from runtime(env), first one to provide auth wins
            • -
          • -
          • "user_principal_auth" -
              -
            • use an OCI user and an API key for authentication.
            • -
            • you’ll need to put in a config file your tenancy OCID, user OCID, region, the path, fingerprint to an API key.
            • -
            • https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm
            • -
          • -
          • "instance_principal_auth" -
              -
            • use instance principals to authorize an instance to make API calls.
            • -
            • each instance has its own identity, and authenticates using the certificates that are read from instance metadata.
            • -
            • https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm
            • -
          • -
          • "resource_principal_auth" -
              -
            • use resource principals to make API calls
            • -
          • -
          • "no_auth" -
              -
            • no credentials needed, this is typically for reading public buckets
            • -
          • -
        • -
        -

        --oos-namespace

        -

        Object storage namespace

        -

        Properties:

        -
          -
        • Config: namespace
        • -
        • Env Var: RCLONE_OOS_NAMESPACE
        • -
        • Type: string
        • -
        • Required: true
        • -
        -

        --oos-compartment

        -

        Object storage compartment OCID

        -

        Properties:

        -
          -
        • Config: compartment
        • -
        • Env Var: RCLONE_OOS_COMPARTMENT
        • -
        • Provider: !no_auth
        • -
        • Type: string
        • -
        • Required: true
        • -
        -

        --oos-region

        -

        Object storage Region

        -

        Properties:

        -
          -
        • Config: region
        • -
        • Env Var: RCLONE_OOS_REGION
        • -
        • Type: string
        • -
        • Required: true
        • -
        -

        --oos-endpoint

        -

        Endpoint for Object storage API.

        -

        Leave blank to use the default endpoint for the region.

        -

        Properties:

        -
          -
        • Config: endpoint
        • -
        • Env Var: RCLONE_OOS_ENDPOINT
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --oos-config-file

        -

        Path to OCI config file

        -

        Properties:

        -
          -
        • Config: config_file
        • -
        • Env Var: RCLONE_OOS_CONFIG_FILE
        • -
        • Provider: user_principal_auth
        • -
        • Type: string
        • -
        • Default: "~/.oci/config"
        • -
        • Examples: -
            -
          • "~/.oci/config" -
              -
            • oci configuration file location
            • -
          • -
        • -
        -

        --oos-config-profile

        -

        Profile name inside the oci config file

        -

        Properties:

        -
          -
        • Config: config_profile
        • -
        • Env Var: RCLONE_OOS_CONFIG_PROFILE
        • -
        • Provider: user_principal_auth
        • -
        • Type: string
        • -
        • Default: "Default"
        • -
        • Examples: -
            -
          • "Default" -
              -
            • Use the default profile
            • -
          • -
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to oracleobjectstorage (Oracle Cloud Infrastructure Object Storage).

        -

        --oos-storage-tier

        -

        The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm

        -

        Properties:

        -
          -
        • Config: storage_tier
        • -
        • Env Var: RCLONE_OOS_STORAGE_TIER
        • -
        • Type: string
        • -
        • Default: "Standard"
        • -
        • Examples: -
            -
          • "Standard" -
              -
            • Standard storage tier, this is the default tier
            • -
          • -
          • "InfrequentAccess" -
              -
            • InfrequentAccess storage tier
            • -
          • -
          • "Archive" -
              -
            • Archive storage tier
            • -
          • -
        • -
        -

        --oos-upload-cutoff

        -

        Cutoff for switching to chunked upload.

        -

        Any files larger than this will be uploaded in chunks of chunk_size. The minimum is 0 and the maximum is 5 GiB.

        -

        Properties:

        -
          -
        • Config: upload_cutoff
        • -
        • Env Var: RCLONE_OOS_UPLOAD_CUTOFF
        • -
        • Type: SizeSuffix
        • -
        • Default: 200Mi
        • -
        -

        --oos-chunk-size

        -

        Chunk size to use for uploading.

        -

        When uploading files larger than upload_cutoff or files with unknown size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google photos or google docs) they will be uploaded as multipart uploads using this chunk size.

        -

        Note that "upload_concurrency" chunks of this size are buffered in memory per transfer.

        -

        If you are transferring large files over high-speed links and you have enough memory, then increasing this will speed up the transfers.

        -

        Rclone will automatically increase the chunk size when uploading a large file of known size to stay below the 10,000 chunks limit.

        -

        Files of unknown size are uploaded with the configured chunk_size. Since the default chunk size is 5 MiB and there can be at most 10,000 chunks, this means that by default the maximum size of a file you can stream upload is 48 GiB. If you wish to stream upload larger files then you will need to increase chunk_size.

        -

        Increasing the chunk size decreases the accuracy of the progress statistics displayed with "-P" flag.

        -

        Properties:

        -
          -
        • Config: chunk_size
        • -
        • Env Var: RCLONE_OOS_CHUNK_SIZE
        • -
        • Type: SizeSuffix
        • -
        • Default: 5Mi
        • -
        -

        --oos-upload-concurrency

        -

        Concurrency for multipart uploads.

        -

        This is the number of chunks of the same file that are uploaded concurrently.

        -

        If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

        -

        Properties:

        -
          -
        • Config: upload_concurrency
        • -
        • Env Var: RCLONE_OOS_UPLOAD_CONCURRENCY
        • -
        • Type: int
        • -
        • Default: 10
        • -
        -

        --oos-copy-cutoff

        -

        Cutoff for switching to multipart copy.

        -

        Any files larger than this that need to be server-side copied will be copied in chunks of this size.

        -

        The minimum is 0 and the maximum is 5 GiB.

        -

        Properties:

        -
          -
        • Config: copy_cutoff
        • -
        • Env Var: RCLONE_OOS_COPY_CUTOFF
        • -
        • Type: SizeSuffix
        • -
        • Default: 4.656Gi
        • -
        -

        --oos-copy-timeout

        -

        Timeout for copy.

        -

        Copy is an asynchronous operation, specify timeout to wait for copy to succeed

        -

        Properties:

        -
          -
        • Config: copy_timeout
        • -
        • Env Var: RCLONE_OOS_COPY_TIMEOUT
        • -
        • Type: Duration
        • -
        • Default: 1m0s
        • -
        -

        --oos-disable-checksum

        -

        Don't store MD5 checksum with object metadata.

        -

        Normally rclone will calculate the MD5 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

        -

        Properties:

        -
          -
        • Config: disable_checksum
        • -
        • Env Var: RCLONE_OOS_DISABLE_CHECKSUM
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --oos-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_OOS_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,InvalidUtf8,Dot
        • -
        -

        --oos-leave-parts-on-error

        -

        If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery.

        -

        It should be set to true for resuming uploads across different sessions.

        -

        WARNING: Storing parts of an incomplete multipart upload counts towards space usage on object storage and will add additional costs if not cleaned up.

        -

        Properties:

        -
          -
        • Config: leave_parts_on_error
        • -
        • Env Var: RCLONE_OOS_LEAVE_PARTS_ON_ERROR
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --oos-no-check-bucket

        -

        If set, don't attempt to check the bucket exists or create it.

        -

        This can be useful when trying to minimise the number of transactions rclone does if you know the bucket exists already.

        -

        It can also be needed if the user you are using does not have bucket creation permissions.

        -

        Properties:

        -
          -
        • Config: no_check_bucket
        • -
        • Env Var: RCLONE_OOS_NO_CHECK_BUCKET
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --oos-sse-customer-key-file

        -

        To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated with the object. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.'

        -

        Properties:

        -
          -
        • Config: sse_customer_key_file
        • -
        • Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY_FILE
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "" -
              -
            • None
            • -
          • -
        • -
        -

        --oos-sse-customer-key

        -

        To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed. For more information, see Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm)

        -

        Properties:

        -
          -
        • Config: sse_customer_key
        • -
        • Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "" -
              -
            • None
            • -
          • -
        • -
        -

        --oos-sse-customer-key-sha256

        -

        If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. see Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm).

        -

        Properties:

        -
          -
        • Config: sse_customer_key_sha256
        • -
        • Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY_SHA256
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "" -
              -
            • None
            • -
          • -
        • -
        -

        --oos-sse-kms-key-id

        -

        if using using your own master key in vault, this header specifies the OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.

        -

        Properties:

        -
          -
        • Config: sse_kms_key_id
        • -
        • Env Var: RCLONE_OOS_SSE_KMS_KEY_ID
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "" -
              -
            • None
            • -
          • -
        • -
        -

        --oos-sse-customer-algorithm

        -

        If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm. Object Storage supports "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm).

        -

        Properties:

        -
          -
        • Config: sse_customer_algorithm
        • -
        • Env Var: RCLONE_OOS_SSE_CUSTOMER_ALGORITHM
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "" -
              -
            • None
            • -
          • -
          • "AES256" -
              -
            • AES256
            • -
          • -
        • -
        -

        Backend commands

        -

        Here are the commands specific to the oracleobjectstorage backend.

        -

        Run them with

        -
        rclone backend COMMAND remote:
        -

        The help below will explain what arguments each command takes.

        -

        See the backend command for more info on how to pass options and arguments.

        -

        These can be run on a running backend using the rc command backend/command.

        -

        rename

        -

        change the name of an object

        -
        rclone backend rename remote: [options] [<arguments>+]
        -

        This command can be used to rename a object.

        -

        Usage Examples:

        -
        rclone backend rename oos:bucket relative-object-path-under-bucket object-new-name
        -

        list-multipart-uploads

        -

        List the unfinished multipart uploads

        -
        rclone backend list-multipart-uploads remote: [options] [<arguments>+]
        -

        This command lists the unfinished multipart uploads in JSON format.

        -
        rclone backend list-multipart-uploads oos:bucket/path/to/object
        -

        It returns a dictionary of buckets with values as lists of unfinished multipart uploads.

        -

        You can call it with no bucket in which case it lists all bucket, with a bucket or with a bucket and path.

        -
        {
        -  "test-bucket": [
        -            {
        -                    "namespace": "test-namespace",
        -                    "bucket": "test-bucket",
        -                    "object": "600m.bin",
        -                    "uploadId": "51dd8114-52a4-b2f2-c42f-5291f05eb3c8",
        -                    "timeCreated": "2022-07-29T06:21:16.595Z",
        -                    "storageTier": "Standard"
        -            }
        -    ]
        -

        cleanup

        -

        Remove unfinished multipart uploads.

        -
        rclone backend cleanup remote: [options] [<arguments>+]
        -

        This command removes unfinished multipart uploads of age greater than max-age which defaults to 24 hours.

        -

        Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

        -
        rclone backend cleanup oos:bucket/path/to/object
        -rclone backend cleanup -o max-age=7w oos:bucket/path/to/object
        -

        Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.

        -

        Options:

        -
          -
        • "max-age": Max age of upload to delete
        • -
        -

        QingStor

        -

        Paths are specified as remote:bucket (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:bucket/path/to/dir.

        -

        Configuration

        -

        Here is an example of making an QingStor configuration. First run

        -
        rclone config
        + +Configuration complete. +Options: +- type: s3 +- provider: Linode +- access_key_id: ACCESS_KEY +- secret_access_key: SECRET_ACCESS_KEY +- endpoint: eu-central-1.linodeobjects.com +Keep this "linode" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y
        +

        This will leave the config file looking like this.

        +
        [linode]
        +type = s3
        +provider = Linode
        +access_key_id = ACCESS_KEY
        +secret_access_key = SECRET_ACCESS_KEY
        +endpoint = eu-central-1.linodeobjects.com
        +

        ArvanCloud

        +

        ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional file storage. It gives you access to backup and archived files and allows sharing. Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service.

        +

        ArvanCloud provides an S3 interface which can be configured for use with rclone like this.

        +
        No remotes found, make a new one?
        +n) New remote
        +s) Set configuration password
        +n/s> n
        +name> ArvanCloud
        +Type of storage to configure.
        +Choose a number from below, or type in your own value
        +[snip]
        +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
        +   \ "s3"
        +[snip]
        +Storage> s3
        +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
        +Choose a number from below, or type in your own value
        + 1 / Enter AWS credentials in the next step
        +   \ "false"
        + 2 / Get AWS credentials from the environment (env vars or IAM)
        +   \ "true"
        +env_auth> 1
        +AWS Access Key ID - leave blank for anonymous access or runtime credentials.
        +access_key_id> YOURACCESSKEY
        +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
        +secret_access_key> YOURSECRETACCESSKEY
        +Region to connect to.
        +Choose a number from below, or type in your own value
        +   / The default endpoint - a good choice if you are unsure.
        + 1 | US Region, Northern Virginia, or Pacific Northwest.
        +   | Leave location constraint empty.
        +   \ "us-east-1"
        +[snip]
        +region> 
        +Endpoint for S3 API.
        +Leave blank if using ArvanCloud to use the default endpoint for the region.
        +Specify if using an S3 clone such as Ceph.
        +endpoint> s3.arvanstorage.com
        +Location constraint - must be set to match the Region. Used when creating buckets only.
        +Choose a number from below, or type in your own value
        + 1 / Empty for Iran-Tehran Region.
        +   \ ""
        +[snip]
        +location_constraint>
        +Canned ACL used when creating buckets and/or storing objects in S3.
        +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
        +Choose a number from below, or type in your own value
        + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
        +   \ "private"
        +[snip]
        +acl>
        +The server-side encryption algorithm used when storing this object in S3.
        +Choose a number from below, or type in your own value
        + 1 / None
        +   \ ""
        + 2 / AES256
        +   \ "AES256"
        +server_side_encryption>
        +The storage class to use when storing objects in S3.
        +Choose a number from below, or type in your own value
        + 1 / Default
        +   \ ""
        + 2 / Standard storage class
        +   \ "STANDARD"
        +storage_class>
        +Remote config
        +--------------------
        +[ArvanCloud]
        +env_auth = false
        +access_key_id = YOURACCESSKEY
        +secret_access_key = YOURSECRETACCESSKEY
        +region = ir-thr-at1
        +endpoint = s3.arvanstorage.com
        +location_constraint =
        +acl =
        +server_side_encryption =
        +storage_class =
        +--------------------
        +y) Yes this is OK
        +e) Edit this remote
        +d) Delete this remote
        +y/e/d> y
        +

        This will leave the config file looking like this.

        +
        [ArvanCloud]
        +type = s3
        +provider = ArvanCloud
        +env_auth = false
        +access_key_id = YOURACCESSKEY
        +secret_access_key = YOURSECRETACCESSKEY
        +region =
        +endpoint = s3.arvanstorage.com
        +location_constraint =
        +acl =
        +server_side_encryption =
        +storage_class =
        +

        Tencent COS

        +

        Tencent Cloud Object Storage (COS) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost.

        +

        To configure access to Tencent COS, follow the steps below:

        +
          +
        1. Run rclone config and select n for a new remote.
        2. +
        +
        rclone config
        +No remotes found, make a new one?
        +n) New remote
        +s) Set configuration password
        +q) Quit config
        +n/s/q> n
        +
          +
        1. Give the name of the configuration. For example, name it 'cos'.
        2. +
        +
        name> cos
        +
          +
        1. Select s3 storage.
        2. +
        +
        Choose a number from below, or type in your own value
        +1 / 1Fichier
        +   \ "fichier"
        + 2 / Alias for an existing remote
        +   \ "alias"
        + 3 / Amazon Drive
        +   \ "amazon cloud drive"
        + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
        +   \ "s3"
        +[snip]
        +Storage> s3
        +
          +
        1. Select TencentCOS provider.
        2. +
        +
        Choose a number from below, or type in your own value
        +1 / Amazon Web Services (AWS) S3
        +   \ "AWS"
        +[snip]
        +11 / Tencent Cloud Object Storage (COS)
        +   \ "TencentCOS"
        +[snip]
        +provider> TencentCOS
        +
          +
        1. Enter your SecretId and SecretKey of Tencent Cloud.
        2. +
        +
        Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
        +Only applies if access_key_id and secret_access_key is blank.
        +Enter a boolean value (true or false). Press Enter for the default ("false").
        +Choose a number from below, or type in your own value
        + 1 / Enter AWS credentials in the next step
        +   \ "false"
        + 2 / Get AWS credentials from the environment (env vars or IAM)
        +   \ "true"
        +env_auth> 1
        +AWS Access Key ID.
        +Leave blank for anonymous access or runtime credentials.
        +Enter a string value. Press Enter for the default ("").
        +access_key_id> AKIDxxxxxxxxxx
        +AWS Secret Access Key (password)
        +Leave blank for anonymous access or runtime credentials.
        +Enter a string value. Press Enter for the default ("").
        +secret_access_key> xxxxxxxxxxx
        +
          +
        1. Select endpoint for Tencent COS. This is the standard endpoint for different region.
        2. +
        +
         1 / Beijing Region.
        +   \ "cos.ap-beijing.myqcloud.com"
        + 2 / Nanjing Region.
        +   \ "cos.ap-nanjing.myqcloud.com"
        + 3 / Shanghai Region.
        +   \ "cos.ap-shanghai.myqcloud.com"
        + 4 / Guangzhou Region.
        +   \ "cos.ap-guangzhou.myqcloud.com"
        +[snip]
        +endpoint> 4
        +
          +
        1. Choose acl and storage class.
        2. +
        +
        Note that this ACL is applied when server-side copying objects as S3
        +doesn't copy the ACL from the source but rather writes a fresh one.
        +Enter a string value. Press Enter for the default ("").
        +Choose a number from below, or type in your own value
        + 1 / Owner gets Full_CONTROL. No one else has access rights (default).
        +   \ "default"
        +[snip]
        +acl> 1
        +The storage class to use when storing new objects in Tencent COS.
        +Enter a string value. Press Enter for the default ("").
        +Choose a number from below, or type in your own value
        + 1 / Default
        +   \ ""
        +[snip]
        +storage_class> 1
        +Edit advanced config? (y/n)
        +y) Yes
        +n) No (default)
        +y/n> n
        +Remote config
        +--------------------
        +[cos]
        +type = s3
        +provider = TencentCOS
        +env_auth = false
        +access_key_id = xxx
        +secret_access_key = xxx
        +endpoint = cos.ap-guangzhou.myqcloud.com
        +acl = default
        +--------------------
        +y) Yes this is OK (default)
        +e) Edit this remote
        +d) Delete this remote
        +y/e/d> y
        +Current remotes:
        +
        +Name                 Type
        +====                 ====
        +cos                  s3
        +

        Netease NOS

        +

        For Netease NOS configure as per the configurator rclone config setting the provider Netease. This will automatically set force_path_style = false which is necessary for it to run properly.

        +

        Petabox

        +

        Here is an example of making a Petabox configuration. First run:

        +
        rclone config

        This will guide you through an interactive setup process.

        No remotes found, make a new one?
         n) New remote
        -r) Rename remote
        -c) Copy remote
         s) Set configuration password
        -q) Quit config
        -n/r/c/s/q> n
        -name> remote
        +n/s> n
        +
        +Enter name for new remote.
        +name> My Petabox Storage
        +
        +Option Storage.
         Type of storage to configure.
        -Choose a number from below, or type in your own value
        +Choose a number from below, or type in your own value.
         [snip]
        -XX / QingStor Object Storage
        -   \ "qingstor"
        +XX / Amazon S3 Compliant Storage Providers including AWS, ...
        +   \ "s3"
         [snip]
        -Storage> qingstor
        -Get QingStor credentials from runtime. Only applies if access_key_id and secret_access_key is blank.
        -Choose a number from below, or type in your own value
        - 1 / Enter QingStor credentials in the next step
        -   \ "false"
        - 2 / Get QingStor credentials from the environment (env vars or IAM)
        -   \ "true"
        +Storage> s3
        +
        +Option provider.
        +Choose your S3 provider.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        +[snip]
        +XX / Petabox Object Storage
        +   \ (Petabox)
        +[snip]
        +provider> Petabox
        +
        +Option env_auth.
        +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
        +Only applies if access_key_id and secret_access_key is blank.
        +Choose a number from below, or type in your own boolean value (true or false).
        +Press Enter for the default (false).
        + 1 / Enter AWS credentials in the next step.
        +   \ (false)
        + 2 / Get AWS credentials from the environment (env vars or IAM).
        +   \ (true)
         env_auth> 1
        -QingStor Access Key ID - leave blank for anonymous access or runtime credentials.
        -access_key_id> access_key
        -QingStor Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
        -secret_access_key> secret_key
        -Enter an endpoint URL to connection QingStor API.
        -Leave blank will use the default value "https://qingstor.com:443"
        -endpoint>
        -Zone connect to. Default is "pek3a".
        -Choose a number from below, or type in your own value
        -   / The Beijing (China) Three Zone
        - 1 | Needs location constraint pek3a.
        -   \ "pek3a"
        -   / The Shanghai (China) First Zone
        - 2 | Needs location constraint sh1a.
        -   \ "sh1a"
        -zone> 1
        -Number of connection retry.
        -Leave blank will use the default value "3".
        -connection_retries>
        -Remote config
        ---------------------
        -[remote]
        -env_auth = false
        -access_key_id = access_key
        -secret_access_key = secret_key
        -endpoint =
        -zone = pek3a
        -connection_retries =
        ---------------------
        -y) Yes this is OK
        +
        +Option access_key_id.
        +AWS Access Key ID.
        +Leave blank for anonymous access or runtime credentials.
        +Enter a value. Press Enter to leave empty.
        +access_key_id> YOUR_ACCESS_KEY_ID
        +
        +Option secret_access_key.
        +AWS Secret Access Key (password).
        +Leave blank for anonymous access or runtime credentials.
        +Enter a value. Press Enter to leave empty.
        +secret_access_key> YOUR_SECRET_ACCESS_KEY
        +
        +Option region.
        +Region where your bucket will be created and your data stored.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        + 1 / US East (N. Virginia)
        +   \ (us-east-1)
        + 2 / Europe (Frankfurt)
        +   \ (eu-central-1)
        + 3 / Asia Pacific (Singapore)
        +   \ (ap-southeast-1)
        + 4 / Middle East (Bahrain)
        +   \ (me-south-1)
        + 5 / South America (São Paulo)
        +   \ (sa-east-1)
        +region> 1
        +
        +Option endpoint.
        +Endpoint for Petabox S3 Object Storage.
        +Specify the endpoint from the same region.
        +Choose a number from below, or type in your own value.
        + 1 / US East (N. Virginia)
        +   \ (s3.petabox.io)
        + 2 / US East (N. Virginia)
        +   \ (s3.us-east-1.petabox.io)
        + 3 / Europe (Frankfurt)
        +   \ (s3.eu-central-1.petabox.io)
        + 4 / Asia Pacific (Singapore)
        +   \ (s3.ap-southeast-1.petabox.io)
        + 5 / Middle East (Bahrain)
        +   \ (s3.me-south-1.petabox.io)
        + 6 / South America (São Paulo)
        +   \ (s3.sa-east-1.petabox.io)
        +endpoint> 1
        +
        +Option acl.
        +Canned ACL used when creating buckets and storing or copying objects.
        +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
        +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
        +Note that this ACL is applied when server-side copying objects as S3
        +doesn't copy the ACL from the source but rather writes a fresh one.
        +If the acl is an empty string then no X-Amz-Acl: header is added and
        +the default (private) will be used.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        +   / Owner gets FULL_CONTROL.
        + 1 | No one else has access rights (default).
        +   \ (private)
        +   / Owner gets FULL_CONTROL.
        + 2 | The AllUsers group gets READ access.
        +   \ (public-read)
        +   / Owner gets FULL_CONTROL.
        + 3 | The AllUsers group gets READ and WRITE access.
        +   | Granting this on a bucket is generally not recommended.
        +   \ (public-read-write)
        +   / Owner gets FULL_CONTROL.
        + 4 | The AuthenticatedUsers group gets READ access.
        +   \ (authenticated-read)
        +   / Object owner gets FULL_CONTROL.
        + 5 | Bucket owner gets READ access.
        +   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
        +   \ (bucket-owner-read)
        +   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
        + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
        +   \ (bucket-owner-full-control)
        +acl> 1
        +
        +Edit advanced config?
        +y) Yes
        +n) No (default)
        +y/n> No
        +
        +Configuration complete.
        +Options:
        +- type: s3
        +- provider: Petabox
        +- access_key_id: YOUR_ACCESS_KEY_ID
        +- secret_access_key: YOUR_SECRET_ACCESS_KEY
        +- region: us-east-1
        +- endpoint: s3.petabox.io
        +Keep this "My Petabox Storage" remote?
        +y) Yes this is OK (default)
         e) Edit this remote
         d) Delete this remote
         y/e/d> y
        -

        This remote is called remote and can now be used like this

        -

        See all buckets

        -
        rclone lsd remote:
        -

        Make a new bucket

        -
        rclone mkdir remote:bucket
        -

        List the contents of a bucket

        -
        rclone ls remote:bucket
        -

        Sync /home/local/directory to the remote bucket, deleting any excess files in the bucket.

        -
        rclone sync --interactive /home/local/directory remote:bucket
        -

        --fast-list

        -

        This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

        -

        Multipart uploads

        -

        rclone supports multipart uploads with QingStor which means that it can upload files bigger than 5 GiB. Note that files uploaded with multipart upload don't have an MD5SUM.

        -

        Note that incomplete multipart uploads older than 24 hours can be removed with rclone cleanup remote:bucket just for one bucket rclone cleanup remote: for all buckets. QingStor does not ever remove incomplete multipart uploads so it may be necessary to run this from time to time.

        -

        Buckets and Zone

        -

        With QingStor you can list buckets (rclone lsd) using any zone, but you can only access the content of a bucket from the zone it was created in. If you attempt to access a bucket from the wrong zone, you will get an error, incorrect zone, the bucket is not in 'XXX' zone.

        -

        Authentication

        -

        There are two ways to supply rclone with a set of QingStor credentials. In order of precedence:

        -
          -
        • Directly in the rclone configuration file (as configured by rclone config) -
            -
          • set access_key_id and secret_access_key
          • -
        • -
        • Runtime configuration: -
            -
          • set env_auth to true in the config file
          • -
          • Exporting the following environment variables before running rclone -
              -
            • Access Key ID: QS_ACCESS_KEY_ID or QS_ACCESS_KEY
            • -
            • Secret Access Key: QS_SECRET_ACCESS_KEY or QS_SECRET_KEY
            • -
          • -
        • -
        -

        Restricted filename characters

        -

        The control characters 0x00-0x1F and / are replaced as in the default restricted characters set. Note that 0x7F is not replaced.

        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Standard options

        -

        Here are the Standard options specific to qingstor (QingCloud Object Storage).

        -

        --qingstor-env-auth

        -

        Get QingStor credentials from runtime.

        -

        Only applies if access_key_id and secret_access_key is blank.

        -

        Properties:

        -
          -
        • Config: env_auth
        • -
        • Env Var: RCLONE_QINGSTOR_ENV_AUTH
        • -
        • Type: bool
        • -
        • Default: false
        • -
        • Examples: -
            -
          • "false" -
              -
            • Enter QingStor credentials in the next step.
            • -
          • -
          • "true" -
              -
            • Get QingStor credentials from the environment (env vars or IAM).
            • -
          • -
        • -
        -

        --qingstor-access-key-id

        -

        QingStor Access Key ID.

        -

        Leave blank for anonymous access or runtime credentials.

        -

        Properties:

        -
          -
        • Config: access_key_id
        • -
        • Env Var: RCLONE_QINGSTOR_ACCESS_KEY_ID
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --qingstor-secret-access-key

        -

        QingStor Secret Access Key (password).

        -

        Leave blank for anonymous access or runtime credentials.

        -

        Properties:

        -
          -
        • Config: secret_access_key
        • -
        • Env Var: RCLONE_QINGSTOR_SECRET_ACCESS_KEY
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --qingstor-endpoint

        -

        Enter an endpoint URL to connection QingStor API.

        -

        Leave blank will use the default value "https://qingstor.com:443".

        -

        Properties:

        -
          -
        • Config: endpoint
        • -
        • Env Var: RCLONE_QINGSTOR_ENDPOINT
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --qingstor-zone

        -

        Zone to connect to.

        -

        Default is "pek3a".

        -

        Properties:

        -
          -
        • Config: zone
        • -
        • Env Var: RCLONE_QINGSTOR_ZONE
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "pek3a" -
              -
            • The Beijing (China) Three Zone.
            • -
            • Needs location constraint pek3a.
            • -
          • -
          • "sh1a" -
              -
            • The Shanghai (China) First Zone.
            • -
            • Needs location constraint sh1a.
            • -
          • -
          • "gd2a" -
              -
            • The Guangdong (China) Second Zone.
            • -
            • Needs location constraint gd2a.
            • -
          • -
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to qingstor (QingCloud Object Storage).

        -

        --qingstor-connection-retries

        -

        Number of connection retries.

        -

        Properties:

        -
          -
        • Config: connection_retries
        • -
        • Env Var: RCLONE_QINGSTOR_CONNECTION_RETRIES
        • -
        • Type: int
        • -
        • Default: 3
        • -
        -

        --qingstor-upload-cutoff

        -

        Cutoff for switching to chunked upload.

        -

        Any files larger than this will be uploaded in chunks of chunk_size. The minimum is 0 and the maximum is 5 GiB.

        -

        Properties:

        -
          -
        • Config: upload_cutoff
        • -
        • Env Var: RCLONE_QINGSTOR_UPLOAD_CUTOFF
        • -
        • Type: SizeSuffix
        • -
        • Default: 200Mi
        • -
        -

        --qingstor-chunk-size

        -

        Chunk size to use for uploading.

        -

        When uploading files larger than upload_cutoff they will be uploaded as multipart uploads using this chunk size.

        -

        Note that "--qingstor-upload-concurrency" chunks of this size are buffered in memory per transfer.

        -

        If you are transferring large files over high-speed links and you have enough memory, then increasing this will speed up the transfers.

        -

        Properties:

        -
          -
        • Config: chunk_size
        • -
        • Env Var: RCLONE_QINGSTOR_CHUNK_SIZE
        • -
        • Type: SizeSuffix
        • -
        • Default: 4Mi
        • -
        -

        --qingstor-upload-concurrency

        -

        Concurrency for multipart uploads.

        -

        This is the number of chunks of the same file that are uploaded concurrently.

        -

        NB if you set this to > 1 then the checksums of multipart uploads become corrupted (the uploads themselves are not corrupted though).

        -

        If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

        -

        Properties:

        +

        This will leave the config file looking like this.

        +
        [My Petabox Storage]
        +type = s3
        +provider = Petabox
        +access_key_id = YOUR_ACCESS_KEY_ID
        +secret_access_key = YOUR_SECRET_ACCESS_KEY
        +region = us-east-1
        +endpoint = s3.petabox.io
        +

        Storj

        +

        Storj is a decentralized cloud storage which can be used through its native protocol or an S3 compatible gateway.

        +

        The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Storj. Here is an example run of the configurator.

        +
        Type of storage to configure.
        +Storage> s3
        +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
        +Only applies if access_key_id and secret_access_key is blank.
        +Choose a number from below, or type in your own boolean value (true or false).
        +Press Enter for the default (false).
        + 1 / Enter AWS credentials in the next step.
        +   \ (false)
        + 2 / Get AWS credentials from the environment (env vars or IAM).
        +   \ (true)
        +env_auth> 1
        +Option access_key_id.
        +AWS Access Key ID.
        +Leave blank for anonymous access or runtime credentials.
        +Enter a value. Press Enter to leave empty.
        +access_key_id> XXXX (as shown when creating the access grant)
        +Option secret_access_key.
        +AWS Secret Access Key (password).
        +Leave blank for anonymous access or runtime credentials.
        +Enter a value. Press Enter to leave empty.
        +secret_access_key> XXXX (as shown when creating the access grant)
        +Option endpoint.
        +Endpoint of the Shared Gateway.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        + 1 / EU1 Shared Gateway
        +   \ (gateway.eu1.storjshare.io)
        + 2 / US1 Shared Gateway
        +   \ (gateway.us1.storjshare.io)
        + 3 / Asia-Pacific Shared Gateway
        +   \ (gateway.ap1.storjshare.io)
        +endpoint> 1 (as shown when creating the access grant)
        +Edit advanced config?
        +y) Yes
        +n) No (default)
        +y/n> n
        +

        Note that s3 credentials are generated when you create an access grant.

        +

        Backend quirks

          -
        • Config: upload_concurrency
        • -
        • Env Var: RCLONE_QINGSTOR_UPLOAD_CONCURRENCY
        • -
        • Type: int
        • -
        • Default: 1
        • +
        • --chunk-size is forced to be 64 MiB or greater. This will use more memory than the default of 5 MiB.
        • +
        • Server side copy is disabled as it isn't currently supported in the gateway.
        • +
        • GetTier and SetTier are not supported.
        -

        --qingstor-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        +

        Backend bugs

        +

        Due to issue #39 uploading multipart files via the S3 gateway causes them to lose their metadata. For rclone's purpose this means that the modification time is not stored, nor is any MD5SUM (if one is available from the source).

        +

        This has the following consequences:

          -
        • Config: encoding
        • -
        • Env Var: RCLONE_QINGSTOR_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,Ctl,InvalidUtf8
        • +
        • Using rclone rcat will fail as the medatada doesn't match after upload
        • +
        • Uploading files with rclone mount will fail for the same reason +
            +
          • This can worked around by using --vfs-cache-mode writes or --vfs-cache-mode full or setting --s3-upload-cutoff large
          • +
        • +
        • Files uploaded via a multipart upload won't have their modtimes +
            +
          • This will mean that rclone sync will likely keep trying to upload files bigger than --s3-upload-cutoff
          • +
          • This can be worked around with --checksum or --size-only or setting --s3-upload-cutoff large
          • +
          • The maximum value for --s3-upload-cutoff is 5GiB though
          • +
        -

        Limitations

        -

        rclone about is not supported by the qingstor backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

        +

        One general purpose workaround is to set --s3-upload-cutoff 5G. This means that rclone will upload files smaller than 5GiB as single parts. Note that this can be set in the config file with upload_cutoff = 5G or configured in the advanced settings. If you regularly transfer files larger than 5G then using --checksum or --size-only in rclone sync is the recommended workaround.

        +

        Comparison with the native protocol

        +

        Use the the native protocol to take advantage of client-side encryption as well as to achieve the best possible download performance. Uploads will be erasure-coded locally, thus a 1gb upload will result in 2.68gb of data being uploaded to storage nodes across the network.

        +

        Use this backend and the S3 compatible Hosted Gateway to increase upload performance and reduce the load on your systems and network. Uploads will be encrypted and erasure-coded server-side, thus a 1GB upload will result in only in 1GB of data being uploaded to storage nodes across the network.

        +

        For more detailed comparison please check the documentation of the storj backend.

        +

        Limitations

        +

        rclone about is not supported by the S3 backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

        See List of backends that do not support rclone about and rclone about

        -

        Sia

        -

        Sia (sia.tech) is a decentralized cloud storage platform based on the blockchain technology. With rclone you can use it like any other remote filesystem or mount Sia folders locally. The technology behind it involves a number of new concepts such as Siacoins and Wallet, Blockchain and Consensus, Renting and Hosting, and so on. If you are new to it, you'd better first familiarize yourself using their excellent support documentation.

        -

        Introduction

        -

        Before you can use rclone with Sia, you will need to have a running copy of Sia-UI or siad (the Sia daemon) locally on your computer or on local network (e.g. a NAS). Please follow the Get started guide and install one.

        -

        rclone interacts with Sia network by talking to the Sia daemon via HTTP API which is usually available on port 9980. By default you will run the daemon locally on the same computer so it's safe to leave the API password blank (the API URL will be http://127.0.0.1:9980 making external access impossible).

        -

        However, if you want to access Sia daemon running on another node, for example due to memory constraints or because you want to share single daemon between several rclone and Sia-UI instances, you'll need to make a few more provisions: - Ensure you have Sia daemon installed directly or in a docker container because Sia-UI does not support this mode natively. - Run it on externally accessible port, for example provide --api-addr :9980 and --disable-api-security arguments on the daemon command line. - Enforce API password for the siad daemon via environment variable SIA_API_PASSWORD or text file named apipassword in the daemon directory. - Set rclone backend option api_password taking it from above locations.

        -

        Notes: 1. If your wallet is locked, rclone cannot unlock it automatically. You should either unlock it in advance by using Sia-UI or via command line siac wallet unlock. Alternatively you can make siad unlock your wallet automatically upon startup by running it with environment variable SIA_WALLET_PASSWORD. 2. If siad cannot find the SIA_API_PASSWORD variable or the apipassword file in the SIA_DIR directory, it will generate a random password and store in the text file named apipassword under YOUR_HOME/.sia/ directory on Unix or C:\Users\YOUR_HOME\AppData\Local\Sia\apipassword on Windows. Remember this when you configure password in rclone. 3. The only way to use siad without API password is to run it on localhost with command line argument --authorize-api=false, but this is insecure and strongly discouraged.

        -

        Configuration

        -

        Here is an example of how to make a sia remote called mySia. First, run:

        -
         rclone config
        -

        This will guide you through an interactive setup process:

        +

        Synology C2 Object Storage

        +

        Synology C2 Object Storage provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty.

        +

        The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Synology. Here is an example run of the configurator.

        +

        First run:

        +
        rclone config
        +

        This will guide you through an interactive setup process.

        No remotes found, make a new one?
         n) New remote
         s) Set configuration password
         q) Quit config
        +
         n/s/q> n
        -name> mySia
        +
        +Enter name for new remote.1
        +name> syno
        +
         Type of storage to configure.
         Enter a string value. Press Enter for the default ("").
         Choose a number from below, or type in your own value
        -...
        -29 / Sia Decentralized Cloud
        -   \ "sia"
        -...
        -Storage> sia
        -Sia daemon API URL, like http://sia.daemon.host:9980.
        -Note that siad must run with --disable-api-security to open API port for other hosts (not recommended).
        -Keep default if Sia daemon runs on localhost.
        -Enter a string value. Press Enter for the default ("http://127.0.0.1:9980").
        -api_url> http://127.0.0.1:9980
        -Sia Daemon API Password.
        -Can be found in the apipassword file located in HOME/.sia/ or in the daemon directory.
        -y) Yes type in my own password
        -g) Generate random password
        -n) No leave this optional password blank (default)
        -y/g/n> y
        -Enter the password:
        -password:
        -Confirm the password:
        -password:
        -Edit advanced config?
        +
        + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
        +   \ "s3"
        +
        +Storage> s3
        +
        +Choose your S3 provider.
        +Enter a string value. Press Enter for the default ("").
        +Choose a number from below, or type in your own value
        + 24 / Synology C2 Object Storage
        +   \ (Synology)
        +
        +provider> Synology
        +
        +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
        +Only applies if access_key_id and secret_access_key is blank.
        +Enter a boolean value (true or false). Press Enter for the default ("false").
        +Choose a number from below, or type in your own value
        + 1 / Enter AWS credentials in the next step
        +   \ "false"
        + 2 / Get AWS credentials from the environment (env vars or IAM)
        +   \ "true"
        +
        +env_auth> 1
        +
        +AWS Access Key ID.
        +Leave blank for anonymous access or runtime credentials.
        +Enter a string value. Press Enter for the default ("").
        +
        +access_key_id> accesskeyid
        +
        +AWS Secret Access Key (password)
        +Leave blank for anonymous access or runtime credentials.
        +Enter a string value. Press Enter for the default ("").
        +
        +secret_access_key> secretaccesskey
        +
        +Region where your data stored.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        + 1 / Europe Region 1
        +   \ (eu-001)
        + 2 / Europe Region 2
        +   \ (eu-002)
        + 3 / US Region 1
        +   \ (us-001)
        + 4 / US Region 2
        +   \ (us-002)
        + 5 / Asia (Taiwan)
        +   \ (tw-001)
        +
        +region > 1
        +
        +Option endpoint.
        +Endpoint for Synology C2 Object Storage API.
        +Choose a number from below, or type in your own value.
        +Press Enter to leave empty.
        + 1 / EU Endpoint 1
        +   \ (eu-001.s3.synologyc2.net)
        + 2 / US Endpoint 1
        +   \ (us-001.s3.synologyc2.net)
        + 3 / TW Endpoint 1
        +   \ (tw-001.s3.synologyc2.net)
        +
        +endpoint> 1
        +
        +Option location_constraint.
        +Location constraint - must be set to match the Region.
        +Leave blank if not sure. Used when creating buckets only.
        +Enter a value. Press Enter to leave empty.
        +location_constraint>
        +
        +Edit advanced config? (y/n)
         y) Yes
        -n) No (default)
        -y/n> n
        ---------------------
        -[mySia]
        -type = sia
        -api_url = http://127.0.0.1:9980
        -api_password = *** ENCRYPTED ***
        ---------------------
        +n) No
        +y/n> y
        +
        +Option no_check_bucket.
        +If set, don't attempt to check the bucket exists or create it.
        +This can be useful when trying to minimise the number of transactions
        +rclone does if you know the bucket exists already.
        +It can also be needed if the user you are using does not have bucket
        +creation permissions. Before v1.52.0 this would have passed silently
        +due to a bug.
        +Enter a boolean value (true or false). Press Enter for the default (true).
        +
        +no_check_bucket> true
        +
        +Configuration complete.
        +Options:
        +- type: s3
        +- provider: Synology
        +- region: eu-001
        +- endpoint: eu-001.s3.synologyc2.net
        +- no_check_bucket: true
        +Keep this "syno" remote?
         y) Yes this is OK (default)
         e) Edit this remote
         d) Delete this remote
        -y/e/d> y
        -

        Once configured, you can then use rclone like this:

        -
          -
        • List directories in top level of your Sia storage
        • -
        -
        rclone lsd mySia:
        -
          -
        • List all the files in your Sia storage
        • -
        -
        rclone ls mySia:
        -
          -
        • Upload a local directory to the Sia directory called backup
        • -
        -
        rclone copy /home/source mySia:backup
        -

        Standard options

        -

        Here are the Standard options specific to sia (Sia Decentralized Cloud).

        -

        --sia-api-url

        -

        Sia daemon API URL, like http://sia.daemon.host:9980.

        -

        Note that siad must run with --disable-api-security to open API port for other hosts (not recommended). Keep default if Sia daemon runs on localhost.

        -

        Properties:

        -
          -
        • Config: api_url
        • -
        • Env Var: RCLONE_SIA_API_URL
        • -
        • Type: string
        • -
        • Default: "http://127.0.0.1:9980"
        • -
        -

        --sia-api-password

        -

        Sia Daemon API Password.

        -

        Can be found in the apipassword file located in HOME/.sia/ or in the daemon directory.

        -

        NB Input to this must be obscured - see rclone obscure.

        -

        Properties:

        + +y/e/d> y + +# Backblaze B2 + +B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). + +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. + +## Configuration + +Here is an example of making a b2 configuration. First run + + rclone config + +This will guide you through an interactive setup process. To authenticate +you will either need your Account ID (a short hex number) and Master +Application Key (a long hex number) OR an Application Key, which is the +recommended method. See below for further details on generating and using +an Application Key. +
        +

        No remotes found, make a new one? n) New remote q) Quit config n/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Backblaze B2  "b2" [snip] Storage> b2 Account ID or Application Key ID account> 123456789abc Application Key key> 0123456789abcdef0123456789abcdef0123456789 Endpoint for the service - leave blank normally. endpoint> Remote config -------------------- [remote] account = 123456789abc key = 0123456789abcdef0123456789abcdef0123456789 endpoint = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +This remote is called `remote` and can now be used like this
        +
        +See all buckets
        +
        +    rclone lsd remote:
        +
        +Create a new bucket
        +
        +    rclone mkdir remote:bucket
        +
        +List the contents of a bucket
        +
        +    rclone ls remote:bucket
        +
        +Sync `/home/local/directory` to the remote bucket, deleting any
        +excess files in the bucket.
        +
        +    rclone sync --interactive /home/local/directory remote:bucket
        +
        +### Application Keys
        +
        +B2 supports multiple [Application Keys for different access permission
        +to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html).
        +
        +You can use these with rclone too; you will need to use rclone version 1.43
        +or later.
        +
        +Follow Backblaze's docs to create an Application Key with the required
        +permission and add the `applicationKeyId` as the `account` and the
        +`Application Key` itself as the `key`.
        +
        +Note that you must put the _applicationKeyId_ as the `account` – you
        +can't use the master Account ID.  If you try then B2 will return 401
        +errors.
        +
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +### Modification times
        +
        +The modification time is stored as metadata on the object as
        +`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01
        +in the Backblaze standard.  Other tools should be able to use this as
        +a modified time.
        +
        +Modified times are used in syncing and are fully supported. Note that
        +if a modification time needs to be updated on an object then it will
        +create a new version of the object.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \         | 0x5C  | \           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +Note that in 2020-05 Backblaze started allowing \ characters in file
        +names. Rclone hasn't changed its encoding as this could cause syncs to
        +re-transfer files. If you want rclone not to replace \ then see the
        +`--b2-encoding` flag below and remove the `BackSlash` from the
        +string. This can be set in the config.
        +
        +### SHA1 checksums
        +
        +The SHA1 checksums of the files are checked on upload and download and
        +will be used in the syncing process.
        +
        +Large files (bigger than the limit in `--b2-upload-cutoff`) which are
        +uploaded in chunks will store their SHA1 on the object as
        +`X-Bz-Info-large_file_sha1` as recommended by Backblaze.
        +
        +For a large file to be uploaded with an SHA1 checksum, the source
        +needs to support SHA1 checksums. The local disk supports SHA1
        +checksums so large file transfers from local disk will have an SHA1.
        +See [the overview](https://rclone.org/overview/#features) for exactly which remotes
        +support SHA1.
        +
        +Sources which don't support SHA1, in particular `crypt` will upload
        +large files without SHA1 checksums.  This may be fixed in the future
        +(see [#1767](https://github.com/rclone/rclone/issues/1767)).
        +
        +Files sizes below `--b2-upload-cutoff` will always have an SHA1
        +regardless of the source.
        +
        +### Transfers
        +
        +Backblaze recommends that you do lots of transfers simultaneously for
        +maximum speed.  In tests from my SSD equipped laptop the optimum
        +setting is about `--transfers 32` though higher numbers may be used
        +for a slight speed improvement. The optimum number for you may vary
        +depending on your hardware, how big the files are, how much you want
        +to load your computer, etc.  The default of `--transfers 4` is
        +definitely too low for Backblaze B2 though.
        +
        +Note that uploading big files (bigger than 200 MiB by default) will use
        +a 96 MiB RAM buffer by default.  There can be at most `--transfers` of
        +these in use at any moment, so this sets the upper limit on the memory
        +used.
        +
        +### Versions
        +
        +When rclone uploads a new version of a file it creates a [new version
        +of it](https://www.backblaze.com/b2/docs/file_versions.html).
        +Likewise when you delete a file, the old version will be marked hidden
        +and still be available.  Conversely, you may opt in to a "hard delete"
        +of files with the `--b2-hard-delete` flag which would permanently remove
        +the file instead of hiding it.
        +
        +Old versions of files, where available, are visible using the 
        +`--b2-versions` flag.
        +
        +It is also possible to view a bucket as it was at a certain point in time,
        +using the `--b2-version-at` flag. This will show the file versions as they
        +were at that time, showing files that have been deleted afterwards, and
        +hiding files that were created since.
        +
        +If you wish to remove all the old versions then you can use the
        +`rclone cleanup remote:bucket` command which will delete all the old
        +versions of files, leaving the current ones intact.  You can also
        +supply a path and only old versions under that path will be deleted,
        +e.g. `rclone cleanup remote:bucket/path/to/stuff`.
        +
        +Note that `cleanup` will remove partially uploaded files from the bucket
        +if they are more than a day old.
        +
        +When you `purge` a bucket, the current and the old versions will be
        +deleted then the bucket will be deleted.
        +
        +However `delete` will cause the current versions of the files to
        +become hidden old versions.
        +
        +Here is a session showing the listing and retrieval of an old
        +version followed by a `cleanup` of the old versions.
        +
        +Show current version and all the versions with `--b2-versions` flag.
        +
        +

        $ rclone -q ls b2:cleanup-test 9 one.txt

        +

        $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 one-v2016-07-02-155621-000.txt

        +
        
        +Retrieve an old version
        +
        +

        $ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp

        +

        $ ls -l /tmp/one-v2016-07-04-141003-000.txt -rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt

        +
        
        +Clean up all the old versions and show that they've gone.
        +
        +

        $ rclone -q cleanup b2:cleanup-test

        +

        $ rclone -q ls b2:cleanup-test 9 one.txt

        +

        $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt

        +
        
        +#### Versions naming caveat
        +
        +When using `--b2-versions` flag rclone is relying on the file name
        +to work out whether the objects are versions or not. Versions' names
        +are created by inserting timestamp between file name and its extension.
        +
            9 file.txt
        +    8 file-v2023-07-17-161032-000.txt
        +   16 file-v2023-06-15-141003-000.txt
        +
        If there are real files present with the same names as versions, then
        +behaviour of `--b2-versions` can be unpredictable.
        +
        +### Data usage
        +
        +It is useful to know how many requests are sent to the server in different scenarios.
        +
        +All copy commands send the following 4 requests:
        +
        +

        /b2api/v1/b2_authorize_account /b2api/v1/b2_create_bucket /b2api/v1/b2_list_buckets /b2api/v1/b2_list_file_names

        +
        
        +The `b2_list_file_names` request will be sent once for every 1k files
        +in the remote path, providing the checksum and modification time of
        +the listed files. As of version 1.33 issue
        +[#818](https://github.com/rclone/rclone/issues/818) causes extra requests
        +to be sent when using B2 with Crypt. When a copy operation does not
        +require any files to be uploaded, no more requests will be sent.
        +
        +Uploading files that do not require chunking, will send 2 requests per
        +file upload:
        +
        +

        /b2api/v1/b2_get_upload_url /b2api/v1/b2_upload_file/

        +
        
        +Uploading files requiring chunking, will send 2 requests (one each to
        +start and finish the upload) and another 2 requests for each chunk:
        +
        +

        /b2api/v1/b2_start_large_file /b2api/v1/b2_get_upload_part_url /b2api/v1/b2_upload_part/ /b2api/v1/b2_finish_large_file

        +
        
        +#### Versions
        +
        +Versions can be viewed with the `--b2-versions` flag. When it is set
        +rclone will show and act on older versions of files.  For example
        +
        +Listing without `--b2-versions`
        +
        +

        $ rclone -q ls b2:cleanup-test 9 one.txt

        +
        
        +And with
        +
        +

        $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 one-v2016-07-02-155621-000.txt

        +
        
        +Showing that the current version is unchanged but older versions can
        +be seen.  These have the UTC date that they were uploaded to the
        +server to the nearest millisecond appended to them.
        +
        +Note that when using `--b2-versions` no file write operations are
        +permitted, so you can't upload files or delete them.
        +
        +### B2 and rclone link
        +
        +Rclone supports generating file share links for private B2 buckets.
        +They can either be for a file for example:
        +
        +

        ./rclone link B2:bucket/path/to/file.txt https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx

        +
        
        +or if run on a directory you will get:
        +
        +

        ./rclone link B2:bucket/path https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx

        +
        
        +you can then use the authorization token (the part of the url from the
        + `?Authorization=` on) on any file path under that directory. For example:
        +
        +

        https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx

        +
        
        +
        +### Standard options
        +
        +Here are the Standard options specific to b2 (Backblaze B2).
        +
        +#### --b2-account
        +
        +Account ID or Application Key ID.
        +
        +Properties:
        +
        +- Config:      account
        +- Env Var:     RCLONE_B2_ACCOUNT
        +- Type:        string
        +- Required:    true
        +
        +#### --b2-key
        +
        +Application Key.
        +
        +Properties:
        +
        +- Config:      key
        +- Env Var:     RCLONE_B2_KEY
        +- Type:        string
        +- Required:    true
        +
        +#### --b2-hard-delete
        +
        +Permanently delete files on remote removal, otherwise hide files.
        +
        +Properties:
        +
        +- Config:      hard_delete
        +- Env Var:     RCLONE_B2_HARD_DELETE
        +- Type:        bool
        +- Default:     false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to b2 (Backblaze B2).
        +
        +#### --b2-endpoint
        +
        +Endpoint for the service.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_B2_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --b2-test-mode
        +
        +A flag string for X-Bz-Test-Mode header for debugging.
        +
        +This is for debugging purposes only. Setting it to one of the strings
        +below will cause b2 to return specific errors:
        +
        +  * "fail_some_uploads"
        +  * "expire_some_account_authorization_tokens"
        +  * "force_cap_exceeded"
        +
        +These will be set in the "X-Bz-Test-Mode" header which is documented
        +in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html).
        +
        +Properties:
        +
        +- Config:      test_mode
        +- Env Var:     RCLONE_B2_TEST_MODE
        +- Type:        string
        +- Required:    false
        +
        +#### --b2-versions
        +
        +Include old versions in directory listings.
        +
        +Note that when using this no file write operations are permitted,
        +so you can't upload files or delete them.
        +
        +Properties:
        +
        +- Config:      versions
        +- Env Var:     RCLONE_B2_VERSIONS
        +- Type:        bool
        +- Default:     false
        +
        +#### --b2-version-at
        +
        +Show file versions as they were at the specified time.
        +
        +Note that when using this no file write operations are permitted,
        +so you can't upload files or delete them.
        +
        +Properties:
        +
        +- Config:      version_at
        +- Env Var:     RCLONE_B2_VERSION_AT
        +- Type:        Time
        +- Default:     off
        +
        +#### --b2-upload-cutoff
        +
        +Cutoff for switching to chunked upload.
        +
        +Files above this size will be uploaded in chunks of "--b2-chunk-size".
        +
        +This value should be set no larger than 4.657 GiB (== 5 GB).
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_B2_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     200Mi
        +
        +#### --b2-copy-cutoff
        +
        +Cutoff for switching to multipart copy.
        +
        +Any files larger than this that need to be server-side copied will be
        +copied in chunks of this size.
        +
        +The minimum is 0 and the maximum is 4.6 GiB.
        +
        +Properties:
        +
        +- Config:      copy_cutoff
        +- Env Var:     RCLONE_B2_COPY_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     4Gi
        +
        +#### --b2-chunk-size
        +
        +Upload chunk size.
        +
        +When uploading large files, chunk the file into this size.
        +
        +Must fit in memory. These chunks are buffered in memory and there
        +might a maximum of "--transfers" chunks in progress at once.
        +
        +5,000,000 Bytes is the minimum size.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_B2_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     96Mi
        +
        +#### --b2-upload-concurrency
        +
        +Concurrency for multipart uploads.
        +
        +This is the number of chunks of the same file that are uploaded
        +concurrently.
        +
        +Note that chunks are stored in memory and there may be up to
        +"--transfers" * "--b2-upload-concurrency" chunks stored at once
        +in memory.
        +
        +Properties:
        +
        +- Config:      upload_concurrency
        +- Env Var:     RCLONE_B2_UPLOAD_CONCURRENCY
        +- Type:        int
        +- Default:     4
        +
        +#### --b2-disable-checksum
        +
        +Disable checksums for large (> upload cutoff) files.
        +
        +Normally rclone will calculate the SHA1 checksum of the input before
        +uploading it so it can add it to metadata on the object. This is great
        +for data integrity checking but can cause long delays for large files
        +to start uploading.
        +
        +Properties:
        +
        +- Config:      disable_checksum
        +- Env Var:     RCLONE_B2_DISABLE_CHECKSUM
        +- Type:        bool
        +- Default:     false
        +
        +#### --b2-download-url
        +
        +Custom endpoint for downloads.
        +
        +This is usually set to a Cloudflare CDN URL as Backblaze offers
        +free egress for data downloaded through the Cloudflare network.
        +Rclone works with private buckets by sending an "Authorization" header.
        +If the custom endpoint rewrites the requests for authentication,
        +e.g., in Cloudflare Workers, this header needs to be handled properly.
        +Leave blank if you want to use the endpoint provided by Backblaze.
        +
        +The URL provided here SHOULD have the protocol and SHOULD NOT have
        +a trailing slash or specify the /file/bucket subpath as rclone will
        +request files with "{download_url}/file/{bucket_name}/{path}".
        +
        +Example:
        +> https://mysubdomain.mydomain.tld
        +(No trailing "/", "file" or "bucket")
        +
        +Properties:
        +
        +- Config:      download_url
        +- Env Var:     RCLONE_B2_DOWNLOAD_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --b2-download-auth-duration
        +
        +Time before the authorization token will expire in s or suffix ms|s|m|h|d.
        +
        +The duration before the download authorization token will expire.
        +The minimum value is 1 second. The maximum value is one week.
        +
        +Properties:
        +
        +- Config:      download_auth_duration
        +- Env Var:     RCLONE_B2_DOWNLOAD_AUTH_DURATION
        +- Type:        Duration
        +- Default:     1w
        +
        +#### --b2-memory-pool-flush-time
        +
        +How often internal memory buffer pools will be flushed. (no longer used)
        +
        +Properties:
        +
        +- Config:      memory_pool_flush_time
        +- Env Var:     RCLONE_B2_MEMORY_POOL_FLUSH_TIME
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --b2-memory-pool-use-mmap
        +
        +Whether to use mmap buffers in internal memory pool. (no longer used)
        +
        +Properties:
        +
        +- Config:      memory_pool_use_mmap
        +- Env Var:     RCLONE_B2_MEMORY_POOL_USE_MMAP
        +- Type:        bool
        +- Default:     false
        +
        +#### --b2-lifecycle
        +
        +Set the number of days deleted files should be kept when creating a bucket.
        +
        +On bucket creation, this parameter is used to create a lifecycle rule
        +for the entire bucket.
        +
        +If lifecycle is 0 (the default) it does not create a lifecycle rule so
        +the default B2 behaviour applies. This is to create versions of files
        +on delete and overwrite and to keep them indefinitely.
        +
        +If lifecycle is >0 then it creates a single rule setting the number of
        +days before a file that is deleted or overwritten is deleted
        +permanently. This is known as daysFromHidingToDeleting in the b2 docs.
        +
        +The minimum value for this parameter is 1 day.
        +
        +You can also enable hard_delete in the config also which will mean
        +deletions won't cause versions but overwrites will still cause
        +versions to be made.
        +
        +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation.
        +
        +
        +Properties:
        +
        +- Config:      lifecycle
        +- Env Var:     RCLONE_B2_LIFECYCLE
        +- Type:        int
        +- Default:     0
        +
        +#### --b2-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_B2_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        +
        +## Backend commands
        +
        +Here are the commands specific to the b2 backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### lifecycle
        +
        +Read or set the lifecycle for a bucket
        +
        +    rclone backend lifecycle remote: [options] [<arguments>+]
        +
        +This command can be used to read or set the lifecycle for a bucket.
        +
        +Usage Examples:
        +
        +To show the current lifecycle rules:
        +
        +    rclone backend lifecycle b2:bucket
        +
        +This will dump something like this showing the lifecycle rules.
        +
        +    [
        +        {
        +            "daysFromHidingToDeleting": 1,
        +            "daysFromUploadingToHiding": null,
        +            "fileNamePrefix": ""
        +        }
        +    ]
        +
        +If there are no lifecycle rules (the default) then it will just return [].
        +
        +To reset the current lifecycle rules:
        +
        +    rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30
        +    rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1
        +
        +This will run and then print the new lifecycle rules as above.
        +
        +Rclone only lets you set lifecycles for the whole bucket with the
        +fileNamePrefix = "".
        +
        +You can't disable versioning with B2. The best you can do is to set
        +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in
        +the config also which will mean deletions won't cause versions but
        +overwrites will still cause versions to be made.
        +
        +    rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1
        +
        +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules
        +
        +
        +Options:
        +
        +- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off.
        +- "daysFromUploadingToHiding": This many days after uploading a file is hidden
        +
        +
        +
        +## Limitations
        +
        +`rclone about` is not supported by the B2 backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +#  Box
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +The initial setup for Box involves getting a token from Box which you
        +can do either in your browser, or with a config.json downloaded from Box
        +to use JWT authentication.  `rclone config` walks you through it.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Box  "box" [snip] Storage> box Box App Client Id - leave blank normally. client_id> Box App Client Secret - leave blank normally. client_secret> Box App config.json location Leave blank normally. Enter a string value. Press Enter for the default (""). box_config_file> Box App Primary Access Token Leave blank normally. Enter a string value. Press Enter for the default (""). access_token>

        +

        Enter a string value. Press Enter for the default ("user"). Choose a number from below, or type in your own value 1 / Rclone should act on behalf of a user  "user" 2 / Rclone should act on behalf of a service account  "enterprise" box_sub_type> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] client_id = client_secret = token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from Box. This only runs from the moment it opens
        +your browser to the moment you get back the verification code.  This
        +is on `http://127.0.0.1:53682/` and this it may require you to unblock
        +it temporarily if you are running a host firewall.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Box
        +
        +    rclone lsd remote:
        +
        +List all the files in your Box
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an Box directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Using rclone with an Enterprise account with SSO
        +
        +If you have an "Enterprise" account type with Box with single sign on
        +(SSO), you need to create a password to use Box with rclone. This can
        +be done at your Enterprise Box account by going to Settings, "Account"
        +Tab, and then set the password in the "Authentication" field.
        +
        +Once you have done this, you can setup your Enterprise Box account
        +using the same procedure detailed above in the, using the password you
        +have just set.
        +
        +### Invalid refresh token
        +
        +According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens):
        +
        +> Each refresh_token is valid for one use in 60 days.
        +
        +This means that if you
        +
        +  * Don't use the box remote for 60 days
        +  * Copy the config file with a box refresh token in and use it in two places
        +  * Get an error on a token refresh
        +
        +then rclone will return an error which includes the text `Invalid
        +refresh token`.
        +
        +To fix this you will need to use oauth2 again to update the refresh
        +token.  You can use the methods in [the remote setup
        +docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the
        +config file method, you should not use that remote on the computer you
        +did the authentication on.
        +
        +Here is how to do it.
        +
        +

        $ rclone config Current remotes:

        +

        Name Type ==== ==== remote box

        +
          +
        1. Edit existing remote
        2. +
        3. New remote
        4. +
        5. Delete remote
        6. +
        7. Rename remote
        8. +
        9. Copy remote
        10. +
        11. Set configuration password
        12. +
        13. Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in an existing value 1 > remote remote> remote -------------------- [remote] type = box token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} -------------------- Edit remote Value "client_id" = "" Edit? (y/n)>
        14. +
        15. Yes
        16. +
        17. No y/n> n Value "client_secret" = "" Edit? (y/n)>
        18. +
        19. Yes
        20. +
        21. No y/n> n Remote config Already have a token - refresh?
        22. +
        23. Yes
        24. +
        25. No y/n> y Use web browser to automatically authenticate rclone with remote?
        26. +
          -
        • Config: api_password
        • -
        • Env Var: RCLONE_SIA_API_PASSWORD
        • -
        • Type: string
        • -
        • Required: false
        • +
        • Say Y if the machine running rclone has a web browser you can use
        • +
        • Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
        -

        Advanced options

        -

        Here are the Advanced options specific to sia (Sia Decentralized Cloud).

        -

        --sia-user-agent

        -

        Siad User Agent

        -

        Sia daemon requires the 'Sia-Agent' user agent by default for security

        -

        Properties:

        +
          +
        1. Yes
        2. +
        3. No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = box token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} --------------------
        4. +
        5. Yes this is OK
        6. +
        7. Edit this remote
        8. +
        9. Delete this remote y/e/d> y
        10. +
        +
        
        +### Modification times and hashes
        +
        +Box allows modification times to be set on objects accurate to 1
        +second.  These will be used to detect whether objects need syncing or
        +not.
        +
        +Box supports SHA1 type hashes, so you can use the `--checksum`
        +flag.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \         | 0x5C  | \           |
        +
        +File names can also not end with the following characters.
        +These only get replaced if they are the last character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Transfers
        +
        +For files above 50 MiB rclone will use a chunked transfer.  Rclone will
        +upload up to `--transfers` chunks at the same time (shared among all
        +the multipart uploads).  Chunks are buffered in memory and are
        +normally 8 MiB so increasing `--transfers` will increase memory use.
        +
        +### Deleting files
        +
        +Depending on the enterprise settings for your user, the item will
        +either be actually deleted from Box or moved to the trash.
        +
        +Emptying the trash is supported via the rclone however cleanup command
        +however this deletes every trashed file and folder individually so it
        +may take a very long time. 
        +Emptying the trash via the  WebUI does not have this limitation 
        +so it is advised to empty the trash via the WebUI.
        +
        +### Root folder ID
        +
        +You can set the `root_folder_id` for rclone.  This is the directory
        +(identified by its `Folder ID`) that rclone considers to be the root
        +of your Box drive.
        +
        +Normally you will leave this blank and rclone will determine the
        +correct root to use itself.
        +
        +However you can set this to restrict rclone to a specific folder
        +hierarchy.
        +
        +In order to do this you will have to find the `Folder ID` of the
        +directory you wish rclone to display.  This will be the last segment
        +of the URL when you open the relevant folder in the Box web
        +interface.
        +
        +So if the folder you want rclone to use has a URL which looks like
        +`https://app.box.com/folder/11xxxxxxxxx8`
        +in the browser, then you use `11xxxxxxxxx8` as
        +the `root_folder_id` in the config.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to box (Box).
        +
        +#### --box-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_BOX_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --box-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_BOX_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --box-box-config-file
        +
        +Box App config.json location
        +
        +Leave blank normally.
        +
        +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
        +
        +Properties:
        +
        +- Config:      box_config_file
        +- Env Var:     RCLONE_BOX_BOX_CONFIG_FILE
        +- Type:        string
        +- Required:    false
        +
        +#### --box-access-token
        +
        +Box App Primary Access Token
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      access_token
        +- Env Var:     RCLONE_BOX_ACCESS_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --box-box-sub-type
        +
        +
        +
        +Properties:
        +
        +- Config:      box_sub_type
        +- Env Var:     RCLONE_BOX_BOX_SUB_TYPE
        +- Type:        string
        +- Default:     "user"
        +- Examples:
        +    - "user"
        +        - Rclone should act on behalf of a user.
        +    - "enterprise"
        +        - Rclone should act on behalf of a service account.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to box (Box).
        +
        +#### --box-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_BOX_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --box-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_BOX_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --box-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_BOX_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --box-root-folder-id
        +
        +Fill in for rclone to use a non root folder as its starting point.
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_BOX_ROOT_FOLDER_ID
        +- Type:        string
        +- Default:     "0"
        +
        +#### --box-upload-cutoff
        +
        +Cutoff for switching to multipart upload (>= 50 MiB).
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_BOX_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     50Mi
        +
        +#### --box-commit-retries
        +
        +Max number of times to try committing a multipart file.
        +
        +Properties:
        +
        +- Config:      commit_retries
        +- Env Var:     RCLONE_BOX_COMMIT_RETRIES
        +- Type:        int
        +- Default:     100
        +
        +#### --box-list-chunk
        +
        +Size of listing chunk 1-1000.
        +
        +Properties:
        +
        +- Config:      list_chunk
        +- Env Var:     RCLONE_BOX_LIST_CHUNK
        +- Type:        int
        +- Default:     1000
        +
        +#### --box-owned-by
        +
        +Only show items owned by the login (email address) passed in.
        +
        +Properties:
        +
        +- Config:      owned_by
        +- Env Var:     RCLONE_BOX_OWNED_BY
        +- Type:        string
        +- Required:    false
        +
        +#### --box-impersonate
        +
        +Impersonate this user ID when using a service account.
        +
        +Setting this flag allows rclone, when using a JWT service account, to
        +act on behalf of another user by setting the as-user header.
        +
        +The user ID is the Box identifier for a user. User IDs can found for
        +any user via the GET /users endpoint, which is only available to
        +admins, or by calling the GET /users/me endpoint with an authenticated
        +user session.
        +
        +See: https://developer.box.com/guides/authentication/jwt/as-user/
        +
        +
        +Properties:
        +
        +- Config:      impersonate
        +- Env Var:     RCLONE_BOX_IMPERSONATE
        +- Type:        string
        +- Required:    false
        +
        +#### --box-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_BOX_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +Note that Box is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +Box file names can't have the `\` character in.  rclone maps this to
        +and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth
        +Reverse Solidus).
        +
        +Box only supports filenames up to 255 characters in length.
        +
        +Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone.
        +
        +`rclone about` is not supported by the Box backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +## Get your own Box App ID
        +
        +Here is how to create your own Box App ID for rclone:
        +
        +1. Go to the [Box Developer Console](https://app.box.com/developers/console)
        +and login, then click `My Apps` on the sidebar. Click `Create New App`
        +and select `Custom App`.
        +
        +2. In the first screen on the box that pops up, you can pretty much enter
        +whatever you want. The `App Name` can be whatever. For `Purpose` choose
        +automation to avoid having to fill out anything else. Click `Next`.
        +
        +3. In the second screen of the creation screen, select
        +`User Authentication (OAuth 2.0)`. Then click `Create App`.
        +
        +4. You should now be on the `Configuration` tab of your new app. If not,
        +click on it at the top of the webpage. Copy down `Client ID`
        +and `Client Secret`, you'll need those for rclone.
        +
        +5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/`
        +
        +6. For `Application Scopes`, select `Read all files and folders stored in Box`
        +and `Write all files and folders stored in box` (assuming you want to do both).
        +Leave others unchecked. Click `Save Changes` at the top right.
        +
        +#  Cache
        +
        +The `cache` remote wraps another existing remote and stores file structure
        +and its data for long running tasks like `rclone mount`.
        +
        +## Status
        +
        +The cache backend code is working but it currently doesn't
        +have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed.
        +
        +The cache backend is due to be phased out in favour of the VFS caching
        +layer eventually which is more tightly integrated into rclone.
        +
        +Until this happens we recommend only using the cache backend if you
        +find you can't work without it. There are many docs online describing
        +the use of the cache backend to minimize API hits and by-and-large
        +these are out of date and the cache backend isn't needed in those
        +scenarios any more.
        +
        +## Configuration
        +
        +To get started you just need to have an existing remote which can be configured
        +with `cache`.
        +
        +Here is an example of how to make a remote called `test-cache`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> test-cache Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Cache a remote  "cache" [snip] Storage> cache Remote to cache. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). remote> local:/test Optional: The URL of the Plex server plex_url> http://127.0.0.1:32400 Optional: The username of the Plex user plex_username> dummyusername Optional: The password of the Plex user y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: The size of a chunk. Lower value good for slow connections but can affect seamless reading. Default: 5M Choose a number from below, or type in your own value 1 / 1 MiB  "1M" 2 / 5 MiB  "5M" 3 / 10 MiB  "10M" chunk_size> 2 How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. Accepted units are: "s", "m", "h". Default: 5m Choose a number from below, or type in your own value 1 / 1 hour  "1h" 2 / 24 hours  "24h" 3 / 24 hours  "48h" info_age> 2 The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. Default: 10G Choose a number from below, or type in your own value 1 / 500 MiB  "500M" 2 / 1 GiB  "1G" 3 / 10 GiB  "10G" chunk_total_size> 3 Remote config -------------------- [test-cache] remote = local:/test plex_url = http://127.0.0.1:32400 plex_username = dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age = 48h chunk_total_size = 10G

        +
        
        +You can then use it like this,
        +
        +List directories in top level of your drive
        +
        +    rclone lsd test-cache:
        +
        +List all the files in your drive
        +
        +    rclone ls test-cache:
        +
        +To start a cached mount
        +
        +    rclone mount --allow-other test-cache: /var/tmp/test-cache
        +
        +### Write Features ###
        +
        +### Offline uploading ###
        +
        +In an effort to make writing through cache more reliable, the backend 
        +now supports this feature which can be activated by specifying a
        +`cache-tmp-upload-path`.
        +
        +A files goes through these states when using this feature:
        +
        +1. An upload is started (usually by copying a file on the cache remote)
        +2. When the copy to the temporary location is complete the file is part 
        +of the cached remote and looks and behaves like any other file (reading included)
        +3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` 
        +is used to move the file to the cloud provider
        +4. Reading the file still works during the upload but most modifications on it will be prohibited
        +5. Once the move is complete the file is unlocked for modifications as it
        +becomes as any other regular file
        +6. If the file is being read through `cache` when it's actually
        +deleted from the temporary path then `cache` will simply swap the source
        +to the cloud provider without interrupting the reading (small blip can happen though)
        +
        +Files are uploaded in sequence and only one file is uploaded at a time.
        +Uploads will be stored in a queue and be processed based on the order they were added.
        +The queue and the temporary storage is persistent across restarts but
        +can be cleared on startup with the `--cache-db-purge` flag.
        +
        +### Write Support ###
        +
        +Writes are supported through `cache`.
        +One caveat is that a mounted cache remote does not add any retry or fallback
        +mechanism to the upload operation. This will depend on the implementation
        +of the wrapped remote. Consider using `Offline uploading` for reliable writes.
        +
        +One special case is covered with `cache-writes` which will cache the file
        +data at the same time as the upload when it is enabled making it available
        +from the cache store immediately once the upload is finished.
        +
        +### Read Features ###
        +
        +#### Multiple connections ####
        +
        +To counter the high latency between a local PC where rclone is running
        +and cloud providers, the cache remote can split multiple requests to the
        +cloud provider for smaller file chunks and combines them together locally
        +where they can be available almost immediately before the reader usually
        +needs them.
        +
        +This is similar to buffering when media files are played online. Rclone
        +will stay around the current marker but always try its best to stay ahead
        +and prepare the data before.
        +
        +#### Plex Integration ####
        +
        +There is a direct integration with Plex which allows cache to detect during reading
        +if the file is in playback or not. This helps cache to adapt how it queries
        +the cloud provider depending on what is needed for.
        +
        +Scans will have a minimum amount of workers (1) while in a confirmed playback cache
        +will deploy the configured number of workers.
        +
        +This integration opens the doorway to additional performance improvements
        +which will be explored in the near future.
        +
        +**Note:** If Plex options are not configured, `cache` will function with its
        +configured options without adapting any of its settings.
        +
        +How to enable? Run `rclone config` and add all the Plex options (endpoint, username
        +and password) in your remote and it will be automatically enabled.
        +
        +Affected settings:
        +- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times
        +
        +##### Certificate Validation #####
        +
        +When the Plex server is configured to only accept secure connections, it is
        +possible to use `.plex.direct` URLs to ensure certificate validation succeeds.
        +These URLs are used by Plex internally to connect to the Plex server securely.
        +
        +The format for these URLs is the following:
        +
        +`https://ip-with-dots-replaced.server-hash.plex.direct:32400/`
        +
        +The `ip-with-dots-replaced` part can be any IPv4 address, where the dots
        +have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`.
        +
        +To get the `server-hash` part, the easiest way is to visit
        +
        +https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token
        +
        +This page will list all the available Plex servers for your account
        +with at least one `.plex.direct` link for each. Copy one URL and replace
        +the IP address with the desired address. This can be used as the
        +`plex_url` value.
        +
        +### Known issues ###
        +
        +#### Mount and --dir-cache-time ####
        +
        +--dir-cache-time controls the first layer of directory caching which works at the mount layer.
        +Being an independent caching mechanism from the `cache` backend, it will manage its own entries
        +based on the configured time.
        +
        +To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct
        +one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are
        +already configured in this way. 
        +
        +#### Windows support - Experimental ####
        +
        +There are a couple of issues with Windows `mount` functionality that still require some investigations.
        +It should be considered as experimental thus far as fixes come in for this OS.
        +
        +Most of the issues seem to be related to the difference between filesystems
        +on Linux flavors and Windows as cache is heavily dependent on them.
        +
        +Any reports or feedback on how cache behaves on this OS is greatly appreciated.
        + 
        +- https://github.com/rclone/rclone/issues/1935
        +- https://github.com/rclone/rclone/issues/1907
        +- https://github.com/rclone/rclone/issues/1834 
        +
        +#### Risk of throttling ####
        +
        +Future iterations of the cache backend will make use of the pooling functionality
        +of the cloud provider to synchronize and at the same time make writing through it
        +more tolerant to failures. 
        +
        +There are a couple of enhancements in track to add these but in the meantime
        +there is a valid concern that the expiring cache listings can lead to cloud provider
        +throttles or bans due to repeated queries on it for very large mounts.
        +
        +Some recommendations:
        +- don't use a very small interval for entry information (`--cache-info-age`)
        +- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage
        +of adding the file in the cache at the same time if configured to do so.
        +
        +Future enhancements:
        +
        +- https://github.com/rclone/rclone/issues/1937
        +- https://github.com/rclone/rclone/issues/1936 
        +
        +#### cache and crypt ####
        +
        +One common scenario is to keep your data encrypted in the cloud provider
        +using the `crypt` remote. `crypt` uses a similar technique to wrap around
        +an existing remote and handles this translation in a seamless way.
        +
        +There is an issue with wrapping the remotes in this order:
        +**cloud remote** -> **crypt** -> **cache**
        +
        +During testing, I experienced a lot of bans with the remotes in this order.
        +I suspect it might be related to how crypt opens files on the cloud provider
        +which makes it think we're downloading the full file instead of small chunks.
        +Organizing the remotes in this order yields better results:
        +**cloud remote** -> **cache** -> **crypt**
        +
        +#### absolute remote paths ####
        +
        +`cache` can not differentiate between relative and absolute paths for the wrapped remote.
        +Any path given in the `remote` config setting and on the command line will be passed to
        +the wrapped remote as is, but for storing the chunks on disk the path will be made
        +relative by removing any leading `/` character.
        +
        +This behavior is irrelevant for most backend types, but there are backends where a leading `/`
        +changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are
        +relative to the root of the SSH server and paths without are relative to the user home directory.
        +As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent
        +a different directory on the SSH server.
        +
        +### Cache and Remote Control (--rc) ###
        +Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points:
        +By default, the listener is disabled if you do not add the flag.
        +
        +### rc cache/expire
        +Purge a remote from the cache backend. Supports either a directory or a file.
        +It supports both encrypted and unencrypted file names if cache is wrapped by crypt.
        +
        +Params:
        +  - **remote** = path to remote **(required)**
        +  - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to cache (Cache a remote).
        +
        +#### --cache-remote
        +
        +Remote to cache.
        +
        +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
        +"myremote:bucket" or maybe "myremote:" (not recommended).
        +
        +Properties:
        +
        +- Config:      remote
        +- Env Var:     RCLONE_CACHE_REMOTE
        +- Type:        string
        +- Required:    true
        +
        +#### --cache-plex-url
        +
        +The URL of the Plex server.
        +
        +Properties:
        +
        +- Config:      plex_url
        +- Env Var:     RCLONE_CACHE_PLEX_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --cache-plex-username
        +
        +The username of the Plex user.
        +
        +Properties:
        +
        +- Config:      plex_username
        +- Env Var:     RCLONE_CACHE_PLEX_USERNAME
        +- Type:        string
        +- Required:    false
        +
        +#### --cache-plex-password
        +
        +The password of the Plex user.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      plex_password
        +- Env Var:     RCLONE_CACHE_PLEX_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +#### --cache-chunk-size
        +
        +The size of a chunk (partial file data).
        +
        +Use lower numbers for slower connections. If the chunk size is
        +changed, any downloaded chunks will be invalid and cache-chunk-path
        +will need to be cleared or unexpected EOF errors will occur.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_CACHE_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     5Mi
        +- Examples:
        +    - "1M"
        +        - 1 MiB
        +    - "5M"
        +        - 5 MiB
        +    - "10M"
        +        - 10 MiB
        +
        +#### --cache-info-age
        +
        +How long to cache file structure information (directory listings, file size, times, etc.). 
        +If all write operations are done through the cache then you can safely make
        +this value very large as the cache store will also be updated in real time.
        +
        +Properties:
        +
        +- Config:      info_age
        +- Env Var:     RCLONE_CACHE_INFO_AGE
        +- Type:        Duration
        +- Default:     6h0m0s
        +- Examples:
        +    - "1h"
        +        - 1 hour
        +    - "24h"
        +        - 24 hours
        +    - "48h"
        +        - 48 hours
        +
        +#### --cache-chunk-total-size
        +
        +The total size that the chunks can take up on the local disk.
        +
        +If the cache exceeds this value then it will start to delete the
        +oldest chunks until it goes under this value.
        +
        +Properties:
        +
        +- Config:      chunk_total_size
        +- Env Var:     RCLONE_CACHE_CHUNK_TOTAL_SIZE
        +- Type:        SizeSuffix
        +- Default:     10Gi
        +- Examples:
        +    - "500M"
        +        - 500 MiB
        +    - "1G"
        +        - 1 GiB
        +    - "10G"
        +        - 10 GiB
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to cache (Cache a remote).
        +
        +#### --cache-plex-token
        +
        +The plex token for authentication - auto set normally.
        +
        +Properties:
        +
        +- Config:      plex_token
        +- Env Var:     RCLONE_CACHE_PLEX_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --cache-plex-insecure
        +
        +Skip all certificate verification when connecting to the Plex server.
        +
        +Properties:
        +
        +- Config:      plex_insecure
        +- Env Var:     RCLONE_CACHE_PLEX_INSECURE
        +- Type:        string
        +- Required:    false
        +
        +#### --cache-db-path
        +
        +Directory to store file structure metadata DB.
        +
        +The remote name is used as the DB file name.
        +
        +Properties:
        +
        +- Config:      db_path
        +- Env Var:     RCLONE_CACHE_DB_PATH
        +- Type:        string
        +- Default:     "$HOME/.cache/rclone/cache-backend"
        +
        +#### --cache-chunk-path
        +
        +Directory to cache chunk files.
        +
        +Path to where partial file data (chunks) are stored locally. The remote
        +name is appended to the final path.
        +
        +This config follows the "--cache-db-path". If you specify a custom
        +location for "--cache-db-path" and don't specify one for "--cache-chunk-path"
        +then "--cache-chunk-path" will use the same path as "--cache-db-path".
        +
        +Properties:
        +
        +- Config:      chunk_path
        +- Env Var:     RCLONE_CACHE_CHUNK_PATH
        +- Type:        string
        +- Default:     "$HOME/.cache/rclone/cache-backend"
        +
        +#### --cache-db-purge
        +
        +Clear all the cached data for this remote on start.
        +
        +Properties:
        +
        +- Config:      db_purge
        +- Env Var:     RCLONE_CACHE_DB_PURGE
        +- Type:        bool
        +- Default:     false
        +
        +#### --cache-chunk-clean-interval
        +
        +How often should the cache perform cleanups of the chunk storage.
        +
        +The default value should be ok for most people. If you find that the
        +cache goes over "cache-chunk-total-size" too often then try to lower
        +this value to force it to perform cleanups more often.
        +
        +Properties:
        +
        +- Config:      chunk_clean_interval
        +- Env Var:     RCLONE_CACHE_CHUNK_CLEAN_INTERVAL
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --cache-read-retries
        +
        +How many times to retry a read from a cache storage.
        +
        +Since reading from a cache stream is independent from downloading file
        +data, readers can get to a point where there's no more data in the
        +cache.  Most of the times this can indicate a connectivity issue if
        +cache isn't able to provide file data anymore.
        +
        +For really slow connections, increase this to a point where the stream is
        +able to provide data but your experience will be very stuttering.
        +
        +Properties:
        +
        +- Config:      read_retries
        +- Env Var:     RCLONE_CACHE_READ_RETRIES
        +- Type:        int
        +- Default:     10
        +
        +#### --cache-workers
        +
        +How many workers should run in parallel to download chunks.
        +
        +Higher values will mean more parallel processing (better CPU needed)
        +and more concurrent requests on the cloud provider.  This impacts
        +several aspects like the cloud provider API limits, more stress on the
        +hardware that rclone runs on but it also means that streams will be
        +more fluid and data will be available much more faster to readers.
        +
        +**Note**: If the optional Plex integration is enabled then this
        +setting will adapt to the type of reading performed and the value
        +specified here will be used as a maximum number of workers to use.
        +
        +Properties:
        +
        +- Config:      workers
        +- Env Var:     RCLONE_CACHE_WORKERS
        +- Type:        int
        +- Default:     4
        +
        +#### --cache-chunk-no-memory
        +
        +Disable the in-memory cache for storing chunks during streaming.
        +
        +By default, cache will keep file data during streaming in RAM as well
        +to provide it to readers as fast as possible.
        +
        +This transient data is evicted as soon as it is read and the number of
        +chunks stored doesn't exceed the number of workers. However, depending
        +on other settings like "cache-chunk-size" and "cache-workers" this footprint
        +can increase if there are parallel streams too (multiple files being read
        +at the same time).
        +
        +If the hardware permits it, use this feature to provide an overall better
        +performance during streaming but it can also be disabled if RAM is not
        +available on the local machine.
        +
        +Properties:
        +
        +- Config:      chunk_no_memory
        +- Env Var:     RCLONE_CACHE_CHUNK_NO_MEMORY
        +- Type:        bool
        +- Default:     false
        +
        +#### --cache-rps
        +
        +Limits the number of requests per second to the source FS (-1 to disable).
        +
        +This setting places a hard limit on the number of requests per second
        +that cache will be doing to the cloud provider remote and try to
        +respect that value by setting waits between reads.
        +
        +If you find that you're getting banned or limited on the cloud
        +provider through cache and know that a smaller number of requests per
        +second will allow you to work with it then you can use this setting
        +for that.
        +
        +A good balance of all the other settings should make this setting
        +useless but it is available to set for more special cases.
        +
        +**NOTE**: This will limit the number of requests during streams but
        +other API calls to the cloud provider like directory listings will
        +still pass.
        +
        +Properties:
        +
        +- Config:      rps
        +- Env Var:     RCLONE_CACHE_RPS
        +- Type:        int
        +- Default:     -1
        +
        +#### --cache-writes
        +
        +Cache file data on writes through the FS.
        +
        +If you need to read files immediately after you upload them through
        +cache you can enable this flag to have their data stored in the
        +cache store at the same time during upload.
        +
        +Properties:
        +
        +- Config:      writes
        +- Env Var:     RCLONE_CACHE_WRITES
        +- Type:        bool
        +- Default:     false
        +
        +#### --cache-tmp-upload-path
        +
        +Directory to keep temporary files until they are uploaded.
        +
        +This is the path where cache will use as a temporary storage for new
        +files that need to be uploaded to the cloud provider.
        +
        +Specifying a value will enable this feature. Without it, it is
        +completely disabled and files will be uploaded directly to the cloud
        +provider
        +
        +Properties:
        +
        +- Config:      tmp_upload_path
        +- Env Var:     RCLONE_CACHE_TMP_UPLOAD_PATH
        +- Type:        string
        +- Required:    false
        +
        +#### --cache-tmp-wait-time
        +
        +How long should files be stored in local cache before being uploaded.
        +
        +This is the duration that a file must wait in the temporary location
        +_cache-tmp-upload-path_ before it is selected for upload.
        +
        +Note that only one file is uploaded at a time and it can take longer
        +to start the upload if a queue formed for this purpose.
        +
        +Properties:
        +
        +- Config:      tmp_wait_time
        +- Env Var:     RCLONE_CACHE_TMP_WAIT_TIME
        +- Type:        Duration
        +- Default:     15s
        +
        +#### --cache-db-wait-time
        +
        +How long to wait for the DB to be available - 0 is unlimited.
        +
        +Only one process can have the DB open at any one time, so rclone waits
        +for this duration for the DB to become available before it gives an
        +error.
        +
        +If you set it to 0 then it will wait forever.
        +
        +Properties:
        +
        +- Config:      db_wait_time
        +- Env Var:     RCLONE_CACHE_DB_WAIT_TIME
        +- Type:        Duration
        +- Default:     1s
        +
        +## Backend commands
        +
        +Here are the commands specific to the cache backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### stats
        +
        +Print stats on the cache backend in JSON format.
        +
        +    rclone backend stats remote: [options] [<arguments>+]
        +
        +
        +
        +#  Chunker
        +
        +The `chunker` overlay transparently splits large files into smaller chunks
        +during upload to wrapped remote and transparently assembles them back
        +when the file is downloaded. This allows to effectively overcome size limits
        +imposed by storage providers.
        +
        +## Configuration
        +
        +To use it, first set up the underlying remote following the configuration
        +instructions for that remote. You can also use a local pathname instead of
        +a remote.
        +
        +First check your chosen remote is working - we'll call it `remote:path` here.
        +Note that anything inside `remote:path` will be chunked and anything outside
        +won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift)
        +then you should probably put the bucket in the remote `s3:bucket`.
        +
        +Now configure `chunker` using `rclone config`. We will call this one `overlay`
        +to separate it from the `remote` itself.
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> overlay Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Transparently chunk/split large files  "chunker" [snip] Storage> chunker Remote to chunk/unchunk. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). Enter a string value. Press Enter for the default (""). remote> remote:path Files larger than chunk size will be split in chunks. Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). chunk_size> 100M Choose how chunker handles hash sums. All modes but "none" require metadata. Enter a string value. Press Enter for the default ("md5"). Choose a number from below, or type in your own value 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise  "none" 2 / MD5 for composite files  "md5" 3 / SHA1 for composite files  "sha1" 4 / MD5 for all files  "md5all" 5 / SHA1 for all files  "sha1all" 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported  "md5quick" 7 / Similar to "md5quick" but prefers SHA1 over MD5  "sha1quick" hash_type> md5 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -------------------- [overlay] type = chunker remote = remote:bucket chunk_size = 100M hash_type = md5 -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### Specifying the remote
        +
        +In normal use, make sure the remote has a `:` in. If you specify the remote
        +without a `:` then rclone will use a local directory of that name.
        +So if you use a remote of `/path/to/secret/files` then rclone will
        +chunk stuff in that directory. If you use a remote of `name` then rclone
        +will put files in a directory called `name` in the current directory.
        +
        +
        +### Chunking
        +
        +When rclone starts a file upload, chunker checks the file size. If it
        +doesn't exceed the configured chunk size, chunker will just pass the file
        +to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut
        +data in pieces with temporary names and stream them one by one, on the fly.
        +Each data chunk will contain the specified number of bytes, except for the
        +last one which may have less data. If file size is unknown in advance
        +(this is called a streaming upload), chunker will internally create
        +a temporary copy, record its size and repeat the above process.
        +
        +When upload completes, temporary chunk files are finally renamed.
        +This scheme guarantees that operations can be run in parallel and look
        +from outside as atomic.
        +A similar method with hidden temporary chunks is used for other operations
        +(copy/move/rename, etc.). If an operation fails, hidden chunks are normally
        +destroyed, and the target composite file stays intact.
        +
        +When a composite file download is requested, chunker transparently
        +assembles it by concatenating data chunks in order. As the split is trivial
        +one could even manually concatenate data chunks together to obtain the
        +original content.
        +
        +When the `list` rclone command scans a directory on wrapped remote,
        +the potential chunk files are accounted for, grouped and assembled into
        +composite directory entries. Any temporary chunks are hidden.
        +
        +List and other commands can sometimes come across composite files with
        +missing or invalid chunks, e.g. shadowed by like-named directory or
        +another file. This usually means that wrapped file system has been directly
        +tampered with or damaged. If chunker detects a missing chunk it will
        +by default print warning, skip the whole incomplete group of chunks but
        +proceed with current command.
        +You can set the `--chunker-fail-hard` flag to have commands abort with
        +error message in such cases.
        +
        +**Caveat**: As it is now, chunker will always create a temporary file in the 
        +backend and then rename it, even if the file is below the chunk threshold.
        +This will result in unnecessary API calls and can severely restrict throughput
        +when handling transfers primarily composed of small files on some backends (e.g. Box).
        +A workaround to this issue is to use chunker only for files above the chunk threshold
        +via `--min-size` and then perform a separate call without chunker on the remaining
        +files. 
        +
        +
        +#### Chunk names
        +
        +The default chunk name format is `*.rclone_chunk.###`, hence by default
        +chunk names are `BIG_FILE_NAME.rclone_chunk.001`,
        +`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format
        +using the `name_format` configuration file option. The format uses asterisk
        +`*` as a placeholder for the base file name and one or more consecutive
        +hash characters `#` as a placeholder for sequential chunk number.
        +There must be one and only one asterisk. The number of consecutive hash
        +characters defines the minimum length of a string representing a chunk number.
        +If decimal chunk number has less digits than the number of hashes, it is
        +left-padded by zeros. If the decimal string is longer, it is left intact.
        +By default numbering starts from 1 but there is another option that allows
        +user to start from 0, e.g. for compatibility with legacy software.
        +
        +For example, if name format is `big_*-##.part` and original file name is
        +`data.txt` and numbering starts from 0, then the first chunk will be named
        +`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part`
        +and the 302nd chunk will become `big_data.txt-301.part`.
        +
        +Note that `list` assembles composite directory entries only when chunk names
        +match the configured format and treats non-conforming file names as normal
        +non-chunked files.
        +
        +When using `norename` transactions, chunk names will additionally have a unique
        +file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`.
        +
        +
        +### Metadata
        +
        +Besides data chunks chunker will by default create metadata object for
        +a composite file. The object is named after the original file.
        +Chunker allows user to disable metadata completely (the `none` format).
        +Note that metadata is normally not created for files smaller than the
        +configured chunk size. This may change in future rclone releases.
        +
        +#### Simple JSON metadata format
        +
        +This is the default format. It supports hash sums and chunk validation
        +for composite files. Meta objects carry the following fields:
        +
        +- `ver`     - version of format, currently `1`
        +- `size`    - total size of composite file
        +- `nchunks` - number of data chunks in file
        +- `md5`     - MD5 hashsum of composite file (if present)
        +- `sha1`    - SHA1 hashsum (if present)
        +- `txn`     - identifies current version of the file
        +
        +There is no field for composite file name as it's simply equal to the name
        +of meta object on the wrapped remote. Please refer to respective sections
        +for details on hashsums and modified time handling.
        +
        +#### No metadata
        +
        +You can disable meta objects by setting the meta format option to `none`.
        +In this mode chunker will scan directory for all files that follow
        +configured chunk name format, group them by detecting chunks with the same
        +base name and show group names as virtual composite files.
        +This method is more prone to missing chunk errors (especially missing
        +last chunk) than format with metadata enabled.
        +
        +
        +### Hashsums
        +
        +Chunker supports hashsums only when a compatible metadata is present.
        +Hence, if you choose metadata format of `none`, chunker will report hashsum
        +as `UNSUPPORTED`.
        +
        +Please note that by default metadata is stored only for composite files.
        +If a file is smaller than configured chunk size, chunker will transparently
        +redirect hash requests to wrapped remote, so support depends on that.
        +You will see the empty string as a hashsum of requested type for small
        +files if the wrapped remote doesn't support it.
        +
        +Many storage backends support MD5 and SHA1 hash types, so does chunker.
        +With chunker you can choose one or another but not both.
        +MD5 is set by default as the most supported type.
        +Since chunker keeps hashes for composite files and falls back to the
        +wrapped remote hash for non-chunked ones, we advise you to choose the same
        +hash type as supported by wrapped remote so that your file listings
        +look coherent.
        +
        +If your storage backend does not support MD5 or SHA1 but you need consistent
        +file hashing, configure chunker with `md5all` or `sha1all`. These two modes
        +guarantee given hash for all files. If wrapped remote doesn't support it,
        +chunker will then add metadata to all files, even small. However, this can
        +double the amount of small files in storage and incur additional service charges.
        +You can even use chunker to force md5/sha1 support in any other remote
        +at expense of sidecar meta objects by setting e.g. `hash_type=sha1all`
        +to force hashsums and `chunk_size=1P` to effectively disable chunking.
        +
        +Normally, when a file is copied to chunker controlled remote, chunker
        +will ask the file source for compatible file hash and revert to on-the-fly
        +calculation if none is found. This involves some CPU overhead but provides
        +a guarantee that given hashsum is available. Also, chunker will reject
        +a server-side copy or move operation if source and destination hashsum
        +types are different resulting in the extra network bandwidth, too.
        +In some rare cases this may be undesired, so chunker provides two optional
        +choices: `sha1quick` and `md5quick`. If the source does not support primary
        +hash type and the quick mode is enabled, chunker will try to fall back to
        +the secondary type. This will save CPU and bandwidth but can result in empty
        +hashsums at destination. Beware of consequences: the `sync` command will
        +revert (sometimes silently) to time/size comparison if compatible hashsums
        +between source and target are not found.
        +
        +
        +### Modification times
        +
        +Chunker stores modification times using the wrapped remote so support
        +depends on that. For a small non-chunked file the chunker overlay simply
        +manipulates modification time of the wrapped remote file.
        +For a composite file with metadata chunker will get and set
        +modification time of the metadata object on the wrapped remote.
        +If file is chunked but metadata format is `none` then chunker will
        +use modification time of the first data chunk.
        +
        +
        +### Migrations
        +
        +The idiomatic way to migrate to a different chunk size, hash type, transaction
        +style or chunk naming scheme is to:
        +
        +- Collect all your chunked files under a directory and have your
        +  chunker remote point to it.
        +- Create another directory (most probably on the same cloud storage)
        +  and configure a new remote with desired metadata format,
        +  hash type, chunk naming etc.
        +- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data
        +  will be transparently converted in transfer.
        +  This may take some time, yet chunker will try server-side
        +  copy if possible.
        +- After checking data integrity you may remove configuration section
        +  of the old remote.
        +
        +If rclone gets killed during a long operation on a big composite file,
        +hidden temporary chunks may stay in the directory. They will not be
        +shown by the `list` command but will eat up your account quota.
        +Please note that the `deletefile` command deletes only active
        +chunks of a file. As a workaround, you can use remote of the wrapped
        +file system to see them.
        +An easy way to get rid of hidden garbage is to copy littered directory
        +somewhere using the chunker remote and purge the original directory.
        +The `copy` command will copy only active chunks while the `purge` will
        +remove everything including garbage.
        +
        +
        +### Caveats and Limitations
        +
        +Chunker requires wrapped remote to support server-side `move` (or `copy` +
        +`delete`) operations, otherwise it will explicitly refuse to start.
        +This is because it internally renames temporary chunk files to their final
        +names when an operation completes successfully.
        +
        +Chunker encodes chunk number in file name, so with default `name_format`
        +setting it adds 17 characters. Also chunker adds 7 characters of temporary
        +suffix during operations. Many file systems limit base file name without path
        +by 255 characters. Using rclone's crypt remote as a base file system limits
        +file name by 143 characters. Thus, maximum name length is 231 for most files
        +and 119 for chunker-over-crypt. A user in need can change name format to
        +e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file).
        +
        +Note that a move implemented using the copy-and-delete method may incur
        +double charging with some cloud storage providers.
        +
        +Chunker will not automatically rename existing chunks when you run
        +`rclone config` on a live remote and change the chunk name format.
        +Beware that in result of this some files which have been treated as chunks
        +before the change can pop up in directory listings as normal files
        +and vice versa. The same warning holds for the chunk size.
        +If you desperately need to change critical chunking settings, you should
        +run data migration as described above.
        +
        +If wrapped remote is case insensitive, the chunker overlay will inherit
        +that property (so you can't have a file called "Hello.doc" and "hello.doc"
        +in the same directory).
        +
        +Chunker included in rclone releases up to `v1.54` can sometimes fail to
        +detect metadata produced by recent versions of rclone. We recommend users
        +to keep rclone up-to-date to avoid data corruption.
        +
        +Changing `transactions` is dangerous and requires explicit migration.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to chunker (Transparently chunk/split large files).
        +
        +#### --chunker-remote
        +
        +Remote to chunk/unchunk.
        +
        +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
        +"myremote:bucket" or maybe "myremote:" (not recommended).
        +
        +Properties:
        +
        +- Config:      remote
        +- Env Var:     RCLONE_CHUNKER_REMOTE
        +- Type:        string
        +- Required:    true
        +
        +#### --chunker-chunk-size
        +
        +Files larger than chunk size will be split in chunks.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_CHUNKER_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     2Gi
        +
        +#### --chunker-hash-type
        +
        +Choose how chunker handles hash sums.
        +
        +All modes but "none" require metadata.
        +
        +Properties:
        +
        +- Config:      hash_type
        +- Env Var:     RCLONE_CHUNKER_HASH_TYPE
        +- Type:        string
        +- Default:     "md5"
        +- Examples:
        +    - "none"
        +        - Pass any hash supported by wrapped remote for non-chunked files.
        +        - Return nothing otherwise.
        +    - "md5"
        +        - MD5 for composite files.
        +    - "sha1"
        +        - SHA1 for composite files.
        +    - "md5all"
        +        - MD5 for all files.
        +    - "sha1all"
        +        - SHA1 for all files.
        +    - "md5quick"
        +        - Copying a file to chunker will request MD5 from the source.
        +        - Falling back to SHA1 if unsupported.
        +    - "sha1quick"
        +        - Similar to "md5quick" but prefers SHA1 over MD5.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to chunker (Transparently chunk/split large files).
        +
        +#### --chunker-name-format
        +
        +String format of chunk file names.
        +
        +The two placeholders are: base file name (*) and chunk number (#...).
        +There must be one and only one asterisk and one or more consecutive hash characters.
        +If chunk number has less digits than the number of hashes, it is left-padded by zeros.
        +If there are more digits in the number, they are left as is.
        +Possible chunk files are ignored if their name does not match given format.
        +
        +Properties:
        +
        +- Config:      name_format
        +- Env Var:     RCLONE_CHUNKER_NAME_FORMAT
        +- Type:        string
        +- Default:     "*.rclone_chunk.###"
        +
        +#### --chunker-start-from
        +
        +Minimum valid chunk number. Usually 0 or 1.
        +
        +By default chunk numbers start from 1.
        +
        +Properties:
        +
        +- Config:      start_from
        +- Env Var:     RCLONE_CHUNKER_START_FROM
        +- Type:        int
        +- Default:     1
        +
        +#### --chunker-meta-format
        +
        +Format of the metadata object or "none".
        +
        +By default "simplejson".
        +Metadata is a small JSON file named after the composite file.
        +
        +Properties:
        +
        +- Config:      meta_format
        +- Env Var:     RCLONE_CHUNKER_META_FORMAT
        +- Type:        string
        +- Default:     "simplejson"
        +- Examples:
        +    - "none"
        +        - Do not use metadata files at all.
        +        - Requires hash type "none".
        +    - "simplejson"
        +        - Simple JSON supports hash sums and chunk validation.
        +        - 
        +        - It has the following fields: ver, size, nchunks, md5, sha1.
        +
        +#### --chunker-fail-hard
        +
        +Choose how chunker should handle files with missing or invalid chunks.
        +
        +Properties:
        +
        +- Config:      fail_hard
        +- Env Var:     RCLONE_CHUNKER_FAIL_HARD
        +- Type:        bool
        +- Default:     false
        +- Examples:
        +    - "true"
        +        - Report errors and abort current command.
        +    - "false"
        +        - Warn user, skip incomplete file and proceed.
        +
        +#### --chunker-transactions
        +
        +Choose how chunker should handle temporary files during transactions.
        +
        +Properties:
        +
        +- Config:      transactions
        +- Env Var:     RCLONE_CHUNKER_TRANSACTIONS
        +- Type:        string
        +- Default:     "rename"
        +- Examples:
        +    - "rename"
        +        - Rename temporary files after a successful transaction.
        +    - "norename"
        +        - Leave temporary file names and write transaction ID to metadata file.
        +        - Metadata is required for no rename transactions (meta format cannot be "none").
        +        - If you are using norename transactions you should be careful not to downgrade Rclone
        +        - as older versions of Rclone don't support this transaction style and will misinterpret
        +        - files manipulated by norename transactions.
        +        - This method is EXPERIMENTAL, don't use on production systems.
        +    - "auto"
        +        - Rename or norename will be used depending on capabilities of the backend.
        +        - If meta format is set to "none", rename transactions will always be used.
        +        - This method is EXPERIMENTAL, don't use on production systems.
        +
        +
        +
        +#  Citrix ShareFile
        +
        +[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business.
        +
        +## Configuration
        +
        +The initial setup for Citrix ShareFile involves getting a token from
        +Citrix ShareFile which you can in your browser.  `rclone config` walks you
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value XX / Citrix Sharefile  "sharefile" Storage> sharefile ** See help for sharefile backend at: https://rclone.org/sharefile/ **

        +

        ID of the root folder

        +

        Leave blank to access "Personal Folders". You can use one of the standard values here or any folder ID (long hex number ID). Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Access the Personal Folders. (Default)  "" 2 / Access the Favorites folder.  "favorites" 3 / Access all the shared folders.  "allshared" 4 / Access all the individual connectors.  "connectors" 5 / Access the home, favorites, and shared folders as well as the connectors.  "top" root_folder_id> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXX Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = sharefile endpoint = https://XXX.sharefile.com token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from Citrix ShareFile. This only runs from the moment it opens
        +your browser to the moment you get back the verification code.  This
        +is on `http://127.0.0.1:53682/` and this it may require you to unblock
        +it temporarily if you are running a host firewall.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your ShareFile
        +
        +    rclone lsd remote:
        +
        +List all the files in your ShareFile
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an ShareFile directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +### Modification times and hashes
        +
        +ShareFile allows modification times to be set on objects accurate to 1
        +second.  These will be used to detect whether objects need syncing or
        +not.
        +
        +ShareFile supports MD5 type hashes, so you can use the `--checksum`
        +flag.
        +
        +### Transfers
        +
        +For files above 128 MiB rclone will use a chunked transfer.  Rclone will
        +upload up to `--transfers` chunks at the same time (shared among all
        +the multipart uploads).  Chunks are buffered in memory and are
        +normally 64 MiB so increasing `--transfers` will increase memory use.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \\        | 0x5C  | \           |
        +| *         | 0x2A  | *           |
        +| <         | 0x3C  | <           |
        +| >         | 0x3E  | >           |
        +| ?         | 0x3F  | ?           |
        +| :         | 0x3A  | :           |
        +| \|        | 0x7C  | |           |
        +| "         | 0x22  | "           |
        +
        +File names can also not start or end with the following characters.
        +These only get replaced if they are the first or last character in the
        +name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +| .         | 0x2E  | .           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to sharefile (Citrix Sharefile).
        +
        +#### --sharefile-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_SHAREFILE_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --sharefile-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_SHAREFILE_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --sharefile-root-folder-id
        +
        +ID of the root folder.
        +
        +Leave blank to access "Personal Folders".  You can use one of the
        +standard values here or any folder ID (long hex number ID).
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_SHAREFILE_ROOT_FOLDER_ID
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - Access the Personal Folders (default).
        +    - "favorites"
        +        - Access the Favorites folder.
        +    - "allshared"
        +        - Access all the shared folders.
        +    - "connectors"
        +        - Access all the individual connectors.
        +    - "top"
        +        - Access the home, favorites, and shared folders as well as the connectors.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to sharefile (Citrix Sharefile).
        +
        +#### --sharefile-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_SHAREFILE_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --sharefile-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_SHAREFILE_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --sharefile-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_SHAREFILE_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --sharefile-upload-cutoff
        +
        +Cutoff for switching to multipart upload.
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_SHAREFILE_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     128Mi
        +
        +#### --sharefile-chunk-size
        +
        +Upload chunk size.
        +
        +Must a power of 2 >= 256k.
        +
        +Making this larger will improve performance, but note that each chunk
        +is buffered in memory one per transfer.
        +
        +Reducing this will reduce memory usage but decrease performance.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_SHAREFILE_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     64Mi
        +
        +#### --sharefile-endpoint
        +
        +Endpoint for API calls.
        +
        +This is usually auto discovered as part of the oauth process, but can
        +be set manually to something like: https://XXX.sharefile.com
        +
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_SHAREFILE_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --sharefile-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_SHAREFILE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot
        +
        +
        +## Limitations
        +
        +Note that ShareFile is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +ShareFile only supports filenames up to 256 characters in length.
        +
        +`rclone about` is not supported by the Citrix ShareFile backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +#  Crypt
        +
        +Rclone `crypt` remotes encrypt and decrypt other remotes.
        +
        +A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/)
        +directly, but instead wraps another remote, which in turn accesses
        +the storage system. This is similar to how [alias](https://rclone.org/alias/),
        +[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/)
        +and a few others work. It makes the usage very flexible, as you can
        +add a layer, in this case an encryption layer, on top of any other
        +backend, even in multiple layers. Rclone's functionality
        +can be used as with any other remote, for example you can
        +[mount](https://rclone.org/commands/rclone_mount/) a crypt remote.
        +
        +Accessing a storage system through a crypt remote realizes client-side
        +encryption, which makes it safe to keep your data in a location you do
        +not trust will not get compromised.
        +When working against the `crypt` remote, rclone will automatically
        +encrypt (before uploading) and decrypt (after downloading) on your local
        +system as needed on the fly, leaving the data encrypted at rest in the
        +wrapped remote. If you access the storage system using an application
        +other than rclone, or access the wrapped remote directly using rclone,
        +there will not be any encryption/decryption: Downloading existing content
        +will just give you the encrypted (scrambled) format, and anything you
        +upload will *not* become encrypted.
        +
        +The encryption is a secret-key encryption (also called symmetric key encryption)
        +algorithm, where a password (or pass phrase) is used to generate real encryption key.
        +The password can be supplied by user, or you may chose to let rclone
        +generate one. It will be stored in the configuration file, in a lightly obscured form.
        +If you are in an environment where you are not able to keep your configuration
        +secured, you should add
        +[configuration encryption](https://rclone.org/docs/#configuration-encryption)
        +as protection. As long as you have this configuration file, you will be able to
        +decrypt your data. Without the configuration file, as long as you remember
        +the password (or keep it in a safe place), you can re-create the configuration
        +and gain access to the existing data. You may also configure a corresponding
        +remote in a different installation to access the same data.
        +See below for guidance to [changing password](#changing-password).
        +
        +Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)),
        +to permute the encryption key so that the same string may be encrypted in
        +different ways. When configuring the crypt remote it is optional to enter a salt,
        +or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string.
        +Normally in cryptography, the salt is stored together with the encrypted content,
        +and do not have to be memorized by the user. This is not the case in rclone,
        +because rclone does not store any additional information on the remotes. Use of
        +custom salt is effectively a second password that must be memorized.
        +
        +[File content](#file-encryption) encryption is performed using
        +[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox),
        +based on XSalsa20 cipher and Poly1305 for integrity.
        +[Names](#name-encryption) (file- and directory names) are also encrypted
        +by default, but this has some implications and is therefore
        +possible to be turned off.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `secret`.
        +
        +To use `crypt`, first set up the underlying remote. Follow the
        +`rclone config` instructions for the specific backend.
        +
        +Before configuring the crypt remote, check the underlying remote is
        +working. In this example the underlying remote is called `remote`.
        +We will configure a path `path` within this remote to contain the
        +encrypted content. Anything inside `remote:path` will be encrypted
        +and anything outside will not.
        +
        +Configure `crypt` using `rclone config`. In this example the `crypt`
        +remote is called `secret`, to differentiate it from the underlying
        +`remote`.
        +
        +When you are done you can use the crypt remote named `secret` just
        +as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`,
        +and rclone will encrypt and decrypt as needed on the fly.
        +If you access the wrapped remote `remote:path` directly you will bypass
        +the encryption, and anything you read will be in encrypted form, and
        +anything you write will be unencrypted. To avoid issues it is best to
        +configure a dedicated path for encrypted content, and access it
        +exclusively through a crypt remote.
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> secret Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Encrypt/Decrypt a remote  "crypt" [snip] Storage> crypt ** See help for crypt backend at: https://rclone.org/crypt/ **

        +

        Remote to encrypt/decrypt. Normally should contain a ':' and a path, eg "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). Enter a string value. Press Enter for the default (""). remote> remote:path How to encrypt the filenames. Enter a string value. Press Enter for the default ("standard"). Choose a number from below, or type in your own value. / Encrypt the filenames. 1 | See the docs for the details.  "standard" 2 / Very simple filename obfuscation.  "obfuscate" / Don't encrypt the file names. 3 | Adds a ".bin" extension only.  "off" filename_encryption> Option to either encrypt directory names or leave them intact.

        +

        NB If filename_encryption is "off" then this option will do nothing. Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value 1 / Encrypt directory names.  "true" 2 / Don't encrypt directory names, leave them intact.  "false" directory_name_encryption> Password or pass phrase for encryption. y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Password or pass phrase for salt. Optional but recommended. Should be different to the previous password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g/n> g Password strength in bits. 64 is just about memorable 128 is secure 1024 is the maximum Bits> 128 Your password is: JAsJvRcgR-_veXNfy_sGmQ Use this password? Please note that an obscured version of this password (and not the password itself) will be stored under your configuration file, so keep this generated password in a safe place. y) Yes (default) n) No y/n> Edit advanced config? (y/n) y) Yes n) No (default) y/n> Remote config -------------------- [secret] type = crypt remote = remote:path password = *** ENCRYPTED password2 = ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d>

        +
        
        +**Important** The crypt password stored in `rclone.conf` is lightly
        +obscured. That only protects it from cursory inspection. It is not
        +secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified.
        +
        +A long passphrase is recommended, or `rclone config` can generate a
        +random one.
        +
        +The obscured password is created using AES-CTR with a static key. The
        +salt is stored verbatim at the beginning of the obscured password. This
        +static key is shared between all versions of rclone.
        +
        +If you reconfigure rclone with the same passwords/passphrases
        +elsewhere it will be compatible, but the obscured version will be different
        +due to the different salt.
        +
        +Rclone does not encrypt
        +
        +  * file length - this can be calculated within 16 bytes
        +  * modification time - used for syncing
        +
        +### Specifying the remote
        +
        +When configuring the remote to encrypt/decrypt, you may specify any
        +string that rclone accepts as a source/destination of other commands.
        +
        +The primary use case is to specify the path into an already configured
        +remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that
        +data in a remote untrusted location can be stored encrypted.
        +
        +You may also specify a local filesystem path, such as
        +`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating
        +a crypt remote pointing to such a local filesystem path, you can
        +use rclone as a utility for pure local file encryption, for example
        +to keep encrypted files on a removable USB drive.
        +
        +**Note**: A string which do not contain a `:` will by rclone be treated
        +as a relative path in the local filesystem. For example, if you enter
        +the name `remote` without the trailing `:`, it will be treated as
        +a subdirectory of the current directory with name "remote".
        +
        +If a path `remote:path/to/dir` is specified, rclone stores encrypted
        +files in `path/to/dir` on the remote. With file name encryption, files
        +saved to `secret:subdir/subfile` are stored in the unencrypted path
        +`path/to/dir` but the `subdir/subpath` element is encrypted.
        +
        +The path you specify does not have to exist, rclone will create
        +it when needed.
        +
        +If you intend to use the wrapped remote both directly for keeping
        +unencrypted content, as well as through a crypt remote for encrypted
        +content, it is recommended to point the crypt remote to a separate
        +directory within the wrapped remote. If you use a bucket-based storage
        +system (e.g. Swift, S3, Google Compute Storage, B2) it is generally
        +advisable to wrap the crypt remote around a specific bucket (`s3:bucket`).
        +If wrapping around the entire root of the storage (`s3:`), and use the
        +optional file name encryption, rclone will encrypt the bucket name.
        +
        +### Changing password
        +
        +Should the password, or the configuration file containing a lightly obscured
        +form of the password, be compromised, you need to re-encrypt your data with
        +a new password. Since rclone uses secret-key encryption, where the encryption
        +key is generated directly from the password kept on the client, it is not
        +possible to change the password/key of already encrypted content. Just changing
        +the password configured for an existing crypt remote means you will no longer
        +able to decrypt any of the previously encrypted content. The only possibility
        +is to re-upload everything via a crypt remote configured with your new password.
        +
        +Depending on the size of your data, your bandwidth, storage quota etc, there are
        +different approaches you can take:
        +- If you have everything in a different location, for example on your local system,
        +you could remove all of the prior encrypted files, change the password for your
        +configured crypt remote (or delete and re-create the crypt configuration),
        +and then re-upload everything from the alternative location.
        +- If you have enough space on the storage system you can create a new crypt
        +remote pointing to a separate directory on the same backend, and then use
        +rclone to copy everything from the original crypt remote to the new,
        +effectively decrypting everything on the fly using the old password and
        +re-encrypting using the new password. When done, delete the original crypt
        +remote directory and finally the rclone crypt configuration with the old password.
        +All data will be streamed from the storage system and back, so you will
        +get half the bandwidth and be charged twice if you have upload and download quota
        +on the storage system.
        +
        +**Note**: A security problem related to the random password generator
        +was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated
        +by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2
        +(released 2020-10-26) are not considered secure and should be changed.
        +If you made up your own password, or used rclone version older than 1.49.0 or
        +newer than 1.53.2 to generate it, you are *not* affected by this issue.
        +See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more
        +details, and a tool you can use to check if you are affected.
        +
        +### Example
        +
        +Create the following file structure using "standard" file name
        +encryption.
        +
        +

        plaintext/ ├── file0.txt ├── file1.txt └── subdir ├── file2.txt ├── file3.txt └── subsubdir └── file4.txt

        +
        
        +Copy these to the remote, and list them
        +
        +

        $ rclone -q copy plaintext secret: $ rclone -q ls secret: 7 file1.txt 6 file0.txt 8 subdir/file2.txt 10 subdir/subsubdir/file4.txt 9 subdir/file3.txt

        +
        
        +The crypt remote looks like
        +
        +

        $ rclone -q ls remote:path 55 hagjclgavj2mbiqm6u6cnjjqcg 54 v05749mltvv1tf4onltun46gls 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps

        +
        
        +The directory structure is preserved
        +
        +

        $ rclone -q ls secret:subdir 8 file2.txt 9 file3.txt 10 subsubdir/file4.txt

        +
        
        +Without file name encryption `.bin` extensions are added to underlying
        +names. This prevents the cloud provider attempting to interpret file
        +content.
        +
        +

        $ rclone -q ls remote:path 54 file0.txt.bin 57 subdir/file3.txt.bin 56 subdir/file2.txt.bin 58 subdir/subsubdir/file4.txt.bin 55 file1.txt.bin

        +
        
        +### File name encryption modes
        +
        +Off
        +
        +  * doesn't hide file names or directory structure
        +  * allows for longer file names (~246 characters)
        +  * can use sub paths and copy single files
        +
        +Standard
        +
        +  * file names encrypted
        +  * file names can't be as long (~143 characters)
        +  * can use sub paths and copy single files
        +  * directory structure visible
        +  * identical files names will have identical uploaded names
        +  * can use shortcuts to shorten the directory recursion
        +
        +Obfuscation
        +
        +This is a simple "rotate" of the filename, with each file having a rot
        +distance based on the filename. Rclone stores the distance at the
        +beginning of the filename. A file called "hello" may become "53.jgnnq".
        +
        +Obfuscation is not a strong encryption of filenames, but hinders
        +automated scanning tools picking up on filename patterns. It is an
        +intermediate between "off" and "standard" which allows for longer path
        +segment names.
        +
        +There is a possibility with some unicode based filenames that the
        +obfuscation is weak and may map lower case characters to upper case
        +equivalents.
        +
        +Obfuscation cannot be relied upon for strong protection.
        +
        +  * file names very lightly obfuscated
        +  * file names can be longer than standard encryption
        +  * can use sub paths and copy single files
        +  * directory structure visible
        +  * identical files names will have identical uploaded names
        +
        +Cloud storage systems have limits on file name length and
        +total path length which rclone is more likely to breach using
        +"Standard" file name encryption.  Where file names are less than 156
        +characters in length issues should not be encountered, irrespective of
        +cloud storage provider.
        +
        +An experimental advanced option `filename_encoding` is now provided to
        +address this problem to a certain degree.
        +For cloud storage systems with case sensitive file names (e.g. Google Drive),
        +`base64` can be used to reduce file name length. 
        +For cloud storage systems using UTF-16 to store file names internally
        +(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce
        +file name length. 
        +
        +An alternative, future rclone file name encryption mode may tolerate
        +backend provider path length limits.
        +
        +### Directory name encryption
        +
        +Crypt offers the option of encrypting dir names or leaving them intact.
        +There are two options:
        +
        +True
        +
        +Encrypts the whole file path including directory names
        +Example:
        +`1/12/123.txt` is encrypted to
        +`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0`
        +
        +False
        +
        +Only encrypts file names, skips directory names
        +Example:
        +`1/12/123.txt` is encrypted to
        +`1/12/qgm4avr35m5loi1th53ato71v0`
        +
        +
        +### Modification times and hashes
        +
        +Crypt stores modification times using the underlying remote so support
        +depends on that.
        +
        +Hashes are not stored for crypt. However the data integrity is
        +protected by an extremely strong crypto authenticator.
        +
        +Use the `rclone cryptcheck` command to check the
        +integrity of an encrypted remote instead of `rclone check` which can't
        +check the checksums properly.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to crypt (Encrypt/Decrypt a remote).
        +
        +#### --crypt-remote
        +
        +Remote to encrypt/decrypt.
        +
        +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
        +"myremote:bucket" or maybe "myremote:" (not recommended).
        +
        +Properties:
        +
        +- Config:      remote
        +- Env Var:     RCLONE_CRYPT_REMOTE
        +- Type:        string
        +- Required:    true
        +
        +#### --crypt-filename-encryption
        +
        +How to encrypt the filenames.
        +
        +Properties:
        +
        +- Config:      filename_encryption
        +- Env Var:     RCLONE_CRYPT_FILENAME_ENCRYPTION
        +- Type:        string
        +- Default:     "standard"
        +- Examples:
        +    - "standard"
        +        - Encrypt the filenames.
        +        - See the docs for the details.
        +    - "obfuscate"
        +        - Very simple filename obfuscation.
        +    - "off"
        +        - Don't encrypt the file names.
        +        - Adds a ".bin", or "suffix" extension only.
        +
        +#### --crypt-directory-name-encryption
        +
        +Option to either encrypt directory names or leave them intact.
        +
        +NB If filename_encryption is "off" then this option will do nothing.
        +
        +Properties:
        +
        +- Config:      directory_name_encryption
        +- Env Var:     RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION
        +- Type:        bool
        +- Default:     true
        +- Examples:
        +    - "true"
        +        - Encrypt directory names.
        +    - "false"
        +        - Don't encrypt directory names, leave them intact.
        +
        +#### --crypt-password
        +
        +Password or pass phrase for encryption.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_CRYPT_PASSWORD
        +- Type:        string
        +- Required:    true
        +
        +#### --crypt-password2
        +
        +Password or pass phrase for salt.
        +
        +Optional but recommended.
        +Should be different to the previous password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password2
        +- Env Var:     RCLONE_CRYPT_PASSWORD2
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote).
        +
        +#### --crypt-server-side-across-configs
        +
        +Deprecated: use --server-side-across-configs instead.
        +
        +Allow server-side operations (e.g. copy) to work across different crypt configs.
        +
        +Normally this option is not what you want, but if you have two crypts
        +pointing to the same backend you can use it.
        +
        +This can be used, for example, to change file name encryption type
        +without re-uploading all the data. Just make two crypt backends
        +pointing to two different directories with the single changed
        +parameter and use rclone move to move the files between the crypt
        +remotes.
        +
        +Properties:
        +
        +- Config:      server_side_across_configs
        +- Env Var:     RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
        +- Type:        bool
        +- Default:     false
        +
        +#### --crypt-show-mapping
        +
        +For all files listed show how the names encrypt.
        +
        +If this flag is set then for each file that the remote is asked to
        +list, it will log (at level INFO) a line stating the decrypted file
        +name and the encrypted file name.
        +
        +This is so you can work out which encrypted names are which decrypted
        +names just in case you need to do something with the encrypted file
        +names, or for debugging purposes.
        +
        +Properties:
        +
        +- Config:      show_mapping
        +- Env Var:     RCLONE_CRYPT_SHOW_MAPPING
        +- Type:        bool
        +- Default:     false
        +
        +#### --crypt-no-data-encryption
        +
        +Option to either encrypt file data or leave it unencrypted.
        +
        +Properties:
        +
        +- Config:      no_data_encryption
        +- Env Var:     RCLONE_CRYPT_NO_DATA_ENCRYPTION
        +- Type:        bool
        +- Default:     false
        +- Examples:
        +    - "true"
        +        - Don't encrypt file data, leave it unencrypted.
        +    - "false"
        +        - Encrypt file data.
        +
        +#### --crypt-pass-bad-blocks
        +
        +If set this will pass bad blocks through as all 0.
        +
        +This should not be set in normal operation, it should only be set if
        +trying to recover an encrypted file with errors and it is desired to
        +recover as much of the file as possible.
        +
        +Properties:
        +
        +- Config:      pass_bad_blocks
        +- Env Var:     RCLONE_CRYPT_PASS_BAD_BLOCKS
        +- Type:        bool
        +- Default:     false
        +
        +#### --crypt-filename-encoding
        +
        +How to encode the encrypted filename to text string.
        +
        +This option could help with shortening the encrypted filename. The 
        +suitable option would depend on the way your remote count the filename
        +length and if it's case sensitive.
        +
        +Properties:
        +
        +- Config:      filename_encoding
        +- Env Var:     RCLONE_CRYPT_FILENAME_ENCODING
        +- Type:        string
        +- Default:     "base32"
        +- Examples:
        +    - "base32"
        +        - Encode using base32. Suitable for all remote.
        +    - "base64"
        +        - Encode using base64. Suitable for case sensitive remote.
        +    - "base32768"
        +        - Encode using base32768. Suitable if your remote counts UTF-16 or
        +        - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox)
        +
        +#### --crypt-suffix
        +
        +If this is set it will override the default suffix of ".bin".
        +
        +Setting suffix to "none" will result in an empty suffix. This may be useful 
        +when the path length is critical.
        +
        +Properties:
        +
        +- Config:      suffix
        +- Env Var:     RCLONE_CRYPT_SUFFIX
        +- Type:        string
        +- Default:     ".bin"
        +
        +### Metadata
        +
        +Any metadata supported by the underlying remote is read and written.
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +## Backend commands
        +
        +Here are the commands specific to the crypt backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### encode
        +
        +Encode the given filename(s)
        +
        +    rclone backend encode remote: [options] [<arguments>+]
        +
        +This encodes the filenames given as arguments returning a list of
        +strings of the encoded results.
        +
        +Usage Example:
        +
        +    rclone backend encode crypt: file1 [file2...]
        +    rclone rc backend/command command=encode fs=crypt: file1 [file2...]
        +
        +
        +### decode
        +
        +Decode the given filename(s)
        +
        +    rclone backend decode remote: [options] [<arguments>+]
        +
        +This decodes the filenames given as arguments returning a list of
        +strings of the decoded results. It will return an error if any of the
        +inputs are invalid.
        +
        +Usage Example:
        +
        +    rclone backend decode crypt: encryptedfile1 [encryptedfile2...]
        +    rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...]
        +
        +
        +
        +
        +## Backing up an encrypted remote
        +
        +If you wish to backup an encrypted remote, it is recommended that you use
        +`rclone sync` on the encrypted files, and make sure the passwords are
        +the same in the new encrypted remote.
        +
        +This will have the following advantages
        +
        +  * `rclone sync` will check the checksums while copying
        +  * you can use `rclone check` between the encrypted remotes
        +  * you don't decrypt and encrypt unnecessarily
        +
        +For example, let's say you have your original remote at `remote:` with
        +the encrypted version at `eremote:` with path `remote:crypt`.  You
        +would then set up the new remote `remote2:` and then the encrypted
        +version `eremote2:` with path `remote2:crypt` using the same passwords
        +as `eremote:`.
        +
        +To sync the two remotes you would do
        +
        +    rclone sync --interactive remote:crypt remote2:crypt
        +
        +And to check the integrity you would do
        +
        +    rclone check remote:crypt remote2:crypt
        +
        +## File formats
        +
        +### File encryption
        +
        +Files are encrypted 1:1 source file to destination object.  The file
        +has a header and is divided into chunks.
        +
        +#### Header
        +
        +  * 8 bytes magic string `RCLONE\x00\x00`
        +  * 24 bytes Nonce (IV)
        +
        +The initial nonce is generated from the operating systems crypto
        +strong random number generator.  The nonce is incremented for each
        +chunk read making sure each nonce is unique for each block written.
        +The chance of a nonce being reused is minuscule.  If you wrote an
        +exabyte of data (10¹⁸ bytes) you would have a probability of
        +approximately 2×10⁻³² of re-using a nonce.
        +
        +#### Chunk
        +
        +Each chunk will contain 64 KiB of data, except for the last one which
        +may have less data. The data chunk is in standard NaCl SecretBox
        +format. SecretBox uses XSalsa20 and Poly1305 to encrypt and
        +authenticate messages.
        +
        +Each chunk contains:
        +
        +  * 16 Bytes of Poly1305 authenticator
        +  * 1 - 65536 bytes XSalsa20 encrypted data
        +
        +64k chunk size was chosen as the best performing chunk size (the
        +authenticator takes too much time below this and the performance drops
        +off due to cache effects above this).  Note that these chunks are
        +buffered in memory so they can't be too big.
        +
        +This uses a 32 byte (256 bit key) key derived from the user password.
        +
        +#### Examples
        +
        +1 byte file will encrypt to
        +
        +  * 32 bytes header
        +  * 17 bytes data chunk
        +
        +49 bytes total
        +
        +1 MiB (1048576 bytes) file will encrypt to
        +
        +  * 32 bytes header
        +  * 16 chunks of 65568 bytes
        +
        +1049120 bytes total (a 0.05% overhead). This is the overhead for big
        +files.
        +
        +### Name encryption
        +
        +File names are encrypted segment by segment - the path is broken up
        +into `/` separated strings and these are encrypted individually.
        +
        +File segments are padded using PKCS#7 to a multiple of 16 bytes
        +before encryption.
        +
        +They are then encrypted with EME using AES with 256 bit key. EME
        +(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003
        +paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway.
        +
        +This makes for deterministic encryption which is what we want - the
        +same filename must encrypt to the same thing otherwise we can't find
        +it on the cloud storage system.
        +
        +This means that
        +
        +  * filenames with the same name will encrypt the same
        +  * filenames which start the same won't have a common prefix
        +
        +This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of
        +which are derived from the user password.
        +
        +After encryption they are written out using a modified version of
        +standard `base32` encoding as described in RFC4648.  The standard
        +encoding is modified in two ways:
        +
        +  * it becomes lower case (no-one likes upper case filenames!)
        +  * we strip the padding character `=`
        +
        +`base32` is used rather than the more efficient `base64` so rclone can be
        +used on case insensitive remotes (e.g. Windows, Amazon Drive).
        +
        +### Key derivation
        +
        +Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an
        +optional user supplied salt (password2) to derive the 32+32+16 = 80
        +bytes of key material required.  If the user doesn't supply a salt
        +then rclone uses an internal one.
        +
        +`scrypt` makes it impractical to mount a dictionary attack on rclone
        +encrypted data.  For full protection against this you should always use
        +a salt.
        +
        +## SEE ALSO
        +
        +* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/)    - Show forward/reverse mapping of encrypted filenames
        +
        +#  Compress
        +
        +## Warning
        +
        +This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is
        +at your own risk. Please understand the risks associated with using experimental code and don't use this remote in
        +critical applications.
        +
        +The `Compress` remote adds compression to another remote. It is best used with remotes containing
        +many large compressible files.
        +
        +## Configuration
        +
        +To use this remote, all you need to do is specify another remote and a compression mode to use:
        +
        +

        Current remotes:

        +

        Name Type ==== ==== remote_to_press sometype

        +
          +
        1. Edit existing remote $ rclone config
        2. +
        3. New remote
        4. +
        5. Delete remote
        6. +
        7. Rename remote
        8. +
        9. Copy remote
        10. +
        11. Set configuration password
        12. +
        13. Quit config e/n/d/r/c/s/q> n name> compress ... 8 / Compress a remote  "compress" ... Storage> compress ** See help for compress backend at: https://rclone.org/compress/ **
        14. +
        +

        Remote to compress. Enter a string value. Press Enter for the default (""). remote> remote_to_press:subdir Compression mode. Enter a string value. Press Enter for the default ("gzip"). Choose a number from below, or type in your own value 1 / Gzip compression balanced for speed and compression strength.  "gzip" compression_mode> gzip Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [compress] type = compress remote = remote_to_press:subdir compression_mode = gzip -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### Compression Modes
        +
        +Currently only gzip compression is supported. It provides a decent balance between speed and size and is well
        +supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no
        +compression and 9 is strongest compression.
        +
        +### File types
        +
        +If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to
        +the compression algorithm you chose. These files are standard files that can be opened by various archive programs, 
        +but they have some hidden metadata that allows them to be used by rclone.
        +While you may download and decompress these files at will, do **not** manually delete or rename files. Files without
        +correct metadata files will not be recognized by rclone.
        +
        +### File names
        +
        +The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded 
        +size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to compress (Compress a remote).
        +
        +#### --compress-remote
        +
        +Remote to compress.
        +
        +Properties:
        +
        +- Config:      remote
        +- Env Var:     RCLONE_COMPRESS_REMOTE
        +- Type:        string
        +- Required:    true
        +
        +#### --compress-mode
        +
        +Compression mode.
        +
        +Properties:
        +
        +- Config:      mode
        +- Env Var:     RCLONE_COMPRESS_MODE
        +- Type:        string
        +- Default:     "gzip"
        +- Examples:
        +    - "gzip"
        +        - Standard gzip compression with fastest parameters.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to compress (Compress a remote).
        +
        +#### --compress-level
        +
        +GZIP compression level (-2 to 9).
        +
        +Generally -1 (default, equivalent to 5) is recommended.
        +Levels 1 to 9 increase compression at the cost of speed. Going past 6 
        +generally offers very little return.
        +
        +Level -2 uses Huffman encoding only. Only use if you know what you
        +are doing.
        +Level 0 turns off compression.
        +
        +Properties:
        +
        +- Config:      level
        +- Env Var:     RCLONE_COMPRESS_LEVEL
        +- Type:        int
        +- Default:     -1
        +
        +#### --compress-ram-cache-limit
        +
        +Some remotes don't allow the upload of files with unknown size.
        +In this case the compressed file will need to be cached to determine
        +it's size.
        +
        +Files smaller than this limit will be cached in RAM, files larger than 
        +this limit will be cached on disk.
        +
        +Properties:
        +
        +- Config:      ram_cache_limit
        +- Env Var:     RCLONE_COMPRESS_RAM_CACHE_LIMIT
        +- Type:        SizeSuffix
        +- Default:     20Mi
        +
        +### Metadata
        +
        +Any metadata supported by the underlying remote is read and written.
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +
        +
        +#  Combine
        +
        +The `combine` backend joins remotes together into a single directory
        +tree.
        +
        +For example you might have a remote for images on one provider:
        +
        +

        $ rclone tree s3:imagesbucket / ├── image1.jpg └── image2.jpg

        +
        
        +And a remote for files on another:
        +
        +

        $ rclone tree drive:important/files / ├── file1.txt └── file2.txt

        +
        
        +The `combine` backend can join these together into a synthetic
        +directory structure like this:
        +
        +

        $ rclone tree combined: / ├── files │ ├── file1.txt │ └── file2.txt └── images ├── image1.jpg └── image2.jpg

        +
        
        +You'd do this by specifying an `upstreams` parameter in the config
        +like this
        +
        +    upstreams = images=s3:imagesbucket files=drive:important/files
        +
        +During the initial setup with `rclone config` you will specify the
        +upstreams remotes as a space separated list. The upstream remotes can
        +either be a local paths or other remotes.
        +
        +## Configuration
        +
        +Here is an example of how to make a combine called `remote` for the
        +example above. First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. ... XX / Combine several remotes into one  (combine) ... Storage> combine Option upstreams. Upstreams for combining These should be in the form dir=remote:path dir2=remote2:path Where before the = is specified the root directory and after is the remote to put there. Embedded spaces can be added using quotes "dir=remote:path with space" "dir2=remote2:path with space" Enter a fs.SpaceSepList value. upstreams> images=s3:imagesbucket files=drive:important/files -------------------- [remote] type = combine upstreams = images=s3:imagesbucket files=drive:important/files -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### Configuring for Google Drive Shared Drives
        +
        +Rclone has a convenience feature for making a combine backend for all
        +the shared drives you have access to.
        +
        +Assuming your main (non shared drive) Google drive remote is called
        +`drive:` you would run
        +
        +    rclone backend -o config drives drive:
        +
        +This would produce something like this:
        +
        +    [My Drive]
        +    type = alias
        +    remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
        +
        +    [Test Drive]
        +    type = alias
        +    remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
        +
        +    [AllDrives]
        +    type = combine
        +    upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
        +
        +If you then add that config to your config file (find it with `rclone
        +config file`) then you can access all the shared drives in one place
        +with the `AllDrives:` remote.
        +
        +See [the Google Drive docs](https://rclone.org/drive/#drives) for full info.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to combine (Combine several remotes into one).
        +
        +#### --combine-upstreams
        +
        +Upstreams for combining
        +
        +These should be in the form
        +
        +    dir=remote:path dir2=remote2:path
        +
        +Where before the = is specified the root directory and after is the remote to
        +put there.
        +
        +Embedded spaces can be added using quotes
        +
        +    "dir=remote:path with space" "dir2=remote2:path with space"
        +
        +
        +
        +Properties:
        +
        +- Config:      upstreams
        +- Env Var:     RCLONE_COMBINE_UPSTREAMS
        +- Type:        SpaceSepList
        +- Default:     
        +
        +### Metadata
        +
        +Any metadata supported by the underlying remote is read and written.
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +
        +
        +#  Dropbox
        +
        +Paths are specified as `remote:path`
        +
        +Dropbox paths may be as deep as required, e.g.
        +`remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for dropbox involves getting a token from Dropbox
        +which you need to do in your browser.  `rclone config` walks you
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +
          +
        1. New remote
        2. +
        3. Delete remote
        4. +
        5. Quit config e/n/d/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Dropbox  "dropbox" [snip] Storage> dropbox Dropbox App Key - leave blank normally. app_key> Dropbox App Secret - leave blank normally. app_secret> Remote config Please visit: https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX -------------------- [remote] app_key = app_secret = token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------------------
        6. +
        7. Yes this is OK
        8. +
        9. Edit this remote
        10. +
        11. Delete this remote y/e/d> y
        12. +
        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from Dropbox. This only
        +runs from the moment it opens your browser to the moment you get back
        +the verification code.  This is on `http://127.0.0.1:53682/` and it
        +may require you to unblock it temporarily if you are running a host
        +firewall, or use manual mode.
        +
        +You can then use it like this,
        +
        +List directories in top level of your dropbox
        +
        +    rclone lsd remote:
        +
        +List all the files in your dropbox
        +
        +    rclone ls remote:
        +
        +To copy a local directory to a dropbox directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Dropbox for business
        +
        +Rclone supports Dropbox for business and Team Folders.
        +
        +When using Dropbox for business `remote:` and `remote:path/to/file`
        +will refer to your personal folder.
        +
        +If you wish to see Team Folders you must use a leading `/` in the
        +path, so `rclone lsd remote:/` will refer to the root and show you all
        +Team Folders and your User Folder.
        +
        +You can then use team folders like this `remote:/TeamFolder` and
        +`remote:/TeamFolder/path/to/file`.
        +
        +A leading `/` for a Dropbox personal account will do nothing, but it
        +will take an extra HTTP transaction so it should be avoided.
        +
        +### Modification times and hashes
        +
        +Dropbox supports modified times, but the only way to set a
        +modification time is to re-upload the file.
        +
        +This means that if you uploaded your data with an older version of
        +rclone which didn't support the v2 API and modified times, rclone will
        +decide to upload all your old data to fix the modification times.  If
        +you don't want this to happen use `--size-only` or `--checksum` flag
        +to stop it.
        +
        +Dropbox supports [its own hash
        +type](https://www.dropbox.com/developers/reference/content-hash) which
        +is checked for all transfers.
        +
        +### Restricted filename characters
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| NUL       | 0x00  | ␀           |
        +| /         | 0x2F  | /           |
        +| DEL       | 0x7F  | ␡           |
        +| \         | 0x5C  | \           |
        +
        +File names can also not end with the following characters.
        +These only get replaced if they are the last character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Batch mode uploads {#batch-mode}
        +
        +Using batch mode uploads is very important for performance when using
        +the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide)
        +for more info.
        +
        +There are 3 modes rclone can use for uploads.
        +
        +#### --dropbox-batch-mode off
        +
        +In this mode rclone will not use upload batching. This was the default
        +before rclone v1.55. It has the disadvantage that it is very likely to
        +encounter `too_many_requests` errors like this
        +
        +    NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds.
        +
        +When rclone receives these it has to wait for 15s or sometimes 300s
        +before continuing which really slows down transfers.
        +
        +This will happen especially if `--transfers` is large, so this mode
        +isn't recommended except for compatibility or investigating problems.
        +
        +#### --dropbox-batch-mode sync
        +
        +In this mode rclone will batch up uploads to the size specified by
        +`--dropbox-batch-size` and commit them together.
        +
        +Using this mode means you can use a much higher `--transfers`
        +parameter (32 or 64 works fine) without receiving `too_many_requests`
        +errors.
        +
        +This mode ensures full data integrity.
        +
        +Note that there may be a pause when quitting rclone while rclone
        +finishes up the last batch using this mode.
        +
        +#### --dropbox-batch-mode async
        +
        +In this mode rclone will batch up uploads to the size specified by
        +`--dropbox-batch-size` and commit them together.
        +
        +However it will not wait for the status of the batch to be returned to
        +the caller. This means rclone can use a much bigger batch size (much
        +bigger than `--transfers`), at the cost of not being able to check the
        +status of the upload.
        +
        +This provides the maximum possible upload speed especially with lots
        +of small files, however rclone can't check the file got uploaded
        +properly using this mode.
        +
        +If you are using this mode then using "rclone check" after the
        +transfer completes is recommended. Or you could do an initial transfer
        +with `--dropbox-batch-mode async` then do a final transfer with
        +`--dropbox-batch-mode sync` (the default).
        +
        +Note that there may be a pause when quitting rclone while rclone
        +finishes up the last batch using this mode.
        +
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to dropbox (Dropbox).
        +
        +#### --dropbox-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_DROPBOX_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --dropbox-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_DROPBOX_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to dropbox (Dropbox).
        +
        +#### --dropbox-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_DROPBOX_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --dropbox-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_DROPBOX_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --dropbox-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_DROPBOX_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --dropbox-chunk-size
        +
        +Upload chunk size (< 150Mi).
        +
        +Any files larger than this will be uploaded in chunks of this size.
        +
        +Note that chunks are buffered in memory (one at a time) so rclone can
        +deal with retries.  Setting this larger will increase the speed
        +slightly (at most 10% for 128 MiB in tests) at the cost of using more
        +memory.  It can be set smaller if you are tight on memory.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_DROPBOX_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     48Mi
        +
        +#### --dropbox-impersonate
        +
        +Impersonate this user when using a business account.
        +
        +Note that if you want to use impersonate, you should make sure this
        +flag is set when running "rclone config" as this will cause rclone to
        +request the "members.read" scope which it won't normally. This is
        +needed to lookup a members email address into the internal ID that
        +dropbox uses in the API.
        +
        +Using the "members.read" scope will require a Dropbox Team Admin
        +to approve during the OAuth flow.
        +
        +You will have to use your own App (setting your own client_id and
        +client_secret) to use this option as currently rclone's default set of
        +permissions doesn't include "members.read". This can be added once
        +v1.55 or later is in use everywhere.
        +
        +
        +Properties:
        +
        +- Config:      impersonate
        +- Env Var:     RCLONE_DROPBOX_IMPERSONATE
        +- Type:        string
        +- Required:    false
        +
        +#### --dropbox-shared-files
        +
        +Instructs rclone to work on individual shared files.
        +
        +In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) 
        +operations and read operations (e.g. downloading) are supported in this mode.
        +All other operations will be disabled.
        +
        +Properties:
        +
        +- Config:      shared_files
        +- Env Var:     RCLONE_DROPBOX_SHARED_FILES
        +- Type:        bool
        +- Default:     false
        +
        +#### --dropbox-shared-folders
        +
        +Instructs rclone to work on shared folders.
        +            
        +When this flag is used with no path only the List operation is supported and 
        +all available shared folders will be listed. If you specify a path the first part 
        +will be interpreted as the name of shared folder. Rclone will then try to mount this 
        +shared to the root namespace. On success shared folder rclone proceeds normally. 
        +The shared folder is now pretty much a normal folder and all normal operations 
        +are supported. 
        +
        +Note that we don't unmount the shared folder afterwards so the 
        +--dropbox-shared-folders can be omitted after the first use of a particular 
        +shared folder.
        +
        +Properties:
        +
        +- Config:      shared_folders
        +- Env Var:     RCLONE_DROPBOX_SHARED_FOLDERS
        +- Type:        bool
        +- Default:     false
        +
        +#### --dropbox-pacer-min-sleep
        +
        +Minimum time to sleep between API calls.
        +
        +Properties:
        +
        +- Config:      pacer_min_sleep
        +- Env Var:     RCLONE_DROPBOX_PACER_MIN_SLEEP
        +- Type:        Duration
        +- Default:     10ms
        +
        +#### --dropbox-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_DROPBOX_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot
        +
        +#### --dropbox-batch-mode
        +
        +Upload file batching sync|async|off.
        +
        +This sets the batch mode used by rclone.
        +
        +For full info see [the main docs](https://rclone.org/dropbox/#batch-mode)
        +
        +This has 3 possible values
        +
        +- off - no batching
        +- sync - batch uploads and check completion (default)
        +- async - batch upload and don't check completion
        +
        +Rclone will close any outstanding batches when it exits which may make
        +a delay on quit.
        +
        +
        +Properties:
        +
        +- Config:      batch_mode
        +- Env Var:     RCLONE_DROPBOX_BATCH_MODE
        +- Type:        string
        +- Default:     "sync"
        +
        +#### --dropbox-batch-size
        +
        +Max number of files in upload batch.
        +
        +This sets the batch size of files to upload. It has to be less than 1000.
        +
        +By default this is 0 which means rclone which calculate the batch size
        +depending on the setting of batch_mode.
        +
        +- batch_mode: async - default batch_size is 100
        +- batch_mode: sync - default batch_size is the same as --transfers
        +- batch_mode: off - not in use
        +
        +Rclone will close any outstanding batches when it exits which may make
        +a delay on quit.
        +
        +Setting this is a great idea if you are uploading lots of small files
        +as it will make them a lot quicker. You can use --transfers 32 to
        +maximise throughput.
        +
        +
        +Properties:
        +
        +- Config:      batch_size
        +- Env Var:     RCLONE_DROPBOX_BATCH_SIZE
        +- Type:        int
        +- Default:     0
        +
        +#### --dropbox-batch-timeout
        +
        +Max time to allow an idle upload batch before uploading.
        +
        +If an upload batch is idle for more than this long then it will be
        +uploaded.
        +
        +The default for this is 0 which means rclone will choose a sensible
        +default based on the batch_mode in use.
        +
        +- batch_mode: async - default batch_timeout is 10s
        +- batch_mode: sync - default batch_timeout is 500ms
        +- batch_mode: off - not in use
        +
        +
        +Properties:
        +
        +- Config:      batch_timeout
        +- Env Var:     RCLONE_DROPBOX_BATCH_TIMEOUT
        +- Type:        Duration
        +- Default:     0s
        +
        +#### --dropbox-batch-commit-timeout
        +
        +Max time to wait for a batch to finish committing
        +
        +Properties:
        +
        +- Config:      batch_commit_timeout
        +- Env Var:     RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT
        +- Type:        Duration
        +- Default:     10m0s
        +
        +
        +
        +## Limitations
        +
        +Note that Dropbox is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +There are some file names such as `thumbs.db` which Dropbox can't
        +store.  There is a full list of them in the ["Ignored Files" section
        +of this document](https://www.dropbox.com/en/help/145).  Rclone will
        +issue an error message `File name disallowed - not uploading` if it
        +attempts to upload one of those file names, but the sync won't fail.
        +
        +Some errors may occur if you try to sync copyright-protected files
        +because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that
        +prevents this sort of file being downloaded. This will return the error `ERROR :
        +/path/to/your/file: Failed to copy: failed to open source object:
        +path/restricted_content/.`
        +
        +If you have more than 10,000 files in a directory then `rclone purge
        +dropbox:dir` will return the error `Failed to purge: There are too
        +many files involved in this operation`.  As a work-around do an
        +`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`.
        +
        +When using `rclone link` you'll need to set `--expire` if using a
        +non-personal account otherwise the visibility may not be correct.
        +(Note that `--expire` isn't supported on personal accounts). See the
        +[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the 
        +[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75).
        +
        +## Get your own Dropbox App ID
        +
        +When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users.
        +
        +Here is how to create your own Dropbox App ID for rclone:
        +
        +1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not
        +to be the same account as the Dropbox you want to access)
        +
        +2. Choose an API => Usually this should be `Dropbox API`
        +
        +3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)).
        +
        +4. Name your App. The app name is global, so you can't use `rclone` for example
        +
        +5. Click the button `Create App`
        +
        +6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit`
        +
        +7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add`
        +
        +8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret`
        +
        +#  Enterprise File Fabric
        +
        +This backend supports [Storage Made Easy's Enterprise File
        +Fabric™](https://storagemadeeasy.com/about/) which provides a software
        +solution to integrate and unify File and Object Storage accessible
        +through a global file system.
        +
        +## Configuration
        +
        +The initial setup for the Enterprise File Fabric backend involves
        +getting a token from the Enterprise File Fabric which you need to
        +do in your browser.  `rclone config` walks you through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Enterprise File Fabric  "filefabric" [snip] Storage> filefabric ** See help for filefabric backend at: https://rclone.org/filefabric/ **

        +

        URL of the Enterprise File Fabric to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Storage Made Easy US  "https://storagemadeeasy.com" 2 / Storage Made Easy EU  "https://eu.storagemadeeasy.com" 3 / Connect to your Enterprise File Fabric  "https://yourfabric.smestorage.com" url> https://yourfabric.smestorage.com/ ID of the root folder Leave blank normally.

        +

        Fill in to make rclone start with directory of a given ID.

        +

        Enter a string value. Press Enter for the default (""). root_folder_id> Permanent Authentication Token

        +

        A Permanent Authentication Token can be created in the Enterprise File Fabric, on the users Dashboard under Security, there is an entry you'll see called "My Authentication Tokens". Click the Manage button to create one.

        +

        These tokens are normally valid for several years.

        +

        For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens

        +

        Enter a string value. Press Enter for the default (""). permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [remote] type = filefabric url = https://yourfabric.smestorage.com/ permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Enterprise File Fabric
        +
        +    rclone lsd remote:
        +
        +List all the files in your Enterprise File Fabric
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an Enterprise File Fabric directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +The Enterprise File Fabric allows modification times to be set on
        +files accurate to 1 second.  These will be used to detect whether
        +objects need syncing or not.
        +
        +The Enterprise File Fabric does not support any data hashes at this time.
        +
        +### Restricted filename characters
        +
        +The [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +will be replaced.
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Empty files
        +
        +Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore
        +upload an empty file as a single space with a mime type of
        +`application/vnd.rclone.empty.file` and files with that mime type are
        +treated as empty.
        +
        +### Root folder ID ###
        +
        +You can set the `root_folder_id` for rclone.  This is the directory
        +(identified by its `Folder ID`) that rclone considers to be the root
        +of your Enterprise File Fabric.
        +
        +Normally you will leave this blank and rclone will determine the
        +correct root to use itself.
        +
        +However you can set this to restrict rclone to a specific folder
        +hierarchy.
        +
        +In order to do this you will have to find the `Folder ID` of the
        +directory you wish rclone to display.  These aren't displayed in the
        +web interface, but you can use `rclone lsf` to find them, for example
        +
        +

        $ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ 120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ 120673757,My contacts/ 120673761,S3 Storage/

        +
        
        +The ID for "S3 Storage" would be `120673761`.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to filefabric (Enterprise File Fabric).
        +
        +#### --filefabric-url
        +
        +URL of the Enterprise File Fabric to connect to.
        +
        +Properties:
        +
        +- Config:      url
        +- Env Var:     RCLONE_FILEFABRIC_URL
        +- Type:        string
        +- Required:    true
        +- Examples:
        +    - "https://storagemadeeasy.com"
        +        - Storage Made Easy US
        +    - "https://eu.storagemadeeasy.com"
        +        - Storage Made Easy EU
        +    - "https://yourfabric.smestorage.com"
        +        - Connect to your Enterprise File Fabric
        +
        +#### --filefabric-root-folder-id
        +
        +ID of the root folder.
        +
        +Leave blank normally.
        +
        +Fill in to make rclone start with directory of a given ID.
        +
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_FILEFABRIC_ROOT_FOLDER_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --filefabric-permanent-token
        +
        +Permanent Authentication Token.
        +
        +A Permanent Authentication Token can be created in the Enterprise File
        +Fabric, on the users Dashboard under Security, there is an entry
        +you'll see called "My Authentication Tokens". Click the Manage button
        +to create one.
        +
        +These tokens are normally valid for several years.
        +
        +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens
        +
        +
        +Properties:
        +
        +- Config:      permanent_token
        +- Env Var:     RCLONE_FILEFABRIC_PERMANENT_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to filefabric (Enterprise File Fabric).
        +
        +#### --filefabric-token
        +
        +Session Token.
        +
        +This is a session token which rclone caches in the config file. It is
        +usually valid for 1 hour.
        +
        +Don't set this value - rclone will set it automatically.
        +
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_FILEFABRIC_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --filefabric-token-expiry
        +
        +Token expiry time.
        +
        +Don't set this value - rclone will set it automatically.
        +
        +
        +Properties:
        +
        +- Config:      token_expiry
        +- Env Var:     RCLONE_FILEFABRIC_TOKEN_EXPIRY
        +- Type:        string
        +- Required:    false
        +
        +#### --filefabric-version
        +
        +Version read from the file fabric.
        +
        +Don't set this value - rclone will set it automatically.
        +
        +
        +Properties:
        +
        +- Config:      version
        +- Env Var:     RCLONE_FILEFABRIC_VERSION
        +- Type:        string
        +- Required:    false
        +
        +#### --filefabric-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_FILEFABRIC_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +#  FTP
        +
        +FTP is the File Transfer Protocol. Rclone FTP support is provided using the
        +[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp)
        +package.
        +
        +[Limitations of Rclone's FTP backend](#limitations)
        +
        +Paths are specified as `remote:path`. If the path does not begin with
        +a `/` it is relative to the home directory of the user.  An empty path
        +`remote:` refers to the user's home directory.
        +
        +## Configuration
        +
        +To create an FTP configuration named `remote`, run
        +
        +    rclone config
        +
        +Rclone config guides you through an interactive setup process. A minimal
        +rclone FTP remote definition only requires host, username and password.
        +For an anonymous FTP server, see [below](#anonymous-ftp).
        +
        +

        No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / FTP  "ftp" [snip] Storage> ftp ** See help for ftp backend at: https://rclone.org/ftp/ **

        +

        FTP host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to ftp.example.com  "ftp.example.com" host> ftp.example.com FTP username Enter a string value. Press Enter for the default ("$USER"). user> FTP port number Enter a signed integer. Press Enter for the default (21). port> FTP password y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Use FTP over TLS (Implicit) Enter a boolean value (true or false). Press Enter for the default ("false"). tls> Use FTP over TLS (Explicit) Enter a boolean value (true or false). Press Enter for the default ("false"). explicit_tls> Remote config -------------------- [remote] type = ftp host = ftp.example.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +To see all directories in the home directory of `remote`
        +
        +    rclone lsd remote:
        +
        +Make a new directory
        +
        +    rclone mkdir remote:path/to/directory
        +
        +List the contents of a directory
        +
        +    rclone ls remote:path/to/directory
        +
        +Sync `/home/local/directory` to the remote directory, deleting any
        +excess files in the directory.
        +
        +    rclone sync --interactive /home/local/directory remote:directory
        +
        +### Anonymous FTP
        +
        +When connecting to a FTP server that allows anonymous login, you can use the
        +special "anonymous" username. Traditionally, this user account accepts any
        +string as a password, although it is common to use either the password
        +"anonymous" or "guest". Some servers require the use of a valid e-mail
        +address as password.
        +
        +Using [on-the-fly](#backend-path-to-dir) or
        +[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access
        +such servers, without requiring any configuration in advance. The following
        +are examples of that:
        +
        +    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy)
        +    rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy):
        +
        +The above examples work in Linux shells and in PowerShell, but not Windows
        +Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/)
        +command to create a password string in the format required by the
        +[pass](#ftp-pass) option. The following examples are exactly the same, except use
        +an already obscured string representation of the same password "dummy", and
        +therefore works even in Windows Command Prompt:
        +
        +    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM
        +    rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM:
        +
        +### Implicit TLS
        +
        +Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to
        +be enabled in the FTP backend config for the remote, or with
        +[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and
        +can be set with [`--ftp-port`](#ftp-port).
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +File names cannot end with the following characters. Replacement is
        +limited to the last character in a file name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +
        +Not all FTP servers can have all characters in file names, for example:
        +
        +| FTP Server| Forbidden characters |
        +| --------- |:--------------------:|
        +| proftpd   | `*`                  |
        +| pureftpd  | `\ [ ]`              |
        +
        +This backend's interactive configuration wizard provides a selection of
        +sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd.
        +Just hit a selection number when prompted.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to ftp (FTP).
        +
        +#### --ftp-host
        +
        +FTP host to connect to.
        +
        +E.g. "ftp.example.com".
        +
        +Properties:
        +
        +- Config:      host
        +- Env Var:     RCLONE_FTP_HOST
        +- Type:        string
        +- Required:    true
        +
        +#### --ftp-user
        +
        +FTP username.
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_FTP_USER
        +- Type:        string
        +- Default:     "$USER"
        +
        +#### --ftp-port
        +
        +FTP port number.
        +
        +Properties:
        +
        +- Config:      port
        +- Env Var:     RCLONE_FTP_PORT
        +- Type:        int
        +- Default:     21
        +
        +#### --ftp-pass
        +
        +FTP password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      pass
        +- Env Var:     RCLONE_FTP_PASS
        +- Type:        string
        +- Required:    false
        +
        +#### --ftp-tls
        +
        +Use Implicit FTPS (FTP over TLS).
        +
        +When using implicit FTP over TLS the client connects using TLS
        +right from the start which breaks compatibility with
        +non-TLS-aware servers. This is usually served over port 990 rather
        +than port 21. Cannot be used in combination with explicit FTPS.
        +
        +Properties:
        +
        +- Config:      tls
        +- Env Var:     RCLONE_FTP_TLS
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-explicit-tls
        +
        +Use Explicit FTPS (FTP over TLS).
        +
        +When using explicit FTP over TLS the client explicitly requests
        +security from the server in order to upgrade a plain text connection
        +to an encrypted one. Cannot be used in combination with implicit FTPS.
        +
        +Properties:
        +
        +- Config:      explicit_tls
        +- Env Var:     RCLONE_FTP_EXPLICIT_TLS
        +- Type:        bool
        +- Default:     false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to ftp (FTP).
        +
        +#### --ftp-concurrency
        +
        +Maximum number of FTP simultaneous connections, 0 for unlimited.
        +
        +Note that setting this is very likely to cause deadlocks so it should
        +be used with care.
        +
        +If you are doing a sync or copy then make sure concurrency is one more
        +than the sum of `--transfers` and `--checkers`.
        +
        +If you use `--check-first` then it just needs to be one more than the
        +maximum of `--checkers` and `--transfers`.
        +
        +So for `concurrency 3` you'd use `--checkers 2 --transfers 2
        +--check-first` or `--checkers 1 --transfers 1`.
        +
        +
        +
        +Properties:
        +
        +- Config:      concurrency
        +- Env Var:     RCLONE_FTP_CONCURRENCY
        +- Type:        int
        +- Default:     0
        +
        +#### --ftp-no-check-certificate
        +
        +Do not verify the TLS certificate of the server.
        +
        +Properties:
        +
        +- Config:      no_check_certificate
        +- Env Var:     RCLONE_FTP_NO_CHECK_CERTIFICATE
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-disable-epsv
        +
        +Disable using EPSV even if server advertises support.
        +
        +Properties:
        +
        +- Config:      disable_epsv
        +- Env Var:     RCLONE_FTP_DISABLE_EPSV
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-disable-mlsd
        +
        +Disable using MLSD even if server advertises support.
        +
        +Properties:
        +
        +- Config:      disable_mlsd
        +- Env Var:     RCLONE_FTP_DISABLE_MLSD
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-disable-utf8
        +
        +Disable using UTF-8 even if server advertises support.
        +
        +Properties:
        +
        +- Config:      disable_utf8
        +- Env Var:     RCLONE_FTP_DISABLE_UTF8
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-writing-mdtm
        +
        +Use MDTM to set modification time (VsFtpd quirk)
        +
        +Properties:
        +
        +- Config:      writing_mdtm
        +- Env Var:     RCLONE_FTP_WRITING_MDTM
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-force-list-hidden
        +
        +Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD.
        +
        +Properties:
        +
        +- Config:      force_list_hidden
        +- Env Var:     RCLONE_FTP_FORCE_LIST_HIDDEN
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-idle-timeout
        +
        +Max time before closing idle connections.
        +
        +If no connections have been returned to the connection pool in the time
        +given, rclone will empty the connection pool.
        +
        +Set to 0 to keep connections indefinitely.
        +
        +
        +Properties:
        +
        +- Config:      idle_timeout
        +- Env Var:     RCLONE_FTP_IDLE_TIMEOUT
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --ftp-close-timeout
        +
        +Maximum time to wait for a response to close.
        +
        +Properties:
        +
        +- Config:      close_timeout
        +- Env Var:     RCLONE_FTP_CLOSE_TIMEOUT
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --ftp-tls-cache-size
        +
        +Size of TLS session cache for all control and data connections.
        +
        +TLS cache allows to resume TLS sessions and reuse PSK between connections.
        +Increase if default size is not enough resulting in TLS resumption errors.
        +Enabled by default. Use 0 to disable.
        +
        +Properties:
        +
        +- Config:      tls_cache_size
        +- Env Var:     RCLONE_FTP_TLS_CACHE_SIZE
        +- Type:        int
        +- Default:     32
        +
        +#### --ftp-disable-tls13
        +
        +Disable TLS 1.3 (workaround for FTP servers with buggy TLS)
        +
        +Properties:
        +
        +- Config:      disable_tls13
        +- Env Var:     RCLONE_FTP_DISABLE_TLS13
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-shut-timeout
        +
        +Maximum time to wait for data connection closing status.
        +
        +Properties:
        +
        +- Config:      shut_timeout
        +- Env Var:     RCLONE_FTP_SHUT_TIMEOUT
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --ftp-ask-password
        +
        +Allow asking for FTP password when needed.
        +
        +If this is set and no password is supplied then rclone will ask for a password
        +
        +
        +Properties:
        +
        +- Config:      ask_password
        +- Env Var:     RCLONE_FTP_ASK_PASSWORD
        +- Type:        bool
        +- Default:     false
        +
        +#### --ftp-socks-proxy
        +
        +Socks 5 proxy host.
        +        
        +        Supports the format user:pass@host:port, user@host:port, host:port.
        +        
        +        Example:
        +        
        +            myUser:myPass@localhost:9005
        +        
        +
        +Properties:
        +
        +- Config:      socks_proxy
        +- Env Var:     RCLONE_FTP_SOCKS_PROXY
        +- Type:        string
        +- Required:    false
        +
        +#### --ftp-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_FTP_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,Del,Ctl,RightSpace,Dot
        +- Examples:
        +    - "Asterisk,Ctl,Dot,Slash"
        +        - ProFTPd can't handle '*' in file names
        +    - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket"
        +        - PureFTPd can't handle '[]' or '*' in file names
        +    - "Ctl,LeftPeriod,Slash"
        +        - VsFTPd can't handle file names starting with dot
        +
        +
        +
        +## Limitations
        +
        +FTP servers acting as rclone remotes must support `passive` mode.
        +The mode cannot be configured as `passive` is the only supported one.
        +Rclone's FTP implementation is not compatible with `active` mode
        +as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29).
        +This will likely never be supported due to security concerns.
        +
        +Rclone's FTP backend does not support any checksums but can compare
        +file sizes.
        +
        +`rclone about` is not supported by the FTP backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +The implementation of : `--dump headers`,
        +`--dump bodies`, `--dump auth` for debugging isn't the same as
        +for rclone HTTP based backends - it has less fine grained control.
        +
        +`--timeout` isn't supported (but `--contimeout` is).
        +
        +`--bind` isn't supported.
        +
        +Rclone's FTP backend could support server-side move but does not
        +at present.
        +
        +The `ftp_proxy` environment variable is not currently supported.
        +
        +### Modification times
        +
        +File modification time (timestamps) is supported to 1 second resolution
        +for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server.
        +The `VsFTPd` server has non-standard implementation of time related protocol
        +commands and needs a special configuration setting: `writing_mdtm = true`.
        +
        +Support for precise file time with other FTP servers varies depending on what
        +protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM`
        +extensions are present, rclone will use them together to provide precise time.
        +Otherwise the times you see on the FTP server through rclone are those of the
        +last file upload.
        +
        +You can use the following command to check whether rclone can use precise time
        +with your FTP server: `rclone backend features your_ftp_remote:` (the trailing
        +colon is important). Look for the number in the line tagged by `Precision`
        +designating the remote time precision expressed as nanoseconds. A value of
        +`1000000000` means that file time precision of 1 second is available.
        +A value of `3153600000000000000` (or another large number) means "unsupported".
        +
        +#  Google Cloud Storage
        +
        +Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
        +command.)  You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`.
        +
        +## Configuration
        +
        +The initial setup for google cloud storage involves getting a token from Google Cloud Storage
        +which you need to do in your browser.  `rclone config` walks you
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +
          +
        1. New remote
        2. +
        3. Delete remote
        4. +
        5. Quit config e/n/d/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Google Cloud Storage (this is not Google Drive)  "google cloud storage" [snip] Storage> google cloud storage Google Application Client Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. client_secret> Project number optional - needed only for list/create/delete buckets - see your developer console. project_number> 12345678 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> Access Control List for new objects. Choose a number from below, or type in your own value 1 / Object owner gets OWNER access, and all Authenticated Users get READER access.  "authenticatedRead" 2 / Object owner gets OWNER access, and project team owners get OWNER access.  "bucketOwnerFullControl" 3 / Object owner gets OWNER access, and project team owners get READER access.  "bucketOwnerRead" 4 / Object owner gets OWNER access [default if left blank].  "private" 5 / Object owner gets OWNER access, and project team members get access according to their roles.  "projectPrivate" 6 / Object owner gets OWNER access, and all Users get READER access.  "publicRead" object_acl> 4 Access Control List for new buckets. Choose a number from below, or type in your own value 1 / Project team owners get OWNER access, and all Authenticated Users get READER access.  "authenticatedRead" 2 / Project team owners get OWNER access [default if left blank].  "private" 3 / Project team members get access according to their roles.  "projectPrivate" 4 / Project team owners get OWNER access, and all Users get READER access.  "publicRead" 5 / Project team owners get OWNER access, and all Users get WRITER access.  "publicReadWrite" bucket_acl> 2 Location for the newly created buckets. Choose a number from below, or type in your own value 1 / Empty for default location (US).  "" 2 / Multi-regional location for Asia.  "asia" 3 / Multi-regional location for Europe.  "eu" 4 / Multi-regional location for United States.  "us" 5 / Taiwan.  "asia-east1" 6 / Tokyo.  "asia-northeast1" 7 / Singapore.  "asia-southeast1" 8 / Sydney.  "australia-southeast1" 9 / Belgium.  "europe-west1" 10 / London.  "europe-west2" 11 / Iowa.  "us-central1" 12 / South Carolina.  "us-east1" 13 / Northern Virginia.  "us-east4" 14 / Oregon.  "us-west1" location> 12 The storage class to use when storing objects in Google Cloud Storage. Choose a number from below, or type in your own value 1 / Default  "" 2 / Multi-regional storage class  "MULTI_REGIONAL" 3 / Regional storage class  "REGIONAL" 4 / Nearline storage class  "NEARLINE" 5 / Coldline storage class  "COLDLINE" 6 / Durable reduced availability storage class  "DURABLE_REDUCED_AVAILABILITY" storage_class> 5 Remote config Use web browser to automatically authenticate rclone with remote?
        6. +
          -
        • Config: user_agent
        • -
        • Env Var: RCLONE_SIA_USER_AGENT
        • -
        • Type: string
        • -
        • Default: "Sia-Agent"
        • +
        • Say Y if the machine running rclone has a web browser you can use
        • +
        • Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
        -

        --sia-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_SIA_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot
        • -
        -

        Limitations

        -
          -
        • Modification times not supported
        • -
        • Checksums not supported
        • -
        • rclone about not supported
        • -
        • rclone can work only with Siad or Sia-UI at the moment, the SkyNet daemon is not supported yet.
        • -
        • Sia does not allow control characters or symbols like question and pound signs in file names. rclone will transparently encode them for you, but you'd better be aware
        • -
        -

        Swift

        -

        Swift refers to OpenStack Object Storage. Commercial implementations of that being:

        - -

        Paths are specified as remote:container (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:container/path/to/dir.

        -

        Configuration

        -

        Here is an example of making a swift configuration. First run

        -
        rclone config
        -

        This will guide you through an interactive setup process.

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> remote
        -Type of storage to configure.
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
        -   \ "swift"
        -[snip]
        -Storage> swift
        -Get swift credentials from environment variables in standard OpenStack form.
        -Choose a number from below, or type in your own value
        - 1 / Enter swift credentials in the next step
        -   \ "false"
        - 2 / Get swift credentials from environment vars. Leave other fields blank if using this.
        -   \ "true"
        -env_auth> true
        -User name to log in (OS_USERNAME).
        -user> 
        -API key or password (OS_PASSWORD).
        -key> 
        -Authentication URL for server (OS_AUTH_URL).
        -Choose a number from below, or type in your own value
        - 1 / Rackspace US
        -   \ "https://auth.api.rackspacecloud.com/v1.0"
        - 2 / Rackspace UK
        -   \ "https://lon.auth.api.rackspacecloud.com/v1.0"
        - 3 / Rackspace v2
        -   \ "https://identity.api.rackspacecloud.com/v2.0"
        - 4 / Memset Memstore UK
        -   \ "https://auth.storage.memset.com/v1.0"
        - 5 / Memset Memstore UK v2
        -   \ "https://auth.storage.memset.com/v2.0"
        - 6 / OVH
        -   \ "https://auth.cloud.ovh.net/v3"
        -auth> 
        -User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID).
        -user_id> 
        -User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)
        -domain> 
        -Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME)
        -tenant> 
        -Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID)
        -tenant_id> 
        -Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME)
        -tenant_domain> 
        -Region name - optional (OS_REGION_NAME)
        -region> 
        -Storage URL - optional (OS_STORAGE_URL)
        -storage_url> 
        -Auth Token from alternate authentication - optional (OS_AUTH_TOKEN)
        -auth_token> 
        -AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION)
        -auth_version> 
        -Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE)
        -Choose a number from below, or type in your own value
        - 1 / Public (default, choose this if not sure)
        -   \ "public"
        - 2 / Internal (use internal service net)
        -   \ "internal"
        - 3 / Admin
        -   \ "admin"
        -endpoint_type> 
        -Remote config
        ---------------------
        -[test]
        -env_auth = true
        -user = 
        -key = 
        -auth = 
        -user_id = 
        -domain = 
        -tenant = 
        -tenant_id = 
        -tenant_domain = 
        -region = 
        -storage_url = 
        -auth_token = 
        -auth_version = 
        -endpoint_type = 
        ---------------------
        -y) Yes this is OK
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -

        This remote is called remote and can now be used like this

        -

        See all containers

        -
        rclone lsd remote:
        -

        Make a new container

        -
        rclone mkdir remote:container
        -

        List the contents of a container

        -
        rclone ls remote:container
        -

        Sync /home/local/directory to the remote container, deleting any excess files in the container.

        -
        rclone sync --interactive /home/local/directory remote:container
        -

        Configuration from an OpenStack credentials file

        -

        An OpenStack credentials file typically looks something something like this (without the comments)

        -
        export OS_AUTH_URL=https://a.provider.net/v2.0
        -export OS_TENANT_ID=ffffffffffffffffffffffffffffffff
        -export OS_TENANT_NAME="1234567890123456"
        -export OS_USERNAME="123abc567xy"
        -echo "Please enter your OpenStack Password: "
        -read -sr OS_PASSWORD_INPUT
        -export OS_PASSWORD=$OS_PASSWORD_INPUT
        -export OS_REGION_NAME="SBG1"
        -if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi
        -

        The config file needs to look something like this where $OS_USERNAME represents the value of the OS_USERNAME variable - 123abc567xy in the example above.

        -
        [remote]
        -type = swift
        -user = $OS_USERNAME
        -key = $OS_PASSWORD
        -auth = $OS_AUTH_URL
        -tenant = $OS_TENANT_NAME
        -

        Note that you may (or may not) need to set region too - try without first.

        -

        Configuration from the environment

        -

        If you prefer you can configure rclone to use swift using a standard set of OpenStack environment variables.

        -

        When you run through the config, make sure you choose true for env_auth and leave everything else blank.

        -

        rclone will then set any empty config parameters from the environment using standard OpenStack environment variables. There is a list of the variables in the docs for the swift library.

        -

        Using an alternate authentication method

        -

        If your OpenStack installation uses a non-standard authentication method that might not be yet supported by rclone or the underlying swift library, you can authenticate externally (e.g. calling manually the openstack commands to get a token). Then, you just need to pass the two configuration variables auth_token and storage_url. If they are both provided, the other variables are ignored. rclone will not try to authenticate but instead assume it is already authenticated and use these two variables to access the OpenStack installation.

        -

        Using rclone without a config file

        -

        You can use rclone with swift without a config file, if desired, like this:

        -
        source openstack-credentials-file
        -export RCLONE_CONFIG_MYREMOTE_TYPE=swift
        -export RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true
        -rclone lsd myremote:
        -

        --fast-list

        -

        This remote supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details.

        -

        --update and --use-server-modtime

        -

        As noted below, the modified time is stored on metadata on the object. It is used by default for all operations that require checking the time a file was last updated. It allows rclone to treat the remote more like a true filesystem, but it is inefficient because it requires an extra API call to retrieve the metadata.

        -

        For many operations, the time the object was last uploaded to the remote is sufficient to determine if it is "dirty". By using --update along with --use-server-modtime, you can avoid the extra API call and simply upload files whose local modtime is newer than the time it was last uploaded.

        -

        Modified time

        -

        The modified time is stored as metadata on the object as X-Object-Meta-Mtime as floating point since the epoch accurate to 1 ns.

        -

        This is a de facto standard (used in the official python-swiftclient amongst others) for storing the modification time for an object.

        -

        Restricted filename characters

        +
          +
        1. Yes
        2. +
        3. No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = google cloud storage client_id = client_secret = token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} project_number = 12345678 object_acl = private bucket_acl = private --------------------
        4. +
        5. Yes this is OK
        6. +
        7. Edit this remote
        8. +
        9. Delete this remote y/e/d> y
        10. +
        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from Google if using web browser to automatically 
        +authenticate. This only
        +runs from the moment it opens your browser to the moment you get back
        +the verification code.  This is on `http://127.0.0.1:53682/` and this
        +it may require you to unblock it temporarily if you are running a host
        +firewall, or use manual mode.
        +
        +This remote is called `remote` and can now be used like this
        +
        +See all the buckets in your project
        +
        +    rclone lsd remote:
        +
        +Make a new bucket
        +
        +    rclone mkdir remote:bucket
        +
        +List the contents of a bucket
        +
        +    rclone ls remote:bucket
        +
        +Sync `/home/local/directory` to the remote bucket, deleting any excess
        +files in the bucket.
        +
        +    rclone sync --interactive /home/local/directory remote:bucket
        +
        +### Service Account support
        +
        +You can set up rclone with Google Cloud Storage in an unattended mode,
        +i.e. not tied to a specific end-user Google account. This is useful
        +when you want to synchronise files onto machines that don't have
        +actively logged-in users, for example build machines.
        +
        +To get credentials for Google Cloud Platform
        +[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts),
        +please head to the
        +[Service Account](https://console.cloud.google.com/permissions/serviceaccounts)
        +section of the Google Developer Console. Service Accounts behave just
        +like normal `User` permissions in
        +[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control),
        +so you can limit their access (e.g. make them read only). After
        +creating an account, a JSON file containing the Service Account's
        +credentials will be downloaded onto your machines. These credentials
        +are what rclone will use for authentication.
        +
        +To use a Service Account instead of OAuth2 token flow, enter the path
        +to your Service Account credentials at the `service_account_file`
        +prompt and rclone won't use the browser based authentication
        +flow. If you'd rather stuff the contents of the credentials file into
        +the rclone config file, you can set `service_account_credentials` with
        +the actual contents of the file instead, or set the equivalent
        +environment variable.
        +
        +### Anonymous Access
        +
        +For downloads of objects that permit public access you can configure rclone
        +to use anonymous access by setting `anonymous` to `true`.
        +With unauthorized access you can't write or create files but only read or list
        +those buckets and objects that have public read access.
        +
        +### Application Default Credentials
        +
        +If no other source of credentials is provided, rclone will fall back
        +to
        +[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials)
        +this is useful both when you already have configured authentication
        +for your developer account, or in production when running on a google
        +compute host. Note that if running in docker, you may need to run
        +additional commands on your google compute machine -
        +[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper).
        +
        +Note that in the case application default credentials are used, there
        +is no need to explicitly configure a project number.
        +
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +### Custom upload headers
        +
        +You can set custom upload headers with the `--header-upload`
        +flag. Google Cloud Storage supports the headers as described in the
        +[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata)
        +
        +- Cache-Control
        +- Content-Disposition
        +- Content-Encoding
        +- Content-Language
        +- Content-Type
        +- X-Goog-Storage-Class
        +- X-Goog-Meta-
        +
        +Eg `--header-upload "Content-Type text/potato"`
        +
        +Note that the last of these is for setting custom metadata in the form
        +`--header-upload "x-goog-meta-key: value"`
        +
        +### Modification times
        +
        +Google Cloud Storage stores md5sum natively.
        +Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time
        +with one-second precision as `goog-reserved-file-mtime` in file metadata.
        +
        +To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries.
        +`mtime` uses RFC3339 format with one-nanosecond precision.
        +`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision.
        +To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time.
        +
        +Note that rclone's default modify window is 1ns.
        +Files uploaded by gsutil only contain timestamps with one-second precision.
        +If you use rclone to sync files previously uploaded by gsutil,
        +rclone will attempt to update modification time for all these files.
        +To avoid these possibly unnecessary updates, use `--modify-window 1s`.
        +
        +### Restricted filename characters
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| NUL       | 0x00  | ␀           |
        +| LF        | 0x0A  | ␊           |
        +| CR        | 0x0D  | ␍           |
        +| /         | 0x2F  | /          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).
        +
        +#### --gcs-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_GCS_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_GCS_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-project-number
        +
        +Project number.
        +
        +Optional - needed only for list/create/delete buckets - see your developer console.
        +
        +Properties:
        +
        +- Config:      project_number
        +- Env Var:     RCLONE_GCS_PROJECT_NUMBER
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-user-project
        +
        +User project.
        +
        +Optional - needed only for requester pays.
        +
        +Properties:
        +
        +- Config:      user_project
        +- Env Var:     RCLONE_GCS_USER_PROJECT
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-service-account-file
        +
        +Service Account Credentials JSON file path.
        +
        +Leave blank normally.
        +Needed only if you want use SA instead of interactive login.
        +
        +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
        +
        +Properties:
        +
        +- Config:      service_account_file
        +- Env Var:     RCLONE_GCS_SERVICE_ACCOUNT_FILE
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-service-account-credentials
        +
        +Service Account Credentials JSON blob.
        +
        +Leave blank normally.
        +Needed only if you want use SA instead of interactive login.
        +
        +Properties:
        +
        +- Config:      service_account_credentials
        +- Env Var:     RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-anonymous
        +
        +Access public buckets and objects without credentials.
        +
        +Set to 'true' if you just want to download files and don't configure credentials.
        +
        +Properties:
        +
        +- Config:      anonymous
        +- Env Var:     RCLONE_GCS_ANONYMOUS
        +- Type:        bool
        +- Default:     false
        +
        +#### --gcs-object-acl
        +
        +Access Control List for new objects.
        +
        +Properties:
        +
        +- Config:      object_acl
        +- Env Var:     RCLONE_GCS_OBJECT_ACL
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "authenticatedRead"
        +        - Object owner gets OWNER access.
        +        - All Authenticated Users get READER access.
        +    - "bucketOwnerFullControl"
        +        - Object owner gets OWNER access.
        +        - Project team owners get OWNER access.
        +    - "bucketOwnerRead"
        +        - Object owner gets OWNER access.
        +        - Project team owners get READER access.
        +    - "private"
        +        - Object owner gets OWNER access.
        +        - Default if left blank.
        +    - "projectPrivate"
        +        - Object owner gets OWNER access.
        +        - Project team members get access according to their roles.
        +    - "publicRead"
        +        - Object owner gets OWNER access.
        +        - All Users get READER access.
        +
        +#### --gcs-bucket-acl
        +
        +Access Control List for new buckets.
        +
        +Properties:
        +
        +- Config:      bucket_acl
        +- Env Var:     RCLONE_GCS_BUCKET_ACL
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "authenticatedRead"
        +        - Project team owners get OWNER access.
        +        - All Authenticated Users get READER access.
        +    - "private"
        +        - Project team owners get OWNER access.
        +        - Default if left blank.
        +    - "projectPrivate"
        +        - Project team members get access according to their roles.
        +    - "publicRead"
        +        - Project team owners get OWNER access.
        +        - All Users get READER access.
        +    - "publicReadWrite"
        +        - Project team owners get OWNER access.
        +        - All Users get WRITER access.
        +
        +#### --gcs-bucket-policy-only
        +
        +Access checks should use bucket-level IAM policies.
        +
        +If you want to upload objects to a bucket with Bucket Policy Only set
        +then you will need to set this.
        +
        +When it is set, rclone:
        +
        +- ignores ACLs set on buckets
        +- ignores ACLs set on objects
        +- creates buckets with Bucket Policy Only set
        +
        +Docs: https://cloud.google.com/storage/docs/bucket-policy-only
        +
        +
        +Properties:
        +
        +- Config:      bucket_policy_only
        +- Env Var:     RCLONE_GCS_BUCKET_POLICY_ONLY
        +- Type:        bool
        +- Default:     false
        +
        +#### --gcs-location
        +
        +Location for the newly created buckets.
        +
        +Properties:
        +
        +- Config:      location
        +- Env Var:     RCLONE_GCS_LOCATION
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - Empty for default location (US)
        +    - "asia"
        +        - Multi-regional location for Asia
        +    - "eu"
        +        - Multi-regional location for Europe
        +    - "us"
        +        - Multi-regional location for United States
        +    - "asia-east1"
        +        - Taiwan
        +    - "asia-east2"
        +        - Hong Kong
        +    - "asia-northeast1"
        +        - Tokyo
        +    - "asia-northeast2"
        +        - Osaka
        +    - "asia-northeast3"
        +        - Seoul
        +    - "asia-south1"
        +        - Mumbai
        +    - "asia-south2"
        +        - Delhi
        +    - "asia-southeast1"
        +        - Singapore
        +    - "asia-southeast2"
        +        - Jakarta
        +    - "australia-southeast1"
        +        - Sydney
        +    - "australia-southeast2"
        +        - Melbourne
        +    - "europe-north1"
        +        - Finland
        +    - "europe-west1"
        +        - Belgium
        +    - "europe-west2"
        +        - London
        +    - "europe-west3"
        +        - Frankfurt
        +    - "europe-west4"
        +        - Netherlands
        +    - "europe-west6"
        +        - Zürich
        +    - "europe-central2"
        +        - Warsaw
        +    - "us-central1"
        +        - Iowa
        +    - "us-east1"
        +        - South Carolina
        +    - "us-east4"
        +        - Northern Virginia
        +    - "us-west1"
        +        - Oregon
        +    - "us-west2"
        +        - California
        +    - "us-west3"
        +        - Salt Lake City
        +    - "us-west4"
        +        - Las Vegas
        +    - "northamerica-northeast1"
        +        - Montréal
        +    - "northamerica-northeast2"
        +        - Toronto
        +    - "southamerica-east1"
        +        - São Paulo
        +    - "southamerica-west1"
        +        - Santiago
        +    - "asia1"
        +        - Dual region: asia-northeast1 and asia-northeast2.
        +    - "eur4"
        +        - Dual region: europe-north1 and europe-west4.
        +    - "nam4"
        +        - Dual region: us-central1 and us-east1.
        +
        +#### --gcs-storage-class
        +
        +The storage class to use when storing objects in Google Cloud Storage.
        +
        +Properties:
        +
        +- Config:      storage_class
        +- Env Var:     RCLONE_GCS_STORAGE_CLASS
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - Default
        +    - "MULTI_REGIONAL"
        +        - Multi-regional storage class
        +    - "REGIONAL"
        +        - Regional storage class
        +    - "NEARLINE"
        +        - Nearline storage class
        +    - "COLDLINE"
        +        - Coldline storage class
        +    - "ARCHIVE"
        +        - Archive storage class
        +    - "DURABLE_REDUCED_AVAILABILITY"
        +        - Durable reduced availability storage class
        +
        +#### --gcs-env-auth
        +
        +Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars).
        +
        +Only applies if service_account_file and service_account_credentials is blank.
        +
        +Properties:
        +
        +- Config:      env_auth
        +- Env Var:     RCLONE_GCS_ENV_AUTH
        +- Type:        bool
        +- Default:     false
        +- Examples:
        +    - "false"
        +        - Enter credentials in the next step.
        +    - "true"
        +        - Get GCP IAM credentials from the environment (env vars or IAM).
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).
        +
        +#### --gcs-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_GCS_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_GCS_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_GCS_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-directory-markers
        +
        +Upload an empty object with a trailing slash when a new directory is created
        +
        +Empty folders are unsupported for bucket based remotes, this option creates an empty
        +object ending with "/", to persist the folder.
        +
        +
        +Properties:
        +
        +- Config:      directory_markers
        +- Env Var:     RCLONE_GCS_DIRECTORY_MARKERS
        +- Type:        bool
        +- Default:     false
        +
        +#### --gcs-no-check-bucket
        +
        +If set, don't attempt to check the bucket exists or create it.
        +
        +This can be useful when trying to minimise the number of transactions
        +rclone does if you know the bucket exists already.
        +
        +
        +Properties:
        +
        +- Config:      no_check_bucket
        +- Env Var:     RCLONE_GCS_NO_CHECK_BUCKET
        +- Type:        bool
        +- Default:     false
        +
        +#### --gcs-decompress
        +
        +If set this will decompress gzip encoded objects.
        +
        +It is possible to upload objects to GCS with "Content-Encoding: gzip"
        +set. Normally rclone will download these files as compressed objects.
        +
        +If this flag is set then rclone will decompress these files with
        +"Content-Encoding: gzip" as they are received. This means that rclone
        +can't check the size and hash but the file contents will be decompressed.
        +
        +
        +Properties:
        +
        +- Config:      decompress
        +- Env Var:     RCLONE_GCS_DECOMPRESS
        +- Type:        bool
        +- Default:     false
        +
        +#### --gcs-endpoint
        +
        +Endpoint for the service.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_GCS_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --gcs-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_GCS_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,CrLf,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +`rclone about` is not supported by the Google Cloud Storage backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +#  Google Drive
        +
        +Paths are specified as `drive:path`
        +
        +Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for drive involves getting a token from Google drive
        +which you need to do in your browser.  `rclone config` walks you
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Google Drive  "drive" [snip] Storage> drive Google Application Client Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. client_secret> Scope that rclone should use when requesting access from drive. Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder.  "drive" 2 / Read-only access to file metadata and file contents.  "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app.  "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website.  "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content.  "drive.metadata.readonly" scope> 1 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> n -------------------- [remote] client_id = client_secret = scope = drive root_folder_id = service_account_file = token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from Google if using web browser to automatically 
        +authenticate. This only
        +runs from the moment it opens your browser to the moment you get back
        +the verification code.  This is on `http://127.0.0.1:53682/` and it
        +may require you to unblock it temporarily if you are running a host
        +firewall, or use manual mode.
        +
        +You can then use it like this,
        +
        +List directories in top level of your drive
        +
        +    rclone lsd remote:
        +
        +List all the files in your drive
        +
        +    rclone ls remote:
        +
        +To copy a local directory to a drive directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Scopes
        +
        +Rclone allows you to select which scope you would like for rclone to
        +use.  This changes what type of token is granted to rclone.  [The
        +scopes are defined
        +here](https://developers.google.com/drive/v3/web/about-auth).
        +
        +A comma-separated list is allowed e.g. `drive.readonly,drive.file`.
        +
        +The scope are
        +
        +#### drive
        +
        +This is the default scope and allows full access to all files, except
        +for the Application Data Folder (see below).
        +
        +Choose this one if you aren't sure.
        +
        +#### drive.readonly
        +
        +This allows read only access to all files.  Files may be listed and
        +downloaded but not uploaded, renamed or deleted.
        +
        +#### drive.file
        +
        +With this scope rclone can read/view/modify only those files and
        +folders it creates.
        +
        +So if you uploaded files to drive via the web interface (or any other
        +means) they will not be visible to rclone.
        +
        +This can be useful if you are using rclone to backup data and you want
        +to be sure confidential data on your drive is not visible to rclone.
        +
        +Files created with this scope are visible in the web interface.
        +
        +#### drive.appfolder
        +
        +This gives rclone its own private area to store files.  Rclone will
        +not be able to see any other files on your drive and you won't be able
        +to see rclone's files from the web interface either.
        +
        +#### drive.metadata.readonly
        +
        +This allows read only access to file names only.  It does not allow
        +rclone to download or upload data, or rename or delete files or
        +directories.
        +
        +### Root folder ID
        +
        +This option has been moved to the advanced section. You can set the `root_folder_id` for rclone.  This is the directory
        +(identified by its `Folder ID`) that rclone considers to be the root
        +of your drive.
        +
        +Normally you will leave this blank and rclone will determine the
        +correct root to use itself.
        +
        +However you can set this to restrict rclone to a specific folder
        +hierarchy or to access data within the "Computers" tab on the drive
        +web interface (where files from Google's Backup and Sync desktop
        +program go).
        +
        +In order to do this you will have to find the `Folder ID` of the
        +directory you wish rclone to display.  This will be the last segment
        +of the URL when you open the relevant folder in the drive web
        +interface.
        +
        +So if the folder you want rclone to use has a URL which looks like
        +`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh`
        +in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as
        +the `root_folder_id` in the config.
        +
        +**NB** folders under the "Computers" tab seem to be read only (drive
        +gives a 500 error) when using rclone.
        +
        +There doesn't appear to be an API to discover the folder IDs of the
        +"Computers" tab - please contact us if you know otherwise!
        +
        +Note also that rclone can't access any data under the "Backups" tab on
        +the google drive web interface yet.
        +
        +### Service Account support
        +
        +You can set up rclone with Google Drive in an unattended mode,
        +i.e. not tied to a specific end-user Google account. This is useful
        +when you want to synchronise files onto machines that don't have
        +actively logged-in users, for example build machines.
        +
        +To use a Service Account instead of OAuth2 token flow, enter the path
        +to your Service Account credentials at the `service_account_file`
        +prompt during `rclone config` and rclone won't use the browser based
        +authentication flow. If you'd rather stuff the contents of the
        +credentials file into the rclone config file, you can set
        +`service_account_credentials` with the actual contents of the file
        +instead, or set the equivalent environment variable.
        +
        +#### Use case - Google Apps/G-suite account and individual Drive
        +
        +Let's say that you are the administrator of a Google Apps (old) or
        +G-suite account.
        +The goal is to store data on an individual's Drive account, who IS
        +a member of the domain.
        +We'll call the domain **example.com**, and the user
        +**foo@example.com**.
        +
        +There's a few steps we need to go through to accomplish this:
        +
        +##### 1. Create a service account for example.com
        +  - To create a service account and obtain its credentials, go to the
        +[Google Developer Console](https://console.developers.google.com).
        +  - You must have a project - create one if you don't.
        +  - Then go to "IAM & admin" -> "Service Accounts".
        +  - Use the "Create Service Account" button. Fill in "Service account name"
        +and "Service account ID" with something that identifies your client.
        +  - Select "Create And Continue". Step 2 and 3 are optional.
        +  - These credentials are what rclone will use for authentication.
        +If you ever need to remove access, press the "Delete service
        +account key" button.
        +
        +##### 2. Allowing API access to example.com Google Drive
        +  - Go to example.com's admin console
        +  - Go into "Security" (or use the search bar)
        +  - Select "Show more" and then "Advanced settings"
        +  - Select "Manage API client access" in the "Authentication" section
        +  - In the "Client Name" field enter the service account's
        +"Client ID" - this can be found in the Developer Console under
        +"IAM & Admin" -> "Service Accounts", then "View Client ID" for
        +the newly created service account.
        +It is a ~21 character numerical string.
        +  - In the next field, "One or More API Scopes", enter
        +`https://www.googleapis.com/auth/drive`
        +to grant access to Google Drive specifically.
        +
        +##### 3. Configure rclone, assuming a new install
        +
        +

        rclone config

        +

        n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select the number shown for Google Drive client_id> # Can be left blank client_secret> # Can be left blank scope> # Select your scope, 1 for example root_folder_id> # Can be left blank service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # Auto config, n

        +
        
        +##### 4. Verify that it's working
        +  - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup`
        +  - The arguments do:
        +    - `-v` - verbose logging
        +    - `--drive-impersonate foo@example.com` - this is what does
        +the magic, pretending to be user foo.
        +    - `lsf` - list files in a parsing friendly way
        +    - `gdrive:backup` - use the remote called gdrive, work in
        +the folder named backup.
        +
        +Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead:
        +  - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1
        +  - use rclone without specifying the `--drive-impersonate` option, like this:
        +        `rclone -v lsf gdrive:backup`
        +
        +
        +### Shared drives (team drives)
        +
        +If you want to configure the remote to point to a Google Shared Drive
        +(previously known as Team Drives) then answer `y` to the question
        +`Configure this as a Shared Drive (Team Drive)?`.
        +
        +This will fetch the list of Shared Drives from google and allow you to
        +configure which one you want to use. You can also type in a Shared
        +Drive ID if you prefer.
        +
        +For example:
        +
        +

        Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y Fetching Shared Drive list... Choose a number from below, or type in your own value 1 / Rclone Test  "xxxxxxxxxxxxxxxxxxxx" 2 / Rclone Test 2  "yyyyyyyyyyyyyyyyyyyy" 3 / Rclone Test 3  "zzzzzzzzzzzzzzzzzzzz" Enter a Shared Drive ID> 1 -------------------- [remote] client_id = client_secret = token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null} team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +It does this by combining multiple `list` calls into a single API request.
        +
        +This works by combining many `'%s' in parents` filters into one expression.
        +To list the contents of directories a, b and c, the following requests will be send by the regular `List` function:
        +

        trashed=false and 'a' in parents trashed=false and 'b' in parents trashed=false and 'c' in parents

        +
        These can now be combined into a single request:
        +

        trashed=false and ('a' in parents or 'b' in parents or 'c' in parents)

        +
        
        +The implementation of `ListR` will put up to 50 `parents` filters into one request.
        +It will  use the `--checkers` value to specify the number of requests to run in parallel.
        +
        +In tests, these batch requests were up to 20x faster than the regular method.
        +Running the following command against different sized folders gives:
        +

        rclone lsjson -vv -R --checkers=6 gdrive:folder

        +
        
        +small folder (220 directories, 700 files):
        +
        +- without `--fast-list`: 38s
        +- with `--fast-list`: 10s
        +
        +large folder (10600 directories, 39000 files):
        +
        +- without `--fast-list`: 22:05 min
        +- with `--fast-list`: 58s
        +
        +### Modification times and hashes
        +
        +Google drive stores modification times accurate to 1 ms.
        +
        +Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however,
        +that a small fraction of files uploaded may not have SHA1 or SHA256
        +hashes especially if they were uploaded before 2018.
        +
        +### Restricted filename characters
        +
        +Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +In contrast to other backends, `/` can also be used in names and `.`
        +or `..` are valid names.
        +
        +### Revisions
        +
        +Google drive stores revisions of files.  When you upload a change to
        +an existing file to google drive using rclone it will create a new
        +revision of that file.
        +
        +Revisions follow the standard google policy which at time of writing
        +was
        +
        +  * They are deleted after 30 days or 100 revisions (whatever comes first).
        +  * They do not count towards a user storage quota.
        +
        +### Deleting files
        +
        +By default rclone will send all files to the trash when deleting
        +files.  If deleting them permanently is required then use the
        +`--drive-use-trash=false` flag, or set the equivalent environment
        +variable.
        +
        +### Shortcuts
        +
        +In March 2020 Google introduced a new feature in Google Drive called
        +[drive shortcuts](https://support.google.com/drive/answer/9700156)
        +([API](https://developers.google.com/drive/api/v3/shortcuts)). These
        +will (by September 2020) [replace the ability for files or folders to
        +be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models).
        +
        +Shortcuts are files that link to other files on Google Drive somewhat
        +like a symlink in unix, except they point to the underlying file data
        +(e.g. the inode in unix terms) so they don't break if the source is
        +renamed or moved about.
        +
        +By default rclone treats these as follows.
        +
        +For shortcuts pointing to files:
        +
        +- When listing a file shortcut appears as the destination file.
        +- When downloading the contents of the destination file is downloaded.
        +- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut.
        +- When server-side moving (renaming) the shortcut is renamed, not the destination file.
        +- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied).
        +- When deleting the shortcut is deleted not the linked file.
        +- When setting the modification time, the modification time of the linked file will be set.
        +
        +For shortcuts pointing to folders:
        +
        +- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders)
        +- When downloading the contents of the linked folder and sub contents are downloaded
        +- When uploading to a shortcut folder the file will be placed in the linked folder
        +- When server-side moving (renaming) the shortcut is renamed, not the destination folder
        +- When server-side copying the contents of the linked folder is copied, not the shortcut.
        +- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder.
        +- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted.
        +
        +The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts.  
        +
        +Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag
        +or the corresponding `skip_shortcuts` configuration setting.
        +
        +### Emptying trash
        +
        +If you wish to empty your trash you can use the `rclone cleanup remote:`
        +command which will permanently delete all your trashed files. This command
        +does not take any path arguments.
        +
        +Note that Google Drive takes some time (minutes to days) to empty the
        +trash even though the command returns within a few seconds.  No output
        +is echoed, so there will be no confirmation even using -v or -vv.
        +
        +### Quota information
        +
        +To view your current quota you can use the `rclone about remote:`
        +command which will display your usage limit (quota), the usage in Google
        +Drive, the size of all files in the Trash and the space used by other
        +Google services such as Gmail. This command does not take any path
        +arguments.
        +
        +#### Import/Export of google documents
        +
        +Google documents can be exported from and uploaded to Google Drive.
        +
        +When rclone downloads a Google doc it chooses a format to download
        +depending upon the `--drive-export-formats` setting.
        +By default the export formats are `docx,xlsx,pptx,svg` which are a
        +sensible default for an editable document.
        +
        +When choosing a format, rclone runs down the list provided in order
        +and chooses the first file format the doc can be exported as from the
        +list. If the file can't be exported to a format on the formats list,
        +then rclone will choose a format from the default list.
        +
        +If you prefer an archive copy then you might use `--drive-export-formats
        +pdf`, or if you prefer openoffice/libreoffice formats you might use
        +`--drive-export-formats ods,odt,odp`.
        +
        +Note that rclone adds the extension to the google doc, so if it is
        +called `My Spreadsheet` on google docs, it will be exported as `My
        +Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc.
        +
        +When importing files into Google Drive, rclone will convert all
        +files with an extension in `--drive-import-formats` to their
        +associated document type.
        +rclone will not convert any files by default, since the conversion
        +is lossy process.
        +
        +The conversion must result in a file with the same extension when
        +the `--drive-export-formats` rules are applied to the uploaded document.
        +
        +Here are some examples for allowed and prohibited conversions.
        +
        +| export-formats | import-formats | Upload Ext | Document Ext | Allowed |
        +| -------------- | -------------- | ---------- | ------------ | ------- |
        +| odt | odt | odt | odt | Yes |
        +| odt | docx,odt | odt | odt | Yes |
        +|  | docx | docx | docx | Yes |
        +|  | odt | odt | docx | No |
        +| odt,docx | docx,odt | docx | odt | No |
        +| docx,odt | docx,odt | docx | docx | Yes |
        +| docx,odt | docx,odt | odt | docx | No |
        +
        +This limitation can be disabled by specifying `--drive-allow-import-name-change`.
        +When using this flag, rclone can convert multiple files types resulting
        +in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`,
        +all files having these extension would result in a document represented as a docx file.
        +This brings the additional risk of overwriting a document, if multiple files
        +have the same stem. Many rclone operations will not handle this name change
        +in any way. They assume an equal name when copying files and might copy the
        +file again or delete them when the name changes. 
        +
        +Here are the possible export extensions with their corresponding mime types.
        +Most of these can also be used for importing, but there more that are not
        +listed here. Some of these additional ones might only be available when
        +the operating system provides the correct MIME type entries.
        +
        +This list can be changed by Google Drive at any time and might not
        +represent the currently available conversions.
        +
        +| Extension | Mime Type | Description |
        +| --------- |-----------| ------------|
        +| bmp  | image/bmp | Windows Bitmap format |
        +| csv  | text/csv | Standard CSV format for Spreadsheets |
        +| doc  | application/msword | Classic Word file |
        +| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document |
        +| epub | application/epub+zip | E-book format |
        +| html | text/html | An HTML Document |
        +| jpg  | image/jpeg | A JPEG Image File |
        +| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts |
        +| odp  | application/vnd.oasis.opendocument.presentation | Openoffice Presentation |
        +| ods  | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet |
        +| ods  | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet |
        +| odt  | application/vnd.oasis.opendocument.text | Openoffice Document |
        +| pdf  | application/pdf | Adobe PDF Format |
        +| pjpeg | image/pjpeg | Progressive JPEG Image |
        +| png  | image/png | PNG Image Format|
        +| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint |
        +| rtf  | application/rtf | Rich Text Format |
        +| svg  | image/svg+xml | Scalable Vector Graphics Format |
        +| tsv  | text/tab-separated-values | Standard TSV format for spreadsheets |
        +| txt  | text/plain | Plain Text |
        +| wmf  | application/x-msmetafile | Windows Meta File |
        +| xls  | application/vnd.ms-excel | Classic Excel file |
        +| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet |
        +| zip  | application/zip | A ZIP file of HTML, Images CSS |
        +
        +Google documents can also be exported as link files. These files will
        +open a browser window for the Google Docs website of that document
        +when opened. The link file extension has to be specified as a
        +`--drive-export-formats` parameter. They will match all available
        +Google Documents.
        +
        +| Extension | Description | OS Support |
        +| --------- | ----------- | ---------- |
        +| desktop | freedesktop.org specified desktop entry | Linux |
        +| link.html | An HTML Document with a redirect | All |
        +| url | INI style link file | macOS, Windows |
        +| webloc | macOS specific XML format | macOS |
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to drive (Google Drive).
        +
        +#### --drive-client-id
        +
        +Google Application Client Id
        +Setting your own is recommended.
        +See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
        +If you leave this blank, it will use an internal key which is low performance.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_DRIVE_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_DRIVE_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-scope
        +
        +Comma separated list of scopes that rclone should use when requesting access from drive.
        +
        +Properties:
        +
        +- Config:      scope
        +- Env Var:     RCLONE_DRIVE_SCOPE
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "drive"
        +        - Full access all files, excluding Application Data Folder.
        +    - "drive.readonly"
        +        - Read-only access to file metadata and file contents.
        +    - "drive.file"
        +        - Access to files created by rclone only.
        +        - These are visible in the drive website.
        +        - File authorization is revoked when the user deauthorizes the app.
        +    - "drive.appfolder"
        +        - Allows read and write access to the Application Data folder.
        +        - This is not visible in the drive website.
        +    - "drive.metadata.readonly"
        +        - Allows read-only access to file metadata but
        +        - does not allow any access to read or download file content.
        +
        +#### --drive-service-account-file
        +
        +Service Account Credentials JSON file path.
        +
        +Leave blank normally.
        +Needed only if you want use SA instead of interactive login.
        +
        +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
        +
        +Properties:
        +
        +- Config:      service_account_file
        +- Env Var:     RCLONE_DRIVE_SERVICE_ACCOUNT_FILE
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-alternate-export
        +
        +Deprecated: No longer needed.
        +
        +Properties:
        +
        +- Config:      alternate_export
        +- Env Var:     RCLONE_DRIVE_ALTERNATE_EXPORT
        +- Type:        bool
        +- Default:     false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to drive (Google Drive).
        +
        +#### --drive-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_DRIVE_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_DRIVE_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_DRIVE_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-root-folder-id
        +
        +ID of the root folder.
        +Leave blank normally.
        +
        +Fill in to access "Computers" folders (see docs), or for rclone to use
        +a non root folder as its starting point.
        +
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_DRIVE_ROOT_FOLDER_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-service-account-credentials
        +
        +Service Account Credentials JSON blob.
        +
        +Leave blank normally.
        +Needed only if you want use SA instead of interactive login.
        +
        +Properties:
        +
        +- Config:      service_account_credentials
        +- Env Var:     RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-team-drive
        +
        +ID of the Shared Drive (Team Drive).
        +
        +Properties:
        +
        +- Config:      team_drive
        +- Env Var:     RCLONE_DRIVE_TEAM_DRIVE
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-auth-owner-only
        +
        +Only consider files owned by the authenticated user.
        +
        +Properties:
        +
        +- Config:      auth_owner_only
        +- Env Var:     RCLONE_DRIVE_AUTH_OWNER_ONLY
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-use-trash
        +
        +Send files to the trash instead of deleting permanently.
        +
        +Defaults to true, namely sending files to the trash.
        +Use `--drive-use-trash=false` to delete files permanently instead.
        +
        +Properties:
        +
        +- Config:      use_trash
        +- Env Var:     RCLONE_DRIVE_USE_TRASH
        +- Type:        bool
        +- Default:     true
        +
        +#### --drive-copy-shortcut-content
        +
        +Server side copy contents of shortcuts instead of the shortcut.
        +
        +When doing server side copies, normally rclone will copy shortcuts as
        +shortcuts.
        +
        +If this flag is used then rclone will copy the contents of shortcuts
        +rather than shortcuts themselves when doing server side copies.
        +
        +Properties:
        +
        +- Config:      copy_shortcut_content
        +- Env Var:     RCLONE_DRIVE_COPY_SHORTCUT_CONTENT
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-skip-gdocs
        +
        +Skip google documents in all listings.
        +
        +If given, gdocs practically become invisible to rclone.
        +
        +Properties:
        +
        +- Config:      skip_gdocs
        +- Env Var:     RCLONE_DRIVE_SKIP_GDOCS
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-show-all-gdocs
        +
        +Show all Google Docs including non-exportable ones in listings.
        +
        +If you try a server side copy on a Google Form without this flag, you
        +will get this error:
        +
        +    No export formats found for "application/vnd.google-apps.form"
        +
        +However adding this flag will allow the form to be server side copied.
        +
        +Note that rclone doesn't add extensions to the Google Docs file names
        +in this mode.
        +
        +Do **not** use this flag when trying to download Google Docs - rclone
        +will fail to download them.
        +
        +
        +Properties:
        +
        +- Config:      show_all_gdocs
        +- Env Var:     RCLONE_DRIVE_SHOW_ALL_GDOCS
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-skip-checksum-gphotos
        +
        +Skip checksums on Google photos and videos only.
        +
        +Use this if you get checksum errors when transferring Google photos or
        +videos.
        +
        +Setting this flag will cause Google photos and videos to return a
        +blank checksums.
        +
        +Google photos are identified by being in the "photos" space.
        +
        +Corrupted checksums are caused by Google modifying the image/video but
        +not updating the checksum.
        +
        +Properties:
        +
        +- Config:      skip_checksum_gphotos
        +- Env Var:     RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-shared-with-me
        +
        +Only show files that are shared with me.
        +
        +Instructs rclone to operate on your "Shared with me" folder (where
        +Google Drive lets you access the files and folders others have shared
        +with you).
        +
        +This works both with the "list" (lsd, lsl, etc.) and the "copy"
        +commands (copy, sync, etc.), and with all other commands too.
        +
        +Properties:
        +
        +- Config:      shared_with_me
        +- Env Var:     RCLONE_DRIVE_SHARED_WITH_ME
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-trashed-only
        +
        +Only show files that are in the trash.
        +
        +This will show trashed files in their original directory structure.
        +
        +Properties:
        +
        +- Config:      trashed_only
        +- Env Var:     RCLONE_DRIVE_TRASHED_ONLY
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-starred-only
        +
        +Only show files that are starred.
        +
        +Properties:
        +
        +- Config:      starred_only
        +- Env Var:     RCLONE_DRIVE_STARRED_ONLY
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-formats
        +
        +Deprecated: See export_formats.
        +
        +Properties:
        +
        +- Config:      formats
        +- Env Var:     RCLONE_DRIVE_FORMATS
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-export-formats
        +
        +Comma separated list of preferred formats for downloading Google docs.
        +
        +Properties:
        +
        +- Config:      export_formats
        +- Env Var:     RCLONE_DRIVE_EXPORT_FORMATS
        +- Type:        string
        +- Default:     "docx,xlsx,pptx,svg"
        +
        +#### --drive-import-formats
        +
        +Comma separated list of preferred formats for uploading Google docs.
        +
        +Properties:
        +
        +- Config:      import_formats
        +- Env Var:     RCLONE_DRIVE_IMPORT_FORMATS
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-allow-import-name-change
        +
        +Allow the filetype to change when uploading Google docs.
        +
        +E.g. file.doc to file.docx. This will confuse sync and reupload every time.
        +
        +Properties:
        +
        +- Config:      allow_import_name_change
        +- Env Var:     RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-use-created-date
        +
        +Use file created date instead of modified date.
        +
        +Useful when downloading data and you want the creation date used in
        +place of the last modified date.
        +
        +**WARNING**: This flag may have some unexpected consequences.
        +
        +When uploading to your drive all files will be overwritten unless they
        +haven't been modified since their creation. And the inverse will occur
        +while downloading.  This side effect can be avoided by using the
        +"--checksum" flag.
        +
        +This feature was implemented to retain photos capture date as recorded
        +by google photos. You will first need to check the "Create a Google
        +Photos folder" option in your google drive settings. You can then copy
        +or move the photos locally and use the date the image was taken
        +(created) set as the modification date.
        +
        +Properties:
        +
        +- Config:      use_created_date
        +- Env Var:     RCLONE_DRIVE_USE_CREATED_DATE
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-use-shared-date
        +
        +Use date file was shared instead of modified date.
        +
        +Note that, as with "--drive-use-created-date", this flag may have
        +unexpected consequences when uploading/downloading files.
        +
        +If both this flag and "--drive-use-created-date" are set, the created
        +date is used.
        +
        +Properties:
        +
        +- Config:      use_shared_date
        +- Env Var:     RCLONE_DRIVE_USE_SHARED_DATE
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-list-chunk
        +
        +Size of listing chunk 100-1000, 0 to disable.
        +
        +Properties:
        +
        +- Config:      list_chunk
        +- Env Var:     RCLONE_DRIVE_LIST_CHUNK
        +- Type:        int
        +- Default:     1000
        +
        +#### --drive-impersonate
        +
        +Impersonate this user when using a service account.
        +
        +Properties:
        +
        +- Config:      impersonate
        +- Env Var:     RCLONE_DRIVE_IMPERSONATE
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-upload-cutoff
        +
        +Cutoff for switching to chunked upload.
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_DRIVE_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     8Mi
        +
        +#### --drive-chunk-size
        +
        +Upload chunk size.
        +
        +Must a power of 2 >= 256k.
        +
        +Making this larger will improve performance, but note that each chunk
        +is buffered in memory one per transfer.
        +
        +Reducing this will reduce memory usage but decrease performance.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_DRIVE_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     8Mi
        +
        +#### --drive-acknowledge-abuse
        +
        +Set to allow files which return cannotDownloadAbusiveFile to be downloaded.
        +
        +If downloading a file returns the error "This file has been identified
        +as malware or spam and cannot be downloaded" with the error code
        +"cannotDownloadAbusiveFile" then supply this flag to rclone to
        +indicate you acknowledge the risks of downloading the file and rclone
        +will download it anyway.
        +
        +Note that if you are using service account it will need Manager
        +permission (not Content Manager) to for this flag to work. If the SA
        +does not have the right permission, Google will just ignore the flag.
        +
        +Properties:
        +
        +- Config:      acknowledge_abuse
        +- Env Var:     RCLONE_DRIVE_ACKNOWLEDGE_ABUSE
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-keep-revision-forever
        +
        +Keep new head revision of each file forever.
        +
        +Properties:
        +
        +- Config:      keep_revision_forever
        +- Env Var:     RCLONE_DRIVE_KEEP_REVISION_FOREVER
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-size-as-quota
        +
        +Show sizes as storage quota usage, not actual size.
        +
        +Show the size of a file as the storage quota used. This is the
        +current version plus any older versions that have been set to keep
        +forever.
        +
        +**WARNING**: This flag may have some unexpected consequences.
        +
        +It is not recommended to set this flag in your config - the
        +recommended usage is using the flag form --drive-size-as-quota when
        +doing rclone ls/lsl/lsf/lsjson/etc only.
        +
        +If you do use this flag for syncing (not recommended) then you will
        +need to use --ignore size also.
        +
        +Properties:
        +
        +- Config:      size_as_quota
        +- Env Var:     RCLONE_DRIVE_SIZE_AS_QUOTA
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-v2-download-min-size
        +
        +If Object's are greater, use drive v2 API to download.
        +
        +Properties:
        +
        +- Config:      v2_download_min_size
        +- Env Var:     RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE
        +- Type:        SizeSuffix
        +- Default:     off
        +
        +#### --drive-pacer-min-sleep
        +
        +Minimum time to sleep between API calls.
        +
        +Properties:
        +
        +- Config:      pacer_min_sleep
        +- Env Var:     RCLONE_DRIVE_PACER_MIN_SLEEP
        +- Type:        Duration
        +- Default:     100ms
        +
        +#### --drive-pacer-burst
        +
        +Number of API calls to allow without sleeping.
        +
        +Properties:
        +
        +- Config:      pacer_burst
        +- Env Var:     RCLONE_DRIVE_PACER_BURST
        +- Type:        int
        +- Default:     100
        +
        +#### --drive-server-side-across-configs
        +
        +Deprecated: use --server-side-across-configs instead.
        +
        +Allow server-side operations (e.g. copy) to work across different drive configs.
        +
        +This can be useful if you wish to do a server-side copy between two
        +different Google drives.  Note that this isn't enabled by default
        +because it isn't easy to tell if it will work between any two
        +configurations.
        +
        +Properties:
        +
        +- Config:      server_side_across_configs
        +- Env Var:     RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-disable-http2
        +
        +Disable drive using http2.
        +
        +There is currently an unsolved issue with the google drive backend and
        +HTTP/2.  HTTP/2 is therefore disabled by default for the drive backend
        +but can be re-enabled here.  When the issue is solved this flag will
        +be removed.
        +
        +See: https://github.com/rclone/rclone/issues/3631
        +
        +
        +
        +Properties:
        +
        +- Config:      disable_http2
        +- Env Var:     RCLONE_DRIVE_DISABLE_HTTP2
        +- Type:        bool
        +- Default:     true
        +
        +#### --drive-stop-on-upload-limit
        +
        +Make upload limit errors be fatal.
        +
        +At the time of writing it is only possible to upload 750 GiB of data to
        +Google Drive a day (this is an undocumented limit). When this limit is
        +reached Google Drive produces a slightly different error message. When
        +this flag is set it causes these errors to be fatal.  These will stop
        +the in-progress sync.
        +
        +Note that this detection is relying on error message strings which
        +Google don't document so it may break in the future.
        +
        +See: https://github.com/rclone/rclone/issues/3857
        +
        +
        +Properties:
        +
        +- Config:      stop_on_upload_limit
        +- Env Var:     RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-stop-on-download-limit
        +
        +Make download limit errors be fatal.
        +
        +At the time of writing it is only possible to download 10 TiB of data from
        +Google Drive a day (this is an undocumented limit). When this limit is
        +reached Google Drive produces a slightly different error message. When
        +this flag is set it causes these errors to be fatal.  These will stop
        +the in-progress sync.
        +
        +Note that this detection is relying on error message strings which
        +Google don't document so it may break in the future.
        +
        +
        +Properties:
        +
        +- Config:      stop_on_download_limit
        +- Env Var:     RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-skip-shortcuts
        +
        +If set skip shortcut files.
        +
        +Normally rclone dereferences shortcut files making them appear as if
        +they are the original file (see [the shortcuts section](#shortcuts)).
        +If this flag is set then rclone will ignore shortcut files completely.
        +
        +
        +Properties:
        +
        +- Config:      skip_shortcuts
        +- Env Var:     RCLONE_DRIVE_SKIP_SHORTCUTS
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-skip-dangling-shortcuts
        +
        +If set skip dangling shortcut files.
        +
        +If this is set then rclone will not show any dangling shortcuts in listings.
        +
        +
        +Properties:
        +
        +- Config:      skip_dangling_shortcuts
        +- Env Var:     RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS
        +- Type:        bool
        +- Default:     false
        +
        +#### --drive-resource-key
        +
        +Resource key for accessing a link-shared file.
        +
        +If you need to access files shared with a link like this
        +
        +    https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing
        +
        +Then you will need to use the first part "XXX" as the "root_folder_id"
        +and the second part "YYY" as the "resource_key" otherwise you will get
        +404 not found errors when trying to access the directory.
        +
        +See: https://developers.google.com/drive/api/guides/resource-keys
        +
        +This resource key requirement only applies to a subset of old files.
        +
        +Note also that opening the folder once in the web interface (with the
        +user you've authenticated rclone with) seems to be enough so that the
        +resource key is not needed.
        +
        +
        +Properties:
        +
        +- Config:      resource_key
        +- Env Var:     RCLONE_DRIVE_RESOURCE_KEY
        +- Type:        string
        +- Required:    false
        +
        +#### --drive-fast-list-bug-fix
        +
        +Work around a bug in Google Drive listing.
        +
        +Normally rclone will work around a bug in Google Drive when using
        +--fast-list (ListR) where the search "(A in parents) or (B in
        +parents)" returns nothing sometimes. See #3114, #4289 and
        +https://issuetracker.google.com/issues/149522397
        +
        +Rclone detects this by finding no items in more than one directory
        +when listing and retries them as lists of individual directories.
        +
        +This means that if you have a lot of empty directories rclone will end
        +up listing them all individually and this can take many more API
        +calls.
        +
        +This flag allows the work-around to be disabled. This is **not**
        +recommended in normal use - only if you have a particular case you are
        +having trouble with like many empty directories.
        +
        +
        +Properties:
        +
        +- Config:      fast_list_bug_fix
        +- Env Var:     RCLONE_DRIVE_FAST_LIST_BUG_FIX
        +- Type:        bool
        +- Default:     true
        +
        +#### --drive-metadata-owner
        +
        +Control whether owner should be read or written in metadata.
        +
        +Owner is a standard part of the file metadata so is easy to read. But it
        +isn't always desirable to set the owner from the metadata.
        +
        +Note that you can't set the owner on Shared Drives, and that setting
        +ownership will generate an email to the new owner (this can't be
        +disabled), and you can't transfer ownership to someone outside your
        +organization.
        +
        +
        +Properties:
        +
        +- Config:      metadata_owner
        +- Env Var:     RCLONE_DRIVE_METADATA_OWNER
        +- Type:        Bits
        +- Default:     read
        +- Examples:
        +    - "off"
        +        - Do not read or write the value
        +    - "read"
        +        - Read the value only
        +    - "write"
        +        - Write the value only
        +    - "read,write"
        +        - Read and Write the value.
        +
        +#### --drive-metadata-permissions
        +
        +Control whether permissions should be read or written in metadata.
        +
        +Reading permissions metadata from files can be done quickly, but it
        +isn't always desirable to set the permissions from the metadata.
        +
        +Note that rclone drops any inherited permissions on Shared Drives and
        +any owner permission on My Drives as these are duplicated in the owner
        +metadata.
        +
        +
        +Properties:
        +
        +- Config:      metadata_permissions
        +- Env Var:     RCLONE_DRIVE_METADATA_PERMISSIONS
        +- Type:        Bits
        +- Default:     off
        +- Examples:
        +    - "off"
        +        - Do not read or write the value
        +    - "read"
        +        - Read the value only
        +    - "write"
        +        - Write the value only
        +    - "read,write"
        +        - Read and Write the value.
        +
        +#### --drive-metadata-labels
        +
        +Control whether labels should be read or written in metadata.
        +
        +Reading labels metadata from files takes an extra API transaction and
        +will slow down listings. It isn't always desirable to set the labels
        +from the metadata.
        +
        +The format of labels is documented in the drive API documentation at
        +https://developers.google.com/drive/api/reference/rest/v3/Label -
        +rclone just provides a JSON dump of this format.
        +
        +When setting labels, the label and fields must already exist - rclone
        +will not create them. This means that if you are transferring labels
        +from two different accounts you will have to create the labels in
        +advance and use the metadata mapper to translate the IDs between the
        +two accounts.
        +
        +
        +Properties:
        +
        +- Config:      metadata_labels
        +- Env Var:     RCLONE_DRIVE_METADATA_LABELS
        +- Type:        Bits
        +- Default:     off
        +- Examples:
        +    - "off"
        +        - Do not read or write the value
        +    - "read"
        +        - Read the value only
        +    - "write"
        +        - Write the value only
        +    - "read,write"
        +        - Read and Write the value.
        +
        +#### --drive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_DRIVE_ENCODING
        +- Type:        Encoding
        +- Default:     InvalidUtf8
        +
        +#### --drive-env-auth
        +
        +Get IAM credentials from runtime (environment variables or instance meta data if no env vars).
        +
        +Only applies if service_account_file and service_account_credentials is blank.
        +
        +Properties:
        +
        +- Config:      env_auth
        +- Env Var:     RCLONE_DRIVE_ENV_AUTH
        +- Type:        bool
        +- Default:     false
        +- Examples:
        +    - "false"
        +        - Enter credentials in the next step.
        +    - "true"
        +        - Get GCP IAM credentials from the environment (env vars or IAM).
        +
        +### Metadata
        +
        +User metadata is stored in the properties field of the drive object.
        +
        +Here are the possible system metadata items for the drive backend.
        +
        +| Name | Help | Type | Example | Read Only |
        +|------|------|------|---------|-----------|
        +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N |
        +| content-type | The MIME type of the file. | string | text/plain | N |
        +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N |
        +| description | A short description of the file. | string | Contract for signing | N |
        +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N |
        +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N |
        +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N |
        +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N |
        +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N |
        +| starred | Whether the user has starred the file. | boolean | false | N |
        +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** |
        +| writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N |
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +## Backend commands
        +
        +Here are the commands specific to the drive backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### get
        +
        +Get command for fetching the drive config parameters
        +
        +    rclone backend get remote: [options] [<arguments>+]
        +
        +This is a get command which will be used to fetch the various drive config parameters
        +
        +Usage Examples:
        +
        +    rclone backend get drive: [-o service_account_file] [-o chunk_size]
        +    rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size]
        +
        +
        +Options:
        +
        +- "chunk_size": show the current upload chunk size
        +- "service_account_file": show the current service account file
        +
        +### set
        +
        +Set command for updating the drive config parameters
        +
        +    rclone backend set remote: [options] [<arguments>+]
        +
        +This is a set command which will be used to update the various drive config parameters
        +
        +Usage Examples:
        +
        +    rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
        +    rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
        +
        +
        +Options:
        +
        +- "chunk_size": update the current upload chunk size
        +- "service_account_file": update the current service account file
        +
        +### shortcut
        +
        +Create shortcuts from files or directories
        +
        +    rclone backend shortcut remote: [options] [<arguments>+]
        +
        +This command creates shortcuts from files or directories.
        +
        +Usage:
        +
        +    rclone backend shortcut drive: source_item destination_shortcut
        +    rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut
        +
        +In the first example this creates a shortcut from the "source_item"
        +which can be a file or a directory to the "destination_shortcut". The
        +"source_item" and the "destination_shortcut" should be relative paths
        +from "drive:"
        +
        +In the second example this creates a shortcut from the "source_item"
        +relative to "drive:" to the "destination_shortcut" relative to
        +"drive2:". This may fail with a permission error if the user
        +authenticated with "drive2:" can't read files from "drive:".
        +
        +
        +Options:
        +
        +- "target": optional target remote for the shortcut destination
        +
        +### drives
        +
        +List the Shared Drives available to this account
        +
        +    rclone backend drives remote: [options] [<arguments>+]
        +
        +This command lists the Shared Drives (Team Drives) available to this
        +account.
        +
        +Usage:
        +
        +    rclone backend [-o config] drives drive:
        +
        +This will return a JSON list of objects like this
        +
        +    [
        +        {
        +            "id": "0ABCDEF-01234567890",
        +            "kind": "drive#teamDrive",
        +            "name": "My Drive"
        +        },
        +        {
        +            "id": "0ABCDEFabcdefghijkl",
        +            "kind": "drive#teamDrive",
        +            "name": "Test Drive"
        +        }
        +    ]
        +
        +With the -o config parameter it will output the list in a format
        +suitable for adding to a config file to make aliases for all the
        +drives found and a combined drive.
        +
        +    [My Drive]
        +    type = alias
        +    remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
        +
        +    [Test Drive]
        +    type = alias
        +    remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
        +
        +    [AllDrives]
        +    type = combine
        +    upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
        +
        +Adding this to the rclone config file will cause those team drives to
        +be accessible with the aliases shown. Any illegal characters will be
        +substituted with "_" and duplicate names will have numbers suffixed.
        +It will also add a remote called AllDrives which shows all the shared
        +drives combined into one directory tree.
        +
        +
        +### untrash
        +
        +Untrash files and directories
        +
        +    rclone backend untrash remote: [options] [<arguments>+]
        +
        +This command untrashes all the files and directories in the directory
        +passed in recursively.
        +
        +Usage:
        +
        +This takes an optional directory to trash which make this easier to
        +use via the API.
        +
        +    rclone backend untrash drive:directory
        +    rclone backend --interactive untrash drive:directory subdir
        +
        +Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it.
        +
        +Result:
        +
        +    {
        +        "Untrashed": 17,
        +        "Errors": 0
        +    }
        +
        +
        +### copyid
        +
        +Copy files by ID
        +
        +    rclone backend copyid remote: [options] [<arguments>+]
        +
        +This command copies files by ID
        +
        +Usage:
        +
        +    rclone backend copyid drive: ID path
        +    rclone backend copyid drive: ID1 path1 ID2 path2
        +
        +It copies the drive file with ID given to the path (an rclone path which
        +will be passed internally to rclone copyto). The ID and path pairs can be
        +repeated.
        +
        +The path should end with a / to indicate copy the file as named to
        +this directory. If it doesn't end with a / then the last path
        +component will be used as the file name.
        +
        +If the destination is a drive backend then server-side copying will be
        +attempted if possible.
        +
        +Use the --interactive/-i or --dry-run flag to see what would be copied before copying.
        +
        +
        +### exportformats
        +
        +Dump the export formats for debug purposes
        +
        +    rclone backend exportformats remote: [options] [<arguments>+]
        +
        +### importformats
        +
        +Dump the import formats for debug purposes
        +
        +    rclone backend importformats remote: [options] [<arguments>+]
        +
        +
        +
        +## Limitations
        +
        +Drive has quite a lot of rate limiting.  This causes rclone to be
        +limited to transferring about 2 files per second only.  Individual
        +files may be transferred much faster at 100s of MiB/s but lots of
        +small files can take a long time.
        +
        +Server side copies are also subject to a separate rate limit. If you
        +see User rate limit exceeded errors, wait at least 24 hours and retry.
        +You can disable server-side copies with `--disable copy` to download
        +and upload the files if you prefer.
        +
        +### Limitations of Google Docs
        +
        +Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc,
        +and as size 0 in anything which uses the VFS layer, e.g. `rclone mount`
        +and `rclone serve`. When calculating directory totals, e.g. in
        +`rclone size` and `rclone ncdu`, they will be counted in as empty
        +files.
        +
        +This is because rclone can't find out the size of the Google docs
        +without downloading them.
        +
        +Google docs will transfer correctly with `rclone sync`, `rclone copy`
        +etc as rclone knows to ignore the size when doing the transfer.
        +
        +However an unfortunate consequence of this is that you may not be able
        +to download Google docs using `rclone mount`. If it doesn't work you
        +will get a 0 sized file.  If you try again the doc may gain its
        +correct size and be downloadable. Whether it will work on not depends
        +on the application accessing the mount and the OS you are running -
        +experiment to find out if it does work for you!
        +
        +### Duplicated files
        +
        +Sometimes, for no reason I've been able to track down, drive will
        +duplicate a file that rclone uploads.  Drive unlike all the other
        +remotes can have duplicated files.
        +
        +Duplicated files cause problems with the syncing and you will see
        +messages in the log about duplicates.
        +
        +Use `rclone dedupe` to fix duplicated files.
        +
        +Note that this isn't just a problem with rclone, even Google Photos on
        +Android duplicates files on drive sometimes.
        +
        +### Rclone appears to be re-copying files it shouldn't
        +
        +The most likely cause of this is the duplicated file issue above - run
        +`rclone dedupe` and check your logs for duplicate object or directory
        +messages.
        +
        +This can also be caused by a delay/caching on google drive's end when
        +comparing directory listings. Specifically with team drives used in
        +combination with --fast-list. Files that were uploaded recently may
        +not appear on the directory list sent to rclone when using --fast-list.
        +
        +Waiting a moderate period of time between attempts (estimated to be
        +approximately 1 hour) and/or not using --fast-list both seem to be
        +effective in preventing the problem.
        +
        +### SHA1 or SHA256 hashes may be missing
        +
        +All files have MD5 hashes, but a small fraction of files uploaded may
        +not have SHA1 or SHA256 hashes especially if they were uploaded before 2018.
        +
        +## Making your own client_id
        +
        +When you use rclone with Google drive in its default configuration you
        +are using rclone's client_id.  This is shared between all the rclone
        +users.  There is a global rate limit on the number of queries per
        +second that each client_id can do set by Google.  rclone already has a
        +high quota and I will continue to make sure it is high enough by
        +contacting Google.
        +
        +It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower.
        +
        +Here is how to create your own Google Drive client ID for rclone:
        +
        +1. Log into the [Google API
        +Console](https://console.developers.google.com/) with your Google
        +account. It doesn't matter what Google account you use. (It need not
        +be the same account as the Google Drive you want to access)
        +
        +2. Select a project or create a new project.
        +
        +3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the
        +"Google Drive API".
        +
        +4. Click "Credentials" in the left-side panel (not "Create
        +credentials", which opens the wizard).
        +
        +5. If you already configured an "Oauth Consent Screen", then skip
        +to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button 
        +(near the top right corner of the right panel), then select "External"
        +and click on "CREATE"; on the next screen, enter an "Application name"
        +("rclone" is OK); enter "User Support Email" (your own email is OK); 
        +enter "Developer Contact Email" (your own email is OK); then click on
        +"Save" (all other data is optional). You will also have to add some scopes,
        +including `.../auth/docs` and `.../auth/drive` in order to be able to edit,
        +create and delete files with RClone. You may also want to include the
        +`../auth/drive.metadata.readonly` scope. After adding scopes, click
        +"Save and continue" to add test users. Be sure to add your own account to
        +the test users. Once you've added yourself as a test user and saved the
        +changes, click again on "Credentials" on the left panel to go back to
        +the "Credentials" screen.
        +
        +   (PS: if you are a GSuite user, you could also select "Internal" instead
        +of "External" above, but this will restrict API use to Google Workspace 
        +users in your organisation). 
        +
        +6.  Click on the "+ CREATE CREDENTIALS" button at the top of the screen,
        +then select "OAuth client ID".
        +
        +7. Choose an application type of "Desktop app" and click "Create". (the default name is fine)
        +
        +8. It will show you a client ID and client secret. Make a note of these.
        +   
        +   (If you selected "External" at Step 5 continue to Step 9. 
        +   If you chose "Internal" you don't need to publish and can skip straight to
        +   Step 10 but your destination drive must be part of the same Google Workspace.)
        +
        +9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm.
        +   You will also want to add yourself as a test user.
        +
        +10. Provide the noted client ID and client secret to rclone.
        +
        +Be aware that, due to the "enhanced security" recently introduced by
        +Google, you are theoretically expected to "submit your app for verification"
        +and then wait a few weeks(!) for their response; in practice, you can go right
        +ahead and use the client ID and client secret with rclone, the only issue will
        +be a very scary confirmation screen shown when you connect via your browser 
        +for rclone to be able to get its token-id (but as this only happens during 
        +the remote configuration, it's not such a big deal). Keeping the application in
        +"Testing" will work as well, but the limitation is that any grants will expire
        +after a week, which can be annoying to refresh constantly. If, for whatever
        +reason, a short grant time is not a problem, then keeping the application in
        +testing mode would also be sufficient.
        +
        +(Thanks to @balazer on github for these instructions.)
        +
        +Sometimes, creation of an OAuth consent in Google API Console fails due to an error message
        +“The request failed because changes to one of the field of the resource is not supported”.
        +As a convenient workaround, the necessary Google Drive API key can be created on the
        +[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page.
        +Just push the Enable the Drive API button to receive the Client ID and Secret.
        +Note that it will automatically create a new project in the API Console.
        +
        +#  Google Photos
        +
        +The rclone backend for [Google Photos](https://www.google.com/photos/about/) is
        +a specialized backend for transferring photos and videos to and from
        +Google Photos.
        +
        +**NB** The Google Photos API which rclone uses has quite a few
        +limitations, so please read the [limitations section](#limitations)
        +carefully to make sure it is suitable for your use.
        +
        +## Configuration
        +
        +The initial setup for google cloud storage involves getting a token from Google Photos
        +which you need to do in your browser.  `rclone config` walks you
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Google Photos  "google photos" [snip] Storage> google photos ** See help for google photos backend at: https://rclone.org/googlephotos/ **

        +

        Google Application Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> Google Application Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> Set to make the Google Photos backend read only.

        +

        If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access. Enter a boolean value (true or false). Press Enter for the default ("false"). read_only> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code

        +

        *** IMPORTANT: All media items uploaded to Google Photos with rclone *** are stored in full resolution at original quality. These uploads *** will count towards storage in your Google Account.

        + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        [remote] type = google photos token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"}
        y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ```
        See the remote setup docs for how to set it up on a machine with no Internet browser available.
        Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode.
        This remote is called remote and can now be used like this
        See all the albums in your photos
        rclone lsd remote:album
        Make a new album
        rclone mkdir remote:album/newAlbum
        List the contents of an album
        rclone ls remote:album/newAlbum
        Sync /home/local/images to the Google Photos, removing any excess files in the album.
        rclone sync --interactive /home/local/image remote:album/newAlbum
        ### Layout
        As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it.
        The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.)
        Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums.
        / - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg
        There are two writable parts of the tree, the upload directory and sub directories of the album directory.
        The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better.
        Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do
        rclone copy /path/to/images remote:album/images
        and the images directory contains
        images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg
        Then rclone will create the following albums with the following files in
        - images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - file3.jpg
        This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing.
        The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface.
        ### Standard options
        Here are the Standard options specific to google photos (Google Photos).
        #### --gphotos-client-id
        OAuth Client Id.
        Leave blank normally.
        Properties:
        - Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - Required: false
        #### --gphotos-client-secret
        OAuth Client Secret.
        Leave blank normally.
        Properties:
        - Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: string - Required: false
        #### --gphotos-read-only
        Set to make the Google Photos backend read only.
        If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access.
        Properties:
        - Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false
        ### Advanced options
        Here are the Advanced options specific to google photos (Google Photos).
        #### --gphotos-token
        OAuth Access Token as a JSON blob.
        Properties:
        - Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - Required: false
        #### --gphotos-auth-url
        Auth server URL.
        Leave blank to use the provider defaults.
        Properties:
        - Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - Required: false
        #### --gphotos-token-url
        Token server url.
        Leave blank to use the provider defaults.
        Properties:
        - Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false
        #### --gphotos-read-size
        Set to read the size of media items.
        Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media.
        Properties:
        - Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false
        #### --gphotos-start-year
        Year limits the photos to be downloaded to those which are uploaded after the given year.
        Properties:
        - Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - Default: 2000
        #### --gphotos-include-archived
        Also view and download archived media.
        By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred.
        Note that media in albums is always visible and synced, no matter their archive status.
        With this flag, archived media are always visible in directory listings and transferred.
        Without this flag, archived media will not be visible in directory listings and won't be transferred.
        Properties:
        - Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false
        #### --gphotos-encoding
        The encoding for the backend.
        See the encoding section in the overview for more info.
        Properties:
        - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot
        #### --gphotos-batch-mode
        Upload file batching sync|async|off.
        This sets the batch mode used by rclone.
        This has 3 possible values
        - off - no batching - sync - batch uploads and check completion (default) - async - batch upload and don't check completion
        Rclone will close any outstanding batches when it exits which may make a delay on quit.
        Properties:
        - Config: batch_mode - Env Var: RCLONE_GPHOTOS_BATCH_MODE - Type: string - Default: "sync"
        #### --gphotos-batch-size
        Max number of files in upload batch.
        This sets the batch size of files to upload. It has to be less than 50.
        By default this is 0 which means rclone which calculate the batch size depending on the setting of batch_mode.
        - batch_mode: async - default batch_size is 50 - batch_mode: sync - default batch_size is the same as --transfers - batch_mode: off - not in use
        Rclone will close any outstanding batches when it exits which may make a delay on quit.
        Setting this is a great idea if you are uploading lots of small files as it will make them a lot quicker. You can use --transfers 32 to maximise throughput.
        Properties:
        - Config: batch_size - Env Var: RCLONE_GPHOTOS_BATCH_SIZE - Type: int - Default: 0
        #### --gphotos-batch-timeout
        Max time to allow an idle upload batch before uploading.
        If an upload batch is idle for more than this long then it will be uploaded.
        The default for this is 0 which means rclone will choose a sensible default based on the batch_mode in use.
        - batch_mode: async - default batch_timeout is 10s - batch_mode: sync - default batch_timeout is 1s - batch_mode: off - not in use
        Properties:
        - Config: batch_timeout - Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT - Type: Duration - Default: 0s
        #### --gphotos-batch-commit-timeout
        Max time to wait for a batch to finish committing
        Properties:
        - Config: batch_commit_timeout - Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT - Type: Duration - Default: 10m0s
        ## Limitations
        Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item.
        Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode..
        rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.
        See List of backends that do not support rclone about See rclone about
        ### Downloading Images
        When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115.
        The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort
        ### Downloading Videos
        When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044.
        ### Duplicates
        If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!).
        If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause too many problems.
        ### Modification times
        The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known.
        This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes.
        ### Size
        The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check.
        It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter.
        If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag.
        ### Albums
        Rclone can only upload files to albums it created. This is a limitation of the Google Photos API.
        Rclone can remove files it uploaded from albums it created only.
        ### Deleting files
        Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781.
        Rclone cannot delete files anywhere except under album.
        ### Deleting albums
        The Google Photos API does not support deleting albums - see bug #135714733.
        # Hasher
        Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files
        ## Getting started
        To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working.
        Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket.
        Now proceed to interactive or manual configuration.
        ### Interactive configuration
        Run rclone config: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> Hasher1 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Handle checksums for other remotes  "hasher" [snip] Storage> hasher Remote to cache checksums for, like myremote:mypath. Enter a string value. Press Enter for the default (""). remote> myRemote:path Comma separated list of supported checksum types. Enter a string value. Press Enter for the default ("md5,sha1"). hashsums> md5 Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. max_age> off Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config
        +

        [Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = off -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### Manual configuration
        +
        +Run `rclone config path` to see the path of current active config file,
        +usually `YOURHOME/.config/rclone/rclone.conf`.
        +Open it in your favorite text editor, find section for the base remote
        +and create new section for hasher like in the following examples:
        +
        +

        [Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = off

        +

        [Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 max_age = 24h

        +
        
        +Hasher takes basically the following parameters:
        +- `remote` is required,
        +- `hashes` is a comma separated list of supported checksums
        +   (by default `md5,sha1`),
        +- `max_age` - maximum time to keep a checksum value in the cache,
        +   `0` will disable caching completely,
        +   `off` will cache "forever" (that is until the files get changed).
        +
        +Make sure the `remote` has `:` (colon) in. If you specify the remote without
        +a colon then rclone will use a local directory of that name. So if you use
        +a remote of `/local/path` then rclone will handle hashes for that directory.
        +If you use `remote = name` literally then rclone will put files
        +**in a directory called `name` located under current directory**.
        +
        +## Usage
        +
        +### Basic operations
        +
        +Now you can use it as `Hasher2:subdir/file` instead of base remote.
        +Hasher will transparently update cache with new checksums when a file
        +is fully read or overwritten, like:
        +

        rclone copy External:path/file Hasher:dest/path

        +

        rclone cat Hasher:path/to/file > /dev/null

        +
        
        +The way to refresh **all** cached checksums (even unsupported by the base backend)
        +for a subtree is to **re-download** all files in the subtree. For example,
        +use `hashsum --download` using **any** supported hashsum on the command line
        +(we just care to re-read):
        +

        rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null

        +

        rclone backend dump Hasher:path/to/subtree

        +
        
        +You can print or drop hashsum cache using custom backend commands:
        +

        rclone backend dump Hasher:dir/subdir

        +

        rclone backend drop Hasher:

        +
        
        +### Pre-Seed from a SUM File
        +
        +Hasher supports two backend commands: generic SUM file `import` and faster
        +but less consistent `stickyimport`.
        +
        +

        rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4]

        +
        
        +Instead of SHA1 it can be any hash supported by the remote. The last argument
        +can point to either a local or an `other-remote:path` text file in SUM format.
        +The command will parse the SUM file, then walk down the path given by the
        +first argument, snapshot current fingerprints and fill in the cache entries
        +correspondingly.
        +- Paths in the SUM file are treated as relative to `hasher:dir/subdir`.
        +- The command will **not** check that supplied values are correct.
        +  You **must know** what you are doing.
        +- This is a one-time action. The SUM file will not get "attached" to the
        +  remote. Cache entries can still be overwritten later, should the object's
        +  fingerprint change.
        +- The tree walk can take long depending on the tree size. You can increase
        +  `--checkers` to make it faster. Or use `stickyimport` if you don't care
        +  about fingerprints and consistency.
        +
        +

        rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1

        +
        
        +`stickyimport` is similar to `import` but works much faster because it
        +does not need to stat existing files and skips initial tree walk.
        +Instead of binding cache entries to file fingerprints it creates _sticky_
        +entries bound to the file name alone ignoring size, modification time etc.
        +Such hash entries can be replaced only by `purge`, `delete`, `backend drop`
        +or by full re-read/re-write of the files.
        +
        +## Configuration reference
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to hasher (Better checksums for other remotes).
        +
        +#### --hasher-remote
        +
        +Remote to cache checksums for (e.g. myRemote:path).
        +
        +Properties:
        +
        +- Config:      remote
        +- Env Var:     RCLONE_HASHER_REMOTE
        +- Type:        string
        +- Required:    true
        +
        +#### --hasher-hashes
        +
        +Comma separated list of supported checksum types.
        +
        +Properties:
        +
        +- Config:      hashes
        +- Env Var:     RCLONE_HASHER_HASHES
        +- Type:        CommaSepList
        +- Default:     md5,sha1
        +
        +#### --hasher-max-age
        +
        +Maximum time to keep checksums in cache (0 = no cache, off = cache forever).
        +
        +Properties:
        +
        +- Config:      max_age
        +- Env Var:     RCLONE_HASHER_MAX_AGE
        +- Type:        Duration
        +- Default:     off
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to hasher (Better checksums for other remotes).
        +
        +#### --hasher-auto-size
        +
        +Auto-update checksum for files smaller than this size (disabled by default).
        +
        +Properties:
        +
        +- Config:      auto_size
        +- Env Var:     RCLONE_HASHER_AUTO_SIZE
        +- Type:        SizeSuffix
        +- Default:     0
        +
        +### Metadata
        +
        +Any metadata supported by the underlying remote is read and written.
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +## Backend commands
        +
        +Here are the commands specific to the hasher backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### drop
        +
        +Drop cache
        +
        +    rclone backend drop remote: [options] [<arguments>+]
        +
        +Completely drop checksum cache.
        +Usage Example:
        +    rclone backend drop hasher:
        +
        +
        +### dump
        +
        +Dump the database
        +
        +    rclone backend dump remote: [options] [<arguments>+]
        +
        +Dump cache records covered by the current remote
        +
        +### fulldump
        +
        +Full dump of the database
        +
        +    rclone backend fulldump remote: [options] [<arguments>+]
        +
        +Dump all cache records in the database
        +
        +### import
        +
        +Import a SUM file
        +
        +    rclone backend import remote: [options] [<arguments>+]
        +
        +Amend hash cache from a SUM file and bind checksums to files by size/time.
        +Usage Example:
        +    rclone backend import hasher:subdir md5 /path/to/sum.md5
        +
        +
        +### stickyimport
        +
        +Perform fast import of a SUM file
        +
        +    rclone backend stickyimport remote: [options] [<arguments>+]
        +
        +Fill hash cache from a SUM file without verifying file fingerprints.
        +Usage Example:
        +    rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5
        +
        +
        +
        +
        +## Implementation details (advanced)
        +
        +This section explains how various rclone operations work on a hasher remote.
        +
        +**Disclaimer. This section describes current implementation which can
        +change in future rclone versions!.**
        +
        +### Hashsum command
        +
        +The `rclone hashsum` (or `md5sum` or `sha1sum`) command will:
        +
        +1. if requested hash is supported by lower level, just pass it.
        +2. if object size is below `auto_size` then download object and calculate
        +   _requested_ hashes on the fly.
        +3. if unsupported and the size is big enough, build object `fingerprint`
        +   (including size, modtime if supported, first-found _other_ hash if any).
        +4. if the strict match is found in cache for the requested remote, return
        +   the stored hash.
        +5. if remote found but fingerprint mismatched, then purge the entry and
        +   proceed to step 6.
        +6. if remote not found or had no requested hash type or after step 5:
        +   download object, calculate all _supported_ hashes on the fly and store
        +   in cache; return requested hash.
        +
        +### Other operations
        +
        +- whenever a file is uploaded or downloaded **in full**, capture the stream
        +  to calculate all supported hashes on the fly and update database
        +- server-side `move`  will update keys of existing cache entries
        +- `deletefile` will remove a single cache entry
        +- `purge` will remove all cache entries under the purged path
        +
        +Note that setting `max_age = 0` will disable checksum caching completely.
        +
        +If you set `max_age = off`, checksums in cache will never age, unless you
        +fully rewrite or delete the file.
        +
        +### Cache storage
        +
        +Cached checksums are stored as `bolt` database files under rclone cache
        +directory, usually `~/.cache/rclone/kv/`. Databases are maintained
        +one per _base_ backend, named like `BaseRemote~hasher.bolt`.
        +Checksums for multiple `alias`-es into a single base backend
        +will be stored in the single database. All local paths are treated as
        +aliases into the `local` backend (unless encrypted or chunked) and stored
        +in `~/.cache/rclone/kv/local~hasher.bolt`.
        +Databases can be shared between multiple rclone processes.
        +
        +#  HDFS
        +
        +[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a
        +distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework.
        +
        +Paths are specified as `remote:` or `remote:path/to/dir`.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`. First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [skip] XX / Hadoop distributed file system  "hdfs" [skip] Storage> hdfs ** See help for hdfs backend at: https://rclone.org/hdfs/ **

        +

        hadoop name node and port Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to host namenode at port 8020  "namenode:8020" namenode> namenode.hadoop:8020 hadoop user name Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to hdfs as root  "root" username> root Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [remote] type = hdfs namenode = namenode.hadoop:8020 username = root -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

        +

        Name Type ==== ==== hadoop hdfs

        +
          +
        1. Edit existing remote
        2. +
        3. New remote
        4. +
        5. Delete remote
        6. +
        7. Rename remote
        8. +
        9. Copy remote
        10. +
        11. Set configuration password
        12. +
        13. Quit config e/n/d/r/c/s/q> q
        14. +
        +
        
        +This remote is called `remote` and can now be used like this
        +
        +See all the top level directories
        +
        +    rclone lsd remote:
        +
        +List the contents of a directory
        +
        +    rclone ls remote:directory
        +
        +Sync the remote `directory` to `/home/local/directory`, deleting any excess files.
        +
        +    rclone sync --interactive remote:directory /home/local/directory
        +
        +### Setting up your own HDFS instance for testing
        +
        +You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html)
        +or use the docker image from the tests:
        +
        +If you want to build the docker image
        +
        +

        git clone https://github.com/rclone/rclone.git cd rclone/fstest/testserver/images/test-hdfs docker build --rm -t rclone/test-hdfs .

        +
        
        +Or you can just use the latest one pushed
        +
        +

        docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs

        +
        
        +**NB** it need few seconds to startup.
        +
        +For this docker image the remote needs to be configured like this:
        +
        +

        [remote] type = hdfs namenode = 127.0.0.1:8020 username = root

        +
        
        +You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data
        +uploaded will be lost.)
        +
        +### Modification times
        +
        +Time accurate to 1 second is stored.
        +
        +### Checksum
        +
        +No checksums are implemented.
        +
        +### Usage information
        +
        +You can use the `rclone about remote:` command which will display filesystem size and current usage.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| :         | 0x3A  | :           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8).
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to hdfs (Hadoop distributed file system).
        +
        +#### --hdfs-namenode
        +
        +Hadoop name nodes and ports.
        +
        +E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020.
        +
        +Properties:
        +
        +- Config:      namenode
        +- Env Var:     RCLONE_HDFS_NAMENODE
        +- Type:        CommaSepList
        +- Default:     
        +
        +#### --hdfs-username
        +
        +Hadoop user name.
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_HDFS_USERNAME
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "root"
        +        - Connect to hdfs as root.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to hdfs (Hadoop distributed file system).
        +
        +#### --hdfs-service-principal-name
        +
        +Kerberos service principal name for the namenode.
        +
        +Enables KERBEROS authentication. Specifies the Service Principal Name
        +(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\"
        +for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'.
        +
        +Properties:
        +
        +- Config:      service_principal_name
        +- Env Var:     RCLONE_HDFS_SERVICE_PRINCIPAL_NAME
        +- Type:        string
        +- Required:    false
        +
        +#### --hdfs-data-transfer-protection
        +
        +Kerberos data transfer protection: authentication|integrity|privacy.
        +
        +Specifies whether or not authentication, data signature integrity
        +checks, and wire encryption are required when communicating with
        +the datanodes. Possible values are 'authentication', 'integrity'
        +and 'privacy'. Used only with KERBEROS enabled.
        +
        +Properties:
        +
        +- Config:      data_transfer_protection
        +- Env Var:     RCLONE_HDFS_DATA_TRANSFER_PROTECTION
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "privacy"
        +        - Ensure authentication, integrity and encryption enabled.
        +
        +#### --hdfs-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_HDFS_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,Colon,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +- No server-side `Move` or `DirMove`.
        +- Checksums not implemented.
        +
        +#  HiDrive
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +The initial setup for hidrive involves getting a token from HiDrive
        +which you need to do in your browser.
        +`rclone config` walks you through it.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / HiDrive  "hidrive" [snip] Storage> hidrive OAuth Client Id - Leave blank normally. client_id> OAuth Client Secret - Leave blank normally. client_secret> Access permissions that rclone should use when requesting access from HiDrive. Leave blank normally. scope_access> Edit advanced config? y/n> n Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = hidrive token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +**You should be aware that OAuth-tokens can be used to access your account
        +and hence should not be shared with other persons.**
        +See the [below section](#keeping-your-tokens-safe) for more information.
        +
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from HiDrive. This only runs from the moment it opens
        +your browser to the moment you get back the verification code.
        +The webserver runs on `http://127.0.0.1:53682/`.
        +If local port `53682` is protected by a firewall you may need to temporarily
        +unblock the firewall to complete authorization.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your HiDrive root folder
        +
        +    rclone lsd remote:
        +
        +List all the files in your HiDrive filesystem
        +
        +    rclone ls remote:
        +
        +To copy a local directory to a HiDrive directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Keeping your tokens safe
        +
        +Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text.
        +Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password.
        +Therefore you should make sure no one else can access your configuration.
        +
        +It is possible to encrypt rclone's configuration file.
        +You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption).
        +
        +### Invalid refresh token
        +
        +As can be verified [here](https://developer.hidrive.com/basics-flows/),
        +each `refresh_token` (for Native Applications) is valid for 60 days.
        +If used to access HiDrivei, its validity will be automatically extended.
        +
        +This means that if you
        +
        +  * Don't use the HiDrive remote for 60 days
        +
        +then rclone will return an error which includes a text
        +that implies the refresh token is *invalid* or *expired*.
        +
        +To fix this you will need to authorize rclone to access your HiDrive account again.
        +
        +Using
        +
        +    rclone config reconnect remote:
        +
        +the process is very similar to the process of initial setup exemplified before.
        +
        +### Modification times and hashes
        +
        +HiDrive allows modification times to be set on objects accurate to 1 second.
        +
        +HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001)
        +which is used to verify the integrity of file contents after successful transfers.
        +
        +### Restricted filename characters
        +
        +HiDrive cannot store files or folders that include
        +`/` (0x2F) or null-bytes (0x00) in their name.
        +Any other characters can be used in the names of files or folders.
        +Additionally, files or folders cannot be named either of the following: `.` or `..`
        +
        +Therefore rclone will automatically replace these characters,
        +if files or folders are stored or accessed with such names.
        +
        +You can read about how this filename encoding works in general
        +[here](overview/#restricted-filenames).
        +
        +Keep in mind that HiDrive only supports file or folder names
        +with a length of 255 characters or less.
        +
        +### Transfers
        +
        +HiDrive limits file sizes per single request to a maximum of 2 GiB.
        +To allow storage of larger files and allow for better upload performance,
        +the hidrive backend will use a chunked transfer for files larger than 96 MiB.
        +Rclone will upload multiple parts/chunks of the file at the same time.
        +Chunks in the process of being uploaded are buffered in memory,
        +so you may want to restrict this behaviour on systems with limited resources.
        +
        +You can customize this behaviour using the following options:
        +
        +* `chunk_size`: size of file parts
        +* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer
        +* `upload_concurrency`: number of file-parts to upload at the same time
        +
        +See the below section about configuration options for more details.
        +
        +### Root folder
        +
        +You can set the root folder for rclone.
        +This is the directory that rclone considers to be the root of your HiDrive.
        +
        +Usually, you will leave this blank, and rclone will use the root of the account.
        +
        +However, you can set this to restrict rclone to a specific folder hierarchy.
        +
        +This works by prepending the contents of the `root_prefix` option
        +to any paths accessed by rclone.
        +For example, the following two ways to access the home directory are equivalent:
        +
        +    rclone lsd --hidrive-root-prefix="/users/test/" remote:path
        +
        +    rclone lsd remote:/users/test/path
        +
        +See the below section about configuration options for more details.
        +
        +### Directory member count
        +
        +By default, rclone will know the number of directory members contained in a directory.
        +For example, `rclone lsd` uses this information.
        +
        +The acquisition of this information will result in additional time costs for HiDrive's API.
        +When dealing with large directory structures, it may be desirable to circumvent this time cost,
        +especially when this information is not explicitly needed.
        +For this, the `disable_fetching_member_count` option can be used.
        +
        +See the below section about configuration options for more details.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to hidrive (HiDrive).
        +
        +#### --hidrive-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_HIDRIVE_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --hidrive-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_HIDRIVE_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --hidrive-scope-access
        +
        +Access permissions that rclone should use when requesting access from HiDrive.
        +
        +Properties:
        +
        +- Config:      scope_access
        +- Env Var:     RCLONE_HIDRIVE_SCOPE_ACCESS
        +- Type:        string
        +- Default:     "rw"
        +- Examples:
        +    - "rw"
        +        - Read and write access to resources.
        +    - "ro"
        +        - Read-only access to resources.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to hidrive (HiDrive).
        +
        +#### --hidrive-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_HIDRIVE_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --hidrive-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_HIDRIVE_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --hidrive-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_HIDRIVE_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --hidrive-scope-role
        +
        +User-level that rclone should use when requesting access from HiDrive.
        +
        +Properties:
        +
        +- Config:      scope_role
        +- Env Var:     RCLONE_HIDRIVE_SCOPE_ROLE
        +- Type:        string
        +- Default:     "user"
        +- Examples:
        +    - "user"
        +        - User-level access to management permissions.
        +        - This will be sufficient in most cases.
        +    - "admin"
        +        - Extensive access to management permissions.
        +    - "owner"
        +        - Full access to management permissions.
        +
        +#### --hidrive-root-prefix
        +
        +The root/parent folder for all paths.
        +
        +Fill in to use the specified folder as the parent for all paths given to the remote.
        +This way rclone can use any folder as its starting point.
        +
        +Properties:
        +
        +- Config:      root_prefix
        +- Env Var:     RCLONE_HIDRIVE_ROOT_PREFIX
        +- Type:        string
        +- Default:     "/"
        +- Examples:
        +    - "/"
        +        - The topmost directory accessible by rclone.
        +        - This will be equivalent with "root" if rclone uses a regular HiDrive user account.
        +    - "root"
        +        - The topmost directory of the HiDrive user account
        +    - ""
        +        - This specifies that there is no root-prefix for your paths.
        +        - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir".
        +
        +#### --hidrive-endpoint
        +
        +Endpoint for the service.
        +
        +This is the URL that API-calls will be made to.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_HIDRIVE_ENDPOINT
        +- Type:        string
        +- Default:     "https://api.hidrive.strato.com/2.1"
        +
        +#### --hidrive-disable-fetching-member-count
        +
        +Do not fetch number of objects in directories unless it is absolutely necessary.
        +
        +Requests may be faster if the number of objects in subdirectories is not fetched.
        +
        +Properties:
        +
        +- Config:      disable_fetching_member_count
        +- Env Var:     RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT
        +- Type:        bool
        +- Default:     false
        +
        +#### --hidrive-chunk-size
        +
        +Chunksize for chunked uploads.
        +
        +Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size.
        +
        +The upper limit for this is 2147483647 bytes (about 2.000Gi).
        +That is the maximum amount of bytes a single upload-operation will support.
        +Setting this above the upper limit or to a negative value will cause uploads to fail.
        +
        +Setting this to larger values may increase the upload speed at the cost of using more memory.
        +It can be set to smaller values smaller to save on memory.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_HIDRIVE_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     48Mi
        +
        +#### --hidrive-upload-cutoff
        +
        +Cutoff/Threshold for chunked uploads.
        +
        +Any files larger than this will be uploaded in chunks of the configured chunksize.
        +
        +The upper limit for this is 2147483647 bytes (about 2.000Gi).
        +That is the maximum amount of bytes a single upload-operation will support.
        +Setting this above the upper limit will cause uploads to fail.
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_HIDRIVE_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     96Mi
        +
        +#### --hidrive-upload-concurrency
        +
        +Concurrency for chunked uploads.
        +
        +This is the upper limit for how many transfers for the same file are running concurrently.
        +Setting this above to a value smaller than 1 will cause uploads to deadlock.
        +
        +If you are uploading small numbers of large files over high-speed links
        +and these uploads do not fully utilize your bandwidth, then increasing
        +this may help to speed up the transfers.
        +
        +Properties:
        +
        +- Config:      upload_concurrency
        +- Env Var:     RCLONE_HIDRIVE_UPLOAD_CONCURRENCY
        +- Type:        int
        +- Default:     4
        +
        +#### --hidrive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_HIDRIVE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,Dot
        +
        +
        +
        +## Limitations
        +
        +### Symbolic links
        +
        +HiDrive is able to store symbolic links (*symlinks*) by design,
        +for example, when unpacked from a zip archive.
        +
        +There exists no direct mechanism to manage native symlinks in remotes.
        +As such this implementation has chosen to ignore any native symlinks present in the remote.
        +rclone will not be able to access or show any symlinks stored in the hidrive-remote.
        +This means symlinks cannot be individually removed, copied, or moved,
        +except when removing, copying, or moving the parent folder.
        +
        +*This does not affect the `.rclonelink`-files
        +that rclone uses to encode and store symbolic links.*
        +
        +### Sparse files
        +
        +It is possible to store sparse files in HiDrive.
        +
        +Note that copying a sparse file will expand the holes
        +into null-byte (0x00) regions that will then consume disk space.
        +Likewise, when downloading a sparse file,
        +the resulting file will have null-byte regions in the place of file holes.
        +
        +#  HTTP
        +
        +The HTTP remote is a read only remote for reading files of a
        +webserver.  The webserver should provide file listings which rclone
        +will read and turn into a remote.  This has been tested with common
        +webservers such as Apache/Nginx/Caddy and will likely work with file
        +listings from most web servers.  (If it doesn't then please file an
        +issue, or send a pull request!)
        +
        +Paths are specified as `remote:` or `remote:path`.
        +
        +The `remote:` represents the configured [url](#http-url), and any path following
        +it will be resolved relative to this url, according to the URL standard. This
        +means with remote url `https://beta.rclone.org/branch` and path `fix`, the
        +resolved URL will be `https://beta.rclone.org/branch/fix`, while with path
        +`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute
        +path is resolved from the root of the domain.
        +
        +If the path following the `remote:` ends with `/` it will be assumed to point
        +to a directory. If the path does not end with `/`, then a HEAD request is sent
        +and the response used to decide if it it is treated as a file or a directory
        +(run with `-vv` to see details). When [--http-no-head](#http-no-head) is
        +specified, a path without ending `/` is always assumed to be a file. If rclone
        +incorrectly assumes the path is a file, the solution is to specify the path with
        +ending `/`. When you know the path is a directory, ending it with `/` is always
        +better as it avoids the initial HEAD request.
        +
        +To just download a single file it is easier to use
        +[copyurl](https://rclone.org/commands/rclone_copyurl/).
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`.  First
        +run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / HTTP  "http" [snip] Storage> http URL of http host to connect to Choose a number from below, or type in your own value 1 / Connect to example.com  "https://example.com" url> https://beta.rclone.org Remote config -------------------- [remote] url = https://beta.rclone.org -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

        +

        Name Type ==== ==== remote http

        +
          +
        1. Edit existing remote
        2. +
        3. New remote
        4. +
        5. Delete remote
        6. +
        7. Rename remote
        8. +
        9. Copy remote
        10. +
        11. Set configuration password
        12. +
        13. Quit config e/n/d/r/c/s/q> q
        14. +
        +
        
        +This remote is called `remote` and can now be used like this
        +
        +See all the top level directories
        +
        +    rclone lsd remote:
        +
        +List the contents of a directory
        +
        +    rclone ls remote:directory
        +
        +Sync the remote `directory` to `/home/local/directory`, deleting any excess files.
        +
        +    rclone sync --interactive remote:directory /home/local/directory
        +
        +### Read only
        +
        +This remote is read only - you can't upload files to an HTTP server.
        +
        +### Modification times
        +
        +Most HTTP servers store time accurate to 1 second.
        +
        +### Checksum
        +
        +No checksums are stored.
        +
        +### Usage without a config file
        +
        +Since the http remote only has one config parameter it is easy to use
        +without a config file:
        +
        +    rclone lsd --http-url https://beta.rclone.org :http:
        +
        +or:
        +
        +    rclone lsd :http,url='https://beta.rclone.org':
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to http (HTTP).
        +
        +#### --http-url
        +
        +URL of HTTP host to connect to.
        +
        +E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password.
        +
        +Properties:
        +
        +- Config:      url
        +- Env Var:     RCLONE_HTTP_URL
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to http (HTTP).
        +
        +#### --http-headers
        +
        +Set HTTP headers for all transactions.
        +
        +Use this to set additional HTTP headers for all transactions.
        +
        +The input format is comma separated list of key,value pairs.  Standard
        +[CSV encoding](https://godoc.org/encoding/csv) may be used.
        +
        +For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'.
        +
        +You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'.
        +
        +Properties:
        +
        +- Config:      headers
        +- Env Var:     RCLONE_HTTP_HEADERS
        +- Type:        CommaSepList
        +- Default:     
        +
        +#### --http-no-slash
        +
        +Set this if the site doesn't end directories with /.
        +
        +Use this if your target website does not use / on the end of
        +directories.
        +
        +A / on the end of a path is how rclone normally tells the difference
        +between files and directories.  If this flag is set, then rclone will
        +treat all files with Content-Type: text/html as directories and read
        +URLs from them rather than downloading them.
        +
        +Note that this may cause rclone to confuse genuine HTML files with
        +directories.
        +
        +Properties:
        +
        +- Config:      no_slash
        +- Env Var:     RCLONE_HTTP_NO_SLASH
        +- Type:        bool
        +- Default:     false
        +
        +#### --http-no-head
        +
        +Don't use HEAD requests.
        +
        +HEAD requests are mainly used to find file sizes in dir listing.
        +If your site is being very slow to load then you can try this option.
        +Normally rclone does a HEAD request for each potential file in a
        +directory listing to:
        +
        +- find its size
        +- check it really exists
        +- check to see if it is a directory
        +
        +If you set this option, rclone will not do the HEAD request. This will mean
        +that directory listings are much quicker, but rclone won't have the times or
        +sizes of any files, and some files that don't exist may be in the listing.
        +
        +Properties:
        +
        +- Config:      no_head
        +- Env Var:     RCLONE_HTTP_NO_HEAD
        +- Type:        bool
        +- Default:     false
        +
        +## Backend commands
        +
        +Here are the commands specific to the http backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### set
        +
        +Set command for updating the config parameters.
        +
        +    rclone backend set remote: [options] [<arguments>+]
        +
        +This set command can be used to update the config parameters
        +for a running http backend.
        +
        +Usage Examples:
        +
        +    rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
        +    rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
        +    rclone rc backend/command command=set fs=remote: -o url=https://example.com
        +
        +The option keys are named as they are in the config file.
        +
        +This rebuilds the connection to the http backend when it is called with
        +the new parameters. Only new parameters need be passed as the values
        +will default to those currently in use.
        +
        +It doesn't return anything.
        +
        +
        +
        +
        +## Limitations
        +
        +`rclone about` is not supported by the HTTP backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +#  ImageKit
        +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service.
        +
        +#### About ImageKit
        +[ImageKit.io](https://imagekit.io/)  provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web.
        +
        +
        +#### Accounts & Pricing
        +
        +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans).
        +
        +## Configuration
        +
        +Here is an example of making an imagekit configuration.
        +
        +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan.
        +
        +You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section.
        +
        +Now run
        +

        rclone config

        +
        
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n

        +

        Enter the name for the new remote. name> imagekit-media-library

        +

        Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] XX / ImageKit.io  (imagekit) [snip] Storage> imagekit

        +

        Option endpoint. You can find your ImageKit.io URL endpoint in your dashboard Enter a value. endpoint> https://ik.imagekit.io/imagekit_id

        +

        Option public_key. You can find your ImageKit.io public key in your dashboard Enter a value. public_key> public_****************************

        +

        Option private_key. You can find your ImageKit.io private key in your dashboard Enter a value. private_key> private_****************************

        +

        Edit advanced config? y) Yes n) No (default) y/n> n

        +

        Configuration complete. Options: - type: imagekit - endpoint: https://ik.imagekit.io/imagekit_id - public_key: public_**************************** - private_key: private_****************************

        +

        Keep this "imagekit-media-library" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        List directories in the top level of your Media Library
        +

        rclone lsd imagekit-media-library:

        +
        Make a new directory.
        +

        rclone mkdir imagekit-media-library:directory

        +
        List the contents of a directory.
        +

        rclone ls imagekit-media-library:directory

        +
        
        +###   Modified time and hashes
        +
        +ImageKit does not support modification times or hashes yet.
        +
        +### Checksums
        +
        +No checksums are supported.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to imagekit (ImageKit.io).
        +
        +#### --imagekit-endpoint
        +
        +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_IMAGEKIT_ENDPOINT
        +- Type:        string
        +- Required:    true
        +
        +#### --imagekit-public-key
        +
        +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
        +
        +Properties:
        +
        +- Config:      public_key
        +- Env Var:     RCLONE_IMAGEKIT_PUBLIC_KEY
        +- Type:        string
        +- Required:    true
        +
        +#### --imagekit-private-key
        +
        +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
        +
        +Properties:
        +
        +- Config:      private_key
        +- Env Var:     RCLONE_IMAGEKIT_PRIVATE_KEY
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to imagekit (ImageKit.io).
        +
        +#### --imagekit-only-signed
        +
        +If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true.
        +
        +Properties:
        +
        +- Config:      only_signed
        +- Env Var:     RCLONE_IMAGEKIT_ONLY_SIGNED
        +- Type:        bool
        +- Default:     false
        +
        +#### --imagekit-versions
        +
        +Include old versions in directory listings.
        +
        +Properties:
        +
        +- Config:      versions
        +- Env Var:     RCLONE_IMAGEKIT_VERSIONS
        +- Type:        bool
        +- Default:     false
        +
        +#### --imagekit-upload-tags
        +
        +Tags to add to the uploaded files, e.g. "tag1,tag2".
        +
        +Properties:
        +
        +- Config:      upload_tags
        +- Env Var:     RCLONE_IMAGEKIT_UPLOAD_TAGS
        +- Type:        string
        +- Required:    false
        +
        +#### --imagekit-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_IMAGEKIT_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket
        +
        +### Metadata
        +
        +Any metadata supported by the underlying remote is read and written.
        +
        +Here are the possible system metadata items for the imagekit backend.
        +
        +| Name | Help | Type | Example | Read Only |
        +|------|------|------|---------|-----------|
        +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** |
        +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** |
        +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** |
        +| file-type | Type of the file | string | image | **Y** |
        +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** |
        +| has-alpha | Whether the image has alpha channel or not | bool |  | **Y** |
        +| height | Height of the image or video in pixels | int |  | **Y** |
        +| is-private-file | Whether the file is private or not | bool |  | **Y** |
        +| size | Size of the object in bytes | int64 |  | **Y** |
        +| tags | Tags associated with the file | string | tag1,tag2 | **Y** |
        +| width | Width of the image or video in pixels | int |  | **Y** |
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +
        +
        +#  Internet Archive
        +
        +The Internet Archive backend utilizes Items on [archive.org](https://archive.org/)
        +
        +Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses.
        +
        +Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
        +command.)  You may put subdirectories in too, e.g. `remote:item/path/to/dir`.
        +
        +Unlike S3, listing up all items uploaded by you isn't supported.
        +
        +Once you have made a remote, you can use it like this:
        +
        +Make a new item
        +
        +    rclone mkdir remote:item
        +
        +List the contents of a item
        +
        +    rclone ls remote:item
        +
        +Sync `/home/local/directory` to the remote item, deleting any excess
        +files in the item.
        +
        +    rclone sync --interactive /home/local/directory remote:item
        +
        +## Notes
        +Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available.
        +The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior.
        +
        +You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key.
        +By making it wait, rclone can do normal file comparison.
        +Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue.
        +
        +## About metadata
        +This backend supports setting, updating and reading metadata of each file.
        +The metadata will appear as file metadata on Internet Archive.
        +However, some fields are reserved by both Internet Archive and rclone.
        +
        +The following are reserved by Internet Archive:
        +- `name`
        +- `source`
        +- `size`
        +- `md5`
        +- `crc32`
        +- `sha1`
        +- `format`
        +- `old_version`
        +- `viruscheck`
        +- `summation`
        +
        +Trying to set values to these keys is ignored with a warning.
        +Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime.
        +
        +rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request.
        +
        +If there are multiple values for a key, only the first one is returned.
        +This is a limitation of rclone, that supports one value per one key.
        +It can be triggered when you did a server-side copy.
        +
        +Reading metadata will also provide custom (non-standard nor reserved) ones.
        +
        +## Filtering auto generated files
        +
        +The Internet Archive automatically creates metadata files after
        +upload. These can cause problems when doing an `rclone sync` as rclone
        +will try, and fail, to delete them. These metadata files are not
        +changeable, as they are created by the Internet Archive automatically.
        +
        +These auto-created files can be excluded from the sync using [metadata
        +filtering](https://rclone.org/filtering/#metadata).
        +
        +    rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata"
        +
        +Which excludes from the sync any files which have the
        +`source=metadata` or `format=Metadata` flags which are added to
        +Internet Archive auto-created files.
        +
        +## Configuration
        +
        +Here is an example of making an internetarchive configuration.
        +Most applies to the other providers as well, any differences are described [below](#providers).
        +
        +First run
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process.
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. XX / InternetArchive Items  (internetarchive) Storage> internetarchive Option access_key_id. IAS3 Access Key. Leave blank for anonymous access. You can find one here: https://archive.org/account/s3.php Enter a value. Press Enter to leave empty. access_key_id> XXXX Option secret_access_key. IAS3 Secret Key (password). Leave blank for anonymous access. Enter a value. Press Enter to leave empty. secret_access_key> XXXX Edit advanced config? y) Yes n) No (default) y/n> y Option endpoint. IAS3 Endpoint. Leave blank for default value. Enter a string value. Press Enter for the default (https://s3.us.archive.org). endpoint> Option front_endpoint. Host of InternetArchive Frontend. Leave blank for default value. Enter a string value. Press Enter for the default (https://archive.org). front_endpoint> Option disable_checksum. Don't store MD5 checksum with object metadata. Normally rclone will calculate the MD5 checksum of the input before uploading it so it can ask the server to check the object against checksum. This is great for data integrity checking but can cause long delays for large files to start uploading. Enter a boolean value (true or false). Press Enter for the default (true). disable_checksum> true Option encoding. The encoding for the backend. See the encoding section in the overview for more info. Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). encoding> Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [remote] type = internetarchive access_key_id = XXXX secret_access_key = XXXX -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +
        +### Standard options
        +
        +Here are the Standard options specific to internetarchive (Internet Archive).
        +
        +#### --internetarchive-access-key-id
        +
        +IAS3 Access Key.
        +
        +Leave blank for anonymous access.
        +You can find one here: https://archive.org/account/s3.php
        +
        +Properties:
        +
        +- Config:      access_key_id
        +- Env Var:     RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --internetarchive-secret-access-key
        +
        +IAS3 Secret Key (password).
        +
        +Leave blank for anonymous access.
        +
        +Properties:
        +
        +- Config:      secret_access_key
        +- Env Var:     RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to internetarchive (Internet Archive).
        +
        +#### --internetarchive-endpoint
        +
        +IAS3 Endpoint.
        +
        +Leave blank for default value.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_INTERNETARCHIVE_ENDPOINT
        +- Type:        string
        +- Default:     "https://s3.us.archive.org"
        +
        +#### --internetarchive-front-endpoint
        +
        +Host of InternetArchive Frontend.
        +
        +Leave blank for default value.
        +
        +Properties:
        +
        +- Config:      front_endpoint
        +- Env Var:     RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT
        +- Type:        string
        +- Default:     "https://archive.org"
        +
        +#### --internetarchive-disable-checksum
        +
        +Don't ask the server to test against MD5 checksum calculated by rclone.
        +Normally rclone will calculate the MD5 checksum of the input before
        +uploading it so it can ask the server to check the object against checksum.
        +This is great for data integrity checking but can cause long delays for
        +large files to start uploading.
        +
        +Properties:
        +
        +- Config:      disable_checksum
        +- Env Var:     RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM
        +- Type:        bool
        +- Default:     true
        +
        +#### --internetarchive-wait-archive
        +
        +Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish.
        +Only enable if you need to be guaranteed to be reflected after write operations.
        +0 to disable waiting. No errors to be thrown in case of timeout.
        +
        +Properties:
        +
        +- Config:      wait_archive
        +- Env Var:     RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE
        +- Type:        Duration
        +- Default:     0s
        +
        +#### --internetarchive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_INTERNETARCHIVE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot
        +
        +### Metadata
        +
        +Metadata fields provided by Internet Archive.
        +If there are multiple values for a key, only the first one is returned.
        +This is a limitation of Rclone, that supports one value per one key.
        +
        +Owner is able to add custom keys. Metadata feature grabs all the keys including them.
        +
        +Here are the possible system metadata items for the internetarchive backend.
        +
        +| Name | Help | Type | Example | Read Only |
        +|------|------|------|---------|-----------|
        +| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** |
        +| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** |
        +| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** |
        +| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** |
        +| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** |
        +| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** |
        +| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
        +| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
        +| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N |
        +| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** |
        +| size | File size in bytes | decimal number | 123456 | **Y** |
        +| source | The source of the file | string | original | **Y** |
        +| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** |
        +| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** |
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +
        +
        +#  Jottacloud
        +
        +Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters
        +in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/),
        +it also provides white-label solutions to different companies, such as:
        +* Telia
        +  * Telia Cloud (cloud.telia.se)
        +  * Telia Sky (sky.telia.no)
        +* Tele2
        +  * Tele2 Cloud (mittcloud.tele2.se)
        +* Onlime
        +  * Onlime Cloud Storage (onlime.dk)
        +* Elkjøp (with subsidiaries):
        +  * Elkjøp Cloud (cloud.elkjop.no)
        +  * Elgiganten Sweden (cloud.elgiganten.se)
        +  * Elgiganten Denmark (cloud.elgiganten.dk)
        +  * Giganti Cloud  (cloud.gigantti.fi)
        +  * ELKO Cloud (cloud.elko.is)
        +
        +Most of the white-label versions are supported by this backend, although may require different
        +authentication setup - described below.
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Authentication types
        +
        +Some of the whitelabel versions uses a different authentication method than the official service,
        +and you have to choose the correct one when setting up the remote.
        +
        +### Standard authentication
        +
        +The standard authentication method used by the official service (jottacloud.com), as well as
        +some of the whitelabel services, requires you to generate a single-use personal login token
        +from the account security settings in the service's web interface. Log in to your account,
        +go to "Settings" and then "Security", or use the direct link presented to you by rclone when
        +configuring the remote: <https://www.jottacloud.com/web/secure>. Scroll down to the section
        +"Personal login token", and click the "Generate" button. Note that if you are using a
        +whitelabel service you probably can't use the direct link, you need to find the same page in
        +their dedicated web interface, and also it may be in a different location than described above.
        +
        +To access your account from multiple instances of rclone, you need to configure each of them
        +with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one
        +location, and copy the configuration file to a second location where you also want to run
        +rclone and access the same remote. Then you need to replace the token for one of them, using
        +the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which
        +requires you to generate a new personal login token and supply as input. If you do not
        +do this, the token may easily end up being invalidated, resulting in both instances failing
        +with an error message something along the lines of:
        +
        +    oauth2: cannot fetch token: 400 Bad Request
        +    Response: {"error":"invalid_grant","error_description":"Stale token"}
        +
        +When this happens, you need to replace the token as described above to be able to use your
        +remote again.
        +
        +All personal login tokens you have taken into use will be listed in the web interface under
        +"My logged in devices", and from the right side of that list you can click the "X" button to
        +revoke individual tokens.
        +
        +### Legacy authentication
        +
        +If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option
        +to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select
        +yes when the setup asks for legacy authentication and enter your username and password.
        +The rest of the setup is identical to the default setup.
        +
        +### Telia Cloud authentication
        +
        +Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and
        +additionally uses a separate authentication flow where the username is generated internally. To setup
        +rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is
        +identical to the default setup.
        +
        +### Tele2 Cloud authentication
        +
        +As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and
        +Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate
        +authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud,
        +choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup.
        +
        +### Onlime Cloud Storage authentication
        +
        +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but
        +have recently set up their own hosting, transferring their customers from Jottacloud servers to their
        +own ones.
        +
        +This, of course, necessitates using their servers for authentication, but otherwise functionality and
        +architecture seems equivalent to Jottacloud.
        +
        +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest
        +of the setup is identical to the default setup.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote` with the default setup.  First run:
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] XX / Jottacloud  (jottacloud) [snip] Storage> jottacloud Edit advanced config? y) Yes n) No (default) y/n> n Option config_type. Select authentication type. Choose a number from below, or type in an existing string value. Press Enter for the default (standard). / Standard authentication. 1 | Use this if you're a normal Jottacloud user.  (standard) / Legacy authentication. 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users.  (legacy) / Telia Cloud authentication. 3 | Use this if you are using Telia Cloud.  (telia) / Tele2 Cloud authentication. 4 | Use this if you are using Tele2 Cloud.  (tele2) / Onlime Cloud authentication. 5 | Use this if you are using Onlime Cloud.  (onlime) config_type> 1 Personal login token. Generate here: https://www.jottacloud.com/web/secure Login Token> Use a non-standard device/mountpoint? Choosing no, the default, will let you access the storage used for the archive section of the official Jottacloud client. If you instead want to access the sync or the backup section, for example, you must choose yes. y) Yes n) No (default) y/n> y Option config_device. The device to use. In standard setup the built-in Jotta device is used, which contains predefined mountpoints for archive, sync etc. All other devices are treated as backup devices by the official Jottacloud client. You may create a new by entering a unique name. Choose a number from below, or type in your own string value. Press Enter for the default (DESKTOP-3H31129). 1 > DESKTOP-3H31129 2 > Jotta config_device> 2 Option config_mountpoint. The mountpoint to use for the built-in device Jotta. The standard setup is to use the Archive mountpoint. Most other mountpoints have very limited support in rclone and should generally be avoided. Choose a number from below, or type in an existing string value. Press Enter for the default (Archive). 1 > Archive 2 > Shared 3 > Sync config_mountpoint> 1 -------------------- [remote] type = jottacloud configVersion = 1 client_id = jottacli client_secret = tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta mountpoint = Archive -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Jottacloud
        +
        +    rclone lsd remote:
        +
        +List all the files in your Jottacloud
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an Jottacloud directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Devices and Mountpoints
        +
        +The official Jottacloud client registers a device for each computer you install
        +it on, and shows them in the backup section of the user interface. For each
        +folder you select for backup it will create a mountpoint within this device.
        +A built-in device called Jotta is special, and contains mountpoints Archive,
        +Sync and some others, used for corresponding features in official clients.
        +
        +With rclone you'll want to use the standard Jotta/Archive device/mountpoint in
        +most cases. However, you may for example want to access files from the sync or
        +backup functionality provided by the official clients, and rclone therefore
        +provides the option to select other devices and mountpoints during config.
        +
        +You are allowed to create new devices and mountpoints. All devices except the
        +built-in Jotta device are treated as backup devices by official Jottacloud
        +clients, and the mountpoints on them are individual backup sets.
        +
        +With the built-in Jotta device, only existing, built-in, mountpoints can be
        +selected. In addition to the mentioned Archive and Sync, it may contain
        +several other mountpoints such as: Latest, Links, Shared and Trash. All of
        +these are special mountpoints with a different internal representation than
        +the "regular" mountpoints. Rclone will only to a very limited degree support
        +them. Generally you should avoid these, unless you know what you are doing.
        +
        +### --fast-list
        +
        +This backend supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +Note that the implementation in Jottacloud always uses only a single
        +API request to get the entire list, so for large folders this could
        +lead to long wait time before the first results are shown.
        +
        +Note also that with rclone version 1.58 and newer, information about
        +[MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata)
        +are not available when using `--fast-list`.
        +
        +### Modification times and hashes
        +
        +Jottacloud allows modification times to be set on objects accurate to 1
        +second. These will be used to detect whether objects need syncing or
        +not.
        +
        +Jottacloud supports MD5 type hashes, so you can use the `--checksum`
        +flag.
        +
        +Note that Jottacloud requires the MD5 hash before upload so if the
        +source does not have an MD5 checksum then the file will be cached
        +temporarily on disk (in location given by
        +[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded.
        +Small files will be cached in memory - see the
        +[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag.
        +When uploading from local disk the source checksum is always available,
        +so this does not apply. Starting with rclone version 1.52 the same is
        +true for encrypted remotes (in older versions the crypt backend would not
        +calculate hashes for uploads from local disk, so the Jottacloud
        +backend had to do it as described above).
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| "         | 0x22  | "          |
        +| *         | 0x2A  | *          |
        +| :         | 0x3A  | :          |
        +| <         | 0x3C  | <          |
        +| >         | 0x3E  | >          |
        +| ?         | 0x3F  | ?          |
        +| \|        | 0x7C  | |          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in XML strings.
        +
        +### Deleting files
        +
        +By default, rclone will send all files to the trash when deleting files. They will be permanently
        +deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately
        +by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable.
        +Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command.
        +
        +### Versions
        +
        +Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it.
        +Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website.
        +
        +Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading
        +a new version. If the upload the fails no version of the file will be available in the remote.
        +
        +### Quota information
        +
        +To view your current quota you can use the `rclone about remote:`
        +command which will display your usage limit (unless it is unlimited)
        +and the current usage.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to jottacloud (Jottacloud).
        +
        +#### --jottacloud-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_JOTTACLOUD_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --jottacloud-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_JOTTACLOUD_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to jottacloud (Jottacloud).
        +
        +#### --jottacloud-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_JOTTACLOUD_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --jottacloud-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_JOTTACLOUD_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --jottacloud-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_JOTTACLOUD_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --jottacloud-md5-memory-limit
        +
        +Files bigger than this will be cached on disk to calculate the MD5 if required.
        +
        +Properties:
        +
        +- Config:      md5_memory_limit
        +- Env Var:     RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT
        +- Type:        SizeSuffix
        +- Default:     10Mi
        +
        +#### --jottacloud-trashed-only
        +
        +Only show files that are in the trash.
        +
        +This will show trashed files in their original directory structure.
        +
        +Properties:
        +
        +- Config:      trashed_only
        +- Env Var:     RCLONE_JOTTACLOUD_TRASHED_ONLY
        +- Type:        bool
        +- Default:     false
        +
        +#### --jottacloud-hard-delete
        +
        +Delete files permanently rather than putting them into the trash.
        +
        +Properties:
        +
        +- Config:      hard_delete
        +- Env Var:     RCLONE_JOTTACLOUD_HARD_DELETE
        +- Type:        bool
        +- Default:     false
        +
        +#### --jottacloud-upload-resume-limit
        +
        +Files bigger than this can be resumed if the upload fail's.
        +
        +Properties:
        +
        +- Config:      upload_resume_limit
        +- Env Var:     RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT
        +- Type:        SizeSuffix
        +- Default:     10Mi
        +
        +#### --jottacloud-no-versions
        +
        +Avoid server side versioning by deleting files and recreating files instead of overwriting them.
        +
        +Properties:
        +
        +- Config:      no_versions
        +- Env Var:     RCLONE_JOTTACLOUD_NO_VERSIONS
        +- Type:        bool
        +- Default:     false
        +
        +#### --jottacloud-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_JOTTACLOUD_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot
        +
        +### Metadata
        +
        +Jottacloud has limited support for metadata, currently an extended set of timestamps.
        +
        +Here are the possible system metadata items for the jottacloud backend.
        +
        +| Name | Help | Type | Example | Read Only |
        +|------|------|------|---------|-----------|
        +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N |
        +| content-type | MIME type, also known as media type | string | text/plain | **Y** |
        +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N |
        +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** |
        +
        +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
        +
        +
        +
        +## Limitations
        +
        +Note that Jottacloud is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical
        +looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead.
        +
        +Jottacloud only supports filenames up to 255 characters in length.
        +
        +## Troubleshooting
        +
        +Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove
        +operations to previously deleted paths to fail. Emptying the trash should help in such cases.
        +
        +#  Koofr
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for Koofr involves creating an application password for
        +rclone. You can do that by opening the Koofr
        +[web application](https://app.koofr.net/app/admin/preferences/password),
        +giving the password a nice name like `rclone` and clicking on generate.
        +
        +Here is an example of how to make a remote called `koofr`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> koofr Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 1
        +Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n Remote config -------------------- [koofr] type = koofr provider = koofr user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +You can choose to edit advanced config in order to enter your own service URL
        +if you use an on-premise or white label Koofr instance, or choose an alternative
        +mount instead of your primary storage.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Koofr
        +
        +    rclone lsd koofr:
        +
        +List all the files in your Koofr
        +
        +    rclone ls koofr:
        +
        +To copy a local directory to an Koofr directory called backup
        +
        +    rclone copy /home/source koofr:backup
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \         | 0x5C  | \           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in XML strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).
        +
        +#### --koofr-provider
        +
        +Choose your storage provider.
        +
        +Properties:
        +
        +- Config:      provider
        +- Env Var:     RCLONE_KOOFR_PROVIDER
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "koofr"
        +        - Koofr, https://app.koofr.net/
        +    - "digistorage"
        +        - Digi Storage, https://storage.rcs-rds.ro/
        +    - "other"
        +        - Any other Koofr API compatible storage service
        +
        +#### --koofr-endpoint
        +
        +The Koofr API endpoint to use.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_KOOFR_ENDPOINT
        +- Provider:    other
        +- Type:        string
        +- Required:    true
        +
        +#### --koofr-user
        +
        +Your user name.
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_KOOFR_USER
        +- Type:        string
        +- Required:    true
        +
        +#### --koofr-password
        +
        +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password).
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_KOOFR_PASSWORD
        +- Provider:    koofr
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).
        +
        +#### --koofr-mountid
        +
        +Mount ID of the mount to use.
        +
        +If omitted, the primary mount is used.
        +
        +Properties:
        +
        +- Config:      mountid
        +- Env Var:     RCLONE_KOOFR_MOUNTID
        +- Type:        string
        +- Required:    false
        +
        +#### --koofr-setmtime
        +
        +Does the backend support setting modification time.
        +
        +Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend.
        +
        +Properties:
        +
        +- Config:      setmtime
        +- Env Var:     RCLONE_KOOFR_SETMTIME
        +- Type:        bool
        +- Default:     true
        +
        +#### --koofr-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_KOOFR_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +Note that Koofr is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +## Providers
        +
        +### Koofr
        +
        +This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above.
        +
        +### Digi Storage 
        +
        +[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that
        +provides a Koofr API.
        +
        +Here is an example of how to make a remote called `ds`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> ds Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 2 Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [ds] type = koofr provider = digistorage user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### Other
        +
        +You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to.
        +
        +Here is an example of how to make a remote called `other`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> other Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 3 Option endpoint. The Koofr API endpoint to use. Enter a value. endpoint> https://koofr.other.org Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at your service's settings page). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [other] type = koofr provider = other endpoint = https://koofr.other.org user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +#  Linkbox
        +
        +Linkbox is [a private cloud drive](https://linkbox.to/).
        +
        +## Configuration
        +
        +Here is an example of making a remote for Linkbox.
        +
        +First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n

        +

        Enter name for new remote. name> remote

        +

        Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. XX / Linkbox  (linkbox) Storage> XX

        +

        Option token. Token from https://www.linkbox.to/admin/account Enter a value. token> testFromCLToken

        +

        Configuration complete. Options: - type: linkbox - token: XXXXXXXXXXX Keep this "linkbox" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +
        +### Standard options
        +
        +Here are the Standard options specific to linkbox (Linkbox).
        +
        +#### --linkbox-token
        +
        +Token from https://www.linkbox.to/admin/account
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_LINKBOX_TOKEN
        +- Type:        string
        +- Required:    true
        +
        +
        +
        +## Limitations
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +#  Mail.ru Cloud
        +
        +[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS.
        +
        +## Features highlights
        +
        +- Paths may be as deep as required, e.g. `remote:directory/subdirectory`
        +- Files have a `last modified time` property, directories don't
        +- Deleted files are by default moved to the trash
        +- Files and directories can be shared via public links
        +- Partial uploads or streaming are not supported, file size must be known before upload
        +- Maximum file size is limited to 2G for a free account, unlimited for paid accounts
        +- Storage keeps hash for all files and performs transparent deduplication,
        +  the hash algorithm is a modified SHA1
        +- If a particular file is already present in storage, one can quickly submit file hash
        +  instead of long file upload (this optimization is supported by rclone)
        +
        +## Configuration
        +
        +Here is an example of making a mailru configuration.
        +
        +First create a Mail.ru Cloud account and choose a tariff.
        +
        +You will need to log in and create an app password for rclone. Rclone
        +**will not work** with your normal username and password - it will
        +give an error like `oauth2: server response missing access_token`.
        +
        +- Click on your user icon in the top right
        +- Go to Security / "Пароль и безопасность"
        +- Click password for apps / "Пароли для внешних приложений"
        +- Add the password - give it a name - eg "rclone"
        +- Copy the password and use this password below - your normal login password won't work.
        +
        +Now run
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Mail.ru Cloud  "mailru" [snip] Storage> mailru User name (usually email) Enter a string value. Press Enter for the default (""). user> username@mail.ru Password

        +

        This must be an app password - rclone will not work with your normal password. See the Configuration section in the docs for how to make an app password. y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Skip full upload if there is another file with same data hash. This feature is called "speedup" or "put by hash". It is especially efficient in case of generally available files like popular books, video or audio clips [snip] Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value 1 / Enable  "true" 2 / Disable  "false" speedup_enable> 1 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -------------------- [remote] type = mailru user = username@mail.ru pass = *** ENCRYPTED *** speedup_enable = true -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +Configuration of this backend does not require a local web browser.
        +You can use the configured backend as shown below:
        +
        +See top level directories
        +
        +    rclone lsd remote:
        +
        +Make a new directory
        +
        +    rclone mkdir remote:directory
        +
        +List the contents of a directory
        +
        +    rclone ls remote:directory
        +
        +Sync `/home/local/directory` to the remote path, deleting any
        +excess files in the path.
        +
        +    rclone sync --interactive /home/local/directory remote:directory
        +
        +### Modification times and hashes
        +
        +Files support a modification time attribute with up to 1 second precision.
        +Directories do not have a modification time, which is shown as "Jan 1 1970".
        +
        +File hashes are supported, with a custom Mail.ru algorithm based on SHA1.
        +If file size is less than or equal to the SHA1 block size (20 bytes),
        +its hash is simply its data right-padded with zero bytes.
        +Hashes of a larger file is computed as a SHA1 of the file data
        +bytes concatenated with a decimal representation of the data length.
        +
        +### Emptying Trash
        +
        +Removing a file or directory actually moves it to the trash, which is not
        +visible to rclone but can be seen in a web browser. The trashed file
        +still occupies part of total quota. If you wish to empty your trash
        +and free some quota, you can use the `rclone cleanup remote:` command,
        +which will permanently delete all your trashed files.
        +This command does not take any path arguments.
        +
        +### Quota information
        +
        +To view your current quota you can use the `rclone about remote:`
        +command which will display your usage limit (quota) and the current usage.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| "         | 0x22  | "          |
        +| *         | 0x2A  | *          |
        +| :         | 0x3A  | :          |
        +| <         | 0x3C  | <          |
        +| >         | 0x3E  | >          |
        +| ?         | 0x3F  | ?          |
        +| \         | 0x5C  | \          |
        +| \|        | 0x7C  | |          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to mailru (Mail.ru Cloud).
        +
        +#### --mailru-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_MAILRU_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_MAILRU_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-user
        +
        +User name (usually email).
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_MAILRU_USER
        +- Type:        string
        +- Required:    true
        +
        +#### --mailru-pass
        +
        +Password.
        +
        +This must be an app password - rclone will not work with your normal
        +password. See the Configuration section in the docs for how to make an
        +app password.
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      pass
        +- Env Var:     RCLONE_MAILRU_PASS
        +- Type:        string
        +- Required:    true
        +
        +#### --mailru-speedup-enable
        +
        +Skip full upload if there is another file with same data hash.
        +
        +This feature is called "speedup" or "put by hash". It is especially efficient
        +in case of generally available files like popular books, video or audio clips,
        +because files are searched by hash in all accounts of all mailru users.
        +It is meaningless and ineffective if source file is unique or encrypted.
        +Please note that rclone may need local memory and disk space to calculate
        +content hash in advance and decide whether full upload is required.
        +Also, if rclone does not know file size in advance (e.g. in case of
        +streaming or partial uploads), it will not even try this optimization.
        +
        +Properties:
        +
        +- Config:      speedup_enable
        +- Env Var:     RCLONE_MAILRU_SPEEDUP_ENABLE
        +- Type:        bool
        +- Default:     true
        +- Examples:
        +    - "true"
        +        - Enable
        +    - "false"
        +        - Disable
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to mailru (Mail.ru Cloud).
        +
        +#### --mailru-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_MAILRU_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_MAILRU_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_MAILRU_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-speedup-file-patterns
        +
        +Comma separated list of file name patterns eligible for speedup (put by hash).
        +
        +Patterns are case insensitive and can contain '*' or '?' meta characters.
        +
        +Properties:
        +
        +- Config:      speedup_file_patterns
        +- Env Var:     RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS
        +- Type:        string
        +- Default:     "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf"
        +- Examples:
        +    - ""
        +        - Empty list completely disables speedup (put by hash).
        +    - "*"
        +        - All files will be attempted for speedup.
        +    - "*.mkv,*.avi,*.mp4,*.mp3"
        +        - Only common audio/video files will be tried for put by hash.
        +    - "*.zip,*.gz,*.rar,*.pdf"
        +        - Only common archives or PDF books will be tried for speedup.
        +
        +#### --mailru-speedup-max-disk
        +
        +This option allows you to disable speedup (put by hash) for large files.
        +
        +Reason is that preliminary hashing can exhaust your RAM or disk space.
        +
        +Properties:
        +
        +- Config:      speedup_max_disk
        +- Env Var:     RCLONE_MAILRU_SPEEDUP_MAX_DISK
        +- Type:        SizeSuffix
        +- Default:     3Gi
        +- Examples:
        +    - "0"
        +        - Completely disable speedup (put by hash).
        +    - "1G"
        +        - Files larger than 1Gb will be uploaded directly.
        +    - "3G"
        +        - Choose this option if you have less than 3Gb free on local disk.
        +
        +#### --mailru-speedup-max-memory
        +
        +Files larger than the size given below will always be hashed on disk.
        +
        +Properties:
        +
        +- Config:      speedup_max_memory
        +- Env Var:     RCLONE_MAILRU_SPEEDUP_MAX_MEMORY
        +- Type:        SizeSuffix
        +- Default:     32Mi
        +- Examples:
        +    - "0"
        +        - Preliminary hashing will always be done in a temporary disk location.
        +    - "32M"
        +        - Do not dedicate more than 32Mb RAM for preliminary hashing.
        +    - "256M"
        +        - You have at most 256Mb RAM free for hash calculations.
        +
        +#### --mailru-check-hash
        +
        +What should copy do if file checksum is mismatched or invalid.
        +
        +Properties:
        +
        +- Config:      check_hash
        +- Env Var:     RCLONE_MAILRU_CHECK_HASH
        +- Type:        bool
        +- Default:     true
        +- Examples:
        +    - "true"
        +        - Fail with error.
        +    - "false"
        +        - Ignore and continue.
        +
        +#### --mailru-user-agent
        +
        +HTTP user agent used internally by client.
        +
        +Defaults to "rclone/VERSION" or "--user-agent" provided on command line.
        +
        +Properties:
        +
        +- Config:      user_agent
        +- Env Var:     RCLONE_MAILRU_USER_AGENT
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-quirks
        +
        +Comma separated list of internal maintenance flags.
        +
        +This option must not be used by an ordinary user. It is intended only to
        +facilitate remote troubleshooting of backend issues. Strict meaning of
        +flags is not documented and not guaranteed to persist between releases.
        +Quirks will be removed when the backend grows stable.
        +Supported quirks: atomicmkdir binlist unknowndirs
        +
        +Properties:
        +
        +- Config:      quirks
        +- Env Var:     RCLONE_MAILRU_QUIRKS
        +- Type:        string
        +- Required:    false
        +
        +#### --mailru-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_MAILRU_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +File size limits depend on your account. A single file size is limited by 2G
        +for a free account and unlimited for paid tariffs. Please refer to the Mail.ru
        +site for the total uploaded size limits.
        +
        +Note that Mailru is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +#  Mega
        +
        +[Mega](https://mega.nz/) is a cloud storage and file hosting service
        +known for its security feature where all files are encrypted locally
        +before they are uploaded. This prevents anyone (including employees of
        +Mega) from accessing the files without knowledge of the key used for
        +encryption.
        +
        +This is an rclone backend for Mega which supports the file transfer
        +features of Mega using the same client side encryption.
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Mega  "mega" [snip] Storage> mega User name user> you@example.com Password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: Remote config -------------------- [remote] type = mega user = you@example.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +**NOTE:** The encryption keys need to have been already generated after a regular login
        +via the browser, otherwise attempting to use the credentials in `rclone` will fail.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Mega
        +
        +    rclone lsd remote:
        +
        +List all the files in your Mega
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an Mega directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +Mega does not support modification times or hashes yet.
        +
        +### Restricted filename characters
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| NUL       | 0x00  | ␀           |
        +| /         | 0x2F  | /          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Duplicated files
        +
        +Mega can have two files with exactly the same name and path (unlike a
        +normal file system).
        +
        +Duplicated files cause problems with the syncing and you will see
        +messages in the log about duplicates.
        +
        +Use `rclone dedupe` to fix duplicated files.
        +
        +### Failure to log-in
        +
        +#### Object not found
        +
        +If you are connecting to your Mega remote for the first time, 
        +to test access and synchronization, you may receive an error such as 
        +
        +

        Failed to create file system for "my-mega-remote:": couldn't login: Object (typically, node or user) not found

        +
        
        +The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega)
        +start with the **MEGAcmd** utility. Note that this refers to 
        +the official C++ command from https://github.com/meganz/MEGAcmd 
        +and not the go language built command from t3rm1n4l/megacmd 
        +that is no longer maintained. 
        +
        +Follow the instructions for installing MEGAcmd and try accessing 
        +your remote as they recommend. You can establish whether or not 
        +you can log in using MEGAcmd, and obtain diagnostic information 
        +to help you, and search or work with others in the forum. 
        +
        +

        MEGA CMD> login me@example.com Password: Fetching nodes ... Loading transfers from local cache Login complete as me@example.com me@example.com:/$

        +
        
        +Note that some have found issues with passwords containing special 
        +characters. If you can not log on with rclone, but MEGAcmd logs on 
        +just fine, then consider changing your password temporarily to 
        +pure alphanumeric characters, in case that helps.
        +
        +
        +#### Repeated commands blocks access
        +
        +Mega remotes seem to get blocked (reject logins) under "heavy use".
        +We haven't worked out the exact blocking rules but it seems to be
        +related to fast paced, successive rclone commands.
        +
        +For example, executing this command 90 times in a row `rclone link
        +remote:file` will cause the remote to become "blocked". This is not an
        +abnormal situation, for example if you wish to get the public links of
        +a directory with hundred of files...  After more or less a week, the
        +remote will remote accept rclone logins normally again.
        +
        +You can mitigate this issue by mounting the remote it with `rclone
        +mount`. This will log-in when mounting and a log-out when unmounting
        +only. You can also run `rclone rcd` and then use `rclone rc` to run
        +the commands over the API to avoid logging in each time.
        +
        +Rclone does not currently close mega sessions (you can see them in the
        +web interface), however closing the sessions does not solve the issue.
        +
        +If you space rclone commands by 3 seconds it will avoid blocking the
        +remote. We haven't identified the exact blocking rules, so perhaps one
        +could execute the command 80 times without waiting and avoid blocking
        +by waiting 3 seconds, then continuing...
        +
        +Note that this has been observed by trial and error and might not be
        +set in stone.
        +
        +Other tools seem not to produce this blocking effect, as they use a
        +different working approach (state-based, using sessionIDs instead of
        +log-in) which isn't compatible with the current stateless rclone
        +approach.
        +
        +Note that once blocked, the use of other tools (such as megacmd) is
        +not a sure workaround: following megacmd login times have been
        +observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30
        +min, 30min. Web access looks unaffected though.
        +
        +Investigation is continuing in relation to workarounds based on
        +timeouts, pacers, retrials and tpslimits - if you discover something
        +relevant, please post on the forum.
        +
        +So, if rclone was working nicely and suddenly you are unable to log-in
        +and you are sure the user and the password are correct, likely you
        +have got the remote blocked for a while.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to mega (Mega).
        +
        +#### --mega-user
        +
        +User name.
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_MEGA_USER
        +- Type:        string
        +- Required:    true
        +
        +#### --mega-pass
        +
        +Password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      pass
        +- Env Var:     RCLONE_MEGA_PASS
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to mega (Mega).
        +
        +#### --mega-debug
        +
        +Output more debug from Mega.
        +
        +If this flag is set (along with -vv) it will print further debugging
        +information from the mega backend.
        +
        +Properties:
        +
        +- Config:      debug
        +- Env Var:     RCLONE_MEGA_DEBUG
        +- Type:        bool
        +- Default:     false
        +
        +#### --mega-hard-delete
        +
        +Delete files permanently rather than putting them into the trash.
        +
        +Normally the mega backend will put all deletions into the trash rather
        +than permanently deleting them.  If you specify this then rclone will
        +permanently delete objects instead.
        +
        +Properties:
        +
        +- Config:      hard_delete
        +- Env Var:     RCLONE_MEGA_HARD_DELETE
        +- Type:        bool
        +- Default:     false
        +
        +#### --mega-use-https
        +
        +Use HTTPS for transfers.
        +
        +MEGA uses plain text HTTP connections by default.
        +Some ISPs throttle HTTP connections, this causes transfers to become very slow.
        +Enabling this will force MEGA to use HTTPS for all transfers.
        +HTTPS is normally not necessary since all data is already encrypted anyway.
        +Enabling it will increase CPU usage and add network overhead.
        +
        +Properties:
        +
        +- Config:      use_https
        +- Env Var:     RCLONE_MEGA_USE_HTTPS
        +- Type:        bool
        +- Default:     false
        +
        +#### --mega-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_MEGA_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,InvalidUtf8,Dot
        +
        +
        +
        +### Process `killed`
        +
        +On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4).
        +
        +## Limitations
        +
        +This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource
        +go library implementing the Mega API. There doesn't appear to be any
        +documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code
        +so there are likely quite a few errors still remaining in this library.
        +
        +Mega allows duplicate files which may confuse rclone.
        +
        +#  Memory
        +
        +The memory backend is an in RAM backend. It does not persist its
        +data - use the local backend for that.
        +
        +The memory backend behaves like a bucket-based remote (e.g. like
        +s3). Because it has no parameters you can just use it with the
        +`:memory:` remote name.
        +
        +## Configuration
        +
        +You can configure it as a remote like this with `rclone config` too if
        +you want to:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Memory  "memory" [snip] Storage> memory ** See help for memory backend at: https://rclone.org/memory/ **

        +

        Remote config

        - - - - - - - - - - + - - - +
        CharacterValueReplacement
        NUL0x00[remote]
        /0x2Ftype = memory
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Standard options

        -

        Here are the Standard options specific to swift (OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)).

        -

        --swift-env-auth

        -

        Get swift credentials from environment variables in standard OpenStack form.

        -

        Properties:

        -
          -
        • Config: env_auth
        • -
        • Env Var: RCLONE_SWIFT_ENV_AUTH
        • -
        • Type: bool
        • -
        • Default: false
        • -
        • Examples: -
            -
          • "false" -
              -
            • Enter swift credentials in the next step.
            • -
          • -
          • "true" -
              -
            • Get swift credentials from environment vars.
            • -
            • Leave other fields blank if using this.
            • -
          • -
        • -
        -

        --swift-user

        -

        User name to log in (OS_USERNAME).

        -

        Properties:

        -
          -
        • Config: user
        • -
        • Env Var: RCLONE_SWIFT_USER
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-key

        -

        API key or password (OS_PASSWORD).

        -

        Properties:

        -
          -
        • Config: key
        • -
        • Env Var: RCLONE_SWIFT_KEY
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-auth

        -

        Authentication URL for server (OS_AUTH_URL).

        -

        Properties:

        -
          -
        • Config: auth
        • -
        • Env Var: RCLONE_SWIFT_AUTH
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "https://auth.api.rackspacecloud.com/v1.0" -
              -
            • Rackspace US
            • -
          • -
          • "https://lon.auth.api.rackspacecloud.com/v1.0" -
              -
            • Rackspace UK
            • -
          • -
          • "https://identity.api.rackspacecloud.com/v2.0" -
              -
            • Rackspace v2
            • -
          • -
          • "https://auth.storage.memset.com/v1.0" -
              -
            • Memset Memstore UK
            • -
          • -
          • "https://auth.storage.memset.com/v2.0" -
              -
            • Memset Memstore UK v2
            • -
          • -
          • "https://auth.cloud.ovh.net/v3" -
              -
            • OVH
            • -
          • -
        • -
        -

        --swift-user-id

        -

        User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID).

        -

        Properties:

        -
          -
        • Config: user_id
        • -
        • Env Var: RCLONE_SWIFT_USER_ID
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-domain

        -

        User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)

        -

        Properties:

        -
          -
        • Config: domain
        • -
        • Env Var: RCLONE_SWIFT_DOMAIN
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-tenant

        -

        Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME).

        -

        Properties:

        -
          -
        • Config: tenant
        • -
        • Env Var: RCLONE_SWIFT_TENANT
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-tenant-id

        -

        Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID).

        -

        Properties:

        -
          -
        • Config: tenant_id
        • -
        • Env Var: RCLONE_SWIFT_TENANT_ID
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-tenant-domain

        -

        Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME).

        -

        Properties:

        -
          -
        • Config: tenant_domain
        • -
        • Env Var: RCLONE_SWIFT_TENANT_DOMAIN
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-region

        -

        Region name - optional (OS_REGION_NAME).

        -

        Properties:

        -
          -
        • Config: region
        • -
        • Env Var: RCLONE_SWIFT_REGION
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-storage-url

        -

        Storage URL - optional (OS_STORAGE_URL).

        -

        Properties:

        -
          -
        • Config: storage_url
        • -
        • Env Var: RCLONE_SWIFT_STORAGE_URL
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-auth-token

        -

        Auth Token from alternate authentication - optional (OS_AUTH_TOKEN).

        -

        Properties:

        -
          -
        • Config: auth_token
        • -
        • Env Var: RCLONE_SWIFT_AUTH_TOKEN
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-application-credential-id

        -

        Application Credential ID (OS_APPLICATION_CREDENTIAL_ID).

        -

        Properties:

        -
          -
        • Config: application_credential_id
        • -
        • Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_ID
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-application-credential-name

        -

        Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME).

        -

        Properties:

        -
          -
        • Config: application_credential_name
        • -
        • Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_NAME
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-application-credential-secret

        -

        Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET).

        -

        Properties:

        -
          -
        • Config: application_credential_secret
        • -
        • Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_SECRET
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --swift-auth-version

        -

        AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION).

        -

        Properties:

        -
          -
        • Config: auth_version
        • -
        • Env Var: RCLONE_SWIFT_AUTH_VERSION
        • -
        • Type: int
        • -
        • Default: 0
        • -
        -

        --swift-endpoint-type

        -

        Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE).

        -

        Properties:

        -
          -
        • Config: endpoint_type
        • -
        • Env Var: RCLONE_SWIFT_ENDPOINT_TYPE
        • -
        • Type: string
        • -
        • Default: "public"
        • -
        • Examples: -
            -
          • "public" -
              -
            • Public (default, choose this if not sure)
            • -
          • -
          • "internal" -
              -
            • Internal (use internal service net)
            • -
          • -
          • "admin" -
              -
            • Admin
            • -
          • -
        • -
        -

        --swift-storage-policy

        -

        The storage policy to use when creating a new container.

        -

        This applies the specified storage policy when creating a new container. The policy cannot be changed afterwards. The allowed configuration values and their meaning depend on your Swift storage provider.

        -

        Properties:

        -
          -
        • Config: storage_policy
        • -
        • Env Var: RCLONE_SWIFT_STORAGE_POLICY
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "" -
              -
            • Default
            • -
          • -
          • "pcs" -
              -
            • OVH Public Cloud Storage
            • -
          • -
          • "pca" -
              -
            • OVH Public Cloud Archive
            • -
          • -
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to swift (OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)).

        -

        --swift-leave-parts-on-error

        -

        If true avoid calling abort upload on a failure.

        -

        It should be set to true for resuming uploads across different sessions.

        -

        Properties:

        -
          -
        • Config: leave_parts_on_error
        • -
        • Env Var: RCLONE_SWIFT_LEAVE_PARTS_ON_ERROR
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --swift-chunk-size

        -

        Above this size files will be chunked into a _segments container.

        -

        Above this size files will be chunked into a _segments container. The default for this is 5 GiB which is its maximum value.

        -

        Properties:

        -
          -
        • Config: chunk_size
        • -
        • Env Var: RCLONE_SWIFT_CHUNK_SIZE
        • -
        • Type: SizeSuffix
        • -
        • Default: 5Gi
        • -
        -

        --swift-no-chunk

        -

        Don't chunk files during streaming upload.

        -

        When doing streaming uploads (e.g. using rcat or mount) setting this flag will cause the swift backend to not upload chunked files.

        -

        This will limit the maximum upload size to 5 GiB. However non chunked files are easier to deal with and have an MD5SUM.

        -

        Rclone will still chunk files bigger than chunk_size when doing normal copy operations.

        -

        Properties:

        -
          -
        • Config: no_chunk
        • -
        • Env Var: RCLONE_SWIFT_NO_CHUNK
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --swift-no-large-objects

        -

        Disable support for static and dynamic large objects

        -

        Swift cannot transparently store files bigger than 5 GiB. There are two schemes for doing that, static or dynamic large objects, and the API does not allow rclone to determine whether a file is a static or dynamic large object without doing a HEAD on the object. Since these need to be treated differently, this means rclone has to issue HEAD requests for objects for example when reading checksums.

        -

        When no_large_objects is set, rclone will assume that there are no static or dynamic large objects stored. This means it can stop doing the extra HEAD calls which in turn increases performance greatly especially when doing a swift to swift transfer with --checksum set.

        -

        Setting this option implies no_chunk and also that no files will be uploaded in chunks, so files bigger than 5 GiB will just fail on upload.

        -

        If you set this option and there are static or dynamic large objects, then this will give incorrect hashes for them. Downloads will succeed, but other operations such as Remove and Copy will fail.

        -

        Properties:

        -
          -
        • Config: no_large_objects
        • -
        • Env Var: RCLONE_SWIFT_NO_LARGE_OBJECTS
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --swift-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        +
          +
        1. Yes this is OK (default)
        2. +
        3. Edit this remote
        4. +
        5. Delete this remote y/e/d> y
        6. +
        +
        
        +Because the memory backend isn't persistent it is most useful for
        +testing or with an rclone server or rclone mount, e.g.
        +
        +    rclone mount :memory: /mnt/tmp
        +    rclone serve webdav :memory:
        +    rclone serve sftp :memory:
        +
        +### Modification times and hashes
        +
        +The memory backend supports MD5 hashes and modification times accurate to 1 nS.
        +
        +### Restricted filename characters
        +
        +The memory backend replaces the [default restricted characters
        +set](https://rclone.org/overview/#restricted-characters).
        +
        +
        +
        +
        +#  Akamai NetStorage
        +
        +Paths are specified as `remote:`
        +You may put subdirectories in too, e.g. `remote:/path/to/dir`.
        +If you have a CP code you can use that as the folder after the domain such as \<domain>\/\<cpcode>\/\<internal directories within cpcode>.
        +
        +For example, this is commonly configured with or without a CP code:
        +* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/`
        +* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net`
        +
        +
        +See all buckets
        +   rclone lsd remote:
        +The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process.
        +
        +## Configuration
        +
        +Here's an example of how to make a remote called `ns1`.
        +
        +1. To begin the interactive configuration process, enter this command:
        +
        +

        rclone config

        +
        
        +2. Type `n` to create a new remote.
        +
        +
          +
        1. New remote
        2. +
        3. Delete remote
        4. +
        5. Quit config e/n/d/q> n
        6. +
        +
        
        +3. For this example, enter `ns1` when you reach the name> prompt.
        +
        +

        name> ns1

        +
        
        +4. Enter `netstorage` as the type of storage to configure.
        +
        +

        Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value XX / NetStorage  "netstorage" Storage> netstorage

        +
        
        +5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes.
        +
        +
        +

        Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / HTTP protocol  "http" 2 / HTTPS protocol  "https" protocol> 1

        +
        
        +6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `<domain>/<cpcode>/<content>/`
        +
        +

        Enter a string value. Press Enter for the default (""). host> baseball-nsu.akamaihd.net/123456/content/

        +
        
        +7. Set the netstorage account name
        +

        Enter a string value. Press Enter for the default (""). account> username

        +
        
        +8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret.
        +Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption.
        +
        +
          +
        1. Yes type in my own password
        2. +
        3. Generate random password y/g> y Enter the password: password: Confirm the password: password:
        4. +
        +
        
        +9. View the summary and confirm your remote configuration.
        +
        +

        [ns1] type = netstorage protocol = http host = baseball-nsu.akamaihd.net/123456/content/ account = username secret = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +This remote is called `ns1` and can now be used.
        +
        +## Example operations
        +
        +Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/.
        +
        +### See contents of a directory in your project
        +
        +    rclone lsd ns1:/974012/testing/
        +
        +### Sync the contents local with remote
        +
        +    rclone sync . ns1:/974012/testing/
        +
        +### Upload local content to remote
        +    rclone copy notes.txt ns1:/974012/testing/
        +
        +### Delete content on remote
        +    rclone delete ns1:/974012/testing/notes.txt
        +
        +### Move or copy content between CP codes.
        +
        +Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes.
        +
        +    rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/
        +
        +## Features
        +
        +### Symlink Support
        +
        +The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote.
        +
        +This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below.
        +
        +Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink.
        +
        +**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote.
        +
        +### Implicit vs. Explicit Directories
        +
        +With NetStorage, directories can exist in one of two forms:
        +
        +1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group.
        +2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file.
        +
        +Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly.
        +
        +### `--fast-list` / ListR support
        +
        +NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered.
        +
        +* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects.
        +
        +* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the  `--fast-list` option.
        +
        +There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster.
        +
        +**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output.
        +
        +### Purge
        +
        +NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method.
        +
        +**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to netstorage (Akamai NetStorage).
        +
        +#### --netstorage-host
        +
        +Domain+path of NetStorage host to connect to.
        +
        +Format should be `<domain>/<internal folders>`
        +
        +Properties:
        +
        +- Config:      host
        +- Env Var:     RCLONE_NETSTORAGE_HOST
        +- Type:        string
        +- Required:    true
        +
        +#### --netstorage-account
        +
        +Set the NetStorage account name
        +
        +Properties:
        +
        +- Config:      account
        +- Env Var:     RCLONE_NETSTORAGE_ACCOUNT
        +- Type:        string
        +- Required:    true
        +
        +#### --netstorage-secret
        +
        +Set the NetStorage account secret/G2O key for authentication.
        +
        +Please choose the 'y' option to set your own password then enter your secret.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      secret
        +- Env Var:     RCLONE_NETSTORAGE_SECRET
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to netstorage (Akamai NetStorage).
        +
        +#### --netstorage-protocol
        +
        +Select between HTTP or HTTPS protocol.
        +
        +Most users should choose HTTPS, which is the default.
        +HTTP is provided primarily for debugging purposes.
        +
        +Properties:
        +
        +- Config:      protocol
        +- Env Var:     RCLONE_NETSTORAGE_PROTOCOL
        +- Type:        string
        +- Default:     "https"
        +- Examples:
        +    - "http"
        +        - HTTP protocol
        +    - "https"
        +        - HTTPS protocol
        +
        +## Backend commands
        +
        +Here are the commands specific to the netstorage backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### du
        +
        +Return disk usage information for a specified directory
        +
        +    rclone backend du remote: [options] [<arguments>+]
        +
        +The usage information returned, includes the targeted directory as well as all
        +files stored in any sub-directories that may exist.
        +
        +### symlink
        +
        +You can create a symbolic link in ObjectStore with the symlink action.
        +
        +    rclone backend symlink remote: [options] [<arguments>+]
        +
        +The desired path location (including applicable sub-directories) ending in
        +the object that will be the target of the symlink (for example, /links/mylink).
        +Include the file extension for the object, if applicable.
        +`rclone backend symlink <src> <path>`
        +
        +
        +
        +#  Microsoft Azure Blob Storage
        +
        +Paths are specified as `remote:container` (or `remote:` for the `lsd`
        +command.)  You may put subdirectories in too, e.g.
        +`remote:container/path/to/dir`.
        +
        +## Configuration
        +
        +Here is an example of making a Microsoft Azure Blob Storage
        +configuration.  For a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Microsoft Azure Blob Storage  "azureblob" [snip] Storage> azureblob Storage Account Name account> account_name Storage Account Key key> base64encodedkey== Endpoint for the service - leave blank normally. endpoint> Remote config -------------------- [remote] account = account_name key = base64encodedkey== endpoint = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +See all containers
        +
        +    rclone lsd remote:
        +
        +Make a new container
        +
        +    rclone mkdir remote:container
        +
        +List the contents of a container
        +
        +    rclone ls remote:container
        +
        +Sync `/home/local/directory` to the remote container, deleting any excess
        +files in the container.
        +
        +    rclone sync --interactive /home/local/directory remote:container
        +
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +### Modification times and hashes
        +
        +The modification time is stored as metadata on the object with the
        +`mtime` key.  It is stored using RFC3339 Format time with nanosecond
        +precision.  The metadata is supplied during directory listings so
        +there is no performance overhead to using it.
        +
        +If you wish to use the Azure standard `LastModified` time stored on
        +the object as the modified time, then use the `--use-server-modtime`
        +flag. Note that rclone can't set `LastModified`, so using the
        +`--update` flag when syncing is recommended if using
        +`--use-server-modtime`.
        +
        +MD5 hashes are stored with blobs. However blobs that were uploaded in
        +chunks only have an MD5 if the source remote was capable of MD5
        +hashes, e.g. the local disk.
        +
        +### Performance
        +
        +When uploading large files, increasing the value of
        +`--azureblob-upload-concurrency` will increase performance at the cost
        +of using more memory. The default of 16 is set quite conservatively to
        +use less memory. It maybe be necessary raise it to 64 or higher to
        +fully utilize a 1 GBit/s link with a single file transfer.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| /         | 0x2F  | /           |
        +| \         | 0x5C  | \           |
        +
        +File names can also not end with the following characters.
        +These only get replaced if they are the last character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| .         | 0x2E  | .          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Authentication {#authentication}
        +
        +There are a number of ways of supplying credentials for Azure Blob
        +Storage. Rclone tries them in the order of the sections below.
        +
        +#### Env Auth
        +
        +If the `env_auth` config parameter is `true` then rclone will pull
        +credentials from the environment or runtime.
        +
        +It tries these authentication methods in this order:
        +
        +1. Environment Variables
        +2. Managed Service Identity Credentials
        +3. Azure CLI credentials (as used by the az tool)
        +
        +These are described in the following sections
        +
        +##### Env Auth: 1. Environment Variables
        +
        +If `env_auth` is set and environment variables are present rclone
        +authenticates a service principal with a secret or certificate, or a
        +user with a password, depending on which environment variable are set.
        +It reads configuration from these variables, in the following order:
        +
        +1. Service principal with client secret
        +    - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID.
        +    - `AZURE_CLIENT_ID`: the service principal's client ID
        +    - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets
        +2. Service principal with certificate
        +    - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID.
        +    - `AZURE_CLIENT_ID`: the service principal's client ID
        +    - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key.
        +    - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file.
        +    - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
        +3. User with username and password
        +    - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations".
        +    - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to
        +    - `AZURE_USERNAME`: a username (usually an email address)
        +    - `AZURE_PASSWORD`: the user's password
        +4. Workload Identity
        +    - `AZURE_TENANT_ID`: Tenant to authenticate in.
        +    - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to.
        +    - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file.
        +    - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com).
        +
        +
        +##### Env Auth: 2. Managed Service Identity Credentials
        +
        +When using Managed Service Identity if the VM(SS) on which this
        +program is running has a system-assigned identity, it will be used by
        +default. If the resource has no system-assigned but exactly one
        +user-assigned identity, the user-assigned identity will be used by
        +default.
        +
        +If the resource has multiple user-assigned identities you will need to
        +unset `env_auth` and set `use_msi` instead. See the [`use_msi`
        +section](#use_msi).
        +
        +##### Env Auth: 3. Azure CLI credentials (as used by the az tool)
        +
        +Credentials created with the `az` tool can be picked up using `env_auth`.
        +
        +For example if you were to login with a service principal like this:
        +
        +    az login --service-principal -u XXX -p XXX --tenant XXX
        +
        +Then you could access rclone resources like this:
        +
        +    rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER
        +
        +Or
        +
        +    rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER
        +
        +Which is analogous to using the `az` tool:
        +
        +    az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login
        +
        +#### Account and Shared Key
        +
        +This is the most straight forward and least flexible way.  Just fill
        +in the `account` and `key` lines and leave the rest blank.
        +
        +#### SAS URL
        +
        +This can be an account level SAS URL or container level SAS URL.
        +
        +To use it leave `account` and `key` blank and fill in `sas_url`.
        +
        +An account level SAS URL or container level SAS URL can be obtained
        +from the Azure portal or the Azure Storage Explorer.  To get a
        +container level SAS URL right click on a container in the Azure Blob
        +explorer in the Azure portal.
        +
        +If you use a container level SAS URL, rclone operations are permitted
        +only on a particular container, e.g.
        +
        +    rclone ls azureblob:container
        +
        +You can also list the single container from the root. This will only
        +show the container specified by the SAS URL.
        +
        +    $ rclone lsd azureblob:
        +    container/
        +
        +Note that you can't see or access any other containers - this will
        +fail
        +
        +    rclone ls azureblob:othercontainer
        +
        +Container level SAS URLs are useful for temporarily allowing third
        +parties access to a single container or putting credentials into an
        +untrusted environment such as a CI build server.
        +
        +#### Service principal with client secret
        +
        +If these variables are set, rclone will authenticate with a service principal with a client secret.
        +
        +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID.
        +- `client_id`: the service principal's client ID
        +- `client_secret`: one of the service principal's client secrets
        +
        +The credentials can also be placed in a file using the
        +`service_principal_file` configuration option.
        +
        +#### Service principal with certificate
        +
        +If these variables are set, rclone will authenticate with a service principal with certificate.
        +
        +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID.
        +- `client_id`: the service principal's client ID
        +- `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key.
        +- `client_certificate_password`: (optional) password for the certificate file.
        +- `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
        +
        +**NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +#### User with username and password
        +
        +If these variables are set, rclone will authenticate with username and password.
        +
        +- `tenant`: (optional) tenant to authenticate in. Defaults to "organizations".
        +- `client_id`: client ID of the application the user will authenticate to
        +- `username`: a username (usually an email address)
        +- `password`: the user's password
        +
        +Microsoft doesn't recommend this kind of authentication, because it's
        +less secure than other authentication flows. This method is not
        +interactive, so it isn't compatible with any form of multi-factor
        +authentication, and the application must already have user or admin
        +consent. This credential can only authenticate work and school
        +accounts; it can't authenticate Microsoft accounts.
        +
        +**NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +#### Managed Service Identity Credentials {#use_msi}
        +
        +If `use_msi` is set then managed service identity credentials are
        +used. This authentication only works when running in an Azure service.
        +`env_auth` needs to be unset to use this.
        +
        +However if you have multiple user identities to choose from these must
        +be explicitly specified using exactly one of the `msi_object_id`,
        +`msi_client_id`, or `msi_mi_res_id` parameters.
        +
        +If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is
        +set, this is is equivalent to using `env_auth`.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage).
        +
        +#### --azureblob-account
        +
        +Azure Storage Account Name.
        +
        +Set this to the Azure Storage Account Name in use.
        +
        +Leave blank to use SAS URL or Emulator, otherwise it needs to be set.
        +
        +If this is blank and if env_auth is set it will be read from the
        +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible.
        +
        +
        +Properties:
        +
        +- Config:      account
        +- Env Var:     RCLONE_AZUREBLOB_ACCOUNT
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-env-auth
        +
        +Read credentials from runtime (environment variables, CLI or MSI).
        +
        +See the [authentication docs](/azureblob#authentication) for full info.
        +
        +Properties:
        +
        +- Config:      env_auth
        +- Env Var:     RCLONE_AZUREBLOB_ENV_AUTH
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-key
        +
        +Storage Account Shared Key.
        +
        +Leave blank to use SAS URL or Emulator.
        +
        +Properties:
        +
        +- Config:      key
        +- Env Var:     RCLONE_AZUREBLOB_KEY
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-sas-url
        +
        +SAS URL for container level access only.
        +
        +Leave blank if using account/key or Emulator.
        +
        +Properties:
        +
        +- Config:      sas_url
        +- Env Var:     RCLONE_AZUREBLOB_SAS_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-tenant
        +
        +ID of the service principal's tenant. Also called its directory ID.
        +
        +Set this if using
        +- Service principal with client secret
        +- Service principal with certificate
        +- User with username and password
        +
        +
        +Properties:
        +
        +- Config:      tenant
        +- Env Var:     RCLONE_AZUREBLOB_TENANT
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-client-id
        +
        +The ID of the client in use.
        +
        +Set this if using
        +- Service principal with client secret
        +- Service principal with certificate
        +- User with username and password
        +
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_AZUREBLOB_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-client-secret
        +
        +One of the service principal's client secrets
        +
        +Set this if using
        +- Service principal with client secret
        +
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_AZUREBLOB_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-client-certificate-path
        +
        +Path to a PEM or PKCS12 certificate file including the private key.
        +
        +Set this if using
        +- Service principal with certificate
        +
        +
        +Properties:
        +
        +- Config:      client_certificate_path
        +- Env Var:     RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-client-certificate-password
        +
        +Password for the certificate file (optional).
        +
        +Optionally set this if using
        +- Service principal with certificate
        +
        +And the certificate has a password.
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      client_certificate_password
        +- Env Var:     RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage).
        +
        +#### --azureblob-client-send-certificate-chain
        +
        +Send the certificate chain when using certificate auth.
        +
        +Specifies whether an authentication request will include an x5c header
        +to support subject name / issuer based authentication. When set to
        +true, authentication requests include the x5c header.
        +
        +Optionally set this if using
        +- Service principal with certificate
        +
        +
        +Properties:
        +
        +- Config:      client_send_certificate_chain
        +- Env Var:     RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-username
        +
        +User name (usually an email address)
        +
        +Set this if using
        +- User with username and password
        +
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_AZUREBLOB_USERNAME
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-password
        +
        +The user's password
        +
        +Set this if using
        +- User with username and password
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_AZUREBLOB_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-service-principal-file
        +
        +Path to file containing credentials for use with a service principal.
        +
        +Leave blank normally. Needed only if you want to use a service principal instead of interactive login.
        +
        +    $ az ad sp create-for-rbac --name "<name>" \
        +      --role "Storage Blob Data Owner" \
        +      --scopes "/subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>" \
        +      > azure-principal.json
        +
        +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details.
        +
        +It may be more convenient to put the credentials directly into the
        +rclone config file under the `client_id`, `tenant` and `client_secret`
        +keys instead of setting `service_principal_file`.
        +
        +
        +Properties:
        +
        +- Config:      service_principal_file
        +- Env Var:     RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-use-msi
        +
        +Use a managed service identity to authenticate (only works in Azure).
        +
        +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/)
        +to authenticate to Azure Storage instead of a SAS token or account key.
        +
        +If the VM(SS) on which this program is running has a system-assigned identity, it will
        +be used by default. If the resource has no system-assigned but exactly one user-assigned identity,
        +the user-assigned identity will be used by default. If the resource has multiple user-assigned
        +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id,
        +msi_client_id, or msi_mi_res_id parameters.
        +
        +Properties:
        +
        +- Config:      use_msi
        +- Env Var:     RCLONE_AZUREBLOB_USE_MSI
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-msi-object-id
        +
        +Object ID of the user-assigned MSI to use, if any.
        +
        +Leave blank if msi_client_id or msi_mi_res_id specified.
        +
        +Properties:
        +
        +- Config:      msi_object_id
        +- Env Var:     RCLONE_AZUREBLOB_MSI_OBJECT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-msi-client-id
        +
        +Object ID of the user-assigned MSI to use, if any.
        +
        +Leave blank if msi_object_id or msi_mi_res_id specified.
        +
        +Properties:
        +
        +- Config:      msi_client_id
        +- Env Var:     RCLONE_AZUREBLOB_MSI_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-msi-mi-res-id
        +
        +Azure resource ID of the user-assigned MSI to use, if any.
        +
        +Leave blank if msi_client_id or msi_object_id specified.
        +
        +Properties:
        +
        +- Config:      msi_mi_res_id
        +- Env Var:     RCLONE_AZUREBLOB_MSI_MI_RES_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-use-emulator
        +
        +Uses local storage emulator if provided as 'true'.
        +
        +Leave blank if using real azure storage endpoint.
        +
        +Properties:
        +
        +- Config:      use_emulator
        +- Env Var:     RCLONE_AZUREBLOB_USE_EMULATOR
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-endpoint
        +
        +Endpoint for the service.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_AZUREBLOB_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-upload-cutoff
        +
        +Cutoff for switching to chunked upload (<= 256 MiB) (deprecated).
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_AZUREBLOB_UPLOAD_CUTOFF
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-chunk-size
        +
        +Upload chunk size.
        +
        +Note that this is stored in memory and there may be up to
        +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once
        +in memory.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_AZUREBLOB_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     4Mi
        +
        +#### --azureblob-upload-concurrency
        +
        +Concurrency for multipart uploads.
        +
        +This is the number of chunks of the same file that are uploaded
        +concurrently.
        +
        +If you are uploading small numbers of large files over high-speed
        +links and these uploads do not fully utilize your bandwidth, then
        +increasing this may help to speed up the transfers.
        +
        +In tests, upload speed increases almost linearly with upload
        +concurrency. For example to fill a gigabit pipe it may be necessary to
        +raise this to 64. Note that this will use more memory.
        +
        +Note that chunks are stored in memory and there may be up to
        +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once
        +in memory.
        +
        +Properties:
        +
        +- Config:      upload_concurrency
        +- Env Var:     RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY
        +- Type:        int
        +- Default:     16
        +
        +#### --azureblob-list-chunk
        +
        +Size of blob list.
        +
        +This sets the number of blobs requested in each listing chunk. Default
        +is the maximum, 5000. "List blobs" requests are permitted 2 minutes
        +per megabyte to complete. If an operation is taking longer than 2
        +minutes per megabyte on average, it will time out (
        +[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval)
        +). This can be used to limit the number of blobs items to return, to
        +avoid the time out.
        +
        +Properties:
        +
        +- Config:      list_chunk
        +- Env Var:     RCLONE_AZUREBLOB_LIST_CHUNK
        +- Type:        int
        +- Default:     5000
        +
        +#### --azureblob-access-tier
        +
        +Access tier of blob: hot, cool, cold or archive.
        +
        +Archived blobs can be restored by setting access tier to hot, cool or
        +cold. Leave blank if you intend to use default access tier, which is
        +set at account level
        +
        +If there is no "access tier" specified, rclone doesn't apply any tier.
        +rclone performs "Set Tier" operation on blobs while uploading, if objects
        +are not modified, specifying "access tier" to new one will have no effect.
        +If blobs are in "archive tier" at remote, trying to perform data transfer
        +operations from remote will not be allowed. User should first restore by
        +tiering blob to "Hot", "Cool" or "Cold".
        +
        +Properties:
        +
        +- Config:      access_tier
        +- Env Var:     RCLONE_AZUREBLOB_ACCESS_TIER
        +- Type:        string
        +- Required:    false
        +
        +#### --azureblob-archive-tier-delete
        +
        +Delete archive tier blobs before overwriting.
        +
        +Archive tier blobs cannot be updated. So without this flag, if you
        +attempt to update an archive tier blob, then rclone will produce the
        +error:
        +
        +    can't update archive tier blob without --azureblob-archive-tier-delete
        +
        +With this flag set then before rclone attempts to overwrite an archive
        +tier blob, it will delete the existing blob before uploading its
        +replacement.  This has the potential for data loss if the upload fails
        +(unlike updating a normal blob) and also may cost more since deleting
        +archive tier blobs early may be chargable.
        +
        +
        +Properties:
        +
        +- Config:      archive_tier_delete
        +- Env Var:     RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-disable-checksum
        +
        +Don't store MD5 checksum with object metadata.
        +
        +Normally rclone will calculate the MD5 checksum of the input before
        +uploading it so it can add it to metadata on the object. This is great
        +for data integrity checking but can cause long delays for large files
        +to start uploading.
        +
        +Properties:
        +
        +- Config:      disable_checksum
        +- Env Var:     RCLONE_AZUREBLOB_DISABLE_CHECKSUM
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-memory-pool-flush-time
        +
        +How often internal memory buffer pools will be flushed. (no longer used)
        +
        +Properties:
        +
        +- Config:      memory_pool_flush_time
        +- Env Var:     RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --azureblob-memory-pool-use-mmap
        +
        +Whether to use mmap buffers in internal memory pool. (no longer used)
        +
        +Properties:
        +
        +- Config:      memory_pool_use_mmap
        +- Env Var:     RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_AZUREBLOB_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8
        +
        +#### --azureblob-public-access
        +
        +Public access level of a container: blob or container.
        +
        +Properties:
        +
        +- Config:      public_access
        +- Env Var:     RCLONE_AZUREBLOB_PUBLIC_ACCESS
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - The container and its blobs can be accessed only with an authorized request.
        +        - It's a default value.
        +    - "blob"
        +        - Blob data within this container can be read via anonymous request.
        +    - "container"
        +        - Allow full public read access for container and blob data.
        +
        +#### --azureblob-directory-markers
        +
        +Upload an empty object with a trailing slash when a new directory is created
        +
        +Empty folders are unsupported for bucket based remotes, this option
        +creates an empty object ending with "/", to persist the folder.
        +
        +This object also has the metadata "hdi_isfolder = true" to conform to
        +the Microsoft standard.
        + 
        +
        +Properties:
        +
        +- Config:      directory_markers
        +- Env Var:     RCLONE_AZUREBLOB_DIRECTORY_MARKERS
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-no-check-container
        +
        +If set, don't attempt to check the container exists or create it.
        +
        +This can be useful when trying to minimise the number of transactions
        +rclone does if you know the container exists already.
        +
        +
        +Properties:
        +
        +- Config:      no_check_container
        +- Env Var:     RCLONE_AZUREBLOB_NO_CHECK_CONTAINER
        +- Type:        bool
        +- Default:     false
        +
        +#### --azureblob-no-head-object
        +
        +If set, do not do HEAD before GET when getting objects.
        +
        +Properties:
        +
        +- Config:      no_head_object
        +- Env Var:     RCLONE_AZUREBLOB_NO_HEAD_OBJECT
        +- Type:        bool
        +- Default:     false
        +
        +
        +
        +### Custom upload headers
        +
        +You can set custom upload headers with the `--header-upload` flag. 
        +
        +- Cache-Control
        +- Content-Disposition
        +- Content-Encoding
        +- Content-Language
        +- Content-Type
        +
        +Eg `--header-upload "Content-Type: text/potato"`
        +
        +## Limitations
        +
        +MD5 sums are only uploaded with chunked files if the source has an MD5
        +sum.  This will always be the case for a local to azure copy.
        +
        +`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +## Azure Storage Emulator Support
        +
        +You can run rclone with the storage emulator (usually _azurite_).
        +
        +To do this, just set up a new remote with `rclone config` following
        +the instructions in the introduction and set `use_emulator` in the
        +advanced settings as `true`. You do not need to provide a default
        +account name nor an account key. But you can override them in the
        +`account` and `key` options. (Prior to v1.61 they were hard coded to
        +_azurite_'s `devstoreaccount1`.)
        +
        +Also, if you want to access a storage emulator instance running on a
        +different machine, you can override the `endpoint` parameter in the
        +advanced settings, setting it to
        +`http(s)://<host>:<port>/devstoreaccount1`
        +(e.g. `http://10.254.2.5:10000/devstoreaccount1`).
        +
        +#  Microsoft Azure Files Storage
        +
        +Paths are specified as `remote:` You may put subdirectories in too,
        +e.g. `remote:path/to/dir`.
        +
        +## Configuration
        +
        +Here is an example of making a Microsoft Azure Files Storage
        +configuration.  For a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Microsoft Azure Files Storage  "azurefiles" [snip]

        +

        Option account. Azure Storage Account Name. Set this to the Azure Storage Account Name in use. Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable AZURE_STORAGE_ACCOUNT_NAME if possible. Enter a value. Press Enter to leave empty. account> account_name

        +

        Option share_name. Azure Files Share Name. This is required and is the name of the share to access. Enter a value. Press Enter to leave empty. share_name> share_name

        +

        Option env_auth. Read credentials from runtime (environment variables, CLI or MSI). See the authentication docs for full info. Enter a boolean value (true or false). Press Enter for the default (false). env_auth>

        +

        Option key. Storage Account Shared Key. Leave blank to use SAS URL or connection string. Enter a value. Press Enter to leave empty. key> base64encodedkey==

        +

        Option sas_url. SAS URL. Leave blank if using account/key or connection string. Enter a value. Press Enter to leave empty. sas_url>

        +

        Option connection_string. Azure Files Connection String. Enter a value. Press Enter to leave empty. connection_string> [snip]

        +

        Configuration complete. Options: - type: azurefiles - account: account_name - share_name: share_name - key: base64encodedkey== Keep this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d>

        +
        
        +Once configured you can use rclone.
        +
        +See all files in the top level:
        +
        +    rclone lsf remote:
        +
        +Make a new directory in the root:
        +
        +    rclone mkdir remote:dir
        +
        +Recursively List the contents:
        +
        +    rclone ls remote:
        +
        +Sync `/home/local/directory` to the remote directory, deleting any
        +excess files in the directory.
        +
        +    rclone sync --interactive /home/local/directory remote:dir
        +
        +### Modified time
        +
        +The modified time is stored as Azure standard `LastModified` time on
        +files
        +
        +### Performance
        +
        +When uploading large files, increasing the value of
        +`--azurefiles-upload-concurrency` will increase performance at the cost
        +of using more memory. The default of 16 is set quite conservatively to
        +use less memory. It maybe be necessary raise it to 64 or higher to
        +fully utilize a 1 GBit/s link with a single file transfer.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| "         | 0x22  | "          |
        +| *         | 0x2A  | *          |
        +| :         | 0x3A  | :          |
        +| <         | 0x3C  | <          |
        +| >         | 0x3E  | >          |
        +| ?         | 0x3F  | ?          |
        +| \         | 0x5C  | \          |
        +| \|        | 0x7C  | |          |
        +
        +File names can also not end with the following characters.
        +These only get replaced if they are the last character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| .         | 0x2E  | .          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Hashes
        +
        +MD5 hashes are stored with files. Not all files will have MD5 hashes
        +as these have to be uploaded with the file.
        +
        +### Authentication {#authentication}
        +
        +There are a number of ways of supplying credentials for Azure Files
        +Storage. Rclone tries them in the order of the sections below.
        +
        +#### Env Auth
        +
        +If the `env_auth` config parameter is `true` then rclone will pull
        +credentials from the environment or runtime.
        +
        +It tries these authentication methods in this order:
        +
        +1. Environment Variables
        +2. Managed Service Identity Credentials
        +3. Azure CLI credentials (as used by the az tool)
        +
        +These are described in the following sections
        +
        +##### Env Auth: 1. Environment Variables
        +
        +If `env_auth` is set and environment variables are present rclone
        +authenticates a service principal with a secret or certificate, or a
        +user with a password, depending on which environment variable are set.
        +It reads configuration from these variables, in the following order:
        +
        +1. Service principal with client secret
        +    - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID.
        +    - `AZURE_CLIENT_ID`: the service principal's client ID
        +    - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets
        +2. Service principal with certificate
        +    - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID.
        +    - `AZURE_CLIENT_ID`: the service principal's client ID
        +    - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key.
        +    - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file.
        +    - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
        +3. User with username and password
        +    - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations".
        +    - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to
        +    - `AZURE_USERNAME`: a username (usually an email address)
        +    - `AZURE_PASSWORD`: the user's password
        +4. Workload Identity
        +    - `AZURE_TENANT_ID`: Tenant to authenticate in.
        +    - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to.
        +    - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file.
        +    - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com).
        +
        +
        +##### Env Auth: 2. Managed Service Identity Credentials
        +
        +When using Managed Service Identity if the VM(SS) on which this
        +program is running has a system-assigned identity, it will be used by
        +default. If the resource has no system-assigned but exactly one
        +user-assigned identity, the user-assigned identity will be used by
        +default.
        +
        +If the resource has multiple user-assigned identities you will need to
        +unset `env_auth` and set `use_msi` instead. See the [`use_msi`
        +section](#use_msi).
        +
        +##### Env Auth: 3. Azure CLI credentials (as used by the az tool)
        +
        +Credentials created with the `az` tool can be picked up using `env_auth`.
        +
        +For example if you were to login with a service principal like this:
        +
        +    az login --service-principal -u XXX -p XXX --tenant XXX
        +
        +Then you could access rclone resources like this:
        +
        +    rclone lsf :azurefiles,env_auth,account=ACCOUNT:
        +
        +Or
        +
        +    rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles:
        +
        +#### Account and Shared Key
        +
        +This is the most straight forward and least flexible way.  Just fill
        +in the `account` and `key` lines and leave the rest blank.
        +
        +#### SAS URL
        +
        +To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`.
        +
        +#### Connection String
        +
        +To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`.
        +
        +#### Service principal with client secret
        +
        +If these variables are set, rclone will authenticate with a service principal with a client secret.
        +
        +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID.
        +- `client_id`: the service principal's client ID
        +- `client_secret`: one of the service principal's client secrets
        +
        +The credentials can also be placed in a file using the
        +`service_principal_file` configuration option.
        +
        +#### Service principal with certificate
        +
        +If these variables are set, rclone will authenticate with a service principal with certificate.
        +
        +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID.
        +- `client_id`: the service principal's client ID
        +- `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key.
        +- `client_certificate_password`: (optional) password for the certificate file.
        +- `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
        +
        +**NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +#### User with username and password
        +
        +If these variables are set, rclone will authenticate with username and password.
        +
        +- `tenant`: (optional) tenant to authenticate in. Defaults to "organizations".
        +- `client_id`: client ID of the application the user will authenticate to
        +- `username`: a username (usually an email address)
        +- `password`: the user's password
        +
        +Microsoft doesn't recommend this kind of authentication, because it's
        +less secure than other authentication flows. This method is not
        +interactive, so it isn't compatible with any form of multi-factor
        +authentication, and the application must already have user or admin
        +consent. This credential can only authenticate work and school
        +accounts; it can't authenticate Microsoft accounts.
        +
        +**NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +#### Managed Service Identity Credentials {#use_msi}
        +
        +If `use_msi` is set then managed service identity credentials are
        +used. This authentication only works when running in an Azure service.
        +`env_auth` needs to be unset to use this.
        +
        +However if you have multiple user identities to choose from these must
        +be explicitly specified using exactly one of the `msi_object_id`,
        +`msi_client_id`, or `msi_mi_res_id` parameters.
        +
        +If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is
        +set, this is is equivalent to using `env_auth`.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to azurefiles (Microsoft Azure Files).
        +
        +#### --azurefiles-account
        +
        +Azure Storage Account Name.
        +
        +Set this to the Azure Storage Account Name in use.
        +
        +Leave blank to use SAS URL or connection string, otherwise it needs to be set.
        +
        +If this is blank and if env_auth is set it will be read from the
        +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible.
        +
        +
        +Properties:
        +
        +- Config:      account
        +- Env Var:     RCLONE_AZUREFILES_ACCOUNT
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-share-name
        +
        +Azure Files Share Name.
        +
        +This is required and is the name of the share to access.
        +
        +
        +Properties:
        +
        +- Config:      share_name
        +- Env Var:     RCLONE_AZUREFILES_SHARE_NAME
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-env-auth
        +
        +Read credentials from runtime (environment variables, CLI or MSI).
        +
        +See the [authentication docs](/azurefiles#authentication) for full info.
        +
        +Properties:
        +
        +- Config:      env_auth
        +- Env Var:     RCLONE_AZUREFILES_ENV_AUTH
        +- Type:        bool
        +- Default:     false
        +
        +#### --azurefiles-key
        +
        +Storage Account Shared Key.
        +
        +Leave blank to use SAS URL or connection string.
        +
        +Properties:
        +
        +- Config:      key
        +- Env Var:     RCLONE_AZUREFILES_KEY
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-sas-url
        +
        +SAS URL.
        +
        +Leave blank if using account/key or connection string.
        +
        +Properties:
        +
        +- Config:      sas_url
        +- Env Var:     RCLONE_AZUREFILES_SAS_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-connection-string
        +
        +Azure Files Connection String.
        +
        +Properties:
        +
        +- Config:      connection_string
        +- Env Var:     RCLONE_AZUREFILES_CONNECTION_STRING
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-tenant
        +
        +ID of the service principal's tenant. Also called its directory ID.
        +
        +Set this if using
        +- Service principal with client secret
        +- Service principal with certificate
        +- User with username and password
        +
        +
        +Properties:
        +
        +- Config:      tenant
        +- Env Var:     RCLONE_AZUREFILES_TENANT
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-client-id
        +
        +The ID of the client in use.
        +
        +Set this if using
        +- Service principal with client secret
        +- Service principal with certificate
        +- User with username and password
        +
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_AZUREFILES_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-client-secret
        +
        +One of the service principal's client secrets
        +
        +Set this if using
        +- Service principal with client secret
        +
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_AZUREFILES_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-client-certificate-path
        +
        +Path to a PEM or PKCS12 certificate file including the private key.
        +
        +Set this if using
        +- Service principal with certificate
        +
        +
        +Properties:
        +
        +- Config:      client_certificate_path
        +- Env Var:     RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-client-certificate-password
        +
        +Password for the certificate file (optional).
        +
        +Optionally set this if using
        +- Service principal with certificate
        +
        +And the certificate has a password.
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      client_certificate_password
        +- Env Var:     RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to azurefiles (Microsoft Azure Files).
        +
        +#### --azurefiles-client-send-certificate-chain
        +
        +Send the certificate chain when using certificate auth.
        +
        +Specifies whether an authentication request will include an x5c header
        +to support subject name / issuer based authentication. When set to
        +true, authentication requests include the x5c header.
        +
        +Optionally set this if using
        +- Service principal with certificate
        +
        +
        +Properties:
        +
        +- Config:      client_send_certificate_chain
        +- Env Var:     RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN
        +- Type:        bool
        +- Default:     false
        +
        +#### --azurefiles-username
        +
        +User name (usually an email address)
        +
        +Set this if using
        +- User with username and password
        +
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_AZUREFILES_USERNAME
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-password
        +
        +The user's password
        +
        +Set this if using
        +- User with username and password
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_AZUREFILES_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-service-principal-file
        +
        +Path to file containing credentials for use with a service principal.
        +
        +Leave blank normally. Needed only if you want to use a service principal instead of interactive login.
        +
        +    $ az ad sp create-for-rbac --name "<name>" \
        +      --role "Storage Files Data Owner" \
        +      --scopes "/subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>" \
        +      > azure-principal.json
        +
        +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details.
        +
        +**NB** this section needs updating for Azure Files - pull requests appreciated!
        +
        +It may be more convenient to put the credentials directly into the
        +rclone config file under the `client_id`, `tenant` and `client_secret`
        +keys instead of setting `service_principal_file`.
        +
        +
        +Properties:
        +
        +- Config:      service_principal_file
        +- Env Var:     RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-use-msi
        +
        +Use a managed service identity to authenticate (only works in Azure).
        +
        +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/)
        +to authenticate to Azure Storage instead of a SAS token or account key.
        +
        +If the VM(SS) on which this program is running has a system-assigned identity, it will
        +be used by default. If the resource has no system-assigned but exactly one user-assigned identity,
        +the user-assigned identity will be used by default. If the resource has multiple user-assigned
        +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id,
        +msi_client_id, or msi_mi_res_id parameters.
        +
        +Properties:
        +
        +- Config:      use_msi
        +- Env Var:     RCLONE_AZUREFILES_USE_MSI
        +- Type:        bool
        +- Default:     false
        +
        +#### --azurefiles-msi-object-id
        +
        +Object ID of the user-assigned MSI to use, if any.
        +
        +Leave blank if msi_client_id or msi_mi_res_id specified.
        +
        +Properties:
        +
        +- Config:      msi_object_id
        +- Env Var:     RCLONE_AZUREFILES_MSI_OBJECT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-msi-client-id
        +
        +Object ID of the user-assigned MSI to use, if any.
        +
        +Leave blank if msi_object_id or msi_mi_res_id specified.
        +
        +Properties:
        +
        +- Config:      msi_client_id
        +- Env Var:     RCLONE_AZUREFILES_MSI_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-msi-mi-res-id
        +
        +Azure resource ID of the user-assigned MSI to use, if any.
        +
        +Leave blank if msi_client_id or msi_object_id specified.
        +
        +Properties:
        +
        +- Config:      msi_mi_res_id
        +- Env Var:     RCLONE_AZUREFILES_MSI_MI_RES_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-endpoint
        +
        +Endpoint for the service.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_AZUREFILES_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --azurefiles-chunk-size
        +
        +Upload chunk size.
        +
        +Note that this is stored in memory and there may be up to
        +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once
        +in memory.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_AZUREFILES_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     4Mi
        +
        +#### --azurefiles-upload-concurrency
        +
        +Concurrency for multipart uploads.
        +
        +This is the number of chunks of the same file that are uploaded
        +concurrently.
        +
        +If you are uploading small numbers of large files over high-speed
        +links and these uploads do not fully utilize your bandwidth, then
        +increasing this may help to speed up the transfers.
        +
        +Note that chunks are stored in memory and there may be up to
        +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once
        +in memory.
        +
        +Properties:
        +
        +- Config:      upload_concurrency
        +- Env Var:     RCLONE_AZUREFILES_UPLOAD_CONCURRENCY
        +- Type:        int
        +- Default:     16
        +
        +#### --azurefiles-max-stream-size
        +
        +Max size for streamed files.
        +
        +Azure files needs to know in advance how big the file will be. When
        +rclone doesn't know it uses this value instead.
        +
        +This will be used when rclone is streaming data, the most common uses are:
        +
        +- Uploading files with `--vfs-cache-mode off` with `rclone mount`
        +- Using `rclone rcat`
        +- Copying files with unknown length
        +
        +You will need this much free space in the share as the file will be this size temporarily.
        +
        +
        +Properties:
        +
        +- Config:      max_stream_size
        +- Env Var:     RCLONE_AZUREFILES_MAX_STREAM_SIZE
        +- Type:        SizeSuffix
        +- Default:     10Gi
        +
        +#### --azurefiles-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_AZUREFILES_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot
        +
        +
        +
        +### Custom upload headers
        +
        +You can set custom upload headers with the `--header-upload` flag. 
        +
        +- Cache-Control
        +- Content-Disposition
        +- Content-Encoding
        +- Content-Language
        +- Content-Type
        +
        +Eg `--header-upload "Content-Type: text/potato"`
        +
        +## Limitations
        +
        +MD5 sums are only uploaded with chunked files if the source has an MD5
        +sum.  This will always be the case for a local to azure copy.
        +
        +#  Microsoft OneDrive
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for OneDrive involves getting a token from
        +Microsoft which you need to do in your browser.  `rclone config` walks
        +you through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +
          +
        1. Edit existing remote
        2. +
        3. New remote
        4. +
        5. Delete remote
        6. +
        7. Rename remote
        8. +
        9. Copy remote
        10. +
        11. Set configuration password
        12. +
        13. Quit config e/n/d/r/c/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Microsoft OneDrive  "onedrive" [snip] Storage> onedrive Microsoft App Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> Microsoft App Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> Edit advanced config? (y/n)
        14. +
        15. Yes
        16. +
        17. No y/n> n Remote config Use web browser to automatically authenticate rclone with remote?
        18. +
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_SWIFT_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,InvalidUtf8
        • -
        -

        Limitations

        -

        The Swift API doesn't return a correct MD5SUM for segmented files (Dynamic or Static Large Objects) so rclone won't check or use the MD5SUM for these.

        -

        Troubleshooting

        -

        Rclone gives Failed to create file system for "remote:": Bad Request

        -

        Due to an oddity of the underlying swift library, it gives a "Bad Request" error rather than a more sensible error when the authentication fails for Swift.

        -

        So this most likely means your username / password is wrong. You can investigate further with the --dump-bodies flag.

        -

        This may also be caused by specifying the region when you shouldn't have (e.g. OVH).

        -

        Rclone gives Failed to create file system: Response didn't have storage url and auth token

        -

        This is most likely caused by forgetting to specify your tenant when setting up a swift remote.

        -

        OVH Cloud Archive

        -

        To use rclone with OVH cloud archive, first use rclone config to set up a swift backend with OVH, choosing pca as the storage_policy.

        -

        Uploading Objects

        -

        Uploading objects to OVH cloud archive is no different to object storage, you just simply run the command you like (move, copy or sync) to upload the objects. Once uploaded the objects will show in a "Frozen" state within the OVH control panel.

        -

        Retrieving Objects

        -

        To retrieve objects use rclone copy as normal. If the objects are in a frozen state then rclone will ask for them all to be unfrozen and it will wait at the end of the output with a message like the following:

        -

        2019/03/23 13:06:33 NOTICE: Received retry after error - sleeping until 2019-03-23T13:16:33.481657164+01:00 (9m59.99985121s)

        -

        Rclone will wait for the time specified then retry the copy.

        -

        pCloud

        -

        Paths are specified as remote:path

        -

        Paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Configuration

        -

        The initial setup for pCloud involves getting a token from pCloud which you need to do in your browser. rclone config walks you through it.

        -

        Here is an example of how to make a remote called remote. First run:

        -
         rclone config
        -

        This will guide you through an interactive setup process:

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> remote
        -Type of storage to configure.
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / Pcloud
        -   \ "pcloud"
        -[snip]
        -Storage> pcloud
        -Pcloud App Client Id - leave blank normally.
        -client_id> 
        -Pcloud App Client Secret - leave blank normally.
        -client_secret> 
        -Remote config
        -Use web browser to automatically authenticate rclone with remote?
        - * Say Y if the machine running rclone has a web browser you can use
        - * Say N if running rclone on a (remote) machine without web browser access
        -If not sure try Y. If Y failed, try N.
        -y) Yes
        -n) No
        -y/n> y
        -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
        -Log in and authorize rclone for access
        -Waiting for code...
        -Got code
        ---------------------
        -[remote]
        -client_id = 
        -client_secret = 
        -token = {"access_token":"XXX","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
        ---------------------
        -y) Yes this is OK
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -

        See the remote setup docs for how to set it up on a machine with no Internet browser available.

        -

        Note that rclone runs a webserver on your local machine to collect the token as returned from pCloud. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall.

        -

        Once configured you can then use rclone like this,

        -

        List directories in top level of your pCloud

        -
        rclone lsd remote:
        -

        List all the files in your pCloud

        -
        rclone ls remote:
        -

        To copy a local directory to a pCloud directory called backup

        -
        rclone copy /home/source remote:backup
        -

        Modified time and hashes

        -

        pCloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. In order to set a Modification time pCloud requires the object be re-uploaded.

        -

        pCloud supports MD5 and SHA1 hashes in the US region, and SHA1 and SHA256 hashes in the EU region, so you can use the --checksum flag.

        -

        Restricted filename characters

        -

        In addition to the default restricted characters set the following characters are also replaced:

        - +
      7. Say Y if the machine running rclone has a web browser you can use
      8. +
      9. Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
      10. + +
          +
        1. Yes
        2. +
        3. No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code Choose a number from below, or type in an existing value 1 / OneDrive Personal or Business  "onedrive" 2 / Sharepoint site  "sharepoint" 3 / Type in driveID  "driveid" 4 / Type in SiteID  "siteid" 5 / Search a Sharepoint site  "search" Your choice> 1 Found 1 drives, please select the one you want to use: 0: OneDrive (business) id=b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk Chose drive to use:> 0 Found drive 'root' of type 'business', URL: https://org-my.sharepoint.com/personal/you/Documents Is that okay?
        4. +
        5. Yes
        6. +
        7. No y/n> y -------------------- [remote] type = onedrive token = {"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2018-08-26T22:39:52.486512262+08:00"} drive_id = b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk drive_type = business --------------------
        8. +
        9. Yes this is OK
        10. +
        11. Edit this remote
        12. +
        13. Delete this remote y/e/d> y
        14. +
        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from Microsoft. This only runs from the moment it
        +opens your browser to the moment you get back the verification
        +code.  This is on `http://127.0.0.1:53682/` and this it may require
        +you to unblock it temporarily if you are running a host firewall.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your OneDrive
        +
        +    rclone lsd remote:
        +
        +List all the files in your OneDrive
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an OneDrive directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Getting your own Client ID and Key
        +
        +rclone uses a default Client ID when talking to OneDrive, unless a custom `client_id` is specified in the config.
        +The default Client ID and Key are shared by all rclone users when performing requests.
        +
        +You may choose to create and use your own Client ID, in case the default one does not work well for you. 
        +For example, you might see throttling.
        +
        +#### Creating Client ID for OneDrive Personal
        +
        +To create your own Client ID, please follow these steps:
        +
        +1. Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click `New registration`.
        +2. Enter a name for your app, choose account type `Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)`, select `Web` in `Redirect URI`, then type (do not copy and paste) `http://localhost:53682/` and click Register. Copy and keep the `Application (client) ID` under the app name for later use.
        +3. Under `manage` select `Certificates & secrets`, click `New client secret`. Enter a description (can be anything) and set `Expires` to 24 months. Copy and keep that secret _Value_ for later use (you _won't_ be able to see this value afterwards).
        +4. Under `manage` select `API permissions`, click `Add a permission` and select `Microsoft Graph` then select `delegated permissions`.
        +5. Search and select the following permissions: `Files.Read`, `Files.ReadWrite`, `Files.Read.All`, `Files.ReadWrite.All`, `offline_access`, `User.Read` and `Sites.Read.All` (if custom access scopes are configured, select the permissions accordingly). Once selected click `Add permissions` at the bottom.
        +
        +Now the application is complete. Run `rclone config` to create or edit a OneDrive remote.
        +Supply the app ID and password as Client ID and Secret, respectively. rclone will walk you through the remaining steps.
        +
        +The access_scopes option allows you to configure the permissions requested by rclone.
        +See [Microsoft Docs](https://docs.microsoft.com/en-us/graph/permissions-reference#files-permissions) for more information about the different scopes.
        +
        +The `Sites.Read.All` permission is required if you need to [search SharePoint sites when configuring the remote](https://github.com/rclone/rclone/pull/5883). However, if that permission is not assigned, you need to exclude `Sites.Read.All` from your access scopes or set `disable_site_permission` option to true in the advanced options.
        +
        +#### Creating Client ID for OneDrive Business
        +
        +The steps for OneDrive Personal may or may not work for OneDrive Business, depending on the security settings of the organization.
        +A common error is that the publisher of the App is not verified.
        +
        +You may try to [verify you account](https://docs.microsoft.com/en-us/azure/active-directory/develop/publisher-verification-overview), or try to limit the App to your organization only, as shown below.
        +
        +1. Make sure to create the App with your business account.
        +2. Follow the steps above to create an App. However, we need a different account type here: `Accounts in this organizational directory only (*** - Single tenant)`. Note that you can also change the account type after creating the App.
        +3. Find the [tenant ID](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant) of your organization.
        +4. In the rclone config, set `auth_url` to `https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/authorize`.
        +5. In the rclone config, set `token_url` to `https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token`.
        +
        +Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86).
        +
        +
        +### Modification times and hashes
        +
        +OneDrive allows modification times to be set on objects accurate to 1
        +second.  These will be used to detect whether objects need syncing or
        +not.
        +
        +OneDrive Personal, OneDrive for Business and Sharepoint Server support
        +[QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash).
        +
        +Before rclone 1.62 the default hash for Onedrive Personal was `SHA1`.
        +For rclone 1.62 and above the default for all Onedrive backends is
        +`QuickXorHash`.
        +
        +Starting from July 2023 `SHA1` support is being phased out in Onedrive
        +Personal in favour of `QuickXorHash`. If necessary the
        +`--onedrive-hash-type` flag (or `hash_type` config option) can be used
        +to select `SHA1` during the transition period if this is important
        +your workflow.
        +
        +For all types of OneDrive you can use the `--checksum` flag.
        +
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +This must be enabled with the `--onedrive-delta` flag (or `delta =
        +true` in the config file) as it can cause performance degradation.
        +
        +It does this by using the delta listing facilities of OneDrive which
        +returns all the files in the remote very efficiently. This is much
        +more efficient than listing directories recursively and is Microsoft's
        +recommended way of reading all the file information from a drive.
        +
        +This can be useful with `rclone mount` and [rclone rc vfs/refresh
        +recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with
        +information about all the files.
        +
        +The API used for the recursive listing (`ListR`) only supports listing
        +from the root of the drive. This will become increasingly inefficient
        +the further away you get from the root as rclone will have to discard
        +files outside of the directory you are using.
        +
        +Some commands (like `rclone lsf -R`) will use `ListR` by default - you
        +can turn this off with `--disable ListR` if you need to.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| "         | 0x22  | "          |
        +| *         | 0x2A  | *          |
        +| :         | 0x3A  | :          |
        +| <         | 0x3C  | <          |
        +| >         | 0x3E  | >          |
        +| ?         | 0x3F  | ?          |
        +| \         | 0x5C  | \          |
        +| \|        | 0x7C  | |          |
        +
        +File names can also not end with the following characters.
        +These only get replaced if they are the last character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +| .         | 0x2E  | .          |
        +
        +File names can also not begin with the following characters.
        +These only get replaced if they are the first character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +| ~         | 0x7E  | ~          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Deleting files
        +
        +Any files you delete with rclone will end up in the trash.  Microsoft
        +doesn't provide an API to permanently delete files, nor to empty the
        +trash, so you will have to do that with one of Microsoft's apps or via
        +the OneDrive website.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to onedrive (Microsoft OneDrive).
        +
        +#### --onedrive-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_ONEDRIVE_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_ONEDRIVE_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-region
        +
        +Choose national cloud region for OneDrive.
        +
        +Properties:
        +
        +- Config:      region
        +- Env Var:     RCLONE_ONEDRIVE_REGION
        +- Type:        string
        +- Default:     "global"
        +- Examples:
        +    - "global"
        +        - Microsoft Cloud Global
        +    - "us"
        +        - Microsoft Cloud for US Government
        +    - "de"
        +        - Microsoft Cloud Germany
        +    - "cn"
        +        - Azure and Office 365 operated by Vnet Group in China
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to onedrive (Microsoft OneDrive).
        +
        +#### --onedrive-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_ONEDRIVE_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_ONEDRIVE_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_ONEDRIVE_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-chunk-size
        +
        +Chunk size to upload files with - must be multiple of 320k (327,680 bytes).
        +
        +Above this size files will be chunked - must be multiple of 320k (327,680 bytes) and
        +should not exceed 250M (262,144,000 bytes) else you may encounter \"Microsoft.SharePoint.Client.InvalidClientQueryException: The request message is too big.\"
        +Note that the chunks will be buffered into memory.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_ONEDRIVE_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     10Mi
        +
        +#### --onedrive-drive-id
        +
        +The ID of the drive to use.
        +
        +Properties:
        +
        +- Config:      drive_id
        +- Env Var:     RCLONE_ONEDRIVE_DRIVE_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-drive-type
        +
        +The type of the drive (personal | business | documentLibrary).
        +
        +Properties:
        +
        +- Config:      drive_type
        +- Env Var:     RCLONE_ONEDRIVE_DRIVE_TYPE
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-root-folder-id
        +
        +ID of the root folder.
        +
        +This isn't normally needed, but in special circumstances you might
        +know the folder ID that you wish to access but not be able to get
        +there through a path traversal.
        +
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_ONEDRIVE_ROOT_FOLDER_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-access-scopes
        +
        +Set scopes to be requested by rclone.
        +
        +Choose or manually enter a custom space separated list with all scopes, that rclone should request.
        +
        +
        +Properties:
        +
        +- Config:      access_scopes
        +- Env Var:     RCLONE_ONEDRIVE_ACCESS_SCOPES
        +- Type:        SpaceSepList
        +- Default:     Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access
        +- Examples:
        +    - "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access"
        +        - Read and write access to all resources
        +    - "Files.Read Files.Read.All Sites.Read.All offline_access"
        +        - Read only access to all resources
        +    - "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All offline_access"
        +        - Read and write access to all resources, without the ability to browse SharePoint sites. 
        +        - Same as if disable_site_permission was set to true
        +
        +#### --onedrive-disable-site-permission
        +
        +Disable the request for Sites.Read.All permission.
        +
        +If set to true, you will no longer be able to search for a SharePoint site when
        +configuring drive ID, because rclone will not request Sites.Read.All permission.
        +Set it to true if your organization didn't assign Sites.Read.All permission to the
        +application, and your organization disallows users to consent app permission
        +request on their own.
        +
        +Properties:
        +
        +- Config:      disable_site_permission
        +- Env Var:     RCLONE_ONEDRIVE_DISABLE_SITE_PERMISSION
        +- Type:        bool
        +- Default:     false
        +
        +#### --onedrive-expose-onenote-files
        +
        +Set to make OneNote files show up in directory listings.
        +
        +By default, rclone will hide OneNote files in directory listings because
        +operations like "Open" and "Update" won't work on them.  But this
        +behaviour may also prevent you from deleting them.  If you want to
        +delete OneNote files or otherwise want them to show up in directory
        +listing, set this option.
        +
        +Properties:
        +
        +- Config:      expose_onenote_files
        +- Env Var:     RCLONE_ONEDRIVE_EXPOSE_ONENOTE_FILES
        +- Type:        bool
        +- Default:     false
        +
        +#### --onedrive-server-side-across-configs
        +
        +Deprecated: use --server-side-across-configs instead.
        +
        +Allow server-side operations (e.g. copy) to work across different onedrive configs.
        +
        +This will only work if you are copying between two OneDrive *Personal* drives AND
        +the files to copy are already shared between them.  In other cases, rclone will
        +fall back to normal copy (which will be slightly slower).
        +
        +Properties:
        +
        +- Config:      server_side_across_configs
        +- Env Var:     RCLONE_ONEDRIVE_SERVER_SIDE_ACROSS_CONFIGS
        +- Type:        bool
        +- Default:     false
        +
        +#### --onedrive-list-chunk
        +
        +Size of listing chunk.
        +
        +Properties:
        +
        +- Config:      list_chunk
        +- Env Var:     RCLONE_ONEDRIVE_LIST_CHUNK
        +- Type:        int
        +- Default:     1000
        +
        +#### --onedrive-no-versions
        +
        +Remove all versions on modifying operations.
        +
        +Onedrive for business creates versions when rclone uploads new files
        +overwriting an existing one and when it sets the modification time.
        +
        +These versions take up space out of the quota.
        +
        +This flag checks for versions after file upload and setting
        +modification time and removes all but the last version.
        +
        +**NB** Onedrive personal can't currently delete versions so don't use
        +this flag there.
        +
        +
        +Properties:
        +
        +- Config:      no_versions
        +- Env Var:     RCLONE_ONEDRIVE_NO_VERSIONS
        +- Type:        bool
        +- Default:     false
        +
        +#### --onedrive-link-scope
        +
        +Set the scope of the links created by the link command.
        +
        +Properties:
        +
        +- Config:      link_scope
        +- Env Var:     RCLONE_ONEDRIVE_LINK_SCOPE
        +- Type:        string
        +- Default:     "anonymous"
        +- Examples:
        +    - "anonymous"
        +        - Anyone with the link has access, without needing to sign in.
        +        - This may include people outside of your organization.
        +        - Anonymous link support may be disabled by an administrator.
        +    - "organization"
        +        - Anyone signed into your organization (tenant) can use the link to get access.
        +        - Only available in OneDrive for Business and SharePoint.
        +
        +#### --onedrive-link-type
        +
        +Set the type of the links created by the link command.
        +
        +Properties:
        +
        +- Config:      link_type
        +- Env Var:     RCLONE_ONEDRIVE_LINK_TYPE
        +- Type:        string
        +- Default:     "view"
        +- Examples:
        +    - "view"
        +        - Creates a read-only link to the item.
        +    - "edit"
        +        - Creates a read-write link to the item.
        +    - "embed"
        +        - Creates an embeddable link to the item.
        +
        +#### --onedrive-link-password
        +
        +Set the password for links created by the link command.
        +
        +At the time of writing this only works with OneDrive personal paid accounts.
        +
        +
        +Properties:
        +
        +- Config:      link_password
        +- Env Var:     RCLONE_ONEDRIVE_LINK_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +#### --onedrive-hash-type
        +
        +Specify the hash in use for the backend.
        +
        +This specifies the hash type in use. If set to "auto" it will use the
        +default hash which is QuickXorHash.
        +
        +Before rclone 1.62 an SHA1 hash was used by default for Onedrive
        +Personal. For 1.62 and later the default is to use a QuickXorHash for
        +all onedrive types. If an SHA1 hash is desired then set this option
        +accordingly.
        +
        +From July 2023 QuickXorHash will be the only available hash for
        +both OneDrive for Business and OneDriver Personal.
        +
        +This can be set to "none" to not use any hashes.
        +
        +If the hash requested does not exist on the object, it will be
        +returned as an empty string which is treated as a missing hash by
        +rclone.
        +
        +
        +Properties:
        +
        +- Config:      hash_type
        +- Env Var:     RCLONE_ONEDRIVE_HASH_TYPE
        +- Type:        string
        +- Default:     "auto"
        +- Examples:
        +    - "auto"
        +        - Rclone chooses the best hash
        +    - "quickxor"
        +        - QuickXor
        +    - "sha1"
        +        - SHA1
        +    - "sha256"
        +        - SHA256
        +    - "crc32"
        +        - CRC32
        +    - "none"
        +        - None - don't use any hashes
        +
        +#### --onedrive-av-override
        +
        +Allows download of files the server thinks has a virus.
        +
        +The onedrive/sharepoint server may check files uploaded with an Anti
        +Virus checker. If it detects any potential viruses or malware it will
        +block download of the file.
        +
        +In this case you will see a message like this
        +
        +    server reports this file is infected with a virus - use --onedrive-av-override to download anyway: Infected (name of virus): 403 Forbidden: 
        +
        +If you are 100% sure you want to download this file anyway then use
        +the --onedrive-av-override flag, or av_override = true in the config
        +file.
        +
        +
        +Properties:
        +
        +- Config:      av_override
        +- Env Var:     RCLONE_ONEDRIVE_AV_OVERRIDE
        +- Type:        bool
        +- Default:     false
        +
        +#### --onedrive-delta
        +
        +If set rclone will use delta listing to implement recursive listings.
        +
        +If this flag is set the the onedrive backend will advertise `ListR`
        +support for recursive listings.
        +
        +Setting this flag speeds up these things greatly:
        +
        +    rclone lsf -R onedrive:
        +    rclone size onedrive:
        +    rclone rc vfs/refresh recursive=true
        +
        +**However** the delta listing API **only** works at the root of the
        +drive. If you use it not at the root then it recurses from the root
        +and discards all the data that is not under the directory you asked
        +for. So it will be correct but may not be very efficient.
        +
        +This is why this flag is not set as the default.
        +
        +As a rule of thumb if nearly all of your data is under rclone's root
        +directory (the `root/directory` in `onedrive:root/directory`) then
        +using this flag will be be a big performance win. If your data is
        +mostly not under the root then using this flag will be a big
        +performance loss.
        +
        +It is recommended if you are mounting your onedrive at the root
        +(or near the root when using crypt) and using rclone `rc vfs/refresh`.
        +
        +
        +Properties:
        +
        +- Config:      delta
        +- Env Var:     RCLONE_ONEDRIVE_DELTA
        +- Type:        bool
        +- Default:     false
        +
        +#### --onedrive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_ONEDRIVE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +If you don't use rclone for 90 days the refresh token will
        +expire. This will result in authorization problems. This is easy to
        +fix by running the `rclone config reconnect remote:` command to get a
        +new token and refresh token.
        +
        +### Naming
        +
        +Note that OneDrive is case insensitive so you can't have a
        +file called "Hello.doc" and one called "hello.doc".
        +
        +There are quite a few characters that can't be in OneDrive file
        +names.  These can't occur on Windows platforms, but on non-Windows
        +platforms they are common.  Rclone will map these names to and from an
        +identical looking unicode equivalent.  For example if a file has a `?`
        +in it will be mapped to `?` instead.
        +
        +### File sizes
        +
        +The largest allowed file size is 250 GiB for both OneDrive Personal and OneDrive for Business [(Updated 13 Jan 2021)](https://support.microsoft.com/en-us/office/invalid-file-names-and-file-types-in-onedrive-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa?ui=en-us&rs=en-us&ad=us#individualfilesize).
        +
        +### Path length
        +
        +The entire path, including the file name, must contain fewer than 400 characters for OneDrive, OneDrive for Business and SharePoint Online. If you are encrypting file and folder names with rclone, you may want to pay attention to this limitation because the encrypted names are typically longer than the original ones.
        +
        +### Number of files
        +
        +OneDrive seems to be OK with at least 50,000 files in a folder, but at
        +100,000 rclone will get errors listing the directory like `couldn’t
        +list files: UnknownError:`.  See
        +[#2707](https://github.com/rclone/rclone/issues/2707) for more info.
        +
        +An official document about the limitations for different types of OneDrive can be found [here](https://support.office.com/en-us/article/invalid-file-names-and-file-types-in-onedrive-onedrive-for-business-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa).
        +
        +## Versions
        +
        +Every change in a file OneDrive causes the service to create a new
        +version of the file.  This counts against a users quota.  For
        +example changing the modification time of a file creates a second
        +version, so the file apparently uses twice the space.
        +
        +For example the `copy` command is affected by this as rclone copies
        +the file and then afterwards sets the modification time to match the
        +source file which uses another version.
        +
        +You can use the `rclone cleanup` command (see below) to remove all old
        +versions.
        +
        +Or you can set the `no_versions` parameter to `true` and rclone will
        +remove versions after operations which create new versions. This takes
        +extra transactions so only enable it if you need it.
        +
        +**Note** At the time of writing Onedrive Personal creates versions
        +(but not for setting the modification time) but the API for removing
        +them returns "API not found" so cleanup and `no_versions` should not
        +be used on Onedrive Personal.
        +
        +### Disabling versioning
        +
        +Starting October 2018, users will no longer be able to
        +disable versioning by default. This is because Microsoft has brought
        +an
        +[update](https://techcommunity.microsoft.com/t5/Microsoft-OneDrive-Blog/New-Updates-to-OneDrive-and-SharePoint-Team-Site-Versioning/ba-p/204390)
        +to the mechanism. To change this new default setting, a PowerShell
        +command is required to be run by a SharePoint admin. If you are an
        +admin, you can run these commands in PowerShell to change that
        +setting:
        +
        +1. `Install-Module -Name Microsoft.Online.SharePoint.PowerShell` (in case you haven't installed this already)
        +2. `Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking`
        +3. `Connect-SPOService -Url https://YOURSITE-admin.sharepoint.com -Credential YOU@YOURSITE.COM` (replacing `YOURSITE`, `YOU`, `YOURSITE.COM` with the actual values; this will prompt for your credentials)
        +4. `Set-SPOTenant -EnableMinimumVersionRequirement $False`
        +5. `Disconnect-SPOService` (to disconnect from the server)
        +
        +*Below are the steps for normal users to disable versioning. If you don't see the "No Versioning" option, make sure the above requirements are met.*
        +
        +User [Weropol](https://github.com/Weropol) has found a method to disable
        +versioning on OneDrive
        +
        +1. Open the settings menu by clicking on the gear symbol at the top of the OneDrive Business page.
        +2. Click Site settings.
        +3. Once on the Site settings page, navigate to Site Administration > Site libraries and lists.
        +4. Click Customize "Documents".
        +5. Click General Settings > Versioning Settings.
        +6. Under Document Version History select the option No versioning.
        +Note: This will disable the creation of new file versions, but will not remove any previous versions. Your documents are safe.
        +7. Apply the changes by clicking OK.
        +8. Use rclone to upload or modify files. (I also use the --no-update-modtime flag)
        +9. Restore the versioning settings after using rclone. (Optional)
        +
        +## Cleanup
        +
        +OneDrive supports `rclone cleanup` which causes rclone to look through
        +every file under the path supplied and delete all version but the
        +current version. Because this involves traversing all the files, then
        +querying each file for versions it can be quite slow. Rclone does
        +`--checkers` tests in parallel. The command also supports `--interactive`/`i`
        +or `--dry-run` which is a great way to see what it would do.
        +
        +    rclone cleanup --interactive remote:path/subdir # interactively remove all old version for path/subdir
        +    rclone cleanup remote:path/subdir               # unconditionally remove all old version for path/subdir
        +
        +**NB** Onedrive personal can't currently delete versions
        +
        +## Troubleshooting ##
        +
        +### Excessive throttling or blocked on SharePoint
        +
        +If you experience excessive throttling or is being blocked on SharePoint then it may help to set the user agent explicitly with a flag like this: `--user-agent "ISV|rclone.org|rclone/v1.55.1"`
        +
        +The specific details can be found in the Microsoft document: [Avoid getting throttled or blocked in SharePoint Online](https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#how-to-decorate-your-http-traffic-to-avoid-throttling)
        +
        +### Unexpected file size/hash differences on Sharepoint ####
        +
        +It is a
        +[known](https://github.com/OneDrive/onedrive-api-docs/issues/935#issuecomment-441741631)
        +issue that Sharepoint (not OneDrive or OneDrive for Business) silently modifies
        +uploaded files, mainly Office files (.docx, .xlsx, etc.), causing file size and
        +hash checks to fail. There are also other situations that will cause OneDrive to
        +report inconsistent file sizes. To use rclone with such
        +affected files on Sharepoint, you
        +may disable these checks with the following command line arguments:
        +
        +

        --ignore-checksum --ignore-size

        +
        
        +Alternatively, if you have write access to the OneDrive files, it may be possible
        +to fix this problem for certain files, by attempting the steps below.
        +Open the web interface for [OneDrive](https://onedrive.live.com) and find the
        +affected files (which will be in the error messages/log for rclone). Simply click on
        +each of these files, causing OneDrive to open them on the web. This will cause each
        +file to be converted in place to a format that is functionally equivalent
        +but which will no longer trigger the size discrepancy. Once all problematic files
        +are converted you will no longer need the ignore options above.
        +
        +### Replacing/deleting existing files on Sharepoint gets "item not found" ####
        +
        +It is a [known](https://github.com/OneDrive/onedrive-api-docs/issues/1068) issue
        +that Sharepoint (not OneDrive or OneDrive for Business) may return "item not
        +found" errors when users try to replace or delete uploaded files; this seems to
        +mainly affect Office files (.docx, .xlsx, etc.) and web files (.html, .aspx, etc.). As a workaround, you may use
        +the `--backup-dir <BACKUP_DIR>` command line argument so rclone moves the
        +files to be replaced/deleted into a given backup directory (instead of directly
        +replacing/deleting them). For example, to instruct rclone to move the files into
        +the directory `rclone-backup-dir` on backend `mysharepoint`, you may use:
        +
        +

        --backup-dir mysharepoint:rclone-backup-dir

        +
        
        +### access\_denied (AADSTS65005) ####
        +
        +

        Error: access_denied Code: AADSTS65005 Description: Using application 'rclone' is currently not supported for your organization [YOUR_ORGANIZATION] because it is in an unmanaged state. An administrator needs to claim ownership of the company by DNS validation of [YOUR_ORGANIZATION] before the application rclone can be provisioned.

        +
        
        +This means that rclone can't use the OneDrive for Business API with your account. You can't do much about it, maybe write an email to your admins.
        +
        +However, there are other ways to interact with your OneDrive account. Have a look at the WebDAV backend: https://rclone.org/webdav/#sharepoint
        +
        +### invalid\_grant (AADSTS50076) ####
        +
        +

        Error: invalid_grant Code: AADSTS50076 Description: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '...'.

        +
        
        +If you see the error above after enabling multi-factor authentication for your account, you can fix it by refreshing your OAuth refresh token. To do that, run `rclone config`, and choose to edit your OneDrive backend. Then, you don't need to actually make any changes until you reach this question: `Already have a token - refresh?`. For this question, answer `y` and go through the process to refresh your token, just like the first time the backend is configured. After this, rclone should work again for this backend.
        +
        +### Invalid request when making public links ####
        +
        +On Sharepoint and OneDrive for Business, `rclone link` may return an "Invalid
        +request" error. A possible cause is that the organisation admin didn't allow
        +public links to be made for the organisation/sharepoint library. To fix the
        +permissions as an admin, take a look at the docs:
        +[1](https://docs.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off),
        +[2](https://support.microsoft.com/en-us/office/set-up-and-manage-access-requests-94b26e0b-2822-49d4-929a-8455698654b3).
        +
        +### Can not access `Shared` with me files
        +
        +Shared with me files is not supported by rclone [currently](https://github.com/rclone/rclone/issues/4062), but there is a workaround:
        +
        +1. Visit [https://onedrive.live.com](https://onedrive.live.com/)
        +2. Right click a item in `Shared`, then click `Add shortcut to My files` in the context
        +    ![make_shortcut](https://user-images.githubusercontent.com/60313789/206118040-7e762b3b-aa61-41a1-8649-cc18889f3572.png "Screenshot (Shared with me)")
        +3. The shortcut will appear in `My files`, you can access it with rclone, it behaves like a normal folder/file.
        +    ![in_my_files](https://i.imgur.com/0S8H3li.png "Screenshot (My Files)")
        +    ![rclone_mount](https://i.imgur.com/2Iq66sW.png "Screenshot (rclone mount)")
        +
        +### Live Photos uploaded from iOS (small video clips in .heic files)
        +
        +The iOS OneDrive app introduced [upload and storage](https://techcommunity.microsoft.com/t5/microsoft-onedrive-blog/live-photos-come-to-onedrive/ba-p/1953452) 
        +of [Live Photos](https://support.apple.com/en-gb/HT207310) in 2020. 
        +The usage and download of these uploaded Live Photos is unfortunately still work-in-progress 
        +and this introduces several issues when copying, synchronising and mounting – both in rclone and in the native OneDrive client on Windows.
        +
        +The root cause can easily be seen if you locate one of your Live Photos in the OneDrive web interface. 
        +Then download the photo from the web interface. You will then see that the size of downloaded .heic file is smaller than the size displayed in the web interface. 
        +The downloaded file is smaller because it only contains a single frame (still photo) extracted from the Live Photo (movie) stored in OneDrive.
        +
        +The different sizes will cause `rclone copy/sync` to repeatedly recopy unmodified photos something like this:
        +
        +    DEBUG : 20230203_123826234_iOS.heic: Sizes differ (src 4470314 vs dst 1298667)
        +    DEBUG : 20230203_123826234_iOS.heic: sha1 = fc2edde7863b7a7c93ca6771498ac797f8460750 OK
        +    INFO  : 20230203_123826234_iOS.heic: Copied (replaced existing)
        +
        +These recopies can be worked around by adding `--ignore-size`. Please note that this workaround only syncs the still-picture not the movie clip, 
        +and relies on modification dates being correctly updated on all files in all situations.
        +
        +The different sizes will also cause `rclone check` to report size errors something like this:
        +
        +    ERROR : 20230203_123826234_iOS.heic: sizes differ
        +
        +These check errors can be suppressed by adding `--ignore-size`.
        +
        +The different sizes will also cause `rclone mount` to fail downloading with an error something like this:
        +
        +    ERROR : 20230203_123826234_iOS.heic: ReadFileHandle.Read error: low level retry 1/10: unexpected EOF
        +
        +or like this when using `--cache-mode=full`:
        +
        +    INFO  : 20230203_123826234_iOS.heic: vfs cache: downloader: error count now 1: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable:
        +    ERROR : 20230203_123826234_iOS.heic: vfs cache: failed to download: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable:
        +
        +#  OpenDrive
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +
          +
        1. New remote
        2. +
        3. Delete remote
        4. +
        5. Quit config e/n/d/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / OpenDrive  "opendrive" [snip] Storage> opendrive Username username> Password
        6. +
        7. Yes type in my own password
        8. +
        9. Generate random password y/g> y Enter the password: password: Confirm the password: password: -------------------- [remote] username = password = *** ENCRYPTED *** --------------------
        10. +
        11. Yes this is OK
        12. +
        13. Edit this remote
        14. +
        15. Delete this remote y/e/d> y
        16. +
        +
        
        +List directories in top level of your OpenDrive
        +
        +    rclone lsd remote:
        +
        +List all the files in your OpenDrive
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an OpenDrive directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +OpenDrive allows modification times to be set on objects accurate to 1
        +second. These will be used to detect whether objects need syncing or
        +not.
        +
        +The MD5 hash algorithm is supported.
        +
        +### Restricted filename characters
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| NUL       | 0x00  | ␀           |
        +| /         | 0x2F  | /          |
        +| "         | 0x22  | "          |
        +| *         | 0x2A  | *          |
        +| :         | 0x3A  | :          |
        +| <         | 0x3C  | <          |
        +| >         | 0x3E  | >          |
        +| ?         | 0x3F  | ?          |
        +| \         | 0x5C  | \          |
        +| \|        | 0x7C  | |          |
        +
        +File names can also not begin or end with the following characters.
        +These only get replaced if they are the first or last character in the name:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| SP        | 0x20  | ␠           |
        +| HT        | 0x09  | ␉           |
        +| LF        | 0x0A  | ␊           |
        +| VT        | 0x0B  | ␋           |
        +| CR        | 0x0D  | ␍           |
        +
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to opendrive (OpenDrive).
        +
        +#### --opendrive-username
        +
        +Username.
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_OPENDRIVE_USERNAME
        +- Type:        string
        +- Required:    true
        +
        +#### --opendrive-password
        +
        +Password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_OPENDRIVE_PASSWORD
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to opendrive (OpenDrive).
        +
        +#### --opendrive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_OPENDRIVE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot
        +
        +#### --opendrive-chunk-size
        +
        +Files will be uploaded in chunks this size.
        +
        +Note that these chunks are buffered in memory so increasing them will
        +increase memory use.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_OPENDRIVE_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     10Mi
        +
        +
        +
        +## Limitations
        +
        +Note that OpenDrive is case insensitive so you can't have a
        +file called "Hello.doc" and one called "hello.doc".
        +
        +There are quite a few characters that can't be in OpenDrive file
        +names.  These can't occur on Windows platforms, but on non-Windows
        +platforms they are common.  Rclone will map these names to and from an
        +identical looking unicode equivalent.  For example if a file has a `?`
        +in it will be mapped to `?` instead.
        +
        +`rclone about` is not supported by the OpenDrive backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +#  Oracle Object Storage
        +- [Oracle Object Storage Overview](https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/objectstorageoverview.htm)
        +- [Oracle Object Storage FAQ](https://www.oracle.com/cloud/storage/object-storage/faq/)
        +- [Oracle Object Storage Limits](https://docs.oracle.com/en-us/iaas/Content/Resources/Assets/whitepapers/oci-object-storage-best-practices.pdf)
        +
        +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` command.)  You may put subdirectories in 
        +too, e.g. `remote:bucket/path/to/dir`.
        +
        +Sample command to transfer local artifacts to remote:bucket in oracle object storage:
        +
        +`rclone -vvv  --progress --stats-one-line --max-stats-groups 10 --log-format date,time,UTC,longfile --fast-list --buffer-size 256Mi --oos-no-check-bucket --oos-upload-cutoff 10Mi --multi-thread-cutoff 16Mi --multi-thread-streams 3000 --transfers 3000 --checkers 64  --retries 2  --oos-chunk-size 10Mi --oos-upload-concurrency 10000  --oos-attempt-resume-upload --oos-leave-parts-on-error sync ./artifacts  remote:bucket -vv`
        +
        +## Configuration
        +
        +Here is an example of making an oracle object storage configuration. `rclone config` walks you 
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +
        +
          +
        1. New remote
        2. +
        3. Delete remote
        4. +
        5. Rename remote
        6. +
        7. Copy remote
        8. +
        9. Set configuration password
        10. +
        11. Quit config e/n/d/r/c/s/q> n
        12. +
        +

        Enter name for new remote. name> remote

        +

        Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] XX / Oracle Cloud Infrastructure Object Storage  (oracleobjectstorage) Storage> oracleobjectstorage

        +

        Option provider. Choose your Auth Provider Choose a number from below, or type in your own string value. Press Enter for the default (env_auth). 1 / automatically pickup the credentials from runtime(env), first one to provide auth wins  (env_auth) / use an OCI user and an API key for authentication. 2 | you’ll need to put in a config file your tenancy OCID, user OCID, region, the path, fingerprint to an API key. | https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm  (user_principal_auth) / use instance principals to authorize an instance to make API calls. 3 | each instance has its own identity, and authenticates using the certificates that are read from instance metadata. | https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm  (instance_principal_auth) 4 / use resource principals to make API calls  (resource_principal_auth) 5 / no credentials needed, this is typically for reading public buckets  (no_auth) provider> 2

        +

        Option namespace. Object storage namespace Enter a value. namespace> idbamagbg734

        +

        Option compartment. Object storage compartment OCID Enter a value. compartment> ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba

        +

        Option region. Object storage Region Enter a value. region> us-ashburn-1

        +

        Option endpoint. Endpoint for Object storage API. Leave blank to use the default endpoint for the region. Enter a value. Press Enter to leave empty. endpoint>

        +

        Option config_file. Full Path to OCI config file Choose a number from below, or type in your own string value. Press Enter for the default (~/.oci/config). 1 / oci configuration file location  (~/.oci/config) config_file> /etc/oci/dev.conf

        +

        Option config_profile. Profile name inside OCI config file Choose a number from below, or type in your own string value. Press Enter for the default (Default). 1 / Use the default profile  (Default) config_profile> Test

        +

        Edit advanced config? y) Yes n) No (default) y/n> n

        +

        Configuration complete. Options: - type: oracleobjectstorage - namespace: idbamagbg734 - compartment: ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba - region: us-ashburn-1 - provider: user_principal_auth - config_file: /etc/oci/dev.conf - config_profile: Test Keep this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +See all buckets
        +
        +    rclone lsd remote:
        +
        +Create a new bucket
        +
        +    rclone mkdir remote:bucket
        +
        +List the contents of a bucket
        +
        +    rclone ls remote:bucket
        +    rclone ls remote:bucket --max-depth 1
        +
        +## Authentication Providers 
        +
        +OCI has various authentication methods. To learn more about authentication methods please refer [oci authentication 
        +methods](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm) 
        +These choices can be specified in the rclone config file.
        +
        +Rclone supports the following OCI authentication provider.
        +
        +    User Principal
        +    Instance Principal
        +    Resource Principal
        +    No authentication
        +
        +### User Principal
        +
        +Sample rclone config file for Authentication Provider User Principal:
        +
        +    [oos]
        +    type = oracleobjectstorage
        +    namespace = id<redacted>34
        +    compartment = ocid1.compartment.oc1..aa<redacted>ba
        +    region = us-ashburn-1
        +    provider = user_principal_auth
        +    config_file = /home/opc/.oci/config
        +    config_profile = Default
        +
        +Advantages:
        +- One can use this method from any server within OCI or on-premises or from other cloud provider.
        +
        +Considerations:
        +- you need to configure user’s privileges / policy to allow access to object storage
        +- Overhead of managing users and keys.
        +- If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials.
        +
        +###  Instance Principal
        +
        +An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. 
        +With this approach no credentials have to be stored and managed.
        +
        +Sample rclone configuration file for Authentication Provider Instance Principal:
        +
        +    [opc@rclone ~]$ cat ~/.config/rclone/rclone.conf
        +    [oos]
        +    type = oracleobjectstorage
        +    namespace = id<redacted>fn
        +    compartment = ocid1.compartment.oc1..aa<redacted>k7a
        +    region = us-ashburn-1
        +    provider = instance_principal_auth
        +
        +Advantages:
        +
        +- With instance principals, you don't need to configure user credentials and transfer/ save it to disk in your compute 
        +  instances or rotate the credentials.
        +- You don’t need to deal with users and keys.
        +- Greatly helps in automation as you don't have to manage access keys, user private keys, storing them in vault, 
        +  using kms etc.
        +
        +Considerations:
        +
        +- You need to configure a dynamic group having this instance as member and add policy to read object storage to that 
        +  dynamic group.
        +- Everyone who has access to this machine can execute the CLI commands.
        +- It is applicable for oci compute instances only. It cannot be used on external instance or resources.
        +
        +### Resource Principal
        +
        +Resource principal auth is very similar to instance principal auth but used for resources that are not 
        +compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). 
        +To use resource principal ensure Rclone process is started with these environment variables set in its process.
        +
        +    export OCI_RESOURCE_PRINCIPAL_VERSION=2.2
        +    export OCI_RESOURCE_PRINCIPAL_REGION=us-ashburn-1
        +    export OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM=/usr/share/model-server/key.pem
        +    export OCI_RESOURCE_PRINCIPAL_RPST=/usr/share/model-server/security_token
        +
        +Sample rclone configuration file for Authentication Provider Resource Principal:
        +
        +    [oos]
        +    type = oracleobjectstorage
        +    namespace = id<redacted>34
        +    compartment = ocid1.compartment.oc1..aa<redacted>ba
        +    region = us-ashburn-1
        +    provider = resource_principal_auth
        +
        +### No authentication
        +
        +Public buckets do not require any authentication mechanism to read objects.
        +Sample rclone configuration file for No authentication:
        +    
        +    [oos]
        +    type = oracleobjectstorage
        +    namespace = id<redacted>34
        +    compartment = ocid1.compartment.oc1..aa<redacted>ba
        +    region = us-ashburn-1
        +    provider = no_auth
        +
        +### Modification times and hashes
        +
        +The modification time is stored as metadata on the object as
        +`opc-meta-mtime` as floating point since the epoch, accurate to 1 ns.
        +
        +If the modification time needs to be updated rclone will attempt to perform a server
        +side copy to update the modification if the object can be copied in a single part.
        +In the case the object is larger than 5Gb, the object will be uploaded rather than copied.
        +
        +Note that reading this from the object takes an additional `HEAD` request as the metadata
        +isn't returned in object listings.
        +
        +The MD5 hash algorithm is supported.
        +
        +### Multipart uploads
        +
        +rclone supports multipart uploads with OOS which means that it can
        +upload files bigger than 5 GiB.
        +
        +Note that files uploaded *both* with multipart upload *and* through
        +crypt remotes do not have MD5 sums.
        +
        +rclone switches from single part uploads to multipart uploads at the
        +point specified by `--oos-upload-cutoff`.  This can be a maximum of 5 GiB
        +and a minimum of 0 (ie always upload multipart files).
        +
        +The chunk sizes used in the multipart upload are specified by
        +`--oos-chunk-size` and the number of chunks uploaded concurrently is
        +specified by `--oos-upload-concurrency`.
        +
        +Multipart uploads will use `--transfers` * `--oos-upload-concurrency` *
        +`--oos-chunk-size` extra memory.  Single part uploads to not use extra
        +memory.
        +
        +Single part transfers can be faster than multipart transfers or slower
        +depending on your latency from oos - the more latency, the more likely
        +single part transfers will be faster.
        +
        +Increasing `--oos-upload-concurrency` will increase throughput (8 would
        +be a sensible value) and increasing `--oos-chunk-size` also increases
        +throughput (16M would be sensible).  Increasing either of these will
        +use more memory.  The default values are high enough to gain most of
        +the possible performance without using too much memory.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to oracleobjectstorage (Oracle Cloud Infrastructure Object Storage).
        +
        +#### --oos-provider
        +
        +Choose your Auth Provider
        +
        +Properties:
        +
        +- Config:      provider
        +- Env Var:     RCLONE_OOS_PROVIDER
        +- Type:        string
        +- Default:     "env_auth"
        +- Examples:
        +    - "env_auth"
        +        - automatically pickup the credentials from runtime(env), first one to provide auth wins
        +    - "user_principal_auth"
        +        - use an OCI user and an API key for authentication.
        +        - you’ll need to put in a config file your tenancy OCID, user OCID, region, the path, fingerprint to an API key.
        +        - https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm
        +    - "instance_principal_auth"
        +        - use instance principals to authorize an instance to make API calls. 
        +        - each instance has its own identity, and authenticates using the certificates that are read from instance metadata. 
        +        - https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm
        +    - "resource_principal_auth"
        +        - use resource principals to make API calls
        +    - "no_auth"
        +        - no credentials needed, this is typically for reading public buckets
        +
        +#### --oos-namespace
        +
        +Object storage namespace
        +
        +Properties:
        +
        +- Config:      namespace
        +- Env Var:     RCLONE_OOS_NAMESPACE
        +- Type:        string
        +- Required:    true
        +
        +#### --oos-compartment
        +
        +Object storage compartment OCID
        +
        +Properties:
        +
        +- Config:      compartment
        +- Env Var:     RCLONE_OOS_COMPARTMENT
        +- Provider:    !no_auth
        +- Type:        string
        +- Required:    true
        +
        +#### --oos-region
        +
        +Object storage Region
        +
        +Properties:
        +
        +- Config:      region
        +- Env Var:     RCLONE_OOS_REGION
        +- Type:        string
        +- Required:    true
        +
        +#### --oos-endpoint
        +
        +Endpoint for Object storage API.
        +
        +Leave blank to use the default endpoint for the region.
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_OOS_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --oos-config-file
        +
        +Path to OCI config file
        +
        +Properties:
        +
        +- Config:      config_file
        +- Env Var:     RCLONE_OOS_CONFIG_FILE
        +- Provider:    user_principal_auth
        +- Type:        string
        +- Default:     "~/.oci/config"
        +- Examples:
        +    - "~/.oci/config"
        +        - oci configuration file location
        +
        +#### --oos-config-profile
        +
        +Profile name inside the oci config file
        +
        +Properties:
        +
        +- Config:      config_profile
        +- Env Var:     RCLONE_OOS_CONFIG_PROFILE
        +- Provider:    user_principal_auth
        +- Type:        string
        +- Default:     "Default"
        +- Examples:
        +    - "Default"
        +        - Use the default profile
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to oracleobjectstorage (Oracle Cloud Infrastructure Object Storage).
        +
        +#### --oos-storage-tier
        +
        +The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm
        +
        +Properties:
        +
        +- Config:      storage_tier
        +- Env Var:     RCLONE_OOS_STORAGE_TIER
        +- Type:        string
        +- Default:     "Standard"
        +- Examples:
        +    - "Standard"
        +        - Standard storage tier, this is the default tier
        +    - "InfrequentAccess"
        +        - InfrequentAccess storage tier
        +    - "Archive"
        +        - Archive storage tier
        +
        +#### --oos-upload-cutoff
        +
        +Cutoff for switching to chunked upload.
        +
        +Any files larger than this will be uploaded in chunks of chunk_size.
        +The minimum is 0 and the maximum is 5 GiB.
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_OOS_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     200Mi
        +
        +#### --oos-chunk-size
        +
        +Chunk size to use for uploading.
        +
        +When uploading files larger than upload_cutoff or files with unknown
        +size (e.g. from "rclone rcat" or uploaded with "rclone mount" they will be uploaded 
        +as multipart uploads using this chunk size.
        +
        +Note that "upload_concurrency" chunks of this size are buffered
        +in memory per transfer.
        +
        +If you are transferring large files over high-speed links and you have
        +enough memory, then increasing this will speed up the transfers.
        +
        +Rclone will automatically increase the chunk size when uploading a
        +large file of known size to stay below the 10,000 chunks limit.
        +
        +Files of unknown size are uploaded with the configured
        +chunk_size. Since the default chunk size is 5 MiB and there can be at
        +most 10,000 chunks, this means that by default the maximum size of
        +a file you can stream upload is 48 GiB.  If you wish to stream upload
        +larger files then you will need to increase chunk_size.
        +
        +Increasing the chunk size decreases the accuracy of the progress
        +statistics displayed with "-P" flag.
        +
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_OOS_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     5Mi
        +
        +#### --oos-max-upload-parts
        +
        +Maximum number of parts in a multipart upload.
        +
        +This option defines the maximum number of multipart chunks to use
        +when doing a multipart upload.
        +
        +OCI has max parts limit of 10,000 chunks.
        +
        +Rclone will automatically increase the chunk size when uploading a
        +large file of a known size to stay below this number of chunks limit.
        +
        +
        +Properties:
        +
        +- Config:      max_upload_parts
        +- Env Var:     RCLONE_OOS_MAX_UPLOAD_PARTS
        +- Type:        int
        +- Default:     10000
        +
        +#### --oos-upload-concurrency
        +
        +Concurrency for multipart uploads.
        +
        +This is the number of chunks of the same file that are uploaded
        +concurrently.
        +
        +If you are uploading small numbers of large files over high-speed links
        +and these uploads do not fully utilize your bandwidth, then increasing
        +this may help to speed up the transfers.
        +
        +Properties:
        +
        +- Config:      upload_concurrency
        +- Env Var:     RCLONE_OOS_UPLOAD_CONCURRENCY
        +- Type:        int
        +- Default:     10
        +
        +#### --oos-copy-cutoff
        +
        +Cutoff for switching to multipart copy.
        +
        +Any files larger than this that need to be server-side copied will be
        +copied in chunks of this size.
        +
        +The minimum is 0 and the maximum is 5 GiB.
        +
        +Properties:
        +
        +- Config:      copy_cutoff
        +- Env Var:     RCLONE_OOS_COPY_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     4.656Gi
        +
        +#### --oos-copy-timeout
        +
        +Timeout for copy.
        +
        +Copy is an asynchronous operation, specify timeout to wait for copy to succeed
        +
        +
        +Properties:
        +
        +- Config:      copy_timeout
        +- Env Var:     RCLONE_OOS_COPY_TIMEOUT
        +- Type:        Duration
        +- Default:     1m0s
        +
        +#### --oos-disable-checksum
        +
        +Don't store MD5 checksum with object metadata.
        +
        +Normally rclone will calculate the MD5 checksum of the input before
        +uploading it so it can add it to metadata on the object. This is great
        +for data integrity checking but can cause long delays for large files
        +to start uploading.
        +
        +Properties:
        +
        +- Config:      disable_checksum
        +- Env Var:     RCLONE_OOS_DISABLE_CHECKSUM
        +- Type:        bool
        +- Default:     false
        +
        +#### --oos-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_OOS_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,InvalidUtf8,Dot
        +
        +#### --oos-leave-parts-on-error
        +
        +If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery.
        +
        +It should be set to true for resuming uploads across different sessions.
        +
        +WARNING: Storing parts of an incomplete multipart upload counts towards space usage on object storage and will add
        +additional costs if not cleaned up.
        +
        +
        +Properties:
        +
        +- Config:      leave_parts_on_error
        +- Env Var:     RCLONE_OOS_LEAVE_PARTS_ON_ERROR
        +- Type:        bool
        +- Default:     false
        +
        +#### --oos-attempt-resume-upload
        +
        +If true attempt to resume previously started multipart upload for the object.
        +This will be helpful to speed up multipart transfers by resuming uploads from past session.
        +
        +WARNING: If chunk size differs in resumed session from past incomplete session, then the resumed multipart upload is 
        +aborted and a new multipart upload is started with the new chunk size.
        +
        +The flag leave_parts_on_error must be true to resume and optimize to skip parts that were already uploaded successfully.
        +
        +
        +Properties:
        +
        +- Config:      attempt_resume_upload
        +- Env Var:     RCLONE_OOS_ATTEMPT_RESUME_UPLOAD
        +- Type:        bool
        +- Default:     false
        +
        +#### --oos-no-check-bucket
        +
        +If set, don't attempt to check the bucket exists or create it.
        +
        +This can be useful when trying to minimise the number of transactions
        +rclone does if you know the bucket exists already.
        +
        +It can also be needed if the user you are using does not have bucket
        +creation permissions.
        +
        +
        +Properties:
        +
        +- Config:      no_check_bucket
        +- Env Var:     RCLONE_OOS_NO_CHECK_BUCKET
        +- Type:        bool
        +- Default:     false
        +
        +#### --oos-sse-customer-key-file
        +
        +To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated
        +with the object. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.'
        +
        +Properties:
        +
        +- Config:      sse_customer_key_file
        +- Env Var:     RCLONE_OOS_SSE_CUSTOMER_KEY_FILE
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - None
        +
        +#### --oos-sse-customer-key
        +
        +To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to
        +encrypt or  decrypt the data. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is
        +needed. For more information, see Using Your Own Keys for Server-Side Encryption 
        +(https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm)
        +
        +Properties:
        +
        +- Config:      sse_customer_key
        +- Env Var:     RCLONE_OOS_SSE_CUSTOMER_KEY
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - None
        +
        +#### --oos-sse-customer-key-sha256
        +
        +If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption
        +key. This value is used to check the integrity of the encryption key. see Using Your Own Keys for 
        +Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm).
        +
        +Properties:
        +
        +- Config:      sse_customer_key_sha256
        +- Env Var:     RCLONE_OOS_SSE_CUSTOMER_KEY_SHA256
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - None
        +
        +#### --oos-sse-kms-key-id
        +
        +if using your own master key in vault, this header specifies the
        +OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a master encryption key used to call
        +the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.
        +Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.
        +
        +Properties:
        +
        +- Config:      sse_kms_key_id
        +- Env Var:     RCLONE_OOS_SSE_KMS_KEY_ID
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - None
        +
        +#### --oos-sse-customer-algorithm
        +
        +If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm.
        +Object Storage supports "AES256" as the encryption algorithm. For more information, see
        +Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm).
        +
        +Properties:
        +
        +- Config:      sse_customer_algorithm
        +- Env Var:     RCLONE_OOS_SSE_CUSTOMER_ALGORITHM
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - None
        +    - "AES256"
        +        - AES256
        +
        +## Backend commands
        +
        +Here are the commands specific to the oracleobjectstorage backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### rename
        +
        +change the name of an object
        +
        +    rclone backend rename remote: [options] [<arguments>+]
        +
        +This command can be used to rename a object.
        +
        +Usage Examples:
        +
        +    rclone backend rename oos:bucket relative-object-path-under-bucket object-new-name
        +
        +
        +### list-multipart-uploads
        +
        +List the unfinished multipart uploads
        +
        +    rclone backend list-multipart-uploads remote: [options] [<arguments>+]
        +
        +This command lists the unfinished multipart uploads in JSON format.
        +
        +    rclone backend list-multipart-uploads oos:bucket/path/to/object
        +
        +It returns a dictionary of buckets with values as lists of unfinished
        +multipart uploads.
        +
        +You can call it with no bucket in which case it lists all bucket, with
        +a bucket or with a bucket and path.
        +
        +    {
        +      "test-bucket": [
        +                {
        +                        "namespace": "test-namespace",
        +                        "bucket": "test-bucket",
        +                        "object": "600m.bin",
        +                        "uploadId": "51dd8114-52a4-b2f2-c42f-5291f05eb3c8",
        +                        "timeCreated": "2022-07-29T06:21:16.595Z",
        +                        "storageTier": "Standard"
        +                }
        +        ]
        +
        +
        +### cleanup
        +
        +Remove unfinished multipart uploads.
        +
        +    rclone backend cleanup remote: [options] [<arguments>+]
        +
        +This command removes unfinished multipart uploads of age greater than
        +max-age which defaults to 24 hours.
        +
        +Note that you can use --interactive/-i or --dry-run with this command to see what
        +it would do.
        +
        +    rclone backend cleanup oos:bucket/path/to/object
        +    rclone backend cleanup -o max-age=7w oos:bucket/path/to/object
        +
        +Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.
        +
        +
        +Options:
        +
        +- "max-age": Max age of upload to delete
        +
        +
        +
        +## Tutorials
        +### [Mounting Buckets](https://rclone.org/oracleobjectstorage/tutorial_mount/)
        +
        +#  QingStor
        +
        +Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
        +command.)  You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`.
        +
        +## Configuration
        +
        +Here is an example of making an QingStor configuration.  First run
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process.
        +
        +

        No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / QingStor Object Storage  "qingstor" [snip] Storage> qingstor Get QingStor credentials from runtime. Only applies if access_key_id and secret_access_key is blank. Choose a number from below, or type in your own value 1 / Enter QingStor credentials in the next step  "false" 2 / Get QingStor credentials from the environment (env vars or IAM)  "true" env_auth> 1 QingStor Access Key ID - leave blank for anonymous access or runtime credentials. access_key_id> access_key QingStor Secret Access Key (password) - leave blank for anonymous access or runtime credentials. secret_access_key> secret_key Enter an endpoint URL to connection QingStor API. Leave blank will use the default value "https://qingstor.com:443" endpoint> Zone connect to. Default is "pek3a". Choose a number from below, or type in your own value / The Beijing (China) Three Zone 1 | Needs location constraint pek3a.  "pek3a" / The Shanghai (China) First Zone 2 | Needs location constraint sh1a.  "sh1a" zone> 1 Number of connection retry. Leave blank will use the default value "3". connection_retries> Remote config -------------------- [remote] env_auth = false access_key_id = access_key secret_access_key = secret_key endpoint = zone = pek3a connection_retries = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +This remote is called `remote` and can now be used like this
        +
        +See all buckets
        +
        +    rclone lsd remote:
        +
        +Make a new bucket
        +
        +    rclone mkdir remote:bucket
        +
        +List the contents of a bucket
        +
        +    rclone ls remote:bucket
        +
        +Sync `/home/local/directory` to the remote bucket, deleting any excess
        +files in the bucket.
        +
        +    rclone sync --interactive /home/local/directory remote:bucket
        +
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +### Multipart uploads
        +
        +rclone supports multipart uploads with QingStor which means that it can
        +upload files bigger than 5 GiB. Note that files uploaded with multipart
        +upload don't have an MD5SUM.
        +
        +Note that incomplete multipart uploads older than 24 hours can be
        +removed with `rclone cleanup remote:bucket` just for one bucket
        +`rclone cleanup remote:` for all buckets. QingStor does not ever
        +remove incomplete multipart uploads so it may be necessary to run this
        +from time to time.
        +
        +### Buckets and Zone
        +
        +With QingStor you can list buckets (`rclone lsd`) using any zone,
        +but you can only access the content of a bucket from the zone it was
        +created in.  If you attempt to access a bucket from the wrong zone,
        +you will get an error, `incorrect zone, the bucket is not in 'XXX'
        +zone`.
        +
        +### Authentication
        +
        +There are two ways to supply `rclone` with a set of QingStor
        +credentials. In order of precedence:
        +
        + - Directly in the rclone configuration file (as configured by `rclone config`)
        +   - set `access_key_id` and `secret_access_key`
        + - Runtime configuration:
        +   - set `env_auth` to `true` in the config file
        +   - Exporting the following environment variables before running `rclone`
        +     - Access Key ID: `QS_ACCESS_KEY_ID` or `QS_ACCESS_KEY`
        +     - Secret Access Key: `QS_SECRET_ACCESS_KEY` or `QS_SECRET_KEY`
        +
        +### Restricted filename characters
        +
        +The control characters 0x00-0x1F and / are replaced as in the [default
        +restricted characters set](https://rclone.org/overview/#restricted-characters).  Note
        +that 0x7F is not replaced.
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to qingstor (QingCloud Object Storage).
        +
        +#### --qingstor-env-auth
        +
        +Get QingStor credentials from runtime.
        +
        +Only applies if access_key_id and secret_access_key is blank.
        +
        +Properties:
        +
        +- Config:      env_auth
        +- Env Var:     RCLONE_QINGSTOR_ENV_AUTH
        +- Type:        bool
        +- Default:     false
        +- Examples:
        +    - "false"
        +        - Enter QingStor credentials in the next step.
        +    - "true"
        +        - Get QingStor credentials from the environment (env vars or IAM).
        +
        +#### --qingstor-access-key-id
        +
        +QingStor Access Key ID.
        +
        +Leave blank for anonymous access or runtime credentials.
        +
        +Properties:
        +
        +- Config:      access_key_id
        +- Env Var:     RCLONE_QINGSTOR_ACCESS_KEY_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --qingstor-secret-access-key
        +
        +QingStor Secret Access Key (password).
        +
        +Leave blank for anonymous access or runtime credentials.
        +
        +Properties:
        +
        +- Config:      secret_access_key
        +- Env Var:     RCLONE_QINGSTOR_SECRET_ACCESS_KEY
        +- Type:        string
        +- Required:    false
        +
        +#### --qingstor-endpoint
        +
        +Enter an endpoint URL to connection QingStor API.
        +
        +Leave blank will use the default value "https://qingstor.com:443".
        +
        +Properties:
        +
        +- Config:      endpoint
        +- Env Var:     RCLONE_QINGSTOR_ENDPOINT
        +- Type:        string
        +- Required:    false
        +
        +#### --qingstor-zone
        +
        +Zone to connect to.
        +
        +Default is "pek3a".
        +
        +Properties:
        +
        +- Config:      zone
        +- Env Var:     RCLONE_QINGSTOR_ZONE
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "pek3a"
        +        - The Beijing (China) Three Zone.
        +        - Needs location constraint pek3a.
        +    - "sh1a"
        +        - The Shanghai (China) First Zone.
        +        - Needs location constraint sh1a.
        +    - "gd2a"
        +        - The Guangdong (China) Second Zone.
        +        - Needs location constraint gd2a.
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to qingstor (QingCloud Object Storage).
        +
        +#### --qingstor-connection-retries
        +
        +Number of connection retries.
        +
        +Properties:
        +
        +- Config:      connection_retries
        +- Env Var:     RCLONE_QINGSTOR_CONNECTION_RETRIES
        +- Type:        int
        +- Default:     3
        +
        +#### --qingstor-upload-cutoff
        +
        +Cutoff for switching to chunked upload.
        +
        +Any files larger than this will be uploaded in chunks of chunk_size.
        +The minimum is 0 and the maximum is 5 GiB.
        +
        +Properties:
        +
        +- Config:      upload_cutoff
        +- Env Var:     RCLONE_QINGSTOR_UPLOAD_CUTOFF
        +- Type:        SizeSuffix
        +- Default:     200Mi
        +
        +#### --qingstor-chunk-size
        +
        +Chunk size to use for uploading.
        +
        +When uploading files larger than upload_cutoff they will be uploaded
        +as multipart uploads using this chunk size.
        +
        +Note that "--qingstor-upload-concurrency" chunks of this size are buffered
        +in memory per transfer.
        +
        +If you are transferring large files over high-speed links and you have
        +enough memory, then increasing this will speed up the transfers.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_QINGSTOR_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     4Mi
        +
        +#### --qingstor-upload-concurrency
        +
        +Concurrency for multipart uploads.
        +
        +This is the number of chunks of the same file that are uploaded
        +concurrently.
        +
        +NB if you set this to > 1 then the checksums of multipart uploads
        +become corrupted (the uploads themselves are not corrupted though).
        +
        +If you are uploading small numbers of large files over high-speed links
        +and these uploads do not fully utilize your bandwidth, then increasing
        +this may help to speed up the transfers.
        +
        +Properties:
        +
        +- Config:      upload_concurrency
        +- Env Var:     RCLONE_QINGSTOR_UPLOAD_CONCURRENCY
        +- Type:        int
        +- Default:     1
        +
        +#### --qingstor-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_QINGSTOR_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,Ctl,InvalidUtf8
        +
        +
        +
        +## Limitations
        +
        +`rclone about` is not supported by the qingstor backend. Backends without
        +this capability cannot determine free space for an rclone mount or
        +use policy `mfs` (most free space) as a member of an rclone union
        +remote.
        +
        +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
        +
        +#  Quatrix
        +
        +Quatrix by Maytech is [Quatrix Secure Compliant File Sharing | Maytech](https://www.maytech.net/products/quatrix-business).
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g., `remote:directory/subdirectory`.
        +
        +The initial setup for Quatrix involves getting an API Key from Quatrix. You can get the API key in the user's profile at `https://<account>/profile/api-keys`
        +or with the help of the API - https://docs.maytech.net/quatrix/quatrix-api/api-explorer#/API-Key/post_api_key_create.
        +
        +See complete Swagger documentation for Quatrix - https://docs.maytech.net/quatrix/quatrix-api/api-explorer
        +
        +## Configuration
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Quatrix by Maytech  "quatrix" [snip] Storage> quatrix API key for accessing Quatrix account. api_key> your_api_key Host name of Quatrix account. host> example.quatrix.it

        +
        +++ - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CharacterValueReplacement[remote] api_key = your_api_key host = example.quatrix.it
        \0x5Cy) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ```
        Once configured you can then use rclone like this,
        List directories in top level of your Quatrix
        rclone lsd remote:
        List all the files in your Quatrix
        rclone ls remote:
        To copy a local directory to an Quatrix directory called backup
        rclone copy /home/source remote:backup
        ### API key validity
        API Key is created with no expiration date. It will be valid until you delete or deactivate it in your account. After disabling, the API Key can be enabled back. If the API Key was deleted and a new key was created, you can update it in rclone config. The same happens if the hostname was changed.
        ``` $ rclone config Current remotes:
        Name Type ==== ==== remote quatrix
        e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in an existing value 1 > remote remote> remote
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Deleting files

        -

        Deleted files will be moved to the trash. Your subscription level will determine how long items stay in the trash. rclone cleanup can be used to empty the trash.

        -

        Emptying the trash

        -

        Due to an API limitation, the rclone cleanup command will only work if you set your username and password in the advanced options for this backend. Since we generally want to avoid storing user passwords in the rclone config file, we advise you to only set this up if you need the rclone cleanup command to work.

        -

        Root folder ID

        -

        You can set the root_folder_id for rclone. This is the directory (identified by its Folder ID) that rclone considers to be the root of your pCloud drive.

        -

        Normally you will leave this blank and rclone will determine the correct root to use itself.

        -

        However you can set this to restrict rclone to a specific folder hierarchy.

        -

        In order to do this you will have to find the Folder ID of the directory you wish rclone to display. This will be the folder field of the URL when you open the relevant folder in the pCloud web interface.

        -

        So if the folder you want rclone to use has a URL which looks like https://my.pcloud.com/#page=filemanager&folder=5xxxxxxxx8&tpl=foldergrid in the browser, then you use 5xxxxxxxx8 as the root_folder_id in the config.

        -

        Standard options

        -

        Here are the Standard options specific to pcloud (Pcloud).

        -

        --pcloud-client-id

        -

        OAuth Client Id.

        -

        Leave blank normally.

        -

        Properties:

        -
          -
        • Config: client_id
        • -
        • Env Var: RCLONE_PCLOUD_CLIENT_ID
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --pcloud-client-secret

        -

        OAuth Client Secret.

        -

        Leave blank normally.

        -

        Properties:

        -
          -
        • Config: client_secret
        • -
        • Env Var: RCLONE_PCLOUD_CLIENT_SECRET
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to pcloud (Pcloud).

        -

        --pcloud-token

        -

        OAuth Access Token as a JSON blob.

        -

        Properties:

        -
          -
        • Config: token
        • -
        • Env Var: RCLONE_PCLOUD_TOKEN
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --pcloud-auth-url

        -

        Auth server URL.

        -

        Leave blank to use the provider defaults.

        -

        Properties:

        -
          -
        • Config: auth_url
        • -
        • Env Var: RCLONE_PCLOUD_AUTH_URL
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --pcloud-token-url

        -

        Token server url.

        -

        Leave blank to use the provider defaults.

        -

        Properties:

        -
          -
        • Config: token_url
        • -
        • Env Var: RCLONE_PCLOUD_TOKEN_URL
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --pcloud-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_PCLOUD_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        • -
        -

        --pcloud-root-folder-id

        -

        Fill in for rclone to use a non root folder as its starting point.

        -

        Properties:

        -
          -
        • Config: root_folder_id
        • -
        • Env Var: RCLONE_PCLOUD_ROOT_FOLDER_ID
        • -
        • Type: string
        • -
        • Default: "d0"
        • -
        -

        --pcloud-hostname

        -

        Hostname to connect to.

        -

        This is normally set when rclone initially does the oauth connection, however you will need to set it by hand if you are using remote config with rclone authorize.

        -

        Properties:

        -
          -
        • Config: hostname
        • -
        • Env Var: RCLONE_PCLOUD_HOSTNAME
        • -
        • Type: string
        • -
        • Default: "api.pcloud.com"
        • -
        • Examples: -
            -
          • "api.pcloud.com" -
              -
            • Original/US region
            • -
          • -
          • "eapi.pcloud.com" -
              -
            • EU region
            • -
          • -
        • -
        -

        --pcloud-username

        -

        Your pcloud username.

        -

        This is only required when you want to use the cleanup command. Due to a bug in the pcloud API the required API does not support OAuth authentication so we have to rely on user password authentication for it.

        -

        Properties:

        -
          -
        • Config: username
        • -
        • Env Var: RCLONE_PCLOUD_USERNAME
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --pcloud-password

        -

        Your pcloud password.

        -

        NB Input to this must be obscured - see rclone obscure.

        -

        Properties:

        -
          -
        • Config: password
        • -
        • Env Var: RCLONE_PCLOUD_PASSWORD
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        premiumize.me

        -

        Paths are specified as remote:path

        -

        Paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Configuration

        -

        The initial setup for premiumize.me involves getting a token from premiumize.me which you need to do in your browser. rclone config walks you through it.

        -

        Here is an example of how to make a remote called remote. First run:

        -
         rclone config
        -

        This will guide you through an interactive setup process:

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> remote
        -Type of storage to configure.
        -Enter a string value. Press Enter for the default ("").
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / premiumize.me
        -   \ "premiumizeme"
        -[snip]
        -Storage> premiumizeme
        -** See help for premiumizeme backend at: https://rclone.org/premiumizeme/ **
        +

        [remote] type = quatrix host = some_host.quatrix.it api_key = your_api_key -------------------- Edit remote Option api_key. API key for accessing Quatrix account Enter a string value. Press Enter for the default (your_api_key) api_key> Option host. Host name of Quatrix account Enter a string value. Press Enter for the default (some_host.quatrix.it).

        + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        [remote] type = quatrix host = some_host.quatrix.it api_key = your_api_key
        y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ```
        ### Modification times and hashes
        Quatrix allows modification times to be set on objects accurate to 1 microsecond. These will be used to detect whether objects need syncing or not.
        Quatrix does not support hashes, so you cannot use the --checksum flag.
        ### Restricted filename characters
        File names in Quatrix are case sensitive and have limitations like the maximum length of a filename is 255, and the minimum length is 1. A file name cannot be equal to . or .. nor contain / , \ or non-printable ascii.
        ### Transfers
        For files above 50 MiB rclone will use a chunked transfer. Rclone will upload up to --transfers chunks at the same time (shared among all multipart uploads). Chunks are buffered in memory, and the minimal chunk size is 10_000_000 bytes by default, and it can be changed in the advanced configuration, so increasing --transfers will increase the memory use. The chunk size has a maximum size limit, which is set to 100_000_000 bytes by default and can be changed in the advanced configuration. The size of the uploaded chunk will dynamically change depending on the upload speed. The total memory use equals the number of transfers multiplied by the minimal chunk size. In case there's free memory allocated for the upload (which equals the difference of maximal_summary_chunk_size and minimal_chunk_size * transfers), the chunk size may increase in case of high upload speed. As well as it can decrease in case of upload speed problems. If no free memory is available, all chunks will equal minimal_chunk_size.
        ### Deleting files
        Files you delete with rclone will end up in Trash and be stored there for 30 days. Quatrix also provides an API to permanently delete files and an API to empty the Trash so that you can remove files permanently from your account.
        ### Standard options
        Here are the Standard options specific to quatrix (Quatrix by Maytech).
        #### --quatrix-api-key
        API key for accessing Quatrix account
        Properties:
        - Config: api_key - Env Var: RCLONE_QUATRIX_API_KEY - Type: string - Required: true
        #### --quatrix-host
        Host name of Quatrix account
        Properties:
        - Config: host - Env Var: RCLONE_QUATRIX_HOST - Type: string - Required: true
        ### Advanced options
        Here are the Advanced options specific to quatrix (Quatrix by Maytech).
        #### --quatrix-encoding
        The encoding for the backend.
        See the encoding section in the overview for more info.
        Properties:
        - Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING - Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        #### --quatrix-effective-upload-time
        Wanted upload time for one chunk
        Properties:
        - Config: effective_upload_time - Env Var: RCLONE_QUATRIX_EFFECTIVE_UPLOAD_TIME - Type: string - Default: "4s"
        #### --quatrix-minimal-chunk-size
        The minimal size for one chunk
        Properties:
        - Config: minimal_chunk_size - Env Var: RCLONE_QUATRIX_MINIMAL_CHUNK_SIZE - Type: SizeSuffix - Default: 9.537Mi
        #### --quatrix-maximal-summary-chunk-size
        The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size'
        Properties:
        - Config: maximal_summary_chunk_size - Env Var: RCLONE_QUATRIX_MAXIMAL_SUMMARY_CHUNK_SIZE - Type: SizeSuffix - Default: 95.367Mi
        #### --quatrix-hard-delete
        Delete files permanently rather than putting them into the trash.
        Properties:
        - Config: hard_delete - Env Var: RCLONE_QUATRIX_HARD_DELETE - Type: bool - Default: false
        ## Storage usage
        The storage usage in Quatrix is restricted to the account during the purchase. You can restrict any user with a smaller storage limit. The account limit is applied if the user has no custom storage limit. Once you've reached the limit, the upload of files will fail. This can be fixed by freeing up the space or increasing the quota.
        ## Server-side operations
        Quatrix supports server-side operations (copy and move). In case of conflict, files are overwritten during server-side operation.
        # Sia
        Sia (sia.tech) is a decentralized cloud storage platform based on the blockchain technology. With rclone you can use it like any other remote filesystem or mount Sia folders locally. The technology behind it involves a number of new concepts such as Siacoins and Wallet, Blockchain and Consensus, Renting and Hosting, and so on. If you are new to it, you'd better first familiarize yourself using their excellent support documentation.
        ## Introduction
        Before you can use rclone with Sia, you will need to have a running copy of Sia-UI or siad (the Sia daemon) locally on your computer or on local network (e.g. a NAS). Please follow the Get started guide and install one.
        rclone interacts with Sia network by talking to the Sia daemon via HTTP API which is usually available on port 9980. By default you will run the daemon locally on the same computer so it's safe to leave the API password blank (the API URL will be http://127.0.0.1:9980 making external access impossible).
        However, if you want to access Sia daemon running on another node, for example due to memory constraints or because you want to share single daemon between several rclone and Sia-UI instances, you'll need to make a few more provisions: - Ensure you have Sia daemon installed directly or in a docker container because Sia-UI does not support this mode natively. - Run it on externally accessible port, for example provide --api-addr :9980 and --disable-api-security arguments on the daemon command line. - Enforce API password for the siad daemon via environment variable SIA_API_PASSWORD or text file named apipassword in the daemon directory. - Set rclone backend option api_password taking it from above locations.
        Notes: 1. If your wallet is locked, rclone cannot unlock it automatically. You should either unlock it in advance by using Sia-UI or via command line siac wallet unlock. Alternatively you can make siad unlock your wallet automatically upon startup by running it with environment variable SIA_WALLET_PASSWORD. 2. If siad cannot find the SIA_API_PASSWORD variable or the apipassword file in the SIA_DIR directory, it will generate a random password and store in the text file named apipassword under YOUR_HOME/.sia/ directory on Unix or C:\Users\YOUR_HOME\AppData\Local\Sia\apipassword on Windows. Remember this when you configure password in rclone. 3. The only way to use siad without API password is to run it on localhost with command line argument --authorize-api=false, but this is insecure and strongly discouraged.
        ## Configuration
        Here is an example of how to make a sia remote called mySia. First, run:
        rclone config
        This will guide you through an interactive setup process:
        ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> mySia Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value ... 29 / Sia Decentralized Cloud  "sia" ... Storage> sia Sia daemon API URL, like http://sia.daemon.host:9980. Note that siad must run with --disable-api-security to open API port for other hosts (not recommended). Keep default if Sia daemon runs on localhost. Enter a string value. Press Enter for the default ("http://127.0.0.1:9980"). api_url> http://127.0.0.1:9980 Sia Daemon API Password. Can be found in the apipassword file located in HOME/.sia/ or in the daemon directory. y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g/n> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n
        +

        [mySia] type = sia api_url = http://127.0.0.1:9980 api_password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +Once configured, you can then use `rclone` like this:
        +
        +- List directories in top level of your Sia storage
        +
        +

        rclone lsd mySia:

        +
        
        +- List all the files in your Sia storage
        +
        +

        rclone ls mySia:

        +
        
        +- Upload a local directory to the Sia directory called _backup_
        +
        +

        rclone copy /home/source mySia:backup

        +
        
        +
        +### Standard options
        +
        +Here are the Standard options specific to sia (Sia Decentralized Cloud).
        +
        +#### --sia-api-url
        +
        +Sia daemon API URL, like http://sia.daemon.host:9980.
        +
        +Note that siad must run with --disable-api-security to open API port for other hosts (not recommended).
        +Keep default if Sia daemon runs on localhost.
        +
        +Properties:
        +
        +- Config:      api_url
        +- Env Var:     RCLONE_SIA_API_URL
        +- Type:        string
        +- Default:     "http://127.0.0.1:9980"
        +
        +#### --sia-api-password
        +
        +Sia Daemon API Password.
        +
        +Can be found in the apipassword file located in HOME/.sia/ or in the daemon directory.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      api_password
        +- Env Var:     RCLONE_SIA_API_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to sia (Sia Decentralized Cloud).
        +
        +#### --sia-user-agent
        +
        +Siad User Agent
        +
        +Sia daemon requires the 'Sia-Agent' user agent by default for security
        +
        +Properties:
        +
        +- Config:      user_agent
        +- Env Var:     RCLONE_SIA_USER_AGENT
        +- Type:        string
        +- Default:     "Sia-Agent"
        +
        +#### --sia-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_SIA_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +- Modification times not supported
        +- Checksums not supported
        +- `rclone about` not supported
        +- rclone can work only with _Siad_ or _Sia-UI_ at the moment,
        +  the **SkyNet daemon is not supported yet.**
        +- Sia does not allow control characters or symbols like question and pound
        +  signs in file names. rclone will transparently [encode](https://rclone.org/overview/#encoding)
        +  them for you, but you'd better be aware
        +
        +#  Swift
        +
        +Swift refers to [OpenStack Object Storage](https://docs.openstack.org/swift/latest/).
        +Commercial implementations of that being:
        +
        +  * [Rackspace Cloud Files](https://www.rackspace.com/cloud/files/)
        +  * [Memset Memstore](https://www.memset.com/cloud/storage/)
        +  * [OVH Object Storage](https://www.ovh.co.uk/public-cloud/storage/object-storage/)
        +  * [Oracle Cloud Storage](https://docs.oracle.com/en-us/iaas/integration/doc/configure-object-storage.html)
        +  * [Blomp Cloud Storage](https://www.blomp.com/cloud-storage/)
        +  * [IBM Bluemix Cloud ObjectStorage Swift](https://console.bluemix.net/docs/infrastructure/objectstorage-swift/index.html)
        +
        +Paths are specified as `remote:container` (or `remote:` for the `lsd`
        +command.)  You may put subdirectories in too, e.g. `remote:container/path/to/dir`.
        +
        +## Configuration
        +
        +Here is an example of making a swift configuration.  First run
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process.
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)  "swift" [snip] Storage> swift Get swift credentials from environment variables in standard OpenStack form. Choose a number from below, or type in your own value 1 / Enter swift credentials in the next step  "false" 2 / Get swift credentials from environment vars. Leave other fields blank if using this.  "true" env_auth> true User name to log in (OS_USERNAME). user> API key or password (OS_PASSWORD). key> Authentication URL for server (OS_AUTH_URL). Choose a number from below, or type in your own value 1 / Rackspace US  "https://auth.api.rackspacecloud.com/v1.0" 2 / Rackspace UK  "https://lon.auth.api.rackspacecloud.com/v1.0" 3 / Rackspace v2  "https://identity.api.rackspacecloud.com/v2.0" 4 / Memset Memstore UK  "https://auth.storage.memset.com/v1.0" 5 / Memset Memstore UK v2  "https://auth.storage.memset.com/v2.0" 6 / OVH  "https://auth.cloud.ovh.net/v3" 7 / Blomp Cloud Storage  "https://authenticate.ain.net" auth> User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID). user_id> User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) domain> Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) tenant> Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) tenant_id> Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) tenant_domain> Region name - optional (OS_REGION_NAME) region> Storage URL - optional (OS_STORAGE_URL) storage_url> Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) auth_token> AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) auth_version> Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) Choose a number from below, or type in your own value 1 / Public (default, choose this if not sure)  "public" 2 / Internal (use internal service net)  "internal" 3 / Admin  "admin" endpoint_type> Remote config -------------------- [test] env_auth = true user = key = auth = user_id = domain = tenant = tenant_id = tenant_domain = region = storage_url = auth_token = auth_version = endpoint_type = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +This remote is called `remote` and can now be used like this
        +
        +See all containers
        +
        +    rclone lsd remote:
        +
        +Make a new container
        +
        +    rclone mkdir remote:container
        +
        +List the contents of a container
        +
        +    rclone ls remote:container
        +
        +Sync `/home/local/directory` to the remote container, deleting any
        +excess files in the container.
        +
        +    rclone sync --interactive /home/local/directory remote:container
        +
        +### Configuration from an OpenStack credentials file
        +
        +An OpenStack credentials file typically looks something something
        +like this (without the comments)
        +
        +

        export OS_AUTH_URL=https://a.provider.net/v2.0 export OS_TENANT_ID=ffffffffffffffffffffffffffffffff export OS_TENANT_NAME="1234567890123456" export OS_USERNAME="123abc567xy" echo "Please enter your OpenStack Password: " read -sr OS_PASSWORD_INPUT export OS_PASSWORD=$OS_PASSWORD_INPUT export OS_REGION_NAME="SBG1" if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi

        +
        
        +The config file needs to look something like this where `$OS_USERNAME`
        +represents the value of the `OS_USERNAME` variable - `123abc567xy` in
        +the example above.
        +
        +

        [remote] type = swift user = $OS_USERNAME key = $OS_PASSWORD auth = $OS_AUTH_URL tenant = $OS_TENANT_NAME

        +
        
        +Note that you may (or may not) need to set `region` too - try without first.
        +
        +### Configuration from the environment
        +
        +If you prefer you can configure rclone to use swift using a standard
        +set of OpenStack environment variables.
        +
        +When you run through the config, make sure you choose `true` for
        +`env_auth` and leave everything else blank.
        +
        +rclone will then set any empty config parameters from the environment
        +using standard OpenStack environment variables.  There is [a list of
        +the
        +variables](https://godoc.org/github.com/ncw/swift#Connection.ApplyEnvironment)
        +in the docs for the swift library.
        +
        +### Using an alternate authentication method
        +
        +If your OpenStack installation uses a non-standard authentication method
        +that might not be yet supported by rclone or the underlying swift library, 
        +you can authenticate externally (e.g. calling manually the `openstack` 
        +commands to get a token). Then, you just need to pass the two 
        +configuration variables ``auth_token`` and ``storage_url``. 
        +If they are both provided, the other variables are ignored. rclone will 
        +not try to authenticate but instead assume it is already authenticated 
        +and use these two variables to access the OpenStack installation.
        +
        +#### Using rclone without a config file
        +
        +You can use rclone with swift without a config file, if desired, like
        +this:
        +
        +

        source openstack-credentials-file export RCLONE_CONFIG_MYREMOTE_TYPE=swift export RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true rclone lsd myremote:

        +
        
        +### --fast-list
        +
        +This remote supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +
        +### --update and --use-server-modtime
        +
        +As noted below, the modified time is stored on metadata on the object. It is
        +used by default for all operations that require checking the time a file was
        +last updated. It allows rclone to treat the remote more like a true filesystem,
        +but it is inefficient because it requires an extra API call to retrieve the
        +metadata.
        +
        +For many operations, the time the object was last uploaded to the remote is
        +sufficient to determine if it is "dirty". By using `--update` along with
        +`--use-server-modtime`, you can avoid the extra API call and simply upload
        +files whose local modtime is newer than the time it was last uploaded.
        +
        +### Modification times and hashes
        +
        +The modified time is stored as metadata on the object as
        +`X-Object-Meta-Mtime` as floating point since the epoch accurate to 1
        +ns.
        +
        +This is a de facto standard (used in the official python-swiftclient
        +amongst others) for storing the modification time for an object.
        +
        +The MD5 hash algorithm is supported.
        +
        +### Restricted filename characters
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| NUL       | 0x00  | ␀           |
        +| /         | 0x2F  | /          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to swift (OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)).
        +
        +#### --swift-env-auth
        +
        +Get swift credentials from environment variables in standard OpenStack form.
        +
        +Properties:
        +
        +- Config:      env_auth
        +- Env Var:     RCLONE_SWIFT_ENV_AUTH
        +- Type:        bool
        +- Default:     false
        +- Examples:
        +    - "false"
        +        - Enter swift credentials in the next step.
        +    - "true"
        +        - Get swift credentials from environment vars.
        +        - Leave other fields blank if using this.
        +
        +#### --swift-user
        +
        +User name to log in (OS_USERNAME).
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_SWIFT_USER
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-key
        +
        +API key or password (OS_PASSWORD).
        +
        +Properties:
        +
        +- Config:      key
        +- Env Var:     RCLONE_SWIFT_KEY
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-auth
        +
        +Authentication URL for server (OS_AUTH_URL).
        +
        +Properties:
        +
        +- Config:      auth
        +- Env Var:     RCLONE_SWIFT_AUTH
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - "https://auth.api.rackspacecloud.com/v1.0"
        +        - Rackspace US
        +    - "https://lon.auth.api.rackspacecloud.com/v1.0"
        +        - Rackspace UK
        +    - "https://identity.api.rackspacecloud.com/v2.0"
        +        - Rackspace v2
        +    - "https://auth.storage.memset.com/v1.0"
        +        - Memset Memstore UK
        +    - "https://auth.storage.memset.com/v2.0"
        +        - Memset Memstore UK v2
        +    - "https://auth.cloud.ovh.net/v3"
        +        - OVH
        +    - "https://authenticate.ain.net"
        +        - Blomp Cloud Storage
        +
        +#### --swift-user-id
        +
        +User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID).
        +
        +Properties:
        +
        +- Config:      user_id
        +- Env Var:     RCLONE_SWIFT_USER_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-domain
        +
        +User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)
        +
        +Properties:
        +
        +- Config:      domain
        +- Env Var:     RCLONE_SWIFT_DOMAIN
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-tenant
        +
        +Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME).
        +
        +Properties:
        +
        +- Config:      tenant
        +- Env Var:     RCLONE_SWIFT_TENANT
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-tenant-id
        +
        +Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID).
        +
        +Properties:
        +
        +- Config:      tenant_id
        +- Env Var:     RCLONE_SWIFT_TENANT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-tenant-domain
        +
        +Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME).
        +
        +Properties:
        +
        +- Config:      tenant_domain
        +- Env Var:     RCLONE_SWIFT_TENANT_DOMAIN
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-region
        +
        +Region name - optional (OS_REGION_NAME).
        +
        +Properties:
        +
        +- Config:      region
        +- Env Var:     RCLONE_SWIFT_REGION
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-storage-url
        +
        +Storage URL - optional (OS_STORAGE_URL).
        +
        +Properties:
        +
        +- Config:      storage_url
        +- Env Var:     RCLONE_SWIFT_STORAGE_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-auth-token
        +
        +Auth Token from alternate authentication - optional (OS_AUTH_TOKEN).
        +
        +Properties:
        +
        +- Config:      auth_token
        +- Env Var:     RCLONE_SWIFT_AUTH_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-application-credential-id
        +
        +Application Credential ID (OS_APPLICATION_CREDENTIAL_ID).
        +
        +Properties:
        +
        +- Config:      application_credential_id
        +- Env Var:     RCLONE_SWIFT_APPLICATION_CREDENTIAL_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-application-credential-name
        +
        +Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME).
        +
        +Properties:
        +
        +- Config:      application_credential_name
        +- Env Var:     RCLONE_SWIFT_APPLICATION_CREDENTIAL_NAME
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-application-credential-secret
        +
        +Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET).
        +
        +Properties:
        +
        +- Config:      application_credential_secret
        +- Env Var:     RCLONE_SWIFT_APPLICATION_CREDENTIAL_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --swift-auth-version
        +
        +AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION).
        +
        +Properties:
        +
        +- Config:      auth_version
        +- Env Var:     RCLONE_SWIFT_AUTH_VERSION
        +- Type:        int
        +- Default:     0
        +
        +#### --swift-endpoint-type
        +
        +Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE).
        +
        +Properties:
        +
        +- Config:      endpoint_type
        +- Env Var:     RCLONE_SWIFT_ENDPOINT_TYPE
        +- Type:        string
        +- Default:     "public"
        +- Examples:
        +    - "public"
        +        - Public (default, choose this if not sure)
        +    - "internal"
        +        - Internal (use internal service net)
        +    - "admin"
        +        - Admin
        +
        +#### --swift-storage-policy
        +
        +The storage policy to use when creating a new container.
        +
        +This applies the specified storage policy when creating a new
        +container. The policy cannot be changed afterwards. The allowed
        +configuration values and their meaning depend on your Swift storage
        +provider.
        +
        +Properties:
        +
        +- Config:      storage_policy
        +- Env Var:     RCLONE_SWIFT_STORAGE_POLICY
        +- Type:        string
        +- Required:    false
        +- Examples:
        +    - ""
        +        - Default
        +    - "pcs"
        +        - OVH Public Cloud Storage
        +    - "pca"
        +        - OVH Public Cloud Archive
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to swift (OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)).
        +
        +#### --swift-leave-parts-on-error
        +
        +If true avoid calling abort upload on a failure.
        +
        +It should be set to true for resuming uploads across different sessions.
        +
        +Properties:
        +
        +- Config:      leave_parts_on_error
        +- Env Var:     RCLONE_SWIFT_LEAVE_PARTS_ON_ERROR
        +- Type:        bool
        +- Default:     false
        +
        +#### --swift-chunk-size
        +
        +Above this size files will be chunked into a _segments container.
        +
        +Above this size files will be chunked into a _segments container.  The
        +default for this is 5 GiB which is its maximum value.
        +
        +Properties:
        +
        +- Config:      chunk_size
        +- Env Var:     RCLONE_SWIFT_CHUNK_SIZE
        +- Type:        SizeSuffix
        +- Default:     5Gi
        +
        +#### --swift-no-chunk
        +
        +Don't chunk files during streaming upload.
        +
        +When doing streaming uploads (e.g. using rcat or mount) setting this
        +flag will cause the swift backend to not upload chunked files.
        +
        +This will limit the maximum upload size to 5 GiB. However non chunked
        +files are easier to deal with and have an MD5SUM.
        +
        +Rclone will still chunk files bigger than chunk_size when doing normal
        +copy operations.
        +
        +Properties:
        +
        +- Config:      no_chunk
        +- Env Var:     RCLONE_SWIFT_NO_CHUNK
        +- Type:        bool
        +- Default:     false
        +
        +#### --swift-no-large-objects
        +
        +Disable support for static and dynamic large objects
        +
        +Swift cannot transparently store files bigger than 5 GiB. There are
        +two schemes for doing that, static or dynamic large objects, and the
        +API does not allow rclone to determine whether a file is a static or
        +dynamic large object without doing a HEAD on the object. Since these
        +need to be treated differently, this means rclone has to issue HEAD
        +requests for objects for example when reading checksums.
        +
        +When `no_large_objects` is set, rclone will assume that there are no
        +static or dynamic large objects stored. This means it can stop doing
        +the extra HEAD calls which in turn increases performance greatly
        +especially when doing a swift to swift transfer with `--checksum` set.
        +
        +Setting this option implies `no_chunk` and also that no files will be
        +uploaded in chunks, so files bigger than 5 GiB will just fail on
        +upload.
        +
        +If you set this option and there *are* static or dynamic large objects,
        +then this will give incorrect hashes for them. Downloads will succeed,
        +but other operations such as Remove and Copy will fail.
        +
        +
        +Properties:
        +
        +- Config:      no_large_objects
        +- Env Var:     RCLONE_SWIFT_NO_LARGE_OBJECTS
        +- Type:        bool
        +- Default:     false
        +
        +#### --swift-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_SWIFT_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,InvalidUtf8
        +
        +
        +
        +## Limitations
        +
        +The Swift API doesn't return a correct MD5SUM for segmented files
        +(Dynamic or Static Large Objects) so rclone won't check or use the
        +MD5SUM for these.
        +
        +## Troubleshooting
        +
        +### Rclone gives Failed to create file system for "remote:": Bad Request
        +
        +Due to an oddity of the underlying swift library, it gives a "Bad
        +Request" error rather than a more sensible error when the
        +authentication fails for Swift.
        +
        +So this most likely means your username / password is wrong.  You can
        +investigate further with the `--dump-bodies` flag.
        +
        +This may also be caused by specifying the region when you shouldn't
        +have (e.g. OVH).
        +
        +### Rclone gives Failed to create file system: Response didn't have storage url and auth token
        +
        +This is most likely caused by forgetting to specify your tenant when
        +setting up a swift remote.
        +
        +## OVH Cloud Archive
        +
        +To use rclone with OVH cloud archive, first use `rclone config` to set up a `swift` backend with OVH, choosing `pca` as the `storage_policy`.
        +
        +### Uploading Objects
        +
        +Uploading objects to OVH cloud archive is no different to object storage, you just simply run the command you like (move, copy or sync) to upload the objects. Once uploaded the objects will show in a "Frozen" state within the OVH control panel.
        +
        +### Retrieving Objects
        +
        +To retrieve objects use `rclone copy` as normal. If the objects are in a frozen state then rclone will ask for them all to be unfrozen and it will wait at the end of the output with a message like the following:
        +
        +`2019/03/23 13:06:33 NOTICE: Received retry after error - sleeping until 2019-03-23T13:16:33.481657164+01:00 (9m59.99985121s)`
        +
        +Rclone will wait for the time specified then retry the copy.
        +
        +#  pCloud
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for pCloud involves getting a token from pCloud which you
        +need to do in your browser.  `rclone config` walks you through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Pcloud  "pcloud" [snip] Storage> pcloud Pcloud App Client Id - leave blank normally. client_id> Pcloud App Client Secret - leave blank normally. client_secret> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] client_id = client_secret = token = {"access_token":"XXX","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from pCloud. This only runs from the moment it opens
        +your browser to the moment you get back the verification code.  This
        +is on `http://127.0.0.1:53682/` and this it may require you to unblock
        +it temporarily if you are running a host firewall.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your pCloud
        +
        +    rclone lsd remote:
        +
        +List all the files in your pCloud
        +
        +    rclone ls remote:
        +
        +To copy a local directory to a pCloud directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +pCloud allows modification times to be set on objects accurate to 1
        +second.  These will be used to detect whether objects need syncing or
        +not.  In order to set a Modification time pCloud requires the object
        +be re-uploaded.
        +
        +pCloud supports MD5 and SHA1 hashes in the US region, and SHA1 and SHA256
        +hashes in the EU region, so you can use the `--checksum` flag.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \         | 0x5C  | \          |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Deleting files
        +
        +Deleted files will be moved to the trash.  Your subscription level
        +will determine how long items stay in the trash.  `rclone cleanup` can
        +be used to empty the trash.
        +
        +### Emptying the trash
        +
        +Due to an API limitation, the `rclone cleanup` command will only work if you 
        +set your username and password in the advanced options for this backend. 
        +Since we generally want to avoid storing user passwords in the rclone config
        +file, we advise you to only set this up if you need the `rclone cleanup` command to work.
        +
        +### Root folder ID
        +
        +You can set the `root_folder_id` for rclone.  This is the directory
        +(identified by its `Folder ID`) that rclone considers to be the root
        +of your pCloud drive.
        +
        +Normally you will leave this blank and rclone will determine the
        +correct root to use itself.
        +
        +However you can set this to restrict rclone to a specific folder
        +hierarchy.
        +
        +In order to do this you will have to find the `Folder ID` of the
        +directory you wish rclone to display.  This will be the `folder` field
        +of the URL when you open the relevant folder in the pCloud web
        +interface.
        +
        +So if the folder you want rclone to use has a URL which looks like
        +`https://my.pcloud.com/#page=filemanager&folder=5xxxxxxxx8&tpl=foldergrid`
        +in the browser, then you use `5xxxxxxxx8` as
        +the `root_folder_id` in the config.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to pcloud (Pcloud).
        +
        +#### --pcloud-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_PCLOUD_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --pcloud-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_PCLOUD_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to pcloud (Pcloud).
        +
        +#### --pcloud-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_PCLOUD_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --pcloud-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_PCLOUD_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --pcloud-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_PCLOUD_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --pcloud-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_PCLOUD_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        +
        +#### --pcloud-root-folder-id
        +
        +Fill in for rclone to use a non root folder as its starting point.
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_PCLOUD_ROOT_FOLDER_ID
        +- Type:        string
        +- Default:     "d0"
        +
        +#### --pcloud-hostname
        +
        +Hostname to connect to.
        +
        +This is normally set when rclone initially does the oauth connection,
        +however you will need to set it by hand if you are using remote config
        +with rclone authorize.
        +
        +
        +Properties:
        +
        +- Config:      hostname
        +- Env Var:     RCLONE_PCLOUD_HOSTNAME
        +- Type:        string
        +- Default:     "api.pcloud.com"
        +- Examples:
        +    - "api.pcloud.com"
        +        - Original/US region
        +    - "eapi.pcloud.com"
        +        - EU region
        +
        +#### --pcloud-username
        +
        +Your pcloud username.
        +            
        +This is only required when you want to use the cleanup command. Due to a bug
        +in the pcloud API the required API does not support OAuth authentication so
        +we have to rely on user password authentication for it.
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_PCLOUD_USERNAME
        +- Type:        string
        +- Required:    false
        +
        +#### --pcloud-password
        +
        +Your pcloud password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_PCLOUD_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +
        +
        +#  PikPak
        +
        +PikPak is [a private cloud drive](https://mypikpak.com/).
        +
        +Paths are specified as `remote:path`, and may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +Here is an example of making a remote for PikPak.
        +
        +First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n

        +

        Enter name for new remote. name> remote

        +

        Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. XX / PikPak  (pikpak) Storage> XX

        +

        Option user. Pikpak username. Enter a value. user> USERNAME

        +

        Option pass. Pikpak password. Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password:

        +

        Edit advanced config? y) Yes n) No (default) y/n>

        +

        Configuration complete. Options: - type: pikpak - user: USERNAME - pass: *** ENCRYPTED *** - token: {"access_token":"eyJ...","token_type":"Bearer","refresh_token":"os...","expiry":"2023-01-26T18:54:32.170582647+09:00"} Keep this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +### Modification times and hashes
        +
        +PikPak keeps modification times on objects, and updates them when uploading objects,
        +but it does not support changing only the modification time
        +
        +The MD5 hash algorithm is supported.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to pikpak (PikPak).
        +
        +#### --pikpak-user
        +
        +Pikpak username.
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_PIKPAK_USER
        +- Type:        string
        +- Required:    true
        +
        +#### --pikpak-pass
        +
        +Pikpak password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      pass
        +- Env Var:     RCLONE_PIKPAK_PASS
        +- Type:        string
        +- Required:    true
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to pikpak (PikPak).
        +
        +#### --pikpak-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_PIKPAK_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --pikpak-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_PIKPAK_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --pikpak-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_PIKPAK_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --pikpak-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_PIKPAK_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --pikpak-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_PIKPAK_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --pikpak-root-folder-id
        +
        +ID of the root folder.
        +Leave blank normally.
        +
        +Fill in for rclone to use a non root folder as its starting point.
        +
        +
        +Properties:
        +
        +- Config:      root_folder_id
        +- Env Var:     RCLONE_PIKPAK_ROOT_FOLDER_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --pikpak-use-trash
        +
        +Send files to the trash instead of deleting permanently.
        +
        +Defaults to true, namely sending files to the trash.
        +Use `--pikpak-use-trash=false` to delete files permanently instead.
        +
        +Properties:
        +
        +- Config:      use_trash
        +- Env Var:     RCLONE_PIKPAK_USE_TRASH
        +- Type:        bool
        +- Default:     true
        +
        +#### --pikpak-trashed-only
        +
        +Only show files that are in the trash.
        +
        +This will show trashed files in their original directory structure.
        +
        +Properties:
        +
        +- Config:      trashed_only
        +- Env Var:     RCLONE_PIKPAK_TRASHED_ONLY
        +- Type:        bool
        +- Default:     false
        +
        +#### --pikpak-hash-memory-limit
        +
        +Files bigger than this will be cached on disk to calculate hash if required.
        +
        +Properties:
        +
        +- Config:      hash_memory_limit
        +- Env Var:     RCLONE_PIKPAK_HASH_MEMORY_LIMIT
        +- Type:        SizeSuffix
        +- Default:     10Mi
        +
        +#### --pikpak-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_PIKPAK_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot
        +
        +## Backend commands
        +
        +Here are the commands specific to the pikpak backend.
        +
        +Run them with
        +
        +    rclone backend COMMAND remote:
        +
        +The help below will explain what arguments each command takes.
        +
        +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
        +info on how to pass options and arguments.
        +
        +These can be run on a running backend using the rc command
        +[backend/command](https://rclone.org/rc/#backend-command).
        +
        +### addurl
        +
        +Add offline download task for url
        +
        +    rclone backend addurl remote: [options] [<arguments>+]
        +
        +This command adds offline download task for url.
        +
        +Usage:
        +
        +    rclone backend addurl pikpak:dirpath url
        +
        +Downloads will be stored in 'dirpath'. If 'dirpath' is invalid, 
        +download will fallback to default 'My Pack' folder.
        +
        +
        +### decompress
        +
        +Request decompress of a file/files in a folder
        +
        +    rclone backend decompress remote: [options] [<arguments>+]
        +
        +This command requests decompress of file/files in a folder.
        +
        +Usage:
        +
        +    rclone backend decompress pikpak:dirpath {filename} -o password=password
        +    rclone backend decompress pikpak:dirpath {filename} -o delete-src-file
        +
        +An optional argument 'filename' can be specified for a file located in 
        +'pikpak:dirpath'. You may want to pass '-o password=password' for a 
        +password-protected files. Also, pass '-o delete-src-file' to delete 
        +source files after decompression finished.
        +
        +Result:
        +
        +    {
        +        "Decompressed": 17,
        +        "SourceDeleted": 0,
        +        "Errors": 0
        +    }
        +
        +
        +
        +
        +## Limitations
        +
        +### Hashes may be empty
        +
        +PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files.
        +
        +### Deleted files still visible with trashed-only
        +
        +Deleted files will still be visible with `--pikpak-trashed-only` even after the
        +trash emptied. This goes away after few days.
        +
        +#  premiumize.me
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for [premiumize.me](https://premiumize.me/) involves getting a token from premiumize.me which you
        +need to do in your browser.  `rclone config` walks you through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / premiumize.me  "premiumizeme" [snip] Storage> premiumizeme ** See help for premiumizeme backend at: https://rclone.org/premiumizeme/ **

        +

        Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = premiumizeme token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2029-08-07T18:44:15.548915378+01:00"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d>

        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from premiumize.me. This only runs from the moment it opens
        +your browser to the moment you get back the verification code.  This
        +is on `http://127.0.0.1:53682/` and this it may require you to unblock
        +it temporarily if you are running a host firewall.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your premiumize.me
        +
        +    rclone lsd remote:
        +
        +List all the files in your premiumize.me
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an premiumize.me directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +premiumize.me does not support modification times or hashes, therefore
        +syncing will default to `--size-only` checking.  Note that using
        +`--update` will work.
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \         | 0x5C  | \           |
        +| "         | 0x22  | "           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to premiumizeme (premiumize.me).
        +
        +#### --premiumizeme-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_PREMIUMIZEME_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --premiumizeme-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_PREMIUMIZEME_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +#### --premiumizeme-api-key
        +
        +API Key.
        +
        +This is not normally used - use oauth instead.
        +
        +
        +Properties:
        +
        +- Config:      api_key
        +- Env Var:     RCLONE_PREMIUMIZEME_API_KEY
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to premiumizeme (premiumize.me).
        +
        +#### --premiumizeme-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_PREMIUMIZEME_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --premiumizeme-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_PREMIUMIZEME_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --premiumizeme-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_PREMIUMIZEME_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --premiumizeme-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_PREMIUMIZEME_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +Note that premiumize.me is case insensitive so you can't have a file called
        +"Hello.doc" and one called "hello.doc".
        +
        +premiumize.me file names can't have the `\` or `"` characters in.
        +rclone maps these to and from an identical looking unicode equivalents
        +`\` and `"`
        +
        +premiumize.me only supports filenames up to 255 characters in length.
        +
        +#  Proton Drive
        +
        +[Proton Drive](https://proton.me/drive) is an end-to-end encrypted Swiss vault
        + for your files that protects your data.
        +
        +This is an rclone backend for Proton Drive which supports the file transfer
        +features of Proton Drive using the same client-side encryption.
        +
        +Due to the fact that Proton Drive doesn't publish its API documentation, this 
        +backend is implemented with best efforts by reading the open-sourced client 
        +source code and observing the Proton Drive traffic in the browser.
        +
        +**NB** This backend is currently in Beta. It is believed to be correct
        +and all the integration tests pass. However the Proton Drive protocol
        +has evolved over time there may be accounts it is not compatible
        +with. Please [post on the rclone forum](https://forum.rclone.org/) if
        +you find an incompatibility.
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configurations
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Proton Drive  "Proton Drive" [snip] Storage> protondrive User name user> you@protonmail.com Password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: Option 2fa. 2FA code (if the account requires one) Enter a value. Press Enter to leave empty. 2fa> 123456 Remote config -------------------- [remote] type = protondrive user = you@protonmail.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +**NOTE:** The Proton Drive encryption keys need to have been already generated 
        +after a regular login via the browser, otherwise attempting to use the 
        +credentials in `rclone` will fail.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Proton Drive
        +
        +    rclone lsd remote:
        +
        +List all the files in your Proton Drive
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an Proton Drive directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +Proton Drive Bridge does not support updating modification times yet.
        +
        +The SHA1 hash algorithm is supported.
        +
        +### Restricted filename characters
        +
        +Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and 
        +right spaces will be removed ([code reference](https://github.com/ProtonMail/WebClients/blob/b4eba99d241af4fdae06ff7138bd651a40ef5d3c/applications/drive/src/app/store/_links/validation.ts#L51))
        +
        +### Duplicated files
        +
        +Proton Drive can not have two files with exactly the same name and path. If the 
        +conflict occurs, depending on the advanced config, the file might or might not 
        +be overwritten.
        +
        +### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password)
        +
        +Please set your mailbox password in the advanced config section.
        +
        +### Caching
        +
        +The cache is currently built for the case when the rclone is the only instance 
        +performing operations to the mount point. The event system, which is the proton
        +API system that provides visibility of what has changed on the drive, is yet 
        +to be implemented, so updates from other clients won’t be reflected in the 
        +cache. Thus, if there are concurrent clients accessing the same mount point, 
        +then we might have a problem with caching the stale data.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to protondrive (Proton Drive).
        +
        +#### --protondrive-username
        +
        +The username of your proton account
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_PROTONDRIVE_USERNAME
        +- Type:        string
        +- Required:    true
        +
        +#### --protondrive-password
        +
        +The password of your proton account.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_PROTONDRIVE_PASSWORD
        +- Type:        string
        +- Required:    true
        +
        +#### --protondrive-2fa
        +
        +The 2FA code
        +
        +The value can also be provided with --protondrive-2fa=000000
        +
        +The 2FA code of your proton drive account if the account is set up with 
        +two-factor authentication
        +
        +Properties:
        +
        +- Config:      2fa
        +- Env Var:     RCLONE_PROTONDRIVE_2FA
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to protondrive (Proton Drive).
        +
        +#### --protondrive-mailbox-password
        +
        +The mailbox password of your two-password proton account.
        +
        +For more information regarding the mailbox password, please check the 
        +following official knowledge base article: 
        +https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      mailbox_password
        +- Env Var:     RCLONE_PROTONDRIVE_MAILBOX_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-uid
        +
        +Client uid key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_uid
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_UID
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-access-token
        +
        +Client access token key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_access_token
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_ACCESS_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-refresh-token
        +
        +Client refresh token key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_refresh_token
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_REFRESH_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-salted-key-pass
        +
        +Client salted key pass key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_salted_key_pass
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_SALTED_KEY_PASS
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_PROTONDRIVE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LeftSpace,RightSpace,InvalidUtf8,Dot
        +
        +#### --protondrive-original-file-size
        +
        +Return the file size before encryption
        +            
        +The size of the encrypted file will be different from (bigger than) the 
        +original file size. Unless there is a reason to return the file size 
        +after encryption is performed, otherwise, set this option to true, as 
        +features like Open() which will need to be supplied with original content 
        +size, will fail to operate properly
        +
        +Properties:
        +
        +- Config:      original_file_size
        +- Env Var:     RCLONE_PROTONDRIVE_ORIGINAL_FILE_SIZE
        +- Type:        bool
        +- Default:     true
        +
        +#### --protondrive-app-version
        +
        +The app version string 
        +
        +The app version string indicates the client that is currently performing 
        +the API request. This information is required and will be sent with every 
        +API request.
        +
        +Properties:
        +
        +- Config:      app_version
        +- Env Var:     RCLONE_PROTONDRIVE_APP_VERSION
        +- Type:        string
        +- Default:     "macos-drive@1.0.0-alpha.1+rclone"
        +
        +#### --protondrive-replace-existing-draft
        +
        +Create a new revision when filename conflict is detected
        +
        +When a file upload is cancelled or failed before completion, a draft will be 
        +created and the subsequent upload of the same file to the same location will be 
        +reported as a conflict.
        +
        +The value can also be set by --protondrive-replace-existing-draft=true
        +
        +If the option is set to true, the draft will be replaced and then the upload 
        +operation will restart. If there are other clients also uploading at the same 
        +file location at the same time, the behavior is currently unknown. Need to set 
        +to true for integration tests.
        +If the option is set to false, an error "a draft exist - usually this means a 
        +file is being uploaded at another client, or, there was a failed upload attempt" 
        +will be returned, and no upload will happen.
        +
        +Properties:
        +
        +- Config:      replace_existing_draft
        +- Env Var:     RCLONE_PROTONDRIVE_REPLACE_EXISTING_DRAFT
        +- Type:        bool
        +- Default:     false
        +
        +#### --protondrive-enable-caching
        +
        +Caches the files and folders metadata to reduce API calls
        +
        +Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, 
        +as the current implementation doesn't update or clear the cache when there are 
        +external changes. 
        +
        +The files and folders on ProtonDrive are represented as links with keyrings, 
        +which can be cached to improve performance and be friendly to the API server.
        +
        +The cache is currently built for the case when the rclone is the only instance 
        +performing operations to the mount point. The event system, which is the proton
        +API system that provides visibility of what has changed on the drive, is yet 
        +to be implemented, so updates from other clients won’t be reflected in the 
        +cache. Thus, if there are concurrent clients accessing the same mount point, 
        +then we might have a problem with caching the stale data.
        +
        +Properties:
        +
        +- Config:      enable_caching
        +- Env Var:     RCLONE_PROTONDRIVE_ENABLE_CACHING
        +- Type:        bool
        +- Default:     true
        +
        +
        +
        +## Limitations
        +
        +This backend uses the 
        +[Proton-API-Bridge](https://github.com/henrybear327/Proton-API-Bridge), which 
        +is based on [go-proton-api](https://github.com/henrybear327/go-proton-api), a 
        +fork of the [official repo](https://github.com/ProtonMail/go-proton-api).
        +
        +There is no official API documentation available from Proton Drive. But, thanks 
        +to Proton open sourcing [proton-go-api](https://github.com/ProtonMail/go-proton-api) 
        +and the web, iOS, and Android client codebases, we don't need to completely 
        +reverse engineer the APIs by observing the web client traffic! 
        +
        +[proton-go-api](https://github.com/ProtonMail/go-proton-api) provides the basic 
        +building blocks of API calls and error handling, such as 429 exponential 
        +back-off, but it is pretty much just a barebone interface to the Proton API. 
        +For example, the encryption and decryption of the Proton Drive file are not 
        +provided in this library. 
        +
        +The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on 
        +top of this quickly. This codebase handles the intricate tasks before and after 
        +calling Proton APIs, particularly the complex encryption scheme, allowing 
        +developers to implement features for other software on top of this codebase. 
        +There are likely quite a few errors in this library, as there isn't official 
        +documentation available.
        +
        +#  put.io
        +
        +Paths are specified as `remote:path`
        +
        +put.io paths may be as deep as required, e.g.
        +`remote:directory/subdirectory`.
        +
        +## Configuration
        +
        +The initial setup for put.io involves getting a token from put.io
        +which you need to do in your browser.  `rclone config` walks you
        +through it.
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> putio Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Put.io  "putio" [snip] Storage> putio ** See help for putio backend at: https://rclone.org/putio/ **

        +

        Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code -------------------- [putio] type = putio token = {"access_token":"XXXXXXXX","expiry":"0001-01-01T00:00:00Z"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

        +

        Name Type ==== ==== putio putio

        +
          +
        1. Edit existing remote
        2. +
        3. New remote
        4. +
        5. Delete remote
        6. +
        7. Rename remote
        8. +
        9. Copy remote
        10. +
        11. Set configuration password
        12. +
        13. Quit config e/n/d/r/c/s/q> q
        14. +
        +
        
        +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
        +machine with no Internet browser available.
        +
        +Note that rclone runs a webserver on your local machine to collect the
        +token as returned from put.io  if using web browser to automatically 
        +authenticate. This only
        +runs from the moment it opens your browser to the moment you get back
        +the verification code.  This is on `http://127.0.0.1:53682/` and this
        +it may require you to unblock it temporarily if you are running a host
        +firewall, or use manual mode.
        +
        +You can then use it like this,
        +
        +List directories in top level of your put.io
        +
        +    rclone lsd remote:
        +
        +List all the files in your put.io
        +
        +    rclone ls remote:
        +
        +To copy a local directory to a put.io directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| \         | 0x5C  | \           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to putio (Put.io).
        +
        +#### --putio-client-id
        +
        +OAuth Client Id.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_id
        +- Env Var:     RCLONE_PUTIO_CLIENT_ID
        +- Type:        string
        +- Required:    false
        +
        +#### --putio-client-secret
        +
        +OAuth Client Secret.
        +
        +Leave blank normally.
        +
        +Properties:
        +
        +- Config:      client_secret
        +- Env Var:     RCLONE_PUTIO_CLIENT_SECRET
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to putio (Put.io).
        +
        +#### --putio-token
        +
        +OAuth Access Token as a JSON blob.
        +
        +Properties:
        +
        +- Config:      token
        +- Env Var:     RCLONE_PUTIO_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --putio-auth-url
        +
        +Auth server URL.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      auth_url
        +- Env Var:     RCLONE_PUTIO_AUTH_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --putio-token-url
        +
        +Token server url.
        +
        +Leave blank to use the provider defaults.
        +
        +Properties:
        +
        +- Config:      token_url
        +- Env Var:     RCLONE_PUTIO_TOKEN_URL
        +- Type:        string
        +- Required:    false
        +
        +#### --putio-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_PUTIO_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        +
        +
        +
        +## Limitations
        +
        +put.io has rate limiting. When you hit a limit, rclone automatically
        +retries after waiting the amount of time requested by the server.
        +
        +If you want to avoid ever hitting these limits, you may use the
        +`--tpslimit` flag with a low number. Note that the imposed limits
        +may be different for different operations, and may change over time.
        +
        +#  Proton Drive
        +
        +[Proton Drive](https://proton.me/drive) is an end-to-end encrypted Swiss vault
        + for your files that protects your data.
        +
        +This is an rclone backend for Proton Drive which supports the file transfer
        +features of Proton Drive using the same client-side encryption.
        +
        +Due to the fact that Proton Drive doesn't publish its API documentation, this 
        +backend is implemented with best efforts by reading the open-sourced client 
        +source code and observing the Proton Drive traffic in the browser.
        +
        +**NB** This backend is currently in Beta. It is believed to be correct
        +and all the integration tests pass. However the Proton Drive protocol
        +has evolved over time there may be accounts it is not compatible
        +with. Please [post on the rclone forum](https://forum.rclone.org/) if
        +you find an incompatibility.
        +
        +Paths are specified as `remote:path`
        +
        +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
        +
        +## Configurations
        +
        +Here is an example of how to make a remote called `remote`.  First run:
        +
        +     rclone config
        +
        +This will guide you through an interactive setup process:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Proton Drive  "Proton Drive" [snip] Storage> protondrive User name user> you@protonmail.com Password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: Option 2fa. 2FA code (if the account requires one) Enter a value. Press Enter to leave empty. 2fa> 123456 Remote config -------------------- [remote] type = protondrive user = you@protonmail.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +**NOTE:** The Proton Drive encryption keys need to have been already generated 
        +after a regular login via the browser, otherwise attempting to use the 
        +credentials in `rclone` will fail.
        +
        +Once configured you can then use `rclone` like this,
        +
        +List directories in top level of your Proton Drive
        +
        +    rclone lsd remote:
        +
        +List all the files in your Proton Drive
        +
        +    rclone ls remote:
        +
        +To copy a local directory to an Proton Drive directory called backup
        +
        +    rclone copy /home/source remote:backup
        +
        +### Modification times and hashes
        +
        +Proton Drive Bridge does not support updating modification times yet.
        +
        +The SHA1 hash algorithm is supported.
        +
        +### Restricted filename characters
        +
        +Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and 
        +right spaces will be removed ([code reference](https://github.com/ProtonMail/WebClients/blob/b4eba99d241af4fdae06ff7138bd651a40ef5d3c/applications/drive/src/app/store/_links/validation.ts#L51))
        +
        +### Duplicated files
        +
        +Proton Drive can not have two files with exactly the same name and path. If the 
        +conflict occurs, depending on the advanced config, the file might or might not 
        +be overwritten.
        +
        +### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password)
        +
        +Please set your mailbox password in the advanced config section.
        +
        +### Caching
        +
        +The cache is currently built for the case when the rclone is the only instance 
        +performing operations to the mount point. The event system, which is the proton
        +API system that provides visibility of what has changed on the drive, is yet 
        +to be implemented, so updates from other clients won’t be reflected in the 
        +cache. Thus, if there are concurrent clients accessing the same mount point, 
        +then we might have a problem with caching the stale data.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to protondrive (Proton Drive).
        +
        +#### --protondrive-username
        +
        +The username of your proton account
        +
        +Properties:
        +
        +- Config:      username
        +- Env Var:     RCLONE_PROTONDRIVE_USERNAME
        +- Type:        string
        +- Required:    true
        +
        +#### --protondrive-password
        +
        +The password of your proton account.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      password
        +- Env Var:     RCLONE_PROTONDRIVE_PASSWORD
        +- Type:        string
        +- Required:    true
        +
        +#### --protondrive-2fa
        +
        +The 2FA code
        +
        +The value can also be provided with --protondrive-2fa=000000
        +
        +The 2FA code of your proton drive account if the account is set up with 
        +two-factor authentication
        +
        +Properties:
        +
        +- Config:      2fa
        +- Env Var:     RCLONE_PROTONDRIVE_2FA
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to protondrive (Proton Drive).
        +
        +#### --protondrive-mailbox-password
        +
        +The mailbox password of your two-password proton account.
        +
        +For more information regarding the mailbox password, please check the 
        +following official knowledge base article: 
        +https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password
        +
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      mailbox_password
        +- Env Var:     RCLONE_PROTONDRIVE_MAILBOX_PASSWORD
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-uid
        +
        +Client uid key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_uid
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_UID
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-access-token
        +
        +Client access token key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_access_token
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_ACCESS_TOKEN
        +- Type:        string
        +- Required:    false
         
        -Remote config
        -Use web browser to automatically authenticate rclone with remote?
        - * Say Y if the machine running rclone has a web browser you can use
        - * Say N if running rclone on a (remote) machine without web browser access
        -If not sure try Y. If Y failed, try N.
        -y) Yes
        -n) No
        -y/n> y
        -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
        -Log in and authorize rclone for access
        -Waiting for code...
        -Got code
        ---------------------
        -[remote]
        -type = premiumizeme
        -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2029-08-07T18:44:15.548915378+01:00"}
        ---------------------
        -y) Yes this is OK
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> 
        -

        See the remote setup docs for how to set it up on a machine with no Internet browser available.

        -

        Note that rclone runs a webserver on your local machine to collect the token as returned from premiumize.me. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall.

        -

        Once configured you can then use rclone like this,

        -

        List directories in top level of your premiumize.me

        -
        rclone lsd remote:
        -

        List all the files in your premiumize.me

        -
        rclone ls remote:
        -

        To copy a local directory to an premiumize.me directory called backup

        -
        rclone copy /home/source remote:backup
        -

        Modified time and hashes

        -

        premiumize.me does not support modification times or hashes, therefore syncing will default to --size-only checking. Note that using --update will work.

        -

        Restricted filename characters

        -

        In addition to the default restricted characters set the following characters are also replaced:

        - - - - - - - - - - - - - - - - - - - - -
        CharacterValueReplacement
        \0x5C
        "0x22
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Standard options

        -

        Here are the Standard options specific to premiumizeme (premiumize.me).

        -

        --premiumizeme-api-key

        -

        API Key.

        -

        This is not normally used - use oauth instead.

        -

        Properties:

        -
          -
        • Config: api_key
        • -
        • Env Var: RCLONE_PREMIUMIZEME_API_KEY
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to premiumizeme (premiumize.me).

        -

        --premiumizeme-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_PREMIUMIZEME_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot
        • -
        -

        Limitations

        -

        Note that premiumize.me is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

        -

        premiumize.me file names can't have the \ or " characters in. rclone maps these to and from an identical looking unicode equivalents and

        -

        premiumize.me only supports filenames up to 255 characters in length.

        -

        put.io

        -

        Paths are specified as remote:path

        -

        put.io paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Configuration

        -

        The initial setup for put.io involves getting a token from put.io which you need to do in your browser. rclone config walks you through it.

        -

        Here is an example of how to make a remote called remote. First run:

        -
         rclone config
        -

        This will guide you through an interactive setup process:

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> putio
        -Type of storage to configure.
        -Enter a string value. Press Enter for the default ("").
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / Put.io
        -   \ "putio"
        -[snip]
        -Storage> putio
        -** See help for putio backend at: https://rclone.org/putio/ **
        +#### --protondrive-client-refresh-token
         
        -Remote config
        -Use web browser to automatically authenticate rclone with remote?
        - * Say Y if the machine running rclone has a web browser you can use
        - * Say N if running rclone on a (remote) machine without web browser access
        -If not sure try Y. If Y failed, try N.
        -y) Yes
        -n) No
        -y/n> y
        -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
        -Log in and authorize rclone for access
        -Waiting for code...
        -Got code
        ---------------------
        -[putio]
        -type = putio
        -token = {"access_token":"XXXXXXXX","expiry":"0001-01-01T00:00:00Z"}
        ---------------------
        -y) Yes this is OK
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -Current remotes:
        +Client refresh token key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_refresh_token
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_REFRESH_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-client-salted-key-pass
        +
        +Client salted key pass key (internal use only)
        +
        +Properties:
        +
        +- Config:      client_salted_key_pass
        +- Env Var:     RCLONE_PROTONDRIVE_CLIENT_SALTED_KEY_PASS
        +- Type:        string
        +- Required:    false
        +
        +#### --protondrive-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_PROTONDRIVE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,LeftSpace,RightSpace,InvalidUtf8,Dot
        +
        +#### --protondrive-original-file-size
        +
        +Return the file size before encryption
        +            
        +The size of the encrypted file will be different from (bigger than) the 
        +original file size. Unless there is a reason to return the file size 
        +after encryption is performed, otherwise, set this option to true, as 
        +features like Open() which will need to be supplied with original content 
        +size, will fail to operate properly
        +
        +Properties:
        +
        +- Config:      original_file_size
        +- Env Var:     RCLONE_PROTONDRIVE_ORIGINAL_FILE_SIZE
        +- Type:        bool
        +- Default:     true
        +
        +#### --protondrive-app-version
        +
        +The app version string 
        +
        +The app version string indicates the client that is currently performing 
        +the API request. This information is required and will be sent with every 
        +API request.
        +
        +Properties:
        +
        +- Config:      app_version
        +- Env Var:     RCLONE_PROTONDRIVE_APP_VERSION
        +- Type:        string
        +- Default:     "macos-drive@1.0.0-alpha.1+rclone"
        +
        +#### --protondrive-replace-existing-draft
        +
        +Create a new revision when filename conflict is detected
        +
        +When a file upload is cancelled or failed before completion, a draft will be 
        +created and the subsequent upload of the same file to the same location will be 
        +reported as a conflict.
        +
        +The value can also be set by --protondrive-replace-existing-draft=true
        +
        +If the option is set to true, the draft will be replaced and then the upload 
        +operation will restart. If there are other clients also uploading at the same 
        +file location at the same time, the behavior is currently unknown. Need to set 
        +to true for integration tests.
        +If the option is set to false, an error "a draft exist - usually this means a 
        +file is being uploaded at another client, or, there was a failed upload attempt" 
        +will be returned, and no upload will happen.
        +
        +Properties:
        +
        +- Config:      replace_existing_draft
        +- Env Var:     RCLONE_PROTONDRIVE_REPLACE_EXISTING_DRAFT
        +- Type:        bool
        +- Default:     false
        +
        +#### --protondrive-enable-caching
        +
        +Caches the files and folders metadata to reduce API calls
        +
        +Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, 
        +as the current implementation doesn't update or clear the cache when there are 
        +external changes. 
        +
        +The files and folders on ProtonDrive are represented as links with keyrings, 
        +which can be cached to improve performance and be friendly to the API server.
        +
        +The cache is currently built for the case when the rclone is the only instance 
        +performing operations to the mount point. The event system, which is the proton
        +API system that provides visibility of what has changed on the drive, is yet 
        +to be implemented, so updates from other clients won’t be reflected in the 
        +cache. Thus, if there are concurrent clients accessing the same mount point, 
        +then we might have a problem with caching the stale data.
        +
        +Properties:
        +
        +- Config:      enable_caching
        +- Env Var:     RCLONE_PROTONDRIVE_ENABLE_CACHING
        +- Type:        bool
        +- Default:     true
        +
        +
        +
        +## Limitations
        +
        +This backend uses the 
        +[Proton-API-Bridge](https://github.com/henrybear327/Proton-API-Bridge), which 
        +is based on [go-proton-api](https://github.com/henrybear327/go-proton-api), a 
        +fork of the [official repo](https://github.com/ProtonMail/go-proton-api).
        +
        +There is no official API documentation available from Proton Drive. But, thanks 
        +to Proton open sourcing [proton-go-api](https://github.com/ProtonMail/go-proton-api) 
        +and the web, iOS, and Android client codebases, we don't need to completely 
        +reverse engineer the APIs by observing the web client traffic! 
        +
        +[proton-go-api](https://github.com/ProtonMail/go-proton-api) provides the basic 
        +building blocks of API calls and error handling, such as 429 exponential 
        +back-off, but it is pretty much just a barebone interface to the Proton API. 
        +For example, the encryption and decryption of the Proton Drive file are not 
        +provided in this library. 
        +
        +The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on 
        +top of this quickly. This codebase handles the intricate tasks before and after 
        +calling Proton APIs, particularly the complex encryption scheme, allowing 
        +developers to implement features for other software on top of this codebase. 
        +There are likely quite a few errors in this library, as there isn't official 
        +documentation available.
        +
        +#  Seafile
        +
        +This is a backend for the [Seafile](https://www.seafile.com/) storage service:
        +- It works with both the free community edition or the professional edition.
        +- Seafile versions 6.x, 7.x, 8.x and 9.x are all supported.
        +- Encrypted libraries are also supported.
        +- It supports 2FA enabled users
        +- Using a Library API Token is **not** supported
        +
        +## Configuration
        +
        +There are two distinct modes you can setup your remote:
        +- you point your remote to the **root of the server**, meaning you don't specify a library during the configuration:
        +Paths are specified as `remote:library`. You may put subdirectories in too, e.g. `remote:library/path/to/dir`.
        +- you point your remote to a specific library during the configuration:
        +Paths are specified as `remote:path/to/dir`. **This is the recommended mode when using encrypted libraries**. (_This mode is possibly slightly faster than the root mode_)
        +
        +### Configuration in root mode
        +
        +Here is an example of making a seafile configuration for a user with **no** two-factor authentication.  First run
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process. To authenticate
        +you will need the URL of your server, your email (or username) and your password.
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> seafile Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Seafile  "seafile" [snip] Storage> seafile ** See help for seafile backend at: https://rclone.org/seafile/ **

        +

        URL of seafile host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to cloud.seafile.com  "https://cloud.seafile.com/" url> http://my.seafile.server/ User name (usually email address) Enter a string value. Press Enter for the default (""). user> me@example.com Password y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g> y Enter the password: password: Confirm the password: password: Two-factor authentication ('true' if the account has 2FA enabled) Enter a boolean value (true or false). Press Enter for the default ("false"). 2fa> false Name of the library. Leave blank to access all non-encrypted libraries. Enter a string value. Press Enter for the default (""). library> Library password (for encrypted libraries only). Leave blank if you pass it through the command line. y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g/n> n Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config Two-factor authentication is not enabled on this account. -------------------- [seafile] type = seafile url = http://my.seafile.server/ user = me@example.com pass = *** ENCRYPTED *** 2fa = false -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +This remote is called `seafile`. It's pointing to the root of your seafile server and can now be used like this:
        +
        +See all libraries
        +
        +    rclone lsd seafile:
        +
        +Create a new library
        +
        +    rclone mkdir seafile:library
        +
        +List the contents of a library
        +
        +    rclone ls seafile:library
        +
        +Sync `/home/local/directory` to the remote library, deleting any
        +excess files in the library.
        +
        +    rclone sync --interactive /home/local/directory seafile:library
        +
        +### Configuration in library mode
        +
        +Here's an example of a configuration in library mode with a user that has the two-factor authentication enabled. Your 2FA code will be asked at the end of the configuration, and will attempt to authenticate you:
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> seafile Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Seafile  "seafile" [snip] Storage> seafile ** See help for seafile backend at: https://rclone.org/seafile/ **

        +

        URL of seafile host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to cloud.seafile.com  "https://cloud.seafile.com/" url> http://my.seafile.server/ User name (usually email address) Enter a string value. Press Enter for the default (""). user> me@example.com Password y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g> y Enter the password: password: Confirm the password: password: Two-factor authentication ('true' if the account has 2FA enabled) Enter a boolean value (true or false). Press Enter for the default ("false"). 2fa> true Name of the library. Leave blank to access all non-encrypted libraries. Enter a string value. Press Enter for the default (""). library> My Library Library password (for encrypted libraries only). Leave blank if you pass it through the command line. y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g/n> n Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config Two-factor authentication: please enter your 2FA code 2fa code> 123456 Authenticating... Success! -------------------- [seafile] type = seafile url = http://my.seafile.server/ user = me@example.com pass = 2fa = true library = My Library -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +You'll notice your password is blank in the configuration. It's because we only need the password to authenticate you once.
        +
        +You specified `My Library` during the configuration. The root of the remote is pointing at the
        +root of the library `My Library`:
        +
        +See all files in the library:
        +
        +    rclone lsd seafile:
        +
        +Create a new directory inside the library
        +
        +    rclone mkdir seafile:directory
        +
        +List the contents of a directory
        +
        +    rclone ls seafile:directory
        +
        +Sync `/home/local/directory` to the remote library, deleting any
        +excess files in the library.
        +
        +    rclone sync --interactive /home/local/directory seafile:
        +
        +
        +### --fast-list
        +
        +Seafile version 7+ supports `--fast-list` which allows you to use fewer
        +transactions in exchange for more memory. See the [rclone
        +docs](https://rclone.org/docs/#fast-list) for more details.
        +Please note this is not supported on seafile server version 6.x
        +
        +
        +### Restricted filename characters
        +
        +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
        +the following characters are also replaced:
        +
        +| Character | Value | Replacement |
        +| --------- |:-----:|:-----------:|
        +| /         | 0x2F  | /          |
        +| "         | 0x22  | "          |
        +| \         | 0x5C  | \           |
        +
        +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
        +as they can't be used in JSON strings.
        +
        +### Seafile and rclone link
        +
        +Rclone supports generating share links for non-encrypted libraries only.
        +They can either be for a file or a directory:
        +
        +

        rclone link seafile:seafile-tutorial.doc http://my.seafile.server/f/fdcd8a2f93f84b8b90f4/

        +
        
        +or if run on a directory you will get:
        +
        +

        rclone link seafile:dir http://my.seafile.server/d/9ea2455f6f55478bbb0d/

        +
        
        +Please note a share link is unique for each file or directory. If you run a link command on a file/dir
        +that has already been shared, you will get the exact same link.
        +
        +### Compatibility
        +
        +It has been actively developed using the [seafile docker image](https://github.com/haiwen/seafile-docker) of these versions:
        +- 6.3.4 community edition
        +- 7.0.5 community edition
        +- 7.1.3 community edition
        +- 9.0.10 community edition
        +
        +Versions below 6.0 are not supported.
        +Versions between 6.0 and 6.3 haven't been tested and might not work properly.
        +
        +Each new version of `rclone` is automatically tested against the [latest docker image](https://hub.docker.com/r/seafileltd/seafile-mc/) of the seafile community server.
        +
        +
        +### Standard options
        +
        +Here are the Standard options specific to seafile (seafile).
        +
        +#### --seafile-url
        +
        +URL of seafile host to connect to.
        +
        +Properties:
        +
        +- Config:      url
        +- Env Var:     RCLONE_SEAFILE_URL
        +- Type:        string
        +- Required:    true
        +- Examples:
        +    - "https://cloud.seafile.com/"
        +        - Connect to cloud.seafile.com.
        +
        +#### --seafile-user
        +
        +User name (usually email address).
        +
        +Properties:
        +
        +- Config:      user
        +- Env Var:     RCLONE_SEAFILE_USER
        +- Type:        string
        +- Required:    true
        +
        +#### --seafile-pass
        +
        +Password.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      pass
        +- Env Var:     RCLONE_SEAFILE_PASS
        +- Type:        string
        +- Required:    false
        +
        +#### --seafile-2fa
        +
        +Two-factor authentication ('true' if the account has 2FA enabled).
        +
        +Properties:
        +
        +- Config:      2fa
        +- Env Var:     RCLONE_SEAFILE_2FA
        +- Type:        bool
        +- Default:     false
        +
        +#### --seafile-library
        +
        +Name of the library.
        +
        +Leave blank to access all non-encrypted libraries.
        +
        +Properties:
        +
        +- Config:      library
        +- Env Var:     RCLONE_SEAFILE_LIBRARY
        +- Type:        string
        +- Required:    false
        +
        +#### --seafile-library-key
        +
        +Library password (for encrypted libraries only).
        +
        +Leave blank if you pass it through the command line.
        +
        +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
        +
        +Properties:
        +
        +- Config:      library_key
        +- Env Var:     RCLONE_SEAFILE_LIBRARY_KEY
        +- Type:        string
        +- Required:    false
        +
        +#### --seafile-auth-token
        +
        +Authentication token.
        +
        +Properties:
        +
        +- Config:      auth_token
        +- Env Var:     RCLONE_SEAFILE_AUTH_TOKEN
        +- Type:        string
        +- Required:    false
        +
        +### Advanced options
        +
        +Here are the Advanced options specific to seafile (seafile).
        +
        +#### --seafile-create-library
        +
        +Should rclone create a library if it doesn't exist.
        +
        +Properties:
        +
        +- Config:      create_library
        +- Env Var:     RCLONE_SEAFILE_CREATE_LIBRARY
        +- Type:        bool
        +- Default:     false
        +
        +#### --seafile-encoding
        +
        +The encoding for the backend.
        +
        +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
        +
        +Properties:
        +
        +- Config:      encoding
        +- Env Var:     RCLONE_SEAFILE_ENCODING
        +- Type:        Encoding
        +- Default:     Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8
        +
        +
        +
        +#  SFTP
        +
        +SFTP is the [Secure (or SSH) File Transfer
        +Protocol](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol).
        +
        +The SFTP backend can be used with a number of different providers:
        +
        +
        +- Hetzner Storage Box
        +- rsync.net
        +
        +
        +SFTP runs over SSH v2 and is installed as standard with most modern
        +SSH installations.
        +
        +Paths are specified as `remote:path`. If the path does not begin with
        +a `/` it is relative to the home directory of the user.  An empty path
        +`remote:` refers to the user's home directory. For example, `rclone lsd remote:` 
        +would list the home directory of the user configured in the rclone remote config 
        +(`i.e /home/sftpuser`). However, `rclone lsd remote:/` would list the root 
        +directory for remote machine (i.e. `/`)
        +
        +Note that some SFTP servers will need the leading / - Synology is a
        +good example of this. rsync.net and Hetzner, on the other hand, requires users to
        +OMIT the leading /.
        +
        +Note that by default rclone will try to execute shell commands on
        +the server, see [shell access considerations](#shell-access-considerations).
        +
        +## Configuration
        +
        +Here is an example of making an SFTP configuration.  First run
        +
        +    rclone config
        +
        +This will guide you through an interactive setup process.
        +
        +

        No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / SSH/SFTP  "sftp" [snip] Storage> sftp SSH host to connect to Choose a number from below, or type in your own value 1 / Connect to example.com  "example.com" host> example.com SSH username Enter a string value. Press Enter for the default ("$USER"). user> sftpuser SSH port number Enter a signed integer. Press Enter for the default (22). port> SSH password, leave blank to use ssh-agent. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> n Path to unencrypted PEM-encoded private key file, leave blank to use ssh-agent. key_file> Remote config -------------------- [remote] host = example.com user = sftpuser port = pass = key_file = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

        +
        
        +This remote is called `remote` and can now be used like this:
        +
        +See all directories in the home directory
        +
        +    rclone lsd remote:
        +
        +See all directories in the root directory
        +
        +    rclone lsd remote:/
        +
        +Make a new directory
        +
        +    rclone mkdir remote:path/to/directory
        +
        +List the contents of a directory
        +
        +    rclone ls remote:path/to/directory
        +
        +Sync `/home/local/directory` to the remote directory, deleting any
        +excess files in the directory.
        +
        +    rclone sync --interactive /home/local/directory remote:directory
        +
        +Mount the remote path `/srv/www-data/` to the local path
        +`/mnt/www-data`
         
        -Name                 Type
        -====                 ====
        -putio                putio
        +    rclone mount remote:/srv/www-data/ /mnt/www-data
         
        -e) Edit existing remote
        -n) New remote
        -d) Delete remote
        -r) Rename remote
        -c) Copy remote
        -s) Set configuration password
        -q) Quit config
        -e/n/d/r/c/s/q> q
        -

        See the remote setup docs for how to set it up on a machine with no Internet browser available.

        -

        Note that rclone runs a webserver on your local machine to collect the token as returned from put.io if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this it may require you to unblock it temporarily if you are running a host firewall, or use manual mode.

        -

        You can then use it like this,

        -

        List directories in top level of your put.io

        -
        rclone lsd remote:
        -

        List all the files in your put.io

        -
        rclone ls remote:
        -

        To copy a local directory to a put.io directory called backup

        -
        rclone copy /home/source remote:backup
        -

        Restricted filename characters

        -

        In addition to the default restricted characters set the following characters are also replaced:

        - - - - - - - - - - - - - - - -
        CharacterValueReplacement
        \0x5C
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Advanced options

        -

        Here are the Advanced options specific to putio (Put.io).

        -

        --putio-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_PUTIO_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
        • -
        -

        Limitations

        -

        put.io has rate limiting. When you hit a limit, rclone automatically retries after waiting the amount of time requested by the server.

        -

        If you want to avoid ever hitting these limits, you may use the --tpslimit flag with a low number. Note that the imposed limits may be different for different operations, and may change over time.

        -

        Seafile

        -

        This is a backend for the Seafile storage service: - It works with both the free community edition or the professional edition. - Seafile versions 6.x, 7.x, 8.x and 9.x are all supported. - Encrypted libraries are also supported. - It supports 2FA enabled users - Using a Library API Token is not supported

        -

        Configuration

        -

        There are two distinct modes you can setup your remote: - you point your remote to the root of the server, meaning you don't specify a library during the configuration: Paths are specified as remote:library. You may put subdirectories in too, e.g. remote:library/path/to/dir. - you point your remote to a specific library during the configuration: Paths are specified as remote:path/to/dir. This is the recommended mode when using encrypted libraries. (This mode is possibly slightly faster than the root mode)

        -

        Configuration in root mode

        -

        Here is an example of making a seafile configuration for a user with no two-factor authentication. First run

        -
        rclone config
        -

        This will guide you through an interactive setup process. To authenticate you will need the URL of your server, your email (or username) and your password.

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> seafile
        -Type of storage to configure.
        -Enter a string value. Press Enter for the default ("").
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / Seafile
        -   \ "seafile"
        -[snip]
        -Storage> seafile
        -** See help for seafile backend at: https://rclone.org/seafile/ **
        +### SSH Authentication
         
        -URL of seafile host to connect to
        -Enter a string value. Press Enter for the default ("").
        -Choose a number from below, or type in your own value
        - 1 / Connect to cloud.seafile.com
        -   \ "https://cloud.seafile.com/"
        -url> http://my.seafile.server/
        -User name (usually email address)
        -Enter a string value. Press Enter for the default ("").
        -user> me@example.com
        -Password
        -y) Yes type in my own password
        -g) Generate random password
        -n) No leave this optional password blank (default)
        -y/g> y
        -Enter the password:
        -password:
        -Confirm the password:
        -password:
        -Two-factor authentication ('true' if the account has 2FA enabled)
        -Enter a boolean value (true or false). Press Enter for the default ("false").
        -2fa> false
        -Name of the library. Leave blank to access all non-encrypted libraries.
        -Enter a string value. Press Enter for the default ("").
        -library>
        -Library password (for encrypted libraries only). Leave blank if you pass it through the command line.
        -y) Yes type in my own password
        -g) Generate random password
        -n) No leave this optional password blank (default)
        -y/g/n> n
        -Edit advanced config? (y/n)
        -y) Yes
        -n) No (default)
        -y/n> n
        -Remote config
        -Two-factor authentication is not enabled on this account.
        ---------------------
        -[seafile]
        -type = seafile
        -url = http://my.seafile.server/
        -user = me@example.com
        -pass = *** ENCRYPTED ***
        -2fa = false
        ---------------------
        -y) Yes this is OK (default)
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -

        This remote is called seafile. It's pointing to the root of your seafile server and can now be used like this:

        -

        See all libraries

        -
        rclone lsd seafile:
        -

        Create a new library

        -
        rclone mkdir seafile:library
        -

        List the contents of a library

        -
        rclone ls seafile:library
        -

        Sync /home/local/directory to the remote library, deleting any excess files in the library.

        -
        rclone sync --interactive /home/local/directory seafile:library
        -

        Configuration in library mode

        -

        Here's an example of a configuration in library mode with a user that has the two-factor authentication enabled. Your 2FA code will be asked at the end of the configuration, and will attempt to authenticate you:

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> seafile
        -Type of storage to configure.
        -Enter a string value. Press Enter for the default ("").
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / Seafile
        -   \ "seafile"
        -[snip]
        -Storage> seafile
        -** See help for seafile backend at: https://rclone.org/seafile/ **
        +The SFTP remote supports three authentication methods:
         
        -URL of seafile host to connect to
        -Enter a string value. Press Enter for the default ("").
        -Choose a number from below, or type in your own value
        - 1 / Connect to cloud.seafile.com
        -   \ "https://cloud.seafile.com/"
        -url> http://my.seafile.server/
        -User name (usually email address)
        -Enter a string value. Press Enter for the default ("").
        -user> me@example.com
        -Password
        -y) Yes type in my own password
        -g) Generate random password
        -n) No leave this optional password blank (default)
        -y/g> y
        -Enter the password:
        -password:
        -Confirm the password:
        -password:
        -Two-factor authentication ('true' if the account has 2FA enabled)
        -Enter a boolean value (true or false). Press Enter for the default ("false").
        -2fa> true
        -Name of the library. Leave blank to access all non-encrypted libraries.
        -Enter a string value. Press Enter for the default ("").
        -library> My Library
        -Library password (for encrypted libraries only). Leave blank if you pass it through the command line.
        -y) Yes type in my own password
        -g) Generate random password
        -n) No leave this optional password blank (default)
        -y/g/n> n
        -Edit advanced config? (y/n)
        -y) Yes
        -n) No (default)
        -y/n> n
        -Remote config
        -Two-factor authentication: please enter your 2FA code
        -2fa code> 123456
        -Authenticating...
        -Success!
        ---------------------
        -[seafile]
        -type = seafile
        -url = http://my.seafile.server/
        -user = me@example.com
        -pass = 
        -2fa = true
        -library = My Library
        ---------------------
        -y) Yes this is OK (default)
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -

        You'll notice your password is blank in the configuration. It's because we only need the password to authenticate you once.

        -

        You specified My Library during the configuration. The root of the remote is pointing at the root of the library My Library:

        -

        See all files in the library:

        -
        rclone lsd seafile:
        -

        Create a new directory inside the library

        -
        rclone mkdir seafile:directory
        -

        List the contents of a directory

        -
        rclone ls seafile:directory
        -

        Sync /home/local/directory to the remote library, deleting any excess files in the library.

        -
        rclone sync --interactive /home/local/directory seafile:
        -

        --fast-list

        -

        Seafile version 7+ supports --fast-list which allows you to use fewer transactions in exchange for more memory. See the rclone docs for more details. Please note this is not supported on seafile server version 6.x

        -

        Restricted filename characters

        -

        In addition to the default restricted characters set the following characters are also replaced:

        - - - - - - - - - - - - - - - - - - - - - - - - - -
        CharacterValueReplacement
        /0x2F
        "0x22
        \0x5C
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        - -

        Rclone supports generating share links for non-encrypted libraries only. They can either be for a file or a directory:

        -
        rclone link seafile:seafile-tutorial.doc
        -http://my.seafile.server/f/fdcd8a2f93f84b8b90f4/
        +  * Password
        +  * Key file, including certificate signed keys
        +  * ssh-agent
        +
        +Key files should be PEM-encoded private key files. For instance `/home/$USER/.ssh/id_rsa`.
        +Only unencrypted OpenSSH or PEM encrypted files are supported.
        +
        +The key file can be specified in either an external file (key_file) or contained within the 
        +rclone config file (key_pem).  If using key_pem in the config file, the entry should be on a
        +single line with new line ('\n' or '\r\n') separating lines.  i.e.
        +
        +    key_pem = -----BEGIN RSA PRIVATE KEY-----\nMaMbaIXtE\n0gAMbMbaSsd\nMbaass\n-----END RSA PRIVATE KEY-----
        +
        +This will generate it correctly for key_pem for use in the config:
        +
        +    awk '{printf "%s\\n", $0}' < ~/.ssh/id_rsa
        +
        +If you don't specify `pass`, `key_file`, or `key_pem` or `ask_password` then
        +rclone will attempt to contact an ssh-agent. You can also specify `key_use_agent`
        +to force the usage of an ssh-agent. In this case `key_file` or `key_pem` can
        +also be specified to force the usage of a specific key in the ssh-agent.
        +
        +Using an ssh-agent is the only way to load encrypted OpenSSH keys at the moment.
        +
        +If you set the `ask_password` option, rclone will prompt for a password when
        +needed and no password has been configured.
        +
        +#### Certificate-signed keys
        +
        +With traditional key-based authentication, you configure your private key only,
        +and the public key built into it will be used during the authentication process.
        +
        +If you have a certificate you may use it to sign your public key, creating a
        +separate SSH user certificate that should be used instead of the plain public key
        +extracted from the private key. Then you must provide the path to the
        +user certificate public key file in `pubkey_file`.
        +
        +Note: This is not the traditional public key paired with your private key,
        +typically saved as `/home/$USER/.ssh/id_rsa.pub`. Setting this path in
        +`pubkey_file` will not work.
        +
        +Example:
         
        -

        or if run on a directory you will get:

        -
        rclone link seafile:dir
        -http://my.seafile.server/d/9ea2455f6f55478bbb0d/
        -

        Please note a share link is unique for each file or directory. If you run a link command on a file/dir that has already been shared, you will get the exact same link.

        -

        Compatibility

        -

        It has been actively developed using the seafile docker image of these versions: - 6.3.4 community edition - 7.0.5 community edition - 7.1.3 community edition - 9.0.10 community edition

        -

        Versions below 6.0 are not supported. Versions between 6.0 and 6.3 haven't been tested and might not work properly.

        -

        Each new version of rclone is automatically tested against the latest docker image of the seafile community server.

        -

        Standard options

        -

        Here are the Standard options specific to seafile (seafile).

        -

        --seafile-url

        -

        URL of seafile host to connect to.

        -

        Properties:

        -
          -
        • Config: url
        • -
        • Env Var: RCLONE_SEAFILE_URL
        • -
        • Type: string
        • -
        • Required: true
        • -
        • Examples: -
            -
          • "https://cloud.seafile.com/" -
              -
            • Connect to cloud.seafile.com.
            • -
          • -
        • -
        -

        --seafile-user

        -

        User name (usually email address).

        -

        Properties:

        -
          -
        • Config: user
        • -
        • Env Var: RCLONE_SEAFILE_USER
        • -
        • Type: string
        • -
        • Required: true
        • -
        -

        --seafile-pass

        -

        Password.

        -

        NB Input to this must be obscured - see rclone obscure.

        -

        Properties:

        -
          -
        • Config: pass
        • -
        • Env Var: RCLONE_SEAFILE_PASS
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --seafile-2fa

        -

        Two-factor authentication ('true' if the account has 2FA enabled).

        -

        Properties:

        -
          -
        • Config: 2fa
        • -
        • Env Var: RCLONE_SEAFILE_2FA
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --seafile-library

        -

        Name of the library.

        -

        Leave blank to access all non-encrypted libraries.

        -

        Properties:

        -
          -
        • Config: library
        • -
        • Env Var: RCLONE_SEAFILE_LIBRARY
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --seafile-library-key

        -

        Library password (for encrypted libraries only).

        -

        Leave blank if you pass it through the command line.

        -

        NB Input to this must be obscured - see rclone obscure.

        -

        Properties:

        -
          -
        • Config: library_key
        • -
        • Env Var: RCLONE_SEAFILE_LIBRARY_KEY
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        --seafile-auth-token

        -

        Authentication token.

        -

        Properties:

        -
          -
        • Config: auth_token
        • -
        • Env Var: RCLONE_SEAFILE_AUTH_TOKEN
        • -
        • Type: string
        • -
        • Required: false
        • -
        -

        Advanced options

        -

        Here are the Advanced options specific to seafile (seafile).

        -

        --seafile-create-library

        -

        Should rclone create a library if it doesn't exist.

        -

        Properties:

        -
          -
        • Config: create_library
        • -
        • Env Var: RCLONE_SEAFILE_CREATE_LIBRARY
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --seafile-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        -
          -
        • Config: encoding
        • -
        • Env Var: RCLONE_SEAFILE_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8
        • -
        -

        SFTP

        -

        SFTP is the Secure (or SSH) File Transfer Protocol.

        -

        The SFTP backend can be used with a number of different providers:

        -
          -
        • Hetzner Storage Box
        • -
        • rsync.net
        • -
        -

        SFTP runs over SSH v2 and is installed as standard with most modern SSH installations.

        -

        Paths are specified as remote:path. If the path does not begin with a / it is relative to the home directory of the user. An empty path remote: refers to the user's home directory. For example, rclone lsd remote: would list the home directory of the user configured in the rclone remote config (i.e /home/sftpuser). However, rclone lsd remote:/ would list the root directory for remote machine (i.e. /)

        -

        Note that some SFTP servers will need the leading / - Synology is a good example of this. rsync.net and Hetzner, on the other hand, requires users to OMIT the leading /.

        -

        Note that by default rclone will try to execute shell commands on the server, see shell access considerations.

        -

        Configuration

        -

        Here is an example of making an SFTP configuration. First run

        -
        rclone config
        -

        This will guide you through an interactive setup process.

        -
        No remotes found, make a new one?
        -n) New remote
        -s) Set configuration password
        -q) Quit config
        -n/s/q> n
        -name> remote
        -Type of storage to configure.
        -Choose a number from below, or type in your own value
        -[snip]
        -XX / SSH/SFTP
        -   \ "sftp"
        -[snip]
        -Storage> sftp
        -SSH host to connect to
        -Choose a number from below, or type in your own value
        - 1 / Connect to example.com
        -   \ "example.com"
        -host> example.com
        -SSH username
        -Enter a string value. Press Enter for the default ("$USER").
        -user> sftpuser
        -SSH port number
        -Enter a signed integer. Press Enter for the default (22).
        -port>
        -SSH password, leave blank to use ssh-agent.
        -y) Yes type in my own password
        -g) Generate random password
        -n) No leave this optional password blank
        -y/g/n> n
        -Path to unencrypted PEM-encoded private key file, leave blank to use ssh-agent.
        -key_file>
        -Remote config
        ---------------------
        +

        [remote] type = sftp host = example.com user = sftpuser key_file = ~/id_rsa pubkey_file = ~/id_rsa-cert.pub

        +
        
        +If you concatenate a cert with a private key then you can specify the
        +merged file in both places.
        +
        +Note: the cert must come first in the file.  e.g.
        +
        +```
        +cat id_rsa-cert.pub id_rsa > merged_key
        +```
        +
        +### Host key validation
        +
        +By default rclone will not check the server's host key for validation.  This
        +can allow an attacker to replace a server with their own and if you use
        +password authentication then this can lead to that password being exposed.
        +
        +Host key matching, using standard `known_hosts` files can be turned on by
        +enabling the `known_hosts_file` option.  This can point to the file maintained
        +by `OpenSSH` or can point to a unique file.
        +
        +e.g. using the OpenSSH `known_hosts` file:
        +
        +```
         [remote]
        -host = example.com
        -user = sftpuser
        -port =
        -pass =
        -key_file =
        ---------------------
        -y) Yes this is OK
        -e) Edit this remote
        -d) Delete this remote
        -y/e/d> y
        -

        This remote is called remote and can now be used like this:

        -

        See all directories in the home directory

        -
        rclone lsd remote:
        -

        See all directories in the root directory

        -
        rclone lsd remote:/
        -

        Make a new directory

        -
        rclone mkdir remote:path/to/directory
        -

        List the contents of a directory

        -
        rclone ls remote:path/to/directory
        -

        Sync /home/local/directory to the remote directory, deleting any excess files in the directory.

        -
        rclone sync --interactive /home/local/directory remote:directory
        -

        Mount the remote path /srv/www-data/ to the local path /mnt/www-data

        -
        rclone mount remote:/srv/www-data/ /mnt/www-data
        -

        SSH Authentication

        -

        The SFTP remote supports three authentication methods:

        -
          -
        • Password
        • -
        • Key file, including certificate signed keys
        • -
        • ssh-agent
        • -
        -

        Key files should be PEM-encoded private key files. For instance /home/$USER/.ssh/id_rsa. Only unencrypted OpenSSH or PEM encrypted files are supported.

        -

        The key file can be specified in either an external file (key_file) or contained within the rclone config file (key_pem). If using key_pem in the config file, the entry should be on a single line with new line ('' or '') separating lines. i.e.

        -
        key_pem = -----BEGIN RSA PRIVATE KEY-----\nMaMbaIXtE\n0gAMbMbaSsd\nMbaass\n-----END RSA PRIVATE KEY-----
        -

        This will generate it correctly for key_pem for use in the config:

        -
        awk '{printf "%s\\n", $0}' < ~/.ssh/id_rsa
        -

        If you don't specify pass, key_file, or key_pem or ask_password then rclone will attempt to contact an ssh-agent. You can also specify key_use_agent to force the usage of an ssh-agent. In this case key_file or key_pem can also be specified to force the usage of a specific key in the ssh-agent.

        -

        Using an ssh-agent is the only way to load encrypted OpenSSH keys at the moment.

        -

        If you set the ask_password option, rclone will prompt for a password when needed and no password has been configured.

        -

        Certificate-signed keys

        -

        With traditional key-based authentication, you configure your private key only, and the public key built into it will be used during the authentication process.

        -

        If you have a certificate you may use it to sign your public key, creating a separate SSH user certificate that should be used instead of the plain public key extracted from the private key. Then you must provide the path to the user certificate public key file in pubkey_file.

        -

        Note: This is not the traditional public key paired with your private key, typically saved as /home/$USER/.ssh/id_rsa.pub. Setting this path in pubkey_file will not work.

        -

        Example:

        -
        [remote]
        -type = sftp
        -host = example.com
        -user = sftpuser
        -key_file = ~/id_rsa
        -pubkey_file = ~/id_rsa-cert.pub
        -

        If you concatenate a cert with a private key then you can specify the merged file in both places.

        -

        Note: the cert must come first in the file. e.g.

        -
        cat id_rsa-cert.pub id_rsa > merged_key
        -

        Host key validation

        -

        By default rclone will not check the server's host key for validation. This can allow an attacker to replace a server with their own and if you use password authentication then this can lead to that password being exposed.

        -

        Host key matching, using standard known_hosts files can be turned on by enabling the known_hosts_file option. This can point to the file maintained by OpenSSH or can point to a unique file.

        -

        e.g. using the OpenSSH known_hosts file:

        -
        [remote]
         type = sftp
         host = example.com
         user = sftpuser
        @@ -27215,21 +33514,21 @@ 

        Shell access

        Shell access considerations

        The shell type auto-detection logic, described above, means that by default rclone will try to run a shell command the first time a new sftp remote is accessed. If you configure a sftp remote without a config file, e.g. an on the fly remote, rclone will have nowhere to store the result, and it will re-run the command on every access. To avoid this you should explicitly set the shell_type option to the correct value, or to none if you want to prevent rclone from executing any remote shell commands.

        It is also important to note that, since the shell type decides how quoting and escaping of file paths used as command-line arguments are performed, configuring the wrong shell type may leave you exposed to command injection exploits. Make sure to confirm the auto-detected shell type, or explicitly set the shell type you know is correct, or disable shell access until you know.

        -

        Checksum

        +

        Checksum

        SFTP does not natively support checksums (file hash), but rclone is able to use checksumming if the same login has shell access, and can execute remote commands. If there is a command that can calculate compatible checksums on the remote system, Rclone can then be configured to execute this whenever a checksum is needed, and read back the results. Currently MD5 and SHA-1 are supported.

        Normally this requires an external utility being available on the server. By default rclone will try commands md5sum, md5 and rclone md5sum for MD5 checksums, and the first one found usable will be picked. Same with sha1sum, sha1 and rclone sha1sum commands for SHA-1 checksums. These utilities normally need to be in the remote's PATH to be found.

        In some cases the shell itself is capable of calculating checksums. PowerShell is an example of such a shell. If rclone detects that the remote shell is PowerShell, which means it most probably is a Windows OpenSSH server, rclone will use a predefined script block to produce the checksums when no external checksum commands are found (see shell access). This assumes PowerShell version 4.0 or newer.

        The options md5sum_command and sha1_command can be used to customize the command to be executed for calculation of checksums. You can for example set a specific path to where md5sum and sha1sum executables are located, or use them to specify some other tools that print checksums in compatible format. The value can include command-line arguments, or even shell script blocks as with PowerShell. Rclone has subcommands md5sum and sha1sum that use compatible format, which means if you have an rclone executable on the server it can be used. As mentioned above, they will be automatically picked up if found in PATH, but if not you can set something like /path/to/rclone md5sum as the value of option md5sum_command to make sure a specific executable is used.

        Remote checksumming is recommended and enabled by default. First time rclone is using a SFTP remote, if options md5sum_command or sha1_command are not set, it will check if any of the default commands for each of them, as described above, can be used. The result will be saved in the remote configuration, so next time it will use the same. Value none will be set if none of the default commands could be used for a specific algorithm, and this algorithm will not be supported by the remote.

        Disabling the checksumming may be required if you are connecting to SFTP servers which are not under your control, and to which the execution of remote shell commands is prohibited. Set the configuration option disable_hashcheck to true to disable checksumming entirely, or set shell_type to none to disable all functionality based on remote shell command execution.

        -

        Modified time

        +

        Modification times and hashes

        Modified times are stored on the server to 1 second precision.

        Modified times are used in syncing and are fully supported.

        Some SFTP servers disable setting/modifying the file modification time after upload (for example, certain configurations of ProFTPd with mod_sftp). If you are using one of these servers, you can set the option set_modtime = false in your RClone backend configuration to disable this behaviour.

        About command

        The about command returns the total space, free space, and used space on the remote for the disk of the specified path on the remote or, if not set, the disk of the root on the remote.

        SFTP usually supports the about command, but it depends on the server. If the server implements the vendor-specific VFS statistics extension, which is normally the case with OpenSSH instances, it will be used. If not, but the same login has access to a Unix shell, where the df command is available (e.g. in the remote's PATH), then this will be used instead. If the server shell is PowerShell, probably with a Windows OpenSSH server, rclone will use a built-in shell command (see shell access). If none of the above is applicable, about will fail.

        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to sftp (SSH/SFTP).

        --sftp-host

        SSH host to connect to.

        @@ -27363,7 +33662,24 @@

        --sftp-disable-hashcheck

      11. Type: bool
      12. Default: false
      13. -

        Advanced options

        +

        --sftp-ssh

        +

        Path and arguments to external ssh binary.

        +

        Normally rclone will use its internal ssh library to connect to the SFTP server. However it does not implement all possible ssh options so it may be desirable to use an external ssh binary.

        +

        Rclone ignores all the internal config if you use this option and expects you to configure the ssh binary with the user/host/port and any other options you need.

        +

        Important The ssh command must log in without asking for a password so needs to be configured with keys or certificates.

        +

        Rclone will run the command supplied either with the additional arguments "-s sftp" to access the SFTP subsystem or with commands such as "md5sum /path/to/file" appended to read checksums.

        +

        Any arguments with spaces in should be surrounded by "double quotes".

        +

        An example setting might be:

        +
        ssh -o ServerAliveInterval=20 user@example.com
        +

        Note that when using an external ssh binary rclone makes a new ssh connection for every hash it calculates.

        +

        Properties:

        +
          +
        • Config: ssh
        • +
        • Env Var: RCLONE_SFTP_SSH
        • +
        • Type: SpaceSepList
        • +
        • Default:
        • +
        +

        Advanced options

        Here are the Advanced options specific to sftp (SSH/SFTP).

        --sftp-known-hosts-file

        Optional path to known_hosts file.

        @@ -27400,6 +33716,12 @@

        --sftp-path-override

        rclone sync /home/local/directory remote:/directory --sftp-path-override /volume2/directory

        E.g. if home directory can be found in a shared folder called "home":

        rclone sync /home/local/directory remote:/home/directory --sftp-path-override /volume1/homes/USER/directory
        +

        To specify only the path to the SFTP remote's root, and allow rclone to add any relative subpaths automatically (including unwrapping/decrypting remotes as necessary), add the '@' character to the beginning of the path.

        +

        E.g. the first example above could be rewritten as:

        +
        rclone sync /home/local/directory remote:/directory --sftp-path-override @/volume2
        +

        Note that when using this method with Synology "home" folders, the full "/homes/USER" path should be specified instead of "/home".

        +

        E.g. the second example above should be rewritten as:

        +
        rclone sync /home/local/directory remote:/homes/USER/directory --sftp-path-override @/volume1

        Properties:

        • Config: path_override
        • @@ -27486,6 +33808,11 @@

          --sftp-subsystem

          --sftp-server-command

          Specifies the path or command to run a sftp server on the remote host.

          The subsystem option is ignored when server_command is defined.

          +

          If adding server_command to the configuration file please note that it should not be enclosed in quotes, since that will make rclone fail.

          +

          A working example is:

          +
          [remote_name]
          +type = sftp
          +server_command = sudo /usr/libexec/openssh/sftp-server

          Properties:

          • Config: server_command
          • @@ -27568,7 +33895,7 @@

            --sftp-set-env

            to be passed to the sftp client and to any commands run (eg md5sum).

            Pass multiple variables space separated, eg

            VAR1=value VAR2=value
            -

            and pass variables with spaces in in quotes, eg

            +

            and pass variables with spaces in quotes, eg

            "VAR3=value with space" "VAR4=value with space" VAR5=nospacehere

            Properties:

              @@ -27615,7 +33942,46 @@

              --sftp-macs

            • Type: SpaceSepList
            • Default:
            -

            Limitations

            +

            --sftp-host-key-algorithms

            +

            Space separated list of host key algorithms, ordered by preference.

            +

            At least one must match with server configuration. This can be checked for example using ssh -Q HostKeyAlgorithms.

            +

            Note: This can affect the outcome of key negotiation with the server even if server host key validation is not enabled.

            +

            Example:

            +
            ssh-ed25519 ssh-rsa ssh-dss
            +

            Properties:

            +
              +
            • Config: host_key_algorithms
            • +
            • Env Var: RCLONE_SFTP_HOST_KEY_ALGORITHMS
            • +
            • Type: SpaceSepList
            • +
            • Default:
            • +
            +

            --sftp-socks-proxy

            +

            Socks 5 proxy host.

            +

            Supports the format user:pass@host:port, user@host:port, host:port.

            +

            Example:

            +
            myUser:myPass@localhost:9005
            +

            Properties:

            +
              +
            • Config: socks_proxy
            • +
            • Env Var: RCLONE_SFTP_SOCKS_PROXY
            • +
            • Type: string
            • +
            • Required: false
            • +
            + +

            Set to enable server side copies using hardlinks.

            +

            The SFTP protocol does not define a copy command so normally server side copies are not allowed with the sftp backend.

            +

            However the SFTP protocol does support hardlinking, and if you enable this flag then the sftp backend will support server side copies. These will be implemented by doing a hardlink from the source to the destination.

            +

            Not all sftp servers support this.

            +

            Note that hardlinking two files together will use no additional space as the source and the destination will be the same file.

            +

            This feature may be useful backups made with --copy-dest.

            +

            Properties:

            +
              +
            • Config: copy_is_hardlink
            • +
            • Env Var: RCLONE_SFTP_COPY_IS_HARDLINK
            • +
            • Type: bool
            • +
            • Default: false
            • +
            +

            Limitations

            On some SFTP servers (e.g. Synology) the paths are different for SSH and SFTP so the hashes can't be calculated properly. For them using disable_hashcheck is a good idea.

            The only ssh agent supported under Windows is Putty's pageant.

            The Go SSH library disables the use of the aes128-cbc cipher by default, due to security concerns. This can be re-enabled on a per-connection basis by setting the use_insecure_cipher setting in the configuration file to true. Further details on the insecurity of this cipher can be found in this paper.

            @@ -27632,11 +33998,11 @@

            SMB

            SMB is a communication protocol to share files over network.

            This relies on go-smb2 library for communication with SMB protocol.

            Paths are specified as remote:sharename (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:item/path/to/dir.

            -

            Notes

            -

            The first path segment must be the name of the share, which you entered when you started to share on Windows. On smbd, it's the section title in smb.conf (usually in /etc/samba/) file. You can find shares by quering the root if you're unsure (e.g. rclone lsd remote:).

            +

            Notes

            +

            The first path segment must be the name of the share, which you entered when you started to share on Windows. On smbd, it's the section title in smb.conf (usually in /etc/samba/) file. You can find shares by querying the root if you're unsure (e.g. rclone lsd remote:).

            You can't access to the shared printers from rclone, obviously.

            You can't use Anonymous access for logging in. You have to use the guest user with an empty password instead. The rclone client tries to avoid 8.3 names when uploading files by encoding trailing spaces and periods. Alternatively, the local backend on Windows can access SMB servers using UNC paths, by \\server\share. This doesn't apply to non-Windows OSes, such as Linux and macOS.

            -

            Configuration

            +

            Configuration

            Here is an example of making a SMB configuration.

            First run

            rclone config
            @@ -27711,7 +34077,7 @@

            Configuration

            e) Edit this remote d) Delete this remote y/e/d> d
        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to smb (SMB / CIFS).

        --smb-host

        SMB server hostname to connect to.

        @@ -27772,7 +34138,7 @@

        --smb-spn

      14. Type: string
      15. Required: false
      16. -

        Advanced options

        +

        Advanced options

        Here are the Advanced options specific to smb (SMB / CIFS).

        --smb-idle-timeout

        Max time before closing idle connections.

        @@ -27811,7 +34177,7 @@

        --smb-encoding

        • Config: encoding
        • Env Var: RCLONE_SMB_ENCODING
        • -
        • Type: MultiEncoder
        • +
        • Type: Encoding
        • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot

        Storj

        @@ -27873,7 +34239,7 @@

        Backend options

      17. S3 backend: secret encryption key is shared with the gateway
      18. -

        Configuration

        +

        Configuration

        To make a new Storj configuration you need one of the following: * Access Grant that someone else shared with you. * API Key of a Storj project you are a member of.

        Here is an example of how to make a remote called remote. First run:

         rclone config
        @@ -27970,7 +34336,7 @@

        Setup with API key and passphrase

        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to storj (Storj Decentralized Cloud Storage).

        --storj-provider

        Choose an authentication method.

        @@ -28049,7 +34415,7 @@

        --storj-passphrase

      19. Type: string
      20. Required: false
      21. -

        Usage

        +

        Usage

        Paths are specified as remote:bucket (or remote: for the lsf command.) You may put subdirectories in too, e.g. remote:bucket/path/to/dir.

        Once configured you can then use rclone like this.

        Create a new bucket

        @@ -28103,15 +34469,15 @@

        Sync two Locations

        rclone sync --interactive --progress remote-us:bucket/path/to/dir/ remote-europe:bucket/path/to/dir/

        Or even between another cloud storage and Storj.

        rclone sync --interactive --progress s3:bucket/path/to/dir/ storj:bucket/path/to/dir/
        -

        Limitations

        +

        Limitations

        rclone about is not supported by the rclone Storj backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

        See List of backends that do not support rclone about and rclone about

        -

        Known issues

        +

        Known issues

        If you get errors like too many open files this usually happens when the default ulimit for system max open files is exceeded. Native Storj protocol opens a large number of TCP connections (each of which is counted as an open file). For a single upload stream you can expect 110 TCP connections to be opened. For a single download stream you can expect 35. This batch of connections will be opened for every 64 MiB segment and you should also expect TCP connections to be reused. If you do many transfers you eventually open a connection to most storage nodes (thousands of nodes).

        To fix these, please raise your system limits. You can do this issuing a ulimit -n 65536 just before you run rclone. To change the limits more permanently you can add this to your shell startup script, e.g. $HOME/.bashrc, or change the system-wide configuration, usually /etc/sysctl.conf and/or /etc/security/limits.conf, but please refer to your operating system manual.

        SugarSync

        SugarSync is a cloud service that enables active synchronization of files across computers and other devices for file backup, access, syncing, and sharing.

        -

        Configuration

        +

        Configuration

        The initial setup for SugarSync involves getting a token from SugarSync which you can do with rclone. rclone config walks you through it.

        Here is an example of how to make a remote called remote. First run:

         rclone config
        @@ -28176,15 +34542,15 @@

        Configuration

        Paths are specified as remote:path

        Paths may be as deep as required, e.g. remote:directory/subdirectory.

        NB you can't create files in the top level folder you have to create a folder, which rclone will create as a "Sync Folder" with SugarSync.

        -

        Modified time and hashes

        +

        Modification times and hashes

        SugarSync does not support modification times or hashes, therefore syncing will default to --size-only checking. Note that using --update will work as rclone can read the time files were uploaded.

        -

        Restricted filename characters

        +

        Restricted filename characters

        SugarSync replaces the default restricted characters set except for DEL.

        Invalid UTF-8 bytes will also be replaced, as they can't be used in XML strings.

        -

        Deleting files

        +

        Deleting files

        Deleted files will be moved to the "Deleted items" folder by default.

        However you can supply the flag --sugarsync-hard-delete or set the config parameter hard_delete = true if you would like files to be deleted straight away.

        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to sugarsync (Sugarsync).

        --sugarsync-app-id

        Sugarsync App ID.

        @@ -28225,7 +34591,7 @@

        --sugarsync-hard-delete

      22. Type: bool
      23. Default: false
      24. -

        Advanced options

        +

        Advanced options

        Here are the Advanced options specific to sugarsync (Sugarsync).

        --sugarsync-refresh-token

        Sugarsync refresh token.

        @@ -28294,10 +34660,10 @@

        --sugarsync-encoding

        • Config: encoding
        • Env Var: RCLONE_SUGARSYNC_ENCODING
        • -
        • Type: MultiEncoder
        • +
        • Type: Encoding
        • Default: Slash,Ctl,InvalidUtf8,Dot
        -

        Limitations

        +

        Limitations

        rclone about is not supported by the SugarSync backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

        See List of backends that do not support rclone about and rclone about

        Tardigrade

        @@ -28306,7 +34672,7 @@

        Uptobox

        This is a Backend for Uptobox file storage service. Uptobox is closer to a one-click hoster than a traditional cloud storage provider and therefore not suitable for long term storage.

        Paths are specified as remote:path

        Paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Configuration

        +

        Configuration

        To configure an Uptobox backend you'll need your personal api token. You'll find it in your account settings

        Here is an example of how to make a remote called remote with the default setup. First run:

        rclone config
        @@ -28360,9 +34726,9 @@

        Configuration

        rclone ls remote:

        To copy a local directory to an Uptobox directory called backup

        rclone copy /home/source remote:backup
        -

        Modified time and hashes

        -

        Uptobox supports neither modified times nor checksums.

        -

        Restricted filename characters

        +

        Modification times and hashes

        +

        Uptobox supports neither modified times nor checksums. All timestamps will read as that set by --default-time.

        +

        Restricted filename characters

        In addition to the default restricted characters set the following characters are also replaced:

        @@ -28386,7 +34752,7 @@

        Restricted filename characters

        Invalid UTF-8 bytes will also be replaced, as they can't be used in XML strings.

        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to uptobox (Uptobox).

        --uptobox-access-token

        Your access token.

        @@ -28398,8 +34764,17 @@

        --uptobox-access-token

      25. Type: string
      26. Required: false
      27. -

        Advanced options

        +

        Advanced options

        Here are the Advanced options specific to uptobox (Uptobox).

        +

        --uptobox-private

        +

        Set to make uploaded files private

        +

        Properties:

        +
          +
        • Config: private
        • +
        • Env Var: RCLONE_UPTOBOX_PRIVATE
        • +
        • Type: bool
        • +
        • Default: false
        • +

        --uptobox-encoding

        The encoding for the backend.

        See the encoding section in the overview for more info.

        @@ -28407,20 +34782,24 @@

        --uptobox-encoding

        • Config: encoding
        • Env Var: RCLONE_UPTOBOX_ENCODING
        • -
        • Type: MultiEncoder
        • +
        • Type: Encoding
        • Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot
        -

        Limitations

        +

        Limitations

        Uptobox will delete inactive files that have not been accessed in 60 days.

        rclone about is not supported by this backend an overview of used space can however been seen in the uptobox web interface.

        Union

        -

        The union remote provides a unification similar to UnionFS using other remotes.

        -

        Paths may be as deep as required or a local path, e.g. remote:directory/subdirectory or /directory/subdirectory.

        +

        The union backend joins several remotes together to make a single unified view of them.

        During the initial setup with rclone config you will specify the upstream remotes as a space separated list. The upstream remotes can either be a local paths or other remotes.

        -

        Attribute :ro and :nc can be attach to the end of path to tag the remote as read only or no create, e.g. remote:directory/subdirectory:ro or remote:directory/subdirectory:nc.

        +

        The attributes :ro, :nc and :writeback can be attached to the end of the remote to tag the remote as read only, no create or writeback, e.g. remote:directory/subdirectory:ro or remote:directory/subdirectory:nc.

        +
          +
        • :ro means files will only be read from here and never written
        • +
        • :nc means new files or directories won't be created here
        • +
        • :writeback means files found in different remotes will be written back here. See the writeback section for more info.
        • +

        Subfolders can be used in upstream remotes. Assume a union remote named backup with the remotes mydrive:private/backup. Invoking rclone mkdir backup:desktop is exactly the same as invoking rclone mkdir mydrive:private/backup/desktop.

        -

        There will be no special handling of paths containing .. segments. Invoking rclone mkdir backup:../desktop is exactly the same as invoking rclone mkdir mydrive:private/backup/../desktop.

        -

        Configuration

        +

        There is no special handling of paths containing .. segments. Invoking rclone mkdir backup:../desktop is exactly the same as invoking rclone mkdir mydrive:private/backup/../desktop.

        +

        Configuration

        Here is an example of how to make a union called remote for local folders. First run:

         rclone config

        This will guide you through an interactive setup process:

        @@ -28641,7 +35020,19 @@

        Policy descriptions

        -

        Standard options

        +

        Writeback

        +

        The tag :writeback on an upstream remote can be used to make a simple cache system like this:

        +
        [union]
        +type = union
        +action_policy = all
        +create_policy = all
        +search_policy = ff
        +upstreams = /local:writeback remote:dir
        +

        When files are opened for read, if the file is in remote:dir but not /local then rclone will copy the file entirely into /local before returning a reference to the file in /local. The copy will be done with the equivalent of rclone copy so will use --multi-thread-streams if configured. Any copies will be logged with an INFO log.

        +

        When files are written, they will be written to both remote:dir and /local.

        +

        As many remotes as desired can be added to upstreams but there should only be one :writeback tag.

        +

        Rclone does not manage the :writeback remote in any way other than writing files back to it. So if you need to expire old files or manage the size then you will have to do this yourself.

        +

        Standard options

        Here are the Standard options specific to union (Union merges the contents of several upstream fs).

        --union-upstreams

        List of space separated upstreams.

        @@ -28690,7 +35081,7 @@

        --union-cache-time

      28. Type: int
      29. Default: 120
      30. -

        Advanced options

        +

        Advanced options

        Here are the Advanced options specific to union (Union merges the contents of several upstream fs).

        --union-min-free-space

        Minimum viable free space for lfs/eplfs policies.

        @@ -28702,13 +35093,13 @@

        --union-min-free-space

      31. Type: SizeSuffix
      32. Default: 1Gi
      33. -

        Metadata

        +

        Metadata

        Any metadata supported by the underlying remote is read and written.

        See the metadata docs for more info.

        WebDAV

        Paths are specified as remote:path

        Paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Configuration

        +

        Configuration

        To configure the WebDAV remote you will need to have a URL for it, and a username and password. If you know what kind of system you are connecting to then rclone can enable extra features.

        Here is an example of how to make a remote called remote. First run:

         rclone config
        @@ -28733,17 +35124,21 @@

        Configuration

        url> https://example.com/remote.php/webdav/ Name of the WebDAV site/service/software you are using Choose a number from below, or type in your own value - 1 / Nextcloud - \ "nextcloud" - 2 / Owncloud - \ "owncloud" - 3 / Sharepoint Online, authenticated by Microsoft account. - \ "sharepoint" - 4 / Sharepoint with NTLM authentication. Usually self-hosted or on-premises. - \ "sharepoint-ntlm" - 5 / Other site/service or software - \ "other" -vendor> 1 + 1 / Fastmail Files + \ (fastmail) + 2 / Nextcloud + \ (nextcloud) + 3 / Owncloud + \ (owncloud) + 4 / Sharepoint Online, authenticated by Microsoft account + \ (sharepoint) + 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises + \ (sharepoint-ntlm) + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \ (rclone) + 7 / Other site/service or software + \ (other) +vendor> 2 User name user> user Password. @@ -28778,10 +35173,10 @@

        Configuration

        rclone ls remote:

        To copy a local directory to an WebDAV directory called backup

        rclone copy /home/source remote:backup
        -

        Modified time and hashes

        -

        Plain WebDAV does not support modified times. However when used with Owncloud or Nextcloud rclone will support modified times.

        -

        Likewise plain WebDAV does not support hashes, however when used with Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. Depending on the exact version of Owncloud or Nextcloud hashes may appear on all objects, or only on objects which had a hash uploaded with them.

        -

        Standard options

        +

        Modification times and hashes

        +

        Plain WebDAV does not support modified times. However when used with Fastmail Files, Owncloud or Nextcloud rclone will support modified times.

        +

        Likewise plain WebDAV does not support hashes, however when used with Fastmail Files, Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. Depending on the exact version of Owncloud or Nextcloud hashes may appear on all objects, or only on objects which had a hash uploaded with them.

        +

        Standard options

        Here are the Standard options specific to webdav (WebDAV).

        --webdav-url

        URL of http host to connect to.

        @@ -28803,6 +35198,10 @@

        --webdav-vendor

      34. Required: false
      35. Examples:
          +
        • "fastmail" +
            +
          • Fastmail Files
          • +
        • "nextcloud"
          • Nextcloud
          • @@ -28819,6 +35218,10 @@

            --webdav-vendor

            • Sharepoint with NTLM authentication, usually self-hosted or on-premises
            +
          • "rclone" +
              +
            • rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
            • +
          • "other"
            • Other site/service or software
            • @@ -28854,7 +35257,7 @@

              --webdav-bearer-token

            • Type: string
            • Required: false
            -

            Advanced options

            +

            Advanced options

            Here are the Advanced options specific to webdav (WebDAV).

            --webdav-bearer-token-command

            Command to run to get a bearer token.

            @@ -28889,8 +35292,31 @@

            --webdav-headers

          • Type: CommaSepList
          • Default:
          +

          --webdav-pacer-min-sleep

          +

          Minimum time to sleep between API calls.

          +

          Properties:

          +
            +
          • Config: pacer_min_sleep
          • +
          • Env Var: RCLONE_WEBDAV_PACER_MIN_SLEEP
          • +
          • Type: Duration
          • +
          • Default: 10ms
          • +
          +

          --webdav-nextcloud-chunk-size

          +

          Nextcloud upload chunk size.

          +

          We recommend configuring your NextCloud instance to increase the max chunk size to 1 GB for better upload performances. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#adjust-chunk-size-on-nextcloud-side

          +

          Set to 0 to disable chunked uploading.

          +

          Properties:

          +
            +
          • Config: nextcloud_chunk_size
          • +
          • Env Var: RCLONE_WEBDAV_NEXTCLOUD_CHUNK_SIZE
          • +
          • Type: SizeSuffix
          • +
          • Default: 10Mi
          • +

          Provider notes

          See below for notes on specific providers.

          +

          Fastmail Files

          +

          Use https://webdav.fastmail.com/ or a subdirectory as the URL, and your Fastmail email username@domain.tld as the username. Follow this documentation to create an app password with access to Files (WebDAV) and use this as the password.

          +

          Fastmail supports modified times using the X-OC-Mtime header.

          Owncloud

          Click on the settings cog in the bottom right of the page and this will show the WebDAV URL that rclone needs in the config step. It will look something like https://example.com/remote.php/webdav/.

          Owncloud supports modified times using the X-OC-Mtime header.

          @@ -28931,6 +35357,9 @@

          Required Flags for SharePoint

          As SharePoint does some special things with uploaded documents, you won't be able to use the documents size or the documents hash to compare if a file has been changed since the upload / which file is newer.

          For Rclone calls copying files (especially Office files such as .docx, .xlsx, etc.) from/to SharePoint (like copy, sync, etc.), you should append these flags to ensure Rclone uses the "Last Modified" datetime property to compare your documents:

          --ignore-size --ignore-checksum --update
          +

          Rclone

          +

          Use this option if you are hosting remotes over WebDAV provided by rclone. Read rclone serve webdav for more details.

          +

          rclone serve supports modified times using the X-OC-Mtime header.

          dCache

          dCache is a storage system that supports many protocols and authentication/authorisation schemes. For WebDAV clients, it allows users to authenticate with username and password (BASIC), X.509, Kerberos, and various bearer tokens, including Macaroons and OpenID-Connect access tokens.

          Configure as normal using the other type. Don't enter a username or password, instead enter your Macaroon as the bearer_token.

          @@ -28961,7 +35390,7 @@

          OpenID-Connect

          bearer_token_command = oidc-token XDC
      36. Yandex Disk

        Yandex Disk is a cloud storage solution created by Yandex.

        -

        Configuration

        +

        Configuration

        Here is an example of making a yandex configuration. First run

        rclone config

        This will guide you through an interactive setup process:

        @@ -29015,18 +35444,17 @@

        Configuration

        Sync /home/local/directory to the remote path, deleting any excess files in the path.

        rclone sync --interactive /home/local/directory remote:directory

        Yandex paths may be as deep as required, e.g. remote:directory/subdirectory.

        -

        Modified time

        +

        Modification times and hashes

        Modified times are supported and are stored accurate to 1 ns in custom metadata called rclone_modified in RFC3339 with nanoseconds format.

        -

        MD5 checksums

        -

        MD5 checksums are natively supported by Yandex Disk.

        -

        Emptying Trash

        +

        The MD5 hash algorithm is natively supported by Yandex Disk.

        +

        Emptying Trash

        If you wish to empty your trash you can use the rclone cleanup remote: command which will permanently delete all your trashed files. This command does not take any path arguments.

        -

        Quota information

        +

        Quota information

        To view your current quota you can use the rclone about remote: command which will display your usage limit (quota) and the current usage.

        -

        Restricted filename characters

        +

        Restricted filename characters

        The default restricted characters set are replaced.

        Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON strings.

        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to yandex (Yandex Disk).

        --yandex-client-id

        OAuth Client Id.

        @@ -29048,7 +35476,7 @@

        --yandex-client-secret

      37. Type: string
      38. Required: false
      39. -

        Advanced options

        +

        Advanced options

        Here are the Advanced options specific to yandex (Yandex Disk).

        --yandex-token

        OAuth Access Token as a JSON blob.

        @@ -29095,16 +35523,16 @@

        --yandex-encoding

        • Config: encoding
        • Env Var: RCLONE_YANDEX_ENCODING
        • -
        • Type: MultiEncoder
        • +
        • Type: Encoding
        • Default: Slash,Del,Ctl,InvalidUtf8,Dot
        -

        Limitations

        +

        Limitations

        When uploading very large files (bigger than about 5 GiB) you will need to increase the --timeout parameter. This is because Yandex pauses (perhaps to calculate the MD5SUM for the entire file) before returning confirmation that the file has been uploaded. The default handling of timeouts in rclone is to assume a 5 minute pause is an error and close the connection - you'll see net/http: timeout awaiting response headers errors in the logs if this is happening. Setting the timeout to twice the max size of file in GiB should be enough, so if you want to upload a 30 GiB file set a timeout of 2 * 30 = 60m, that is --timeout 60m.

        Having a Yandex Mail account is mandatory to use the Yandex.Disk subscription. Token generation will work without a mail account, but Rclone won't be able to complete any actions.

        [403 - DiskUnsupportedUserAccountTypeError] User account type is not supported.

        Zoho Workdrive

        Zoho WorkDrive is a cloud storage solution created by Zoho.

        -

        Configuration

        +

        Configuration

        Here is an example of making a zoho configuration. First run

        rclone config

        This will guide you through an interactive setup process:

        @@ -29177,751 +35605,1491 @@

        Configuration

        Sync /home/local/directory to the remote path, deleting any excess files in the path.

        rclone sync --interactive /home/local/directory remote:directory

        Zoho paths may be as deep as required, eg remote:directory/subdirectory.

        -

        Modified time

        +

        Modification times and hashes

        Modified times are currently not supported for Zoho Workdrive

        -

        Checksums

        -

        No checksums are supported.

        -

        Usage information

        +

        No hash algorithms are supported.

        +

        Usage information

        To view your current quota you can use the rclone about remote: command which will display your current usage.

        -

        Restricted filename characters

        +

        Restricted filename characters

        Only control characters and invalid UTF-8 are replaced. In addition most Unicode full-width characters are not supported at all and will be removed from filenames during upload.

        -

        Standard options

        +

        Standard options

        Here are the Standard options specific to zoho (Zoho).

        --zoho-client-id

        OAuth Client Id.

        Leave blank normally.

        Properties:

          -
        • Config: client_id
        • -
        • Env Var: RCLONE_ZOHO_CLIENT_ID
        • -
        • Type: string
        • -
        • Required: false
        • +
        • Config: client_id
        • +
        • Env Var: RCLONE_ZOHO_CLIENT_ID
        • +
        • Type: string
        • +
        • Required: false
        • +
        +

        --zoho-client-secret

        +

        OAuth Client Secret.

        +

        Leave blank normally.

        +

        Properties:

        +
          +
        • Config: client_secret
        • +
        • Env Var: RCLONE_ZOHO_CLIENT_SECRET
        • +
        • Type: string
        • +
        • Required: false
        • +
        +

        --zoho-region

        +

        Zoho region to connect to.

        +

        You'll have to use the region your organization is registered in. If not sure use the same top level domain as you connect to in your browser.

        +

        Properties:

        +
          +
        • Config: region
        • +
        • Env Var: RCLONE_ZOHO_REGION
        • +
        • Type: string
        • +
        • Required: false
        • +
        • Examples: +
            +
          • "com" +
              +
            • United states / Global
            • +
          • +
          • "eu" +
              +
            • Europe
            • +
          • +
          • "in" +
              +
            • India
            • +
          • +
          • "jp" +
              +
            • Japan
            • +
          • +
          • "com.cn" +
              +
            • China
            • +
          • +
          • "com.au" +
              +
            • Australia
            • +
          • +
        • +
        +

        Advanced options

        +

        Here are the Advanced options specific to zoho (Zoho).

        +

        --zoho-token

        +

        OAuth Access Token as a JSON blob.

        +

        Properties:

        +
          +
        • Config: token
        • +
        • Env Var: RCLONE_ZOHO_TOKEN
        • +
        • Type: string
        • +
        • Required: false
        • +
        +

        --zoho-auth-url

        +

        Auth server URL.

        +

        Leave blank to use the provider defaults.

        +

        Properties:

        +
          +
        • Config: auth_url
        • +
        • Env Var: RCLONE_ZOHO_AUTH_URL
        • +
        • Type: string
        • +
        • Required: false
        • +
        +

        --zoho-token-url

        +

        Token server url.

        +

        Leave blank to use the provider defaults.

        +

        Properties:

        +
          +
        • Config: token_url
        • +
        • Env Var: RCLONE_ZOHO_TOKEN_URL
        • +
        • Type: string
        • +
        • Required: false
        • +
        +

        --zoho-encoding

        +

        The encoding for the backend.

        +

        See the encoding section in the overview for more info.

        +

        Properties:

        +
          +
        • Config: encoding
        • +
        • Env Var: RCLONE_ZOHO_ENCODING
        • +
        • Type: Encoding
        • +
        • Default: Del,Ctl,InvalidUtf8
        • +
        +

        Setting up your own client_id

        +

        For Zoho we advise you to set up your own client_id. To do so you have to complete the following steps.

        +
          +
        1. Log in to the Zoho API Console

        2. +
        3. Create a new client of type "Server-based Application". The name and website don't matter, but you must add the redirect URL http://localhost:53682/.

        4. +
        5. Once the client is created, you can go to the settings tab and enable it in other regions.

        6. +
        +

        The client id and client secret can now be used with rclone.

        +

        Local Filesystem

        +

        Local paths are specified as normal filesystem paths, e.g. /path/to/wherever, so

        +
        rclone sync --interactive /home/source /tmp/destination
        +

        Will sync /home/source to /tmp/destination.

        +

        Configuration

        +

        For consistencies sake one can also configure a remote of type local in the config file, and access the local filesystem using rclone remote paths, e.g. remote:path/to/wherever, but it is probably easier not to.

        +

        Modification times

        +

        Rclone reads and writes the modification times using an accuracy determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X.

        +

        Filenames

        +

        Filenames should be encoded in UTF-8 on disk. This is the normal case for Windows and OS X.

        +

        There is a bit more uncertainty in the Linux world, but new distributions will have UTF-8 encoded files names. If you are using an old Linux filesystem with non UTF-8 file names (e.g. latin1) then you can use the convmv tool to convert the filesystem to UTF-8. This tool is available in most distributions' package managers.

        +

        If an invalid (non-UTF8) filename is read, the invalid characters will be replaced with a quoted representation of the invalid bytes. The name gro\xdf will be transferred as gro‛DF. rclone will emit a debug message in this case (use -v to see), e.g.

        +
        Local file system at .: Replacing invalid UTF-8 characters in "gro\xdf"
        +

        Restricted characters

        +

        With the local backend, restrictions on the characters that are usable in file or directory names depend on the operating system. To check what rclone will replace by default on your system, run rclone help flags local-encoding.

        +

        On non Windows platforms the following characters are replaced when handling file names.

        + + + + + + + + + + + + + + + + + + + + +
        CharacterValueReplacement
        NUL0x00
        /0x2F
        +

        When running on Windows the following characters are replaced. This list is based on the Windows file naming conventions.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CharacterValueReplacement
        NUL0x00
        SOH0x01
        STX0x02
        ETX0x03
        EOT0x04
        ENQ0x05
        ACK0x06
        BEL0x07
        BS0x08
        HT0x09
        LF0x0A
        VT0x0B
        FF0x0C
        CR0x0D
        SO0x0E
        SI0x0F
        DLE0x10
        DC10x11
        DC20x12
        DC30x13
        DC40x14
        NAK0x15
        SYN0x16
        ETB0x17
        CAN0x18
        EM0x19
        SUB0x1A
        ESC0x1B
        FS0x1C
        GS0x1D
        RS0x1E
        US0x1F
        /0x2F
        "0x22
        *0x2A
        :0x3A
        <0x3C
        >0x3E
        ?0x3F
        \0x5C
        |0x7C
        +

        File names on Windows can also not end with the following characters. These only get replaced if they are the last character in the name:

        + + + + + + + + + + + + + + + + + + + + +
        CharacterValueReplacement
        SP0x20
        .0x2E
        +

        Invalid UTF-8 bytes will also be replaced, as they can't be converted to UTF-16.

        +

        Paths on Windows

        +

        On Windows there are many ways of specifying a path to a file system resource. Local paths can be absolute, like C:\path\to\wherever, or relative, like ..\wherever. Network paths in UNC format, \\server\share, are also supported. Path separator can be either \ (as in C:\path\to\wherever) or / (as in C:/path/to/wherever). Length of these paths are limited to 259 characters for files and 247 characters for directories, but there is an alternative extended-length path format increasing the limit to (approximately) 32,767 characters. This format requires absolute paths and the use of prefix \\?\, e.g. \\?\D:\some\very\long\path. For convenience rclone will automatically convert regular paths into the corresponding extended-length paths, so in most cases you do not have to worry about this (read more below).

        +

        Note that Windows supports using the same prefix \\?\ to specify path to volumes identified by their GUID, e.g. \\?\Volume{b75e2c83-0000-0000-0000-602f00000000}\some\path. This is not supported in rclone, due to an issue in go.

        +

        Long paths

        +

        Rclone handles long paths automatically, by converting all paths to extended-length path format, which allows paths up to 32,767 characters.

        +

        This conversion will ensure paths are absolute and prefix them with the \\?\. This is why you will see that your paths, for instance .\files is shown as path \\?\C:\files in the output, and \\server\share as \\?\UNC\server\share.

        +

        However, in rare cases this may cause problems with buggy file system drivers like EncFS. To disable UNC conversion globally, add this to your .rclone.conf file:

        +
        [local]
        +nounc = true
        +

        If you want to selectively disable UNC, you can add it to a separate entry like this:

        +
        [nounc]
        +type = local
        +nounc = true
        +

        And use rclone like this:

        +

        rclone copy c:\src nounc:z:\dst

        +

        This will use UNC paths on c:\src but not on z:\dst. Of course this will cause problems if the absolute path length of a file exceeds 259 characters on z, so only use this option if you have to.

        + +

        Normally rclone will ignore symlinks or junction points (which behave like symlinks under Windows).

        +

        If you supply --copy-links or -L then rclone will follow the symlink and copy the pointed to file or directory. Note that this flag is incompatible with --links / -l.

        +

        This flag applies to all commands.

        +

        For example, supposing you have a directory structure like this

        +
        $ tree /tmp/a
        +/tmp/a
        +├── b -> ../b
        +├── expected -> ../expected
        +├── one
        +└── two
        +    └── three
        +

        Then you can see the difference with and without the flag like this

        +
        $ rclone ls /tmp/a
        +        6 one
        +        6 two/three
        +

        and

        +
        $ rclone -L ls /tmp/a
        +     4174 expected
        +        6 one
        +        6 two/three
        +        6 b/two
        +        6 b/one
        + +

        Normally rclone will ignore symlinks or junction points (which behave like symlinks under Windows).

        +

        If you supply this flag then rclone will copy symbolic links from the local storage, and store them as text files, with a '.rclonelink' suffix in the remote storage.

        +

        The text file will contain the target of the symbolic link (see example).

        +

        This flag applies to all commands.

        +

        For example, supposing you have a directory structure like this

        +
        $ tree /tmp/a
        +/tmp/a
        +├── file1 -> ./file4
        +└── file2 -> /home/user/file3
        +

        Copying the entire directory with '-l'

        +
        $ rclone copyto -l /tmp/a/file1 remote:/tmp/a/
        +

        The remote files are created with a '.rclonelink' suffix

        +
        $ rclone ls remote:/tmp/a
        +       5 file1.rclonelink
        +      14 file2.rclonelink
        +

        The remote files will contain the target of the symbolic links

        +
        $ rclone cat remote:/tmp/a/file1.rclonelink
        +./file4
        +
        +$ rclone cat remote:/tmp/a/file2.rclonelink
        +/home/user/file3
        +

        Copying them back with '-l'

        +
        $ rclone copyto -l remote:/tmp/a/ /tmp/b/
        +
        +$ tree /tmp/b
        +/tmp/b
        +├── file1 -> ./file4
        +└── file2 -> /home/user/file3
        +

        However, if copied back without '-l'

        +
        $ rclone copyto remote:/tmp/a/ /tmp/b/
        +
        +$ tree /tmp/b
        +/tmp/b
        +├── file1.rclonelink
        +└── file2.rclonelink
        +

        Note that this flag is incompatible with -copy-links / -L.

        +

        Restricting filesystems with --one-file-system

        +

        Normally rclone will recurse through filesystems as mounted.

        +

        However if you set --one-file-system or -x this tells rclone to stay in the filesystem specified by the root and not to recurse into different file systems.

        +

        For example if you have a directory hierarchy like this

        +
        root
        +├── disk1     - disk1 mounted on the root
        +│   └── file3 - stored on disk1
        +├── disk2     - disk2 mounted on the root
        +│   └── file4 - stored on disk12
        +├── file1     - stored on the root disk
        +└── file2     - stored on the root disk
        +

        Using rclone --one-file-system copy root remote: will only copy file1 and file2. Eg

        +
        $ rclone -q --one-file-system ls root
        +        0 file1
        +        0 file2
        +
        $ rclone -q ls root
        +        0 disk1/file3
        +        0 disk2/file4
        +        0 file1
        +        0 file2
        +

        NB Rclone (like most unix tools such as du, rsync and tar) treats a bind mount to the same device as being on the same filesystem.

        +

        NB This flag is only available on Unix based systems. On systems where it isn't supported (e.g. Windows) it will be ignored.

        +

        Advanced options

        +

        Here are the Advanced options specific to local (Local Disk).

        +

        --local-nounc

        +

        Disable UNC (long path names) conversion on Windows.

        +

        Properties:

        +
          +
        • Config: nounc
        • +
        • Env Var: RCLONE_LOCAL_NOUNC
        • +
        • Type: bool
        • +
        • Default: false
        • +
        • Examples: +
            +
          • "true" +
              +
            • Disables long file names.
            • +
          • +
        -

        --zoho-client-secret

        -

        OAuth Client Secret.

        -

        Leave blank normally.

        + +

        Follow symlinks and copy the pointed to item.

        Properties:

          -
        • Config: client_secret
        • -
        • Env Var: RCLONE_ZOHO_CLIENT_SECRET
        • -
        • Type: string
        • -
        • Required: false
        • +
        • Config: copy_links
        • +
        • Env Var: RCLONE_LOCAL_COPY_LINKS
        • +
        • Type: bool
        • +
        • Default: false
        -

        --zoho-region

        -

        Zoho region to connect to.

        -

        You'll have to use the region your organization is registered in. If not sure use the same top level domain as you connect to in your browser.

        + +

        Translate symlinks to/from regular files with a '.rclonelink' extension.

        Properties:

          -
        • Config: region
        • -
        • Env Var: RCLONE_ZOHO_REGION
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: -
            -
          • "com" -
              -
            • United states / Global
            • -
          • -
          • "eu" +
          • Config: links
          • +
          • Env Var: RCLONE_LOCAL_LINKS
          • +
          • Type: bool
          • +
          • Default: false
          • +
          + +

          Don't warn about skipped symlinks.

          +

          This flag disables warning messages on skipped symlinks or junction points, as you explicitly acknowledge that they should be skipped.

          +

          Properties:

            -
          • Europe
          • -
        • -
        • "in" +
        • Config: skip_links
        • +
        • Env Var: RCLONE_LOCAL_SKIP_LINKS
        • +
        • Type: bool
        • +
        • Default: false
        • +
        + +

        Assume the Stat size of links is zero (and read them instead) (deprecated).

        +

        Rclone used to use the Stat size of links as the link size, but this fails in quite a few places:

          -
        • India
        • -
        -
      40. "jp" +
      41. Windows
      42. +
      43. On some virtual filesystems (such ash LucidLink)
      44. +
      45. Android
      46. + +

        So rclone now always reads the link.

        +

        Properties:

          -
        • Japan
        • -
        -
      47. "com.cn" +
      48. Config: zero_size_links
      49. +
      50. Env Var: RCLONE_LOCAL_ZERO_SIZE_LINKS
      51. +
      52. Type: bool
      53. +
      54. Default: false
      55. + +

        --local-unicode-normalization

        +

        Apply unicode NFC normalization to paths and filenames.

        +

        This flag can be used to normalize file names into unicode NFC form that are read from the local filesystem.

        +

        Rclone does not normally touch the encoding of file names it reads from the file system.

        +

        This can be useful when using macOS as it normally provides decomposed (NFD) unicode which in some language (eg Korean) doesn't display properly on some OSes.

        +

        Note that rclone compares filenames with unicode normalization in the sync routine so this flag shouldn't normally be used.

        +

        Properties:

          -
        • China
        • -
        -
      56. "com.au" +
      57. Config: unicode_normalization
      58. +
      59. Env Var: RCLONE_LOCAL_UNICODE_NORMALIZATION
      60. +
      61. Type: bool
      62. +
      63. Default: false
      64. + +

        --local-no-check-updated

        +

        Don't check to see if the files change during upload.

        +

        Normally rclone checks the size and modification time of files as they are being uploaded and aborts with a message which starts "can't copy - source file is being updated" if the file changes during upload.

        +

        However on some file systems this modification time check may fail (e.g. Glusterfs #2206) so this check can be disabled with this flag.

        +

        If this flag is set, rclone will use its best efforts to transfer a file which is being updated. If the file is only having things appended to it (e.g. a log) then rclone will transfer the log file with the size it had the first time rclone saw it.

        +

        If the file is being modified throughout (not just appended to) then the transfer may fail with a hash check failure.

        +

        In detail, once the file has had stat() called on it for the first time we:

          -
        • Australia
        • -
        - +
      65. Only transfer the size that stat gave
      66. +
      67. Only checksum the size that stat gave
      68. +
      69. Don't update the stat info for the file
      70. -

        Advanced options

        -

        Here are the Advanced options specific to zoho (Zoho).

        -

        --zoho-token

        -

        OAuth Access Token as a JSON blob.

        +

        NB do not use this flag on a Windows Volume Shadow (VSS). For some unknown reason, files in a VSS sometimes show different sizes from the directory listing (where the initial stat value comes from on Windows) and when stat is called on them directly. Other copy tools always use the direct stat value and setting this flag will disable that.

        Properties:

          -
        • Config: token
        • -
        • Env Var: RCLONE_ZOHO_TOKEN
        • -
        • Type: string
        • -
        • Required: false
        • +
        • Config: no_check_updated
        • +
        • Env Var: RCLONE_LOCAL_NO_CHECK_UPDATED
        • +
        • Type: bool
        • +
        • Default: false
        -

        --zoho-auth-url

        -

        Auth server URL.

        -

        Leave blank to use the provider defaults.

        +

        --one-file-system / -x

        +

        Don't cross filesystem boundaries (unix/macOS only).

        Properties:

          -
        • Config: auth_url
        • -
        • Env Var: RCLONE_ZOHO_AUTH_URL
        • -
        • Type: string
        • -
        • Required: false
        • +
        • Config: one_file_system
        • +
        • Env Var: RCLONE_LOCAL_ONE_FILE_SYSTEM
        • +
        • Type: bool
        • +
        • Default: false
        -

        --zoho-token-url

        -

        Token server url.

        -

        Leave blank to use the provider defaults.

        +

        --local-case-sensitive

        +

        Force the filesystem to report itself as case sensitive.

        +

        Normally the local backend declares itself as case insensitive on Windows/macOS and case sensitive for everything else. Use this flag to override the default choice.

        Properties:

          -
        • Config: token_url
        • -
        • Env Var: RCLONE_ZOHO_TOKEN_URL
        • -
        • Type: string
        • -
        • Required: false
        • +
        • Config: case_sensitive
        • +
        • Env Var: RCLONE_LOCAL_CASE_SENSITIVE
        • +
        • Type: bool
        • +
        • Default: false
        -

        --zoho-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        +

        --local-case-insensitive

        +

        Force the filesystem to report itself as case insensitive.

        +

        Normally the local backend declares itself as case insensitive on Windows/macOS and case sensitive for everything else. Use this flag to override the default choice.

        Properties:

          -
        • Config: encoding
        • -
        • Env Var: RCLONE_ZOHO_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Del,Ctl,InvalidUtf8
        • -
        -

        Setting up your own client_id

        -

        For Zoho we advise you to set up your own client_id. To do so you have to complete the following steps.

        -
          -
        1. Log in to the Zoho API Console

        2. -
        3. Create a new client of type "Server-based Application". The name and website don't matter, but you must add the redirect URL http://localhost:53682/.

        4. -
        5. Once the client is created, you can go to the settings tab and enable it in other regions.

        6. -
        -

        The client id and client secret can now be used with rclone.

        -

        Local Filesystem

        -

        Local paths are specified as normal filesystem paths, e.g. /path/to/wherever, so

        -
        rclone sync --interactive /home/source /tmp/destination
        -

        Will sync /home/source to /tmp/destination.

        -

        Configuration

        -

        For consistencies sake one can also configure a remote of type local in the config file, and access the local filesystem using rclone remote paths, e.g. remote:path/to/wherever, but it is probably easier not to.

        -

        Modified time

        -

        Rclone reads and writes the modified time using an accuracy determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X.

        -

        Filenames

        -

        Filenames should be encoded in UTF-8 on disk. This is the normal case for Windows and OS X.

        -

        There is a bit more uncertainty in the Linux world, but new distributions will have UTF-8 encoded files names. If you are using an old Linux filesystem with non UTF-8 file names (e.g. latin1) then you can use the convmv tool to convert the filesystem to UTF-8. This tool is available in most distributions' package managers.

        -

        If an invalid (non-UTF8) filename is read, the invalid characters will be replaced with a quoted representation of the invalid bytes. The name gro\xdf will be transferred as gro‛DF. rclone will emit a debug message in this case (use -v to see), e.g.

        -
        Local file system at .: Replacing invalid UTF-8 characters in "gro\xdf"
        -

        Restricted characters

        -

        With the local backend, restrictions on the characters that are usable in file or directory names depend on the operating system. To check what rclone will replace by default on your system, run rclone help flags local-encoding.

        -

        On non Windows platforms the following characters are replaced when handling file names.

        - - - - - - - - - - - - - - - - - - - - -
        CharacterValueReplacement
        NUL0x00
        /0x2F
        -

        When running on Windows the following characters are replaced. This list is based on the Windows file naming conventions.

        +
      71. Config: case_insensitive
      72. +
      73. Env Var: RCLONE_LOCAL_CASE_INSENSITIVE
      74. +
      75. Type: bool
      76. +
      77. Default: false
      78. + +

        --local-no-preallocate

        +

        Disable preallocation of disk space for transferred files.

        +

        Preallocation of disk space helps prevent filesystem fragmentation. However, some virtual filesystem layers (such as Google Drive File Stream) may incorrectly set the actual file size equal to the preallocated space, causing checksum and file size checks to fail. Use this flag to disable preallocation.

        +

        Properties:

        +
          +
        • Config: no_preallocate
        • +
        • Env Var: RCLONE_LOCAL_NO_PREALLOCATE
        • +
        • Type: bool
        • +
        • Default: false
        • +
        +

        --local-no-sparse

        +

        Disable sparse files for multi-thread downloads.

        +

        On Windows platforms rclone will make sparse files when doing multi-thread downloads. This avoids long pauses on large files where the OS zeros the file. However sparse files may be undesirable as they cause disk fragmentation and can be slow to work with.

        +

        Properties:

        +
          +
        • Config: no_sparse
        • +
        • Env Var: RCLONE_LOCAL_NO_SPARSE
        • +
        • Type: bool
        • +
        • Default: false
        • +
        +

        --local-no-set-modtime

        +

        Disable setting modtime.

        +

        Normally rclone updates modification time of files after they are done uploading. This can cause permissions issues on Linux platforms when the user rclone is running as does not own the file uploaded, such as when copying to a CIFS mount owned by another user. If this option is enabled, rclone will no longer update the modtime after copying a file.

        +

        Properties:

        +
          +
        • Config: no_set_modtime
        • +
        • Env Var: RCLONE_LOCAL_NO_SET_MODTIME
        • +
        • Type: bool
        • +
        • Default: false
        • +
        +

        --local-encoding

        +

        The encoding for the backend.

        +

        See the encoding section in the overview for more info.

        +

        Properties:

        +
          +
        • Config: encoding
        • +
        • Env Var: RCLONE_LOCAL_ENCODING
        • +
        • Type: Encoding
        • +
        • Default: Slash,Dot
        • +
        +

        Metadata

        +

        Depending on which OS is in use the local backend may return only some of the system metadata. Setting system metadata is supported on all OSes but setting user metadata is only supported on linux, freebsd, netbsd, macOS and Solaris. It is not supported on Windows yet (see pkg/attrs#47).

        +

        User metadata is stored as extended attributes (which may not be supported by all file systems) under the "user.*" prefix.

        +

        Here are the possible system metadata items for the local backend.

        +++++++ - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + + + + + - - - + + + + + - -
        CharacterValueReplacementNameHelpTypeExampleRead Only
        NUL0x00
        SOH0x01
        STX0x02
        ETX0x03
        EOT0x04
        ENQ0x05
        ACK0x06
        BEL0x07
        BS0x08
        HT0x09
        LF0x0A
        VT0x0B
        FF0x0C
        CR0x0D
        SO0x0E
        SI0x0F
        DLE0x10
        DC10x11
        DC20x12
        DC30x13
        DC40x14
        NAK0x15
        SYN0x16
        ETB0x17
        CAN0x18
        EM0x19
        SUB0x1A
        ESC0x1B
        FS0x1C
        GS0x1D
        RS0x1E
        US0x1F
        /0x2F
        "0x22
        *0x2A
        :0x3A
        <0x3C
        >0x3E
        ?0x3FatimeTime of last accessRFC 33392006-01-02T15:04:05.999999999Z07:00N
        \0x5CbtimeTime of file birth (creation)RFC 33392006-01-02T15:04:05.999999999Z07:00N
        |0x7CgidGroup ID of ownerdecimal number500N
        -

        File names on Windows can also not end with the following characters. These only get replaced if they are the last character in the name:

        - - - - - - + + + + + + - - - - - + + + + + - - - + + + + + + + + + + + +
        CharacterValueReplacement
        modeFile type and modeoctal, unix style0100664N
        SP0x20mtimeTime of last modificationRFC 33392006-01-02T15:04:05.999999999Z07:00N
        .0x2ErdevDevice ID (if special file)hexadecimal1abcN
        uidUser ID of ownerdecimal number500N
        -

        Invalid UTF-8 bytes will also be replaced, as they can't be converted to UTF-16.

        -

        Paths on Windows

        -

        On Windows there are many ways of specifying a path to a file system resource. Local paths can be absolute, like C:\path\to\wherever, or relative, like ..\wherever. Network paths in UNC format, \\server\share, are also supported. Path separator can be either \ (as in C:\path\to\wherever) or / (as in C:/path/to/wherever). Length of these paths are limited to 259 characters for files and 247 characters for directories, but there is an alternative extended-length path format increasing the limit to (approximately) 32,767 characters. This format requires absolute paths and the use of prefix \\?\, e.g. \\?\D:\some\very\long\path. For convenience rclone will automatically convert regular paths into the corresponding extended-length paths, so in most cases you do not have to worry about this (read more below).

        -

        Note that Windows supports using the same prefix \\?\ to specify path to volumes identified by their GUID, e.g. \\?\Volume{b75e2c83-0000-0000-0000-602f00000000}\some\path. This is not supported in rclone, due to an issue in go.

        -

        Long paths

        -

        Rclone handles long paths automatically, by converting all paths to extended-length path format, which allows paths up to 32,767 characters.

        -

        This conversion will ensure paths are absolute and prefix them with the \\?\. This is why you will see that your paths, for instance .\files is shown as path \\?\C:\files in the output, and \\server\share as \\?\UNC\server\share.

        -

        However, in rare cases this may cause problems with buggy file system drivers like EncFS. To disable UNC conversion globally, add this to your .rclone.conf file:

        -
        [local]
        -nounc = true
        -

        If you want to selectively disable UNC, you can add it to a separate entry like this:

        -
        [nounc]
        -type = local
        -nounc = true
        -

        And use rclone like this:

        -

        rclone copy c:\src nounc:z:\dst

        -

        This will use UNC paths on c:\src but not on z:\dst. Of course this will cause problems if the absolute path length of a file exceeds 259 characters on z, so only use this option if you have to.

        - -

        Normally rclone will ignore symlinks or junction points (which behave like symlinks under Windows).

        -

        If you supply --copy-links or -L then rclone will follow the symlink and copy the pointed to file or directory. Note that this flag is incompatible with --links / -l.

        -

        This flag applies to all commands.

        -

        For example, supposing you have a directory structure like this

        -
        $ tree /tmp/a
        -/tmp/a
        -├── b -> ../b
        -├── expected -> ../expected
        -├── one
        -└── two
        -    └── three
        -

        Then you can see the difference with and without the flag like this

        -
        $ rclone ls /tmp/a
        -        6 one
        -        6 two/three
        -

        and

        -
        $ rclone -L ls /tmp/a
        -     4174 expected
        -        6 one
        -        6 two/three
        -        6 b/two
        -        6 b/one
        - -

        Normally rclone will ignore symlinks or junction points (which behave like symlinks under Windows).

        -

        If you supply this flag then rclone will copy symbolic links from the local storage, and store them as text files, with a '.rclonelink' suffix in the remote storage.

        -

        The text file will contain the target of the symbolic link (see example).

        -

        This flag applies to all commands.

        -

        For example, supposing you have a directory structure like this

        -
        $ tree /tmp/a
        -/tmp/a
        -├── file1 -> ./file4
        -└── file2 -> /home/user/file3
        -

        Copying the entire directory with '-l'

        -
        $ rclone copyto -l /tmp/a/file1 remote:/tmp/a/
        -

        The remote files are created with a '.rclonelink' suffix

        -
        $ rclone ls remote:/tmp/a
        -       5 file1.rclonelink
        -      14 file2.rclonelink
        -

        The remote files will contain the target of the symbolic links

        -
        $ rclone cat remote:/tmp/a/file1.rclonelink
        -./file4
        -
        -$ rclone cat remote:/tmp/a/file2.rclonelink
        -/home/user/file3
        -

        Copying them back with '-l'

        -
        $ rclone copyto -l remote:/tmp/a/ /tmp/b/
        -
        -$ tree /tmp/b
        -/tmp/b
        -├── file1 -> ./file4
        -└── file2 -> /home/user/file3
        -

        However, if copied back without '-l'

        -
        $ rclone copyto remote:/tmp/a/ /tmp/b/
        -
        -$ tree /tmp/b
        -/tmp/b
        -├── file1.rclonelink
        -└── file2.rclonelink
        -

        Note that this flag is incompatible with -copy-links / -L.

        -

        Restricting filesystems with --one-file-system

        -

        Normally rclone will recurse through filesystems as mounted.

        -

        However if you set --one-file-system or -x this tells rclone to stay in the filesystem specified by the root and not to recurse into different file systems.

        -

        For example if you have a directory hierarchy like this

        -
        root
        -├── disk1     - disk1 mounted on the root
        -│   └── file3 - stored on disk1
        -├── disk2     - disk2 mounted on the root
        -│   └── file4 - stored on disk12
        -├── file1     - stored on the root disk
        -└── file2     - stored on the root disk
        -

        Using rclone --one-file-system copy root remote: will only copy file1 and file2. Eg

        -
        $ rclone -q --one-file-system ls root
        -        0 file1
        -        0 file2
        -
        $ rclone -q ls root
        -        0 disk1/file3
        -        0 disk2/file4
        -        0 file1
        -        0 file2
        -

        NB Rclone (like most unix tools such as du, rsync and tar) treats a bind mount to the same device as being on the same filesystem.

        -

        NB This flag is only available on Unix based systems. On systems where it isn't supported (e.g. Windows) it will be ignored.

        -

        Advanced options

        -

        Here are the Advanced options specific to local (Local Disk).

        -

        --local-nounc

        -

        Disable UNC (long path names) conversion on Windows.

        -

        Properties:

        +

        See the metadata docs for more info.

        +

        Backend commands

        +

        Here are the commands specific to the local backend.

        +

        Run them with

        +
        rclone backend COMMAND remote:
        +

        The help below will explain what arguments each command takes.

        +

        See the backend command for more info on how to pass options and arguments.

        +

        These can be run on a running backend using the rc command backend/command.

        +

        noop

        +

        A null operation for testing backend commands

        +
        rclone backend noop remote: [options] [<arguments>+]
        +

        This is a test command which has some options you can try to change the output.

        +

        Options:

        +
          +
        • "echo": echo the input arguments
        • +
        • "error": return an error based on option value
        • +
        +

        Changelog

        +

        v1.65.0 - 2023-11-26

        +

        See commits

        +
          +
        • New backends +
            +
          • Azure Files (karan, moongdal, Nick Craig-Wood)
          • +
          • ImageKit (Abhinav Dhiman)
          • +
          • Linkbox (viktor, Nick Craig-Wood)
          • +
        • +
        • New commands +
            +
          • serve s3: Let rclone act as an S3 compatible server (Mikubill, Artur Neumann, Saw-jan, Nick Craig-Wood)
          • +
          • nfsmount: mount command to provide mount mechanism on macOS without FUSE (Saleh Dindar)
          • +
          • serve nfs: to serve a remote for use by nfsmount (Saleh Dindar)
          • +
        • +
        • New Features +
            +
          • install.sh: Clean up temp files in install script (Jacob Hands)
          • +
          • build +
              +
            • Update all dependencies (Nick Craig-Wood)
            • +
            • Refactor version info and icon resource handling on windows (albertony)
            • +
          • +
          • doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick Craig-Wood)
          • +
          • Implement --metadata-mapper to transform metatadata with a user supplied program (Nick Craig-Wood)
          • +
          • Add ChunkWriterDoesntSeek feature flag and set it for b2 (Nick Craig-Wood)
          • +
          • lib/http: Export basic go string functions for use in --template (Gabriel Espinoza)
          • +
          • makefile: Use POSIX compatible install arguments (Mina Galić)
          • +
          • operations +
              +
            • Use less memory when doing multithread uploads (Nick Craig-Wood)
            • +
            • Implement --partial-suffix to control extension of temporary file names (Volodymyr)
            • +
          • +
          • rc +
              +
            • Add operations/check to the rc API (Nick Craig-Wood)
            • +
            • Always report an error as JSON (Nick Craig-Wood)
            • +
            • Set Last-Modified header for files served by --rc-serve (Nikita Shoshin)
            • +
          • +
          • size: Dont show duplicate object count when less than 1k (albertony)
          • +
        • +
        • Bug Fixes +
            +
          • fshttp: Fix --contimeout being ignored (你知道未来吗)
          • +
          • march: Fix excessive parallelism when using --no-traverse (Nick Craig-Wood)
          • +
          • ncdu: Fix crash when re-entering changed directory after rescan (Nick Craig-Wood)
          • +
          • operations +
              +
            • Fix overwrite of destination when multi-thread transfer fails (Nick Craig-Wood)
            • +
            • Fix invalid UTF-8 when truncating file names when not using --inplace (Nick Craig-Wood)
            • +
          • +
          • serve dnla: Fix crash on graceful exit (wuxingzhong)
          • +
        • +
        • Mount +
            +
          • Disable mount for freebsd and alias cmount as mount on that platform (Nick Craig-Wood)
          • +
        • +
        • VFS +
            +
          • Add --vfs-refresh flag to read all the directories on start (Beyond Meat)
          • +
          • Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh Dindar)
          • +
          • Add go-billy dependency and make sure vfs.Handle implements billy.File (Saleh Dindar)
          • +
          • Error out early if can't upload 0 length file (Nick Craig-Wood)
          • +
        • +
        • Local +
            +
          • Fix copying from Windows Volume Shadows (Nick Craig-Wood)
          • +
        • +
        • Azure Blob +
            +
          • Add support for cold tier (Ivan Yanitra)
          • +
        • +
        • B2 +
            +
          • Implement "rclone backend lifecycle" to read and set bucket lifecycles (Nick Craig-Wood)
          • +
          • Implement --b2-lifecycle to control lifecycle when creating buckets (Nick Craig-Wood)
          • +
          • Fix listing all buckets when not needed (Nick Craig-Wood)
          • +
          • Fix multi-thread upload with copyto going to wrong name (Nick Craig-Wood)
          • +
          • Fix server side chunked copy when file size was exactly --b2-copy-cutoff (Nick Craig-Wood)
          • +
          • Fix streaming chunked files an exact multiple of chunk size (Nick Craig-Wood)
          • +
        • +
        • Box +
            +
          • Filter more EventIDs when polling (David Sze)
          • +
          • Add more logging for polling (David Sze)
          • +
          • Fix performance problem reading metadata for single files (Nick Craig-Wood)
          • +
        • +
        • Drive +
            +
          • Add read/write metadata support (Nick Craig-Wood)
          • +
          • Add support for SHA-1 and SHA-256 checksums (rinsuki)
          • +
          • Add --drive-show-all-gdocs to allow unexportable gdocs to be server side copied (Nick Craig-Wood)
          • +
          • Add a note that --drive-scope accepts comma-separated list of scopes (Keigo Imai)
          • +
          • Fix error updating created time metadata on existing object (Nick Craig-Wood)
          • +
          • Fix integration tests by enabling metadata support from the context (Nick Craig-Wood)
          • +
        • +
        • Dropbox +
            +
          • Factor batcher into lib/batcher (Nick Craig-Wood)
          • +
          • Fix missing encoding for rclone purge (Nick Craig-Wood)
          • +
        • +
        • Google Cloud Storage +
            +
          • Fix 400 Bad request errors when using multi-thread copy (Nick Craig-Wood)
          • +
        • +
        • Googlephotos +
            +
          • Implement batcher for uploads (Nick Craig-Wood)
          • +
        • +
        • Hdfs +
            +
          • Added support for list of namenodes in hdfs remote config (Tayo-pasedaRJ)
          • +
        • +
        • HTTP +
            +
          • Implement set backend command to update running backend (Nick Craig-Wood)
          • +
          • Enable methods used with WebDAV (Alen Šiljak)
          • +
        • +
        • Jottacloud +
            +
          • Add support for reading and writing metadata (albertony)
          • +
        • +
        • Onedrive +
            +
          • Implement ListR method which gives --fast-list support (Nick Craig-Wood) +
              +
            • This must be enabled with the --onedrive-delta flag
            • +
          • +
        • +
        • Quatrix +
            +
          • Add partial upload support (Oksana Zhykina)
          • +
          • Overwrite files on conflict during server-side move (Oksana Zhykina)
          • +
        • +
        • S3 +
            +
          • Add Linode provider (Nick Craig-Wood)
          • +
          • Add docs on how to add a new provider (Nick Craig-Wood)
          • +
          • Fix no error being returned when creating a bucket we don't own (Nick Craig-Wood)
          • +
          • Emit a debug message if anonymous credentials are in use (Nick Craig-Wood)
          • +
          • Add --s3-disable-multipart-uploads flag (Nick Craig-Wood)
          • +
          • Detect looping when using gcs and versions (Nick Craig-Wood)
          • +
        • +
        • SFTP +
            +
          • Implement --sftp-copy-is-hardlink to server side copy as hardlink (Nick Craig-Wood)
          • +
        • +
        • Smb
            -
          • Config: nounc
          • -
          • Env Var: RCLONE_LOCAL_NOUNC
          • -
          • Type: bool
          • -
          • Default: false
          • -
          • Examples: +
          • Fix incorrect about size by switching to github.com/cloudsoda/go-smb2 fork (Nick Craig-Wood)
          • +
          • Fix modtime of multithread uploads by setting PartialUploads (Nick Craig-Wood)
          • +
        • +
        • WebDAV +
            +
          • Added an rclone vendor to work with rclone serve webdav (Adithya Kumar)
          • +
        • +
        +

        v1.64.2 - 2023-10-19

        +

        See commits

        +
          +
        • Bug Fixes +
            +
          • selfupdate: Fix "invalid hashsum signature" error (Nick Craig-Wood)
          • +
          • build: Fix docker build running out of space (Nick Craig-Wood)
          • +
        • +
        +

        v1.64.1 - 2023-10-17

        +

        See commits

        +
          +
        • Bug Fixes +
            +
          • cmd: Make --progress output logs in the same format as without (Nick Craig-Wood)
          • +
          • docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj Ghosh, Nick Craig-Wood)
          • +
          • lsjson: Make sure we set the global metadata flag too (Nick Craig-Wood)
          • +
          • operations +
              +
            • Ensure concurrency is no greater than the number of chunks (Pat Patterson)
            • +
            • Fix OpenOptions ignored in copy if operation was a multiThreadCopy (Vitor Gomes)
            • +
            • Fix error message on delete to have file name (Nick Craig-Wood)
            • +
          • +
          • serve sftp: Return not supported error for not supported commands (Nick Craig-Wood)
          • +
          • build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid reset (Nick Craig-Wood)
          • +
          • pacer: Fix b2 deadlock by defaulting max connections to unlimited (Nick Craig-Wood)
          • +
        • +
        • Mount +
            +
          • Fix automount not detecting drive is ready (Nick Craig-Wood)
          • +
        • +
        • VFS +
            +
          • Fix update dir modification time (Saleh Dindar)
          • +
        • +
        • Azure Blob +
            +
          • Fix "fatal error: concurrent map writes" (Nick Craig-Wood)
          • +
        • +
        • B2 +
            +
          • Fix multipart upload: corrupted on transfer: sizes differ XXX vs 0 (Nick Craig-Wood)
          • +
          • Fix locking window when getting mutipart upload URL (Nick Craig-Wood)
          • +
          • Fix server side copies greater than 4GB (Nick Craig-Wood)
          • +
          • Fix chunked streaming uploads (Nick Craig-Wood)
          • +
          • Reduce default --b2-upload-concurrency to 4 to reduce memory usage (Nick Craig-Wood)
          • +
        • +
        • Onedrive +
            +
          • Fix the configurator to allow /teams/ID in the config (Nick Craig-Wood)
          • +
        • +
        • Oracleobjectstorage +
            +
          • Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Nick Craig-Wood)
          • +
        • +
        • S3 +
            +
          • Fix slice bounds out of range error when listing (Nick Craig-Wood)
          • +
          • Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Vitor Gomes)
          • +
        • +
        • Storj +
            +
          • Update storj.io/uplink to v1.12.0 (Kaloyan Raev)
          • +
        • +
        +

        v1.64.0 - 2023-09-11

        +

        See commits

        +
          +
        • New backends +
        • +
        • Major changes +
            +
          • Multi-thread transfers (Vitor Gomes, Nick Craig-Wood, Manoj Ghosh, Edwin Mackenzie-Owen) +
              +
            • Multi-thread transfers are now available when transferring to: +
                +
              • local, s3, azureblob, b2, oracleobjectstorage and smb
              • +
            • +
            • This greatly improves transfer speed between two network sources.
            • +
            • In memory buffering has been unified between all backends and should share memory better.
            • +
            • See --multi-thread docs for more info
            • +
          • +
        • +
        • New commands +
            +
          • rclone config redacted support mechanism for showing redacted config (Nick Craig-Wood)
          • +
        • +
        • New Features +
            +
          • accounting +
              +
            • Show server side stats in own lines and not as bytes transferred (Nick Craig-Wood)
            • +
          • +
          • bisync +
              +
            • Add new --ignore-listing-checksum flag to distinguish from --ignore-checksum (nielash)
            • +
            • Add experimental --resilient mode to allow recovery from self-correctable errors (nielash)
            • +
            • Add support for --create-empty-src-dirs (nielash)
            • +
            • Dry runs no longer commit filter changes (nielash)
            • +
            • Enforce --check-access during --resync (nielash)
            • +
            • Apply filters correctly during deletes (nielash)
            • +
            • Equality check before renaming (leave identical files alone) (nielash)
            • +
            • Fix dryRun rc parameter being ignored (nielash)
            • +
          • +
          • build +
              +
            • Update to go1.21 and make go1.19 the minimum required version (Anagh Kumar Baranwal, Nick Craig-Wood)
            • +
            • Update dependencies (Nick Craig-Wood)
            • +
            • Add snap installation (hideo aoyama)
            • +
            • Change Winget Releaser job to ubuntu-latest (sitiom)
            • +
          • +
          • cmd: Refactor and use sysdnotify in more commands (eNV25)
          • +
          • config: Add --multi-thread-chunk-size flag (Vitor Gomes)
          • +
          • doc updates (antoinetran, Benjamin, Bjørn Smith, Dean Attali, gabriel-suela, James Braza, Justin Hellings, kapitainsky, Mahad, Masamune3210, Nick Craig-Wood, Nihaal Sangha, Niklas Hambüchen, Raymond Berger, r-ricci, Sawada Tsunayoshi, Tiago Boeing, Vladislav Vorobev)
          • +
          • fs +
              +
            • Use atomic types everywhere (Roberto Ricci)
            • +
            • When --max-transfer limit is reached exit with code (10) (kapitainsky)
            • +
            • Add rclone completion powershell - basic implementation only (Nick Craig-Wood)
            • +
          • +
          • http servers: Allow CORS to be set with --allow-origin flag (yuudi)
          • +
          • lib/rest: Remove unnecessary nil check (Eng Zer Jun)
          • +
          • ncdu: Add keybinding to rescan filesystem (eNV25)
          • +
          • rc +
              +
            • Add executeId to job listings (yuudi)
            • +
            • Add core/du to measure local disk usage (Nick Craig-Wood)
            • +
            • Add operations/settier to API (Drew Stinnett)
            • +
          • +
          • rclone test info: Add --check-base32768 flag to check can store all base32768 characters (Nick Craig-Wood)
          • +
          • rmdirs: Remove directories concurrently controlled by --checkers (Nick Craig-Wood)
          • +
        • +
        • Bug Fixes +
            +
          • accounting: Don't stop calculating average transfer speed until the operation is complete (Jacob Hands)
          • +
          • fs: Fix transferTime not being set in JSON logs (Jacob Hands)
          • +
          • fshttp: Fix --bind 0.0.0.0 allowing IPv6 and --bind ::0 allowing IPv4 (Nick Craig-Wood)
          • +
          • operations: Fix overlapping check on case insensitive file systems (Nick Craig-Wood)
          • +
          • serve dlna: Fix MIME type if backend can't identify it (Nick Craig-Wood)
          • +
          • serve ftp: Fix race condition when using the auth proxy (Nick Craig-Wood)
          • +
          • serve sftp: Fix hash calculations with --vfs-cache-mode full (Nick Craig-Wood)
          • +
          • serve webdav: Fix error: Expecting fs.Object or fs.Directory, got nil (Nick Craig-Wood)
          • +
          • sync: Fix lockup with --cutoff-mode=soft and --max-duration (Nick Craig-Wood)
          • +
        • +
        • Mount +
            +
          • fix: Mount parsing for linux (Anagh Kumar Baranwal)
          • +
        • +
        • VFS +
            +
          • Add --vfs-cache-min-free-space to control minimum free space on the disk containing the cache (Nick Craig-Wood)
          • +
          • Added cache cleaner for directories to reduce memory usage (Anagh Kumar Baranwal)
          • +
          • Update parent directory modtimes on vfs actions (David Pedersen)
          • +
          • Keep virtual directory status accurate and reduce deadlock potential (Anagh Kumar Baranwal)
          • +
          • Make sure struct field is aligned for atomic access (Roberto Ricci)
          • +
        • +
        • Local +
            +
          • Rmdir return an error if the path is not a dir (zjx20)
          • +
        • +
        • Azure Blob +
            +
          • Implement OpenChunkWriter and multi-thread uploads (Nick Craig-Wood)
          • +
          • Fix creation of directory markers (Nick Craig-Wood)
          • +
          • Fix purging with directory markers (Nick Craig-Wood)
          • +
        • +
        • B2 +
            +
          • Implement OpenChunkWriter and multi-thread uploads (Nick Craig-Wood)
          • +
          • Fix rclone link when object path contains special characters (Alishan Ladhani)
          • +
        • +
        • Box +
            +
          • Add polling support (David Sze)
          • +
          • Add --box-impersonate to impersonate a user ID (Nick Craig-Wood)
          • +
          • Fix unhelpful decoding of error messages into decimal numbers (Nick Craig-Wood)
          • +
        • +
        • Chunker +
            +
          • Update documentation to mention issue with small files (Ricardo D'O. Albanus)
          • +
        • +
        • Compress +
            +
          • Fix ChangeNotify (Nick Craig-Wood)
          • +
        • +
        • Drive +
            +
          • Add --drive-fast-list-bug-fix to control ListR bug workaround (Nick Craig-Wood)
          • +
        • +
        • Fichier +
            +
          • Implement DirMove (Nick Craig-Wood)
          • +
          • Fix error code parsing (alexia)
          • +
        • +
        • FTP +
            +
          • Add socks_proxy support for SOCKS5 proxies (Zach)
          • +
          • Fix 425 "TLS session of data connection not resumed" errors (Nick Craig-Wood)
          • +
        • +
        • Hdfs +
            +
          • Retry "replication in progress" errors when uploading (Nick Craig-Wood)
          • +
          • Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood)
          • +
        • +
        • HTTP +
            +
          • CORS should not be sent if not set (yuudi)
          • +
          • Fix webdav OPTIONS response (yuudi)
          • +
        • +
        • Opendrive +
            +
          • Fix List on a just deleted and remade directory (Nick Craig-Wood)
          • +
        • +
        • Oracleobjectstorage +
            +
          • Use rclone's rate limiter in multipart transfers (Manoj Ghosh)
          • +
          • Implement OpenChunkWriter and multi-thread uploads (Manoj Ghosh)
          • +
        • +
        • S3 +
            +
          • Refactor multipart upload to use OpenChunkWriter and ChunkWriter (Vitor Gomes)
          • +
          • Factor generic multipart upload into lib/multipart (Nick Craig-Wood)
          • +
          • Fix purging of root directory with --s3-directory-markers (Nick Craig-Wood)
          • +
          • Add rclone backend set command to update the running config (Nick Craig-Wood)
          • +
          • Add rclone backend restore-status command (Nick Craig-Wood)
          • +
        • +
        • SFTP +
            +
          • Stop uploads re-using the same ssh connection to improve performance (Nick Craig-Wood)
          • +
          • Add --sftp-ssh to specify an external ssh binary to use (Nick Craig-Wood)
          • +
          • Add socks_proxy support for SOCKS5 proxies (Zach)
          • +
          • Support dynamic --sftp-path-override (nielash)
          • +
          • Fix spurious warning when using --sftp-ssh (Nick Craig-Wood)
          • +
        • +
        • Smb +
            +
          • Implement multi-threaded writes for copies to smb (Edwin Mackenzie-Owen)
          • +
        • +
        • Storj +
            +
          • Performance improvement for large file uploads (Kaloyan Raev)
          • +
        • +
        • Swift +
            +
          • Fix HEADing 0-length objects when --swift-no-large-objects set (Julian Lepinski)
          • +
        • +
        • Union +
            +
          • Add :writback to act as a simple cache (Nick Craig-Wood)
          • +
        • +
        • WebDAV +
            +
          • Nextcloud: fix segment violation in low-level retry (Paul)
          • +
        • +
        • Zoho +
            +
          • Remove Range requests workarounds to fix integration tests (Nick Craig-Wood)
          • +
        • +
        +

        v1.63.1 - 2023-07-17

        +

        See commits

        +
          +
        • Bug Fixes +
            +
          • build: Fix macos builds for versions < 12 (Anagh Kumar Baranwal)
          • +
          • dirtree: Fix performance with large directories of directories and --fast-list (Nick Craig-Wood)
          • +
          • operations +
              +
            • Fix deadlock when using lsd/ls with --progress (Nick Craig-Wood)
            • +
            • Fix .rclonelink files not being converted back to symlinks (Nick Craig-Wood)
            • +
          • +
          • doc fixes (Dean Attali, Mahad, Nick Craig-Wood, Sawada Tsunayoshi, Vladislav Vorobev)
          • +
        • +
        • Local +
            +
          • Fix partial directory read for corrupted filesystem (Nick Craig-Wood)
          • +
        • +
        • Box +
            +
          • Fix reconnect failing with HTTP 400 Bad Request (albertony)
          • +
        • +
        • Smb +
            +
          • Fix "Statfs failed: bucket or container name is needed" when mounting (Nick Craig-Wood)
          • +
        • +
        • WebDAV +
            +
          • Nextcloud: fix must use /dav/files/USER endpoint not /webdav error (Paul)
          • +
          • Nextcloud chunking: add more guidance for the user to check the config (darix)
          • +
        • +
        +

        v1.63.0 - 2023-06-30

        +

        See commits

        +
          +
        • New backends +
        • +
        • Major changes +
            +
          • Files will be copied to a temporary name ending in .partial when copying to local,ftp,sftp then renamed at the end of the transfer. (Janne Hellsten, Nick Craig-Wood) +
              +
            • This helps with data integrity as we don't delete the existing file until the new one is complete.
            • +
            • It can be disabled with the --inplace flag.
            • +
            • This behaviour will also happen if the backend is wrapped, for example sftp wrapped with crypt.
            • +
          • +
          • The s3, azureblob and gcs backends now support directory markers so empty directories are supported (Jānis Bebrītis, Nick Craig-Wood)
          • +
          • The --default-time flag now controls the unknown modification time of files/dirs (Nick Craig-Wood) +
              +
            • If a file or directory does not have a modification time rclone can read then rclone will display this fixed time instead.
            • +
            • For the old behaviour use --default-time 0s which will set this time to the time rclone started up.
            • +
          • +
        • +
        • New Features +
            +
          • build +
              +
            • Modernise linters in use and fixup all affected code (albertony)
            • +
            • Push docker beta to GHCR (GitHub container registry) (Richard Tweed)
            • +
          • +
          • cat: Add --separator option to cat command (Loren Gordon)
          • +
          • config +
              +
            • Do not remove/overwrite other files during config file save (albertony)
            • +
            • Do not overwrite config file symbolic link (albertony)
            • +
            • Stop config create making invalid config files (Nick Craig-Wood)
            • +
          • +
          • doc updates (Adam K, Aditya Basu, albertony, asdffdsazqqq, Damo, danielkrajnik, Dimitri Papadopoulos, dlitster, Drew Parsons, jumbi77, kapitainsky, mac-15, Mariusz Suchodolski, Nick Craig-Wood, NickIAm, Rintze Zelle, Stanislav Gromov, Tareq Sharafy, URenko, yuudi, Zach Kipp)
          • +
          • fs +
              +
            • Add size to JSON logs when moving or copying an object (Nick Craig-Wood)
            • +
            • Allow boolean features to be enabled with --disable !Feature (Nick Craig-Wood)
            • +
          • +
          • genautocomplete: Rename to completion with alias to the old name (Nick Craig-Wood)
          • +
          • librclone: Added example on using librclone with Go (alankrit)
          • +
          • lsjson: Make --stat more efficient (Nick Craig-Wood)
          • +
          • operations +
              +
            • Implement --multi-thread-write-buffer-size for speed improvements on downloads (Paulo Schreiner)
            • +
            • Reopen downloads on error when using check --download and cat (Nick Craig-Wood)
            • +
          • +
          • rc: config/listremotes includes remotes defined with environment variables (kapitainsky)
          • +
          • selfupdate: Obey --no-check-certificate flag (Nick Craig-Wood)
          • +
          • serve restic: Trigger systemd notify (Shyim)
          • +
          • serve webdav: Implement owncloud checksum and modtime extensions (WeidiDeng)
          • +
          • sync: --suffix-keep-extension preserve 2 part extensions like .tar.gz (Nick Craig-Wood)
          • +
        • +
        • Bug Fixes +
            +
          • accounting +
              +
            • Fix Prometheus metrics to be the same as core/stats (Nick Craig-Wood)
            • +
            • Bwlimit signal handler should always start (Sam Lai)
            • +
          • +
          • bisync: Fix maxDelete parameter being ignored via the rc (Nick Craig-Wood)
          • +
          • cmd/ncdu: Fix screen corruption when logging (eNV25)
          • +
          • filter: Fix deadlock with errors on --files-from (douchen)
          • +
          • fs +
              +
            • Fix interaction between --progress and --interactive (Nick Craig-Wood)
            • +
            • Fix infinite recursive call in pacer ModifyCalculator (fixes issue reported by the staticcheck linter) (albertony)
            • +
          • +
          • lib/atexit: Ensure OnError only calls cancel function once (Nick Craig-Wood)
          • +
          • lib/rest: Fix problems re-using HTTP connections (Nick Craig-Wood)
          • +
          • rc +
              +
            • Fix operations/stat with trailing / (Nick Craig-Wood)
            • +
            • Fix missing --rc flags (Nick Craig-Wood)
            • +
            • Fix output of Time values in options/get (Nick Craig-Wood)
            • +
          • +
          • serve dlna: Fix potential data race (Nick Craig-Wood)
          • +
          • version: Fix reported os/kernel version for windows (albertony)
          • +
        • +
        • Mount +
            +
          • Add --mount-case-insensitive to force the mount to be case insensitive (Nick Craig-Wood)
          • +
          • Removed unnecessary byte slice allocation for reads (Anagh Kumar Baranwal)
          • +
          • Clarify rclone mount error when installed via homebrew (Nick Craig-Wood)
          • +
          • Added _netdev to the example mount so it gets treated as a remote-fs rather than local-fs (Anagh Kumar Baranwal)
          • +
        • +
        • Mount2 +
            +
          • Updated go-fuse version (Anagh Kumar Baranwal)
          • +
          • Fixed statfs (Anagh Kumar Baranwal)
          • +
          • Disable xattrs (Anagh Kumar Baranwal)
          • +
        • +
        • VFS +
            +
          • Add MkdirAll function to make a directory and all beneath (Nick Craig-Wood)
          • +
          • Fix reload: failed to add virtual dir entry: file does not exist (Nick Craig-Wood)
          • +
          • Fix writing to a read only directory creating spurious directory entries (WeidiDeng)
          • +
          • Fix potential data race (Nick Craig-Wood)
          • +
          • Fix backends being Shutdown too early when startup takes a long time (Nick Craig-Wood)
          • +
        • +
        • Local +
            +
          • Fix filtering of symlinks with -l/--links flag (Nick Craig-Wood)
          • +
          • Fix /path/to/file.rclonelink when -l/--links is in use (Nick Craig-Wood)
          • +
          • Fix crash with --metadata on Android (Nick Craig-Wood)
          • +
        • +
        • Cache +
            +
          • Fix backends shutting down when in use when used via the rc (Nick Craig-Wood)
          • +
        • +
        • Crypt +
            +
          • Add --crypt-suffix option to set a custom suffix for encrypted files (jladbrook)
          • +
          • Add --crypt-pass-bad-blocks to allow corrupted file output (Nick Craig-Wood)
          • +
          • Fix reading 0 length files (Nick Craig-Wood)
          • +
          • Try not to return "unexpected EOF" error (Nick Craig-Wood)
          • +
          • Reduce allocations (albertony)
          • +
          • Recommend Dropbox for base32768 encoding (Nick Craig-Wood)
          • +
        • +
        • Azure Blob +
            +
          • Empty directory markers (Nick Craig-Wood)
          • +
          • Support azure workload identities (Tareq Sharafy)
          • +
          • Fix azure blob uploads with multiple bits of metadata (Nick Craig-Wood)
          • +
          • Fix azurite compatibility by sending nil tier if set to empty string (Roel Arents)
          • +
        • +
        • Combine +
            +
          • Implement missing methods (Nick Craig-Wood)
          • +
          • Fix goroutine stack overflow on bad object (Nick Craig-Wood)
          • +
        • +
        • Drive +
            +
          • Add --drive-env-auth to get IAM credentials from runtime (Peter Brunner)
          • +
          • Update drive service account guide (Juang, Yi-Lin)
          • +
          • Fix change notify picking up files outside the root (Nick Craig-Wood)
          • +
          • Fix trailing slash mis-identificaton of folder as file (Nick Craig-Wood)
          • +
          • Fix incorrect remote after Update on object (Nick Craig-Wood)
          • +
        • +
        • Dropbox +
            +
          • Implement --dropbox-pacer-min-sleep flag (Nick Craig-Wood)
          • +
          • Fix the dropbox batcher stalling (Misty)
          • +
        • +
        • Fichier +
            +
          • Add --ficicher-cdn option to use the CDN for download (Nick Craig-Wood)
          • +
        • +
        • FTP +
            +
          • Lower log message priority when SetModTime is not supported to debug (Tobias Gion)
          • +
          • Fix "unsupported LIST line" errors on startup (Nick Craig-Wood)
          • +
          • Fix "501 Not a valid pathname." errors when creating directories (Nick Craig-Wood)
          • +
        • +
        • Google Cloud Storage +
            +
          • Empty directory markers (Jānis Bebrītis, Nick Craig-Wood)
          • +
          • Added --gcs-user-project needed for requester pays (Christopher Merry)
          • +
        • +
        • HTTP +
            +
          • Add client certificate user auth middleware. This can auth serve restic from the username in the client cert. (Peter Fern)
          • +
        • +
        • Jottacloud
            -
          • "true" +
          • Fix vfs writeback stuck in a failed upload loop with file versioning disabled (albertony)
          • +
        • +
        • Onedrive
            -
          • Disables long file names.
          • +
          • Add --onedrive-av-override flag to download files flagged as virus (Nick Craig-Wood)
          • +
          • Fix quickxorhash on 32 bit architectures (Nick Craig-Wood)
          • +
          • Report any list errors during rclone cleanup (albertony)
        • +
        • Putio +
            +
          • Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood)
          • +
          • Fix modification times not being preserved for server side copy and move (Nick Craig-Wood)
          • +
          • Fix server side copy failures (400 errors) (Nick Craig-Wood)
        • -
        - -

        Follow symlinks and copy the pointed to item.

        -

        Properties:

        +
      79. S3
          -
        • Config: copy_links
        • -
        • Env Var: RCLONE_LOCAL_COPY_LINKS
        • -
        • Type: bool
        • -
        • Default: false
        • -
        - -

        Translate symlinks to/from regular files with a '.rclonelink' extension.

        -

        Properties:

        +
      80. Empty directory markers (Jānis Bebrītis, Nick Craig-Wood)
      81. +
      82. Update Scaleway storage classes (Brian Starkey)
      83. +
      84. Fix --s3-versions on individual objects (Nick Craig-Wood)
      85. +
      86. Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood)
      87. +
      88. Fix missing "tier" metadata (Nick Craig-Wood)
      89. +
      90. Fix V3sign: add missing subresource delete (cc)
      91. +
      92. Fix Arvancloud Domain and region changes and alphabetise the provider (Ehsan Tadayon)
      93. +
      94. Fix Qiniu KODO quirks virtualHostStyle is false (zzq)
      95. + +
      96. SFTP
          -
        • Config: links
        • -
        • Env Var: RCLONE_LOCAL_LINKS
        • -
        • Type: bool
        • -
        • Default: false
        • -
        - -

        Don't warn about skipped symlinks.

        -

        This flag disables warning messages on skipped symlinks or junction points, as you explicitly acknowledge that they should be skipped.

        -

        Properties:

        +
      97. Add --sftp-host-key-algorithms to allow specifying SSH host key algorithms (Joel)
      98. +
      99. Fix using --sftp-key-use-agent and --sftp-key-file together needing private key file (Arnav Singh)
      100. +
      101. Fix move to allow overwriting existing files (Nick Craig-Wood)
      102. +
      103. Don't stat directories before listing them (Nick Craig-Wood)
      104. +
      105. Don't check remote points to a file if it ends with / (Nick Craig-Wood)
      106. + +
      107. Sharefile
          -
        • Config: skip_links
        • -
        • Env Var: RCLONE_LOCAL_SKIP_LINKS
        • -
        • Type: bool
        • -
        • Default: false
        • -
        - -

        Assume the Stat size of links is zero (and read them instead) (deprecated).

        -

        Rclone used to use the Stat size of links as the link size, but this fails in quite a few places:

        +
      108. Disable streamed transfers as they no longer work (Nick Craig-Wood)
      109. + +
      110. Smb
          -
        • Windows
        • -
        • On some virtual filesystems (such ash LucidLink)
        • -
        • Android
        • -
        -

        So rclone now always reads the link.

        -

        Properties:

        +
      111. Code cleanup to avoid overwriting ctx before first use (fixes issue reported by the staticcheck linter) (albertony)
      112. + +
      113. Storj
          -
        • Config: zero_size_links
        • -
        • Env Var: RCLONE_LOCAL_ZERO_SIZE_LINKS
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --local-unicode-normalization

        -

        Apply unicode NFC normalization to paths and filenames.

        -

        This flag can be used to normalize file names into unicode NFC form that are read from the local filesystem.

        -

        Rclone does not normally touch the encoding of file names it reads from the file system.

        -

        This can be useful when using macOS as it normally provides decomposed (NFD) unicode which in some language (eg Korean) doesn't display properly on some OSes.

        -

        Note that rclone compares filenames with unicode normalization in the sync routine so this flag shouldn't normally be used.

        -

        Properties:

        +
      114. Fix "uplink: too many requests" errors when uploading to the same file (Nick Craig-Wood)
      115. +
      116. Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood)
      117. + +
      118. Swift
          -
        • Config: unicode_normalization
        • -
        • Env Var: RCLONE_LOCAL_UNICODE_NORMALIZATION
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --local-no-check-updated

        -

        Don't check to see if the files change during upload.

        -

        Normally rclone checks the size and modification time of files as they are being uploaded and aborts with a message which starts "can't copy - source file is being updated" if the file changes during upload.

        -

        However on some file systems this modification time check may fail (e.g. Glusterfs #2206) so this check can be disabled with this flag.

        -

        If this flag is set, rclone will use its best efforts to transfer a file which is being updated. If the file is only having things appended to it (e.g. a log) then rclone will transfer the log file with the size it had the first time rclone saw it.

        -

        If the file is being modified throughout (not just appended to) then the transfer may fail with a hash check failure.

        -

        In detail, once the file has had stat() called on it for the first time we:

        +
      119. Ignore 404 error when deleting an object (Nick Craig-Wood)
      120. + +
      121. Union
          -
        • Only transfer the size that stat gave
        • -
        • Only checksum the size that stat gave
        • -
        • Don't update the stat info for the file
        • -
        -

        Properties:

        +
      122. Implement missing methods (Nick Craig-Wood)
      123. +
      124. Allow errors to be unwrapped for inspection (Nick Craig-Wood)
      125. + +
      126. Uptobox
          -
        • Config: no_check_updated
        • -
        • Env Var: RCLONE_LOCAL_NO_CHECK_UPDATED
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --one-file-system / -x

        -

        Don't cross filesystem boundaries (unix/macOS only).

        -

        Properties:

        +
      127. Add --uptobox-private flag to make all uploaded files private (Nick Craig-Wood)
      128. +
      129. Fix improper regex (Aaron Gokaslan)
      130. +
      131. Fix Update returning the wrong object (Nick Craig-Wood)
      132. +
      133. Fix rmdir declaring that directories weren't empty (Nick Craig-Wood)
      134. + +
      135. WebDAV
          -
        • Config: one_file_system
        • -
        • Env Var: RCLONE_LOCAL_ONE_FILE_SYSTEM
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --local-case-sensitive

        -

        Force the filesystem to report itself as case sensitive.

        -

        Normally the local backend declares itself as case insensitive on Windows/macOS and case sensitive for everything else. Use this flag to override the default choice.

        -

        Properties:

        +
      136. nextcloud: Add support for chunked uploads (Paul)
      137. +
      138. Set modtime using propset for owncloud and nextcloud (WeidiDeng)
      139. +
      140. Make pacer minSleep configurable with --webdav-pacer-min-sleep (ed)
      141. +
      142. Fix server side copy/move not overwriting (WeidiDeng)
      143. +
      144. Fix modtime on server side copy for owncloud and nextcloud (Nick Craig-Wood)
      145. + +
      146. Yandex
          -
        • Config: case_sensitive
        • -
        • Env Var: RCLONE_LOCAL_CASE_SENSITIVE
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --local-case-insensitive

        -

        Force the filesystem to report itself as case insensitive.

        -

        Normally the local backend declares itself as case insensitive on Windows/macOS and case sensitive for everything else. Use this flag to override the default choice.

        -

        Properties:

        +
      147. Fix 400 Bad Request on transfer failure (Nick Craig-Wood)
      148. + +
      149. Zoho
          -
        • Config: case_insensitive
        • -
        • Env Var: RCLONE_LOCAL_CASE_INSENSITIVE
        • -
        • Type: bool
        • -
        • Default: false
        • +
        • Fix downloads with Range: header returning the wrong data (Nick Craig-Wood)
        • +
      150. -

        --local-no-preallocate

        -

        Disable preallocation of disk space for transferred files.

        -

        Preallocation of disk space helps prevent filesystem fragmentation. However, some virtual filesystem layers (such as Google Drive File Stream) may incorrectly set the actual file size equal to the preallocated space, causing checksum and file size checks to fail. Use this flag to disable preallocation.

        -

        Properties:

        +

        v1.62.2 - 2023-03-16

        +

        See commits

          -
        • Config: no_preallocate
        • -
        • Env Var: RCLONE_LOCAL_NO_PREALLOCATE
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --local-no-sparse

        -

        Disable sparse files for multi-thread downloads.

        -

        On Windows platforms rclone will make sparse files when doing multi-thread downloads. This avoids long pauses on large files where the OS zeros the file. However sparse files may be undesirable as they cause disk fragmentation and can be slow to work with.

        -

        Properties:

        +
      151. Bug Fixes
          -
        • Config: no_sparse
        • -
        • Env Var: RCLONE_LOCAL_NO_SPARSE
        • -
        • Type: bool
        • -
        • Default: false
        • -
        -

        --local-no-set-modtime

        -

        Disable setting modtime.

        -

        Normally rclone updates modification time of files after they are done uploading. This can cause permissions issues on Linux platforms when the user rclone is running as does not own the file uploaded, such as when copying to a CIFS mount owned by another user. If this option is enabled, rclone will no longer update the modtime after copying a file.

        -

        Properties:

        +
      152. docker volume plugin: Add missing fuse3 dependency (Nick Craig-Wood)
      153. +
      154. docs: Fix size documentation (asdffdsazqqq)
      155. + +
      156. FTP
          -
        • Config: no_set_modtime
        • -
        • Env Var: RCLONE_LOCAL_NO_SET_MODTIME
        • -
        • Type: bool
        • -
        • Default: false
        • +
        • Fix 426 errors on downloads with vsftpd (Lesmiscore)
        • +
      157. -

        --local-encoding

        -

        The encoding for the backend.

        -

        See the encoding section in the overview for more info.

        -

        Properties:

        +

        v1.62.1 - 2023-03-15

        +

        See commits

          -
        • Config: encoding
        • -
        • Env Var: RCLONE_LOCAL_ENCODING
        • -
        • Type: MultiEncoder
        • -
        • Default: Slash,Dot
        • -
        -

        Metadata

        -

        Depending on which OS is in use the local backend may return only some of the system metadata. Setting system metadata is supported on all OSes but setting user metadata is only supported on linux, freebsd, netbsd, macOS and Solaris. It is not supported on Windows yet (see pkg/attrs#47).

        -

        User metadata is stored as extended attributes (which may not be supported by all file systems) under the "user.*" prefix.

        -

        Here are the possible system metadata items for the local backend.

        - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        NameHelpTypeExampleRead Only
        atimeTime of last accessRFC 33392006-01-02T15:04:05.999999999Z07:00N
        btimeTime of file birth (creation)RFC 33392006-01-02T15:04:05.999999999Z07:00N
        gidGroup ID of ownerdecimal number500N
        modeFile type and modeoctal, unix style0100664N
        mtimeTime of last modificationRFC 33392006-01-02T15:04:05.999999999Z07:00N
        rdevDevice ID (if special file)hexadecimal1abcN
        uidUser ID of ownerdecimal number500N
        -

        See the metadata docs for more info.

        -

        Backend commands

        -

        Here are the commands specific to the local backend.

        -

        Run them with

        -
        rclone backend COMMAND remote:
        -

        The help below will explain what arguments each command takes.

        -

        See the backend command for more info on how to pass options and arguments.

        -

        These can be run on a running backend using the rc command backend/command.

        -

        noop

        -

        A null operation for testing backend commands

        -
        rclone backend noop remote: [options] [<arguments>+]
        -

        This is a test command which has some options you can try to change the output.

        -

        Options:

        +
      158. Bug Fixes
          -
        • "echo": echo the input arguments
        • -
        • "error": return an error based on option value
        • +
        • docker: Add missing fuse3 dependency (cycneuramus)
        • +
        • build: Update release docs to be more careful with the tag (Nick Craig-Wood)
        • +
        • build: Set Github release to draft while uploading binaries (Nick Craig-Wood)
        • +
      159. -

        Changelog

        v1.62.0 - 2023-03-14

        See commits

          @@ -32883,8 +40051,8 @@

          v1.52.0 - 2020-05-27

          • Calculate hashes for uploads from local disk (Nick Craig-Wood)
              -
            • This allows crypted Jottacloud uploads without using local disk
            • -
            • This means crypted s3/b2 uploads will now have hashes
            • +
            • This allows encrypted Jottacloud uploads without using local disk
            • +
            • This means encrypted s3/b2 uploads will now have hashes
          • Added rclone backend decode/encode commands to replicate functionality of cryptdecode (Anagh Kumar Baranwal)
          • Get rid of the unused Cipher interface as it obfuscated the code (Nick Craig-Wood)
          • @@ -34690,7 +41858,7 @@

            v1.42 - 2018-06-16

        • Crypt
            -
          • Check the crypted hash of files when uploading for extra data security
          • +
          • Check the encrypted hash of files when uploading for extra data security
        • Dropbox
            @@ -35245,7 +42413,7 @@

            v1.38 - 2017-09-30

            • rcat - read from standard input and stream upload
            • tree - shows a nicely formatted recursive listing
            • -
            • cryptdecode - decode crypted file names (thanks ishuah)
            • +
            • cryptdecode - decode encrypted file names (thanks ishuah)
            • config show - print the config file
            • config file - print the config file location
            @@ -35281,7 +42449,7 @@

            v1.38 - 2017-09-30

        • Mount
            -
          • Re-use rcat internals to support uploads from all remotes
          • +
          • Reuse rcat internals to support uploads from all remotes
        • Dropbox
            @@ -35688,7 +42856,7 @@

            v1.34 - 2016-11-06

          • Delete src files which already existed in dst
          • Fix deletion of src file when dst file older
        • -
        • Fix rclone check on crypted file systems
        • +
        • Fix rclone check on encrypted file systems
        • Make failed uploads not count as "Transferred"
        • Make sure high level retries show with -q
        • Use a vendor directory with godep for repeatable builds
        • @@ -36456,7 +43624,7 @@

          v0.00 - 2012-11-18

        • Project started

        Bugs and Limitations

        -

        Limitations

        +

        Limitations

        Directory timestamps aren't preserved

        Rclone doesn't currently preserve the timestamps of directories. This is because rclone only really considers objects when syncing.

        Rclone struggles with millions of files in a directory/bucket

        @@ -36465,7 +43633,7 @@

        Rclone str

        Bucket-based remotes and folders

        Bucket-based remotes (e.g. S3/GCS/Swift/B2) do not have a concept of directories. Rclone therefore cannot create directories in them which means that empty directories on a bucket-based remote will tend to disappear.

        Some software creates empty keys ending in / as directory markers. Rclone doesn't do this as it potentially creates more objects and costs more. This ability may be added in the future (probably via a flag/option).

        -

        Bugs

        +

        Bugs

        Bugs are stored in rclone's GitHub project:

        • Reported bugs
        • @@ -36544,7 +43712,14 @@

          tcp lookup some.domain.com no s dig www.googleapis.com # resolve using your default DNS dig www.googleapis.com @8.8.8.8 # resolve with Google's DNS server

    If you are using systemd-resolved (default on Arch Linux), ensure it is at version 233 or higher. Previous releases contain a bug which causes not all domains to be resolved properly.

    -

    Additionally with the GODEBUG=netdns= environment variable the Go resolver decision can be influenced. This also allows to resolve certain issues with DNS resolution. See the name resolution section in the go docs.

    +

    The Go resolver decision can be influenced with the GODEBUG=netdns=... environment variable. This also allows to resolve certain issues with DNS resolution. On Windows or MacOS systems, try forcing use of the internal Go resolver by setting GODEBUG=netdns=go at runtime. On other systems (Linux, *BSD, etc) try forcing use of the system name resolver by setting GODEBUG=netdns=cgo (and recompile rclone from source with CGO enabled if necessary). See the name resolution section in the go docs.

    +

    Failed to start auth webserver on Windows

    +
    Error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
    +...
    +yyyy/mm/dd hh:mm:ss Fatal error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
    +

    This is sometimes caused by the Host Network Service causing issues with opening the port on the host.

    +

    A simple solution may be restarting the Host Network Service with eg. Powershell

    +
    Restart-Service hns

    The total size reported in the stats for a sync is wrong and keeps changing

    It is likely you have more than 10,000 files that need to be synced. By default, rclone only gets 10,000 files ahead in a sync so as not to use up too much memory. You can change this default with the --max-backlog flag.

    Rclone is using too much memory or appears to have a memory leak

    @@ -36581,7 +43756,7 @@

    Authors

  • Nick Craig-Wood
  • Contributors

    -

    {{< rem email addresses removed from here need to be addeed to bin/.ignore-emails to make sure update-authors.py doesn't immediately put them back in again. >}}

    +

    {{< rem email addresses removed from here need to be added to bin/.ignore-emails to make sure update-authors.py doesn't immediately put them back in again. >}}

    Contact the rclone project

    Forum

    @@ -37268,6 +44553,12 @@

    Forum

    • https://forum.rclone.org
    +

    Business support

    +

    For business support or sponsorship enquiries please see:

    +
      +
    • https://rclone.com/
    • +
    • sponsorship@rclone.com
    • +

    GitHub repository

    The project's repository is located at:

      @@ -37275,11 +44566,15 @@

      GitHub repository

    There you can file bug reports or contribute with pull requests.

    Twitter

    -

    You can also follow me on twitter for rclone announcements:

    +

    You can also follow Nick on twitter for rclone announcements:

    • [@njcw](https://twitter.com/njcw)

    Email

    -

    Or if all else fails or you want to ask something private or confidential email Nick Craig-Wood. Please don't email me requests for help - those are better directed to the forum. Thanks!

    +

    Or if all else fails or you want to ask something private or confidential

    +
      +
    • info@rclone.com
    • +
    +

    Please don't email requests for help to this address - those are better directed to the forum unless you'd like to sign up for business support.

    diff --git a/MANUAL.md b/MANUAL.md index 430ad23bc54a1..13bee7b753b3e 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -1,6 +1,6 @@ % rclone(1) User Manual % Nick Craig-Wood -% Mar 14, 2023 +% Nov 26, 2023 # Rclone syncs your files to cloud storage @@ -18,7 +18,7 @@ Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage -interfaces. [Over 40 cloud storage products](#providers) support +interfaces. [Over 70 cloud storage products](#providers) support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols. @@ -118,6 +118,7 @@ WebDAV or S3, that work out of the box.) - Dreamhost - Dropbox - Enterprise File Fabric +- Fastmail Files - FTP - Google Cloud Storage - Google Drive @@ -132,26 +133,35 @@ WebDAV or S3, that work out of the box.) - IDrive e2 - IONOS Cloud - Koofr +- Leviia Object Storage - Liara Object Storage +- Linkbox +- Linode Object Storage - Mail.ru Cloud - Memset Memstore - Mega - Memory - Microsoft Azure Blob Storage +- Microsoft Azure Files Storage - Microsoft OneDrive - Minio - Nextcloud - OVH +- Blomp Cloud Storage - OpenDrive - OpenStack Swift - Oracle Cloud Storage Swift - Oracle Object Storage - ownCloud - pCloud +- Petabox +- PikPak - premiumize.me - put.io +- Proton Drive - QingStor - Qiniu Cloud Object Storage (Kodo) +- Quatrix by Maytech - Rackspace Cloud Files - rsync.net - Scaleway @@ -163,6 +173,7 @@ WebDAV or S3, that work out of the box.) - SMB / CIFS - StackPath - Storj +- Synology - SugarSync - Tencent Cloud Object Storage (COS) - Uptobox @@ -213,6 +224,9 @@ run `rclone -h`. Already installed rclone can be easily updated to the latest version using the [rclone selfupdate](https://rclone.org/commands/rclone_selfupdate/) command. +See [the release signing docs](https://rclone.org/release_signing/) for how to verify +signatures on the release. + ## Script installation To install rclone on Linux/macOS/BSD systems, run: @@ -268,6 +282,19 @@ developers so it may be out of date. Its current version is as below. [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/rclone.svg)](https://repology.org/project/rclone/versions) +### Installation with MacPorts (#macos-macports) + +On macOS, rclone can also be installed via [MacPorts](https://www.macports.org): + + sudo port install rclone + +Note that this is a third party installer not controlled by the rclone +developers so it may be out of date. Its current version is as below. + +[![MacPorts port](https://repology.org/badge/version-for-repo/macports/rclone.svg)](https://repology.org/project/rclone/versions) + +More information [here](https://ports.macports.org/port/rclone/). + ### Precompiled binary, using curl {#macos-precompiled} To avoid problems with macOS gatekeeper enforcing the binary to be signed and @@ -337,9 +364,14 @@ feature then you will need to install the third party utility [Winget](https://learn.microsoft.com/en-us/windows/package-manager/) comes pre-installed with the latest versions of Windows. If not, update the [App Installer](https://www.microsoft.com/p/app-installer/9nblggh4nns1) package from the Microsoft store. +To install rclone ``` winget install Rclone.Rclone ``` +To uninstall rclone +``` +winget uninstall Rclone.Rclone --force +``` ### Chocolatey package manager {#windows-chocolatey} @@ -449,10 +481,16 @@ Here are some commands tested on an Ubuntu 18.04.3 host: # config on host at ~/.config/rclone/rclone.conf # data on host at ~/data +# add a remote interactively +docker run --rm -it \ + --volume ~/.config/rclone:/config/rclone \ + --user $(id -u):$(id -g) \ + rclone/rclone \ + config + # make sure the config is ok by listing the remotes docker run --rm \ --volume ~/.config/rclone:/config/rclone \ - --volume ~/data:/data:shared \ --user $(id -u):$(id -g) \ rclone/rclone \ listremotes @@ -470,11 +508,33 @@ docker run --rm \ ls ~/data/mount kill %1 ``` +## Snap installation {#snap} + +[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/rclone) + +Make sure you have [Snapd installed](https://snapcraft.io/docs/installing-snapd) + +```bash +$ sudo snap install rclone +``` +Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below. + +- Default config directory: + - /home/$USER/snap/rclone/current/.config/rclone + +Note: Due to the strict confinement of Snap, `rclone mount` feature is `not` supported. + +If mounting is wanted, either install a precompiled binary or enable the relevant option when [installing from source](#source). + +Note that this is controlled by [community maintainer](https://github.com/boukendesho/rclone-snap) not the rclone developers so it may be out of date. Its current version is as below. + +[![rclone](https://snapcraft.io/rclone/badge.svg)](https://snapcraft.io/rclone) + ## Source installation {#source} Make sure you have git and [Go](https://golang.org/) installed. -Go version 1.17 or newer is required, latest release is recommended. +Go version 1.18 or newer is required, the latest release is recommended. You can get it from your package manager, or download it from [golang.org/dl](https://golang.org/dl/). Then you can run the following: @@ -508,26 +568,59 @@ port of GCC, e.g. by installing it in a [MSYS2](https://www.msys2.org) distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible). -Additionally, on Windows, you must install the third party utility -[WinFsp](https://winfsp.dev/), with the "Developer" feature selected. +Additionally, to build with mount on Windows, you must install the third party +utility [WinFsp](https://winfsp.dev/), with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally `C:\Program Files (x86)\WinFsp\inc\fuse`). -You may also add arguments `-ldflags -s` (with or without `-tags cmount`), -to omit symbol table and debug information, making the executable file smaller, -and `-trimpath` to remove references to local file system paths. This is how -the official rclone releases are built. +You may add arguments `-ldflags -s` to omit symbol table and debug information, +making the executable file smaller, and `-trimpath` to remove references to +local file system paths. The official rclone releases are built with both of these. ``` go build -trimpath -ldflags -s -tags cmount ``` +If you want to customize the version string, as reported by +the `rclone version` command, you can set one of the variables `fs.Version`, +`fs.VersionTag` (to keep default suffix but customize the number), +or `fs.VersionSuffix` (to keep default number but customize the suffix). +This can be done from the build command, by adding to the `-ldflags` +argument value as shown below. + +``` +go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount +``` + +On Windows, the official executables also have the version information, +as well as a file icon, embedded as binary resources. To get that with your +own build you need to run the following command **before** the build command. +It generates a Windows resource system object file, with extension .syso, e.g. +`resource_windows_amd64.syso`, that will be automatically picked up by +future build commands. + +``` +go run bin/resource_windows.go +``` + +The above command will generate a resource file containing version information +based on the fs.Version variable in source at the time you run the command, +which means if the value of this variable changes you need to re-run the +command for it to be reflected in the version information. Also, if you +override this version variable in the build command as described above, you +need to do that also when generating the resource file, or else it will still +use the value from the source. + +``` +go run bin/resource_windows.go -version v9.9.9-test +``` + Instead of executing the `go build` command directly, you can run it via the -Makefile. It changes the version number suffix from "-DEV" to "-beta" and -appends commit details. It also copies the resulting rclone executable into -your GOPATH bin folder (`$(go env GOPATH)/bin`, which corresponds to -`~/go/bin/rclone` by default). +Makefile. The default target changes the version suffix from "-DEV" to "-beta" +followed by additional commit details, embeds version information binary resources +on Windows, and copies the resulting rclone executable into your GOPATH bin folder +(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default). ``` make @@ -540,32 +633,22 @@ make GOTAGS=cmount ``` There are other make targets that can be used for more advanced builds, -such as cross-compiling for all supported os/architectures, embedding -icon and version info resources into windows executable, and packaging +such as cross-compiling for all supported os/architectures, and packaging results into release artifacts. See [Makefile](https://github.com/rclone/rclone/blob/master/Makefile) and [cross-compile.go](https://github.com/rclone/rclone/blob/master/bin/cross-compile.go) for details. -Another alternative is to download the source, build and install rclone in one -operation, as a regular Go package. The source will be stored it in the Go -module cache, and the resulting executable will be in your GOPATH bin folder -(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default). - -With Go version 1.17 or newer: +Another alternative method for source installation is to download the source, +build and install rclone - all in one operation, as a regular Go package. +The source will be stored it in the Go module cache, and the resulting +executable will be in your GOPATH bin folder (`$(go env GOPATH)/bin`, +which corresponds to `~/go/bin/rclone` by default). ``` go install github.com/rclone/rclone@latest ``` -With Go versions older than 1.17 (do **not** use the `-u` flag, it causes Go to -try to update the dependencies that rclone uses and sometimes these don't work -with the current version): - -``` -go get github.com/rclone/rclone -``` - ## Ansible installation {#ansible} This can be done with [Stefan Weichinger's ansible @@ -727,7 +810,7 @@ It requires .NET Framework, but it is preinstalled on newer versions of Windows, also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage -as it is easy to back up and re-use the configuration +as it is easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter). @@ -797,18 +880,23 @@ See the following for detailed instructions for * [Internet Archive](https://rclone.org/internetarchive/) * [Jottacloud](https://rclone.org/jottacloud/) * [Koofr](https://rclone.org/koofr/) + * [Linkbox](https://rclone.org/linkbox/) * [Mail.ru Cloud](https://rclone.org/mailru/) * [Mega](https://rclone.org/mega/) * [Memory](https://rclone.org/memory/) * [Microsoft Azure Blob Storage](https://rclone.org/azureblob/) + * [Microsoft Azure Files Storage](https://rclone.org/azurefiles/) * [Microsoft OneDrive](https://rclone.org/onedrive/) - * [OpenStack Swift / Rackspace Cloudfiles / Memset Memstore](https://rclone.org/swift/) + * [OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset Memstore](https://rclone.org/swift/) * [OpenDrive](https://rclone.org/opendrive/) * [Oracle Object Storage](https://rclone.org/oracleobjectstorage/) * [Pcloud](https://rclone.org/pcloud/) + * [PikPak](https://rclone.org/pikpak/) * [premiumize.me](https://rclone.org/premiumizeme/) * [put.io](https://rclone.org/putio/) + * [Proton Drive](https://rclone.org/protondrive/) * [QingStor](https://rclone.org/qingstor/) + * [Quatrix by Maytech](https://rclone.org/quatrix/) * [Seafile](https://rclone.org/seafile/) * [SFTP](https://rclone.org/sftp/) * [Sia](https://rclone.org/sia/) @@ -870,20 +958,23 @@ rclone config [flags] -h, --help help for config ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone config create](https://rclone.org/commands/rclone_config_create/) - Create a new remote with name, type and options. * [rclone config delete](https://rclone.org/commands/rclone_config_delete/) - Delete an existing remote. * [rclone config disconnect](https://rclone.org/commands/rclone_config_disconnect/) - Disconnects user from remote * [rclone config dump](https://rclone.org/commands/rclone_config_dump/) - Dump the config file as JSON. +* [rclone config edit](https://rclone.org/commands/rclone_config_edit/) - Enter an interactive configuration session. * [rclone config file](https://rclone.org/commands/rclone_config_file/) - Show path of configuration file in use. * [rclone config password](https://rclone.org/commands/rclone_config_password/) - Update password in an existing remote. * [rclone config paths](https://rclone.org/commands/rclone_config_paths/) - Show paths used for configuration, cache, temp etc. * [rclone config providers](https://rclone.org/commands/rclone_config_providers/) - List in JSON format all the providers and options. * [rclone config reconnect](https://rclone.org/commands/rclone_config_reconnect/) - Re-authenticates user with remote. +* [rclone config redacted](https://rclone.org/commands/rclone_config_redacted/) - Print redacted (decrypted) config file, or the redacted config for a single remote. * [rclone config show](https://rclone.org/commands/rclone_config_show/) - Print (decrypted) config file, or the config for a single remote. * [rclone config touch](https://rclone.org/commands/rclone_config_touch/) - Ensure configuration file exists. * [rclone config update](https://rclone.org/commands/rclone_config_update/) - Update options in an existing remote. @@ -964,9 +1055,96 @@ rclone copy source:path dest:path [flags] -h, --help help for copy ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1024,9 +1202,114 @@ rclone sync source:path dest:path [flags] -h, --help help for sync ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Sync Options + +Flags just used for `rclone sync`. + +``` + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1080,9 +1363,96 @@ rclone move source:path dest:path [flags] -h, --help help for move ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1132,9 +1502,58 @@ rclone delete remote:path [flags] --rmdirs rmdirs removes empty directories but leaves root intact ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1165,9 +1584,20 @@ rclone purge remote:path [flags] -h, --help help for purge ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1185,9 +1615,20 @@ rclone mkdir remote:path [flags] -h, --help help for mkdir ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1216,9 +1657,20 @@ rclone rmdir remote:path [flags] -h, --help help for rmdir ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1235,7 +1687,7 @@ match. It doesn't alter the source or destination. For the [crypt](https://rclone.org/crypt/) remote there is a dedicated command, [cryptcheck](https://rclone.org/commands/rclone_cryptcheck/), that are able to check -the checksums of the crypted files. +the checksums of the encrypted files. If you supply the `--size-only` flag, it will only compare the sizes not the hashes as well. Use this for a quick check. @@ -1269,6 +1721,9 @@ you what happened to it. These are reminiscent of diff files. - `* path` means path was present in source and destination but different. - `! path` means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the [--checkers=N](https://rclone.org/docs/#checkers-n) +option for more information. + ``` rclone check source:path dest:path [flags] @@ -1289,9 +1744,56 @@ rclone check source:path dest:path [flags] --one-way Check one way only, source files must exist on remote ``` + +## Check Options + +Flags used for `rclone check`. + +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1347,9 +1849,48 @@ rclone ls remote:path [flags] -h, --help help for ls ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1416,9 +1957,48 @@ rclone lsd remote:path [flags] -R, --recursive Recurse into the listing ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1474,9 +2054,48 @@ rclone lsl remote:path [flags] -h, --help help for lsl ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1519,9 +2138,48 @@ rclone md5sum remote:path [flags] --output-file string Output hashsums to a file rather than the terminal ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1567,9 +2225,48 @@ rclone sha1sum remote:path [flags] --output-file string Output hashsums to a file rather than the terminal ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1593,7 +2290,7 @@ recursion. Some backends do not always provide file sizes, see for example [Google Photos](https://rclone.org/googlephotos/#size) and -[Google Drive](https://rclone.org/drive/#limitations-of-google-docs). +[Google Docs](https://rclone.org/drive/#limitations-of-google-docs). Rclone will then show a notice in the log indicating how many such files were encountered, and count them in as empty files in the output of the size command. @@ -1610,9 +2307,48 @@ rclone size remote:path [flags] --json Format output as JSON ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1672,9 +2408,10 @@ rclone version [flags] -h, --help help for version ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1699,9 +2436,20 @@ rclone cleanup remote:path [flags] -h, --help help for cleanup ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1831,9 +2579,20 @@ rclone dedupe [mode] remote:path [flags] -h, --help help for dedupe ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1903,9 +2662,10 @@ rclone about remote: [flags] --json Format output as JSON ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1937,9 +2697,10 @@ rclone authorize [flags] --template string The path to a custom Go template for generating HTML responses ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -1989,9 +2750,20 @@ rclone backend remote:path [opts] [flags] -o, --option stringArray Option in the form name=value or name ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -2021,22 +2793,103 @@ rclone bisync remote1:path1 remote2:path2 [flags] ## Options ``` - --check-access Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort. - --check-filename string Filename for --check-access (default: RCLONE_TEST) - --check-sync string Controls comparison of final listings: true|false|only (default: true) (default "true") - --filters-file string Read filtering patterns from a file - --force Bypass --max-delete safety check and run the sync. Consider using with --verbose - -h, --help help for bisync - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first. - --workdir string Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync) + --check-access Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort. + --check-filename string Filename for --check-access (default: RCLONE_TEST) + --check-sync string Controls comparison of final listings: true|false|only (default: true) (default "true") + --create-empty-src-dirs Sync creation and deletion of empty directories. (Not compatible with --remove-empty-dirs) + --filters-file string Read filtering patterns from a file + --force Bypass --max-delete safety check and run the sync. Consider using with --verbose + -h, --help help for bisync + --ignore-listing-checksum Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks) + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --remove-empty-dirs Remove ALL empty directories at the final cleanup step. + --resilient Allow future runs to retry after certain less-serious errors, instead of requiring --resync. Use at your own risk! + -1, --resync Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first. + --workdir string Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync) +``` + + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) ``` See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -2066,6 +2919,18 @@ the end and `--offset` and `--count` to print a section in the middle. Note that if offset is negative it will count from the end, so `--offset -1 --count 1` is equivalent to `--tail 1`. +Use the `--separator` flag to print a separator value between files. Be sure to +shell-escape special characters. For example, to print a newline between +files, use: + +* bash: + + rclone --include "*.txt" --separator $'\n' cat remote:path/to/dir + +* powershell: + + rclone --include "*.txt" --separator "`n" cat remote:path/to/dir + ``` rclone cat remote:path [flags] @@ -2074,33 +2939,76 @@ rclone cat remote:path [flags] ## Options ``` - --count int Only print N characters (default -1) - --discard Discard the output instead of printing - --head int Only print the first N characters - -h, --help help for cat - --offset int Start printing at offset N (or from end if -ve) - --tail int Only print the last N characters + --count int Only print N characters (default -1) + --discard Discard the output instead of printing + --head int Only print the first N characters + -h, --help help for cat + --offset int Start printing at offset N (or from end if -ve) + --separator string Separator to use between objects when printing multiple files + --tail int Only print the last N characters +``` + + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions ``` See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. # rclone checksum -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. ## Synopsis -Checks that hashsums of source files match the SUM file. +Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system. -If you supply the `--download` flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for remotes +The sumfile is treated as the source and the dst:path is treated as +the destination for the purposes of the output. + +If you supply the `--download` flag, it will download the data from the remote +and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. Note that hash values in the SUM file are treated as case insensitive. @@ -2126,9 +3034,12 @@ you what happened to it. These are reminiscent of diff files. - `* path` means path was present in source and destination but different. - `! path` means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the [--checkers=N](https://rclone.org/docs/#checkers-n) +option for more information. + ``` -rclone checksum sumfile src:path [flags] +rclone checksum sumfile dst:path [flags] ``` ## Options @@ -2145,20 +3056,60 @@ rclone checksum sumfile src:path [flags] --one-way Check one way only, source files must exist on remote ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. # rclone completion -Generate the autocompletion script for the specified shell +Output completion script for a given shell. ## Synopsis -Generate the autocompletion script for rclone for the specified shell. -See each sub-command's help for details on how to use the generated script. + +Generates a shell completion script for rclone. +Run with `--help` to list the supported shells. ## Options @@ -2167,176 +3118,178 @@ See each sub-command's help for details on how to use the generated script. -h, --help help for completion ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -* [rclone completion bash](https://rclone.org/commands/rclone_completion_bash/) - Generate the autocompletion script for bash -* [rclone completion fish](https://rclone.org/commands/rclone_completion_fish/) - Generate the autocompletion script for fish -* [rclone completion powershell](https://rclone.org/commands/rclone_completion_powershell/) - Generate the autocompletion script for powershell -* [rclone completion zsh](https://rclone.org/commands/rclone_completion_zsh/) - Generate the autocompletion script for zsh +* [rclone completion bash](https://rclone.org/commands/rclone_completion_bash/) - Output bash completion script for rclone. +* [rclone completion fish](https://rclone.org/commands/rclone_completion_fish/) - Output fish completion script for rclone. +* [rclone completion powershell](https://rclone.org/commands/rclone_completion_powershell/) - Output powershell completion script for rclone. +* [rclone completion zsh](https://rclone.org/commands/rclone_completion_zsh/) - Output zsh completion script for rclone. # rclone completion bash -Generate the autocompletion script for bash +Output bash completion script for rclone. ## Synopsis -Generate the autocompletion script for the bash shell. - -This script depends on the 'bash-completion' package. -If it is not installed already, you can install it via your OS's package manager. -To load completions in your current shell session: - - source <(rclone completion bash) +Generates a bash shell autocompletion script for rclone. -To load completions for every new session, execute once: +This writes to /etc/bash_completion.d/rclone by default so will +probably need to be run with sudo or as root, e.g. -### Linux: + sudo rclone genautocomplete bash - rclone completion bash > /etc/bash_completion.d/rclone +Logout and login again to use the autocompletion scripts, or source +them directly -### macOS: + . /etc/bash_completion - rclone completion bash > $(brew --prefix)/etc/bash_completion.d/rclone +If you supply a command line argument the script will be written +there. -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. ``` -rclone completion bash +rclone completion bash [output_file] [flags] ``` ## Options ``` - -h, --help help for bash - --no-descriptions disable completion descriptions + -h, --help help for bash ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](https://rclone.org/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](https://rclone.org/commands/rclone_completion/) - Output completion script for a given shell. # rclone completion fish -Generate the autocompletion script for fish +Output fish completion script for rclone. ## Synopsis -Generate the autocompletion script for the fish shell. -To load completions in your current shell session: +Generates a fish autocompletion script for rclone. + +This writes to /etc/fish/completions/rclone.fish by default so will +probably need to be run with sudo or as root, e.g. + + sudo rclone genautocomplete fish - rclone completion fish | source +Logout and login again to use the autocompletion scripts, or source +them directly -To load completions for every new session, execute once: + . /etc/fish/completions/rclone.fish - rclone completion fish > ~/.config/fish/completions/rclone.fish +If you supply a command line argument the script will be written +there. -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. ``` -rclone completion fish [flags] +rclone completion fish [output_file] [flags] ``` ## Options ``` - -h, --help help for fish - --no-descriptions disable completion descriptions + -h, --help help for fish ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](https://rclone.org/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](https://rclone.org/commands/rclone_completion/) - Output completion script for a given shell. # rclone completion powershell -Generate the autocompletion script for powershell +Output powershell completion script for rclone. ## Synopsis + Generate the autocompletion script for powershell. To load completions in your current shell session: - rclone completion powershell | Out-String | Invoke-Expression + rclone completion powershell | Out-String | Invoke-Expression To load completions for every new session, add the output of the above command to your powershell profile. +If output_file is "-" or missing, then the output will be written to stdout. + ``` -rclone completion powershell [flags] +rclone completion powershell [output_file] [flags] ``` ## Options ``` - -h, --help help for powershell - --no-descriptions disable completion descriptions + -h, --help help for powershell ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](https://rclone.org/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](https://rclone.org/commands/rclone_completion/) - Output completion script for a given shell. # rclone completion zsh -Generate the autocompletion script for zsh +Output zsh completion script for rclone. ## Synopsis -Generate the autocompletion script for the zsh shell. -If shell completion is not already enabled in your environment you will need -to enable it. You can execute the following once: - - echo "autoload -U compinit; compinit" >> ~/.zshrc - -To load completions in your current shell session: - - source <(rclone completion zsh); compdef _rclone rclone +Generates a zsh autocompletion script for rclone. -To load completions for every new session, execute once: +This writes to /usr/share/zsh/vendor-completions/_rclone by default so will +probably need to be run with sudo or as root, e.g. -### Linux: + sudo rclone genautocomplete zsh - rclone completion zsh > "${fpath[1]}/_rclone" +Logout and login again to use the autocompletion scripts, or source +them directly -### macOS: + autoload -U compinit && compinit - rclone completion zsh > $(brew --prefix)/share/zsh/site-functions/_rclone +If you supply a command line argument the script will be written +there. -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. ``` -rclone completion zsh [flags] +rclone completion zsh [output_file] [flags] ``` ## Options ``` - -h, --help help for zsh - --no-descriptions disable completion descriptions + -h, --help help for zsh ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](https://rclone.org/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](https://rclone.org/commands/rclone_completion/) - Output completion script for a given shell. # rclone config create @@ -2464,9 +3417,10 @@ rclone config create name type [key value]* [flags] --state string State - use with --continue ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2484,9 +3438,10 @@ rclone config delete name [flags] -h, --help help for delete ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2514,9 +3469,10 @@ rclone config disconnect remote: [flags] -h, --help help for disconnect ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2534,9 +3490,10 @@ rclone config dump [flags] -h, --help help for dump ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2544,7 +3501,7 @@ See the [global flags page](https://rclone.org/flags/) for global options not li Enter an interactive configuration session. -# Synopsis +## Synopsis Enter an interactive configuration session where you can setup new remotes and manage existing ones. You may also set or remove a @@ -2555,12 +3512,13 @@ password to protect your configuration. rclone config edit [flags] ``` -# Options +## Options ``` -h, --help help for edit ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. # SEE ALSO @@ -2581,9 +3539,10 @@ rclone config file [flags] -h, --help help for file ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2617,9 +3576,10 @@ rclone config password name [key value]+ [flags] -h, --help help for password ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2637,9 +3597,10 @@ rclone config paths [flags] -h, --help help for paths ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2657,9 +3618,10 @@ rclone config providers [flags] -h, --help help for providers ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2687,9 +3649,45 @@ rclone config reconnect remote: [flags] -h, --help help for reconnect ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO + +* [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. + +# rclone config redacted + +Print redacted (decrypted) config file, or the redacted config for a single remote. + +## Synopsis + +This prints a redacted copy of the config file, either the +whole config file or for a given remote. + +The config file will be redacted by replacing all passwords and other +sensitive info with XXX. + +This makes the config file suitable for posting online for support. + +It should be double checked before posting as the redaction may not be perfect. + + + +``` +rclone config redacted [] [flags] +``` + +## Options + +``` + -h, --help help for redacted +``` + + +See the [global flags page](https://rclone.org/flags/) for global options not listed here. + +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2707,9 +3705,10 @@ rclone config show [] [flags] -h, --help help for show ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2727,9 +3726,10 @@ rclone config touch [flags] -h, --help help for touch ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2859,9 +3859,10 @@ rclone config update name [key value]+ [flags] --state string State - use with --continue ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2887,9 +3888,10 @@ rclone config userinfo remote: [flags] --json Format output as JSON ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](https://rclone.org/commands/rclone_config/) - Enter an interactive configuration session. @@ -2939,9 +3941,96 @@ rclone copyto source:path dest:path [flags] -h, --help help for copyto ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -2983,22 +4072,33 @@ rclone copyurl https://example.com dest:path [flags] --stdout Write the output to stdout rather than a file ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. # rclone cryptcheck -Cryptcheck checks the integrity of a crypted remote. +Cryptcheck checks the integrity of an encrypted remote. ## Synopsis rclone cryptcheck checks a remote against a [crypted](https://rclone.org/crypt/) remote. This is the equivalent of running rclone [check](https://rclone.org/commands/rclone_check/), -but able to check the checksums of the crypted remote. +but able to check the checksums of the encrypted remote. For it to work the underlying remote of the cryptedremote must support some kind of checksum. @@ -3040,6 +4140,9 @@ you what happened to it. These are reminiscent of diff files. - `* path` means path was present in source and destination but different. - `! path` means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the [--checkers=N](https://rclone.org/docs/#checkers-n) +option for more information. + ``` rclone cryptcheck remote:path cryptedremote:path [flags] @@ -3058,9 +4161,56 @@ rclone cryptcheck remote:path cryptedremote:path [flags] --one-way Check one way only, source files must exist on remote ``` + +## Check Options + +Flags used for `rclone check`. + +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3097,9 +4247,10 @@ rclone cryptdecode encryptedremote: encryptedfilename [flags] --reverse Reverse cryptdecode, encrypts filenames ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3125,9 +4276,20 @@ rclone deletefile remote:path [flags] -h, --help help for deletefile ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3135,14 +4297,14 @@ See the [global flags page](https://rclone.org/flags/) for global options not li Output completion script for a given shell. -## Synopsis +# Synopsis Generates a shell completion script for rclone. Run with `--help` to list the supported shells. -## Options +# Options ``` -h, --help help for genautocomplete @@ -3150,7 +4312,7 @@ Run with `--help` to list the supported shells. See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone genautocomplete bash](https://rclone.org/commands/rclone_genautocomplete_bash/) - Output bash completion script for rclone. @@ -3161,7 +4323,7 @@ See the [global flags page](https://rclone.org/flags/) for global options not li Output bash completion script for rclone. -## Synopsis +# Synopsis Generates a bash shell autocompletion script for rclone. @@ -3186,7 +4348,7 @@ If output_file is "-", then the output will be written to stdout. rclone genautocomplete bash [output_file] [flags] ``` -## Options +# Options ``` -h, --help help for bash @@ -3194,7 +4356,7 @@ rclone genautocomplete bash [output_file] [flags] See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone genautocomplete](https://rclone.org/commands/rclone_genautocomplete/) - Output completion script for a given shell. @@ -3202,7 +4364,7 @@ See the [global flags page](https://rclone.org/flags/) for global options not li Output fish completion script for rclone. -## Synopsis +# Synopsis Generates a fish autocompletion script for rclone. @@ -3227,7 +4389,7 @@ If output_file is "-", then the output will be written to stdout. rclone genautocomplete fish [output_file] [flags] ``` -## Options +# Options ``` -h, --help help for fish @@ -3235,7 +4397,7 @@ rclone genautocomplete fish [output_file] [flags] See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone genautocomplete](https://rclone.org/commands/rclone_genautocomplete/) - Output completion script for a given shell. @@ -3243,7 +4405,7 @@ See the [global flags page](https://rclone.org/flags/) for global options not li Output zsh completion script for rclone. -## Synopsis +# Synopsis Generates a zsh autocompletion script for rclone. @@ -3268,7 +4430,7 @@ If output_file is "-", then the output will be written to stdout. rclone genautocomplete zsh [output_file] [flags] ``` -## Options +# Options ``` -h, --help help for zsh @@ -3276,7 +4438,7 @@ rclone genautocomplete zsh [output_file] [flags] See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone genautocomplete](https://rclone.org/commands/rclone_genautocomplete/) - Output completion script for a given shell. @@ -3301,9 +4463,10 @@ rclone gendocs output_directory [flags] -h, --help help for gendocs ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3340,10 +4503,6 @@ Run without a hash to see the list of all supported hashes, e.g. * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor Then @@ -3353,7 +4512,7 @@ Note that hash names are case insensitive and values are output in lower case. ``` -rclone hashsum remote:path [flags] +rclone hashsum [ remote:path] [flags] ``` ## Options @@ -3366,9 +4525,48 @@ rclone hashsum remote:path [flags] --output-file string Output hashsums to a file rather than the terminal ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3413,15 +4611,16 @@ rclone link remote:path [flags] --unlink Remove existing public link to file/folder ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. # rclone listremotes -List all the remotes in the config file. +List all the remotes in the config file and defined in environment variables. ## Synopsis @@ -3442,9 +4641,10 @@ rclone listremotes [flags] --long Show the type as well as names ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3593,9 +4793,48 @@ rclone lsf remote:path [flags] -s, --separator string Separator for the items in the format (default ";") ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3722,9 +4961,48 @@ rclone lsjson remote:path [flags] --stat Just return the info for the pointed to file ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -3734,7 +5012,6 @@ Mount the remote as file system on a mountpoint. ## Synopsis - rclone mount allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's cloud storage systems as a file system with FUSE. @@ -3989,11 +5266,28 @@ does not suffer from the same limitations. ## Mounting on macOS -Mounting on macOS can be done either via [macFUSE](https://osxfuse.github.io/) +Mounting on macOS can be done either via [built-in NFS server](https://rclone.org/commands/rclone_serve_nfs/), [macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or [FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server. +# NFS mount + +This method spins up an NFS server using [serve nfs](https://rclone.org/commands/rclone_serve_nfs/) command and mounts +it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to +send SIGTERM signal to the rclone process using |kill| command to stop the mount. + +### macFUSE Notes + +If installing macFUSE using [dmg packages](https://github.com/osxfuse/osxfuse/releases) from +the website, rclone will locate the macFUSE libraries without any further intervention. +If however, macFUSE is installed using the [macports](https://www.macports.org/) package manager, +the following addition steps are required. + + sudo mkdir /usr/local/lib + cd /usr/local/lib + sudo ln -s /opt/local/lib/libfuse.2.dylib + ### FUSE-T Limitations, Caveats, and Notes There are some limitations, caveats, and notes about how it works. These are current as @@ -4032,6 +5326,8 @@ sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without `--vfs-cache-mode writes` or `--vfs-cache-mode full`. See the [VFS File Caching](#vfs-file-caching) section for more info. +When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| +the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty @@ -4130,20 +5426,19 @@ or create systemd mount units: ``` # /etc/systemd/system/mnt-data.mount [Unit] -After=network-online.target +Description=Mount for /mnt/data [Mount] Type=rclone What=sftp1:subdir Where=/mnt/data -Options=rw,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone +Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone ``` optionally accompanied by systemd automount unit ``` # /etc/systemd/system/mnt-data.automount [Unit] -After=network-online.target -Before=remote-fs.target +Description=AutoMount for /mnt/data [Automount] Where=/mnt/data TimeoutIdleSec=600 @@ -4179,7 +5474,6 @@ Mount option syntax includes a few extra options treated specially: - `vv...` will be transformed into appropriate `--verbose=N` - standard mount options like `x-systemd.automount`, `_netdev`, `nosuid` and alike are intended only for Automountd and ignored by rclone. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -4254,12 +5548,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -4276,10 +5571,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -4524,6 +5831,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for mount --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -4535,8 +5843,9 @@ rclone mount remote:path /path/to/mountpoint [flags] --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -4546,6 +5855,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -4553,9 +5863,39 @@ rclone mount remote:path /path/to/mountpoint [flags] --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -4608,9 +5948,96 @@ rclone moveto source:path dest:path [flags] -h, --help help for moveto ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -4651,6 +6078,7 @@ press '?' to toggle the help on and off. The supported keys are: y copy current path to clipboard Y display current path ^L refresh screen (fix screen corruption) + r recalculate file sizes ? to toggle help on and off q/ESC/^c to quit @@ -4691,9 +6119,48 @@ rclone ncdu remote:path [flags] -h, --help help for ncdu ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -4737,9 +6204,10 @@ rclone obscure password [flags] -h, --help help for obscure ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -4818,9 +6286,10 @@ rclone rc commands parameter [flags] --user string Username to use to rclone remote control ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -4856,10 +6325,11 @@ and actually stream it, even if remote backend doesn't support streaming. size of the stream is different in length to the `--size` passed in then the transfer will likely fail. -Note that the upload can also not be retried because the data is -not kept around until the upload succeeds. If you need to transfer -a lot of data, you're better off caching locally and then -`rclone move` it to the destination. +Note that the upload cannot be retried because the data is not stored. +If the backend supports multipart uploading then individual chunks can +be retried. If you need to transfer a lot of data, you may be better +off caching it locally and then `rclone move` it to the +destination which can use retries. ``` rclone rcat remote:path [flags] @@ -4872,9 +6342,20 @@ rclone rcat remote:path [flags] --size int File size hint to preallocate (default -1) ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -4897,54 +6378,54 @@ See the [rc documentation](https://rclone.org/rc/) for more info on the rc flags ## Server options -Use `--addr` to specify which IP address and port the server should -listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +Use `--rc-addr` to specify which IP address and port the server should +listen on, eg `--rc-addr 1.2.3.4:8000` or `--rc-addr :8080` to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port. -If you set `--addr` to listen on a public or LAN accessible IP address +If you set `--rc-addr` to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info. You can use a unix socket by setting the url to `unix:///path/to/socket` or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions. -`--addr` may be repeated to listen on multiple IPs/ports/sockets. +`--rc-addr` may be repeated to listen on multiple IPs/ports/sockets. -`--server-read-timeout` and `--server-write-timeout` can be used to +`--rc-server-read-timeout` and `--rc-server-write-timeout` can be used to control the timeouts on the server. Note that this is the total time for a transfer. -`--max-header-bytes` controls the maximum number of bytes the server will +`--rc-max-header-bytes` controls the maximum number of bytes the server will accept in the HTTP header. -`--baseurl` controls the URL prefix that rclone serves from. By default -rclone will serve from the root. If you used `--baseurl "/rclone"` then +`--rc-baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--rc-baseurl "/rclone"` then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically -inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, -`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +inserts leading and trailing "/" on `--rc-baseurl`, so `--rc-baseurl "rclone"`, +`--rc-baseurl "/rclone"` and `--rc-baseurl "/rclone/"` are all treated identically. ### TLS (SSL) By default this will serve over http. If you want you can serve over -https. You will need to supply the `--cert` and `--key` flags. +https. You will need to supply the `--rc-cert` and `--rc-key` flags. If you wish to do client side certificate validation then you will need to -supply `--client-ca` also. +supply `--rc-client-ca` also. -`--cert` should be a either a PEM encoded certificate or a concatenation -of that with the CA certificate. `--key` should be the PEM encoded -private key and `--client-ca` should be the PEM encoded client +`--rc-cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--krc-ey` should be the PEM encoded +private key and `--rc-client-ca` should be the PEM encoded client certificate authority certificate. ---min-tls-version is minimum TLS version that is acceptable. Valid +--rc-min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). ### Template -`--template` allows a user to specify a custom markup template for HTTP +`--rc-template` allows a user to specify a custom markup template for HTTP and WebDAV serve functions. The server exports the following markup to be used within the template to server pages: @@ -4967,14 +6448,29 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or -set a single username and password with the `--user` and `--pass` flags. +set a single username and password with the `--rc-user` and `--rc-pass` flags. -Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + +Use `--rc-htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -4986,9 +6482,9 @@ To create an htpasswd file: The password file can be updated while rclone is running. -Use `--realm` to set the authentication realm. +Use `--rc-realm` to set the authentication realm. -Use `--salt` to change the password hashing salt from the default. +Use `--rc-salt` to change the password hashing salt from the default. ``` @@ -5001,9 +6497,45 @@ rclone rcd * [flags] -h, --help help for rcd ``` + +## RC Options + +Flags to control the Remote Control API. + +``` + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -5027,7 +6559,10 @@ empty directories in. For example the [delete](https://rclone.org/commands/rclon command will delete files but leave the directory structure (unless used with option `--rmdirs`). -To delete a path and any objects in it, use [purge](https://rclone.org/commands/rclone_purge/) +This will delete `--checkers` directories concurrently so +if you have thousands of empty directories consider increasing this number. + +To delete a path and any objects in it, use the [purge](https://rclone.org/commands/rclone_purge/) command. @@ -5042,9 +6577,20 @@ rclone rmdirs remote:path [flags] --leave-root Do not remove root directory if empty ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -5054,10 +6600,10 @@ Update the rclone binary. ## Synopsis - -This command downloads the latest release of rclone and replaces -the currently running binary. The download is verified with a hashsum -and cryptographically signed signature. +This command downloads the latest release of rclone and replaces the +currently running binary. The download is verified with a hashsum and +cryptographically signed signature; see [the release signing +docs](https://rclone.org/release_signing/) for details. If used without flags (or with implied `--stable` flag), this command will install the latest stable release. However, some issues may be fixed @@ -5090,7 +6636,7 @@ your OS) to update these too. This command with the default `--package zip` will update only the rclone executable so the local manual may become inaccurate after it. -The `rclone mount` command (https://rclone.org/commands/rclone_mount/) may +The [rclone mount](https://rclone.org/commands/rclone_mount/) command may or may not support extended FUSE options depending on the build and OS. `selfupdate` will refuse to update if the capability would be discarded. @@ -5119,9 +6665,10 @@ rclone selfupdate [flags] --version string Install the given rclone version (default: latest) ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. @@ -5149,16 +6696,19 @@ rclone serve [opts] [flags] -h, --help help for serve ``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone serve dlna](https://rclone.org/commands/rclone_serve_dlna/) - Serve remote:path over DLNA * [rclone serve docker](https://rclone.org/commands/rclone_serve_docker/) - Serve any remote on docker's volume plugin API. * [rclone serve ftp](https://rclone.org/commands/rclone_serve_ftp/) - Serve remote:path over FTP. * [rclone serve http](https://rclone.org/commands/rclone_serve_http/) - Serve the remote over HTTP. +* [rclone serve nfs](https://rclone.org/commands/rclone_serve_nfs/) - Serve the remote as an NFS mount * [rclone serve restic](https://rclone.org/commands/rclone_serve_restic/) - Serve the remote for restic's REST API. +* [rclone serve s3](https://rclone.org/commands/rclone_serve_s3/) - Serve remote:path over s3. * [rclone serve sftp](https://rclone.org/commands/rclone_serve_sftp/) - Serve the remote over SFTP. * [rclone serve webdav](https://rclone.org/commands/rclone_serve_webdav/) - Serve remote:path over WebDAV. @@ -5191,7 +6741,6 @@ default "rclone (hostname)". Use `--log-trace` in conjunction with `-vv` to enable additional debug logging of all UPNP traffic. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -5266,12 +6815,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -5288,10 +6838,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -5535,8 +7097,9 @@ rclone serve dlna remote:path [flags] --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -5546,14 +7109,45 @@ rclone serve dlna remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. @@ -5563,7 +7157,6 @@ Serve any remote on docker's volume plugin API. ## Synopsis - This command implements the Docker volume plugin API allowing docker to use rclone as a data storage mechanism for various cloud providers. rclone provides [docker volume plugin](/docker) based on it. @@ -5602,7 +7195,6 @@ directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -5677,12 +7269,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -5699,10 +7292,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -5949,6 +7554,7 @@ rclone serve docker [flags] --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for docker --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -5963,8 +7569,9 @@ rclone serve docker [flags] --socket-gid int GID for unix socket (default: current process GID) (default 1000) --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -5974,6 +7581,7 @@ rclone serve docker [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -5981,9 +7589,39 @@ rclone serve docker [flags] --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. @@ -6013,7 +7651,6 @@ then using Authentication is advised - see the next section for info. By default this will serve files without needing a login. You can set a single username and password with the --user and --pass flags. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -6088,12 +7725,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -6110,10 +7748,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -6441,8 +8091,9 @@ rclone serve ftp remote:path [flags] --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication (default "anonymous") - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -6452,14 +8103,45 @@ rclone serve ftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. @@ -6553,6 +8235,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -6560,6 +8253,10 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the `--user` and `--pass` flags. +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -6575,7 +8272,6 @@ The password file can be updated while rclone is running. Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -6650,12 +8346,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -6672,10 +8369,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -6984,6 +8693,7 @@ rclone serve http remote:path [flags] ``` --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --auth-proxy string A program to use to create the backend from the auth --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) @@ -7011,8 +8721,9 @@ rclone serve http remote:path [flags] --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -7022,268 +8733,82 @@ rclone serve http remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` -See the [global flags page](https://rclone.org/flags/) for global options not listed here. - -## SEE ALSO - -* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. - -# rclone serve restic - -Serve the remote for restic's REST API. - -## Synopsis - -Run a basic web server to serve a remote over restic's REST backend -API over HTTP. This allows restic to use rclone as a data storage -mechanism for cloud providers that restic does not support directly. - -[Restic](https://restic.net/) is a command-line program for doing -backups. - -The server will log errors. Use -v to see access logs. - -`--bwlimit` will be respected for file transfers. -Use `--stats` to control the stats printing. - -## Setting up rclone for use by restic ### - -First [set up a remote for your chosen cloud provider](https://rclone.org/docs/#configure). - -Once you have set up the remote, check it is working with, for example -"rclone lsd remote:". You may have called the remote something other -than "remote:" - just substitute whatever you called it in the -following instructions. - -Now start the rclone restic server - - rclone serve restic -v remote:backup - -Where you can replace "backup" in the above by whatever path in the -remote you wish to use. - -By default this will serve on "localhost:8080" you can change this -with use of the `--addr` flag. - -You might wish to start this server on boot. - -Adding `--cache-objects=false` will cause rclone to stop caching objects -returned from the List call. Caching is normally desirable as it speeds -up downloading objects, saves transactions and uses very little memory. - -## Setting up restic to use rclone ### - -Now you can [follow the restic -instructions](http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) -on setting up restic. - -Note that you will need restic 0.8.2 or later to interoperate with -rclone. - -For the example above you will want to use "http://localhost:8080/" as -the URL for the REST server. - -For example: - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/ - $ export RESTIC_PASSWORD=yourpassword - $ restic init - created restic backend 8b1a4b56ae at rest:http://localhost:8080/ - - Please note that knowledge of your password is required to access - the repository. Losing your password means that your data is - irrecoverably lost. - $ restic backup /path/to/files/to/backup - scan [/path/to/files/to/backup] - scanned 189 directories, 312 files in 0:00 - [0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 - duration: 0:00 - snapshot 45c8fdd8 saved - -### Multiple repositories #### - -Note that you can use the endpoint to host multiple repositories. Do -this by adding a directory name or path after the URL. Note that -these **must** end with /. Eg - - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ - # backup user1 stuff - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ - # backup user2 stuff - -### Private repositories #### - -The`--private-repos` flag can be used to limit users to repositories starting -with a path of `//`. - -## Server options - -Use `--addr` to specify which IP address and port the server should -listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all -IPs. By default it only listens on localhost. You can use port -:0 to let the OS choose an available port. - -If you set `--addr` to listen on a public or LAN accessible IP address -then using Authentication is advised - see the next section for info. - -You can use a unix socket by setting the url to `unix:///path/to/socket` -or just by using an absolute path name. Note that unix sockets bypass the -authentication - this is expected to be done with file system permissions. - -`--addr` may be repeated to listen on multiple IPs/ports/sockets. - -`--server-read-timeout` and `--server-write-timeout` can be used to -control the timeouts on the server. Note that this is the total time -for a transfer. - -`--max-header-bytes` controls the maximum number of bytes the server will -accept in the HTTP header. - -`--baseurl` controls the URL prefix that rclone serves from. By default -rclone will serve from the root. If you used `--baseurl "/rclone"` then -rclone would serve from a URL starting with "/rclone/". This is -useful if you wish to proxy rclone serve. Rclone automatically -inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, -`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated -identically. - -### TLS (SSL) - -By default this will serve over http. If you want you can serve over -https. You will need to supply the `--cert` and `--key` flags. -If you wish to do client side certificate validation then you will need to -supply `--client-ca` also. - -`--cert` should be a either a PEM encoded certificate or a concatenation -of that with the CA certificate. `--key` should be the PEM encoded -private key and `--client-ca` should be the PEM encoded client -certificate authority certificate. - ---min-tls-version is minimum TLS version that is acceptable. Valid - values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default - "tls1.0"). - -### Authentication - -By default this will serve files without needing a login. - -You can either use an htpasswd file which can take lots of users, or -set a single username and password with the `--user` and `--pass` flags. - -Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is -in standard apache format and supports MD5, SHA1 and BCrypt for basic -authentication. Bcrypt is recommended. - -To create an htpasswd file: - - touch htpasswd - htpasswd -B htpasswd user - htpasswd -B htpasswd anotherUser - -The password file can be updated while rclone is running. - -Use `--realm` to set the authentication realm. - -Use `--salt` to change the password hashing salt from the default. +## Filter Options +Flags for filtering directory listings. ``` -rclone serve restic remote:path [flags] -``` - -## Options - -``` - --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) - --append-only Disallow deletion of repository data - --baseurl string Prefix for URLs - leave blank for root - --cache-objects Cache listed objects (default true) - --cert string TLS PEM key (concatenation of certificate and CA certificate) - --client-ca string Client certificate authority to verify clients with - -h, --help help for restic - --htpasswd string A htpasswd file - if not provided no authentication is done - --key string TLS PEM Private key - --max-header-bytes int Maximum size of request header (default 4096) - --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --pass string Password for authentication - --private-repos Users can only access their private repo - --realm string Realm for authentication - --salt string Password hashing salt (default "dlPL2MqE") - --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --stdio Run an HTTP2 server on stdin/stdout - --user string User name for authentication + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) ``` See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -# rclone serve sftp +# rclone serve nfs -Serve the remote over SFTP. +Serve the remote as an NFS mount ## Synopsis -Run an SFTP server to serve a remote over SFTP. This can be used -with an SFTP client or you can make a remote of type [sftp](/sftp) to use with it. +Create an NFS server that serves the given remote over the network. + +The primary purpose for this command is to enable [mount command](https://rclone.org/commands/rclone_mount/) on recent macOS versions where +installing FUSE is very cumbersome. -You can use the [filter](/filtering) flags (e.g. `--include`, `--exclude`) -to control what is served. +Since this is running on NFSv3, no authentication method is available. Any client +will be able to access the data. To limit access, you can use serve NFS on loopback address +and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; +meaning that it is only available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address and port using `--addr` flag. -The server will respond to a small number of shell commands, mainly -md5sum, sha1sum and df, which enable it to provide support for checksums -and the about feature when accessed from an sftp remote. +Modifying files through NFS protocol requires VFS caching. Usually you will need to specify `--vfs-cache-mode` +in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, +the mount will be read-only. -Note that this server uses standard 32 KiB packet payload size, which -means you must not configure the client to expect anything else, e.g. -with the [chunk_size](https://rclone.org/sftp/#sftp-chunk-size) option on an sftp remote. +To serve NFS over the network use following command: -The server will log errors. Use `-v` to see access logs. + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full -`--bwlimit` will be respected for file transfers. -Use `--stats` to control the stats printing. +We specify a specific port that we can use in the mount command: -You must provide some means of authentication, either with -`--user`/`--pass`, an authorized keys file (specify location with -`--authorized-keys` - the default is the same as ssh), an -`--auth-proxy`, or set the `--no-auth` flag for no -authentication when logging in. - -If you don't supply a host `--key` then rclone will generate rsa, ecdsa -and ed25519 variants, and cache them for later use in rclone's cache -directory (see `rclone help flags cache-dir`) in the "serve-sftp" -directory. - -By default the server binds to localhost:2022 - if you want it to be -reachable externally then supply `--addr :2022` for example. - -Note that the default of `--vfs-cache-mode off` is fine for the rclone -sftp backend, but it may not be with other SFTP clients. - -If `--stdio` is specified, rclone will serve SFTP over stdio, which can -be used with sshd via ~/.ssh/authorized_keys, for example: - - restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... - -On the client you need to set `--transfers 1` when using `--stdio`. -Otherwise multiple instances of the rclone server are started by OpenSSH -which can lead to "corrupted on transfer" errors. This is the case because -the client chooses indiscriminately which server to send commands to while -the servers all have different views of the state of the filing system. +To mount the server under Linux/macOS, use the following command: + + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint -The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from beeing -used. Omitting "restrict" and using `--sftp-path-override` to enable -checksumming is possible but less secure and you could use the SFTP server -provided by OpenSSH in this case. +Where `$PORT` is the same port number we used in the serve nfs command. +This feature is only available on Unix platforms. ## VFS - Virtual File System @@ -7359,12 +8884,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -7381,10 +8907,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -7603,117 +9141,30 @@ _WARNING._ Contrary to `rclone size`, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -## Auth Proxy - -If you supply the parameter `--auth-proxy /path/to/program` then -rclone will use that program to generate backends on the fly which -then are used to authenticate incoming requests. This uses a simple -JSON based protocol with input on STDIN and output on STDOUT. - -**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used -together, if `--auth-proxy` is set the authorized keys option will be -ignored. - -There is an example program -[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) -in the rclone source code. - -The program's job is to take a `user` and `pass` on the input and turn -those into the config for a backend on STDOUT in JSON format. This -config will have any default parameters for the backend added, but it -won't use configuration from environment variables or command line -options - it is the job of the proxy program to make a complete -config. - -This config generated must have this extra parameter -- `_root` - root to use for the backend - -And it may have this parameter -- `_obscure` - comma separated strings for parameters to obscure - -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "pass": "mypassword" -} -``` - -If public-key authentication was used by the client, input to the -proxy process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" -} -``` - -And as an example return this on STDOUT - -``` -{ - "type": "sftp", - "_root": "", - "_obscure": "pass", - "user": "me", - "pass": "mypassword", - "host": "sftp.example.com" -} -``` - -This would mean that an SFTP backend would be created on the fly for -the `user` and `pass`/`public_key` returned in the output to the host given. Note -that since `_obscure` is set to `pass`, rclone will obscure the `pass` -parameter before creating the backend (which is required for sftp -backends). - -The program can manipulate the supplied `user` in any way, for example -to make proxy to many different sftp backends, you could make the -`user` be `user@example.com` and then set the `host` to `example.com` -in the output and the user to `user`. For security you'd probably want -to restrict the `host` to a limited list. - -Note that an internal cache is keyed on `user` so only use that for -configuration, don't use `pass` or `public_key`. This also means that if a user's -password or public-key is changed the cache will need to expire (which takes 5 mins) -before it takes effect. - -This can be used to build general purpose proxies to any kind of -backend that rclone supports. - ``` -rclone serve sftp remote:path [flags] +rclone serve nfs remote:path [flags] ``` ## Options ``` - --addr string IPaddress:Port or :Port to bind server to (default "localhost:2022") - --auth-proxy string A program to use to create the backend from the auth - --authorized-keys string Authorized keys file (default "~/.ssh/authorized_keys") + --addr string IPaddress:Port or :Port to bind server to --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) --file-perms FileMode File permissions (default 0666) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for sftp - --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) - --no-auth Allow connections with no authentication if set + -h, --help help for nfs --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) --no-seek Don't allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --stdio Run an sftp server on stdin/stdout --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -7723,63 +9174,135 @@ rclone serve sftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](https://rclone.org/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -# rclone serve webdav +# rclone serve restic -Serve remote:path over WebDAV. +Serve the remote for restic's REST API. ## Synopsis -Run a basic WebDAV server to serve a remote over HTTP via the -WebDAV protocol. This can be viewed with a WebDAV client, through a web -browser, or you can make a remote of type WebDAV to read and write it. +Run a basic web server to serve a remote over restic's REST backend +API over HTTP. This allows restic to use rclone as a data storage +mechanism for cloud providers that restic does not support directly. -## WebDAV options +[Restic](https://restic.net/) is a command-line program for doing +backups. -### --etag-hash +The server will log errors. Use -v to see access logs. -This controls the ETag header. Without this flag the ETag will be -based on the ModTime and Size of the object. +`--bwlimit` will be respected for file transfers. +Use `--stats` to control the stats printing. -If this flag is set to "auto" then rclone will choose the first -supported hash on the backend or you can use a named hash such as -"MD5" or "SHA-1". Use the [hashsum](https://rclone.org/commands/rclone_hashsum/) command -to see the full list. +## Setting up rclone for use by restic ### -## Access WebDAV on Windows -WebDAV shared folder can be mapped as a drive on Windows, however the default settings prevent it. -Windows will fail to connect to the server using insecure Basic authentication. -It will not even display any login dialog. Windows requires SSL / HTTPS connection to be used with Basic. -If you try to connect via Add Network Location Wizard you will get the following error: -"The folder you entered does not appear to be valid. Please choose another". -However, you still can connect if you set the following registry key on a client machine: -HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel to 2. -The BasicAuthLevel can be set to the following values: - 0 - Basic authentication disabled - 1 - Basic authentication enabled for SSL connections only - 2 - Basic authentication enabled for SSL connections and for non-SSL connections -If required, increase the FileSizeLimitInBytes to a higher value. -Navigate to the Services interface, then restart the WebClient service. +First [set up a remote for your chosen cloud provider](https://rclone.org/docs/#configure). -## Access Office applications on WebDAV -Navigate to following registry HKEY_CURRENT_USER\Software\Microsoft\Office\[14.0/15.0/16.0]\Common\Internet -Create a new DWORD BasicAuthLevel with value 2. - 0 - Basic authentication disabled - 1 - Basic authentication enabled for SSL connections only - 2 - Basic authentication enabled for SSL and for non-SSL connections +Once you have set up the remote, check it is working with, for example +"rclone lsd remote:". You may have called the remote something other +than "remote:" - just substitute whatever you called it in the +following instructions. -https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint +Now start the rclone restic server + + rclone serve restic -v remote:backup + +Where you can replace "backup" in the above by whatever path in the +remote you wish to use. + +By default this will serve on "localhost:8080" you can change this +with use of the `--addr` flag. + +You might wish to start this server on boot. + +Adding `--cache-objects=false` will cause rclone to stop caching objects +returned from the List call. Caching is normally desirable as it speeds +up downloading objects, saves transactions and uses very little memory. + +## Setting up restic to use rclone ### + +Now you can [follow the restic +instructions](http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) +on setting up restic. + +Note that you will need restic 0.8.2 or later to interoperate with +rclone. + +For the example above you will want to use "http://localhost:8080/" as +the URL for the REST server. + +For example: + + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/ + $ export RESTIC_PASSWORD=yourpassword + $ restic init + created restic backend 8b1a4b56ae at rest:http://localhost:8080/ + + Please note that knowledge of your password is required to access + the repository. Losing your password means that your data is + irrecoverably lost. + $ restic backup /path/to/files/to/backup + scan [/path/to/files/to/backup] + scanned 189 directories, 312 files in 0:00 + [0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 + duration: 0:00 + snapshot 45c8fdd8 saved + +### Multiple repositories #### + +Note that you can use the endpoint to host multiple repositories. Do +this by adding a directory name or path after the URL. Note that +these **must** end with /. Eg + + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ + # backup user1 stuff + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ + # backup user2 stuff +### Private repositories #### + +The`--private-repos` flag can be used to limit users to repositories starting +with a path of `//`. ## Server options @@ -7828,31 +9351,6 @@ certificate authority certificate. values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -### Template - -`--template` allows a user to specify a custom markup template for HTTP -and WebDAV serve functions. The server exports the following markup -to be used within the template to server pages: - -| Parameter | Description | -| :---------- | :---------- | -| .Name | The full path of a file/directory. | -| .Title | Directory listing of .Name | -| .Sort | The current sort used. This is changeable via ?sort= parameter | -| | Sort Options: namedirfirst,name,size,time (default namedirfirst) | -| .Order | The current ordering used. This is changeable via ?order= parameter | -| | Order Options: asc,desc (default asc) | -| .Query | Currently unused. | -| .Breadcrumb | Allows for creating a relative navigation | -|-- .Link | The relative to the root link of the Text. | -|-- .Text | The Name of the directory. | -| .Entries | Information about a specific file/directory. | -|-- .URL | The 'url' of an entry. | -|-- .Leaf | Currently same as 'URL' but intended to be 'just' the name. | -|-- .IsDir | Boolean for if an entry is a directory or not. | -|-- .Size | Size in Bytes of the entry. | -|-- .ModTime | The UTC timestamp of an entry. | - ### Authentication By default this will serve files without needing a login. @@ -7860,6 +9358,10 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the `--user` and `--pass` flags. +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -7876,6 +9378,211 @@ Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. + +``` +rclone serve restic remote:path [flags] +``` + +## Options + +``` + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --append-only Disallow deletion of repository data + --baseurl string Prefix for URLs - leave blank for root + --cache-objects Cache listed objects (default true) + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + -h, --help help for restic + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --pass string Password for authentication + --private-repos Users can only access their private repo + --realm string Realm for authentication + --salt string Password hashing salt (default "dlPL2MqE") + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --stdio Run an HTTP2 server on stdin/stdout + --user string User name for authentication +``` + + +See the [global flags page](https://rclone.org/flags/) for global options not listed here. + +# SEE ALSO + +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. + +# rclone serve s3 + +Serve remote:path over s3. + +## Synopsis + +`serve s3` implements a basic s3 server that serves a remote via s3. +This can be viewed with an s3 client, or you can make an [s3 type +remote](https://rclone.org/s3/) to read and write to it with rclone. + +`serve s3` is considered **Experimental** so use with care. + +S3 server supports Signature Version 4 authentication. Just use +`--auth-key accessKey,secretKey` and set the `Authorization` +header correctly in the request. (See the [AWS +docs](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)). + +`--auth-key` can be repeated for multiple auth pairs. If +`--auth-key` is not provided then `serve s3` will allow anonymous +access. + +Please note that some clients may require HTTPS endpoints. See [the +SSL docs](#ssl-tls) for more information. + +This command uses the [VFS directory cache](#vfs-virtual-file-system). +All the functionality will work with `--vfs-cache-mode off`. Using +`--vfs-cache-mode full` (or `writes`) can be used to cache objects +locally to improve performance. + +Use `--force-path-style=false` if you want to use the bucket name as a +part of the hostname (such as mybucket.local) + +Use `--etag-hash` if you want to change the hash uses for the `ETag`. +Note that using anything other than `MD5` (the default) is likely to +cause problems for S3 clients which rely on the Etag being the MD5. + +## Quickstart + +For a simple set up, to serve `remote:path` over s3, run the server +like this: + +``` +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +``` + +This will be compatible with an rclone remote which is defined like this: + +``` +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +``` + +Note that setting `disable_multipart_uploads = true` is to work around +[a bug](#bugs) which will be fixed in due course. + +## Bugs + +When uploading multipart files `serve s3` holds all the parts in +memory (see [#7453](https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. + +Multipart server side copies do not work (see +[#7454](https://github.com/rclone/rclone/issues/7454)). These take a +very long time and eventually fail. The default threshold for +multipart server side copies is 5G which is the maximum it can be, so +files above this side will fail to be server side copied. + +For a current list of `serve s3` bugs see the [serve +s3](https://github.com/rclone/rclone/labels/serve%20s3) bug category +on GitHub. + +## Limitations + +`serve s3` will treat all directories in the root as buckets and +ignore all files in the root. You can use `CreateBucket` to create +folders under the root, but you can't create empty folders under other +folders not in the root. + +When using `PutObject` or `DeleteObject`, rclone will automatically +create or clean up empty folders. If you don't want to clean up empty +folders automatically, use `--no-cleanup`. + +When using `ListObjects`, rclone will use `/` when the delimiter is +empty. This reduces backend requests with no effect on most +operations, but if the delimiter is something other than `/` and +empty, rclone will do a full recursive search of the backend, which +can take some time. + +Versioning is not currently supported. + +Metadata will only be saved in memory other than the rclone `mtime` +metadata which will be set as the modification time of the file. + +## Supported operations + +`serve s3` currently supports the following operations. + +- Bucket + - `ListBuckets` + - `CreateBucket` + - `DeleteBucket` +- Object + - `HeadObject` + - `ListObjects` + - `GetObject` + - `PutObject` + - `DeleteObject` + - `DeleteObjects` + - `CreateMultipartUpload` + - `CompleteMultipartUpload` + - `AbortMultipartUpload` + - `CopyObject` + - `UploadPart` + +Other operations will return error `Unimplemented`. + +## Server options + +Use `--addr` to specify which IP address and port the server should +listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +IPs. By default it only listens on localhost. You can use port +:0 to let the OS choose an available port. + +If you set `--addr` to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. + +You can use a unix socket by setting the url to `unix:///path/to/socket` +or just by using an absolute path name. Note that unix sockets bypass the +authentication - this is expected to be done with file system permissions. + +`--addr` may be repeated to listen on multiple IPs/ports/sockets. + +`--server-read-timeout` and `--server-write-timeout` can be used to +control the timeouts on the server. Note that this is the total time +for a transfer. + +`--max-header-bytes` controls the maximum number of bytes the server will +accept in the HTTP header. + +`--baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--baseurl "/rclone"` then +rclone would serve from a URL starting with "/rclone/". This is +useful if you wish to proxy rclone serve. Rclone automatically +inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, +`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +identically. + +### TLS (SSL) + +By default this will serve over http. If you want you can serve over +https. You will need to supply the `--cert` and `--key` flags. +If you wish to do client side certificate validation then you will need to +supply `--client-ca` also. + +`--cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--key` should be the PEM encoded +private key and `--client-ca` should be the PEM encoded client +certificate authority certificate. + +--min-tls-version is minimum TLS version that is acceptable. Valid + values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default + "tls1.0"). ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -7950,12 +9657,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -7972,10 +9680,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -8194,127 +9914,43 @@ _WARNING._ Contrary to `rclone size`, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -## Auth Proxy - -If you supply the parameter `--auth-proxy /path/to/program` then -rclone will use that program to generate backends on the fly which -then are used to authenticate incoming requests. This uses a simple -JSON based protocol with input on STDIN and output on STDOUT. - -**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used -together, if `--auth-proxy` is set the authorized keys option will be -ignored. - -There is an example program -[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) -in the rclone source code. - -The program's job is to take a `user` and `pass` on the input and turn -those into the config for a backend on STDOUT in JSON format. This -config will have any default parameters for the backend added, but it -won't use configuration from environment variables or command line -options - it is the job of the proxy program to make a complete -config. - -This config generated must have this extra parameter -- `_root` - root to use for the backend - -And it may have this parameter -- `_obscure` - comma separated strings for parameters to obscure - -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "pass": "mypassword" -} -``` - -If public-key authentication was used by the client, input to the -proxy process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" -} -``` - -And as an example return this on STDOUT - -``` -{ - "type": "sftp", - "_root": "", - "_obscure": "pass", - "user": "me", - "pass": "mypassword", - "host": "sftp.example.com" -} -``` - -This would mean that an SFTP backend would be created on the fly for -the `user` and `pass`/`public_key` returned in the output to the host given. Note -that since `_obscure` is set to `pass`, rclone will obscure the `pass` -parameter before creating the backend (which is required for sftp -backends). - -The program can manipulate the supplied `user` in any way, for example -to make proxy to many different sftp backends, you could make the -`user` be `user@example.com` and then set the `host` to `example.com` -in the output and the user to `user`. For security you'd probably want -to restrict the `host` to a limited list. - -Note that an internal cache is keyed on `user` so only use that for -configuration, don't use `pass` or `public_key`. This also means that if a user's -password or public-key is changed the cache will need to expire (which takes 5 mins) -before it takes effect. - -This can be used to build general purpose proxies to any kind of -backend that rclone supports. - ``` -rclone serve webdav remote:path [flags] +rclone serve s3 remote:path [flags] ``` ## Options ``` --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) - --auth-proxy string A program to use to create the backend from the auth + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-key stringArray Set key pair for v4 authorization: access_key_id,secret_access_key --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) --client-ca string Client certificate authority to verify clients with --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) - --disable-dir-list Disable HTML directory list on GET request for a directory - --etag-hash string Which hash to use for the ETag, or auto or blank for off + --etag-hash string Which hash to use for the ETag, or auto or blank for off (default "MD5") --file-perms FileMode File permissions (default 0666) + --force-path-style If true use path style access if false use virtual hosted style (default true) (default true) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for webdav - --htpasswd string A htpasswd file - if not provided no authentication is done + -h, --help help for s3 --key string TLS PEM Private key --max-header-bytes int Maximum size of request header (default 4096) --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") --no-checksum Don't compare checksums on up/download + --no-cleanup Not to cleanup empty folder after object is deleted --no-modtime Don't read/write the modification time (can speed things up) --no-seek Don't allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --realm string Realm for authentication - --salt string Password hashing salt (default "dlPL2MqE") --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --template string User-specified template --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -8324,12236 +9960,11739 @@ rclone serve webdav remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` -See the [global flags page](https://rclone.org/flags/) for global options not listed here. - -## SEE ALSO -* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. +## Filter Options -# rclone settier +Flags for filtering directory listings. -Changes storage class/tier of objects in remote. +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -## Synopsis +See the [global flags page](https://rclone.org/flags/) for global options not listed here. +# SEE ALSO -rclone settier changes storage tier or class at remote if supported. -Few cloud storage services provides different storage classes on objects, -for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive, -Google Cloud Storage, Regional Storage, Nearline, Coldline etc. +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -Note that, certain tier changes make objects not available to access immediately. -For example tiering to archive in azure blob storage makes objects in frozen state, -user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object -inaccessible.true +# rclone serve sftp -You can use it to tier single object +Serve the remote over SFTP. - rclone settier Cool remote:path/file +## Synopsis -Or use rclone filters to set tier on only specific files +Run an SFTP server to serve a remote over SFTP. This can be used +with an SFTP client or you can make a remote of type [sftp](/sftp) to use with it. - rclone --include "*.txt" settier Hot remote:path/dir +You can use the [filter](/filtering) flags (e.g. `--include`, `--exclude`) +to control what is served. -Or just provide remote directory and all files in directory will be tiered +The server will respond to a small number of shell commands, mainly +md5sum, sha1sum and df, which enable it to provide support for checksums +and the about feature when accessed from an sftp remote. - rclone settier tier remote:path/dir +Note that this server uses standard 32 KiB packet payload size, which +means you must not configure the client to expect anything else, e.g. +with the [chunk_size](https://rclone.org/sftp/#sftp-chunk-size) option on an sftp remote. +The server will log errors. Use `-v` to see access logs. -``` -rclone settier tier remote:path [flags] -``` +`--bwlimit` will be respected for file transfers. +Use `--stats` to control the stats printing. -## Options +You must provide some means of authentication, either with +`--user`/`--pass`, an authorized keys file (specify location with +`--authorized-keys` - the default is the same as ssh), an +`--auth-proxy`, or set the `--no-auth` flag for no +authentication when logging in. -``` - -h, --help help for settier -``` +If you don't supply a host `--key` then rclone will generate rsa, ecdsa +and ed25519 variants, and cache them for later use in rclone's cache +directory (see `rclone help flags cache-dir`) in the "serve-sftp" +directory. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +By default the server binds to localhost:2022 - if you want it to be +reachable externally then supply `--addr :2022` for example. -## SEE ALSO +Note that the default of `--vfs-cache-mode off` is fine for the rclone +sftp backend, but it may not be with other SFTP clients. -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +If `--stdio` is specified, rclone will serve SFTP over stdio, which can +be used with sshd via ~/.ssh/authorized_keys, for example: -# rclone test + restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... -Run a test command - -## Synopsis +On the client you need to set `--transfers 1` when using `--stdio`. +Otherwise multiple instances of the rclone server are started by OpenSSH +which can lead to "corrupted on transfer" errors. This is the case because +the client chooses indiscriminately which server to send commands to while +the servers all have different views of the state of the filing system. -Rclone test is used to run test commands. +The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being +used. Omitting "restrict" and using `--sftp-path-override` to enable +checksumming is possible but less secure and you could use the SFTP server +provided by OpenSSH in this case. -Select which test comand you want with the subcommand, eg +## VFS - Virtual File System - rclone test memory remote: +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. -Each subcommand has its own options which you can see in their help. +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. -**NB** Be careful running these commands, they may do strange things -so reading their documentation first is recommended. +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. +## VFS Directory Cache -## Options +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. -``` - -h, --help help for test -``` + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. -## SEE ALSO +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -* [rclone test changenotify](https://rclone.org/commands/rclone_test_changenotify/) - Log any change notify requests for the remote passed in. -* [rclone test histogram](https://rclone.org/commands/rclone_test_histogram/) - Makes a histogram of file name characters. -* [rclone test info](https://rclone.org/commands/rclone_test_info/) - Discovers file name or other limitations for paths. -* [rclone test makefile](https://rclone.org/commands/rclone_test_makefile/) - Make files with random contents of the size given -* [rclone test makefiles](https://rclone.org/commands/rclone_test_makefiles/) - Make a random file hierarchy in a directory -* [rclone test memory](https://rclone.org/commands/rclone_test_memory/) - Load all the objects at remote:path into memory and report memory stats. + kill -SIGHUP $(pidof rclone) -# rclone test changenotify +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: -Log any change notify requests for the remote passed in. + rclone rc vfs/forget -``` -rclone test changenotify remote: [flags] -``` +Or individual files or directories: -## Options + rclone rc vfs/forget file=path/to/file dir=path/to/dir -``` - -h, --help help for changenotify - --poll-interval Duration Time to wait between polling for changes (default 10s) -``` +## VFS File Buffering -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. -## SEE ALSO +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. -# rclone test histogram +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. -Makes a histogram of file name characters. +## VFS File Caching -## Synopsis +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. -This command outputs JSON which shows the histogram of characters used -in filenames in the remote:path specified. +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. -The data doesn't contain any identifying information but is useful for -the rclone developers when developing filename compression. +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) -``` -rclone test histogram [remote:path] [flags] -``` +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. -## Options +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. -``` - -h, --help help for histogram -``` +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . -## SEE ALSO +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +### --vfs-cache-mode off -# rclone test info +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. -Discovers file name or other limitations for paths. +This will mean some operations are not possible -## Synopsis + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried -rclone info discovers what filenames and upload methods are possible -to write to the paths passed in and how long they can be. It can take some -time. It will write test files into the remote:path passed in. It outputs -a bit of go code for each one. +### --vfs-cache-mode minimal -**NB** this can create undeletable files and other hazards - use with care +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. +These operations are not possible -``` -rclone test info [remote:path]+ [flags] -``` + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried -## Options +### --vfs-cache-mode writes -``` - --all Run all tests - --check-control Check control characters - --check-length Check max filename length - --check-normalization Check UTF-8 Normalization - --check-streaming Check uploads with indeterminate file size - -h, --help help for info - --upload-wait Duration Wait after writing a file (default 0s) - --write-json string Write results to file -``` +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +This mode should support all normal file system operations. -## SEE ALSO +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +### --vfs-cache-mode full -# rclone test makefile +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. -Make files with random contents of the size given +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. -``` -rclone test makefile []+ [flags] -``` +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. -## Options +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. -``` - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - -h, --help help for makefile - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 -``` +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. -## SEE ALSO +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +### Fingerprinting -# rclone test makefiles +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: -Make a random file hierarchy in a directory +- size +- modification time +- hash -``` -rclone test makefiles [flags] -``` +where available on an object. -## Options +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). -``` - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - --files int Number of files to create (default 1000) - --files-per-directory int Average number of files per directory (default 10) - -h, --help help for makefiles - --max-depth int Maximum depth of directory hierarchy (default 10) - --max-file-size SizeSuffix Maximum size of files to create (default 100) - --max-name-length int Maximum size of file names (default 12) - --min-file-size SizeSuffix Minimum size of file to create - --min-name-length int Minimum size of file names (default 4) - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 -``` +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. -## SEE ALSO +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. -# rclone test memory +## VFS Chunked Reading -Load all the objects at remote:path into memory and report memory stats. +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. -``` -rclone test memory remote:path [flags] -``` +These flags control the chunking: -## Options + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) -``` - -h, --help help for memory -``` +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. -## SEE ALSO +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +## VFS Performance -# rclone touch +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. -Create new file or change file modification time. +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. -## Synopsis + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. -Set the modification time on file(s) as specified by remote:path to -have the current time. + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) -If remote:path does not exist then a zero sized file will be created, -unless `--no-create` or `--recursive` is provided. +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). -If `--recursive` is used then recursively sets the modification -time on all existing files that is found under the path. Filters are supported, -and you can test with the `--dry-run` or the `--interactive`/`-i` flag. + --transfers int Number of file transfers to run in parallel (default 4) -If `--timestamp` is used then sets the modification time to that -time instead of the current time. Times may be specified as one of: +## VFS Case Sensitivity -- 'YYMMDD' - e.g. 17.10.30 -- 'YYYY-MM-DDTHH:MM:SS' - e.g. 2006-01-02T15:04:05 -- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789 +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. -Note that value of `--timestamp` is in UTC. If you want local time -then add the `--localtime` flag. +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. -``` -rclone touch remote:path [flags] -``` +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. -## Options +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. -``` - -h, --help help for touch - --localtime Use localtime for timestamp, not UTC - -C, --no-create Do not create the file if it does not exist (implied with --recursive) - -R, --recursive Recursively touch all files - -t, --timestamp string Use specified time instead of the current time of day -``` +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". -## SEE ALSO +## VFS Disk Options -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. -# rclone tree + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) -List the contents of the remote in a tree like fashion. +## Alternate report of used bytes -## Synopsis +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. -rclone tree lists the contents of a remote in a similar way to the -unix tree command. +## Auth Proxy -For example +If you supply the parameter `--auth-proxy /path/to/program` then +rclone will use that program to generate backends on the fly which +then are used to authenticate incoming requests. This uses a simple +JSON based protocol with input on STDIN and output on STDOUT. - $ rclone tree remote:path - / - ├── file1 - ├── file2 - ├── file3 - └── subdir - ├── file4 - └── file5 +**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used +together, if `--auth-proxy` is set the authorized keys option will be +ignored. - 1 directories, 5 files +There is an example program +[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) +in the rclone source code. -You can use any of the filtering options with the tree command (e.g. -`--include` and `--exclude`. You can also use `--fast-list`. +The program's job is to take a `user` and `pass` on the input and turn +those into the config for a backend on STDOUT in JSON format. This +config will have any default parameters for the backend added, but it +won't use configuration from environment variables or command line +options - it is the job of the proxy program to make a complete +config. -The tree command has many options for controlling the listing which -are compatible with the tree command, for example you can include file -sizes with `--size`. Note that not all of them have -short options as they conflict with rclone's short options. +This config generated must have this extra parameter +- `_root` - root to use for the backend -For a more interactive navigation of the remote see the -[ncdu](https://rclone.org/commands/rclone_ncdu/) command. +And it may have this parameter +- `_obscure` - comma separated strings for parameters to obscure +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: ``` -rclone tree remote:path [flags] +{ + "user": "me", + "pass": "mypassword" +} ``` -## Options +If public-key authentication was used by the client, input to the +proxy process (on STDIN) would look similar to this: ``` - -a, --all All files are listed (list . files too) - -d, --dirs-only List directories only - --dirsfirst List directories before files (-U disables) - --full-path Print the full path prefix for each file - -h, --help help for tree - --level int Descend only level directories deep - -D, --modtime Print the date of last modification. - --noindent Don't print indentation lines - --noreport Turn off file/directory count at end of tree listing - -o, --output string Output to file instead of stdout - -p, --protections Print the protections for each file. - -Q, --quote Quote filenames with double quotes. - -s, --size Print the size in bytes of each file. - --sort string Select sort: name,version,size,mtime,ctime - --sort-ctime Sort files by last status change time - -t, --sort-modtime Sort files by last modification time - -r, --sort-reverse Reverse the order of the sort - -U, --unsorted Leave files unsorted - --version Sort files alphanumerically by version +{ + "user": "me", + "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" +} ``` -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +And as an example return this on STDOUT -## SEE ALSO +``` +{ + "type": "sftp", + "_root": "", + "_obscure": "pass", + "user": "me", + "pass": "mypassword", + "host": "sftp.example.com" +} +``` -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +This would mean that an SFTP backend would be created on the fly for +the `user` and `pass`/`public_key` returned in the output to the host given. Note +that since `_obscure` is set to `pass`, rclone will obscure the `pass` +parameter before creating the backend (which is required for sftp +backends). +The program can manipulate the supplied `user` in any way, for example +to make proxy to many different sftp backends, you could make the +`user` be `user@example.com` and then set the `host` to `example.com` +in the output and the user to `user`. For security you'd probably want +to restrict the `host` to a limited list. -Copying single files --------------------- +Note that an internal cache is keyed on `user` so only use that for +configuration, don't use `pass` or `public_key`. This also means that if a user's +password or public-key is changed the cache will need to expire (which takes 5 mins) +before it takes effect. -rclone normally syncs or copies directories. However, if the source -remote points to a file, rclone will just copy that file. The -destination remote must point to a directory - rclone will give the -error `Failed to create file system for "remote:file": is a file not a -directory` if it isn't. +This can be used to build general purpose proxies to any kind of +backend that rclone supports. -For example, suppose you have a remote with a file in called -`test.jpg`, then you could copy just that file like this - rclone copy remote:test.jpg /tmp/download +``` +rclone serve sftp remote:path [flags] +``` -The file `test.jpg` will be placed inside `/tmp/download`. +## Options -This is equivalent to specifying +``` + --addr string IPaddress:Port or :Port to bind server to (default "localhost:2022") + --auth-proxy string A program to use to create the backend from the auth + --authorized-keys string Authorized keys file (default "~/.ssh/authorized_keys") + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for sftp + --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) + --no-auth Allow connections with no authentication if set + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --stdio Run an sftp server on stdin/stdout + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +``` - rclone copy --files-from /tmp/files remote: /tmp/download -Where `/tmp/files` contains the single line +## Filter Options - test.jpg +Flags for filtering directory listings. -It is recommended to use `copy` when copying individual files, not `sync`. -They have pretty much the same effect but `copy` will use a lot less -memory. +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -Syntax of remote paths ----------------------- +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -The syntax of the paths passed to the rclone command are as follows. +# SEE ALSO -### /path/to/dir +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -This refers to the local file system. +# rclone serve webdav -On Windows `\` may be used instead of `/` in local paths **only**, -non local paths must use `/`. See [local filesystem](https://rclone.org/local/#paths-on-windows) -documentation for more about Windows-specific paths. +Serve remote:path over WebDAV. -These paths needn't start with a leading `/` - if they don't then they -will be relative to the current directory. +## Synopsis -### remote:path/to/dir +Run a basic WebDAV server to serve a remote over HTTP via the +WebDAV protocol. This can be viewed with a WebDAV client, through a web +browser, or you can make a remote of type WebDAV to read and write it. -This refers to a directory `path/to/dir` on `remote:` as defined in -the config file (configured with `rclone config`). +## WebDAV options -### remote:/path/to/dir +### --etag-hash -On most backends this is refers to the same directory as -`remote:path/to/dir` and that format should be preferred. On a very -small number of remotes (FTP, SFTP, Dropbox for business) this will -refer to a different directory. On these, paths without a leading `/` -will refer to your "home" directory and paths with a leading `/` will -refer to the root. +This controls the ETag header. Without this flag the ETag will be +based on the ModTime and Size of the object. -### :backend:path/to/dir +If this flag is set to "auto" then rclone will choose the first +supported hash on the backend or you can use a named hash such as +"MD5" or "SHA-1". Use the [hashsum](https://rclone.org/commands/rclone_hashsum/) command +to see the full list. -This is an advanced form for creating remotes on the fly. `backend` -should be the name or prefix of a backend (the `type` in the config -file) and all the configuration for the backend should be provided on -the command line (or in environment variables). +## Access WebDAV on Windows +WebDAV shared folder can be mapped as a drive on Windows, however the default settings prevent it. +Windows will fail to connect to the server using insecure Basic authentication. +It will not even display any login dialog. Windows requires SSL / HTTPS connection to be used with Basic. +If you try to connect via Add Network Location Wizard you will get the following error: +"The folder you entered does not appear to be valid. Please choose another". +However, you still can connect if you set the following registry key on a client machine: +HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel to 2. +The BasicAuthLevel can be set to the following values: + 0 - Basic authentication disabled + 1 - Basic authentication enabled for SSL connections only + 2 - Basic authentication enabled for SSL connections and for non-SSL connections +If required, increase the FileSizeLimitInBytes to a higher value. +Navigate to the Services interface, then restart the WebClient service. -Here are some examples: +## Access Office applications on WebDAV +Navigate to following registry HKEY_CURRENT_USER\Software\Microsoft\Office\[14.0/15.0/16.0]\Common\Internet +Create a new DWORD BasicAuthLevel with value 2. + 0 - Basic authentication disabled + 1 - Basic authentication enabled for SSL connections only + 2 - Basic authentication enabled for SSL and for non-SSL connections - rclone lsd --http-url https://pub.rclone.org :http: +https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint -To list all the directories in the root of `https://pub.rclone.org/`. - rclone lsf --http-url https://example.com :http:path/to/dir +## Server options -To list files and directories in `https://example.com/path/to/dir/` +Use `--addr` to specify which IP address and port the server should +listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +IPs. By default it only listens on localhost. You can use port +:0 to let the OS choose an available port. - rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir +If you set `--addr` to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. -To copy files and directories in `https://example.com/path/to/dir` to `/tmp/dir`. +You can use a unix socket by setting the url to `unix:///path/to/socket` +or just by using an absolute path name. Note that unix sockets bypass the +authentication - this is expected to be done with file system permissions. - rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir +`--addr` may be repeated to listen on multiple IPs/ports/sockets. -To copy files and directories from `example.com` in the relative -directory `path/to/dir` to `/tmp/dir` using sftp. +`--server-read-timeout` and `--server-write-timeout` can be used to +control the timeouts on the server. Note that this is the total time +for a transfer. -### Connection strings {#connection-strings} +`--max-header-bytes` controls the maximum number of bytes the server will +accept in the HTTP header. -The above examples can also be written using a connection string -syntax, so instead of providing the arguments as command line -parameters `--http-url https://pub.rclone.org` they are provided as -part of the remote specification as a kind of connection string. +`--baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--baseurl "/rclone"` then +rclone would serve from a URL starting with "/rclone/". This is +useful if you wish to proxy rclone serve. Rclone automatically +inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, +`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +identically. - rclone lsd ":http,url='https://pub.rclone.org':" - rclone lsf ":http,url='https://example.com':path/to/dir" - rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir - rclone copy :sftp,host=example.com:path/to/dir /tmp/dir +### TLS (SSL) -These can apply to modify existing remotes as well as create new -remotes with the on the fly syntax. This example is equivalent to -adding the `--drive-shared-with-me` parameter to the remote `gdrive:`. +By default this will serve over http. If you want you can serve over +https. You will need to supply the `--cert` and `--key` flags. +If you wish to do client side certificate validation then you will need to +supply `--client-ca` also. - rclone lsf "gdrive,shared_with_me:path/to/dir" +`--cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--key` should be the PEM encoded +private key and `--client-ca` should be the PEM encoded client +certificate authority certificate. -The major advantage to using the connection string style syntax is -that it only applies to the remote, not to all the remotes of that -type of the command line. A common confusion is this attempt to copy a -file shared on google drive to the normal drive which **does not -work** because the `--drive-shared-with-me` flag applies to both the -source and the destination. +--min-tls-version is minimum TLS version that is acceptable. Valid + values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default + "tls1.0"). - rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: +### Template -However using the connection string syntax, this does work. +`--template` allows a user to specify a custom markup template for HTTP +and WebDAV serve functions. The server exports the following markup +to be used within the template to server pages: - rclone copy "gdrive,shared_with_me:shared-file.txt" gdrive: +| Parameter | Description | +| :---------- | :---------- | +| .Name | The full path of a file/directory. | +| .Title | Directory listing of .Name | +| .Sort | The current sort used. This is changeable via ?sort= parameter | +| | Sort Options: namedirfirst,name,size,time (default namedirfirst) | +| .Order | The current ordering used. This is changeable via ?order= parameter | +| | Order Options: asc,desc (default asc) | +| .Query | Currently unused. | +| .Breadcrumb | Allows for creating a relative navigation | +|-- .Link | The relative to the root link of the Text. | +|-- .Text | The Name of the directory. | +| .Entries | Information about a specific file/directory. | +|-- .URL | The 'url' of an entry. | +|-- .Leaf | Currently same as 'URL' but intended to be 'just' the name. | +|-- .IsDir | Boolean for if an entry is a directory or not. | +|-- .Size | Size in Bytes of the entry. | +|-- .ModTime | The UTC timestamp of an entry. | -Note that the connection string only affects the options of the immediate -backend. If for example gdriveCrypt is a crypt based on gdrive, then the -following command **will not work** as intended, because -`shared_with_me` is ignored by the crypt backend: +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. - rclone copy "gdriveCrypt,shared_with_me:shared-file.txt" gdriveCrypt: +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | -The connection strings have the following syntax +### Authentication - remote,parameter=value,parameter2=value2:path/to/dir - :backend,parameter=value,parameter2=value2:path/to/dir +By default this will serve files without needing a login. -If the `parameter` has a `:` or `,` then it must be placed in quotes `"` or -`'`, so +You can either use an htpasswd file which can take lots of users, or +set a single username and password with the `--user` and `--pass` flags. - remote,parameter="colon:value",parameter2="comma,value":path/to/dir - :backend,parameter='colon:value',parameter2='comma,value':path/to/dir +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. -If a quoted value needs to include that quote, then it should be -doubled, so +Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is +in standard apache format and supports MD5, SHA1 and BCrypt for basic +authentication. Bcrypt is recommended. - remote,parameter="with""quote",parameter2='with''quote':path/to/dir +To create an htpasswd file: -This will make `parameter` be `with"quote` and `parameter2` be -`with'quote`. + touch htpasswd + htpasswd -B htpasswd user + htpasswd -B htpasswd anotherUser -If you leave off the `=parameter` then rclone will substitute `=true` -which works very well with flags. For example, to use s3 configured in -the environment you could use: +The password file can be updated while rclone is running. - rclone lsd :s3,env_auth: +Use `--realm` to set the authentication realm. -Which is equivalent to +Use `--salt` to change the password hashing salt from the default. +## VFS - Virtual File System - rclone lsd :s3,env_auth=true: +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. -Note that on the command line you might need to surround these -connection strings with `"` or `'` to stop the shell interpreting any -special characters within them. +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. -If you are a shell master then you'll know which strings are OK and -which aren't, but if you aren't sure then enclose them in `"` and use -`'` as the inside quote. This syntax works on all OSes. +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. - rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir +## VFS Directory Cache -On Linux/macOS some characters are still interpreted inside `"` -strings in the shell (notably `\` and `$` and `"`) so if your strings -contain those you can swap the roles of `"` and `'` thus. (This syntax -does not work on Windows.) +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. - rclone copy ':http,url="https://example.com":path/to/dir' /tmp/dir + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) -#### Connection strings, config and logging +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. -If you supply extra configuration to a backend by command line flag, -environment variable or connection string then rclone will add a -suffix based on the hash of the config to the name of the remote, eg +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: - rclone -vv lsf --s3-chunk-size 20M s3: + kill -SIGHUP $(pidof rclone) -Has the log message +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: - DEBUG : s3: detected overridden config - adding "{Srj1p}" suffix to name + rclone rc vfs/forget -This is so rclone can tell the modified remote apart from the -unmodified remote when caching the backends. +Or individual files or directories: -This should only be noticeable in the logs. + rclone rc vfs/forget file=path/to/file dir=path/to/dir -This means that on the fly backends such as +## VFS File Buffering - rclone -vv lsf :s3,env_auth: +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. -Will get their own names +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. - DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. -### Valid remote names +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. -Remote names are case sensitive, and must adhere to the following rules: - - May contain number, letter, `_`, `-`, `.`, `+`, `@` and space. - - May not start with `-` or space. - - May not end with space. +## VFS File Caching -Starting with rclone version 1.61, any Unicode numbers and letters are allowed, -while in older versions it was limited to plain ASCII (0-9, A-Z, a-z). If you use -the same rclone configuration from different shells, which may be configured with -different character encoding, you must be cautious to use characters that are -possible to write in all of them. This is mostly a problem on Windows, where -the console traditionally uses a non-Unicode character set - defined -by the so-called "code page". +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. -Quoting and the shell ---------------------- +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. -When you are typing commands to your computer you are using something -called the command line shell. This interprets various characters in -an OS specific way. +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. -Here are some gotchas which may help users unfamiliar with the shell rules + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) -### Linux / OSX ### +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. -If your names have spaces or shell metacharacters (e.g. `*`, `?`, `$`, -`'`, `"`, etc.) then you must quote them. Use single quotes `'` by default. +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. - rclone copy 'Important files?' remote:backup +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. -If you want to send a `'` you will need to use `"`, e.g. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . - rclone copy "O'Reilly Reviews" remote:backup +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. -The rules for quoting metacharacters are complicated and if you want -the full details you'll have to consult the manual page for your -shell. +### --vfs-cache-mode off -### Windows ### +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. -If your names have spaces in you need to put them in `"`, e.g. +This will mean some operations are not possible - rclone copy "E:\folder name\folder name\folder name" remote:backup + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried -If you are using the root directory on its own then don't quote it -(see [#464](https://github.com/rclone/rclone/issues/464) for why), e.g. +### --vfs-cache-mode minimal - rclone copy E:\ remote:backup +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. -Copying files or directories with `:` in the names --------------------------------------------------- +These operations are not possible -rclone uses `:` to mark a remote name. This is, however, a valid -filename component in non-Windows OSes. The remote name parser will -only search for a `:` up to the first `/` so if you need to act on a -file or directory like this then use the full path starting with a -`/`, or use `./` as a current directory prefix. + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried -So to sync a directory called `sync:me` to a remote called `remote:` use +### --vfs-cache-mode writes - rclone sync --interactive ./sync:me remote:path +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. -or +This mode should support all normal file system operations. - rclone sync --interactive /full/path/to/sync:me remote:path +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. -Server Side Copy ----------------- +### --vfs-cache-mode full -Most remotes (but not all - see [the -overview](https://rclone.org/overview/#optional-features)) support server-side copy. +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. -This means if you want to copy one folder to another then rclone won't -download all the files and re-upload them; it will instruct the server -to copy them in place. +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. -Eg +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. - rclone copy s3:oldbucket s3:newbucket +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. -Will copy the contents of `oldbucket` to `newbucket` without -downloading and re-uploading. +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. -Remotes which don't support server-side copy **will** download and -re-upload in this case. +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. -Server side copies are used with `sync` and `copy` and will be -identified in the log when using the `-v` flag. The `move` command -may also use them if remote doesn't support server-side move directly. -This is done by issuing a server-side copy then a delete which is much -quicker than a download and re-upload. +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. -Server side copies will only be attempted if the remote names are the -same. +### Fingerprinting -This can be used when scripting to make aged backups efficiently, e.g. +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: - rclone sync --interactive remote:current-backup remote:previous-backup - rclone sync --interactive /path/to/files remote:current-backup +- size +- modification time +- hash -## Metadata support {#metadata} +where available on an object. -Metadata is data about a file which isn't the contents of the file. -Normally rclone only preserves the modification time and the content -(MIME) type where possible. +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). -Rclone supports preserving all the available metadata on files (not -directories) when using the `--metadata` or `-M` flag. +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. -Exactly what metadata is supported and what that support means depends -on the backend. Backends that support metadata have a metadata section -in their docs and are listed in the [features table](https://rclone.org/overview/#features) -(Eg [local](https://rclone.org/local/#metadata), [s3](/s3/#metadata)) +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. -Rclone only supports a one-time sync of metadata. This means that -metadata will be synced from the source object to the destination -object only when the source object has changed and needs to be -re-uploaded. If the metadata subsequently changes on the source object -without changing the object itself then it won't be synced to the -destination object. This is in line with the way rclone syncs -`Content-Type` without the `--metadata` flag. +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. -Using `--metadata` when syncing from local to local will preserve file -attributes such as file mode, owner, extended attributes (not -Windows). +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. -Note that arbitrary metadata may be added to objects using the -`--metadata-set key=value` flag when the object is first uploaded. -This flag can be repeated as many times as necessary. +## VFS Chunked Reading -### Types of metadata +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. -Metadata is divided into two type. System metadata and User metadata. +These flags control the chunking: -Metadata which the backend uses itself is called system metadata. For -example on the local backend the system metadata `uid` will store the -user ID of the file when used on a unix based platform. + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) -Arbitrary metadata is called user metadata and this can be set however -is desired. +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. -When objects are copied from backend to backend, they will attempt to -interpret system metadata if it is supplied. Metadata may change from -being user metadata to system metadata as objects are copied between -different backends. For example copying an object from s3 sets the -`content-type` metadata. In a backend which understands this (like -`azureblob`) this will become the Content-Type of the object. In a -backend which doesn't understand this (like the `local` backend) this -will become user metadata. However should the local object be copied -back to s3, the Content-Type will be set correctly. +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. -### Metadata framework +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. -Rclone implements a metadata framework which can read metadata from an -object and write it to the object when (and only when) it is being -uploaded. +## VFS Performance -This metadata is stored as a dictionary with string keys and string -values. +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. -There are some limits on the names of the keys (these may be clarified -further in the future). +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. -- must be lower case -- may be `a-z` `0-9` containing `.` `-` or `_` -- length is backend dependent + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. -Each backend can provide system metadata that it understands. Some -backends can also store arbitrary user metadata. +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. -Where possible the key names are standardized, so, for example, it is -possible to copy object metadata from s3 to azureblob for example and -metadata will be translated appropriately. + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) -Some backends have limits on the size of the metadata and rclone will -give errors on upload if they are exceeded. +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). -### Metadata preservation + --transfers int Number of file transfers to run in parallel (default 4) -The goal of the implementation is to +## VFS Case Sensitivity -1. Preserve metadata if at all possible -2. Interpret metadata if at all possible +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. -The consequences of 1 is that you can copy an S3 object to a local -disk then back to S3 losslessly. Likewise you can copy a local file -with file attributes and xattrs from local disk to s3 and back again -losslessly. +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. -The consequence of 2 is that you can copy an S3 object with metadata -to Azureblob (say) and have the metadata appear on the Azureblob -object also. +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. -### Standard system metadata +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. -Here is a table of standard system metadata which, if appropriate, a -backend may implement. +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. -| key | description | example | -|---------------------|-------------|---------| -| mode | File type and mode: octal, unix style | 0100664 | -| uid | User ID of owner: decimal number | 500 | -| gid | Group ID of owner: decimal number | 500 | -| rdev | Device ID (if special file) => hexadecimal | 0 | -| atime | Time of last access: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | -| mtime | Time of last modification: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | -| btime | Time of file creation (birth): RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | -| cache-control | Cache-Control header | no-cache | -| content-disposition | Content-Disposition header | inline | -| content-encoding | Content-Encoding header | gzip | -| content-language | Content-Language header | en-US | -| content-type | Content-Type header | text/plain | +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. -The metadata keys `mtime` and `content-type` will take precedence if -supplied in the metadata over reading the `Content-Type` or -modification time of the source object. +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". -Hashes are not included in system metadata as there is a well defined -way of reading those already. +## VFS Disk Options -Options -------- +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. -Rclone has a number of options to control its behaviour. + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) -Options that take parameters can have the values passed in two ways, -`--option=value` or `--option value`. However boolean (true/false) -options behave slightly differently to the other options in that -`--boolean` sets the option to `true` and the absence of the flag sets -it to `false`. It is also possible to specify `--boolean=false` or -`--boolean=true`. Note that `--boolean false` is not valid - this is -parsed as `--boolean` and the `false` is parsed as an extra command -line argument for rclone. +## Alternate report of used bytes -### Time or duration options {#time-option} +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. -TIME or DURATION options can be specified as a duration string or a -time string. +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. -A duration string is a possibly signed sequence of decimal numbers, -each with optional fraction and a unit suffix, such as "300ms", -"-1.5h" or "2h45m". Default units are seconds or the following -abbreviations are valid: +## Auth Proxy - * `ms` - Milliseconds - * `s` - Seconds - * `m` - Minutes - * `h` - Hours - * `d` - Days - * `w` - Weeks - * `M` - Months - * `y` - Years +If you supply the parameter `--auth-proxy /path/to/program` then +rclone will use that program to generate backends on the fly which +then are used to authenticate incoming requests. This uses a simple +JSON based protocol with input on STDIN and output on STDOUT. -These can also be specified as an absolute time in the following -formats: +**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used +together, if `--auth-proxy` is set the authorized keys option will be +ignored. -- RFC3339 - e.g. `2006-01-02T15:04:05Z` or `2006-01-02T15:04:05+07:00` -- ISO8601 Date and time, local timezone - `2006-01-02T15:04:05` -- ISO8601 Date and time, local timezone - `2006-01-02 15:04:05` -- ISO8601 Date - `2006-01-02` (YYYY-MM-DD) +There is an example program +[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) +in the rclone source code. -### Size options {#size-option} +The program's job is to take a `user` and `pass` on the input and turn +those into the config for a backend on STDOUT in JSON format. This +config will have any default parameters for the backend added, but it +won't use configuration from environment variables or command line +options - it is the job of the proxy program to make a complete +config. -Options which use SIZE use KiB (multiples of 1024 bytes) by default. -However, a suffix of `B` for Byte, `K` for KiB, `M` for MiB, -`G` for GiB, `T` for TiB and `P` for PiB may be used. These are -the binary units, e.g. 1, 2\*\*10, 2\*\*20, 2\*\*30 respectively. +This config generated must have this extra parameter +- `_root` - root to use for the backend -### --backup-dir=DIR ### +And it may have this parameter +- `_obscure` - comma separated strings for parameters to obscure -When using `sync`, `copy` or `move` any files which would have been -overwritten or deleted are moved in their original hierarchy into this -directory. +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: -If `--suffix` is set, then the moved files will have the suffix added -to them. If there is a file with the same path (after the suffix has -been added) in DIR, then it will be overwritten. +``` +{ + "user": "me", + "pass": "mypassword" +} +``` -The remote in use must support server-side move or copy and you must -use the same remote as the destination of the sync. The backup -directory must not overlap the destination directory without it being -excluded by a filter rule. +If public-key authentication was used by the client, input to the +proxy process (on STDIN) would look similar to this: -For example +``` +{ + "user": "me", + "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" +} +``` - rclone sync --interactive /path/to/local remote:current --backup-dir remote:old +And as an example return this on STDOUT -will sync `/path/to/local` to `remote:current`, but for any files -which would have been updated or deleted will be stored in -`remote:old`. +``` +{ + "type": "sftp", + "_root": "", + "_obscure": "pass", + "user": "me", + "pass": "mypassword", + "host": "sftp.example.com" +} +``` -If running rclone from a script you might want to use today's date as -the directory name passed to `--backup-dir` to store the old files, or -you might want to pass `--suffix` with today's date. +This would mean that an SFTP backend would be created on the fly for +the `user` and `pass`/`public_key` returned in the output to the host given. Note +that since `_obscure` is set to `pass`, rclone will obscure the `pass` +parameter before creating the backend (which is required for sftp +backends). -See `--compare-dest` and `--copy-dest`. +The program can manipulate the supplied `user` in any way, for example +to make proxy to many different sftp backends, you could make the +`user` be `user@example.com` and then set the `host` to `example.com` +in the output and the user to `user`. For security you'd probably want +to restrict the `host` to a limited list. -### --bind string ### +Note that an internal cache is keyed on `user` so only use that for +configuration, don't use `pass` or `public_key`. This also means that if a user's +password or public-key is changed the cache will need to expire (which takes 5 mins) +before it takes effect. -Local address to bind to for outgoing connections. This can be an -IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If -the host name doesn't resolve or resolves to more than one IP address -it will give an error. +This can be used to build general purpose proxies to any kind of +backend that rclone supports. -### --bwlimit=BANDWIDTH_SPEC ### -This option controls the bandwidth limit. For example +``` +rclone serve webdav remote:path [flags] +``` - --bwlimit 10M +## Options -would mean limit the upload and download bandwidth to 10 MiB/s. -**NB** this is **bytes** per second not **bits** per second. To use a -single limit, specify the desired bandwidth in KiB/s, or use a -suffix B|K|M|G|T|P. The default is `0` which means to not limit bandwidth. +``` + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-proxy string A program to use to create the backend from the auth + --baseurl string Prefix for URLs - leave blank for root + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --disable-dir-list Disable HTML directory list on GET request for a directory + --etag-hash string Which hash to use for the ETag, or auto or blank for off + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for webdav + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --realm string Realm for authentication + --salt string Password hashing salt (default "dlPL2MqE") + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --template string User-specified template + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +``` -The upload and download bandwidth can be specified separately, as -`--bwlimit UP:DOWN`, so - --bwlimit 10M:100k +## Filter Options -would mean limit the upload bandwidth to 10 MiB/s and the download -bandwidth to 100 KiB/s. Either limit can be "off" meaning no limit, so -to just limit the upload bandwidth you would use +Flags for filtering directory listings. - --bwlimit 10M:off +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -this would limit the upload bandwidth to 10 MiB/s but the download -bandwidth would be unlimited. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -When specified as above the bandwidth limits last for the duration of -run of the rclone binary. +# SEE ALSO -It is also possible to specify a "timetable" of limits, which will -cause certain limits to be applied at certain times. To specify a -timetable, format your entries as `WEEKDAY-HH:MM,BANDWIDTH -WEEKDAY-HH:MM,BANDWIDTH...` where: `WEEKDAY` is optional element. +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -- `BANDWIDTH` can be a single number, e.g.`100k` or a pair of numbers -for upload:download, e.g.`10M:1M`. -- `WEEKDAY` can be written as the whole word or only using the first 3 - characters. It is optional. -- `HH:MM` is an hour from 00:00 to 23:59. +# rclone settier -An example of a typical timetable to avoid link saturation during daytime -working hours could be: +Changes storage class/tier of objects in remote. -`--bwlimit "08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off"` +## Synopsis -In this example, the transfer bandwidth will be set to 512 KiB/s -at 8am every day. At noon, it will rise to 10 MiB/s, and drop back -to 512 KiB/sec at 1pm. At 6pm, the bandwidth limit will be set to -30 MiB/s, and at 11pm it will be completely disabled (full speed). -Anything between 11pm and 8am will remain unlimited. -An example of timetable with `WEEKDAY` could be: +rclone settier changes storage tier or class at remote if supported. +Few cloud storage services provides different storage classes on objects, +for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive, +Google Cloud Storage, Regional Storage, Nearline, Coldline etc. -`--bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off"` +Note that, certain tier changes make objects not available to access immediately. +For example tiering to archive in azure blob storage makes objects in frozen state, +user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object +inaccessible.true -It means that, the transfer bandwidth will be set to 512 KiB/s on -Monday. It will rise to 10 MiB/s before the end of Friday. At 10:00 -on Saturday it will be set to 1 MiB/s. From 20:00 on Sunday it will -be unlimited. +You can use it to tier single object -Timeslots without `WEEKDAY` are extended to the whole week. So this -example: + rclone settier Cool remote:path/file -`--bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off"` +Or use rclone filters to set tier on only specific files -Is equivalent to this: + rclone --include "*.txt" settier Hot remote:path/dir -`--bwlimit "Mon-00:00,512Mon-12:00,1M Tue-12:00,1M Wed-12:00,1M Thu-12:00,1M Fri-12:00,1M Sat-12:00,1M Sun-12:00,1M Sun-20:00,off"` +Or just provide remote directory and all files in directory will be tiered -Bandwidth limit apply to the data transfer for all backends. For most -backends the directory listing bandwidth is also included (exceptions -being the non HTTP backends, `ftp`, `sftp` and `storj`). + rclone settier tier remote:path/dir -Note that the units are **Byte/s**, not **bit/s**. Typically -connections are measured in bit/s - to convert divide by 8. For -example, let's say you have a 10 Mbit/s connection and you wish rclone -to use half of it - 5 Mbit/s. This is 5/8 = 0.625 MiB/s so you would -use a `--bwlimit 0.625M` parameter for rclone. -On Unix systems (Linux, macOS, …) the bandwidth limiter can be toggled by -sending a `SIGUSR2` signal to rclone. This allows to remove the limitations -of a long running rclone transfer and to restore it back to the value specified -with `--bwlimit` quickly when needed. Assuming there is only one rclone instance -running, you can toggle the limiter like this: +``` +rclone settier tier remote:path [flags] +``` - kill -SIGUSR2 $(pidof rclone) +## Options -If you configure rclone with a [remote control](/rc) then you can use -change the bwlimit dynamically: +``` + -h, --help help for settier +``` - rclone rc core/bwlimit rate=1M -### --bwlimit-file=BANDWIDTH_SPEC ### +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -This option controls per file bandwidth limit. For the options see the -`--bwlimit` flag. +# SEE ALSO -For example use this to allow no transfers to be faster than 1 MiB/s +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. - --bwlimit-file 1M +# rclone test -This can be used in conjunction with `--bwlimit`. +Run a test command -Note that if a schedule is provided the file will use the schedule in -effect at the start of the transfer. +## Synopsis -### --buffer-size=SIZE ### +Rclone test is used to run test commands. -Use this sized buffer to speed up file transfers. Each `--transfer` -will use this much memory for buffering. +Select which test command you want with the subcommand, eg -When using `mount` or `cmount` each open file descriptor will use this much -memory for buffering. -See the [mount](https://rclone.org/commands/rclone_mount/#file-buffering) documentation for more details. + rclone test memory remote: -Set to `0` to disable the buffering for the minimum memory usage. +Each subcommand has its own options which you can see in their help. -Note that the memory allocation of the buffers is influenced by the -[--use-mmap](#use-mmap) flag. +**NB** Be careful running these commands, they may do strange things +so reading their documentation first is recommended. -### --cache-dir=DIR ### -Specify the directory rclone will use for caching, to override -the default. +## Options -Default value is depending on operating system: -- Windows `%LocalAppData%\rclone`, if `LocalAppData` is defined. -- macOS `$HOME/Library/Caches/rclone` if `HOME` is defined. -- Unix `$XDG_CACHE_HOME/rclone` if `XDG_CACHE_HOME` is defined, else `$HOME/.cache/rclone` if `HOME` is defined. -- Fallback (on all OS) to `$TMPDIR/rclone`, where `TMPDIR` is the value from [--temp-dir](#temp-dir-dir). +``` + -h, --help help for test +``` -You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) -command to see the current value. -Cache directory is heavily used by the [VFS File Caching](https://rclone.org/commands/rclone_mount/#vfs-file-caching) -mount feature, but also by [serve](https://rclone.org/commands/rclone_serve/), [GUI](/gui) and other parts of rclone. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -### --check-first ### +# SEE ALSO -If this flag is set then in a `sync`, `copy` or `move`, rclone will do -all the checks to see whether files need to be transferred before -doing any of the transfers. Normally rclone would start running -transfers as soon as possible. +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +* [rclone test changenotify](https://rclone.org/commands/rclone_test_changenotify/) - Log any change notify requests for the remote passed in. +* [rclone test histogram](https://rclone.org/commands/rclone_test_histogram/) - Makes a histogram of file name characters. +* [rclone test info](https://rclone.org/commands/rclone_test_info/) - Discovers file name or other limitations for paths. +* [rclone test makefile](https://rclone.org/commands/rclone_test_makefile/) - Make files with random contents of the size given +* [rclone test makefiles](https://rclone.org/commands/rclone_test_makefiles/) - Make a random file hierarchy in a directory +* [rclone test memory](https://rclone.org/commands/rclone_test_memory/) - Load all the objects at remote:path into memory and report memory stats. -This flag can be useful on IO limited systems where transfers -interfere with checking. +# rclone test changenotify -It can also be useful to ensure perfect ordering when using -`--order-by`. +Log any change notify requests for the remote passed in. -If both `--check-first` and `--order-by` are set when doing `rclone move` -then rclone will use the transfer thread to delete source files which -don't need transferring. This will enable perfect ordering of the -transfers and deletes but will cause the transfer stats to have more -items in than expected. +``` +rclone test changenotify remote: [flags] +``` -Using this flag can use more memory as it effectively sets -`--max-backlog` to infinite. This means that all the info on the -objects to transfer is held in memory before the transfers start. +## Options -### --checkers=N ### +``` + -h, --help help for changenotify + --poll-interval Duration Time to wait between polling for changes (default 10s) +``` -Originally controlling just the number of file checkers to run in parallel, -e.g. by `rclone copy`. Now a fairly universal parallelism control -used by `rclone` in several places. -Note: checkers do the equality checking of files during a sync. -For some storage systems (e.g. S3, Swift, Dropbox) this can take -a significant amount of time so they are run in parallel. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -The default is to run 8 checkers in parallel. However, in case -of slow-reacting backends you may need to lower (rather than increase) -this default by setting `--checkers` to 4 or less threads. This is -especially advised if you are experiencing backend server crashes -during file checking phase (e.g. on subsequent or top-up backups -where little or no file copying is done and checking takes up -most of the time). Increase this setting only with utmost care, -while monitoring your server health and file checking throughput. +# SEE ALSO -### -c, --checksum ### +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -Normally rclone will look at modification time and size of files to -see if they are equal. If you set this flag then rclone will check -the file hash and size to determine if files are equal. +# rclone test histogram -This is useful when the remote doesn't support setting modified time -and a more accurate sync is desired than just checking the file size. +Makes a histogram of file name characters. -This is very useful when transferring between remotes which store the -same hash type on the object, e.g. Drive and Swift. For details of which -remotes support which hash type see the table in the [overview -section](https://rclone.org/overview/). +## Synopsis -Eg `rclone --checksum sync s3:/bucket swift:/bucket` would run much -quicker than without the `--checksum` flag. +This command outputs JSON which shows the histogram of characters used +in filenames in the remote:path specified. -When using this flag, rclone won't update mtimes of remote files if -they are incorrect as it would normally. +The data doesn't contain any identifying information but is useful for +the rclone developers when developing filename compression. -### --color WHEN ### - -Specifiy when colors (and other ANSI codes) should be added to the output. - -`AUTO` (default) only allows ANSI codes when the output is a terminal - -`NEVER` never allow ANSI codes - -`ALWAYS` always add ANSI codes, regardless of the output format (terminal or file) - -### --compare-dest=DIR ### - -When using `sync`, `copy` or `move` DIR is checked in addition to the -destination for files. If a file identical to the source is found that -file is NOT copied from source. This is useful to copy just files that -have changed since the last backup. - -You must use the same remote as the destination of the sync. The -compare directory must not overlap the destination directory. -See `--copy-dest` and `--backup-dir`. +``` +rclone test histogram [remote:path] [flags] +``` -### --config=CONFIG_FILE ### +## Options -Specify the location of the rclone configuration file, to override -the default. E.g. `rclone config --config="rclone.conf"`. +``` + -h, --help help for histogram +``` -The exact default is a bit complex to describe, due to changes -introduced through different versions of rclone while preserving -backwards compatibility, but in most cases it is as simple as: - - `%APPDATA%/rclone/rclone.conf` on Windows - - `~/.config/rclone/rclone.conf` on other +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -The complete logic is as follows: Rclone will look for an existing -configuration file in any of the following locations, in priority order: +# SEE ALSO - 1. `rclone.conf` (in program directory, where rclone executable is) - 2. `%APPDATA%/rclone/rclone.conf` (only on Windows) - 3. `$XDG_CONFIG_HOME/rclone/rclone.conf` (on all systems, including Windows) - 4. `~/.config/rclone/rclone.conf` (see below for explanation of ~ symbol) - 5. `~/.rclone.conf` +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -If no existing configuration file is found, then a new one will be created -in the following location: +# rclone test info -- On Windows: Location 2 listed above, except in the unlikely event - that `APPDATA` is not defined, then location 4 is used instead. -- On Unix: Location 3 if `XDG_CONFIG_HOME` is defined, else location 4. -- Fallback to location 5 (on all OS), when the rclone directory cannot be - created, but if also a home directory was not found then path - `.rclone.conf` relative to current working directory will be used as - a final resort. +Discovers file name or other limitations for paths. -The `~` symbol in paths above represent the home directory of the current user -on any OS, and the value is defined as following: +## Synopsis - - On Windows: `%HOME%` if defined, else `%USERPROFILE%`, or else `%HOMEDRIVE%\%HOMEPATH%`. - - On Unix: `$HOME` if defined, else by looking up current user in OS-specific user database - (e.g. passwd file), or else use the result from shell command `cd && pwd`. +rclone info discovers what filenames and upload methods are possible +to write to the paths passed in and how long they can be. It can take some +time. It will write test files into the remote:path passed in. It outputs +a bit of go code for each one. -If you run `rclone config file` you will see where the default -location is for you. +**NB** this can create undeletable files and other hazards - use with care -The fact that an existing file `rclone.conf` in the same directory -as the rclone executable is always preferred, means that it is easy -to run in "portable" mode by downloading rclone executable to a -writable directory and then create an empty file `rclone.conf` in the -same directory. -If the location is set to empty string `""` or path to a file -with name `notfound`, or the os null device represented by value `NUL` on -Windows and `/dev/null` on Unix systems, then rclone will keep the -config file in memory only. +``` +rclone test info [remote:path]+ [flags] +``` -The file format is basic [INI](https://en.wikipedia.org/wiki/INI_file#Format): -Sections of text, led by a `[section]` header and followed by -`key=value` entries on separate lines. In rclone each remote is -represented by its own section, where the section name defines the -name of the remote. Options are specified as the `key=value` entries, -where the key is the option name without the `--backend-` prefix, -in lowercase and with `_` instead of `-`. E.g. option `--mega-hard-delete` -corresponds to key `hard_delete`. Only backend options can be specified. -A special, and required, key `type` identifies the [storage system](https://rclone.org/overview/), -where the value is the internal lowercase name as returned by command -`rclone help backends`. Comments are indicated by `;` or `#` at the -beginning of a line. +## Options -Example: +``` + --all Run all tests + --check-base32768 Check can store all possible base32768 characters + --check-control Check control characters + --check-length Check max filename length + --check-normalization Check UTF-8 Normalization + --check-streaming Check uploads with indeterminate file size + -h, --help help for info + --upload-wait Duration Wait after writing a file (default 0s) + --write-json string Write results to file +``` - [megaremote] - type = mega - user = you@example.com - pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH -Note that passwords are in [obscured](https://rclone.org/commands/rclone_obscure/) -form. Also, many storage systems uses token-based authentication instead -of passwords, and this requires additional steps. It is easier, and safer, -to use the interactive command `rclone config` instead of manually -editing the configuration file. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -The configuration file will typically contain login information, and -should therefore have restricted permissions so that only the current user -can read it. Rclone tries to ensure this when it writes the file. -You may also choose to [encrypt](#configuration-encryption) the file. +# SEE ALSO -When token-based authentication are used, the configuration file -must be writable, because rclone needs to update the tokens inside it. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -### --contimeout=TIME ### +# rclone test makefile -Set the connection timeout. This should be in go time format which -looks like `5s` for 5 seconds, `10m` for 10 minutes, or `3h30m`. +Make files with random contents of the size given -The connection timeout is the amount of time rclone will wait for a -connection to go through to a remote object storage system. It is -`1m` by default. +``` +rclone test makefile []+ [flags] +``` -### --copy-dest=DIR ### +## Options -When using `sync`, `copy` or `move` DIR is checked in addition to the -destination for files. If a file identical to the source is found that -file is server-side copied from DIR to the destination. This is useful -for incremental backup. +``` + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + -h, --help help for makefile + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 +``` -The remote in use must support server-side copy and you must -use the same remote as the destination of the sync. The compare -directory must not overlap the destination directory. -See `--compare-dest` and `--backup-dir`. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -### --dedupe-mode MODE ### +# SEE ALSO -Mode to run dedupe command in. One of `interactive`, `skip`, `first`, -`newest`, `oldest`, `rename`. The default is `interactive`. -See the dedupe command for more information as to what these options mean. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -### --disable FEATURE,FEATURE,... ### +# rclone test makefiles -This disables a comma separated list of optional features. For example -to disable server-side move and server-side copy use: +Make a random file hierarchy in a directory - --disable move,copy +``` +rclone test makefiles [flags] +``` -The features can be put in any case. +## Options -To see a list of which features can be disabled use: +``` + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + --files int Number of files to create (default 1000) + --files-per-directory int Average number of files per directory (default 10) + -h, --help help for makefiles + --max-depth int Maximum depth of directory hierarchy (default 10) + --max-file-size SizeSuffix Maximum size of files to create (default 100) + --max-name-length int Maximum size of file names (default 12) + --min-file-size SizeSuffix Minimum size of file to create + --min-name-length int Minimum size of file names (default 4) + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 +``` - --disable help -See the overview [features](https://rclone.org/overview/#features) and -[optional features](https://rclone.org/overview/#optional-features) to get an idea of -which feature does what. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -This flag can be useful for debugging and in exceptional circumstances -(e.g. Google Drive limiting the total volume of Server Side Copies to -100 GiB/day). +# SEE ALSO -### --disable-http2 +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -This stops rclone from trying to use HTTP/2 if available. This can -sometimes speed up transfers due to a -[problem in the Go standard library](https://github.com/golang/go/issues/37373). +# rclone test memory -### --dscp VALUE ### +Load all the objects at remote:path into memory and report memory stats. -Specify a DSCP value or name to use in connections. This could help QoS -system to identify traffic class. BE, EF, DF, LE, CSx and AFxx are allowed. +``` +rclone test memory remote:path [flags] +``` -See the description of [differentiated services](https://en.wikipedia.org/wiki/Differentiated_services) to get an idea of -this field. Setting this to 1 (LE) to identify the flow to SCAVENGER class -can avoid occupying too much bandwidth in a network with DiffServ support ([RFC 8622](https://tools.ietf.org/html/rfc8622)). +## Options -For example, if you configured QoS on router to handle LE properly. Running: ``` -rclone copy --dscp LE from:/from to:/to + -h, --help help for memory ``` -would make the priority lower than usual internet flows. -This option has no effect on Windows (see [golang/go#42728](https://github.com/golang/go/issues/42728)). -### -n, --dry-run ### +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -Do a trial run with no permanent changes. Use this to see what rclone -would do without actually doing it. Useful when setting up the `sync` -command which deletes files in the destination. +# SEE ALSO -### --expect-continue-timeout=TIME ### +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -This specifies the amount of time to wait for a server's first -response headers after fully writing the request headers if the -request has an "Expect: 100-continue" header. Not all backends support -using this. +# rclone touch -Zero means no timeout and causes the body to be sent immediately, -without waiting for the server to approve. This time does not include -the time to send the request header. +Create new file or change file modification time. -The default is `1s`. Set to `0` to disable. +## Synopsis -### --error-on-no-transfer ### -By default, rclone will exit with return code 0 if there were no errors. +Set the modification time on file(s) as specified by remote:path to +have the current time. -This option allows rclone to return exit code 9 if no files were transferred -between the source and destination. This allows using rclone in scripts, and -triggering follow-on actions if data was copied, or skipping if not. +If remote:path does not exist then a zero sized file will be created, +unless `--no-create` or `--recursive` is provided. -NB: Enabling this option turns a usually non-fatal error into a potentially -fatal one - please check and adjust your scripts accordingly! +If `--recursive` is used then recursively sets the modification +time on all existing files that is found under the path. Filters are supported, +and you can test with the `--dry-run` or the `--interactive`/`-i` flag. -### --fs-cache-expire-duration=TIME +If `--timestamp` is used then sets the modification time to that +time instead of the current time. Times may be specified as one of: -When using rclone via the API rclone caches created remotes for 5 -minutes by default in the "fs cache". This means that if you do -repeated actions on the same remote then rclone won't have to build it -again from scratch, which makes it more efficient. +- 'YYMMDD' - e.g. 17.10.30 +- 'YYYY-MM-DDTHH:MM:SS' - e.g. 2006-01-02T15:04:05 +- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789 -This flag sets the time that the remotes are cached for. If you set it -to `0` (or negative) then rclone won't cache the remotes at all. +Note that value of `--timestamp` is in UTC. If you want local time +then add the `--localtime` flag. -Note that if you use some flags, eg `--backup-dir` and if this is set -to `0` rclone may build two remotes (one for the source or destination -and one for the `--backup-dir` where it may have only built one -before. -### --fs-cache-expire-interval=TIME +``` +rclone touch remote:path [flags] +``` -This controls how often rclone checks for cached remotes to expire. -See the `--fs-cache-expire-duration` documentation above for more -info. The default is 60s, set to 0 to disable expiry. +## Options -### --header ### +``` + -h, --help help for touch + --localtime Use localtime for timestamp, not UTC + -C, --no-create Do not create the file if it does not exist (implied with --recursive) + -R, --recursive Recursively touch all files + -t, --timestamp string Use specified time instead of the current time of day +``` -Add an HTTP header for all transactions. The flag can be repeated to -add multiple headers. -If you want to add headers only for uploads use `--header-upload` and -if you want to add headers only for downloads use `--header-download`. +## Important Options -This flag is supported for all HTTP based backends even those not -supported by `--header-upload` and `--header-download` so may be used -as a workaround for those with care. +Important flags useful for most commands. ``` -rclone ls remote:test --header "X-Rclone: Foo" --header "X-LetMeIn: Yes" + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) ``` -### --header-download ### +## Filter Options -Add an HTTP header for all download transactions. The flag can be repeated to -add multiple headers. +Flags for filtering directory listings. ``` -rclone sync --interactive s3:test/src ~/dst --header-download "X-Amz-Meta-Test: Foo" --header-download "X-Amz-Meta-Test2: Bar" + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) ``` -See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for -currently supported backends. - -### --header-upload ### +## Listing Options -Add an HTTP header for all upload transactions. The flag can be repeated to add -multiple headers. +Flags for listing directories. ``` -rclone sync --interactive ~/src s3:test/dst --header-upload "Content-Disposition: attachment; filename='cool.html'" --header-upload "X-Amz-Meta-Test: FooBar" + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions ``` -See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for -currently supported backends. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -### --human-readable ### +# SEE ALSO -Rclone commands output values for sizes (e.g. number of bytes) and -counts (e.g. number of files) either as *raw* numbers, or -in *human-readable* format. +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -In human-readable format the values are scaled to larger units, indicated with -a suffix shown after the value, and rounded to three decimals. Rclone consistently -uses binary units (powers of 2) for sizes and decimal units (powers of 10) for counts. -The unit prefix for size is according to IEC standard notation, e.g. `Ki` for kibi. -Used with byte unit, `1 KiB` means 1024 Byte. In list type of output, only the -unit prefix appended to the value (e.g. `9.762Ki`), while in more textual output -the full unit is shown (e.g. `9.762 KiB`). For counts the SI standard notation is -used, e.g. prefix `k` for kilo. Used with file counts, `1k` means 1000 files. +# rclone tree -The various [list](https://rclone.org/commands/rclone_ls/) commands output raw numbers by default. -Option `--human-readable` will make them output values in human-readable format -instead (with the short unit prefix). +List the contents of the remote in a tree like fashion. -The [about](https://rclone.org/commands/rclone_about/) command outputs human-readable by default, -with a command-specific option `--full` to output the raw numbers instead. +## Synopsis -Command [size](https://rclone.org/commands/rclone_size/) outputs both human-readable and raw numbers -in the same output. -The [tree](https://rclone.org/commands/rclone_tree/) command also considers `--human-readable`, but -it will not use the exact same notation as the other commands: It rounds to one -decimal, and uses single letter suffix, e.g. `K` instead of `Ki`. The reason for -this is that it relies on an external library. +rclone tree lists the contents of a remote in a similar way to the +unix tree command. -The interactive command [ncdu](https://rclone.org/commands/rclone_ncdu/) shows human-readable by -default, and responds to key `u` for toggling human-readable format. +For example -### --ignore-case-sync ### + $ rclone tree remote:path + / + ├── file1 + ├── file2 + ├── file3 + └── subdir + ├── file4 + └── file5 -Using this option will cause rclone to ignore the case of the files -when synchronizing so files will not be copied/synced when the -existing filenames are the same, even if the casing is different. + 1 directories, 5 files -### --ignore-checksum ### +You can use any of the filtering options with the tree command (e.g. +`--include` and `--exclude`. You can also use `--fast-list`. -Normally rclone will check that the checksums of transferred files -match, and give an error "corrupted on transfer" if they don't. +The tree command has many options for controlling the listing which +are compatible with the tree command, for example you can include file +sizes with `--size`. Note that not all of them have +short options as they conflict with rclone's short options. -You can use this option to skip that check. You should only use it if -you have had the "corrupted on transfer" error message and you are -sure you might want to transfer potentially corrupted data. +For a more interactive navigation of the remote see the +[ncdu](https://rclone.org/commands/rclone_ncdu/) command. -### --ignore-existing ### -Using this option will make rclone unconditionally skip all files -that exist on the destination, no matter the content of these files. +``` +rclone tree remote:path [flags] +``` -While this isn't a generally recommended option, it can be useful -in cases where your files change due to encryption. However, it cannot -correct partial transfers in case a transfer was interrupted. +## Options -When performing a `move`/`moveto` command, this flag will leave skipped -files in the source location unchanged when a file with the same name -exists on the destination. +``` + -a, --all All files are listed (list . files too) + -d, --dirs-only List directories only + --dirsfirst List directories before files (-U disables) + --full-path Print the full path prefix for each file + -h, --help help for tree + --level int Descend only level directories deep + -D, --modtime Print the date of last modification. + --noindent Don't print indentation lines + --noreport Turn off file/directory count at end of tree listing + -o, --output string Output to file instead of stdout + -p, --protections Print the protections for each file. + -Q, --quote Quote filenames with double quotes. + -s, --size Print the size in bytes of each file. + --sort string Select sort: name,version,size,mtime,ctime + --sort-ctime Sort files by last status change time + -t, --sort-modtime Sort files by last modification time + -r, --sort-reverse Reverse the order of the sort + -U, --unsorted Leave files unsorted + --version Sort files alphanumerically by version +``` -### --ignore-size ### -Normally rclone will look at modification time and size of files to -see if they are equal. If you set this flag then rclone will check -only the modification time. If `--checksum` is set then it only -checks the checksum. +## Filter Options -It will also cause rclone to skip verifying the sizes are the same -after transfer. +Flags for filtering directory listings. -This can be useful for transferring files to and from OneDrive which -occasionally misreports the size of image files (see -[#399](https://github.com/rclone/rclone/issues/399) for more info). +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -### -I, --ignore-times ### +## Listing Options -Using this option will cause rclone to unconditionally upload all -files regardless of the state of files on the destination. +Flags for listing directories. -Normally rclone would skip any files that have the same -modification time and are the same size (or have the same checksum if -using `--checksum`). +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` -### --immutable ### +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -Treat source and destination files as immutable and disallow -modification. +# SEE ALSO -With this option set, files will be created and deleted as requested, -but existing files will never be updated. If an existing file does -not match between the source and destination, rclone will give the error -`Source and destination exist but do not match: immutable file modified`. +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -Note that only commands which transfer files (e.g. `sync`, `copy`, -`move`) are affected by this behavior, and only modification is -disallowed. Files may still be deleted explicitly (e.g. `delete`, -`purge`) or implicitly (e.g. `sync`, `move`). Use `copy --immutable` -if it is desired to avoid deletion as well as modification. -This can be useful as an additional layer of protection for immutable -or append-only data sets (notably backup archives), where modification -implies corruption and should not be propagated. +Copying single files +-------------------- -### -i, --interactive {#interactive} +rclone normally syncs or copies directories. However, if the source +remote points to a file, rclone will just copy that file. The +destination remote must point to a directory - rclone will give the +error `Failed to create file system for "remote:file": is a file not a +directory` if it isn't. -This flag can be used to tell rclone that you wish a manual -confirmation before destructive operations. +For example, suppose you have a remote with a file in called +`test.jpg`, then you could copy just that file like this -It is **recommended** that you use this flag while learning rclone -especially with `rclone sync`. + rclone copy remote:test.jpg /tmp/download -For example +The file `test.jpg` will be placed inside `/tmp/download`. -``` -$ rclone delete --interactive /tmp/dir -rclone: delete "important-file.txt"? -y) Yes, this is OK (default) -n) No, skip this -s) Skip all delete operations with no more questions -!) Do all delete operations with no more questions -q) Exit rclone now. -y/n/s/!/q> n -``` +This is equivalent to specifying -The options mean + rclone copy --files-from /tmp/files remote: /tmp/download -- `y`: **Yes**, this operation should go ahead. You can also press Return - for this to happen. You'll be asked every time unless you choose `s` - or `!`. -- `n`: **No**, do not do this operation. You'll be asked every time unless - you choose `s` or `!`. -- `s`: **Skip** all the following operations of this type with no more - questions. This takes effect until rclone exits. If there are any - different kind of operations you'll be prompted for them. -- `!`: **Do all** the following operations with no more - questions. Useful if you've decided that you don't mind rclone doing - that kind of operation. This takes effect until rclone exits . If - there are any different kind of operations you'll be prompted for - them. -- `q`: **Quit** rclone now, just in case! +Where `/tmp/files` contains the single line -### --leave-root #### + test.jpg -During rmdirs it will not remove root directory, even if it's empty. +It is recommended to use `copy` when copying individual files, not `sync`. +They have pretty much the same effect but `copy` will use a lot less +memory. -### --log-file=FILE ### +Syntax of remote paths +---------------------- -Log all of rclone's output to FILE. This is not active by default. -This can be useful for tracking down problems with syncs in -combination with the `-v` flag. See the [Logging section](#logging) -for more info. +The syntax of the paths passed to the rclone command are as follows. -If FILE exists then rclone will append to it. +### /path/to/dir -Note that if you are using the `logrotate` program to manage rclone's -logs, then you should use the `copytruncate` option as rclone doesn't -have a signal to rotate logs. +This refers to the local file system. -### --log-format LIST ### +On Windows `\` may be used instead of `/` in local paths **only**, +non local paths must use `/`. See [local filesystem](https://rclone.org/local/#paths-on-windows) +documentation for more about Windows-specific paths. -Comma separated list of log format options. Accepted options are `date`, -`time`, `microseconds`, `pid`, `longfile`, `shortfile`, `UTC`. Any other -keywords will be silently ignored. `pid` will tag log messages with process -identifier which useful with `rclone mount --daemon`. Other accepted -options are explained in the [go documentation](https://pkg.go.dev/log#pkg-constants). -The default log format is "`date`,`time`". +These paths needn't start with a leading `/` - if they don't then they +will be relative to the current directory. -### --log-level LEVEL ### +### remote:path/to/dir -This sets the log level for rclone. The default log level is `NOTICE`. +This refers to a directory `path/to/dir` on `remote:` as defined in +the config file (configured with `rclone config`). -`DEBUG` is equivalent to `-vv`. It outputs lots of debug info - useful -for bug reports and really finding out what rclone is doing. +### remote:/path/to/dir -`INFO` is equivalent to `-v`. It outputs information about each transfer -and prints stats once a minute by default. +On most backends this is refers to the same directory as +`remote:path/to/dir` and that format should be preferred. On a very +small number of remotes (FTP, SFTP, Dropbox for business) this will +refer to a different directory. On these, paths without a leading `/` +will refer to your "home" directory and paths with a leading `/` will +refer to the root. -`NOTICE` is the default log level if no logging flags are supplied. It -outputs very little when things are working normally. It outputs -warnings and significant events. +### :backend:path/to/dir -`ERROR` is equivalent to `-q`. It only outputs error messages. +This is an advanced form for creating remotes on the fly. `backend` +should be the name or prefix of a backend (the `type` in the config +file) and all the configuration for the backend should be provided on +the command line (or in environment variables). -### --use-json-log ### +Here are some examples: -This switches the log format to JSON for rclone. The fields of json log -are level, msg, source, time. + rclone lsd --http-url https://pub.rclone.org :http: -### --low-level-retries NUMBER ### +To list all the directories in the root of `https://pub.rclone.org/`. -This controls the number of low level retries rclone does. + rclone lsf --http-url https://example.com :http:path/to/dir -A low level retry is used to retry a failing operation - typically one -HTTP request. This might be uploading a chunk of a big file for -example. You will see low level retries in the log with the `-v` -flag. +To list files and directories in `https://example.com/path/to/dir/` -This shouldn't need to be changed from the default in normal operations. -However, if you get a lot of low level retries you may wish -to reduce the value so rclone moves on to a high level retry (see the -`--retries` flag) quicker. + rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir -Disable low level retries with `--low-level-retries 1`. +To copy files and directories in `https://example.com/path/to/dir` to `/tmp/dir`. -### --max-backlog=N ### + rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir -This is the maximum allowable backlog of files in a sync/copy/move -queued for being checked or transferred. +To copy files and directories from `example.com` in the relative +directory `path/to/dir` to `/tmp/dir` using sftp. -This can be set arbitrarily large. It will only use memory when the -queue is in use. Note that it will use in the order of N KiB of memory -when the backlog is in use. +### Connection strings {#connection-strings} -Setting this large allows rclone to calculate how many files are -pending more accurately, give a more accurate estimated finish -time and make `--order-by` work more accurately. +The above examples can also be written using a connection string +syntax, so instead of providing the arguments as command line +parameters `--http-url https://pub.rclone.org` they are provided as +part of the remote specification as a kind of connection string. -Setting this small will make rclone more synchronous to the listings -of the remote which may be desirable. + rclone lsd ":http,url='https://pub.rclone.org':" + rclone lsf ":http,url='https://example.com':path/to/dir" + rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir + rclone copy :sftp,host=example.com:path/to/dir /tmp/dir -Setting this to a negative number will make the backlog as large as -possible. +These can apply to modify existing remotes as well as create new +remotes with the on the fly syntax. This example is equivalent to +adding the `--drive-shared-with-me` parameter to the remote `gdrive:`. -### --max-delete=N ### + rclone lsf "gdrive,shared_with_me:path/to/dir" -This tells rclone not to delete more than N files. If that limit is -exceeded then a fatal error will be generated and rclone will stop the -operation in progress. +The major advantage to using the connection string style syntax is +that it only applies to the remote, not to all the remotes of that +type of the command line. A common confusion is this attempt to copy a +file shared on google drive to the normal drive which **does not +work** because the `--drive-shared-with-me` flag applies to both the +source and the destination. -### --max-delete-size=SIZE ### + rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: -Rclone will stop deleting files when the total size of deletions has -reached the size specified. It defaults to off. +However using the connection string syntax, this does work. -If that limit is exceeded then a fatal error will be generated and -rclone will stop the operation in progress. + rclone copy "gdrive,shared_with_me:shared-file.txt" gdrive: -### --max-depth=N ### +Note that the connection string only affects the options of the immediate +backend. If for example gdriveCrypt is a crypt based on gdrive, then the +following command **will not work** as intended, because +`shared_with_me` is ignored by the crypt backend: -This modifies the recursion depth for all the commands except purge. + rclone copy "gdriveCrypt,shared_with_me:shared-file.txt" gdriveCrypt: -So if you do `rclone --max-depth 1 ls remote:path` you will see only -the files in the top level directory. Using `--max-depth 2` means you -will see all the files in first two directory levels and so on. +The connection strings have the following syntax -For historical reasons the `lsd` command defaults to using a -`--max-depth` of 1 - you can override this with the command line flag. + remote,parameter=value,parameter2=value2:path/to/dir + :backend,parameter=value,parameter2=value2:path/to/dir -You can use this command to disable recursion (with `--max-depth 1`). +If the `parameter` has a `:` or `,` then it must be placed in quotes `"` or +`'`, so -Note that if you use this with `sync` and `--delete-excluded` the -files not recursed through are considered excluded and will be deleted -on the destination. Test first with `--dry-run` if you are not sure -what will happen. + remote,parameter="colon:value",parameter2="comma,value":path/to/dir + :backend,parameter='colon:value',parameter2='comma,value':path/to/dir -### --max-duration=TIME ### +If a quoted value needs to include that quote, then it should be +doubled, so -Rclone will stop scheduling new transfers when it has run for the -duration specified. + remote,parameter="with""quote",parameter2='with''quote':path/to/dir -Defaults to off. +This will make `parameter` be `with"quote` and `parameter2` be +`with'quote`. -When the limit is reached any existing transfers will complete. +If you leave off the `=parameter` then rclone will substitute `=true` +which works very well with flags. For example, to use s3 configured in +the environment you could use: -Rclone won't exit with an error if the transfer limit is reached. + rclone lsd :s3,env_auth: -### --max-transfer=SIZE ### +Which is equivalent to -Rclone will stop transferring when it has reached the size specified. -Defaults to off. + rclone lsd :s3,env_auth=true: -When the limit is reached all transfers will stop immediately. +Note that on the command line you might need to surround these +connection strings with `"` or `'` to stop the shell interpreting any +special characters within them. -Rclone will exit with exit code 8 if the transfer limit is reached. +If you are a shell master then you'll know which strings are OK and +which aren't, but if you aren't sure then enclose them in `"` and use +`'` as the inside quote. This syntax works on all OSes. -## -M, --metadata + rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir -Setting this flag enables rclone to copy the metadata from the source -to the destination. For local backends this is ownership, permissions, -xattr etc. See the [#metadata](metadata section) for more info. +On Linux/macOS some characters are still interpreted inside `"` +strings in the shell (notably `\` and `$` and `"`) so if your strings +contain those you can swap the roles of `"` and `'` thus. (This syntax +does not work on Windows.) -### --metadata-set key=value + rclone copy ':http,url="https://example.com":path/to/dir' /tmp/dir -Add metadata `key` = `value` when uploading. This can be repeated as -many times as required. See the [#metadata](metadata section) for more -info. +#### Connection strings, config and logging -### --cutoff-mode=hard|soft|cautious ### +If you supply extra configuration to a backend by command line flag, +environment variable or connection string then rclone will add a +suffix based on the hash of the config to the name of the remote, eg -This modifies the behavior of `--max-transfer` -Defaults to `--cutoff-mode=hard`. + rclone -vv lsf --s3-chunk-size 20M s3: -Specifying `--cutoff-mode=hard` will stop transferring immediately -when Rclone reaches the limit. +Has the log message -Specifying `--cutoff-mode=soft` will stop starting new transfers -when Rclone reaches the limit. + DEBUG : s3: detected overridden config - adding "{Srj1p}" suffix to name -Specifying `--cutoff-mode=cautious` will try to prevent Rclone -from reaching the limit. +This is so rclone can tell the modified remote apart from the +unmodified remote when caching the backends. -### --modify-window=TIME ### +This should only be noticeable in the logs. -When checking whether a file has been modified, this is the maximum -allowed time difference that a file can have and still be considered -equivalent. +This means that on the fly backends such as -The default is `1ns` unless this is overridden by a remote. For -example OS X only stores modification times to the nearest second so -if you are reading and writing to an OS X filing system this will be -`1s` by default. + rclone -vv lsf :s3,env_auth: -This command line flag allows you to override that computed default. +Will get their own names -### --multi-thread-cutoff=SIZE ### + DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name -When downloading files to the local backend above this size, rclone -will use multiple threads to download the file (default 250M). +### Valid remote names -Rclone preallocates the file (using `fallocate(FALLOC_FL_KEEP_SIZE)` -on unix or `NTSetInformationFile` on Windows both of which takes no -time) then each thread writes directly into the file at the correct -place. This means that rclone won't create fragmented or sparse files -and there won't be any assembly time at the end of the transfer. +Remote names are case sensitive, and must adhere to the following rules: + - May contain number, letter, `_`, `-`, `.`, `+`, `@` and space. + - May not start with `-` or space. + - May not end with space. -The number of threads used to download is controlled by -`--multi-thread-streams`. +Starting with rclone version 1.61, any Unicode numbers and letters are allowed, +while in older versions it was limited to plain ASCII (0-9, A-Z, a-z). If you use +the same rclone configuration from different shells, which may be configured with +different character encoding, you must be cautious to use characters that are +possible to write in all of them. This is mostly a problem on Windows, where +the console traditionally uses a non-Unicode character set - defined +by the so-called "code page". -Use `-vv` if you wish to see info about the threads. +Do not use single character names on Windows as it creates ambiguity with Windows +drives' names, e.g.: remote called `C` is indistinguishable from `C` drive. Rclone +will always assume that single letter name refers to a drive. -This will work with the `sync`/`copy`/`move` commands and friends -`copyto`/`moveto`. Multi thread downloads will be used with `rclone -mount` and `rclone serve` if `--vfs-cache-mode` is set to `writes` or -above. +Quoting and the shell +--------------------- -**NB** that this **only** works for a local destination but will work -with any source. +When you are typing commands to your computer you are using something +called the command line shell. This interprets various characters in +an OS specific way. -**NB** that multi thread copies are disabled for local to local copies -as they are faster without unless `--multi-thread-streams` is set -explicitly. +Here are some gotchas which may help users unfamiliar with the shell rules -**NB** on Windows using multi-thread downloads will cause the -resulting files to be [sparse](https://en.wikipedia.org/wiki/Sparse_file). -Use `--local-no-sparse` to disable sparse files (which may cause long -delays at the start of downloads) or disable multi-thread downloads -with `--multi-thread-streams 0` +### Linux / OSX ### -### --multi-thread-streams=N ### +If your names have spaces or shell metacharacters (e.g. `*`, `?`, `$`, +`'`, `"`, etc.) then you must quote them. Use single quotes `'` by default. -When using multi thread downloads (see above `--multi-thread-cutoff`) -this sets the maximum number of streams to use. Set to `0` to disable -multi thread downloads (Default 4). + rclone copy 'Important files?' remote:backup -Exactly how many streams rclone uses for the download depends on the -size of the file. To calculate the number of download streams Rclone -divides the size of the file by the `--multi-thread-cutoff` and rounds -up, up to the maximum set with `--multi-thread-streams`. +If you want to send a `'` you will need to use `"`, e.g. -So if `--multi-thread-cutoff 250M` and `--multi-thread-streams 4` are -in effect (the defaults): + rclone copy "O'Reilly Reviews" remote:backup -- 0..250 MiB files will be downloaded with 1 stream -- 250..500 MiB files will be downloaded with 2 streams -- 500..750 MiB files will be downloaded with 3 streams -- 750+ MiB files will be downloaded with 4 streams +The rules for quoting metacharacters are complicated and if you want +the full details you'll have to consult the manual page for your +shell. -### --no-check-dest ### +### Windows ### -The `--no-check-dest` can be used with `move` or `copy` and it causes -rclone not to check the destination at all when copying files. +If your names have spaces in you need to put them in `"`, e.g. -This means that: + rclone copy "E:\folder name\folder name\folder name" remote:backup -- the destination is not listed minimising the API calls -- files are always transferred -- this can cause duplicates on remotes which allow it (e.g. Google Drive) -- `--retries 1` is recommended otherwise you'll transfer everything again on a retry +If you are using the root directory on its own then don't quote it +(see [#464](https://github.com/rclone/rclone/issues/464) for why), e.g. -This flag is useful to minimise the transactions if you know that none -of the files are on the destination. + rclone copy E:\ remote:backup -This is a specialized flag which should be ignored by most users! +Copying files or directories with `:` in the names +-------------------------------------------------- -### --no-gzip-encoding ### +rclone uses `:` to mark a remote name. This is, however, a valid +filename component in non-Windows OSes. The remote name parser will +only search for a `:` up to the first `/` so if you need to act on a +file or directory like this then use the full path starting with a +`/`, or use `./` as a current directory prefix. -Don't set `Accept-Encoding: gzip`. This means that rclone won't ask -the server for compressed files automatically. Useful if you've set -the server to return files with `Content-Encoding: gzip` but you -uploaded compressed files. +So to sync a directory called `sync:me` to a remote called `remote:` use -There is no need to set this in normal operation, and doing so will -decrease the network transfer efficiency of rclone. + rclone sync --interactive ./sync:me remote:path -### --no-traverse ### +or -The `--no-traverse` flag controls whether the destination file system -is traversed when using the `copy` or `move` commands. -`--no-traverse` is not compatible with `sync` and will be ignored if -you supply it with `sync`. + rclone sync --interactive /full/path/to/sync:me remote:path -If you are only copying a small number of files (or are filtering most -of the files) and/or have a large number of files on the destination -then `--no-traverse` will stop rclone listing the destination and save -time. +Server Side Copy +---------------- -However, if you are copying a large number of files, especially if you -are doing a copy where lots of the files under consideration haven't -changed and won't need copying then you shouldn't use `--no-traverse`. +Most remotes (but not all - see [the +overview](https://rclone.org/overview/#optional-features)) support server-side copy. -See [rclone copy](https://rclone.org/commands/rclone_copy/) for an example of how to use it. +This means if you want to copy one folder to another then rclone won't +download all the files and re-upload them; it will instruct the server +to copy them in place. -### --no-unicode-normalization ### +Eg -Don't normalize unicode characters in filenames during the sync routine. + rclone copy s3:oldbucket s3:newbucket -Sometimes, an operating system will store filenames containing unicode -parts in their decomposed form (particularly macOS). Some cloud storage -systems will then recompose the unicode, resulting in duplicate files if -the data is ever copied back to a local filesystem. +Will copy the contents of `oldbucket` to `newbucket` without +downloading and re-uploading. -Using this flag will disable that functionality, treating each unicode -character as unique. For example, by default é and é will be normalized -into the same character. With `--no-unicode-normalization` they will be -treated as unique characters. +Remotes which don't support server-side copy **will** download and +re-upload in this case. -### --no-update-modtime ### +Server side copies are used with `sync` and `copy` and will be +identified in the log when using the `-v` flag. The `move` command +may also use them if remote doesn't support server-side move directly. +This is done by issuing a server-side copy then a delete which is much +quicker than a download and re-upload. -When using this flag, rclone won't update modification times of remote -files if they are incorrect as it would normally. +Server side copies will only be attempted if the remote names are the +same. -This can be used if the remote is being synced with another tool also -(e.g. the Google Drive client). +This can be used when scripting to make aged backups efficiently, e.g. -### --order-by string ### + rclone sync --interactive remote:current-backup remote:previous-backup + rclone sync --interactive /path/to/files remote:current-backup -The `--order-by` flag controls the order in which files in the backlog -are processed in `rclone sync`, `rclone copy` and `rclone move`. +## Metadata support {#metadata} -The order by string is constructed like this. The first part -describes what aspect is being measured: +Metadata is data about a file which isn't the contents of the file. +Normally rclone only preserves the modification time and the content +(MIME) type where possible. -- `size` - order by the size of the files -- `name` - order by the full path of the files -- `modtime` - order by the modification date of the files +Rclone supports preserving all the available metadata on files (not +directories) when using the `--metadata` or `-M` flag. -This can have a modifier appended with a comma: +Exactly what metadata is supported and what that support means depends +on the backend. Backends that support metadata have a metadata section +in their docs and are listed in the [features table](https://rclone.org/overview/#features) +(Eg [local](https://rclone.org/local/#metadata), [s3](/s3/#metadata)) -- `ascending` or `asc` - order so that the smallest (or oldest) is processed first -- `descending` or `desc` - order so that the largest (or newest) is processed first -- `mixed` - order so that the smallest is processed first for some threads and the largest for others +Rclone only supports a one-time sync of metadata. This means that +metadata will be synced from the source object to the destination +object only when the source object has changed and needs to be +re-uploaded. If the metadata subsequently changes on the source object +without changing the object itself then it won't be synced to the +destination object. This is in line with the way rclone syncs +`Content-Type` without the `--metadata` flag. -If the modifier is `mixed` then it can have an optional percentage -(which defaults to `50`), e.g. `size,mixed,25` which means that 25% of -the threads should be taking the smallest items and 75% the -largest. The threads which take the smallest first will always take -the smallest first and likewise the largest first threads. The `mixed` -mode can be useful to minimise the transfer time when you are -transferring a mixture of large and small files - the large files are -guaranteed upload threads and bandwidth and the small files will be -processed continuously. +Using `--metadata` when syncing from local to local will preserve file +attributes such as file mode, owner, extended attributes (not +Windows). -If no modifier is supplied then the order is `ascending`. +Note that arbitrary metadata may be added to objects using the +`--metadata-set key=value` flag when the object is first uploaded. +This flag can be repeated as many times as necessary. -For example +The [--metadata-mapper](#metadata-mapper) flag can be used to pass the +name of a program in which can transform metadata when it is being +copied from source to destination. -- `--order-by size,desc` - send the largest files first -- `--order-by modtime,ascending` - send the oldest files first -- `--order-by name` - send the files with alphabetically by path first +### Types of metadata -If the `--order-by` flag is not supplied or it is supplied with an -empty string then the default ordering will be used which is as -scanned. With `--checkers 1` this is mostly alphabetical, however -with the default `--checkers 8` it is somewhat random. +Metadata is divided into two type. System metadata and User metadata. -#### Limitations +Metadata which the backend uses itself is called system metadata. For +example on the local backend the system metadata `uid` will store the +user ID of the file when used on a unix based platform. -The `--order-by` flag does not do a separate pass over the data. This -means that it may transfer some files out of the order specified if +Arbitrary metadata is called user metadata and this can be set however +is desired. -- there are no files in the backlog or the source has not been fully scanned yet -- there are more than [--max-backlog](#max-backlog-n) files in the backlog +When objects are copied from backend to backend, they will attempt to +interpret system metadata if it is supplied. Metadata may change from +being user metadata to system metadata as objects are copied between +different backends. For example copying an object from s3 sets the +`content-type` metadata. In a backend which understands this (like +`azureblob`) this will become the Content-Type of the object. In a +backend which doesn't understand this (like the `local` backend) this +will become user metadata. However should the local object be copied +back to s3, the Content-Type will be set correctly. -Rclone will do its best to transfer the best file it has so in -practice this should not cause a problem. Think of `--order-by` as -being more of a best efforts flag rather than a perfect ordering. +### Metadata framework -If you want perfect ordering then you will need to specify -[--check-first](#check-first) which will find all the files which need -transferring first before transferring any. +Rclone implements a metadata framework which can read metadata from an +object and write it to the object when (and only when) it is being +uploaded. -### --password-command SpaceSepList ### +This metadata is stored as a dictionary with string keys and string +values. -This flag supplies a program which should supply the config password -when run. This is an alternative to rclone prompting for the password -or setting the `RCLONE_CONFIG_PASS` variable. +There are some limits on the names of the keys (these may be clarified +further in the future). -The argument to this should be a command with a space separated list -of arguments. If one of the arguments has a space in then enclose it -in `"`, if you want a literal `"` in an argument then enclose the -argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) -for more info. +- must be lower case +- may be `a-z` `0-9` containing `.` `-` or `_` +- length is backend dependent -Eg +Each backend can provide system metadata that it understands. Some +backends can also store arbitrary user metadata. - --password-command echo hello - --password-command echo "hello with space" - --password-command echo "hello with ""quotes"" and space" +Where possible the key names are standardized, so, for example, it is +possible to copy object metadata from s3 to azureblob for example and +metadata will be translated appropriately. -See the [Configuration Encryption](#configuration-encryption) for more info. +Some backends have limits on the size of the metadata and rclone will +give errors on upload if they are exceeded. -See a [Windows PowerShell example on the Wiki](https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password). +### Metadata preservation -### -P, --progress ### +The goal of the implementation is to -This flag makes rclone update the stats in a static block in the -terminal providing a realtime overview of the transfer. +1. Preserve metadata if at all possible +2. Interpret metadata if at all possible -Any log messages will scroll above the static block. Log messages -will push the static block down to the bottom of the terminal where it -will stay. +The consequences of 1 is that you can copy an S3 object to a local +disk then back to S3 losslessly. Likewise you can copy a local file +with file attributes and xattrs from local disk to s3 and back again +losslessly. -Normally this is updated every 500mS but this period can be overridden -with the `--stats` flag. +The consequence of 2 is that you can copy an S3 object with metadata +to Azureblob (say) and have the metadata appear on the Azureblob +object also. -This can be used with the `--stats-one-line` flag for a simpler -display. +### Standard system metadata -Note: On Windows until [this bug](https://github.com/Azure/go-ansiterm/issues/26) -is fixed all non-ASCII characters will be replaced with `.` when -`--progress` is in use. +Here is a table of standard system metadata which, if appropriate, a +backend may implement. -### --progress-terminal-title ### +| key | description | example | +|---------------------|-------------|---------| +| mode | File type and mode: octal, unix style | 0100664 | +| uid | User ID of owner: decimal number | 500 | +| gid | Group ID of owner: decimal number | 500 | +| rdev | Device ID (if special file) => hexadecimal | 0 | +| atime | Time of last access: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| mtime | Time of last modification: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| btime | Time of file creation (birth): RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| utime | Time of file upload: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| cache-control | Cache-Control header | no-cache | +| content-disposition | Content-Disposition header | inline | +| content-encoding | Content-Encoding header | gzip | +| content-language | Content-Language header | en-US | +| content-type | Content-Type header | text/plain | -This flag, when used with `-P/--progress`, will print the string `ETA: %s` -to the terminal title. +The metadata keys `mtime` and `content-type` will take precedence if +supplied in the metadata over reading the `Content-Type` or +modification time of the source object. -### -q, --quiet ### +Hashes are not included in system metadata as there is a well defined +way of reading those already. -This flag will limit rclone's output to error messages only. +Options +------- -### --refresh-times ### +Rclone has a number of options to control its behaviour. -The `--refresh-times` flag can be used to update modification times of -existing files when they are out of sync on backends which don't -support hashes. +Options that take parameters can have the values passed in two ways, +`--option=value` or `--option value`. However boolean (true/false) +options behave slightly differently to the other options in that +`--boolean` sets the option to `true` and the absence of the flag sets +it to `false`. It is also possible to specify `--boolean=false` or +`--boolean=true`. Note that `--boolean false` is not valid - this is +parsed as `--boolean` and the `false` is parsed as an extra command +line argument for rclone. -This is useful if you uploaded files with the incorrect timestamps and -you now wish to correct them. +### Time or duration options {#time-option} -This flag is **only** useful for destinations which don't support -hashes (e.g. `crypt`). +TIME or DURATION options can be specified as a duration string or a +time string. -This can be used any of the sync commands `sync`, `copy` or `move`. +A duration string is a possibly signed sequence of decimal numbers, +each with optional fraction and a unit suffix, such as "300ms", +"-1.5h" or "2h45m". Default units are seconds or the following +abbreviations are valid: -To use this flag you will need to be doing a modification time sync -(so not using `--size-only` or `--checksum`). The flag will have no -effect when using `--size-only` or `--checksum`. + * `ms` - Milliseconds + * `s` - Seconds + * `m` - Minutes + * `h` - Hours + * `d` - Days + * `w` - Weeks + * `M` - Months + * `y` - Years -If this flag is used when rclone comes to upload a file it will check -to see if there is an existing file on the destination. If this file -matches the source with size (and checksum if available) but has a -differing timestamp then instead of re-uploading it, rclone will -update the timestamp on the destination file. If the checksum does not -match rclone will upload the new file. If the checksum is absent (e.g. -on a `crypt` backend) then rclone will update the timestamp. - -Note that some remotes can't set the modification time without -re-uploading the file so this flag is less useful on them. - -Normally if you are doing a modification time sync rclone will update -modification times without `--refresh-times` provided that the remote -supports checksums **and** the checksums match on the file. However if the -checksums are absent then rclone will upload the file rather than -setting the timestamp as this is the safe behaviour. +These can also be specified as an absolute time in the following +formats: -### --retries int ### +- RFC3339 - e.g. `2006-01-02T15:04:05Z` or `2006-01-02T15:04:05+07:00` +- ISO8601 Date and time, local timezone - `2006-01-02T15:04:05` +- ISO8601 Date and time, local timezone - `2006-01-02 15:04:05` +- ISO8601 Date - `2006-01-02` (YYYY-MM-DD) -Retry the entire sync if it fails this many times it fails (default 3). +### Size options {#size-option} -Some remotes can be unreliable and a few retries help pick up the -files which didn't get transferred because of errors. +Options which use SIZE use KiB (multiples of 1024 bytes) by default. +However, a suffix of `B` for Byte, `K` for KiB, `M` for MiB, +`G` for GiB, `T` for TiB and `P` for PiB may be used. These are +the binary units, e.g. 1, 2\*\*10, 2\*\*20, 2\*\*30 respectively. -Disable retries with `--retries 1`. +### --backup-dir=DIR ### -### --retries-sleep=TIME ### +When using `sync`, `copy` or `move` any files which would have been +overwritten or deleted are moved in their original hierarchy into this +directory. -This sets the interval between each retry specified by `--retries` +If `--suffix` is set, then the moved files will have the suffix added +to them. If there is a file with the same path (after the suffix has +been added) in DIR, then it will be overwritten. -The default is `0`. Use `0` to disable. +The remote in use must support server-side move or copy and you must +use the same remote as the destination of the sync. The backup +directory must not overlap the destination directory without it being +excluded by a filter rule. -### --server-side-across-configs ### +For example -Allow server-side operations (e.g. copy or move) to work across -different configurations. + rclone sync --interactive /path/to/local remote:current --backup-dir remote:old -This can be useful if you wish to do a server-side copy or move -between two remotes which use the same backend but are configured -differently. +will sync `/path/to/local` to `remote:current`, but for any files +which would have been updated or deleted will be stored in +`remote:old`. -Note that this isn't enabled by default because it isn't easy for -rclone to tell if it will work between any two configurations. +If running rclone from a script you might want to use today's date as +the directory name passed to `--backup-dir` to store the old files, or +you might want to pass `--suffix` with today's date. -### --size-only ### +See `--compare-dest` and `--copy-dest`. -Normally rclone will look at modification time and size of files to -see if they are equal. If you set this flag then rclone will check -only the size. +### --bind string ### -This can be useful transferring files from Dropbox which have been -modified by the desktop sync client which doesn't set checksums of -modification times in the same way as rclone. +Local address to bind to for outgoing connections. This can be an +IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If +the host name doesn't resolve or resolves to more than one IP address +it will give an error. -### --stats=TIME ### +You can use `--bind 0.0.0.0` to force rclone to use IPv4 addresses and +`--bind ::0` to force rclone to use IPv6 addresses. -Commands which transfer data (`sync`, `copy`, `copyto`, `move`, -`moveto`) will print data transfer stats at regular intervals to show -their progress. +### --bwlimit=BANDWIDTH_SPEC ### -This sets the interval. +This option controls the bandwidth limit. For example -The default is `1m`. Use `0` to disable. + --bwlimit 10M -If you set the stats interval then all commands can show stats. This -can be useful when running other commands, `check` or `mount` for -example. +would mean limit the upload and download bandwidth to 10 MiB/s. +**NB** this is **bytes** per second not **bits** per second. To use a +single limit, specify the desired bandwidth in KiB/s, or use a +suffix B|K|M|G|T|P. The default is `0` which means to not limit bandwidth. -Stats are logged at `INFO` level by default which means they won't -show at default log level `NOTICE`. Use `--stats-log-level NOTICE` or -`-v` to make them show. See the [Logging section](#logging) for more -info on log levels. +The upload and download bandwidth can be specified separately, as +`--bwlimit UP:DOWN`, so -Note that on macOS you can send a SIGINFO (which is normally ctrl-T in -the terminal) to make the stats print immediately. + --bwlimit 10M:100k -### --stats-file-name-length integer ### -By default, the `--stats` output will truncate file names and paths longer -than 40 characters. This is equivalent to providing -`--stats-file-name-length 40`. Use `--stats-file-name-length 0` to disable -any truncation of file names printed by stats. +would mean limit the upload bandwidth to 10 MiB/s and the download +bandwidth to 100 KiB/s. Either limit can be "off" meaning no limit, so +to just limit the upload bandwidth you would use -### --stats-log-level string ### + --bwlimit 10M:off -Log level to show `--stats` output at. This can be `DEBUG`, `INFO`, -`NOTICE`, or `ERROR`. The default is `INFO`. This means at the -default level of logging which is `NOTICE` the stats won't show - if -you want them to then use `--stats-log-level NOTICE`. See the [Logging -section](#logging) for more info on log levels. +this would limit the upload bandwidth to 10 MiB/s but the download +bandwidth would be unlimited. -### --stats-one-line ### +When specified as above the bandwidth limits last for the duration of +run of the rclone binary. -When this is specified, rclone condenses the stats into a single line -showing the most important stats only. +It is also possible to specify a "timetable" of limits, which will +cause certain limits to be applied at certain times. To specify a +timetable, format your entries as `WEEKDAY-HH:MM,BANDWIDTH +WEEKDAY-HH:MM,BANDWIDTH...` where: `WEEKDAY` is optional element. -### --stats-one-line-date ### +- `BANDWIDTH` can be a single number, e.g.`100k` or a pair of numbers +for upload:download, e.g.`10M:1M`. +- `WEEKDAY` can be written as the whole word or only using the first 3 + characters. It is optional. +- `HH:MM` is an hour from 00:00 to 23:59. -When this is specified, rclone enables the single-line stats and prepends -the display with a date string. The default is `2006/01/02 15:04:05 - ` +An example of a typical timetable to avoid link saturation during daytime +working hours could be: -### --stats-one-line-date-format ### +`--bwlimit "08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off"` -When this is specified, rclone enables the single-line stats and prepends -the display with a user-supplied date string. The date string MUST be -enclosed in quotes. Follow [golang specs](https://golang.org/pkg/time/#Time.Format) for -date formatting syntax. +In this example, the transfer bandwidth will be set to 512 KiB/s +at 8am every day. At noon, it will rise to 10 MiB/s, and drop back +to 512 KiB/sec at 1pm. At 6pm, the bandwidth limit will be set to +30 MiB/s, and at 11pm it will be completely disabled (full speed). +Anything between 11pm and 8am will remain unlimited. -### --stats-unit=bits|bytes ### +An example of timetable with `WEEKDAY` could be: -By default, data transfer rates will be printed in bytes per second. +`--bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off"` -This option allows the data rate to be printed in bits per second. +It means that, the transfer bandwidth will be set to 512 KiB/s on +Monday. It will rise to 10 MiB/s before the end of Friday. At 10:00 +on Saturday it will be set to 1 MiB/s. From 20:00 on Sunday it will +be unlimited. -Data transfer volume will still be reported in bytes. +Timeslots without `WEEKDAY` are extended to the whole week. So this +example: -The rate is reported as a binary unit, not SI unit. So 1 Mbit/s -equals 1,048,576 bit/s and not 1,000,000 bit/s. +`--bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off"` -The default is `bytes`. +Is equivalent to this: -### --suffix=SUFFIX ### +`--bwlimit "Mon-00:00,512Mon-12:00,1M Tue-12:00,1M Wed-12:00,1M Thu-12:00,1M Fri-12:00,1M Sat-12:00,1M Sun-12:00,1M Sun-20:00,off"` -When using `sync`, `copy` or `move` any files which would have been -overwritten or deleted will have the suffix added to them. If there -is a file with the same path (after the suffix has been added), then -it will be overwritten. +Bandwidth limit apply to the data transfer for all backends. For most +backends the directory listing bandwidth is also included (exceptions +being the non HTTP backends, `ftp`, `sftp` and `storj`). -The remote in use must support server-side move or copy and you must -use the same remote as the destination of the sync. +Note that the units are **Byte/s**, not **bit/s**. Typically +connections are measured in bit/s - to convert divide by 8. For +example, let's say you have a 10 Mbit/s connection and you wish rclone +to use half of it - 5 Mbit/s. This is 5/8 = 0.625 MiB/s so you would +use a `--bwlimit 0.625M` parameter for rclone. -This is for use with files to add the suffix in the current directory -or with `--backup-dir`. See `--backup-dir` for more info. +On Unix systems (Linux, macOS, …) the bandwidth limiter can be toggled by +sending a `SIGUSR2` signal to rclone. This allows to remove the limitations +of a long running rclone transfer and to restore it back to the value specified +with `--bwlimit` quickly when needed. Assuming there is only one rclone instance +running, you can toggle the limiter like this: -For example + kill -SIGUSR2 $(pidof rclone) - rclone copy --interactive /path/to/local/file remote:current --suffix .bak +If you configure rclone with a [remote control](/rc) then you can use +change the bwlimit dynamically: -will copy `/path/to/local` to `remote:current`, but for any files -which would have been updated or deleted have .bak added. + rclone rc core/bwlimit rate=1M -If using `rclone sync` with `--suffix` and without `--backup-dir` then -it is recommended to put a filter rule in excluding the suffix -otherwise the `sync` will delete the backup files. +### --bwlimit-file=BANDWIDTH_SPEC ### - rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude "*.bak" +This option controls per file bandwidth limit. For the options see the +`--bwlimit` flag. -### --suffix-keep-extension ### +For example use this to allow no transfers to be faster than 1 MiB/s -When using `--suffix`, setting this causes rclone put the SUFFIX -before the extension of the files that it backs up rather than after. + --bwlimit-file 1M -So let's say we had `--suffix -2019-01-01`, without the flag `file.txt` -would be backed up to `file.txt-2019-01-01` and with the flag it would -be backed up to `file-2019-01-01.txt`. This can be helpful to make -sure the suffixed files can still be opened. +This can be used in conjunction with `--bwlimit`. -### --syslog ### +Note that if a schedule is provided the file will use the schedule in +effect at the start of the transfer. -On capable OSes (not Windows or Plan9) send all log output to syslog. +### --buffer-size=SIZE ### -This can be useful for running rclone in a script or `rclone mount`. +Use this sized buffer to speed up file transfers. Each `--transfer` +will use this much memory for buffering. -### --syslog-facility string ### +When using `mount` or `cmount` each open file descriptor will use this much +memory for buffering. +See the [mount](https://rclone.org/commands/rclone_mount/#file-buffering) documentation for more details. -If using `--syslog` this sets the syslog facility (e.g. `KERN`, `USER`). -See `man syslog` for a list of possible facilities. The default -facility is `DAEMON`. +Set to `0` to disable the buffering for the minimum memory usage. -### --temp-dir=DIR ### +Note that the memory allocation of the buffers is influenced by the +[--use-mmap](#use-mmap) flag. -Specify the directory rclone will use for temporary files, to override -the default. Make sure the directory exists and have accessible permissions. +### --cache-dir=DIR ### -By default the operating system's temp directory will be used: -- On Unix systems, `$TMPDIR` if non-empty, else `/tmp`. -- On Windows, the first non-empty value from `%TMP%`, `%TEMP%`, `%USERPROFILE%`, or the Windows directory. +Specify the directory rclone will use for caching, to override +the default. -When overriding the default with this option, the specified path will be -set as value of environment variable `TMPDIR` on Unix systems -and `TMP` and `TEMP` on Windows. +Default value is depending on operating system: +- Windows `%LocalAppData%\rclone`, if `LocalAppData` is defined. +- macOS `$HOME/Library/Caches/rclone` if `HOME` is defined. +- Unix `$XDG_CACHE_HOME/rclone` if `XDG_CACHE_HOME` is defined, else `$HOME/.cache/rclone` if `HOME` is defined. +- Fallback (on all OS) to `$TMPDIR/rclone`, where `TMPDIR` is the value from [--temp-dir](#temp-dir-dir). You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) command to see the current value. -### --tpslimit float ### +Cache directory is heavily used by the [VFS File Caching](https://rclone.org/commands/rclone_mount/#vfs-file-caching) +mount feature, but also by [serve](https://rclone.org/commands/rclone_serve/), [GUI](/gui) and other parts of rclone. -Limit transactions per second to this number. Default is 0 which is -used to mean unlimited transactions per second. +### --check-first ### -A transaction is roughly defined as an API call; its exact meaning -will depend on the backend. For HTTP based backends it is an HTTP -PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip -transaction over TCP. +If this flag is set then in a `sync`, `copy` or `move`, rclone will do +all the checks to see whether files need to be transferred before +doing any of the transfers. Normally rclone would start running +transfers as soon as possible. -For example, to limit rclone to 10 transactions per second use -`--tpslimit 10`, or to 1 transaction every 2 seconds use `--tpslimit -0.5`. +This flag can be useful on IO limited systems where transfers +interfere with checking. -Use this when the number of transactions per second from rclone is -causing a problem with the cloud storage provider (e.g. getting you -banned or rate limited). +It can also be useful to ensure perfect ordering when using +`--order-by`. -This can be very useful for `rclone mount` to control the behaviour of -applications using it. +If both `--check-first` and `--order-by` are set when doing `rclone move` +then rclone will use the transfer thread to delete source files which +don't need transferring. This will enable perfect ordering of the +transfers and deletes but will cause the transfer stats to have more +items in than expected. -This limit applies to all HTTP based backends and to the FTP and SFTP -backends. It does not apply to the local backend or the Storj backend. +Using this flag can use more memory as it effectively sets +`--max-backlog` to infinite. This means that all the info on the +objects to transfer is held in memory before the transfers start. -See also `--tpslimit-burst`. +### --checkers=N ### -### --tpslimit-burst int ### +Originally controlling just the number of file checkers to run in parallel, +e.g. by `rclone copy`. Now a fairly universal parallelism control +used by `rclone` in several places. -Max burst of transactions for `--tpslimit` (default `1`). +Note: checkers do the equality checking of files during a sync. +For some storage systems (e.g. S3, Swift, Dropbox) this can take +a significant amount of time so they are run in parallel. -Normally `--tpslimit` will do exactly the number of transaction per -second specified. However if you supply `--tps-burst` then rclone can -save up some transactions from when it was idle giving a burst of up -to the parameter supplied. +The default is to run 8 checkers in parallel. However, in case +of slow-reacting backends you may need to lower (rather than increase) +this default by setting `--checkers` to 4 or less threads. This is +especially advised if you are experiencing backend server crashes +during file checking phase (e.g. on subsequent or top-up backups +where little or no file copying is done and checking takes up +most of the time). Increase this setting only with utmost care, +while monitoring your server health and file checking throughput. -For example if you provide `--tpslimit-burst 10` then if rclone has -been idle for more than 10*`--tpslimit` then it can do 10 transactions -very quickly before they are limited again. +### -c, --checksum ### -This may be used to increase performance of `--tpslimit` without -changing the long term average number of transactions per second. +Normally rclone will look at modification time and size of files to +see if they are equal. If you set this flag then rclone will check +the file hash and size to determine if files are equal. -### --track-renames ### +This is useful when the remote doesn't support setting modified time +and a more accurate sync is desired than just checking the file size. -By default, rclone doesn't keep track of renamed files, so if you -rename a file locally then sync it to a remote, rclone will delete the -old file on the remote and upload a new copy. +This is very useful when transferring between remotes which store the +same hash type on the object, e.g. Drive and Swift. For details of which +remotes support which hash type see the table in the [overview +section](https://rclone.org/overview/). -An rclone sync with `--track-renames` runs like a normal sync, but keeps -track of objects which exist in the destination but not in the source -(which would normally be deleted), and which objects exist in the -source but not the destination (which would normally be transferred). -These objects are then candidates for renaming. +Eg `rclone --checksum sync s3:/bucket swift:/bucket` would run much +quicker than without the `--checksum` flag. -After the sync, rclone matches up the source only and destination only -objects using the `--track-renames-strategy` specified and either -renames the destination object or transfers the source and deletes the -destination object. `--track-renames` is stateless like all of -rclone's syncs. +When using this flag, rclone won't update mtimes of remote files if +they are incorrect as it would normally. -To use this flag the destination must support server-side copy or -server-side move, and to use a hash based `--track-renames-strategy` -(the default) the source and the destination must have a compatible -hash. +### --color WHEN ### -If the destination does not support server-side copy or move, rclone -will fall back to the default behaviour and log an error level message -to the console. +Specify when colors (and other ANSI codes) should be added to the output. -Encrypted destinations are not currently supported by `--track-renames` -if `--track-renames-strategy` includes `hash`. +`AUTO` (default) only allows ANSI codes when the output is a terminal -Note that `--track-renames` is incompatible with `--no-traverse` and -that it uses extra memory to keep track of all the rename candidates. +`NEVER` never allow ANSI codes -Note also that `--track-renames` is incompatible with -`--delete-before` and will select `--delete-after` instead of -`--delete-during`. +`ALWAYS` always add ANSI codes, regardless of the output format (terminal or file) -### --track-renames-strategy (hash,modtime,leaf,size) ### +### --compare-dest=DIR ### -This option changes the file matching criteria for `--track-renames`. +When using `sync`, `copy` or `move` DIR is checked in addition to the +destination for files. If a file identical to the source is found that +file is NOT copied from source. This is useful to copy just files that +have changed since the last backup. -The matching is controlled by a comma separated selection of these tokens: +You must use the same remote as the destination of the sync. The +compare directory must not overlap the destination directory. -- `modtime` - the modification time of the file - not supported on all backends -- `hash` - the hash of the file contents - not supported on all backends -- `leaf` - the name of the file not including its directory name -- `size` - the size of the file (this is always enabled) +See `--copy-dest` and `--backup-dir`. -The default option is `hash`. +### --config=CONFIG_FILE ### -Using `--track-renames-strategy modtime,leaf` would match files -based on modification time, the leaf of the file name and the size -only. +Specify the location of the rclone configuration file, to override +the default. E.g. `rclone config --config="rclone.conf"`. -Using `--track-renames-strategy modtime` or `leaf` can enable -`--track-renames` support for encrypted destinations. +The exact default is a bit complex to describe, due to changes +introduced through different versions of rclone while preserving +backwards compatibility, but in most cases it is as simple as: -Note that the `hash` strategy is not supported with encrypted destinations. + - `%APPDATA%/rclone/rclone.conf` on Windows + - `~/.config/rclone/rclone.conf` on other -### --delete-(before,during,after) ### +The complete logic is as follows: Rclone will look for an existing +configuration file in any of the following locations, in priority order: -This option allows you to specify when files on your destination are -deleted when you sync folders. + 1. `rclone.conf` (in program directory, where rclone executable is) + 2. `%APPDATA%/rclone/rclone.conf` (only on Windows) + 3. `$XDG_CONFIG_HOME/rclone/rclone.conf` (on all systems, including Windows) + 4. `~/.config/rclone/rclone.conf` (see below for explanation of ~ symbol) + 5. `~/.rclone.conf` -Specifying the value `--delete-before` will delete all files present -on the destination, but not on the source *before* starting the -transfer of any new or updated files. This uses two passes through the -file systems, one for the deletions and one for the copies. +If no existing configuration file is found, then a new one will be created +in the following location: -Specifying `--delete-during` will delete files while checking and -uploading files. This is the fastest option and uses the least memory. +- On Windows: Location 2 listed above, except in the unlikely event + that `APPDATA` is not defined, then location 4 is used instead. +- On Unix: Location 3 if `XDG_CONFIG_HOME` is defined, else location 4. +- Fallback to location 5 (on all OS), when the rclone directory cannot be + created, but if also a home directory was not found then path + `.rclone.conf` relative to current working directory will be used as + a final resort. -Specifying `--delete-after` (the default value) will delay deletion of -files until all new/updated files have been successfully transferred. -The files to be deleted are collected in the copy pass then deleted -after the copy pass has completed successfully. The files to be -deleted are held in memory so this mode may use more memory. This is -the safest mode as it will only delete files if there have been no -errors subsequent to that. If there have been errors before the -deletions start then you will get the message `not deleting files as -there were IO errors`. +The `~` symbol in paths above represent the home directory of the current user +on any OS, and the value is defined as following: -### --fast-list ### + - On Windows: `%HOME%` if defined, else `%USERPROFILE%`, or else `%HOMEDRIVE%\%HOMEPATH%`. + - On Unix: `$HOME` if defined, else by looking up current user in OS-specific user database + (e.g. passwd file), or else use the result from shell command `cd && pwd`. -When doing anything which involves a directory listing (e.g. `sync`, -`copy`, `ls` - in fact nearly every command), rclone normally lists a -directory and processes it before using more directory lists to -process any subdirectories. This can be parallelised and works very -quickly using the least amount of memory. - -However, some remotes have a way of listing all files beneath a -directory in one (or a small number) of transactions. These tend to -be the bucket-based remotes (e.g. S3, B2, GCS, Swift). - -If you use the `--fast-list` flag then rclone will use this method for -listing directories. This will have the following consequences for -the listing: - - * It **will** use fewer transactions (important if you pay for them) - * It **will** use more memory. Rclone has to load the whole listing into memory. - * It *may* be faster because it uses fewer transactions - * It *may* be slower because it can't be parallelized - -rclone should always give identical results with and without -`--fast-list`. - -If you pay for transactions and can fit your entire sync listing into -memory then `--fast-list` is recommended. If you have a very big sync -to do then don't use `--fast-list` otherwise you will run out of -memory. +If you run `rclone config file` you will see where the default +location is for you. -If you use `--fast-list` on a remote which doesn't support it, then -rclone will just ignore it. +The fact that an existing file `rclone.conf` in the same directory +as the rclone executable is always preferred, means that it is easy +to run in "portable" mode by downloading rclone executable to a +writable directory and then create an empty file `rclone.conf` in the +same directory. -### --timeout=TIME ### +If the location is set to empty string `""` or path to a file +with name `notfound`, or the os null device represented by value `NUL` on +Windows and `/dev/null` on Unix systems, then rclone will keep the +config file in memory only. -This sets the IO idle timeout. If a transfer has started but then -becomes idle for this long it is considered broken and disconnected. +The file format is basic [INI](https://en.wikipedia.org/wiki/INI_file#Format): +Sections of text, led by a `[section]` header and followed by +`key=value` entries on separate lines. In rclone each remote is +represented by its own section, where the section name defines the +name of the remote. Options are specified as the `key=value` entries, +where the key is the option name without the `--backend-` prefix, +in lowercase and with `_` instead of `-`. E.g. option `--mega-hard-delete` +corresponds to key `hard_delete`. Only backend options can be specified. +A special, and required, key `type` identifies the [storage system](https://rclone.org/overview/), +where the value is the internal lowercase name as returned by command +`rclone help backends`. Comments are indicated by `;` or `#` at the +beginning of a line. -The default is `5m`. Set to `0` to disable. +Example: -### --transfers=N ### + [megaremote] + type = mega + user = you@example.com + pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH -The number of file transfers to run in parallel. It can sometimes be -useful to set this to a smaller number if the remote is giving a lot -of timeouts or bigger if you have lots of bandwidth and a fast remote. +Note that passwords are in [obscured](https://rclone.org/commands/rclone_obscure/) +form. Also, many storage systems uses token-based authentication instead +of passwords, and this requires additional steps. It is easier, and safer, +to use the interactive command `rclone config` instead of manually +editing the configuration file. -The default is to run 4 file transfers in parallel. +The configuration file will typically contain login information, and +should therefore have restricted permissions so that only the current user +can read it. Rclone tries to ensure this when it writes the file. +You may also choose to [encrypt](#configuration-encryption) the file. -Look at --multi-thread-streams if you would like to control single file transfers. +When token-based authentication are used, the configuration file +must be writable, because rclone needs to update the tokens inside it. -### -u, --update ### +To reduce risk of corrupting an existing configuration file, rclone +will not write directly to it when saving changes. Instead it will +first write to a new, temporary, file. If a configuration file already +existed, it will (on Unix systems) try to mirror its permissions to +the new file. Then it will rename the existing file to a temporary +name as backup. Next, rclone will rename the new file to the correct name, +before finally cleaning up by deleting the backup file. + +If the configuration file path used by rclone is a symbolic link, then +this will be evaluated and rclone will write to the resolved path, instead +of overwriting the symbolic link. Temporary files used in the process +(described above) will be written to the same parent directory as that +of the resolved configuration file, but if this directory is also a +symbolic link it will not be resolved and the temporary files will be +written to the location of the directory symbolic link. -This forces rclone to skip any files which exist on the destination -and have a modified time that is newer than the source file. +### --contimeout=TIME ### -This can be useful in avoiding needless transfers when transferring to -a remote which doesn't support modification times directly (or when -using `--use-server-modtime` to avoid extra API calls) as it is more -accurate than a `--size-only` check and faster than using -`--checksum`. On such remotes (or when using `--use-server-modtime`) -the time checked will be the uploaded time. +Set the connection timeout. This should be in go time format which +looks like `5s` for 5 seconds, `10m` for 10 minutes, or `3h30m`. -If an existing destination file has a modification time older than the -source file's, it will be updated if the sizes are different. If the -sizes are the same, it will be updated if the checksum is different or -not available. +The connection timeout is the amount of time rclone will wait for a +connection to go through to a remote object storage system. It is +`1m` by default. -If an existing destination file has a modification time equal (within -the computed modify window) to the source file's, it will be updated -if the sizes are different. The checksum will not be checked in this -case unless the `--checksum` flag is provided. +### --copy-dest=DIR ### -In all other cases the file will not be updated. +When using `sync`, `copy` or `move` DIR is checked in addition to the +destination for files. If a file identical to the source is found that +file is server-side copied from DIR to the destination. This is useful +for incremental backup. -Consider using the `--modify-window` flag to compensate for time skews -between the source and the backend, for backends that do not support -mod times, and instead use uploaded times. However, if the backend -does not support checksums, note that syncing or copying within the -time skew window may still result in additional transfers for safety. +The remote in use must support server-side copy and you must +use the same remote as the destination of the sync. The compare +directory must not overlap the destination directory. -### --use-mmap ### +See `--compare-dest` and `--backup-dir`. -If this flag is set then rclone will use anonymous memory allocated by -mmap on Unix based platforms and VirtualAlloc on Windows for its -transfer buffers (size controlled by `--buffer-size`). Memory -allocated like this does not go on the Go heap and can be returned to -the OS immediately when it is finished with. +### --dedupe-mode MODE ### -If this flag is not set then rclone will allocate and free the buffers -using the Go memory allocator which may use more memory as memory -pages are returned less aggressively to the OS. +Mode to run dedupe command in. One of `interactive`, `skip`, `first`, +`newest`, `oldest`, `rename`. The default is `interactive`. +See the dedupe command for more information as to what these options mean. -It is possible this does not work well on all platforms so it is -disabled by default; in the future it may be enabled by default. +### --default-time TIME ### -### --use-server-modtime ### +If a file or directory does have a modification time rclone can read +then rclone will display this fixed time instead. -Some object-store backends (e.g, Swift, S3) do not preserve file modification -times (modtime). On these backends, rclone stores the original modtime as -additional metadata on the object. By default it will make an API call to -retrieve the metadata when the modtime is needed by an operation. +The default is `2000-01-01 00:00:00 UTC`. This can be configured in +any of the ways shown in [the time or duration options](#time-option). -Use this flag to disable the extra API call and rely instead on the server's -modified time. In cases such as a local to remote sync using `--update`, -knowing the local file is newer than the time it was last uploaded to the -remote is sufficient. In those cases, this flag can speed up the process and -reduce the number of API calls necessary. +For example `--default-time 2020-06-01` to set the default time to the +1st of June 2020 or `--default-time 0s` to set the default time to the +time rclone started up. -Using this flag on a sync operation without also using `--update` would cause -all files modified at any time other than the last upload time to be uploaded -again, which is probably not what you want. +### --disable FEATURE,FEATURE,... ### -### -v, -vv, --verbose ### +This disables a comma separated list of optional features. For example +to disable server-side move and server-side copy use: -With `-v` rclone will tell you about each file that is transferred and -a small number of significant events. + --disable move,copy -With `-vv` rclone will become very verbose telling you about every -file it considers and transfers. Please send bug reports with a log -with this setting. +The features can be put in any case. -When setting verbosity as an environment variable, use -`RCLONE_VERBOSE=1` or `RCLONE_VERBOSE=2` for `-v` and `-vv` respectively. +To see a list of which features can be disabled use: -### -V, --version ### + --disable help -Prints the version number +The features a remote has can be seen in JSON format with: -SSL/TLS options ---------------- + rclone backend features remote: -The outgoing SSL/TLS connections rclone makes can be controlled with -these options. For example this can be very useful with the HTTP or -WebDAV backends. Rclone HTTP servers have their own set of -configuration for SSL/TLS which you can find in their documentation. +See the overview [features](https://rclone.org/overview/#features) and +[optional features](https://rclone.org/overview/#optional-features) to get an idea of +which feature does what. -### --ca-cert stringArray +Note that some features can be set to `true` if they are `true`/`false` +feature flag features by prefixing them with `!`. For example the +`CaseInsensitive` feature can be forced to `false` with `--disable CaseInsensitive` +and forced to `true` with `--disable '!CaseInsensitive'`. In general +it isn't a good idea doing this but it may be useful in extremis. -This loads the PEM encoded certificate authority certificates and uses -it to verify the certificates of the servers rclone connects to. +(Note that `!` is a shell command which you will +need to escape with single quotes or a backslash on unix like +platforms.) -If you have generated certificates signed with a local CA then you -will need this flag to connect to servers using those certificates. +This flag can be useful for debugging and in exceptional circumstances +(e.g. Google Drive limiting the total volume of Server Side Copies to +100 GiB/day). -### --client-cert string +### --disable-http2 -This loads the PEM encoded client side certificate. +This stops rclone from trying to use HTTP/2 if available. This can +sometimes speed up transfers due to a +[problem in the Go standard library](https://github.com/golang/go/issues/37373). -This is used for [mutual TLS authentication](https://en.wikipedia.org/wiki/Mutual_authentication). +### --dscp VALUE ### -The `--client-key` flag is required too when using this. +Specify a DSCP value or name to use in connections. This could help QoS +system to identify traffic class. BE, EF, DF, LE, CSx and AFxx are allowed. -### --client-key string +See the description of [differentiated services](https://en.wikipedia.org/wiki/Differentiated_services) to get an idea of +this field. Setting this to 1 (LE) to identify the flow to SCAVENGER class +can avoid occupying too much bandwidth in a network with DiffServ support ([RFC 8622](https://tools.ietf.org/html/rfc8622)). -This loads the PEM encoded client side private key used for mutual TLS -authentication. Used in conjunction with `--client-cert`. +For example, if you configured QoS on router to handle LE properly. Running: +``` +rclone copy --dscp LE from:/from to:/to +``` +would make the priority lower than usual internet flows. -### --no-check-certificate=true/false ### +This option has no effect on Windows (see [golang/go#42728](https://github.com/golang/go/issues/42728)). -`--no-check-certificate` controls whether a client verifies the -server's certificate chain and host name. -If `--no-check-certificate` is true, TLS accepts any certificate -presented by the server and any host name in that certificate. -In this mode, TLS is susceptible to man-in-the-middle attacks. +### -n, --dry-run ### -This option defaults to `false`. +Do a trial run with no permanent changes. Use this to see what rclone +would do without actually doing it. Useful when setting up the `sync` +command which deletes files in the destination. -**This should be used only for testing.** +### --expect-continue-timeout=TIME ### -Configuration Encryption ------------------------- -Your configuration file contains information for logging in to -your cloud services. This means that you should keep your -`rclone.conf` file in a secure location. +This specifies the amount of time to wait for a server's first +response headers after fully writing the request headers if the +request has an "Expect: 100-continue" header. Not all backends support +using this. -If you are in an environment where that isn't possible, you can -add a password to your configuration. This means that you will -have to supply the password every time you start rclone. +Zero means no timeout and causes the body to be sent immediately, +without waiting for the server to approve. This time does not include +the time to send the request header. -To add a password to your rclone configuration, execute `rclone config`. +The default is `1s`. Set to `0` to disable. -``` ->rclone config -Current remotes: +### --error-on-no-transfer ### -e) Edit existing remote -n) New remote -d) Delete remote -s) Set configuration password -q) Quit config -e/n/d/s/q> -``` +By default, rclone will exit with return code 0 if there were no errors. -Go into `s`, Set configuration password: -``` -e/n/d/s/q> s -Your configuration is not encrypted. -If you add a password, you will protect your login information to cloud services. -a) Add Password -q) Quit to main menu -a/q> a -Enter NEW configuration password: -password: -Confirm NEW password: -password: -Password set -Your configuration is encrypted. -c) Change Password -u) Unencrypt configuration -q) Quit to main menu -c/u/q> -``` +This option allows rclone to return exit code 9 if no files were transferred +between the source and destination. This allows using rclone in scripts, and +triggering follow-on actions if data was copied, or skipping if not. -Your configuration is now encrypted, and every time you start rclone -you will have to supply the password. See below for details. -In the same menu, you can change the password or completely remove -encryption from your configuration. +NB: Enabling this option turns a usually non-fatal error into a potentially +fatal one - please check and adjust your scripts accordingly! -There is no way to recover the configuration if you lose your password. +### --fs-cache-expire-duration=TIME -rclone uses [nacl secretbox](https://godoc.org/golang.org/x/crypto/nacl/secretbox) -which in turn uses XSalsa20 and Poly1305 to encrypt and authenticate -your configuration with secret-key cryptography. -The password is SHA-256 hashed, which produces the key for secretbox. -The hashed password is not stored. +When using rclone via the API rclone caches created remotes for 5 +minutes by default in the "fs cache". This means that if you do +repeated actions on the same remote then rclone won't have to build it +again from scratch, which makes it more efficient. -While this provides very good security, we do not recommend storing -your encrypted rclone configuration in public if it contains sensitive -information, maybe except if you use a very strong password. +This flag sets the time that the remotes are cached for. If you set it +to `0` (or negative) then rclone won't cache the remotes at all. -If it is safe in your environment, you can set the `RCLONE_CONFIG_PASS` -environment variable to contain your password, in which case it will be -used for decrypting the configuration. +Note that if you use some flags, eg `--backup-dir` and if this is set +to `0` rclone may build two remotes (one for the source or destination +and one for the `--backup-dir` where it may have only built one +before. -You can set this for a session from a script. For unix like systems -save this to a file called `set-rclone-password`: +### --fs-cache-expire-interval=TIME -``` -#!/bin/echo Source this file don't run it +This controls how often rclone checks for cached remotes to expire. +See the `--fs-cache-expire-duration` documentation above for more +info. The default is 60s, set to 0 to disable expiry. -read -s RCLONE_CONFIG_PASS -export RCLONE_CONFIG_PASS -``` +### --header ### -Then source the file when you want to use it. From the shell you -would do `source set-rclone-password`. It will then ask you for the -password and set it in the environment variable. +Add an HTTP header for all transactions. The flag can be repeated to +add multiple headers. -An alternate means of supplying the password is to provide a script -which will retrieve the password and print on standard output. This -script should have a fully specified path name and not rely on any -environment variables. The script is supplied either via -`--password-command="..."` command line argument or via the -`RCLONE_PASSWORD_COMMAND` environment variable. +If you want to add headers only for uploads use `--header-upload` and +if you want to add headers only for downloads use `--header-download`. -One useful example of this is using the `passwordstore` application -to retrieve the password: +This flag is supported for all HTTP based backends even those not +supported by `--header-upload` and `--header-download` so may be used +as a workaround for those with care. ``` -export RCLONE_PASSWORD_COMMAND="pass rclone/config" +rclone ls remote:test --header "X-Rclone: Foo" --header "X-LetMeIn: Yes" ``` -If the `passwordstore` password manager holds the password for the -rclone configuration, using the script method means the password -is primarily protected by the `passwordstore` system, and is never -embedded in the clear in scripts, nor available for examination -using the standard commands available. It is quite possible with -long running rclone sessions for copies of passwords to be innocently -captured in log files or terminal scroll buffers, etc. Using the -script method of supplying the password enhances the security of -the config password considerably. +### --header-download ### -If you are running rclone inside a script, unless you are using the -`--password-command` method, you might want to disable -password prompts. To do that, pass the parameter -`--ask-password=false` to rclone. This will make rclone fail instead -of asking for a password if `RCLONE_CONFIG_PASS` doesn't contain -a valid password, and `--password-command` has not been supplied. +Add an HTTP header for all download transactions. The flag can be repeated to +add multiple headers. -Whenever running commands that may be affected by options in a -configuration file, rclone will look for an existing file according -to the rules described [above](#config-config-file), and load any it -finds. If an encrypted file is found, this includes decrypting it, -with the possible consequence of a password prompt. When executing -a command line that you know are not actually using anything from such -a configuration file, you can avoid it being loaded by overriding the -location, e.g. with one of the documented special values for -memory-only configuration. Since only backend options can be stored -in configuration files, this is normally unnecessary for commands -that do not operate on backends, e.g. `genautocomplete`. However, -it will be relevant for commands that do operate on backends in -general, but are used without referencing a stored remote, e.g. -listing local filesystem paths, or -[connection strings](#connection-strings): `rclone --config="" ls .` +``` +rclone sync --interactive s3:test/src ~/dst --header-download "X-Amz-Meta-Test: Foo" --header-download "X-Amz-Meta-Test2: Bar" +``` -Developer options ------------------ +See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for +currently supported backends. -These options are useful when developing or debugging rclone. There -are also some more remote specific options which aren't documented -here which are used for testing. These start with remote name e.g. -`--drive-test-option` - see the docs for the remote in question. +### --header-upload ### -### --cpuprofile=FILE ### +Add an HTTP header for all upload transactions. The flag can be repeated to add +multiple headers. -Write CPU profile to file. This can be analysed with `go tool pprof`. +``` +rclone sync --interactive ~/src s3:test/dst --header-upload "Content-Disposition: attachment; filename='cool.html'" --header-upload "X-Amz-Meta-Test: FooBar" +``` -#### --dump flag,flag,flag #### +See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for +currently supported backends. -The `--dump` flag takes a comma separated list of flags to dump info -about. +### --human-readable ### -Note that some headers including `Accept-Encoding` as shown may not -be correct in the request and the response may not show `Content-Encoding` -if the go standard libraries auto gzip encoding was in effect. In this case -the body of the request will be gunzipped before showing it. +Rclone commands output values for sizes (e.g. number of bytes) and +counts (e.g. number of files) either as *raw* numbers, or +in *human-readable* format. -The available flags are: +In human-readable format the values are scaled to larger units, indicated with +a suffix shown after the value, and rounded to three decimals. Rclone consistently +uses binary units (powers of 2) for sizes and decimal units (powers of 10) for counts. +The unit prefix for size is according to IEC standard notation, e.g. `Ki` for kibi. +Used with byte unit, `1 KiB` means 1024 Byte. In list type of output, only the +unit prefix appended to the value (e.g. `9.762Ki`), while in more textual output +the full unit is shown (e.g. `9.762 KiB`). For counts the SI standard notation is +used, e.g. prefix `k` for kilo. Used with file counts, `1k` means 1000 files. -#### --dump headers #### +The various [list](https://rclone.org/commands/rclone_ls/) commands output raw numbers by default. +Option `--human-readable` will make them output values in human-readable format +instead (with the short unit prefix). -Dump HTTP headers with `Authorization:` lines removed. May still -contain sensitive info. Can be very verbose. Useful for debugging -only. +The [about](https://rclone.org/commands/rclone_about/) command outputs human-readable by default, +with a command-specific option `--full` to output the raw numbers instead. -Use `--dump auth` if you do want the `Authorization:` headers. +Command [size](https://rclone.org/commands/rclone_size/) outputs both human-readable and raw numbers +in the same output. -#### --dump bodies #### +The [tree](https://rclone.org/commands/rclone_tree/) command also considers `--human-readable`, but +it will not use the exact same notation as the other commands: It rounds to one +decimal, and uses single letter suffix, e.g. `K` instead of `Ki`. The reason for +this is that it relies on an external library. -Dump HTTP headers and bodies - may contain sensitive info. Can be -very verbose. Useful for debugging only. +The interactive command [ncdu](https://rclone.org/commands/rclone_ncdu/) shows human-readable by +default, and responds to key `u` for toggling human-readable format. -Note that the bodies are buffered in memory so don't use this for -enormous files. +### --ignore-case-sync ### -#### --dump requests #### +Using this option will cause rclone to ignore the case of the files +when synchronizing so files will not be copied/synced when the +existing filenames are the same, even if the casing is different. -Like `--dump bodies` but dumps the request bodies and the response -headers. Useful for debugging download problems. +### --ignore-checksum ### -#### --dump responses #### +Normally rclone will check that the checksums of transferred files +match, and give an error "corrupted on transfer" if they don't. -Like `--dump bodies` but dumps the response bodies and the request -headers. Useful for debugging upload problems. +You can use this option to skip that check. You should only use it if +you have had the "corrupted on transfer" error message and you are +sure you might want to transfer potentially corrupted data. -#### --dump auth #### +### --ignore-existing ### -Dump HTTP headers - will contain sensitive info such as -`Authorization:` headers - use `--dump headers` to dump without -`Authorization:` headers. Can be very verbose. Useful for debugging -only. +Using this option will make rclone unconditionally skip all files +that exist on the destination, no matter the content of these files. -#### --dump filters #### +While this isn't a generally recommended option, it can be useful +in cases where your files change due to encryption. However, it cannot +correct partial transfers in case a transfer was interrupted. -Dump the filters to the output. Useful to see exactly what include -and exclude options are filtering on. +When performing a `move`/`moveto` command, this flag will leave skipped +files in the source location unchanged when a file with the same name +exists on the destination. -#### --dump goroutines #### +### --ignore-size ### -This dumps a list of the running go-routines at the end of the command -to standard output. +Normally rclone will look at modification time and size of files to +see if they are equal. If you set this flag then rclone will check +only the modification time. If `--checksum` is set then it only +checks the checksum. -#### --dump openfiles #### +It will also cause rclone to skip verifying the sizes are the same +after transfer. -This dumps a list of the open files at the end of the command. It -uses the `lsof` command to do that so you'll need that installed to -use it. +This can be useful for transferring files to and from OneDrive which +occasionally misreports the size of image files (see +[#399](https://github.com/rclone/rclone/issues/399) for more info). -### --memprofile=FILE ### +### -I, --ignore-times ### -Write memory profile to file. This can be analysed with `go tool pprof`. +Using this option will cause rclone to unconditionally upload all +files regardless of the state of files on the destination. -Filtering ---------- +Normally rclone would skip any files that have the same +modification time and are the same size (or have the same checksum if +using `--checksum`). -For the filtering options +### --immutable ### - * `--delete-excluded` - * `--filter` - * `--filter-from` - * `--exclude` - * `--exclude-from` - * `--exclude-if-present` - * `--include` - * `--include-from` - * `--files-from` - * `--files-from-raw` - * `--min-size` - * `--max-size` - * `--min-age` - * `--max-age` - * `--dump filters` - * `--metadata-include` - * `--metadata-include-from` - * `--metadata-exclude` - * `--metadata-exclude-from` - * `--metadata-filter` - * `--metadata-filter-from` +Treat source and destination files as immutable and disallow +modification. -See the [filtering section](https://rclone.org/filtering/). +With this option set, files will be created and deleted as requested, +but existing files will never be updated. If an existing file does +not match between the source and destination, rclone will give the error +`Source and destination exist but do not match: immutable file modified`. -Remote control --------------- +Note that only commands which transfer files (e.g. `sync`, `copy`, +`move`) are affected by this behavior, and only modification is +disallowed. Files may still be deleted explicitly (e.g. `delete`, +`purge`) or implicitly (e.g. `sync`, `move`). Use `copy --immutable` +if it is desired to avoid deletion as well as modification. -For the remote control options and for instructions on how to remote control rclone +This can be useful as an additional layer of protection for immutable +or append-only data sets (notably backup archives), where modification +implies corruption and should not be propagated. - * `--rc` - * and anything starting with `--rc-` +### --inplace {#inplace} -See [the remote control section](https://rclone.org/rc/). +The `--inplace` flag changes the behaviour of rclone when uploading +files to some backends (backends with the `PartialUploads` feature +flag set) such as: -Logging -------- +- local +- ftp +- sftp -rclone has 4 levels of logging, `ERROR`, `NOTICE`, `INFO` and `DEBUG`. +Without `--inplace` (the default) rclone will first upload to a +temporary file with an extension like this, where `XXXXXX` represents a +random string and `.partial` is [--partial-suffix](#partial-suffix) value +(`.partial` by default). -By default, rclone logs to standard error. This means you can redirect -standard error and still see the normal output of rclone commands (e.g. -`rclone ls`). + original-file-name.XXXXXX.partial -By default, rclone will produce `Error` and `Notice` level messages. +(rclone will make sure the final name is no longer than 100 characters +by truncating the `original-file-name` part if necessary). -If you use the `-q` flag, rclone will only produce `Error` messages. +When the upload is complete, rclone will rename the `.partial` file to +the correct name, overwriting any existing file at that point. If the +upload fails then the `.partial` file will be deleted. -If you use the `-v` flag, rclone will produce `Error`, `Notice` and -`Info` messages. +This prevents other users of the backend from seeing partially +uploaded files in their new names and prevents overwriting the old +file until the new one is completely uploaded. -If you use the `-vv` flag, rclone will produce `Error`, `Notice`, -`Info` and `Debug` messages. +If the `--inplace` flag is supplied, rclone will upload directly to +the final name without creating a `.partial` file. -You can also control the log levels with the `--log-level` flag. +This means that an incomplete file will be visible in the directory +listings while the upload is in progress and any existing files will +be overwritten as soon as the upload starts. If the transfer fails +then the file will be deleted. This can cause data loss of the +existing file if the transfer fails. -If you use the `--log-file=FILE` option, rclone will redirect `Error`, -`Info` and `Debug` messages along with standard error to FILE. +Note that on the local file system if you don't use `--inplace` hard +links (Unix only) will be broken. And if you do use `--inplace` you +won't be able to update in use executables. -If you use the `--syslog` flag then rclone will log to syslog and the -`--syslog-facility` control which facility it uses. +Note also that versions of rclone prior to v1.63.0 behave as if the +`--inplace` flag is always supplied. -Rclone prefixes all log messages with their level in capitals, e.g. INFO -which makes it easy to grep the log file for different kinds of -information. +### -i, --interactive {#interactive} -Exit Code ---------- +This flag can be used to tell rclone that you wish a manual +confirmation before destructive operations. -If any errors occur during the command execution, rclone will exit with a -non-zero exit code. This allows scripts to detect when rclone -operations have failed. +It is **recommended** that you use this flag while learning rclone +especially with `rclone sync`. -During the startup phase, rclone will exit immediately if an error is -detected in the configuration. There will always be a log message -immediately before exiting. +For example -When rclone is running it will accumulate errors as it goes along, and -only exit with a non-zero exit code if (after retries) there were -still failed transfers. For every error counted there will be a high -priority log message (visible with `-q`) showing the message and -which file caused the problem. A high priority message is also shown -when starting a retry so the user can see that any previous error -messages may not be valid after the retry. If rclone has done a retry -it will log a high priority message if the retry was successful. +``` +$ rclone delete --interactive /tmp/dir +rclone: delete "important-file.txt"? +y) Yes, this is OK (default) +n) No, skip this +s) Skip all delete operations with no more questions +!) Do all delete operations with no more questions +q) Exit rclone now. +y/n/s/!/q> n +``` -### List of exit codes ### - * `0` - success - * `1` - Syntax or usage error - * `2` - Error not otherwise categorised - * `3` - Directory not found - * `4` - File not found - * `5` - Temporary error (one that more retries might fix) (Retry errors) - * `6` - Less serious errors (like 461 errors from dropbox) (NoRetry errors) - * `7` - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors) - * `8` - Transfer exceeded - limit set by --max-transfer reached - * `9` - Operation successful, but no files transferred +The options mean -Environment Variables ---------------------- +- `y`: **Yes**, this operation should go ahead. You can also press Return + for this to happen. You'll be asked every time unless you choose `s` + or `!`. +- `n`: **No**, do not do this operation. You'll be asked every time unless + you choose `s` or `!`. +- `s`: **Skip** all the following operations of this type with no more + questions. This takes effect until rclone exits. If there are any + different kind of operations you'll be prompted for them. +- `!`: **Do all** the following operations with no more + questions. Useful if you've decided that you don't mind rclone doing + that kind of operation. This takes effect until rclone exits . If + there are any different kind of operations you'll be prompted for + them. +- `q`: **Quit** rclone now, just in case! -Rclone can be configured entirely using environment variables. These -can be used to set defaults for options or config file entries. +### --leave-root #### -### Options ### +During rmdirs it will not remove root directory, even if it's empty. -Every option in rclone can have its default set by environment -variable. +### --log-file=FILE ### -To find the name of the environment variable, first, take the long -option name, strip the leading `--`, change `-` to `_`, make -upper case and prepend `RCLONE_`. +Log all of rclone's output to FILE. This is not active by default. +This can be useful for tracking down problems with syncs in +combination with the `-v` flag. See the [Logging section](#logging) +for more info. -For example, to always set `--stats 5s`, set the environment variable -`RCLONE_STATS=5s`. If you set stats on the command line this will -override the environment variable setting. +If FILE exists then rclone will append to it. -Or to always use the trash in drive `--drive-use-trash`, set -`RCLONE_DRIVE_USE_TRASH=true`. +Note that if you are using the `logrotate` program to manage rclone's +logs, then you should use the `copytruncate` option as rclone doesn't +have a signal to rotate logs. -Verbosity is slightly different, the environment variable -equivalent of `--verbose` or `-v` is `RCLONE_VERBOSE=1`, -or for `-vv`, `RCLONE_VERBOSE=2`. +### --log-format LIST ### -The same parser is used for the options and the environment variables -so they take exactly the same form. +Comma separated list of log format options. Accepted options are `date`, +`time`, `microseconds`, `pid`, `longfile`, `shortfile`, `UTC`. Any other +keywords will be silently ignored. `pid` will tag log messages with process +identifier which useful with `rclone mount --daemon`. Other accepted +options are explained in the [go documentation](https://pkg.go.dev/log#pkg-constants). +The default log format is "`date`,`time`". -The options set by environment variables can be seen with the `-vv` flag, e.g. `rclone version -vv`. +### --log-level LEVEL ### -### Config file ### +This sets the log level for rclone. The default log level is `NOTICE`. -You can set defaults for values in the config file on an individual -remote basis. The names of the config items are documented in the page -for each backend. +`DEBUG` is equivalent to `-vv`. It outputs lots of debug info - useful +for bug reports and really finding out what rclone is doing. -To find the name of the environment variable, you need to set, take -`RCLONE_CONFIG_` + name of remote + `_` + name of config file option -and make it all uppercase. +`INFO` is equivalent to `-v`. It outputs information about each transfer +and prints stats once a minute by default. -For example, to configure an S3 remote named `mys3:` without a config -file (using unix ways of setting environment variables): +`NOTICE` is the default log level if no logging flags are supplied. It +outputs very little when things are working normally. It outputs +warnings and significant events. -``` -$ export RCLONE_CONFIG_MYS3_TYPE=s3 -$ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX -$ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX -$ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket -$ rclone listremotes | grep mys3 -mys3: -``` +`ERROR` is equivalent to `-q`. It only outputs error messages. -Note that if you want to create a remote using environment variables -you must create the `..._TYPE` variable as above. +### --use-json-log ### -Note that the name of a remote created using environment variable is -case insensitive, in contrast to regular remotes stored in config -file as documented [above](#valid-remote-names). -You must write the name in uppercase in the environment variable, but -as seen from example above it will be listed and can be accessed in -lowercase, while you can also refer to the same remote in uppercase: -``` -$ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket -$ rclone lsd MYS3: - -1 2016-09-21 12:54:21 -1 my-bucket -``` +This switches the log format to JSON for rclone. The fields of json log +are level, msg, source, time. +### --low-level-retries NUMBER ### -Note that you can only set the options of the immediate backend, -so RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is -a crypt remote based on an S3 remote. However RCLONE_S3_ACCESS_KEY_ID will -set the access key of all remotes using S3, including myS3Crypt. +This controls the number of low level retries rclone does. -Note also that now rclone has [connection strings](#connection-strings), -it is probably easier to use those instead which makes the above example +A low level retry is used to retry a failing operation - typically one +HTTP request. This might be uploading a chunk of a big file for +example. You will see low level retries in the log with the `-v` +flag. - rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: +This shouldn't need to be changed from the default in normal operations. +However, if you get a lot of low level retries you may wish +to reduce the value so rclone moves on to a high level retry (see the +`--retries` flag) quicker. -### Precedence +Disable low level retries with `--low-level-retries 1`. -The various different methods of backend configuration are read in -this order and the first one with a value is used. +### --max-backlog=N ### -- Parameters in connection strings, e.g. `myRemote,skip_links:` -- Flag values as supplied on the command line, e.g. `--skip-links` -- Remote specific environment vars, e.g. `RCLONE_CONFIG_MYREMOTE_SKIP_LINKS` (see above). -- Backend-specific environment vars, e.g. `RCLONE_LOCAL_SKIP_LINKS`. -- Backend generic environment vars, e.g. `RCLONE_SKIP_LINKS`. -- Config file, e.g. `skip_links = true`. -- Default values, e.g. `false` - these can't be changed. +This is the maximum allowable backlog of files in a sync/copy/move +queued for being checked or transferred. -So if both `--skip-links` is supplied on the command line and an -environment variable `RCLONE_LOCAL_SKIP_LINKS` is set, the command line -flag will take preference. +This can be set arbitrarily large. It will only use memory when the +queue is in use. Note that it will use in the order of N KiB of memory +when the backlog is in use. -The backend configurations set by environment variables can be seen with the `-vv` flag, e.g. `rclone about myRemote: -vv`. +Setting this large allows rclone to calculate how many files are +pending more accurately, give a more accurate estimated finish +time and make `--order-by` work more accurately. -For non backend configuration the order is as follows: +Setting this small will make rclone more synchronous to the listings +of the remote which may be desirable. -- Flag values as supplied on the command line, e.g. `--stats 5s`. -- Environment vars, e.g. `RCLONE_STATS=5s`. -- Default values, e.g. `1m` - these can't be changed. +Setting this to a negative number will make the backlog as large as +possible. -### Other environment variables ### +### --max-delete=N ### -- `RCLONE_CONFIG_PASS` set to contain your config file password (see [Configuration Encryption](#configuration-encryption) section) -- `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` (or the lowercase versions thereof). - - `HTTPS_PROXY` takes precedence over `HTTP_PROXY` for https requests. - - The environment values may be either a complete URL or a "host[:port]" for, in which case the "http" scheme is assumed. -- `USER` and `LOGNAME` values are used as fallbacks for current username. The primary method for looking up username is OS-specific: Windows API on Windows, real user ID in /etc/passwd on Unix systems. In the documentation the current username is simply referred to as `$USER`. -- `RCLONE_CONFIG_DIR` - rclone **sets** this variable for use in config files and sub processes to point to the directory holding the config file. +This tells rclone not to delete more than N files. If that limit is +exceeded then a fatal error will be generated and rclone will stop the +operation in progress. -The options set by environment variables can be seen with the `-vv` and `--log-level=DEBUG` flags, e.g. `rclone version -vv`. +### --max-delete-size=SIZE ### -# Configuring rclone on a remote / headless machine # +Rclone will stop deleting files when the total size of deletions has +reached the size specified. It defaults to off. -Some of the configurations (those involving oauth2) require an -Internet connected web browser. +If that limit is exceeded then a fatal error will be generated and +rclone will stop the operation in progress. -If you are trying to set rclone up on a remote or headless box with no -browser available on it (e.g. a NAS or a server in a datacenter) then -you will need to use an alternative means of configuration. There are -two ways of doing it, described below. +### --max-depth=N ### -## Configuring using rclone authorize ## +This modifies the recursion depth for all the commands except purge. -On the headless box run `rclone` config but answer `N` to the `Use web browser -to automatically authenticate?` question. +So if you do `rclone --max-depth 1 ls remote:path` you will see only +the files in the top level directory. Using `--max-depth 2` means you +will see all the files in first two directory levels and so on. -``` -... -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes (default) -n) No -y/n> n -For this to work, you will need rclone available on a machine that has -a web browser available. +For historical reasons the `lsd` command defaults to using a +`--max-depth` of 1 - you can override this with the command line flag. -For more help and alternate methods see: https://rclone.org/remote_setup/ +You can use this command to disable recursion (with `--max-depth 1`). -Execute the following on the machine with the web browser (same rclone -version recommended): +Note that if you use this with `sync` and `--delete-excluded` the +files not recursed through are considered excluded and will be deleted +on the destination. Test first with `--dry-run` if you are not sure +what will happen. - rclone authorize "amazon cloud drive" +### --max-duration=TIME ### -Then paste the result below: -result> -``` +Rclone will stop transferring when it has run for the +duration specified. +Defaults to off. -Then on your main desktop machine +When the limit is reached all transfers will stop immediately. +Use `--cutoff-mode` to modify this behaviour. -``` -rclone authorize "amazon cloud drive" -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth -Log in and authorize rclone for access -Waiting for code... -Got code -Paste the following into your remote machine ---> -SECRET_TOKEN -<---End paste -``` +Rclone will exit with exit code 10 if the duration limit is reached. -Then back to the headless box, paste in the code +### --max-transfer=SIZE ### -``` -result> SECRET_TOKEN --------------------- -[acd12] -client_id = -client_secret = -token = SECRET_TOKEN --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> -``` +Rclone will stop transferring when it has reached the size specified. +Defaults to off. -## Configuring by copying the config file ## +When the limit is reached all transfers will stop immediately. +Use `--cutoff-mode` to modify this behaviour. -Rclone stores all of its config in a single configuration file. This -can easily be copied to configure a remote rclone. +Rclone will exit with exit code 8 if the transfer limit is reached. -So first configure rclone on your desktop machine with +### --cutoff-mode=hard|soft|cautious ### - rclone config +This modifies the behavior of `--max-transfer` and `--max-duration` +Defaults to `--cutoff-mode=hard`. -to set up the config file. +Specifying `--cutoff-mode=hard` will stop transferring immediately +when Rclone reaches the limit. -Find the config file by running `rclone config file`, for example +Specifying `--cutoff-mode=soft` will stop starting new transfers +when Rclone reaches the limit. -``` -$ rclone config file -Configuration file is stored at: -/home/user/.rclone.conf -``` +Specifying `--cutoff-mode=cautious` will try to prevent Rclone +from reaching the limit. Only applicable for `--max-transfer` -Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and -place it in the correct place (use `rclone config file` on the remote -box to find out where). +## -M, --metadata -## Configuring using SSH Tunnel ## +Setting this flag enables rclone to copy the metadata from the source +to the destination. For local backends this is ownership, permissions, +xattr etc. See the [metadata section](#metadata) for more info. -Linux and MacOS users can utilize SSH Tunnel to redirect the headless box port 53682 to local machine by using the following command: -``` -ssh -L localhost:53682:localhost:53682 username@remote_server -``` -Then on the headless box run `rclone` config and answer `Y` to the `Use web -browser to automatically authenticate?` question. +### --metadata-mapper SpaceSepList {#metadata-mapper} -``` -... -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes (default) -n) No -y/n> y -``` -Then copy and paste the auth url `http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx` to the browser on your local machine, complete the auth and it is done. +If you supply the parameter `--metadata-mapper /path/to/program` then +rclone will use that program to map metadata from source object to +destination object. -# Filtering, includes and excludes +The argument to this flag should be a command with an optional space separated +list of arguments. If one of the arguments has a space in then enclose +it in `"`, if you want a literal `"` in an argument then enclose the +argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) +for more info. -Filter flags determine which files rclone `sync`, `move`, `ls`, `lsl`, -`md5sum`, `sha1sum`, `size`, `delete`, `check` and similar commands -apply to. + --metadata-mapper "python bin/test_metadata_mapper.py" + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"' + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"' -They are specified in terms of path/file name patterns; path/file -lists; file age and size, or presence of a file in a directory. Bucket -based remotes without the concept of directory apply filters to object -key, age and size in an analogous way. +This uses a simple JSON based protocol with input on STDIN and output +on STDOUT. This will be called for every file and directory copied and +may be called concurrently. -Rclone `purge` does not obey filters. +The program's job is to take a metadata blob on the input and turn it +into a metadata blob on the output suitable for the destination +backend. -To test filters without risk of damage to data, apply them to `rclone -ls`, or with the `--dry-run` and `-vv` flags. +Input to the program (via STDIN) might look like this. This provides +some context for the `Metadata` which may be important. -Rclone filter patterns can only be used in filter command line options, not -in the specification of a remote. +- `SrcFs` is the config string for the remote that the object is currently on. +- `SrcFsType` is the name of the source backend. +- `DstFs` is the config string for the remote that the object is being copied to +- `DstFsType` is the name of the destination backend. +- `Remote` is the path of the file relative to the root. +- `Size`, `MimeType`, `ModTime` are attributes of the file. +- `IsDir` is `true` if this is a directory (not yet implemented). +- `ID` is the source `ID` of the file if known. +- `Metadata` is the backend specific metadata as described in the backend docs. -E.g. `rclone copy "remote:dir*.jpg" /path/to/dir` does not have a filter effect. -`rclone copy remote:dir /path/to/dir --include "*.jpg"` does. +```json +{ + "SrcFs": "gdrive:", + "SrcFsType": "drive", + "DstFs": "newdrive:user", + "DstFsType": "onedrive", + "Remote": "test.txt", + "Size": 6, + "MimeType": "text/plain; charset=utf-8", + "ModTime": "2022-10-11T17:53:10.286745272+01:00", + "IsDir": false, + "ID": "xyz", + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain1.com", + "permissions": "...", + "description": "my nice file", + "starred": "false" + } +} +``` -**Important** Avoid mixing any two of `--include...`, `--exclude...` or -`--filter...` flags in an rclone command. The results may not be what -you expect. Instead use a `--filter...` flag. +The program should then modify the input as desired and send it to +STDOUT. The returned `Metadata` field will be used in its entirety for +the destination object. Any other fields will be ignored. Note in this +example we translate user names and permissions and add something to +the description: -## Patterns for matching path/file names +```json +{ + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain2.com", + "permissions": "...", + "description": "my nice file [migrated from domain1]", + "starred": "false" + } +} +``` -### Pattern syntax {#patterns} +Metadata can be removed here too. -Here is a formal definition of the pattern syntax, -[examples](#examples) are below. +An example python program might look something like this to implement +the above transformations. -Rclone matching rules follow a glob style: +```python +import sys, json - * matches any sequence of non-separator (/) characters - ** matches any sequence of characters including / separators - ? matches any single non-separator (/) character - [ [ ! ] { character-range } ] - character class (must be non-empty) - { pattern-list } - pattern alternatives - {{ regexp }} - regular expression to match - c matches character c (c != *, **, ?, \, [, {, }) - \c matches reserved character c (c = *, **, ?, \, [, {, }) or character class +i = json.load(sys.stdin) +metadata = i["Metadata"] +# Add tag to description +if "description" in metadata: + metadata["description"] += " [migrated from domain1]" +else: + metadata["description"] = "[migrated from domain1]" +# Modify owner +if "owner" in metadata: + metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com") +o = { "Metadata": metadata } +json.dump(o, sys.stdout, indent="\t") +``` -character-range: +You can find this example (slightly expanded) in the rclone source code at +[bin/test_metadata_mapper.py](https://github.com/rclone/rclone/blob/master/test_metadata_mapper.py). - c matches character c (c != \, -, ]) - \c matches reserved character c (c = \, -, ]) - lo - hi matches character c for lo <= c <= hi +If you want to see the input to the metadata mapper and the output +returned from it in the log you can use `-vv --dump mapper`. -pattern-list: +See the [metadata section](#metadata) for more info. - pattern { , pattern } - comma-separated (without spaces) patterns +### --metadata-set key=value -character classes (see [Go regular expression reference](https://golang.org/pkg/regexp/syntax/)) include: +Add metadata `key` = `value` when uploading. This can be repeated as +many times as required. See the [metadata section](#metadata) for more +info. - Named character classes (e.g. [\d], [^\d], [\D], [^\D]) - Perl character classes (e.g. \s, \S, \w, \W) - ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) +### --modify-window=TIME ### -regexp for advanced users to insert a regular expression - see [below](#regexp) for more info: +When checking whether a file has been modified, this is the maximum +allowed time difference that a file can have and still be considered +equivalent. - Any re2 regular expression not containing `}}` +The default is `1ns` unless this is overridden by a remote. For +example OS X only stores modification times to the nearest second so +if you are reading and writing to an OS X filing system this will be +`1s` by default. -If the filter pattern starts with a `/` then it only matches -at the top level of the directory tree, -**relative to the root of the remote** (not necessarily the root -of the drive). If it does not start with `/` then it is matched -starting at the **end of the path/file name** but it only matches -a complete path element - it must match from a `/` -separator or the beginning of the path/file. +This command line flag allows you to override that computed default. - file.jpg - matches "file.jpg" - - matches "directory/file.jpg" - - doesn't match "afile.jpg" - - doesn't match "directory/afile.jpg" - /file.jpg - matches "file.jpg" in the root directory of the remote - - doesn't match "afile.jpg" - - doesn't match "directory/file.jpg" +### --multi-thread-write-buffer-size=SIZE ### -The top level of the remote may not be the top level of the drive. +When transferring with multiple threads, rclone will buffer SIZE bytes +in memory before writing to disk for each thread. -E.g. for a Microsoft Windows local directory structure +This can improve performance if the underlying filesystem does not deal +well with a lot of small writes in different positions of the file, so +if you see transfers being limited by disk write speed, you might want +to experiment with different values. Specially for magnetic drives and +remote file systems a higher value can be useful. - F: - ├── bkp - ├── data - │ ├── excl - │ │ ├── 123.jpg - │ │ └── 456.jpg - │ ├── incl - │ │ └── document.pdf +Nevertheless, the default of `128k` should be fine for almost all use +cases, so before changing it ensure that network is not really your +bottleneck. -To copy the contents of folder `data` into folder `bkp` excluding the contents of subfolder -`excl`the following command treats `F:\data` and `F:\bkp` as top level for filtering. +As a final hint, size is not the only factor: block size (or similar +concept) can have an impact. In one case, we observed that exact +multiples of 16k performed much better than other values. -`rclone copy F:\data\ F:\bkp\ --exclude=/excl/**` +### --multi-thread-chunk-size=SizeSuffix ### -**Important** Use `/` in path/file name patterns and not `\` even if -running on Microsoft Windows. +Normally the chunk size for multi thread transfers is set by the backend. +However some backends such as `local` and `smb` (which implement `OpenWriterAt` +but not `OpenChunkWriter`) don't have a natural chunk size. -Simple patterns are case sensitive unless the `--ignore-case` flag is used. +In this case the value of this option is used (default 64Mi). -Without `--ignore-case` (default) +### --multi-thread-cutoff=SIZE {#multi-thread-cutoff} - potato - matches "potato" - - doesn't match "POTATO" +When transferring files above SIZE to capable backends, rclone will +use multiple threads to transfer the file (default 256M). -With `--ignore-case` +Capable backends are marked in the +[overview](https://rclone.org/overview/#optional-features) as `MultithreadUpload`. (They +need to implement either the `OpenWriterAt` or `OpenChunkedWriter` +internal interfaces). These include include, `local`, `s3`, +`azureblob`, `b2`, `oracleobjectstorage` and `smb` at the time of +writing. - potato - matches "potato" - - matches "POTATO" +On the local disk, rclone preallocates the file (using +`fallocate(FALLOC_FL_KEEP_SIZE)` on unix or `NTSetInformationFile` on +Windows both of which takes no time) then each thread writes directly +into the file at the correct place. This means that rclone won't +create fragmented or sparse files and there won't be any assembly time +at the end of the transfer. -## Using regular expressions in filter patterns {#regexp} +The number of threads used to transfer is controlled by +`--multi-thread-streams`. -The syntax of filter patterns is glob style matching (like `bash` -uses) to make things easy for users. However this does not provide -absolute control over the matching, so for advanced users rclone also -provides a regular expression syntax. +Use `-vv` if you wish to see info about the threads. -The regular expressions used are as defined in the [Go regular -expression reference](https://golang.org/pkg/regexp/syntax/). Regular -expressions should be enclosed in `{{` `}}`. They will match only the -last path segment if the glob doesn't start with `/` or the whole path -name if it does. Note that rclone does not attempt to parse the -supplied regular expression, meaning that using any regular expression -filter will prevent rclone from using [directory filter rules](#directory_filter), -as it will instead check every path against -the supplied regular expression(s). +This will work with the `sync`/`copy`/`move` commands and friends +`copyto`/`moveto`. Multi thread transfers will be used with `rclone +mount` and `rclone serve` if `--vfs-cache-mode` is set to `writes` or +above. -Here is how the `{{regexp}}` is transformed into an full regular -expression to match the entire path: +**NB** that this **only** works with supported backends as the +destination but will work with any backend as the source. - {{regexp}} becomes (^|/)(regexp)$ - /{{regexp}} becomes ^(regexp)$ +**NB** that multi-thread copies are disabled for local to local copies +as they are faster without unless `--multi-thread-streams` is set +explicitly. -Regexp syntax can be mixed with glob syntax, for example +**NB** on Windows using multi-thread transfers to the local disk will +cause the resulting files to be [sparse](https://en.wikipedia.org/wiki/Sparse_file). +Use `--local-no-sparse` to disable sparse files (which may cause long +delays at the start of transfers) or disable multi-thread transfers +with `--multi-thread-streams 0` - *.{{jpe?g}} to match file.jpg, file.jpeg but not file.png +### --multi-thread-streams=N ### -You can also use regexp flags - to set case insensitive, for example +When using multi thread transfers (see above `--multi-thread-cutoff`) +this sets the number of streams to use. Set to `0` to disable multi +thread transfers (Default 4). - *.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png +If the backend has a `--backend-upload-concurrency` setting (eg +`--s3-upload-concurrency`) then this setting will be used as the +number of transfers instead if it is larger than the value of +`--multi-thread-streams` or `--multi-thread-streams` isn't set. -Be careful with wildcards in regular expressions - you don't want them -to match path separators normally. To match any file name starting -with `start` and ending with `end` write +### --no-check-dest ### - {{start[^/]*end\.jpg}} +The `--no-check-dest` can be used with `move` or `copy` and it causes +rclone not to check the destination at all when copying files. -Not +This means that: - {{start.*end\.jpg}} +- the destination is not listed minimising the API calls +- files are always transferred +- this can cause duplicates on remotes which allow it (e.g. Google Drive) +- `--retries 1` is recommended otherwise you'll transfer everything again on a retry -Which will match a directory called `start` with a file called -`end.jpg` in it as the `.*` will match `/` characters. +This flag is useful to minimise the transactions if you know that none +of the files are on the destination. -Note that you can use `-vv --dump filters` to show the filter patterns -in regexp format - rclone implements the glob patters by transforming -them into regular expressions. +This is a specialized flag which should be ignored by most users! -## Filter pattern examples {#examples} +### --no-gzip-encoding ### -| Description | Pattern | Matches | Does not match | -| ----------- |-------- | ------- | -------------- | -| Wildcard | `*.jpg` | `/file.jpg` | `/file.png` | -| | | `/dir/file.jpg` | `/dir/file.png` | -| Rooted | `/*.jpg` | `/file.jpg` | `/file.png` | -| | | `/file2.jpg` | `/dir/file.jpg` | -| Alternates | `*.{jpg,png}` | `/file.jpg` | `/file.gif` | -| | | `/dir/file.png` | `/dir/file.gif` | -| Path Wildcard | `dir/**` | `/dir/anyfile` | `file.png` | -| | | `/subdir/dir/subsubdir/anyfile` | `/subdir/file.png` | -| Any Char | `*.t?t` | `/file.txt` | `/file.qxt` | -| | | `/dir/file.tzt` | `/dir/file.png` | -| Range | `*.[a-z]` | `/file.a` | `/file.0` | -| | | `/dir/file.b` | `/dir/file.1` | -| Escape | `*.\?\?\?` | `/file.???` | `/file.abc` | -| | | `/dir/file.???` | `/dir/file.def` | -| Class | `*.\d\d\d` | `/file.012` | `/file.abc` | -| | | `/dir/file.345` | `/dir/file.def` | -| Regexp | `*.{{jpe?g}}` | `/file.jpeg` | `/file.png` | -| | | `/dir/file.jpg` | `/dir/file.jpeeg` | -| Rooted Regexp | `/{{.*\.jpe?g}}` | `/file.jpeg` | `/file.png` | -| | | `/file.jpg` | `/dir/file.jpg` | +Don't set `Accept-Encoding: gzip`. This means that rclone won't ask +the server for compressed files automatically. Useful if you've set +the server to return files with `Content-Encoding: gzip` but you +uploaded compressed files. -## How filter rules are applied to files {#how-filter-rules-work} +There is no need to set this in normal operation, and doing so will +decrease the network transfer efficiency of rclone. -Rclone path/file name filters are made up of one or more of the following flags: +### --no-traverse ### - * `--include` - * `--include-from` - * `--exclude` - * `--exclude-from` - * `--filter` - * `--filter-from` +The `--no-traverse` flag controls whether the destination file system +is traversed when using the `copy` or `move` commands. +`--no-traverse` is not compatible with `sync` and will be ignored if +you supply it with `sync`. -There can be more than one instance of individual flags. +If you are only copying a small number of files (or are filtering most +of the files) and/or have a large number of files on the destination +then `--no-traverse` will stop rclone listing the destination and save +time. -Rclone internally uses a combined list of all the include and exclude -rules. The order in which rules are processed can influence the result -of the filter. +However, if you are copying a large number of files, especially if you +are doing a copy where lots of the files under consideration haven't +changed and won't need copying then you shouldn't use `--no-traverse`. -All flags of the same type are processed together in the order -above, regardless of what order the different types of flags are -included on the command line. +See [rclone copy](https://rclone.org/commands/rclone_copy/) for an example of how to use it. -Multiple instances of the same flag are processed from left -to right according to their position in the command line. +### --no-unicode-normalization ### -To mix up the order of processing includes and excludes use `--filter...` -flags. +Don't normalize unicode characters in filenames during the sync routine. -Within `--include-from`, `--exclude-from` and `--filter-from` flags -rules are processed from top to bottom of the referenced file. +Sometimes, an operating system will store filenames containing unicode +parts in their decomposed form (particularly macOS). Some cloud storage +systems will then recompose the unicode, resulting in duplicate files if +the data is ever copied back to a local filesystem. -If there is an `--include` or `--include-from` flag specified, rclone -implies a `- **` rule which it adds to the bottom of the internal rule -list. Specifying a `+` rule with a `--filter...` flag does not imply -that rule. +Using this flag will disable that functionality, treating each unicode +character as unique. For example, by default é and é will be normalized +into the same character. With `--no-unicode-normalization` they will be +treated as unique characters. -Each path/file name passed through rclone is matched against the -combined filter list. At first match to a rule the path/file name -is included or excluded and no further filter rules are processed for -that path/file. +### --no-update-modtime ### -If rclone does not find a match, after testing against all rules -(including the implied rule if appropriate), the path/file name -is included. +When using this flag, rclone won't update modification times of remote +files if they are incorrect as it would normally. -Any path/file included at that stage is processed by the rclone -command. +This can be used if the remote is being synced with another tool also +(e.g. the Google Drive client). -`--files-from` and `--files-from-raw` flags over-ride and cannot be -combined with other filter options. +### --order-by string ### -To see the internal combined rule list, in regular expression form, -for a command add the `--dump filters` flag. Running an rclone command -with `--dump filters` and `-vv` flags lists the internal filter elements -and shows how they are applied to each source path/file. There is not -currently a means provided to pass regular expression filter options into -rclone directly though character class filter rules contain character -classes. [Go regular expression reference](https://golang.org/pkg/regexp/syntax/) +The `--order-by` flag controls the order in which files in the backlog +are processed in `rclone sync`, `rclone copy` and `rclone move`. -### How filter rules are applied to directories {#directory_filter} +The order by string is constructed like this. The first part +describes what aspect is being measured: -Rclone commands are applied to path/file names not -directories. The entire contents of a directory can be matched -to a filter by the pattern `directory/*` or recursively by -`directory/**`. +- `size` - order by the size of the files +- `name` - order by the full path of the files +- `modtime` - order by the modification date of the files -Directory filter rules are defined with a closing `/` separator. +This can have a modifier appended with a comma: -E.g. `/directory/subdirectory/` is an rclone directory filter rule. +- `ascending` or `asc` - order so that the smallest (or oldest) is processed first +- `descending` or `desc` - order so that the largest (or newest) is processed first +- `mixed` - order so that the smallest is processed first for some threads and the largest for others -Rclone commands can use directory filter rules to determine whether they -recurse into subdirectories. This potentially optimises access to a remote -by avoiding listing unnecessary directories. Whether optimisation is -desirable depends on the specific filter rules and source remote content. +If the modifier is `mixed` then it can have an optional percentage +(which defaults to `50`), e.g. `size,mixed,25` which means that 25% of +the threads should be taking the smallest items and 75% the +largest. The threads which take the smallest first will always take +the smallest first and likewise the largest first threads. The `mixed` +mode can be useful to minimise the transfer time when you are +transferring a mixture of large and small files - the large files are +guaranteed upload threads and bandwidth and the small files will be +processed continuously. -If any [regular expression filters](#regexp) are in use, then no -directory recursion optimisation is possible, as rclone must check -every path against the supplied regular expression(s). +If no modifier is supplied then the order is `ascending`. -Directory recursion optimisation occurs if either: +For example -* A source remote does not support the rclone `ListR` primitive. local, -sftp, Microsoft OneDrive and WebDAV do not support `ListR`. Google -Drive and most bucket type storage do. [Full list](https://rclone.org/overview/#optional-features) +- `--order-by size,desc` - send the largest files first +- `--order-by modtime,ascending` - send the oldest files first +- `--order-by name` - send the files with alphabetically by path first -* On other remotes (those that support `ListR`), if the rclone command is not naturally recursive, and -provided it is not run with the `--fast-list` flag. `ls`, `lsf -R` and -`size` are naturally recursive but `sync`, `copy` and `move` are not. +If the `--order-by` flag is not supplied or it is supplied with an +empty string then the default ordering will be used which is as +scanned. With `--checkers 1` this is mostly alphabetical, however +with the default `--checkers 8` it is somewhat random. -* Whenever the `--disable ListR` flag is applied to an rclone command. +#### Limitations -Rclone commands imply directory filter rules from path/file filter -rules. To view the directory filter rules rclone has implied for a -command specify the `--dump filters` flag. +The `--order-by` flag does not do a separate pass over the data. This +means that it may transfer some files out of the order specified if -E.g. for an include rule +- there are no files in the backlog or the source has not been fully scanned yet +- there are more than [--max-backlog](#max-backlog-n) files in the backlog - /a/*.jpg +Rclone will do its best to transfer the best file it has so in +practice this should not cause a problem. Think of `--order-by` as +being more of a best efforts flag rather than a perfect ordering. -Rclone implies the directory include rule +If you want perfect ordering then you will need to specify +[--check-first](#check-first) which will find all the files which need +transferring first before transferring any. - /a/ +### --partial-suffix {#partial-suffix} -Directory filter rules specified in an rclone command can limit -the scope of an rclone command but path/file filters still have -to be specified. +When [--inplace](#inplace) is not used, it causes rclone to use +the `--partial-suffix` as suffix for temporary files. -E.g. `rclone ls remote: --include /directory/` will not match any -files. Because it is an `--include` option the `--exclude **` rule -is implied, and the `/directory/` pattern serves only to optimise -access to the remote by ignoring everything outside of that directory. +Suffix length limit is 16 characters. -E.g. `rclone ls remote: --filter-from filter-list.txt` with a file -`filter-list.txt`: +The default is `.partial`. - - /dir1/ - - /dir2/ - + *.pdf - - ** +### --password-command SpaceSepList ### -All files in directories `dir1` or `dir2` or their subdirectories -are completely excluded from the listing. Only files of suffix -`pdf` in the root of `remote:` or its subdirectories are listed. -The `- **` rule prevents listing of any path/files not previously -matched by the rules above. +This flag supplies a program which should supply the config password +when run. This is an alternative to rclone prompting for the password +or setting the `RCLONE_CONFIG_PASS` variable. -Option `exclude-if-present` creates a directory exclude rule based -on the presence of a file in a directory and takes precedence over -other rclone directory filter rules. +The argument to this should be a command with a space separated list +of arguments. If one of the arguments has a space in then enclose it +in `"`, if you want a literal `"` in an argument then enclose the +argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) +for more info. -When using pattern list syntax, if a pattern item contains either -`/` or `**`, then rclone will not able to imply a directory filter rule -from this pattern list. +Eg -E.g. for an include rule + --password-command "echo hello" + --password-command 'echo "hello with space"' + --password-command 'echo "hello with ""quotes"" and space"' - {dir1/**,dir2/**} +See the [Configuration Encryption](#configuration-encryption) for more info. -Rclone will match files below directories `dir1` or `dir2` only, -but will not be able to use this filter to exclude a directory `dir3` -from being traversed. +See a [Windows PowerShell example on the Wiki](https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password). -Directory recursion optimisation may affect performance, but normally -not the result. One exception to this is sync operations with option -`--create-empty-src-dirs`, where any traversed empty directories will -be created. With the pattern list example `{dir1/**,dir2/**}` above, -this would create an empty directory `dir3` on destination (when it exists -on source). Changing the filter to `{dir1,dir2}/**`, or splitting it into -two include rules `--include dir1/** --include dir2/**`, will match the -same files while also filtering directories, with the result that an empty -directory `dir3` will no longer be created. +### -P, --progress ### -### `--exclude` - Exclude files matching pattern +This flag makes rclone update the stats in a static block in the +terminal providing a realtime overview of the transfer. -Excludes path/file names from an rclone command based on a single exclude -rule. +Any log messages will scroll above the static block. Log messages +will push the static block down to the bottom of the terminal where it +will stay. -This flag can be repeated. See above for the order filter flags are -processed in. +Normally this is updated every 500mS but this period can be overridden +with the `--stats` flag. -`--exclude` should not be used with `--include`, `--include-from`, -`--filter` or `--filter-from` flags. +This can be used with the `--stats-one-line` flag for a simpler +display. -`--exclude` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +Note: On Windows until [this bug](https://github.com/Azure/go-ansiterm/issues/26) +is fixed all non-ASCII characters will be replaced with `.` when +`--progress` is in use. -E.g. `rclone ls remote: --exclude *.bak` excludes all .bak files -from listing. +### --progress-terminal-title ### -E.g. `rclone size remote: "--exclude /dir/**"` returns the total size of -all files on `remote:` excluding those in root directory `dir` and sub -directories. +This flag, when used with `-P/--progress`, will print the string `ETA: %s` +to the terminal title. -E.g. on Microsoft Windows `rclone ls remote: --exclude "*\[{JP,KR,HK}\]*"` -lists the files in `remote:` with `[JP]` or `[KR]` or `[HK]` in -their name. Quotes prevent the shell from interpreting the `\` -characters.`\` characters escape the `[` and `]` so an rclone filter -treats them literally rather than as a character-range. The `{` and `}` -define an rclone pattern list. For other operating systems single quotes are -required ie `rclone ls remote: --exclude '*\[{JP,KR,HK}\]*'` +### -q, --quiet ### -### `--exclude-from` - Read exclude patterns from file +This flag will limit rclone's output to error messages only. -Excludes path/file names from an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. +### --refresh-times ### -For an example `exclude-file.txt`: +The `--refresh-times` flag can be used to update modification times of +existing files when they are out of sync on backends which don't +support hashes. - # a sample exclude rule file - *.bak - file2.jpg +This is useful if you uploaded files with the incorrect timestamps and +you now wish to correct them. -`rclone ls remote: --exclude-from exclude-file.txt` lists the files on -`remote:` except those named `file2.jpg` or with a suffix `.bak`. That is -equivalent to `rclone ls remote: --exclude file2.jpg --exclude "*.bak"`. +This flag is **only** useful for destinations which don't support +hashes (e.g. `crypt`). -This flag can be repeated. See above for the order filter flags are -processed in. +This can be used any of the sync commands `sync`, `copy` or `move`. -The `--exclude-from` flag is useful where multiple exclude filter rules -are applied to an rclone command. +To use this flag you will need to be doing a modification time sync +(so not using `--size-only` or `--checksum`). The flag will have no +effect when using `--size-only` or `--checksum`. -`--exclude-from` should not be used with `--include`, `--include-from`, -`--filter` or `--filter-from` flags. +If this flag is used when rclone comes to upload a file it will check +to see if there is an existing file on the destination. If this file +matches the source with size (and checksum if available) but has a +differing timestamp then instead of re-uploading it, rclone will +update the timestamp on the destination file. If the checksum does not +match rclone will upload the new file. If the checksum is absent (e.g. +on a `crypt` backend) then rclone will update the timestamp. -`--exclude-from` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +Note that some remotes can't set the modification time without +re-uploading the file so this flag is less useful on them. -`--exclude-from` followed by `-` reads filter rules from standard input. +Normally if you are doing a modification time sync rclone will update +modification times without `--refresh-times` provided that the remote +supports checksums **and** the checksums match on the file. However if the +checksums are absent then rclone will upload the file rather than +setting the timestamp as this is the safe behaviour. -### `--include` - Include files matching pattern +### --retries int ### -Adds a single include rule based on path/file names to an rclone -command. +Retry the entire sync if it fails this many times it fails (default 3). -This flag can be repeated. See above for the order filter flags are -processed in. +Some remotes can be unreliable and a few retries help pick up the +files which didn't get transferred because of errors. -`--include` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +Disable retries with `--retries 1`. -`--include` implies `--exclude **` at the end of an rclone internal -filter list. Therefore if you mix `--include` and `--include-from` -flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, -you must use include rules for all the files you want in the include -statement. For more flexibility use the `--filter-from` flag. +### --retries-sleep=TIME ### -E.g. `rclone ls remote: --include "*.{png,jpg}"` lists the files on -`remote:` with suffix `.png` and `.jpg`. All other files are excluded. +This sets the interval between each retry specified by `--retries` -E.g. multiple rclone copy commands can be combined with `--include` and a -pattern-list. +The default is `0`. Use `0` to disable. - rclone copy /vol1/A remote:A - rclone copy /vol1/B remote:B +### --server-side-across-configs ### -is equivalent to: +Allow server-side operations (e.g. copy or move) to work across +different configurations. - rclone copy /vol1 remote: --include "{A,B}/**" +This can be useful if you wish to do a server-side copy or move +between two remotes which use the same backend but are configured +differently. -E.g. `rclone ls remote:/wheat --include "??[^[:punct:]]*"` lists the -files `remote:` directory `wheat` (and subdirectories) whose third -character is not punctuation. This example uses -an [ASCII character class](https://golang.org/pkg/regexp/syntax/). +Note that this isn't enabled by default because it isn't easy for +rclone to tell if it will work between any two configurations. -### `--include-from` - Read include patterns from file +### --size-only ### -Adds path/file names to an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. +Normally rclone will look at modification time and size of files to +see if they are equal. If you set this flag then rclone will check +only the size. -For an example `include-file.txt`: +This can be useful transferring files from Dropbox which have been +modified by the desktop sync client which doesn't set checksums of +modification times in the same way as rclone. - # a sample include rule file - *.jpg - file2.avi +### --stats=TIME ### -`rclone ls remote: --include-from include-file.txt` lists the files on -`remote:` with name `file2.avi` or suffix `.jpg`. That is equivalent to -`rclone ls remote: --include file2.avi --include "*.jpg"`. +Commands which transfer data (`sync`, `copy`, `copyto`, `move`, +`moveto`) will print data transfer stats at regular intervals to show +their progress. -This flag can be repeated. See above for the order filter flags are -processed in. +This sets the interval. -The `--include-from` flag is useful where multiple include filter rules -are applied to an rclone command. +The default is `1m`. Use `0` to disable. -`--include-from` implies `--exclude **` at the end of an rclone internal -filter list. Therefore if you mix `--include` and `--include-from` -flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, -you must use include rules for all the files you want in the include -statement. For more flexibility use the `--filter-from` flag. +If you set the stats interval then all commands can show stats. This +can be useful when running other commands, `check` or `mount` for +example. -`--exclude-from` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +Stats are logged at `INFO` level by default which means they won't +show at default log level `NOTICE`. Use `--stats-log-level NOTICE` or +`-v` to make them show. See the [Logging section](#logging) for more +info on log levels. -`--exclude-from` followed by `-` reads filter rules from standard input. +Note that on macOS you can send a SIGINFO (which is normally ctrl-T in +the terminal) to make the stats print immediately. -### `--filter` - Add a file-filtering rule +### --stats-file-name-length integer ### +By default, the `--stats` output will truncate file names and paths longer +than 40 characters. This is equivalent to providing +`--stats-file-name-length 40`. Use `--stats-file-name-length 0` to disable +any truncation of file names printed by stats. -Specifies path/file names to an rclone command, based on a single -include or exclude rule, in `+` or `-` format. +### --stats-log-level string ### -This flag can be repeated. See above for the order filter flags are -processed in. +Log level to show `--stats` output at. This can be `DEBUG`, `INFO`, +`NOTICE`, or `ERROR`. The default is `INFO`. This means at the +default level of logging which is `NOTICE` the stats won't show - if +you want them to then use `--stats-log-level NOTICE`. See the [Logging +section](#logging) for more info on log levels. -`--filter +` differs from `--include`. In the case of `--include` rclone -implies an `--exclude *` rule which it adds to the bottom of the internal rule -list. `--filter...+` does not imply -that rule. +### --stats-one-line ### -`--filter` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +When this is specified, rclone condenses the stats into a single line +showing the most important stats only. -`--filter` should not be used with `--include`, `--include-from`, -`--exclude` or `--exclude-from` flags. +### --stats-one-line-date ### -E.g. `rclone ls remote: --filter "- *.bak"` excludes all `.bak` files -from a list of `remote:`. +When this is specified, rclone enables the single-line stats and prepends +the display with a date string. The default is `2006/01/02 15:04:05 - ` -### `--filter-from` - Read filtering patterns from a file +### --stats-one-line-date-format ### -Adds path/file names to an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. Include -rules start with `+ ` and exclude rules with `- `. `!` clears existing -rules. Rules are processed in the order they are defined. +When this is specified, rclone enables the single-line stats and prepends +the display with a user-supplied date string. The date string MUST be +enclosed in quotes. Follow [golang specs](https://golang.org/pkg/time/#Time.Format) for +date formatting syntax. -This flag can be repeated. See above for the order filter flags are -processed in. +### --stats-unit=bits|bytes ### -Arrange the order of filter rules with the most restrictive first and -work down. +By default, data transfer rates will be printed in bytes per second. -E.g. for `filter-file.txt`: +This option allows the data rate to be printed in bits per second. - # a sample filter rule file - - secret*.jpg - + *.jpg - + *.png - + file2.avi - - /dir/Trash/** - + /dir/** - # exclude everything else - - * +Data transfer volume will still be reported in bytes. -`rclone ls remote: --filter-from filter-file.txt` lists the path/files on -`remote:` including all `jpg` and `png` files, excluding any -matching `secret*.jpg` and including `file2.avi`. It also includes -everything in the directory `dir` at the root of `remote`, except -`remote:dir/Trash` which it excludes. Everything else is excluded. +The rate is reported as a binary unit, not SI unit. So 1 Mbit/s +equals 1,048,576 bit/s and not 1,000,000 bit/s. +The default is `bytes`. -E.g. for an alternative `filter-file.txt`: +### --suffix=SUFFIX ### - - secret*.jpg - + *.jpg - + *.png - + file2.avi - - * +When using `sync`, `copy` or `move` any files which would have been +overwritten or deleted will have the suffix added to them. If there +is a file with the same path (after the suffix has been added), then +it will be overwritten. -Files `file1.jpg`, `file3.png` and `file2.avi` are listed whilst -`secret17.jpg` and files without the suffix .jpg` or `.png` are excluded. +The remote in use must support server-side move or copy and you must +use the same remote as the destination of the sync. -E.g. for an alternative `filter-file.txt`: +This is for use with files to add the suffix in the current directory +or with `--backup-dir`. See `--backup-dir` for more info. - + *.jpg - + *.gif - ! - + 42.doc - - * +For example -Only file 42.doc is listed. Prior rules are cleared by the `!`. + rclone copy --interactive /path/to/local/file remote:current --suffix .bak -### `--files-from` - Read list of source-file names +will copy `/path/to/local` to `remote:current`, but for any files +which would have been updated or deleted have .bak added. -Adds path/files to an rclone command from a list in a named file. -Rclone processes the path/file names in the order of the list, and -no others. +If using `rclone sync` with `--suffix` and without `--backup-dir` then +it is recommended to put a filter rule in excluding the suffix +otherwise the `sync` will delete the backup files. -Other filter flags (`--include`, `--include-from`, `--exclude`, -`--exclude-from`, `--filter` and `--filter-from`) are ignored when -`--files-from` is used. + rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude "*.bak" -`--files-from` expects a list of files as its input. Leading or -trailing whitespace is stripped from the input lines. Lines starting -with `#` or `;` are ignored. +### --suffix-keep-extension ### -Rclone commands with a `--files-from` flag traverse the remote, -treating the names in `--files-from` as a set of filters. +When using `--suffix`, setting this causes rclone put the SUFFIX +before the extension of the files that it backs up rather than after. -If the `--no-traverse` and `--files-from` flags are used together -an rclone command does not traverse the remote. Instead it addresses -each path/file named in the file individually. For each path/file name, that -requires typically 1 API call. This can be efficient for a short `--files-from` -list and a remote containing many files. +So let's say we had `--suffix -2019-01-01`, without the flag `file.txt` +would be backed up to `file.txt-2019-01-01` and with the flag it would +be backed up to `file-2019-01-01.txt`. This can be helpful to make +sure the suffixed files can still be opened. -Rclone commands do not error if any names in the `--files-from` file are -missing from the source remote. +If a file has two (or more) extensions and the second (or subsequent) +extension is recognised as a valid mime type, then the suffix will go +before that extension. So `file.tar.gz` would be backed up to +`file-2019-01-01.tar.gz` whereas `file.badextension.gz` would be +backed up to `file.badextension-2019-01-01.gz`. -The `--files-from` flag can be repeated in a single rclone command to -read path/file names from more than one file. The files are read from left -to right along the command line. +### --syslog ### -Paths within the `--files-from` file are interpreted as starting -with the root specified in the rclone command. Leading `/` separators are -ignored. See [--files-from-raw](#files-from-raw-read-list-of-source-file-names-without-any-processing) if -you need the input to be processed in a raw manner. +On capable OSes (not Windows or Plan9) send all log output to syslog. -E.g. for a file `files-from.txt`: +This can be useful for running rclone in a script or `rclone mount`. - # comment - file1.jpg - subdir/file2.jpg +### --syslog-facility string ### -`rclone copy --files-from files-from.txt /home/me/pics remote:pics` -copies the following, if they exist, and only those files. +If using `--syslog` this sets the syslog facility (e.g. `KERN`, `USER`). +See `man syslog` for a list of possible facilities. The default +facility is `DAEMON`. - /home/me/pics/file1.jpg → remote:pics/file1.jpg - /home/me/pics/subdir/file2.jpg → remote:pics/subdir/file2.jpg +### --temp-dir=DIR ### -E.g. to copy the following files referenced by their absolute paths: +Specify the directory rclone will use for temporary files, to override +the default. Make sure the directory exists and have accessible permissions. - /home/user1/42 - /home/user1/dir/ford - /home/user2/prefect +By default the operating system's temp directory will be used: +- On Unix systems, `$TMPDIR` if non-empty, else `/tmp`. +- On Windows, the first non-empty value from `%TMP%`, `%TEMP%`, `%USERPROFILE%`, or the Windows directory. -First find a common subdirectory - in this case `/home` -and put the remaining files in `files-from.txt` with or without -leading `/`, e.g. +When overriding the default with this option, the specified path will be +set as value of environment variable `TMPDIR` on Unix systems +and `TMP` and `TEMP` on Windows. - user1/42 - user1/dir/ford - user2/prefect +You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) +command to see the current value. -Then copy these to a remote: +### --tpslimit float ### - rclone copy --files-from files-from.txt /home remote:backup +Limit transactions per second to this number. Default is 0 which is +used to mean unlimited transactions per second. -The three files are transferred as follows: +A transaction is roughly defined as an API call; its exact meaning +will depend on the backend. For HTTP based backends it is an HTTP +PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip +transaction over TCP. - /home/user1/42 → remote:backup/user1/important - /home/user1/dir/ford → remote:backup/user1/dir/file - /home/user2/prefect → remote:backup/user2/stuff +For example, to limit rclone to 10 transactions per second use +`--tpslimit 10`, or to 1 transaction every 2 seconds use `--tpslimit +0.5`. -Alternatively if `/` is chosen as root `files-from.txt` will be: +Use this when the number of transactions per second from rclone is +causing a problem with the cloud storage provider (e.g. getting you +banned or rate limited). - /home/user1/42 - /home/user1/dir/ford - /home/user2/prefect +This can be very useful for `rclone mount` to control the behaviour of +applications using it. -The copy command will be: +This limit applies to all HTTP based backends and to the FTP and SFTP +backends. It does not apply to the local backend or the Storj backend. - rclone copy --files-from files-from.txt / remote:backup +See also `--tpslimit-burst`. -Then there will be an extra `home` directory on the remote: +### --tpslimit-burst int ### - /home/user1/42 → remote:backup/home/user1/42 - /home/user1/dir/ford → remote:backup/home/user1/dir/ford - /home/user2/prefect → remote:backup/home/user2/prefect +Max burst of transactions for `--tpslimit` (default `1`). -### `--files-from-raw` - Read list of source-file names without any processing +Normally `--tpslimit` will do exactly the number of transaction per +second specified. However if you supply `--tps-burst` then rclone can +save up some transactions from when it was idle giving a burst of up +to the parameter supplied. -This flag is the same as `--files-from` except that input is read in a -raw manner. Lines with leading / trailing whitespace, and lines starting -with `;` or `#` are read without any processing. [rclone lsf](https://rclone.org/commands/rclone_lsf/) has -a compatible format that can be used to export file lists from remotes for -input to `--files-from-raw`. +For example if you provide `--tpslimit-burst 10` then if rclone has +been idle for more than 10*`--tpslimit` then it can do 10 transactions +very quickly before they are limited again. -### `--ignore-case` - make searches case insensitive +This may be used to increase performance of `--tpslimit` without +changing the long term average number of transactions per second. -By default, rclone filter patterns are case sensitive. The `--ignore-case` -flag makes all of the filters patterns on the command line case -insensitive. +### --track-renames ### -E.g. `--include "zaphod.txt"` does not match a file `Zaphod.txt`. With -`--ignore-case` a match is made. +By default, rclone doesn't keep track of renamed files, so if you +rename a file locally then sync it to a remote, rclone will delete the +old file on the remote and upload a new copy. -## Quoting shell metacharacters - -Rclone commands with filter patterns containing shell metacharacters may -not as work as expected in your shell and may require quoting. - -E.g. linux, OSX (`*` metacharacter) +An rclone sync with `--track-renames` runs like a normal sync, but keeps +track of objects which exist in the destination but not in the source +(which would normally be deleted), and which objects exist in the +source but not the destination (which would normally be transferred). +These objects are then candidates for renaming. - * `--include \*.jpg` - * `--include '*.jpg'` - * `--include='*.jpg'` +After the sync, rclone matches up the source only and destination only +objects using the `--track-renames-strategy` specified and either +renames the destination object or transfers the source and deletes the +destination object. `--track-renames` is stateless like all of +rclone's syncs. -Microsoft Windows expansion is done by the command, not shell, so -`--include *.jpg` does not require quoting. +To use this flag the destination must support server-side copy or +server-side move, and to use a hash based `--track-renames-strategy` +(the default) the source and the destination must have a compatible +hash. -If the rclone error -`Command .... needs .... arguments maximum: you provided .... non flag arguments:` -is encountered, the cause is commonly spaces within the name of a -remote or flag value. The fix then is to quote values containing spaces. +If the destination does not support server-side copy or move, rclone +will fall back to the default behaviour and log an error level message +to the console. -## Other filters +Encrypted destinations are not currently supported by `--track-renames` +if `--track-renames-strategy` includes `hash`. -### `--min-size` - Don't transfer any file smaller than this +Note that `--track-renames` is incompatible with `--no-traverse` and +that it uses extra memory to keep track of all the rename candidates. -Controls the minimum size file within the scope of an rclone command. -Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. +Note also that `--track-renames` is incompatible with +`--delete-before` and will select `--delete-after` instead of +`--delete-during`. -E.g. `rclone ls remote: --min-size 50k` lists files on `remote:` of 50 KiB -size or larger. +### --track-renames-strategy (hash,modtime,leaf,size) ### -See [the size option docs](https://rclone.org/docs/#size-option) for more info. +This option changes the file matching criteria for `--track-renames`. -### `--max-size` - Don't transfer any file larger than this +The matching is controlled by a comma separated selection of these tokens: -Controls the maximum size file within the scope of an rclone command. -Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. +- `modtime` - the modification time of the file - not supported on all backends +- `hash` - the hash of the file contents - not supported on all backends +- `leaf` - the name of the file not including its directory name +- `size` - the size of the file (this is always enabled) -E.g. `rclone ls remote: --max-size 1G` lists files on `remote:` of 1 GiB -size or smaller. +The default option is `hash`. -See [the size option docs](https://rclone.org/docs/#size-option) for more info. +Using `--track-renames-strategy modtime,leaf` would match files +based on modification time, the leaf of the file name and the size +only. -### `--max-age` - Don't transfer any file older than this +Using `--track-renames-strategy modtime` or `leaf` can enable +`--track-renames` support for encrypted destinations. -Controls the maximum age of files within the scope of an rclone command. +Note that the `hash` strategy is not supported with encrypted destinations. -`--max-age` applies only to files and not to directories. +### --delete-(before,during,after) ### -E.g. `rclone ls remote: --max-age 2d` lists files on `remote:` of 2 days -old or less. +This option allows you to specify when files on your destination are +deleted when you sync folders. -See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. +Specifying the value `--delete-before` will delete all files present +on the destination, but not on the source *before* starting the +transfer of any new or updated files. This uses two passes through the +file systems, one for the deletions and one for the copies. -### `--min-age` - Don't transfer any file younger than this +Specifying `--delete-during` will delete files while checking and +uploading files. This is the fastest option and uses the least memory. -Controls the minimum age of files within the scope of an rclone command. -(see `--max-age` for valid formats) +Specifying `--delete-after` (the default value) will delay deletion of +files until all new/updated files have been successfully transferred. +The files to be deleted are collected in the copy pass then deleted +after the copy pass has completed successfully. The files to be +deleted are held in memory so this mode may use more memory. This is +the safest mode as it will only delete files if there have been no +errors subsequent to that. If there have been errors before the +deletions start then you will get the message `not deleting files as +there were IO errors`. -`--min-age` applies only to files and not to directories. +### --fast-list ### -E.g. `rclone ls remote: --min-age 2d` lists files on `remote:` of 2 days -old or more. +When doing anything which involves a directory listing (e.g. `sync`, +`copy`, `ls` - in fact nearly every command), rclone has different +strategies to choose from. + +The basic strategy is to list one directory and processes it before using +more directory lists to process any subdirectories. This is a mandatory +backend feature, called `List`, which means it is supported by all backends. +This strategy uses small amount of memory, and because it can be parallelised +it is fast for operations involving processing of the list results. + +Some backends provide the support for an alternative strategy, where all +files beneath a directory can be listed in one (or a small number) of +transactions. Rclone supports this alternative strategy through an optional +backend feature called [`ListR`](https://rclone.org/overview/#listr). You can see in the storage +system overview documentation's [optional features](https://rclone.org/overview/#optional-features) +section which backends it is enabled for (these tend to be the bucket-based +ones, e.g. S3, B2, GCS, Swift). This strategy requires fewer transactions +for highly recursive operations, which is important on backends where this +is charged or heavily rate limited. It may be faster (due to fewer transactions) +or slower (because it can't be parallelized) depending on different parameters, +and may require more memory if rclone has to keep the whole listing in memory. + +Which listing strategy rclone picks for a given operation is complicated, but +in general it tries to choose the best possible. It will prefer `ListR` in +situations where it doesn't need to store the listed files in memory, e.g. +for unlimited recursive `ls` command variants. In other situations it will +prefer `List`, e.g. for `sync` and `copy`, where it needs to keep the listed +files in memory, and is performing operations on them where parallelization +may be a huge advantage. + +Rclone is not able to take all relevant parameters into account for deciding +the best strategy, and therefore allows you to influence the choice in two ways: +You can stop rclone from using `ListR` by disabling the feature, using the +[--disable](#disable-feature-feature) option (`--disable ListR`), or you can +allow rclone to use `ListR` where it would normally choose not to do so due to +higher memory usage, using the `--fast-list` option. Rclone should always +produce identical results either way. Using `--disable ListR` or `--fast-list` +on a remote which doesn't support `ListR` does nothing, rclone will just ignore +it. -See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. +A rule of thumb is that if you pay for transactions and can fit your entire +sync listing into memory, then `--fast-list` is recommended. If you have a +very big sync to do, then don't use `--fast-list`, otherwise you will run out +of memory. Run some tests and compare before you decide, and if in doubt then +just leave the default, let rclone decide, i.e. not use `--fast-list`. -## Other flags +### --timeout=TIME ### -### `--delete-excluded` - Delete files on dest excluded from sync +This sets the IO idle timeout. If a transfer has started but then +becomes idle for this long it is considered broken and disconnected. -**Important** this flag is dangerous to your data - use with `--dry-run` -and `-v` first. +The default is `5m`. Set to `0` to disable. -In conjunction with `rclone sync`, `--delete-excluded` deletes any files -on the destination which are excluded from the command. +### --transfers=N ### -E.g. the scope of `rclone sync --interactive A: B:` can be restricted: +The number of file transfers to run in parallel. It can sometimes be +useful to set this to a smaller number if the remote is giving a lot +of timeouts or bigger if you have lots of bandwidth and a fast remote. - rclone --min-size 50k --delete-excluded sync A: B: +The default is to run 4 file transfers in parallel. -All files on `B:` which are less than 50 KiB are deleted -because they are excluded from the rclone sync command. +Look at --multi-thread-streams if you would like to control single file transfers. -### `--dump filters` - dump the filters to the output +### -u, --update ### -Dumps the defined filters to standard output in regular expression -format. +This forces rclone to skip any files which exist on the destination +and have a modified time that is newer than the source file. -Useful for debugging. +This can be useful in avoiding needless transfers when transferring to +a remote which doesn't support modification times directly (or when +using `--use-server-modtime` to avoid extra API calls) as it is more +accurate than a `--size-only` check and faster than using +`--checksum`. On such remotes (or when using `--use-server-modtime`) +the time checked will be the uploaded time. -## Exclude directory based on a file +If an existing destination file has a modification time older than the +source file's, it will be updated if the sizes are different. If the +sizes are the same, it will be updated if the checksum is different or +not available. -The `--exclude-if-present` flag controls whether a directory is -within the scope of an rclone command based on the presence of a -named file within it. The flag can be repeated to check for -multiple file names, presence of any of them will exclude the -directory. +If an existing destination file has a modification time equal (within +the computed modify window) to the source file's, it will be updated +if the sizes are different. The checksum will not be checked in this +case unless the `--checksum` flag is provided. -This flag has a priority over other filter flags. +In all other cases the file will not be updated. -E.g. for the following directory structure: +Consider using the `--modify-window` flag to compensate for time skews +between the source and the backend, for backends that do not support +mod times, and instead use uploaded times. However, if the backend +does not support checksums, note that syncing or copying within the +time skew window may still result in additional transfers for safety. - dir1/file1 - dir1/dir2/file2 - dir1/dir2/dir3/file3 - dir1/dir2/dir3/.ignore +### --use-mmap ### -The command `rclone ls --exclude-if-present .ignore dir1` does -not list `dir3`, `file3` or `.ignore`. +If this flag is set then rclone will use anonymous memory allocated by +mmap on Unix based platforms and VirtualAlloc on Windows for its +transfer buffers (size controlled by `--buffer-size`). Memory +allocated like this does not go on the Go heap and can be returned to +the OS immediately when it is finished with. -## Metadata filters {#metadata} +If this flag is not set then rclone will allocate and free the buffers +using the Go memory allocator which may use more memory as memory +pages are returned less aggressively to the OS. -The metadata filters work in a very similar way to the normal file -name filters, except they match [metadata](https://rclone.org/docs/#metadata) on the -object. +It is possible this does not work well on all platforms so it is +disabled by default; in the future it may be enabled by default. -The metadata should be specified as `key=value` patterns. This may be -wildcarded using the normal [filter patterns](#patterns) or [regular -expressions](#regexp). +### --use-server-modtime ### -For example if you wished to list only local files with a mode of -`100664` you could do that with: +Some object-store backends (e.g, Swift, S3) do not preserve file modification +times (modtime). On these backends, rclone stores the original modtime as +additional metadata on the object. By default it will make an API call to +retrieve the metadata when the modtime is needed by an operation. - rclone lsf -M --files-only --metadata-include "mode=100664" . +Use this flag to disable the extra API call and rely instead on the server's +modified time. In cases such as a local to remote sync using `--update`, +knowing the local file is newer than the time it was last uploaded to the +remote is sufficient. In those cases, this flag can speed up the process and +reduce the number of API calls necessary. -Or if you wished to show files with an `atime`, `mtime` or `btime` at a given date: +Using this flag on a sync operation without also using `--update` would cause +all files modified at any time other than the last upload time to be uploaded +again, which is probably not what you want. - rclone lsf -M --files-only --metadata-include "[abm]time=2022-12-16*" . +### -v, -vv, --verbose ### -Like file filtering, metadata filtering only applies to files not to -directories. +With `-v` rclone will tell you about each file that is transferred and +a small number of significant events. -The filters can be applied using these flags. +With `-vv` rclone will become very verbose telling you about every +file it considers and transfers. Please send bug reports with a log +with this setting. -- `--metadata-include` - Include metadatas matching pattern -- `--metadata-include-from` - Read metadata include patterns from file (use - to read from stdin) -- `--metadata-exclude` - Exclude metadatas matching pattern -- `--metadata-exclude-from` - Read metadata exclude patterns from file (use - to read from stdin) -- `--metadata-filter` - Add a metadata filtering rule -- `--metadata-filter-from` - Read metadata filtering patterns from a file (use - to read from stdin) +When setting verbosity as an environment variable, use +`RCLONE_VERBOSE=1` or `RCLONE_VERBOSE=2` for `-v` and `-vv` respectively. -Each flag can be repeated. See the section on [how filter rules are -applied](#how-filter-rules-work) for more details - these flags work -in an identical way to the file name filtering flags, but instead of -file name patterns have metadata patterns. +### -V, --version ### +Prints the version number -## Common pitfalls +SSL/TLS options +--------------- -The most frequent filter support issues on -the [rclone forum](https://forum.rclone.org/) are: +The outgoing SSL/TLS connections rclone makes can be controlled with +these options. For example this can be very useful with the HTTP or +WebDAV backends. Rclone HTTP servers have their own set of +configuration for SSL/TLS which you can find in their documentation. -* Not using paths relative to the root of the remote -* Not using `/` to match from the root of a remote -* Not using `**` to match the contents of a directory +### --ca-cert stringArray -# GUI (Experimental) +This loads the PEM encoded certificate authority certificates and uses +it to verify the certificates of the servers rclone connects to. -Rclone can serve a web based GUI (graphical user interface). This is -somewhat experimental at the moment so things may be subject to -change. +If you have generated certificates signed with a local CA then you +will need this flag to connect to servers using those certificates. -Run this command in a terminal and rclone will download and then -display the GUI in a web browser. +### --client-cert string -``` -rclone rcd --rc-web-gui -``` +This loads the PEM encoded client side certificate. -This will produce logs like this and rclone needs to continue to run to serve the GUI: +This is used for [mutual TLS authentication](https://en.wikipedia.org/wiki/Mutual_authentication). -``` -2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip -2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] -2019/08/25 11:40:16 NOTICE: Unzipping -2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ -``` +The `--client-key` flag is required too when using this. -This assumes you are running rclone locally on your machine. It is -possible to separate the rclone and the GUI - see below for details. +### --client-key string -If you wish to check for updates then you can add `--rc-web-gui-update` -to the command line. +This loads the PEM encoded client side private key used for mutual TLS +authentication. Used in conjunction with `--client-cert`. -If you find your GUI broken, you may force it to update by add `--rc-web-gui-force-update`. +### --no-check-certificate=true/false ### -By default, rclone will open your browser. Add `--rc-web-gui-no-open-browser` -to disable this feature. +`--no-check-certificate` controls whether a client verifies the +server's certificate chain and host name. +If `--no-check-certificate` is true, TLS accepts any certificate +presented by the server and any host name in that certificate. +In this mode, TLS is susceptible to man-in-the-middle attacks. -## Using the GUI +This option defaults to `false`. -Once the GUI opens, you will be looking at the dashboard which has an overall overview. +**This should be used only for testing.** -On the left hand side you will see a series of view buttons you can click on: +Configuration Encryption +------------------------ +Your configuration file contains information for logging in to +your cloud services. This means that you should keep your +`rclone.conf` file in a secure location. -- Dashboard - main overview -- Configs - examine and create new configurations -- Explorer - view, download and upload files to the cloud storage systems -- Backend - view or alter the backend config -- Log out +If you are in an environment where that isn't possible, you can +add a password to your configuration. This means that you will +have to supply the password every time you start rclone. -(More docs and walkthrough video to come!) +To add a password to your rclone configuration, execute `rclone config`. -## How it works +``` +>rclone config +Current remotes: -When you run the `rclone rcd --rc-web-gui` this is what happens +e) Edit existing remote +n) New remote +d) Delete remote +s) Set configuration password +q) Quit config +e/n/d/s/q> +``` -- Rclone starts but only runs the remote control API ("rc"). -- The API is bound to localhost with an auto-generated username and password. -- If the API bundle is missing then rclone will download it. -- rclone will start serving the files from the API bundle over the same port as the API -- rclone will open the browser with a `login_token` so it can log straight in. +Go into `s`, Set configuration password: +``` +e/n/d/s/q> s +Your configuration is not encrypted. +If you add a password, you will protect your login information to cloud services. +a) Add Password +q) Quit to main menu +a/q> a +Enter NEW configuration password: +password: +Confirm NEW password: +password: +Password set +Your configuration is encrypted. +c) Change Password +u) Unencrypt configuration +q) Quit to main menu +c/u/q> +``` -## Advanced use +Your configuration is now encrypted, and every time you start rclone +you will have to supply the password. See below for details. +In the same menu, you can change the password or completely remove +encryption from your configuration. -The `rclone rcd` may use any of the [flags documented on the rc page](https://rclone.org/rc/#supported-parameters). +There is no way to recover the configuration if you lose your password. -The flag `--rc-web-gui` is shorthand for +rclone uses [nacl secretbox](https://godoc.org/golang.org/x/crypto/nacl/secretbox) +which in turn uses XSalsa20 and Poly1305 to encrypt and authenticate +your configuration with secret-key cryptography. +The password is SHA-256 hashed, which produces the key for secretbox. +The hashed password is not stored. -- Download the web GUI if necessary -- Check we are using some authentication -- `--rc-user gui` -- `--rc-pass ` -- `--rc-serve` +While this provides very good security, we do not recommend storing +your encrypted rclone configuration in public if it contains sensitive +information, maybe except if you use a very strong password. -These flags can be overridden as desired. +If it is safe in your environment, you can set the `RCLONE_CONFIG_PASS` +environment variable to contain your password, in which case it will be +used for decrypting the configuration. -See also the [rclone rcd documentation](https://rclone.org/commands/rclone_rcd/). +You can set this for a session from a script. For unix like systems +save this to a file called `set-rclone-password`: -### Example: Running a public GUI +``` +#!/bin/echo Source this file don't run it -For example the GUI could be served on a public port over SSL using an htpasswd file using the following flags: +read -s RCLONE_CONFIG_PASS +export RCLONE_CONFIG_PASS +``` -- `--rc-web-gui` -- `--rc-addr :443` -- `--rc-htpasswd /path/to/htpasswd` -- `--rc-cert /path/to/ssl.crt` -- `--rc-key /path/to/ssl.key` +Then source the file when you want to use it. From the shell you +would do `source set-rclone-password`. It will then ask you for the +password and set it in the environment variable. -### Example: Running a GUI behind a proxy +An alternate means of supplying the password is to provide a script +which will retrieve the password and print on standard output. This +script should have a fully specified path name and not rely on any +environment variables. The script is supplied either via +`--password-command="..."` command line argument or via the +`RCLONE_PASSWORD_COMMAND` environment variable. -If you want to run the GUI behind a proxy at `/rclone` you could use these flags: +One useful example of this is using the `passwordstore` application +to retrieve the password: -- `--rc-web-gui` -- `--rc-baseurl rclone` -- `--rc-htpasswd /path/to/htpasswd` +``` +export RCLONE_PASSWORD_COMMAND="pass rclone/config" +``` -Or instead of htpasswd if you just want a single user and password: +If the `passwordstore` password manager holds the password for the +rclone configuration, using the script method means the password +is primarily protected by the `passwordstore` system, and is never +embedded in the clear in scripts, nor available for examination +using the standard commands available. It is quite possible with +long running rclone sessions for copies of passwords to be innocently +captured in log files or terminal scroll buffers, etc. Using the +script method of supplying the password enhances the security of +the config password considerably. -- `--rc-user me` -- `--rc-pass mypassword` +If you are running rclone inside a script, unless you are using the +`--password-command` method, you might want to disable +password prompts. To do that, pass the parameter +`--ask-password=false` to rclone. This will make rclone fail instead +of asking for a password if `RCLONE_CONFIG_PASS` doesn't contain +a valid password, and `--password-command` has not been supplied. -## Project +Whenever running commands that may be affected by options in a +configuration file, rclone will look for an existing file according +to the rules described [above](#config-config-file), and load any it +finds. If an encrypted file is found, this includes decrypting it, +with the possible consequence of a password prompt. When executing +a command line that you know are not actually using anything from such +a configuration file, you can avoid it being loaded by overriding the +location, e.g. with one of the documented special values for +memory-only configuration. Since only backend options can be stored +in configuration files, this is normally unnecessary for commands +that do not operate on backends, e.g. `genautocomplete`. However, +it will be relevant for commands that do operate on backends in +general, but are used without referencing a stored remote, e.g. +listing local filesystem paths, or +[connection strings](#connection-strings): `rclone --config="" ls .` -The GUI is being developed in the: [rclone/rclone-webui-react repository](https://github.com/rclone/rclone-webui-react). +Developer options +----------------- -Bug reports and contributions are very welcome :-) +These options are useful when developing or debugging rclone. There +are also some more remote specific options which aren't documented +here which are used for testing. These start with remote name e.g. +`--drive-test-option` - see the docs for the remote in question. -If you have questions then please ask them on the [rclone forum](https://forum.rclone.org/). +### --cpuprofile=FILE ### -# Remote controlling rclone with its API +Write CPU profile to file. This can be analysed with `go tool pprof`. -If rclone is run with the `--rc` flag then it starts an HTTP server -which can be used to remote control rclone using its API. +#### --dump flag,flag,flag #### -You can either use the [rc](#api-rc) command to access the API -or [use HTTP directly](#api-http). +The `--dump` flag takes a comma separated list of flags to dump info +about. -If you just want to run a remote control then see the [rcd](https://rclone.org/commands/rclone_rcd/) command. +Note that some headers including `Accept-Encoding` as shown may not +be correct in the request and the response may not show `Content-Encoding` +if the go standard libraries auto gzip encoding was in effect. In this case +the body of the request will be gunzipped before showing it. -## Supported parameters +The available flags are: -### --rc +#### --dump headers #### -Flag to start the http server listen on remote requests - -### --rc-addr=IP +Dump HTTP headers with `Authorization:` lines removed. May still +contain sensitive info. Can be very verbose. Useful for debugging +only. -IPaddress:Port or :Port to bind server to. (default "localhost:5572") +Use `--dump auth` if you do want the `Authorization:` headers. -### --rc-cert=KEY -SSL PEM key (concatenation of certificate and CA certificate) +#### --dump bodies #### -### --rc-client-ca=PATH -Client certificate authority to verify clients with +Dump HTTP headers and bodies - may contain sensitive info. Can be +very verbose. Useful for debugging only. -### --rc-htpasswd=PATH +Note that the bodies are buffered in memory so don't use this for +enormous files. -htpasswd file - if not provided no authentication is done +#### --dump requests #### -### --rc-key=PATH +Like `--dump bodies` but dumps the request bodies and the response +headers. Useful for debugging download problems. -SSL PEM Private key +#### --dump responses #### -### --rc-max-header-bytes=VALUE +Like `--dump bodies` but dumps the response bodies and the request +headers. Useful for debugging upload problems. -Maximum size of request header (default 4096) +#### --dump auth #### -### --rc-min-tls-version=VALUE +Dump HTTP headers - will contain sensitive info such as +`Authorization:` headers - use `--dump headers` to dump without +`Authorization:` headers. Can be very verbose. Useful for debugging +only. -The minimum TLS version that is acceptable. Valid values are "tls1.0", -"tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). +#### --dump filters #### -### --rc-user=VALUE +Dump the filters to the output. Useful to see exactly what include +and exclude options are filtering on. -User name for authentication. +#### --dump goroutines #### -### --rc-pass=VALUE +This dumps a list of the running go-routines at the end of the command +to standard output. -Password for authentication. +#### --dump openfiles #### -### --rc-realm=VALUE +This dumps a list of the open files at the end of the command. It +uses the `lsof` command to do that so you'll need that installed to +use it. -Realm for authentication (default "rclone") +#### --dump mapper #### -### --rc-server-read-timeout=DURATION +This shows the JSON blobs being sent to the program supplied with +`--metadata-mapper` and received from it. It can be useful for +debugging the metadata mapper interface. -Timeout for server reading data (default 1h0m0s) +### --memprofile=FILE ### -### --rc-server-write-timeout=DURATION +Write memory profile to file. This can be analysed with `go tool pprof`. -Timeout for server writing data (default 1h0m0s) +Filtering +--------- -### --rc-serve +For the filtering options -Enable the serving of remote objects via the HTTP interface. This -means objects will be accessible at http://127.0.0.1:5572/ by default, -so you can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* -to see a listing of the remotes. Objects may be requested from -remotes using this syntax http://127.0.0.1:5572/[remote:path]/path/to/object + * `--delete-excluded` + * `--filter` + * `--filter-from` + * `--exclude` + * `--exclude-from` + * `--exclude-if-present` + * `--include` + * `--include-from` + * `--files-from` + * `--files-from-raw` + * `--min-size` + * `--max-size` + * `--min-age` + * `--max-age` + * `--dump filters` + * `--metadata-include` + * `--metadata-include-from` + * `--metadata-exclude` + * `--metadata-exclude-from` + * `--metadata-filter` + * `--metadata-filter-from` -Default Off. +See the [filtering section](https://rclone.org/filtering/). -### --rc-files /path/to/directory +Remote control +-------------- -Path to local files to serve on the HTTP server. +For the remote control options and for instructions on how to remote control rclone -If this is set then rclone will serve the files in that directory. It -will also open the root in the web browser if specified. This is for -implementing browser based GUIs for rclone functions. + * `--rc` + * and anything starting with `--rc-` -If `--rc-user` or `--rc-pass` is set then the URL that is opened will -have the authorization in the URL in the `http://user:pass@localhost/` -style. +See [the remote control section](https://rclone.org/rc/). -Default Off. +Logging +------- -### --rc-enable-metrics +rclone has 4 levels of logging, `ERROR`, `NOTICE`, `INFO` and `DEBUG`. -Enable OpenMetrics/Prometheus compatible endpoint at `/metrics`. +By default, rclone logs to standard error. This means you can redirect +standard error and still see the normal output of rclone commands (e.g. +`rclone ls`). -Default Off. +By default, rclone will produce `Error` and `Notice` level messages. -### --rc-web-gui +If you use the `-q` flag, rclone will only produce `Error` messages. -Set this flag to serve the default web gui on the same port as rclone. +If you use the `-v` flag, rclone will produce `Error`, `Notice` and +`Info` messages. -Default Off. +If you use the `-vv` flag, rclone will produce `Error`, `Notice`, +`Info` and `Debug` messages. -### --rc-allow-origin +You can also control the log levels with the `--log-level` flag. -Set the allowed Access-Control-Allow-Origin for rc requests. +If you use the `--log-file=FILE` option, rclone will redirect `Error`, +`Info` and `Debug` messages along with standard error to FILE. -Can be used with --rc-web-gui if the rclone is running on different IP than the web-gui. +If you use the `--syslog` flag then rclone will log to syslog and the +`--syslog-facility` control which facility it uses. -Default is IP address on which rc is running. +Rclone prefixes all log messages with their level in capitals, e.g. INFO +which makes it easy to grep the log file for different kinds of +information. -### --rc-web-fetch-url +Exit Code +--------- -Set the URL to fetch the rclone-web-gui files from. +If any errors occur during the command execution, rclone will exit with a +non-zero exit code. This allows scripts to detect when rclone +operations have failed. -Default https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. +During the startup phase, rclone will exit immediately if an error is +detected in the configuration. There will always be a log message +immediately before exiting. -### --rc-web-gui-update +When rclone is running it will accumulate errors as it goes along, and +only exit with a non-zero exit code if (after retries) there were +still failed transfers. For every error counted there will be a high +priority log message (visible with `-q`) showing the message and +which file caused the problem. A high priority message is also shown +when starting a retry so the user can see that any previous error +messages may not be valid after the retry. If rclone has done a retry +it will log a high priority message if the retry was successful. -Set this flag to check and update rclone-webui-react from the rc-web-fetch-url. +### List of exit codes ### + * `0` - success + * `1` - Syntax or usage error + * `2` - Error not otherwise categorised + * `3` - Directory not found + * `4` - File not found + * `5` - Temporary error (one that more retries might fix) (Retry errors) + * `6` - Less serious errors (like 461 errors from dropbox) (NoRetry errors) + * `7` - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors) + * `8` - Transfer exceeded - limit set by --max-transfer reached + * `9` - Operation successful, but no files transferred + * `10` - Duration exceeded - limit set by --max-duration reached -Default Off. +Environment Variables +--------------------- -### --rc-web-gui-force-update +Rclone can be configured entirely using environment variables. These +can be used to set defaults for options or config file entries. -Set this flag to force update rclone-webui-react from the rc-web-fetch-url. +### Options ### -Default Off. +Every option in rclone can have its default set by environment +variable. -### --rc-web-gui-no-open-browser +To find the name of the environment variable, first, take the long +option name, strip the leading `--`, change `-` to `_`, make +upper case and prepend `RCLONE_`. -Set this flag to disable opening browser automatically when using web-gui. +For example, to always set `--stats 5s`, set the environment variable +`RCLONE_STATS=5s`. If you set stats on the command line this will +override the environment variable setting. -Default Off. +Or to always use the trash in drive `--drive-use-trash`, set +`RCLONE_DRIVE_USE_TRASH=true`. -### --rc-job-expire-duration=DURATION +Verbosity is slightly different, the environment variable +equivalent of `--verbose` or `-v` is `RCLONE_VERBOSE=1`, +or for `-vv`, `RCLONE_VERBOSE=2`. -Expire finished async jobs older than DURATION (default 60s). +The same parser is used for the options and the environment variables +so they take exactly the same form. -### --rc-job-expire-interval=DURATION +The options set by environment variables can be seen with the `-vv` flag, e.g. `rclone version -vv`. -Interval duration to check for expired async jobs (default 10s). +### Config file ### -### --rc-no-auth +You can set defaults for values in the config file on an individual +remote basis. The names of the config items are documented in the page +for each backend. -By default rclone will require authorisation to have been set up on -the rc interface in order to use any methods which access any rclone -remotes. Eg `operations/list` is denied as it involved creating a -remote as is `sync/copy`. +To find the name of the environment variable, you need to set, take +`RCLONE_CONFIG_` + name of remote + `_` + name of config file option +and make it all uppercase. +Note one implication here is the remote's name must be +convertible into a valid environment variable name, +so it can only contain letters, digits, or the `_` (underscore) character. -If this is set then no authorisation will be required on the server to -use these methods. The alternative is to use `--rc-user` and -`--rc-pass` and use these credentials in the request. +For example, to configure an S3 remote named `mys3:` without a config +file (using unix ways of setting environment variables): -Default Off. +``` +$ export RCLONE_CONFIG_MYS3_TYPE=s3 +$ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX +$ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX +$ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket +$ rclone listremotes | grep mys3 +mys3: +``` -### --rc-baseurl +Note that if you want to create a remote using environment variables +you must create the `..._TYPE` variable as above. -Prefix for URLs. +Note that the name of a remote created using environment variable is +case insensitive, in contrast to regular remotes stored in config +file as documented [above](#valid-remote-names). +You must write the name in uppercase in the environment variable, but +as seen from example above it will be listed and can be accessed in +lowercase, while you can also refer to the same remote in uppercase: +``` +$ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket +$ rclone lsd MYS3: + -1 2016-09-21 12:54:21 -1 my-bucket +``` -Default is root -### --rc-template +Note that you can only set the options of the immediate backend, +so RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is +a crypt remote based on an S3 remote. However RCLONE_S3_ACCESS_KEY_ID will +set the access key of all remotes using S3, including myS3Crypt. -User-specified template. +Note also that now rclone has [connection strings](#connection-strings), +it is probably easier to use those instead which makes the above example -## Accessing the remote control via the rclone rc command {#api-rc} + rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: -Rclone itself implements the remote control protocol in its `rclone -rc` command. +### Precedence -You can use it like this +The various different methods of backend configuration are read in +this order and the first one with a value is used. -``` -$ rclone rc rc/noop param1=one param2=two -{ - "param1": "one", - "param2": "two" -} -``` +- Parameters in connection strings, e.g. `myRemote,skip_links:` +- Flag values as supplied on the command line, e.g. `--skip-links` +- Remote specific environment vars, e.g. `RCLONE_CONFIG_MYREMOTE_SKIP_LINKS` (see above). +- Backend-specific environment vars, e.g. `RCLONE_LOCAL_SKIP_LINKS`. +- Backend generic environment vars, e.g. `RCLONE_SKIP_LINKS`. +- Config file, e.g. `skip_links = true`. +- Default values, e.g. `false` - these can't be changed. -Run `rclone rc` on its own to see the help for the installed remote -control commands. +So if both `--skip-links` is supplied on the command line and an +environment variable `RCLONE_LOCAL_SKIP_LINKS` is set, the command line +flag will take preference. -## JSON input +The backend configurations set by environment variables can be seen with the `-vv` flag, e.g. `rclone about myRemote: -vv`. -`rclone rc` also supports a `--json` flag which can be used to send -more complicated input parameters. +For non backend configuration the order is as follows: + +- Flag values as supplied on the command line, e.g. `--stats 5s`. +- Environment vars, e.g. `RCLONE_STATS=5s`. +- Default values, e.g. `1m` - these can't be changed. + +### Other environment variables ### + +- `RCLONE_CONFIG_PASS` set to contain your config file password (see [Configuration Encryption](#configuration-encryption) section) +- `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` (or the lowercase versions thereof). + - `HTTPS_PROXY` takes precedence over `HTTP_PROXY` for https requests. + - The environment values may be either a complete URL or a "host[:port]" for, in which case the "http" scheme is assumed. +- `USER` and `LOGNAME` values are used as fallbacks for current username. The primary method for looking up username is OS-specific: Windows API on Windows, real user ID in /etc/passwd on Unix systems. In the documentation the current username is simply referred to as `$USER`. +- `RCLONE_CONFIG_DIR` - rclone **sets** this variable for use in config files and sub processes to point to the directory holding the config file. + +The options set by environment variables can be seen with the `-vv` and `--log-level=DEBUG` flags, e.g. `rclone version -vv`. + +# Configuring rclone on a remote / headless machine # + +Some of the configurations (those involving oauth2) require an +Internet connected web browser. + +If you are trying to set rclone up on a remote or headless box with no +browser available on it (e.g. a NAS or a server in a datacenter) then +you will need to use an alternative means of configuration. There are +two ways of doing it, described below. + +## Configuring using rclone authorize ## + +On the headless box run `rclone` config but answer `N` to the `Use web browser +to automatically authenticate?` question. ``` -$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 } }' rc/noop -{ - "p1": [ - 1, - "2", - null, - 4 - ], - "p2": { - "a": 1, - "b": 2 - } -} +... +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes (default) +n) No +y/n> n +For this to work, you will need rclone available on a machine that has +a web browser available. + +For more help and alternate methods see: https://rclone.org/remote_setup/ + +Execute the following on the machine with the web browser (same rclone +version recommended): + + rclone authorize "amazon cloud drive" + +Then paste the result below: +result> ``` -If the parameter being passed is an object then it can be passed as a -JSON string rather than using the `--json` flag which simplifies the -command line. +Then on your main desktop machine ``` -rclone rc operations/list fs=/tmp remote=test opt='{"showHash": true}' +rclone authorize "amazon cloud drive" +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code +Paste the following into your remote machine ---> +SECRET_TOKEN +<---End paste ``` -Rather than +Then back to the headless box, paste in the code ``` -rclone rc operations/list --json '{"fs": "/tmp", "remote": "test", "opt": {"showHash": true}}' +result> SECRET_TOKEN +-------------------- +[acd12] +client_id = +client_secret = +token = SECRET_TOKEN +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> ``` -## Special parameters - -The rc interface supports some special parameters which apply to -**all** commands. These start with `_` to show they are different. +## Configuring by copying the config file ## -### Running asynchronous jobs with _async = true +Rclone stores all of its config in a single configuration file. This +can easily be copied to configure a remote rclone. -Each rc call is classified as a job and it is assigned its own id. By default -jobs are executed immediately as they are created or synchronously. +So first configure rclone on your desktop machine with -If `_async` has a true value when supplied to an rc call then it will -return immediately with a job id and the task will be run in the -background. The `job/status` call can be used to get information of -the background job. The job can be queried for up to 1 minute after -it has finished. + rclone config -It is recommended that potentially long running jobs, e.g. `sync/sync`, -`sync/copy`, `sync/move`, `operations/purge` are run with the `_async` -flag to avoid any potential problems with the HTTP request and -response timing out. +to set up the config file. -Starting a job with the `_async` flag: +Find the config file by running `rclone config file`, for example ``` -$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 }, "_async": true }' rc/noop -{ - "jobid": 2 -} +$ rclone config file +Configuration file is stored at: +/home/user/.rclone.conf ``` -Query the status to see if the job has finished. For more information -on the meaning of these return parameters see the `job/status` call. +Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and +place it in the correct place (use `rclone config file` on the remote +box to find out where). +## Configuring using SSH Tunnel ## + +Linux and MacOS users can utilize SSH Tunnel to redirect the headless box port 53682 to local machine by using the following command: ``` -$ rclone rc --json '{ "jobid":2 }' job/status -{ - "duration": 0.000124163, - "endTime": "2018-10-27T11:38:07.911245881+01:00", - "error": "", - "finished": true, - "id": 2, - "output": { - "_async": true, - "p1": [ - 1, - "2", - null, - 4 - ], - "p2": { - "a": 1, - "b": 2 - } - }, - "startTime": "2018-10-27T11:38:07.911121728+01:00", - "success": true -} +ssh -L localhost:53682:localhost:53682 username@remote_server ``` - -`job/list` can be used to show the running or recently completed jobs +Then on the headless box run `rclone` config and answer `Y` to the `Use web +browser to automatically authenticate?` question. ``` -$ rclone rc job/list -{ - "jobids": [ - 2 - ] -} +... +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes (default) +n) No +y/n> y ``` +Then copy and paste the auth url `http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx` to the browser on your local machine, complete the auth and it is done. -### Setting config flags with _config +# Filtering, includes and excludes -If you wish to set config (the equivalent of the global flags) for the -duration of an rc call only then pass in the `_config` parameter. +Filter flags determine which files rclone `sync`, `move`, `ls`, `lsl`, +`md5sum`, `sha1sum`, `size`, `delete`, `check` and similar commands +apply to. -This should be in the same format as the `config` key returned by -[options/get](#options-get). +They are specified in terms of path/file name patterns; path/file +lists; file age and size, or presence of a file in a directory. Bucket +based remotes without the concept of directory apply filters to object +key, age and size in an analogous way. -For example, if you wished to run a sync with the `--checksum` -parameter, you would pass this parameter in your JSON blob. +Rclone `purge` does not obey filters. - "_config":{"CheckSum": true} +To test filters without risk of damage to data, apply them to `rclone +ls`, or with the `--dry-run` and `-vv` flags. -If using `rclone rc` this could be passed as +Rclone filter patterns can only be used in filter command line options, not +in the specification of a remote. - rclone rc operations/sync ... _config='{"CheckSum": true}' +E.g. `rclone copy "remote:dir*.jpg" /path/to/dir` does not have a filter effect. +`rclone copy remote:dir /path/to/dir --include "*.jpg"` does. -Any config parameters you don't set will inherit the global defaults -which were set with command line flags or environment variables. +**Important** Avoid mixing any two of `--include...`, `--exclude...` or +`--filter...` flags in an rclone command. The results might not be what +you expect. Instead use a `--filter...` flag. -Note that it is possible to set some values as strings or integers - -see [data types](#data-types) for more info. Here is an example -setting the equivalent of `--buffer-size` in string or integer format. +## Patterns for matching path/file names - "_config":{"BufferSize": "42M"} - "_config":{"BufferSize": 44040192} +### Pattern syntax {#patterns} -If you wish to check the `_config` assignment has worked properly then -calling `options/local` will show what the value got set to. +Here is a formal definition of the pattern syntax, +[examples](#examples) are below. -### Setting filter flags with _filter +Rclone matching rules follow a glob style: -If you wish to set filters for the duration of an rc call only then -pass in the `_filter` parameter. + * matches any sequence of non-separator (/) characters + ** matches any sequence of characters including / separators + ? matches any single non-separator (/) character + [ [ ! ] { character-range } ] + character class (must be non-empty) + { pattern-list } + pattern alternatives + {{ regexp }} + regular expression to match + c matches character c (c != *, **, ?, \, [, {, }) + \c matches reserved character c (c = *, **, ?, \, [, {, }) or character class -This should be in the same format as the `filter` key returned by -[options/get](#options-get). +character-range: -For example, if you wished to run a sync with these flags + c matches character c (c != \, -, ]) + \c matches reserved character c (c = \, -, ]) + lo - hi matches character c for lo <= c <= hi - --max-size 1M --max-age 42s --include "a" --include "b" +pattern-list: -you would pass this parameter in your JSON blob. + pattern { , pattern } + comma-separated (without spaces) patterns - "_filter":{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"} +character classes (see [Go regular expression reference](https://golang.org/pkg/regexp/syntax/)) include: -If using `rclone rc` this could be passed as + Named character classes (e.g. [\d], [^\d], [\D], [^\D]) + Perl character classes (e.g. \s, \S, \w, \W) + ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) - rclone rc ... _filter='{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"}' +regexp for advanced users to insert a regular expression - see [below](#regexp) for more info: -Any filter parameters you don't set will inherit the global defaults -which were set with command line flags or environment variables. + Any re2 regular expression not containing `}}` -Note that it is possible to set some values as strings or integers - -see [data types](#data-types) for more info. Here is an example -setting the equivalent of `--buffer-size` in string or integer format. +If the filter pattern starts with a `/` then it only matches +at the top level of the directory tree, +**relative to the root of the remote** (not necessarily the root +of the drive). If it does not start with `/` then it is matched +starting at the **end of the path/file name** but it only matches +a complete path element - it must match from a `/` +separator or the beginning of the path/file. - "_filter":{"MinSize": "42M"} - "_filter":{"MinSize": 44040192} + file.jpg - matches "file.jpg" + - matches "directory/file.jpg" + - doesn't match "afile.jpg" + - doesn't match "directory/afile.jpg" + /file.jpg - matches "file.jpg" in the root directory of the remote + - doesn't match "afile.jpg" + - doesn't match "directory/file.jpg" -If you wish to check the `_filter` assignment has worked properly then -calling `options/local` will show what the value got set to. +The top level of the remote might not be the top level of the drive. -### Assigning operations to groups with _group = value +E.g. for a Microsoft Windows local directory structure -Each rc call has its own stats group for tracking its metrics. By default -grouping is done by the composite group name from prefix `job/` and id of the -job like so `job/1`. + F: + ├── bkp + ├── data + │ ├── excl + │ │ ├── 123.jpg + │ │ └── 456.jpg + │ ├── incl + │ │ └── document.pdf -If `_group` has a value then stats for that request will be grouped under that -value. This allows caller to group stats under their own name. +To copy the contents of folder `data` into folder `bkp` excluding the contents of subfolder +`excl`the following command treats `F:\data` and `F:\bkp` as top level for filtering. -Stats for specific group can be accessed by passing `group` to `core/stats`: +`rclone copy F:\data\ F:\bkp\ --exclude=/excl/**` -``` -$ rclone rc --json '{ "group": "job/1" }' core/stats -{ - "speed": 12345 - ... -} -``` +**Important** Use `/` in path/file name patterns and not `\` even if +running on Microsoft Windows. -## Data types {#data-types} +Simple patterns are case sensitive unless the `--ignore-case` flag is used. -When the API returns types, these will mostly be straight forward -integer, string or boolean types. +Without `--ignore-case` (default) -However some of the types returned by the [options/get](#options-get) -call and taken by the [options/set](#options-set) calls as well as the -`vfsOpt`, `mountOpt` and the `_config` parameters. + potato - matches "potato" + - doesn't match "POTATO" -- `Duration` - these are returned as an integer duration in - nanoseconds. They may be set as an integer, or they may be set with - time string, eg "5s". See the [options section](https://rclone.org/docs/#options) for - more info. -- `Size` - these are returned as an integer number of bytes. They may - be set as an integer or they may be set with a size suffix string, - eg "10M". See the [options section](https://rclone.org/docs/#options) for more info. -- Enumerated type (such as `CutoffMode`, `DumpFlags`, `LogLevel`, - `VfsCacheMode` - these will be returned as an integer and may be set - as an integer but more conveniently they can be set as a string, eg - "HARD" for `CutoffMode` or `DEBUG` for `LogLevel`. -- `BandwidthSpec` - this will be set and returned as a string, eg - "1M". +With `--ignore-case` -## Specifying remotes to work on + potato - matches "potato" + - matches "POTATO" -Remotes are specified with the `fs=`, `srcFs=`, `dstFs=` -parameters depending on the command being used. +## Using regular expressions in filter patterns {#regexp} -The parameters can be a string as per the rest of rclone, eg -`s3:bucket/path` or `:sftp:/my/dir`. They can also be specified as -JSON blobs. +The syntax of filter patterns is glob style matching (like `bash` +uses) to make things easy for users. However this does not provide +absolute control over the matching, so for advanced users rclone also +provides a regular expression syntax. -If specifying a JSON blob it should be a object mapping strings to -strings. These values will be used to configure the remote. There are -3 special values which may be set: +The regular expressions used are as defined in the [Go regular +expression reference](https://golang.org/pkg/regexp/syntax/). Regular +expressions should be enclosed in `{{` `}}`. They will match only the +last path segment if the glob doesn't start with `/` or the whole path +name if it does. Note that rclone does not attempt to parse the +supplied regular expression, meaning that using any regular expression +filter will prevent rclone from using [directory filter rules](#directory_filter), +as it will instead check every path against +the supplied regular expression(s). -- `type` - set to `type` to specify a remote called `:type:` -- `_name` - set to `name` to specify a remote called `name:` -- `_root` - sets the root of the remote - may be empty +Here is how the `{{regexp}}` is transformed into an full regular +expression to match the entire path: -One of `_name` or `type` should normally be set. If the `local` -backend is desired then `type` should be set to `local`. If `_root` -isn't specified then it defaults to the root of the remote. + {{regexp}} becomes (^|/)(regexp)$ + /{{regexp}} becomes ^(regexp)$ -For example this JSON is equivalent to `remote:/tmp` +Regexp syntax can be mixed with glob syntax, for example -``` -{ - "_name": "remote", - "_path": "/tmp" -} -``` + *.{{jpe?g}} to match file.jpg, file.jpeg but not file.png -And this is equivalent to `:sftp,host='example.com':/tmp` +You can also use regexp flags - to set case insensitive, for example -``` -{ - "type": "sftp", - "host": "example.com", - "_path": "/tmp" -} -``` + *.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png -And this is equivalent to `/tmp/dir` +Be careful with wildcards in regular expressions - you don't want them +to match path separators normally. To match any file name starting +with `start` and ending with `end` write -``` -{ - type = "local", - _ path = "/tmp/dir" -} -``` + {{start[^/]*end\.jpg}} -## Supported commands +Not -### backend/command: Runs a backend command. {#backend-command} + {{start.*end\.jpg}} -This takes the following parameters: +Which will match a directory called `start` with a file called +`end.jpg` in it as the `.*` will match `/` characters. -- command - a string with the command name -- fs - a remote name string e.g. "drive:" -- arg - a list of arguments for the backend command -- opt - a map of string to string of options +Note that you can use `-vv --dump filters` to show the filter patterns +in regexp format - rclone implements the glob patterns by transforming +them into regular expressions. -Returns: +## Filter pattern examples {#examples} -- result - result from the backend command +| Description | Pattern | Matches | Does not match | +| ----------- |-------- | ------- | -------------- | +| Wildcard | `*.jpg` | `/file.jpg` | `/file.png` | +| | | `/dir/file.jpg` | `/dir/file.png` | +| Rooted | `/*.jpg` | `/file.jpg` | `/file.png` | +| | | `/file2.jpg` | `/dir/file.jpg` | +| Alternates | `*.{jpg,png}` | `/file.jpg` | `/file.gif` | +| | | `/dir/file.png` | `/dir/file.gif` | +| Path Wildcard | `dir/**` | `/dir/anyfile` | `file.png` | +| | | `/subdir/dir/subsubdir/anyfile` | `/subdir/file.png` | +| Any Char | `*.t?t` | `/file.txt` | `/file.qxt` | +| | | `/dir/file.tzt` | `/dir/file.png` | +| Range | `*.[a-z]` | `/file.a` | `/file.0` | +| | | `/dir/file.b` | `/dir/file.1` | +| Escape | `*.\?\?\?` | `/file.???` | `/file.abc` | +| | | `/dir/file.???` | `/dir/file.def` | +| Class | `*.\d\d\d` | `/file.012` | `/file.abc` | +| | | `/dir/file.345` | `/dir/file.def` | +| Regexp | `*.{{jpe?g}}` | `/file.jpeg` | `/file.png` | +| | | `/dir/file.jpg` | `/dir/file.jpeeg` | +| Rooted Regexp | `/{{.*\.jpe?g}}` | `/file.jpeg` | `/file.png` | +| | | `/file.jpg` | `/dir/file.jpg` | -Example: +## How filter rules are applied to files {#how-filter-rules-work} - rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 +Rclone path/file name filters are made up of one or more of the following flags: -Returns + * `--include` + * `--include-from` + * `--exclude` + * `--exclude-from` + * `--filter` + * `--filter-from` -``` -{ - "result": { - "arg": [ - "path1", - "path2" - ], - "name": "noop", - "opt": { - "blue": "", - "echo": "yes" - } - } -} -``` +There can be more than one instance of individual flags. -Note that this is the direct equivalent of using this "backend" -command: +Rclone internally uses a combined list of all the include and exclude +rules. The order in which rules are processed can influence the result +of the filter. - rclone backend noop . -o echo=yes -o blue path1 path2 +All flags of the same type are processed together in the order +above, regardless of what order the different types of flags are +included on the command line. -Note that arguments must be preceded by the "-a" flag +Multiple instances of the same flag are processed from left +to right according to their position in the command line. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more information. +To mix up the order of processing includes and excludes use `--filter...` +flags. -**Authentication is required for this call.** +Within `--include-from`, `--exclude-from` and `--filter-from` flags +rules are processed from top to bottom of the referenced file. -### cache/expire: Purge a remote from cache {#cache-expire} +If there is an `--include` or `--include-from` flag specified, rclone +implies a `- **` rule which it adds to the bottom of the internal rule +list. Specifying a `+` rule with a `--filter...` flag does not imply +that rule. -Purge a remote from the cache backend. Supports either a directory or a file. -Params: - - remote = path to remote (required) - - withData = true/false to delete cached data (chunks) as well (optional) +Each path/file name passed through rclone is matched against the +combined filter list. At first match to a rule the path/file name +is included or excluded and no further filter rules are processed for +that path/file. -Eg +If rclone does not find a match, after testing against all rules +(including the implied rule if appropriate), the path/file name +is included. - rclone rc cache/expire remote=path/to/sub/folder/ - rclone rc cache/expire remote=/ withData=true +Any path/file included at that stage is processed by the rclone +command. -### cache/fetch: Fetch file chunks {#cache-fetch} +`--files-from` and `--files-from-raw` flags over-ride and cannot be +combined with other filter options. -Ensure the specified file chunks are cached on disk. +To see the internal combined rule list, in regular expression form, +for a command add the `--dump filters` flag. Running an rclone command +with `--dump filters` and `-vv` flags lists the internal filter elements +and shows how they are applied to each source path/file. There is not +currently a means provided to pass regular expression filter options into +rclone directly though character class filter rules contain character +classes. [Go regular expression reference](https://golang.org/pkg/regexp/syntax/) -The chunks= parameter specifies the file chunks to check. -It takes a comma separated list of array slice indices. -The slice indices are similar to Python slices: start[:end] +### How filter rules are applied to directories {#directory_filter} -start is the 0 based chunk number from the beginning of the file -to fetch inclusive. end is 0 based chunk number from the beginning -of the file to fetch exclusive. -Both values can be negative, in which case they count from the back -of the file. The value "-5:" represents the last 5 chunks of a file. +Rclone commands are applied to path/file names not +directories. The entire contents of a directory can be matched +to a filter by the pattern `directory/*` or recursively by +`directory/**`. -Some valid examples are: -":5,-5:" -> the first and last five chunks -"0,-2" -> the first and the second last chunk -"0:10" -> the first ten chunks +Directory filter rules are defined with a closing `/` separator. -Any parameter with a key that starts with "file" can be used to -specify files to fetch, e.g. +E.g. `/directory/subdirectory/` is an rclone directory filter rule. - rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye +Rclone commands can use directory filter rules to determine whether they +recurse into subdirectories. This potentially optimises access to a remote +by avoiding listing unnecessary directories. Whether optimisation is +desirable depends on the specific filter rules and source remote content. -File names will automatically be encrypted when the a crypt remote -is used on top of the cache. +If any [regular expression filters](#regexp) are in use, then no +directory recursion optimisation is possible, as rclone must check +every path against the supplied regular expression(s). -### cache/stats: Get cache stats {#cache-stats} +Directory recursion optimisation occurs if either: -Show statistics for the cache remote. +* A source remote does not support the rclone `ListR` primitive. local, +sftp, Microsoft OneDrive and WebDAV do not support `ListR`. Google +Drive and most bucket type storage do. [Full list](https://rclone.org/overview/#optional-features) -### config/create: create the config for a remote. {#config-create} +* On other remotes (those that support `ListR`), if the rclone command is not naturally recursive, and +provided it is not run with the `--fast-list` flag. `ls`, `lsf -R` and +`size` are naturally recursive but `sync`, `copy` and `move` are not. -This takes the following parameters: +* Whenever the `--disable ListR` flag is applied to an rclone command. -- name - name of remote -- parameters - a map of \{ "key": "value" \} pairs -- type - type of the new remote -- opt - a dictionary of options to control the configuration - - obscure - declare passwords are plain and need obscuring - - noObscure - declare passwords are already obscured and don't need obscuring - - nonInteractive - don't interact with a user, return questions - - continue - continue the config process with an answer - - all - ask all the config questions not just the post config ones - - state - state to restart with - used with continue - - result - result to restart with - used with continue +Rclone commands imply directory filter rules from path/file filter +rules. To view the directory filter rules rclone has implied for a +command specify the `--dump filters` flag. +E.g. for an include rule -See the [config create](https://rclone.org/commands/rclone_config_create/) command for more information on the above. + /a/*.jpg -**Authentication is required for this call.** +Rclone implies the directory include rule -### config/delete: Delete a remote in the config file. {#config-delete} + /a/ -Parameters: +Directory filter rules specified in an rclone command can limit +the scope of an rclone command but path/file filters still have +to be specified. -- name - name of remote to delete +E.g. `rclone ls remote: --include /directory/` will not match any +files. Because it is an `--include` option the `--exclude **` rule +is implied, and the `/directory/` pattern serves only to optimise +access to the remote by ignoring everything outside of that directory. -See the [config delete](https://rclone.org/commands/rclone_config_delete/) command for more information on the above. +E.g. `rclone ls remote: --filter-from filter-list.txt` with a file +`filter-list.txt`: -**Authentication is required for this call.** + - /dir1/ + - /dir2/ + + *.pdf + - ** -### config/dump: Dumps the config file. {#config-dump} +All files in directories `dir1` or `dir2` or their subdirectories +are completely excluded from the listing. Only files of suffix +`pdf` in the root of `remote:` or its subdirectories are listed. +The `- **` rule prevents listing of any path/files not previously +matched by the rules above. -Returns a JSON object: -- key: value +Option `exclude-if-present` creates a directory exclude rule based +on the presence of a file in a directory and takes precedence over +other rclone directory filter rules. -Where keys are remote names and values are the config parameters. +When using pattern list syntax, if a pattern item contains either +`/` or `**`, then rclone will not able to imply a directory filter rule +from this pattern list. -See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. +E.g. for an include rule -**Authentication is required for this call.** + {dir1/**,dir2/**} -### config/get: Get a remote in the config file. {#config-get} +Rclone will match files below directories `dir1` or `dir2` only, +but will not be able to use this filter to exclude a directory `dir3` +from being traversed. -Parameters: +Directory recursion optimisation may affect performance, but normally +not the result. One exception to this is sync operations with option +`--create-empty-src-dirs`, where any traversed empty directories will +be created. With the pattern list example `{dir1/**,dir2/**}` above, +this would create an empty directory `dir3` on destination (when it exists +on source). Changing the filter to `{dir1,dir2}/**`, or splitting it into +two include rules `--include dir1/** --include dir2/**`, will match the +same files while also filtering directories, with the result that an empty +directory `dir3` will no longer be created. -- name - name of remote to get +### `--exclude` - Exclude files matching pattern -See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. +Excludes path/file names from an rclone command based on a single exclude +rule. -**Authentication is required for this call.** +This flag can be repeated. See above for the order filter flags are +processed in. -### config/listremotes: Lists the remotes in the config file. {#config-listremotes} +`--exclude` should not be used with `--include`, `--include-from`, +`--filter` or `--filter-from` flags. -Returns -- remotes - array of remote names +`--exclude` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -See the [listremotes](https://rclone.org/commands/rclone_listremotes/) command for more information on the above. +E.g. `rclone ls remote: --exclude *.bak` excludes all .bak files +from listing. -**Authentication is required for this call.** +E.g. `rclone size remote: "--exclude /dir/**"` returns the total size of +all files on `remote:` excluding those in root directory `dir` and sub +directories. -### config/password: password the config for a remote. {#config-password} +E.g. on Microsoft Windows `rclone ls remote: --exclude "*\[{JP,KR,HK}\]*"` +lists the files in `remote:` without `[JP]` or `[KR]` or `[HK]` in +their name. Quotes prevent the shell from interpreting the `\` +characters.`\` characters escape the `[` and `]` so an rclone filter +treats them literally rather than as a character-range. The `{` and `}` +define an rclone pattern list. For other operating systems single quotes are +required ie `rclone ls remote: --exclude '*\[{JP,KR,HK}\]*'` -This takes the following parameters: +### `--exclude-from` - Read exclude patterns from file -- name - name of remote -- parameters - a map of \{ "key": "value" \} pairs +Excludes path/file names from an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. +For an example `exclude-file.txt`: -See the [config password](https://rclone.org/commands/rclone_config_password/) command for more information on the above. + # a sample exclude rule file + *.bak + file2.jpg -**Authentication is required for this call.** +`rclone ls remote: --exclude-from exclude-file.txt` lists the files on +`remote:` except those named `file2.jpg` or with a suffix `.bak`. That is +equivalent to `rclone ls remote: --exclude file2.jpg --exclude "*.bak"`. -### config/providers: Shows how providers are configured in the config file. {#config-providers} +This flag can be repeated. See above for the order filter flags are +processed in. -Returns a JSON object: -- providers - array of objects +The `--exclude-from` flag is useful where multiple exclude filter rules +are applied to an rclone command. -See the [config providers](https://rclone.org/commands/rclone_config_providers/) command for more information on the above. +`--exclude-from` should not be used with `--include`, `--include-from`, +`--filter` or `--filter-from` flags. -**Authentication is required for this call.** +`--exclude-from` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -### config/setpath: Set the path of the config file {#config-setpath} +`--exclude-from` followed by `-` reads filter rules from standard input. -Parameters: +### `--include` - Include files matching pattern -- path - path to the config file to use +Adds a single include rule based on path/file names to an rclone +command. -**Authentication is required for this call.** +This flag can be repeated. See above for the order filter flags are +processed in. -### config/update: update the config for a remote. {#config-update} +`--include` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -This takes the following parameters: +`--include` implies `--exclude **` at the end of an rclone internal +filter list. Therefore if you mix `--include` and `--include-from` +flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, +you must use include rules for all the files you want in the include +statement. For more flexibility use the `--filter-from` flag. -- name - name of remote -- parameters - a map of \{ "key": "value" \} pairs -- opt - a dictionary of options to control the configuration - - obscure - declare passwords are plain and need obscuring - - noObscure - declare passwords are already obscured and don't need obscuring - - nonInteractive - don't interact with a user, return questions - - continue - continue the config process with an answer - - all - ask all the config questions not just the post config ones - - state - state to restart with - used with continue - - result - result to restart with - used with continue +E.g. `rclone ls remote: --include "*.{png,jpg}"` lists the files on +`remote:` with suffix `.png` and `.jpg`. All other files are excluded. +E.g. multiple rclone copy commands can be combined with `--include` and a +pattern-list. -See the [config update](https://rclone.org/commands/rclone_config_update/) command for more information on the above. + rclone copy /vol1/A remote:A + rclone copy /vol1/B remote:B -**Authentication is required for this call.** +is equivalent to: -### core/bwlimit: Set the bandwidth limit. {#core-bwlimit} + rclone copy /vol1 remote: --include "{A,B}/**" -This sets the bandwidth limit to the string passed in. This should be -a single bandwidth limit entry or a pair of upload:download bandwidth. +E.g. `rclone ls remote:/wheat --include "??[^[:punct:]]*"` lists the +files `remote:` directory `wheat` (and subdirectories) whose third +character is not punctuation. This example uses +an [ASCII character class](https://golang.org/pkg/regexp/syntax/). -Eg +### `--include-from` - Read include patterns from file - rclone rc core/bwlimit rate=off - { - "bytesPerSecond": -1, - "bytesPerSecondTx": -1, - "bytesPerSecondRx": -1, - "rate": "off" - } - rclone rc core/bwlimit rate=1M - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 1048576, - "rate": "1M" - } - rclone rc core/bwlimit rate=1M:100k - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 131072, - "rate": "1M" - } +Adds path/file names to an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. +For an example `include-file.txt`: -If the rate parameter is not supplied then the bandwidth is queried + # a sample include rule file + *.jpg + file2.avi - rclone rc core/bwlimit - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 1048576, - "rate": "1M" - } +`rclone ls remote: --include-from include-file.txt` lists the files on +`remote:` with name `file2.avi` or suffix `.jpg`. That is equivalent to +`rclone ls remote: --include file2.avi --include "*.jpg"`. -The format of the parameter is exactly the same as passed to --bwlimit -except only one bandwidth may be specified. +This flag can be repeated. See above for the order filter flags are +processed in. -In either case "rate" is returned as a human-readable string, and -"bytesPerSecond" is returned as a number. +The `--include-from` flag is useful where multiple include filter rules +are applied to an rclone command. -### core/command: Run a rclone terminal command over rc. {#core-command} +`--include-from` implies `--exclude **` at the end of an rclone internal +filter list. Therefore if you mix `--include` and `--include-from` +flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, +you must use include rules for all the files you want in the include +statement. For more flexibility use the `--filter-from` flag. -This takes the following parameters: +`--exclude-from` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -- command - a string with the command name. -- arg - a list of arguments for the backend command. -- opt - a map of string to string of options. -- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). - - Defaults to "COMBINED_OUTPUT" if not set. - - The STREAM returnTypes will write the output to the body of the HTTP message. - - The COMBINED_OUTPUT will write the output to the "result" parameter. +`--exclude-from` followed by `-` reads filter rules from standard input. -Returns: +### `--filter` - Add a file-filtering rule -- result - result from the backend command. - - Only set when using returnType "COMBINED_OUTPUT". -- error - set if rclone exits with an error code. -- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). +Specifies path/file names to an rclone command, based on a single +include or exclude rule, in `+` or `-` format. -Example: +This flag can be repeated. See above for the order filter flags are +processed in. - rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 - rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 +`--filter +` differs from `--include`. In the case of `--include` rclone +implies an `--exclude *` rule which it adds to the bottom of the internal rule +list. `--filter...+` does not imply +that rule. -Returns: +`--filter` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -``` -{ - "error": false, - "result": "" -} +`--filter` should not be used with `--include`, `--include-from`, +`--exclude` or `--exclude-from` flags. -OR -{ - "error": true, - "result": "" -} +E.g. `rclone ls remote: --filter "- *.bak"` excludes all `.bak` files +from a list of `remote:`. -``` +### `--filter-from` - Read filtering patterns from a file -**Authentication is required for this call.** +Adds path/file names to an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. Include +rules start with `+ ` and exclude rules with `- `. `!` clears existing +rules. Rules are processed in the order they are defined. -### core/gc: Runs a garbage collection. {#core-gc} +This flag can be repeated. See above for the order filter flags are +processed in. -This tells the go runtime to do a garbage collection run. It isn't -necessary to call this normally, but it can be useful for debugging -memory problems. +Arrange the order of filter rules with the most restrictive first and +work down. -### core/group-list: Returns list of stats. {#core-group-list} +E.g. for `filter-file.txt`: -This returns list of stats groups currently in memory. + # a sample filter rule file + - secret*.jpg + + *.jpg + + *.png + + file2.avi + - /dir/Trash/** + + /dir/** + # exclude everything else + - * -Returns the following values: -``` -{ - "groups": an array of group names: - [ - "group1", - "group2", - ... - ] -} -``` +`rclone ls remote: --filter-from filter-file.txt` lists the path/files on +`remote:` including all `jpg` and `png` files, excluding any +matching `secret*.jpg` and including `file2.avi`. It also includes +everything in the directory `dir` at the root of `remote`, except +`remote:dir/Trash` which it excludes. Everything else is excluded. -### core/memstats: Returns the memory statistics {#core-memstats} -This returns the memory statistics of the running program. What the values mean -are explained in the go docs: https://golang.org/pkg/runtime/#MemStats +E.g. for an alternative `filter-file.txt`: -The most interesting values for most people are: + - secret*.jpg + + *.jpg + + *.png + + file2.avi + - * -- HeapAlloc - this is the amount of memory rclone is actually using -- HeapSys - this is the amount of memory rclone has obtained from the OS -- Sys - this is the total amount of memory requested from the OS - - It is virtual memory so may include unused memory +Files `file1.jpg`, `file3.png` and `file2.avi` are listed whilst +`secret17.jpg` and files without the suffix .jpg` or `.png` are excluded. -### core/obscure: Obscures a string passed in. {#core-obscure} +E.g. for an alternative `filter-file.txt`: -Pass a clear string and rclone will obscure it for the config file: -- clear - string + + *.jpg + + *.gif + ! + + 42.doc + - * -Returns: -- obscured - string +Only file 42.doc is listed. Prior rules are cleared by the `!`. -### core/pid: Return PID of current process {#core-pid} +### `--files-from` - Read list of source-file names -This returns PID of current process. -Useful for stopping rclone process. +Adds path/files to an rclone command from a list in a named file. +Rclone processes the path/file names in the order of the list, and +no others. -### core/quit: Terminates the app. {#core-quit} +Other filter flags (`--include`, `--include-from`, `--exclude`, +`--exclude-from`, `--filter` and `--filter-from`) are ignored when +`--files-from` is used. -(Optional) Pass an exit code to be used for terminating the app: -- exitCode - int +`--files-from` expects a list of files as its input. Leading or +trailing whitespace is stripped from the input lines. Lines starting +with `#` or `;` are ignored. -### core/stats: Returns stats about current transfers. {#core-stats} +Rclone commands with a `--files-from` flag traverse the remote, +treating the names in `--files-from` as a set of filters. -This returns all available stats: +If the `--no-traverse` and `--files-from` flags are used together +an rclone command does not traverse the remote. Instead it addresses +each path/file named in the file individually. For each path/file name, that +requires typically 1 API call. This can be efficient for a short `--files-from` +list and a remote containing many files. - rclone rc core/stats +Rclone commands do not error if any names in the `--files-from` file are +missing from the source remote. -If group is not provided then summed up stats for all groups will be -returned. +The `--files-from` flag can be repeated in a single rclone command to +read path/file names from more than one file. The files are read from left +to right along the command line. -Parameters +Paths within the `--files-from` file are interpreted as starting +with the root specified in the rclone command. Leading `/` separators are +ignored. See [--files-from-raw](#files-from-raw-read-list-of-source-file-names-without-any-processing) if +you need the input to be processed in a raw manner. -- group - name of the stats group (string) +E.g. for a file `files-from.txt`: -Returns the following values: + # comment + file1.jpg + subdir/file2.jpg -``` -{ - "bytes": total transferred bytes since the start of the group, - "checks": number of files checked, - "deletes" : number of files deleted, - "elapsedTime": time in floating point seconds since rclone was started, - "errors": number of errors, - "eta": estimated time in seconds until the group completes, - "fatalError": boolean whether there has been at least one fatal error, - "lastError": last error string, - "renames" : number of files renamed, - "retryError": boolean showing whether there has been at least one non-NoRetryError, - "speed": average speed in bytes per second since start of the group, - "totalBytes": total number of bytes in the group, - "totalChecks": total number of checks in the group, - "totalTransfers": total number of transfers in the group, - "transferTime" : total time spent on running jobs, - "transfers": number of transferred files, - "transferring": an array of currently active file transfers: - [ - { - "bytes": total transferred bytes for this file, - "eta": estimated time in seconds until file transfer completion - "name": name of the file, - "percentage": progress of the file transfer in percent, - "speed": average speed over the whole transfer in bytes per second, - "speedAvg": current speed in bytes per second as an exponentially weighted moving average, - "size": size of the file in bytes - } - ], - "checking": an array of names of currently active file checks - [] -} -``` -Values for "transferring", "checking" and "lastError" are only assigned if data is available. -The value for "eta" is null if an eta cannot be determined. +`rclone copy --files-from files-from.txt /home/me/pics remote:pics` +copies the following, if they exist, and only those files. -### core/stats-delete: Delete stats group. {#core-stats-delete} + /home/me/pics/file1.jpg → remote:pics/file1.jpg + /home/me/pics/subdir/file2.jpg → remote:pics/subdir/file2.jpg -This deletes entire stats group. +E.g. to copy the following files referenced by their absolute paths: -Parameters + /home/user1/42 + /home/user1/dir/ford + /home/user2/prefect -- group - name of the stats group (string) +First find a common subdirectory - in this case `/home` +and put the remaining files in `files-from.txt` with or without +leading `/`, e.g. -### core/stats-reset: Reset stats. {#core-stats-reset} + user1/42 + user1/dir/ford + user2/prefect -This clears counters, errors and finished transfers for all stats or specific -stats group if group is provided. +Then copy these to a remote: -Parameters + rclone copy --files-from files-from.txt /home remote:backup -- group - name of the stats group (string) +The three files are transferred as follows: -### core/transferred: Returns stats about completed transfers. {#core-transferred} + /home/user1/42 → remote:backup/user1/important + /home/user1/dir/ford → remote:backup/user1/dir/file + /home/user2/prefect → remote:backup/user2/stuff -This returns stats about completed transfers: +Alternatively if `/` is chosen as root `files-from.txt` will be: - rclone rc core/transferred + /home/user1/42 + /home/user1/dir/ford + /home/user2/prefect -If group is not provided then completed transfers for all groups will be -returned. +The copy command will be: -Note only the last 100 completed transfers are returned. + rclone copy --files-from files-from.txt / remote:backup -Parameters +Then there will be an extra `home` directory on the remote: -- group - name of the stats group (string) + /home/user1/42 → remote:backup/home/user1/42 + /home/user1/dir/ford → remote:backup/home/user1/dir/ford + /home/user2/prefect → remote:backup/home/user2/prefect -Returns the following values: -``` -{ - "transferred": an array of completed transfers (including failed ones): - [ - { - "name": name of the file, - "size": size of the file in bytes, - "bytes": total transferred bytes for this file, - "checked": if the transfer is only checked (skipped, deleted), - "timestamp": integer representing millisecond unix epoch, - "error": string description of the error (empty if successful), - "jobid": id of the job that this transfer belongs to - } - ] -} -``` +### `--files-from-raw` - Read list of source-file names without any processing -### core/version: Shows the current version of rclone and the go runtime. {#core-version} +This flag is the same as `--files-from` except that input is read in a +raw manner. Lines with leading / trailing whitespace, and lines starting +with `;` or `#` are read without any processing. [rclone lsf](https://rclone.org/commands/rclone_lsf/) has +a compatible format that can be used to export file lists from remotes for +input to `--files-from-raw`. -This shows the current version of go and the go runtime: +### `--ignore-case` - make searches case insensitive -- version - rclone version, e.g. "v1.53.0" -- decomposed - version number as [major, minor, patch] -- isGit - boolean - true if this was compiled from the git version -- isBeta - boolean - true if this is a beta version -- os - OS in use as according to Go -- arch - cpu architecture in use according to Go -- goVersion - version of Go runtime in use -- linking - type of rclone executable (static or dynamic) -- goTags - space separated build tags or "none" +By default, rclone filter patterns are case sensitive. The `--ignore-case` +flag makes all of the filters patterns on the command line case +insensitive. -### debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. {#debug-set-block-profile-rate} +E.g. `--include "zaphod.txt"` does not match a file `Zaphod.txt`. With +`--ignore-case` a match is made. -SetBlockProfileRate controls the fraction of goroutine blocking events -that are reported in the blocking profile. The profiler aims to sample -an average of one blocking event per rate nanoseconds spent blocked. +## Quoting shell metacharacters -To include every blocking event in the profile, pass rate = 1. To turn -off profiling entirely, pass rate <= 0. +Rclone commands with filter patterns containing shell metacharacters may +not as work as expected in your shell and may require quoting. -After calling this you can use this to see the blocking profile: +E.g. linux, OSX (`*` metacharacter) - go tool pprof http://localhost:5572/debug/pprof/block + * `--include \*.jpg` + * `--include '*.jpg'` + * `--include='*.jpg'` -Parameters: +Microsoft Windows expansion is done by the command, not shell, so +`--include *.jpg` does not require quoting. -- rate - int +If the rclone error +`Command .... needs .... arguments maximum: you provided .... non flag arguments:` +is encountered, the cause is commonly spaces within the name of a +remote or flag value. The fix then is to quote values containing spaces. -### debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. {#debug-set-gc-percent} +## Other filters -SetGCPercent sets the garbage collection target percentage: a collection is triggered -when the ratio of freshly allocated data to live data remaining after the previous collection -reaches this percentage. SetGCPercent returns the previous setting. The initial setting is the -value of the GOGC environment variable at startup, or 100 if the variable is not set. +### `--min-size` - Don't transfer any file smaller than this -This setting may be effectively reduced in order to maintain a memory limit. -A negative percentage effectively disables garbage collection, unless the memory limit is reached. +Controls the minimum size file within the scope of an rclone command. +Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. -See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. +E.g. `rclone ls remote: --min-size 50k` lists files on `remote:` of 50 KiB +size or larger. -Parameters: +See [the size option docs](https://rclone.org/docs/#size-option) for more info. -- gc-percent - int +### `--max-size` - Don't transfer any file larger than this -### debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. {#debug-set-mutex-profile-fraction} +Controls the maximum size file within the scope of an rclone command. +Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. -SetMutexProfileFraction controls the fraction of mutex contention -events that are reported in the mutex profile. On average 1/rate -events are reported. The previous rate is returned. +E.g. `rclone ls remote: --max-size 1G` lists files on `remote:` of 1 GiB +size or smaller. -To turn off profiling entirely, pass rate 0. To just read the current -rate, pass rate < 0. (For n>1 the details of sampling may change.) +See [the size option docs](https://rclone.org/docs/#size-option) for more info. -Once this is set you can look use this to profile the mutex contention: +### `--max-age` - Don't transfer any file older than this - go tool pprof http://localhost:5572/debug/pprof/mutex +Controls the maximum age of files within the scope of an rclone command. -Parameters: +`--max-age` applies only to files and not to directories. -- rate - int +E.g. `rclone ls remote: --max-age 2d` lists files on `remote:` of 2 days +old or less. -Results: +See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. -- previousRate - int +### `--min-age` - Don't transfer any file younger than this -### debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. {#debug-set-soft-memory-limit} +Controls the minimum age of files within the scope of an rclone command. +(see `--max-age` for valid formats) -SetMemoryLimit provides the runtime with a soft memory limit. +`--min-age` applies only to files and not to directories. -The runtime undertakes several processes to try to respect this memory limit, including -adjustments to the frequency of garbage collections and returning memory to the underlying -system more aggressively. This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) is executed). +E.g. `rclone ls remote: --min-age 2d` lists files on `remote:` of 2 days +old or more. -The input limit is provided as bytes, and includes all memory mapped, managed, and not -released by the Go runtime. Notably, it does not account for space used by the Go binary -and memory external to Go, such as memory managed by the underlying system on behalf of -the process, or memory managed by non-Go code inside the same process. -Examples of excluded memory sources include: OS kernel memory held on behalf of the process, -memory allocated by C code, and memory mapped by syscall.Mmap (because it is not managed by the Go runtime). +See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. -A zero limit or a limit that's lower than the amount of memory used by the Go runtime may cause -the garbage collector to run nearly continuously. However, the application may still make progress. +## Other flags -The memory limit is always respected by the Go runtime, so to effectively disable this behavior, -set the limit very high. math.MaxInt64 is the canonical value for disabling the limit, but values -much greater than the available memory on the underlying system work just as well. +### `--delete-excluded` - Delete files on dest excluded from sync -See https://go.dev/doc/gc-guide for a detailed guide explaining the soft memory limit in more detail, -as well as a variety of common use-cases and scenarios. +**Important** this flag is dangerous to your data - use with `--dry-run` +and `-v` first. -SetMemoryLimit returns the previously set memory limit. A negative input does not adjust the limit, -and allows for retrieval of the currently set memory limit. +In conjunction with `rclone sync`, `--delete-excluded` deletes any files +on the destination which are excluded from the command. -Parameters: +E.g. the scope of `rclone sync --interactive A: B:` can be restricted: -- mem-limit - int + rclone --min-size 50k --delete-excluded sync A: B: -### fscache/clear: Clear the Fs cache. {#fscache-clear} +All files on `B:` which are less than 50 KiB are deleted +because they are excluded from the rclone sync command. -This clears the fs cache. This is where remotes created from backends -are cached for a short while to make repeated rc calls more efficient. +### `--dump filters` - dump the filters to the output -If you change the parameters of a backend then you may want to call -this to clear an existing remote out of the cache before re-creating -it. +Dumps the defined filters to standard output in regular expression +format. -**Authentication is required for this call.** +Useful for debugging. -### fscache/entries: Returns the number of entries in the fs cache. {#fscache-entries} +## Exclude directory based on a file -This returns the number of entries in the fs cache. +The `--exclude-if-present` flag controls whether a directory is +within the scope of an rclone command based on the presence of a +named file within it. The flag can be repeated to check for +multiple file names, presence of any of them will exclude the +directory. -Returns -- entries - number of items in the cache +This flag has a priority over other filter flags. -**Authentication is required for this call.** +E.g. for the following directory structure: -### job/list: Lists the IDs of the running jobs {#job-list} + dir1/file1 + dir1/dir2/file2 + dir1/dir2/dir3/file3 + dir1/dir2/dir3/.ignore -Parameters: None. +The command `rclone ls --exclude-if-present .ignore dir1` does +not list `dir3`, `file3` or `.ignore`. -Results: +## Metadata filters {#metadata} -- jobids - array of integer job ids. +The metadata filters work in a very similar way to the normal file +name filters, except they match [metadata](https://rclone.org/docs/#metadata) on the +object. -### job/status: Reads the status of the job ID {#job-status} +The metadata should be specified as `key=value` patterns. This may be +wildcarded using the normal [filter patterns](#patterns) or [regular +expressions](#regexp). -Parameters: +For example if you wished to list only local files with a mode of +`100664` you could do that with: -- jobid - id of the job (integer). + rclone lsf -M --files-only --metadata-include "mode=100664" . -Results: +Or if you wished to show files with an `atime`, `mtime` or `btime` at a given date: -- finished - boolean -- duration - time in seconds that the job ran for -- endTime - time the job finished (e.g. "2018-10-26T18:50:20.528746884+01:00") -- error - error from the job or empty string for no error -- finished - boolean whether the job has finished or not -- id - as passed in above -- startTime - time the job started (e.g. "2018-10-26T18:50:20.528336039+01:00") -- success - boolean - true for success false otherwise -- output - output of the job as would have been returned if called synchronously -- progress - output of the progress related to the underlying job + rclone lsf -M --files-only --metadata-include "[abm]time=2022-12-16*" . -### job/stop: Stop the running job {#job-stop} +Like file filtering, metadata filtering only applies to files not to +directories. -Parameters: +The filters can be applied using these flags. -- jobid - id of the job (integer). +- `--metadata-include` - Include metadatas matching pattern +- `--metadata-include-from` - Read metadata include patterns from file (use - to read from stdin) +- `--metadata-exclude` - Exclude metadatas matching pattern +- `--metadata-exclude-from` - Read metadata exclude patterns from file (use - to read from stdin) +- `--metadata-filter` - Add a metadata filtering rule +- `--metadata-filter-from` - Read metadata filtering patterns from a file (use - to read from stdin) -### job/stopgroup: Stop all running jobs in a group {#job-stopgroup} +Each flag can be repeated. See the section on [how filter rules are +applied](#how-filter-rules-work) for more details - these flags work +in an identical way to the file name filtering flags, but instead of +file name patterns have metadata patterns. -Parameters: -- group - name of the group (string). +## Common pitfalls -### mount/listmounts: Show current mount points {#mount-listmounts} +The most frequent filter support issues on +the [rclone forum](https://forum.rclone.org/) are: -This shows currently mounted points, which can be used for performing an unmount. +* Not using paths relative to the root of the remote +* Not using `/` to match from the root of a remote +* Not using `**` to match the contents of a directory -This takes no parameters and returns +# GUI (Experimental) -- mountPoints: list of current mount points +Rclone can serve a web based GUI (graphical user interface). This is +somewhat experimental at the moment so things may be subject to +change. -Eg +Run this command in a terminal and rclone will download and then +display the GUI in a web browser. - rclone rc mount/listmounts +``` +rclone rcd --rc-web-gui +``` -**Authentication is required for this call.** +This will produce logs like this and rclone needs to continue to run to serve the GUI: -### mount/mount: Create a new mount point {#mount-mount} +``` +2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip +2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] +2019/08/25 11:40:16 NOTICE: Unzipping +2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ +``` -rclone allows Linux, FreeBSD, macOS and Windows to mount any of -Rclone's cloud storage systems as a file system with FUSE. +This assumes you are running rclone locally on your machine. It is +possible to separate the rclone and the GUI - see below for details. -If no mountType is provided, the priority is given as follows: 1. mount 2.cmount 3.mount2 +If you wish to check for updates then you can add `--rc-web-gui-update` +to the command line. -This takes the following parameters: +If you find your GUI broken, you may force it to update by add `--rc-web-gui-force-update`. -- fs - a remote path to be mounted (required) -- mountPoint: valid path on the local machine (required) -- mountType: one of the values (mount, cmount, mount2) specifies the mount implementation to use -- mountOpt: a JSON object with Mount options in. -- vfsOpt: a JSON object with VFS options in. +By default, rclone will open your browser. Add `--rc-web-gui-no-open-browser` +to disable this feature. -Example: +## Using the GUI - rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint - rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount - rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}' +Once the GUI opens, you will be looking at the dashboard which has an overall overview. -The vfsOpt are as described in options/get and can be seen in the the -"vfs" section when running and the mountOpt can be seen in the "mount" section: +On the left hand side you will see a series of view buttons you can click on: - rclone rc options/get +- Dashboard - main overview +- Configs - examine and create new configurations +- Explorer - view, download and upload files to the cloud storage systems +- Backend - view or alter the backend config +- Log out -**Authentication is required for this call.** +(More docs and walkthrough video to come!) -### mount/types: Show all possible mount types {#mount-types} +## How it works -This shows all possible mount types and returns them as a list. +When you run the `rclone rcd --rc-web-gui` this is what happens -This takes no parameters and returns +- Rclone starts but only runs the remote control API ("rc"). +- The API is bound to localhost with an auto-generated username and password. +- If the API bundle is missing then rclone will download it. +- rclone will start serving the files from the API bundle over the same port as the API +- rclone will open the browser with a `login_token` so it can log straight in. -- mountTypes: list of mount types +## Advanced use -The mount types are strings like "mount", "mount2", "cmount" and can -be passed to mount/mount as the mountType parameter. +The `rclone rcd` may use any of the [flags documented on the rc page](https://rclone.org/rc/#supported-parameters). -Eg +The flag `--rc-web-gui` is shorthand for - rclone rc mount/types +- Download the web GUI if necessary +- Check we are using some authentication +- `--rc-user gui` +- `--rc-pass ` +- `--rc-serve` -**Authentication is required for this call.** +These flags can be overridden as desired. -### mount/unmount: Unmount selected active mount {#mount-unmount} +See also the [rclone rcd documentation](https://rclone.org/commands/rclone_rcd/). -rclone allows Linux, FreeBSD, macOS and Windows to -mount any of Rclone's cloud storage systems as a file system with -FUSE. +### Example: Running a public GUI -This takes the following parameters: +For example the GUI could be served on a public port over SSL using an htpasswd file using the following flags: -- mountPoint: valid path on the local machine where the mount was created (required) +- `--rc-web-gui` +- `--rc-addr :443` +- `--rc-htpasswd /path/to/htpasswd` +- `--rc-cert /path/to/ssl.crt` +- `--rc-key /path/to/ssl.key` -Example: +### Example: Running a GUI behind a proxy - rclone rc mount/unmount mountPoint=/home//mountPoint +If you want to run the GUI behind a proxy at `/rclone` you could use these flags: -**Authentication is required for this call.** +- `--rc-web-gui` +- `--rc-baseurl rclone` +- `--rc-htpasswd /path/to/htpasswd` -### mount/unmountall: Unmount all active mounts {#mount-unmountall} +Or instead of htpasswd if you just want a single user and password: -rclone allows Linux, FreeBSD, macOS and Windows to -mount any of Rclone's cloud storage systems as a file system with -FUSE. +- `--rc-user me` +- `--rc-pass mypassword` -This takes no parameters and returns error if unmount does not succeed. +## Project -Eg +The GUI is being developed in the: [rclone/rclone-webui-react repository](https://github.com/rclone/rclone-webui-react). - rclone rc mount/unmountall +Bug reports and contributions are very welcome :-) -**Authentication is required for this call.** +If you have questions then please ask them on the [rclone forum](https://forum.rclone.org/). -### operations/about: Return the space used on the remote {#operations-about} +# Remote controlling rclone with its API -This takes the following parameters: +If rclone is run with the `--rc` flag then it starts an HTTP server +which can be used to remote control rclone using its API. -- fs - a remote name string e.g. "drive:" +You can either use the [rc](#api-rc) command to access the API +or [use HTTP directly](#api-http). -The result is as returned from rclone about --json +If you just want to run a remote control then see the [rcd](https://rclone.org/commands/rclone_rcd/) command. -See the [about](https://rclone.org/commands/rclone_about/) command for more information on the above. +## Supported parameters -**Authentication is required for this call.** +### --rc -### operations/cleanup: Remove trashed files in the remote or path {#operations-cleanup} +Flag to start the http server listen on remote requests + +### --rc-addr=IP -This takes the following parameters: +IPaddress:Port or :Port to bind server to. (default "localhost:5572") -- fs - a remote name string e.g. "drive:" +### --rc-cert=KEY +SSL PEM key (concatenation of certificate and CA certificate) -See the [cleanup](https://rclone.org/commands/rclone_cleanup/) command for more information on the above. +### --rc-client-ca=PATH +Client certificate authority to verify clients with -**Authentication is required for this call.** +### --rc-htpasswd=PATH -### operations/copyfile: Copy a file from source remote to destination remote {#operations-copyfile} +htpasswd file - if not provided no authentication is done -This takes the following parameters: +### --rc-key=PATH -- srcFs - a remote name string e.g. "drive:" for the source -- srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination -- dstRemote - a path within that remote e.g. "file2.txt" for the destination +SSL PEM Private key -**Authentication is required for this call.** +### --rc-max-header-bytes=VALUE -### operations/copyurl: Copy the URL to the object {#operations-copyurl} +Maximum size of request header (default 4096) -This takes the following parameters: +### --rc-min-tls-version=VALUE -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- url - string, URL to read from - - autoFilename - boolean, set to true to retrieve destination file name from url +The minimum TLS version that is acceptable. Valid values are "tls1.0", +"tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -See the [copyurl](https://rclone.org/commands/rclone_copyurl/) command for more information on the above. +### --rc-user=VALUE -**Authentication is required for this call.** +User name for authentication. -### operations/delete: Remove files in the path {#operations-delete} +### --rc-pass=VALUE -This takes the following parameters: +Password for authentication. -- fs - a remote name string e.g. "drive:" +### --rc-realm=VALUE -See the [delete](https://rclone.org/commands/rclone_delete/) command for more information on the above. +Realm for authentication (default "rclone") -**Authentication is required for this call.** +### --rc-server-read-timeout=DURATION -### operations/deletefile: Remove the single file pointed to {#operations-deletefile} +Timeout for server reading data (default 1h0m0s) -This takes the following parameters: +### --rc-server-write-timeout=DURATION -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +Timeout for server writing data (default 1h0m0s) -See the [deletefile](https://rclone.org/commands/rclone_deletefile/) command for more information on the above. +### --rc-serve -**Authentication is required for this call.** +Enable the serving of remote objects via the HTTP interface. This +means objects will be accessible at http://127.0.0.1:5572/ by default, +so you can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* +to see a listing of the remotes. Objects may be requested from +remotes using this syntax http://127.0.0.1:5572/[remote:path]/path/to/object -### operations/fsinfo: Return information about the remote {#operations-fsinfo} +Default Off. -This takes the following parameters: +### --rc-files /path/to/directory -- fs - a remote name string e.g. "drive:" +Path to local files to serve on the HTTP server. -This returns info about the remote passed in; +If this is set then rclone will serve the files in that directory. It +will also open the root in the web browser if specified. This is for +implementing browser based GUIs for rclone functions. -``` -{ - // optional features and whether they are available or not - "Features": { - "About": true, - "BucketBased": false, - "BucketBasedRootOK": false, - "CanHaveEmptyDirectories": true, - "CaseInsensitive": false, - "ChangeNotify": false, - "CleanUp": false, - "Command": true, - "Copy": false, - "DirCacheFlush": false, - "DirMove": true, - "Disconnect": false, - "DuplicateFiles": false, - "GetTier": false, - "IsLocal": true, - "ListR": false, - "MergeDirs": false, - "MetadataInfo": true, - "Move": true, - "OpenWriterAt": true, - "PublicLink": false, - "Purge": true, - "PutStream": true, - "PutUnchecked": false, - "ReadMetadata": true, - "ReadMimeType": false, - "ServerSideAcrossConfigs": false, - "SetTier": false, - "SetWrapper": false, - "Shutdown": false, - "SlowHash": true, - "SlowModTime": false, - "UnWrap": false, - "UserInfo": false, - "UserMetadata": true, - "WrapFs": false, - "WriteMetadata": true, - "WriteMimeType": false - }, - // Names of hashes available - "Hashes": [ - "md5", - "sha1", - "whirlpool", - "crc32", - "sha256", - "dropbox", - "mailru", - "quickxor" - ], - "Name": "local", // Name as created - "Precision": 1, // Precision of timestamps in ns - "Root": "/", // Path as created - "String": "Local file system at /", // how the remote will appear in logs - // Information about the system metadata for this backend - "MetadataInfo": { - "System": { - "atime": { - "Help": "Time of last access", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "btime": { - "Help": "Time of file birth (creation)", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "gid": { - "Help": "Group ID of owner", - "Type": "decimal number", - "Example": "500" - }, - "mode": { - "Help": "File type and mode", - "Type": "octal, unix style", - "Example": "0100664" - }, - "mtime": { - "Help": "Time of last modification", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "rdev": { - "Help": "Device ID (if special file)", - "Type": "hexadecimal", - "Example": "1abc" - }, - "uid": { - "Help": "User ID of owner", - "Type": "decimal number", - "Example": "500" - } - }, - "Help": "Textual help string\n" - } -} -``` +If `--rc-user` or `--rc-pass` is set then the URL that is opened will +have the authorization in the URL in the `http://user:pass@localhost/` +style. -This command does not have a command line equivalent so use this instead: +Default Off. - rclone rc --loopback operations/fsinfo fs=remote: +### --rc-enable-metrics -### operations/list: List the given remote and path in JSON format {#operations-list} +Enable OpenMetrics/Prometheus compatible endpoint at `/metrics`. -This takes the following parameters: +Default Off. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- opt - a dictionary of options to control the listing (optional) - - recurse - If set recurse directories - - noModTime - If set return modification time - - showEncrypted - If set show decrypted names - - showOrigIDs - If set show the IDs for each item if known - - showHash - If set return a dictionary of hashes - - noMimeType - If set don't show mime types - - dirsOnly - If set only show directories - - filesOnly - If set only show files - - metadata - If set return metadata of objects also - - hashTypes - array of strings of hash types to show if showHash set +### --rc-web-gui -Returns: +Set this flag to serve the default web gui on the same port as rclone. -- list - - This is an array of objects as described in the lsjson command +Default Off. -See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. +### --rc-allow-origin -**Authentication is required for this call.** +Set the allowed Access-Control-Allow-Origin for rc requests. -### operations/mkdir: Make a destination directory or container {#operations-mkdir} +Can be used with --rc-web-gui if the rclone is running on different IP than the web-gui. -This takes the following parameters: +Default is IP address on which rc is running. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +### --rc-web-fetch-url -See the [mkdir](https://rclone.org/commands/rclone_mkdir/) command for more information on the above. +Set the URL to fetch the rclone-web-gui files from. -**Authentication is required for this call.** +Default https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. -### operations/movefile: Move a file from source remote to destination remote {#operations-movefile} +### --rc-web-gui-update -This takes the following parameters: +Set this flag to check and update rclone-webui-react from the rc-web-fetch-url. -- srcFs - a remote name string e.g. "drive:" for the source -- srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination -- dstRemote - a path within that remote e.g. "file2.txt" for the destination +Default Off. -**Authentication is required for this call.** +### --rc-web-gui-force-update -### operations/publiclink: Create or retrieve a public link to the given file or folder. {#operations-publiclink} +Set this flag to force update rclone-webui-react from the rc-web-fetch-url. -This takes the following parameters: +Default Off. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- unlink - boolean - if set removes the link rather than adding it (optional) -- expire - string - the expiry time of the link e.g. "1d" (optional) +### --rc-web-gui-no-open-browser -Returns: +Set this flag to disable opening browser automatically when using web-gui. -- url - URL of the resource +Default Off. -See the [link](https://rclone.org/commands/rclone_link/) command for more information on the above. +### --rc-job-expire-duration=DURATION -**Authentication is required for this call.** +Expire finished async jobs older than DURATION (default 60s). -### operations/purge: Remove a directory or container and all of its contents {#operations-purge} +### --rc-job-expire-interval=DURATION -This takes the following parameters: +Interval duration to check for expired async jobs (default 10s). -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +### --rc-no-auth -See the [purge](https://rclone.org/commands/rclone_purge/) command for more information on the above. +By default rclone will require authorisation to have been set up on +the rc interface in order to use any methods which access any rclone +remotes. Eg `operations/list` is denied as it involved creating a +remote as is `sync/copy`. -**Authentication is required for this call.** +If this is set then no authorisation will be required on the server to +use these methods. The alternative is to use `--rc-user` and +`--rc-pass` and use these credentials in the request. -### operations/rmdir: Remove an empty directory or container {#operations-rmdir} +Default Off. -This takes the following parameters: +### --rc-baseurl -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +Prefix for URLs. -See the [rmdir](https://rclone.org/commands/rclone_rmdir/) command for more information on the above. +Default is root -**Authentication is required for this call.** +### --rc-template -### operations/rmdirs: Remove all the empty directories in the path {#operations-rmdirs} +User-specified template. -This takes the following parameters: +## Accessing the remote control via the rclone rc command {#api-rc} -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- leaveRoot - boolean, set to true not to delete the root +Rclone itself implements the remote control protocol in its `rclone +rc` command. -See the [rmdirs](https://rclone.org/commands/rclone_rmdirs/) command for more information on the above. +You can use it like this -**Authentication is required for this call.** +``` +$ rclone rc rc/noop param1=one param2=two +{ + "param1": "one", + "param2": "two" +} +``` -### operations/size: Count the number of bytes and files in remote {#operations-size} +Run `rclone rc` on its own to see the help for the installed remote +control commands. -This takes the following parameters: +## JSON input -- fs - a remote name string e.g. "drive:path/to/dir" +`rclone rc` also supports a `--json` flag which can be used to send +more complicated input parameters. -Returns: +``` +$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 } }' rc/noop +{ + "p1": [ + 1, + "2", + null, + 4 + ], + "p2": { + "a": 1, + "b": 2 + } +} +``` -- count - number of files -- bytes - number of bytes in those files +If the parameter being passed is an object then it can be passed as a +JSON string rather than using the `--json` flag which simplifies the +command line. -See the [size](https://rclone.org/commands/rclone_size/) command for more information on the above. +``` +rclone rc operations/list fs=/tmp remote=test opt='{"showHash": true}' +``` -**Authentication is required for this call.** +Rather than -### operations/stat: Give information about the supplied file or directory {#operations-stat} +``` +rclone rc operations/list --json '{"fs": "/tmp", "remote": "test", "opt": {"showHash": true}}' +``` -This takes the following parameters +## Special parameters -- fs - a remote name string eg "drive:" -- remote - a path within that remote eg "dir" -- opt - a dictionary of options to control the listing (optional) - - see operations/list for the options +The rc interface supports some special parameters which apply to +**all** commands. These start with `_` to show they are different. -The result is +### Running asynchronous jobs with _async = true -- item - an object as described in the lsjson command. Will be null if not found. +Each rc call is classified as a job and it is assigned its own id. By default +jobs are executed immediately as they are created or synchronously. -Note that if you are only interested in files then it is much more -efficient to set the filesOnly flag in the options. +If `_async` has a true value when supplied to an rc call then it will +return immediately with a job id and the task will be run in the +background. The `job/status` call can be used to get information of +the background job. The job can be queried for up to 1 minute after +it has finished. -See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. +It is recommended that potentially long running jobs, e.g. `sync/sync`, +`sync/copy`, `sync/move`, `operations/purge` are run with the `_async` +flag to avoid any potential problems with the HTTP request and +response timing out. -**Authentication is required for this call.** +Starting a job with the `_async` flag: -### operations/uploadfile: Upload file using multiform/form-data {#operations-uploadfile} +``` +$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 }, "_async": true }' rc/noop +{ + "jobid": 2 +} +``` -This takes the following parameters: +Query the status to see if the job has finished. For more information +on the meaning of these return parameters see the `job/status` call. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- each part in body represents a file to be uploaded +``` +$ rclone rc --json '{ "jobid":2 }' job/status +{ + "duration": 0.000124163, + "endTime": "2018-10-27T11:38:07.911245881+01:00", + "error": "", + "finished": true, + "id": 2, + "output": { + "_async": true, + "p1": [ + 1, + "2", + null, + 4 + ], + "p2": { + "a": 1, + "b": 2 + } + }, + "startTime": "2018-10-27T11:38:07.911121728+01:00", + "success": true +} +``` -See the [uploadfile](https://rclone.org/commands/rclone_uploadfile/) command for more information on the above. +`job/list` can be used to show the running or recently completed jobs -**Authentication is required for this call.** +``` +$ rclone rc job/list +{ + "jobids": [ + 2 + ] +} +``` -### options/blocks: List all the option blocks {#options-blocks} +### Setting config flags with _config -Returns: -- options - a list of the options block names +If you wish to set config (the equivalent of the global flags) for the +duration of an rc call only then pass in the `_config` parameter. -### options/get: Get all the global options {#options-get} +This should be in the same format as the `config` key returned by +[options/get](#options-get). -Returns an object where keys are option block names and values are an -object with the current option values in. +For example, if you wished to run a sync with the `--checksum` +parameter, you would pass this parameter in your JSON blob. -Note that these are the global options which are unaffected by use of -the _config and _filter parameters. If you wish to read the parameters -set in _config then use options/config and for _filter use options/filter. + "_config":{"CheckSum": true} -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. +If using `rclone rc` this could be passed as -### options/local: Get the currently active config for this call {#options-local} + rclone rc sync/sync ... _config='{"CheckSum": true}' -Returns an object with the keys "config" and "filter". -The "config" key contains the local config and the "filter" key contains -the local filters. +Any config parameters you don't set will inherit the global defaults +which were set with command line flags or environment variables. -Note that these are the local options specific to this rc call. If -_config was not supplied then they will be the global options. -Likewise with "_filter". +Note that it is possible to set some values as strings or integers - +see [data types](#data-types) for more info. Here is an example +setting the equivalent of `--buffer-size` in string or integer format. -This call is mostly useful for seeing if _config and _filter passing -is working. + "_config":{"BufferSize": "42M"} + "_config":{"BufferSize": 44040192} -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. +If you wish to check the `_config` assignment has worked properly then +calling `options/local` will show what the value got set to. -### options/set: Set an option {#options-set} +### Setting filter flags with _filter -Parameters: +If you wish to set filters for the duration of an rc call only then +pass in the `_filter` parameter. -- option block name containing an object with - - key: value +This should be in the same format as the `filter` key returned by +[options/get](#options-get). -Repeated as often as required. +For example, if you wished to run a sync with these flags -Only supply the options you wish to change. If an option is unknown -it will be silently ignored. Not all options will have an effect when -changed like this. + --max-size 1M --max-age 42s --include "a" --include "b" -For example: +you would pass this parameter in your JSON blob. -This sets DEBUG level logs (-vv) (these can be set by number or string) + "_filter":{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"} - rclone rc options/set --json '{"main": {"LogLevel": "DEBUG"}}' - rclone rc options/set --json '{"main": {"LogLevel": 8}}' +If using `rclone rc` this could be passed as -And this sets INFO level logs (-v) + rclone rc ... _filter='{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"}' - rclone rc options/set --json '{"main": {"LogLevel": "INFO"}}' +Any filter parameters you don't set will inherit the global defaults +which were set with command line flags or environment variables. -And this sets NOTICE level logs (normal without -v) +Note that it is possible to set some values as strings or integers - +see [data types](#data-types) for more info. Here is an example +setting the equivalent of `--buffer-size` in string or integer format. - rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}' + "_filter":{"MinSize": "42M"} + "_filter":{"MinSize": 44040192} -### pluginsctl/addPlugin: Add a plugin using url {#pluginsctl-addPlugin} +If you wish to check the `_filter` assignment has worked properly then +calling `options/local` will show what the value got set to. -Used for adding a plugin to the webgui. +### Assigning operations to groups with _group = value -This takes the following parameters: +Each rc call has its own stats group for tracking its metrics. By default +grouping is done by the composite group name from prefix `job/` and id of the +job like so `job/1`. -- url - http url of the github repo where the plugin is hosted (http://github.com/rclone/rclone-webui-react). +If `_group` has a value then stats for that request will be grouped under that +value. This allows caller to group stats under their own name. -Example: +Stats for specific group can be accessed by passing `group` to `core/stats`: - rclone rc pluginsctl/addPlugin +``` +$ rclone rc --json '{ "group": "job/1" }' core/stats +{ + "speed": 12345 + ... +} +``` -**Authentication is required for this call.** +## Data types {#data-types} -### pluginsctl/getPluginsForType: Get plugins with type criteria {#pluginsctl-getPluginsForType} +When the API returns types, these will mostly be straight forward +integer, string or boolean types. -This shows all possible plugins by a mime type. +However some of the types returned by the [options/get](#options-get) +call and taken by the [options/set](#options-set) calls as well as the +`vfsOpt`, `mountOpt` and the `_config` parameters. -This takes the following parameters: +- `Duration` - these are returned as an integer duration in + nanoseconds. They may be set as an integer, or they may be set with + time string, eg "5s". See the [options section](https://rclone.org/docs/#options) for + more info. +- `Size` - these are returned as an integer number of bytes. They may + be set as an integer or they may be set with a size suffix string, + eg "10M". See the [options section](https://rclone.org/docs/#options) for more info. +- Enumerated type (such as `CutoffMode`, `DumpFlags`, `LogLevel`, + `VfsCacheMode` - these will be returned as an integer and may be set + as an integer but more conveniently they can be set as a string, eg + "HARD" for `CutoffMode` or `DEBUG` for `LogLevel`. +- `BandwidthSpec` - this will be set and returned as a string, eg + "1M". -- type - supported mime type by a loaded plugin e.g. (video/mp4, audio/mp3). -- pluginType - filter plugins based on their type e.g. (DASHBOARD, FILE_HANDLER, TERMINAL). +## Specifying remotes to work on -Returns: +Remotes are specified with the `fs=`, `srcFs=`, `dstFs=` +parameters depending on the command being used. -- loadedPlugins - list of current production plugins. -- testPlugins - list of temporarily loaded development plugins, usually running on a different server. +The parameters can be a string as per the rest of rclone, eg +`s3:bucket/path` or `:sftp:/my/dir`. They can also be specified as +JSON blobs. -Example: +If specifying a JSON blob it should be a object mapping strings to +strings. These values will be used to configure the remote. There are +3 special values which may be set: - rclone rc pluginsctl/getPluginsForType type=video/mp4 +- `type` - set to `type` to specify a remote called `:type:` +- `_name` - set to `name` to specify a remote called `name:` +- `_root` - sets the root of the remote - may be empty -**Authentication is required for this call.** +One of `_name` or `type` should normally be set. If the `local` +backend is desired then `type` should be set to `local`. If `_root` +isn't specified then it defaults to the root of the remote. -### pluginsctl/listPlugins: Get the list of currently loaded plugins {#pluginsctl-listPlugins} +For example this JSON is equivalent to `remote:/tmp` -This allows you to get the currently enabled plugins and their details. +``` +{ + "_name": "remote", + "_path": "/tmp" +} +``` -This takes no parameters and returns: +And this is equivalent to `:sftp,host='example.com':/tmp` -- loadedPlugins - list of current production plugins. -- testPlugins - list of temporarily loaded development plugins, usually running on a different server. +``` +{ + "type": "sftp", + "host": "example.com", + "_path": "/tmp" +} +``` -E.g. +And this is equivalent to `/tmp/dir` - rclone rc pluginsctl/listPlugins +``` +{ + type = "local", + _ path = "/tmp/dir" +} +``` -**Authentication is required for this call.** +## Supported commands -### pluginsctl/listTestPlugins: Show currently loaded test plugins {#pluginsctl-listTestPlugins} +### backend/command: Runs a backend command. {#backend-command} -Allows listing of test plugins with the rclone.test set to true in package.json of the plugin. +This takes the following parameters: -This takes no parameters and returns: +- command - a string with the command name +- fs - a remote name string e.g. "drive:" +- arg - a list of arguments for the backend command +- opt - a map of string to string of options -- loadedTestPlugins - list of currently available test plugins. +Returns: -E.g. +- result - result from the backend command - rclone rc pluginsctl/listTestPlugins +Example: -**Authentication is required for this call.** + rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 -### pluginsctl/removePlugin: Remove a loaded plugin {#pluginsctl-removePlugin} +Returns -This allows you to remove a plugin using it's name. +``` +{ + "result": { + "arg": [ + "path1", + "path2" + ], + "name": "noop", + "opt": { + "blue": "", + "echo": "yes" + } + } +} +``` -This takes parameters: +Note that this is the direct equivalent of using this "backend" +command: -- name - name of the plugin in the format `author`/`plugin_name`. + rclone backend noop . -o echo=yes -o blue path1 path2 -E.g. +Note that arguments must be preceded by the "-a" flag - rclone rc pluginsctl/removePlugin name=rclone/video-plugin +See the [backend](https://rclone.org/commands/rclone_backend/) command for more information. **Authentication is required for this call.** -### pluginsctl/removeTestPlugin: Remove a test plugin {#pluginsctl-removeTestPlugin} - -This allows you to remove a plugin using it's name. +### cache/expire: Purge a remote from cache {#cache-expire} -This takes the following parameters: +Purge a remote from the cache backend. Supports either a directory or a file. +Params: + - remote = path to remote (required) + - withData = true/false to delete cached data (chunks) as well (optional) -- name - name of the plugin in the format `author`/`plugin_name`. +Eg -Example: + rclone rc cache/expire remote=path/to/sub/folder/ + rclone rc cache/expire remote=/ withData=true - rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react +### cache/fetch: Fetch file chunks {#cache-fetch} -**Authentication is required for this call.** +Ensure the specified file chunks are cached on disk. -### rc/error: This returns an error {#rc-error} +The chunks= parameter specifies the file chunks to check. +It takes a comma separated list of array slice indices. +The slice indices are similar to Python slices: start[:end] -This returns an error with the input as part of its error string. -Useful for testing error handling. +start is the 0 based chunk number from the beginning of the file +to fetch inclusive. end is 0 based chunk number from the beginning +of the file to fetch exclusive. +Both values can be negative, in which case they count from the back +of the file. The value "-5:" represents the last 5 chunks of a file. -### rc/list: List all the registered remote control commands {#rc-list} +Some valid examples are: +":5,-5:" -> the first and last five chunks +"0,-2" -> the first and the second last chunk +"0:10" -> the first ten chunks -This lists all the registered remote control commands as a JSON map in -the commands response. +Any parameter with a key that starts with "file" can be used to +specify files to fetch, e.g. -### rc/noop: Echo the input to the output parameters {#rc-noop} + rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye -This echoes the input parameters to the output parameters for testing -purposes. It can be used to check that rclone is still alive and to -check that parameter passing is working properly. +File names will automatically be encrypted when the a crypt remote +is used on top of the cache. -### rc/noopauth: Echo the input to the output parameters requiring auth {#rc-noopauth} +### cache/stats: Get cache stats {#cache-stats} -This echoes the input parameters to the output parameters for testing -purposes. It can be used to check that rclone is still alive and to -check that parameter passing is working properly. +Show statistics for the cache remote. -**Authentication is required for this call.** +### config/create: create the config for a remote. {#config-create} -### sync/bisync: Perform bidirectional synchronization between two paths. {#sync-bisync} +This takes the following parameters: -This takes the following parameters +- name - name of remote +- parameters - a map of \{ "key": "value" \} pairs +- type - type of the new remote +- opt - a dictionary of options to control the configuration + - obscure - declare passwords are plain and need obscuring + - noObscure - declare passwords are already obscured and don't need obscuring + - nonInteractive - don't interact with a user, return questions + - continue - continue the config process with an answer + - all - ask all the config questions not just the post config ones + - state - state to restart with - used with continue + - result - result to restart with - used with continue -- path1 - a remote directory string e.g. `drive:path1` -- path2 - a remote directory string e.g. `drive:path2` -- dryRun - dry-run mode -- resync - performs the resync run -- checkAccess - abort if RCLONE_TEST files are not found on both filesystems -- checkFilename - file name for checkAccess (default: RCLONE_TEST) -- maxDelete - abort sync if percentage of deleted files is above - this threshold (default: 50) -- force - maxDelete safety check and run the sync -- checkSync - `true` by default, `false` disables comparison of final listings, - `only` will skip sync, only compare listings from the last run -- removeEmptyDirs - remove empty directories at the final cleanup step -- filtersFile - read filtering patterns from a file -- workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync) -- noCleanup - retain working files -See [bisync command help](https://rclone.org/commands/rclone_bisync/) -and [full bisync description](https://rclone.org/bisync/) -for more information. +See the [config create](https://rclone.org/commands/rclone_config_create/) command for more information on the above. **Authentication is required for this call.** -### sync/copy: copy a directory from source remote to destination remote {#sync-copy} - -This takes the following parameters: +### config/delete: Delete a remote in the config file. {#config-delete} -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if set +Parameters: +- name - name of remote to delete -See the [copy](https://rclone.org/commands/rclone_copy/) command for more information on the above. +See the [config delete](https://rclone.org/commands/rclone_config_delete/) command for more information on the above. **Authentication is required for this call.** -### sync/move: move a directory from source remote to destination remote {#sync-move} - -This takes the following parameters: +### config/dump: Dumps the config file. {#config-dump} -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if set -- deleteEmptySrcDirs - delete empty src directories if set +Returns a JSON object: +- key: value +Where keys are remote names and values are the config parameters. -See the [move](https://rclone.org/commands/rclone_move/) command for more information on the above. +See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. **Authentication is required for this call.** -### sync/sync: sync a directory from source remote to destination remote {#sync-sync} - -This takes the following parameters: +### config/get: Get a remote in the config file. {#config-get} -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if set +Parameters: +- name - name of remote to get -See the [sync](https://rclone.org/commands/rclone_sync/) command for more information on the above. +See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. **Authentication is required for this call.** -### vfs/forget: Forget files or directories in the directory cache. {#vfs-forget} +### config/listremotes: Lists the remotes in the config file and defined in environment variables. {#config-listremotes} -This forgets the paths in the directory cache causing them to be -re-read from the remote when needed. +Returns +- remotes - array of remote names -If no paths are passed in then it will forget all the paths in the -directory cache. +See the [listremotes](https://rclone.org/commands/rclone_listremotes/) command for more information on the above. - rclone rc vfs/forget +**Authentication is required for this call.** -Otherwise pass files or dirs in as file=path or dir=path. Any -parameter key starting with file will forget that file and any -starting with dir will forget that dir, e.g. +### config/password: password the config for a remote. {#config-password} - rclone rc vfs/forget file=hello file2=goodbye dir=home/junk - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +This takes the following parameters: -### vfs/list: List active VFSes. {#vfs-list} +- name - name of remote +- parameters - a map of \{ "key": "value" \} pairs -This lists the active VFSes. -It returns a list under the key "vfses" where the values are the VFS -names that could be passed to the other VFS commands in the "fs" -parameter. +See the [config password](https://rclone.org/commands/rclone_config_password/) command for more information on the above. -### vfs/poll-interval: Get the status or update the value of the poll-interval option. {#vfs-poll-interval} +**Authentication is required for this call.** -Without any parameter given this returns the current status of the -poll-interval setting. +### config/providers: Shows how providers are configured in the config file. {#config-providers} -When the interval=duration parameter is set, the poll-interval value -is updated and the polling function is notified. -Setting interval=0 disables poll-interval. +Returns a JSON object: +- providers - array of objects - rclone rc vfs/poll-interval interval=5m +See the [config providers](https://rclone.org/commands/rclone_config_providers/) command for more information on the above. -The timeout=duration parameter can be used to specify a time to wait -for the current poll function to apply the new value. -If timeout is less or equal 0, which is the default, wait indefinitely. +**Authentication is required for this call.** -The new poll-interval value will only be active when the timeout is -not reached. +### config/setpath: Set the path of the config file {#config-setpath} -If poll-interval is updated or disabled temporarily, some changes -might not get picked up by the polling function, depending on the -used remote. - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +Parameters: -### vfs/refresh: Refresh the directory cache. {#vfs-refresh} +- path - path to the config file to use -This reads the directories for the specified paths and freshens the -directory cache. +**Authentication is required for this call.** -If no paths are passed in then it will refresh the root directory. +### config/update: update the config for a remote. {#config-update} - rclone rc vfs/refresh +This takes the following parameters: -Otherwise pass directories in as dir=path. Any parameter key -starting with dir will refresh that directory, e.g. +- name - name of remote +- parameters - a map of \{ "key": "value" \} pairs +- opt - a dictionary of options to control the configuration + - obscure - declare passwords are plain and need obscuring + - noObscure - declare passwords are already obscured and don't need obscuring + - nonInteractive - don't interact with a user, return questions + - continue - continue the config process with an answer + - all - ask all the config questions not just the post config ones + - state - state to restart with - used with continue + - result - result to restart with - used with continue - rclone rc vfs/refresh dir=home/junk dir2=data/misc -If the parameter recursive=true is given the whole directory tree -will get refreshed. This refresh will use --fast-list if enabled. - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +See the [config update](https://rclone.org/commands/rclone_config_update/) command for more information on the above. -### vfs/stats: Stats for a VFS. {#vfs-stats} +**Authentication is required for this call.** -This returns stats for the selected VFS. +### core/bwlimit: Set the bandwidth limit. {#core-bwlimit} + +This sets the bandwidth limit to the string passed in. This should be +a single bandwidth limit entry or a pair of upload:download bandwidth. + +Eg + rclone rc core/bwlimit rate=off { - // Status of the disk cache - only present if --vfs-cache-mode > off - "diskCache": { - "bytesUsed": 0, - "erroredFiles": 0, - "files": 0, - "hashType": 1, - "outOfSpace": false, - "path": "/home/user/.cache/rclone/vfs/local/mnt/a", - "pathMeta": "/home/user/.cache/rclone/vfsMeta/local/mnt/a", - "uploadsInProgress": 0, - "uploadsQueued": 0 - }, - "fs": "/mnt/a", - "inUse": 1, - // Status of the in memory metadata cache - "metadataCache": { - "dirs": 1, - "files": 0 - }, - // Options as returned by options/get - "opt": { - "CacheMaxAge": 3600000000000, - // ... - "WriteWait": 1000000000 - } + "bytesPerSecond": -1, + "bytesPerSecondTx": -1, + "bytesPerSecondRx": -1, + "rate": "off" + } + rclone rc core/bwlimit rate=1M + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 1048576, + "rate": "1M" + } + rclone rc core/bwlimit rate=1M:100k + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 131072, + "rate": "1M" } - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +If the rate parameter is not supplied then the bandwidth is queried + rclone rc core/bwlimit + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 1048576, + "rate": "1M" + } -## Accessing the remote control via HTTP {#api-http} +The format of the parameter is exactly the same as passed to --bwlimit +except only one bandwidth may be specified. -Rclone implements a simple HTTP based protocol. +In either case "rate" is returned as a human-readable string, and +"bytesPerSecond" is returned as a number. -Each endpoint takes an JSON object and returns a JSON object or an -error. The JSON objects are essentially a map of string names to -values. +### core/command: Run a rclone terminal command over rc. {#core-command} -All calls must made using POST. +This takes the following parameters: -The input objects can be supplied using URL parameters, POST -parameters or by supplying "Content-Type: application/json" and a JSON -blob in the body. There are examples of these below using `curl`. +- command - a string with the command name. +- arg - a list of arguments for the backend command. +- opt - a map of string to string of options. +- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). + - Defaults to "COMBINED_OUTPUT" if not set. + - The STREAM returnTypes will write the output to the body of the HTTP message. + - The COMBINED_OUTPUT will write the output to the "result" parameter. -The response will be a JSON blob in the body of the response. This is -formatted to be reasonably human-readable. +Returns: -### Error returns +- result - result from the backend command. + - Only set when using returnType "COMBINED_OUTPUT". +- error - set if rclone exits with an error code. +- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). -If an error occurs then there will be an HTTP error status (e.g. 500) -and the body of the response will contain a JSON encoded error object, -e.g. +Example: + + rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 + rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 + +Returns: ``` { - "error": "Expecting string value for key \"remote\" (was float64)", - "input": { - "fs": "/tmp", - "remote": 3 - }, - "status": 400 - "path": "operations/rmdir", + "error": false, + "result": "" +} + +OR +{ + "error": true, + "result": "" } + ``` -The keys in the error response are -- error - error string -- input - the input parameters to the call -- status - the HTTP status code -- path - the path of the call +**Authentication is required for this call.** -### CORS +### core/du: Returns disk usage of a locally attached disk. {#core-du} -The sever implements basic CORS support and allows all origins for that. -The response to a preflight OPTIONS request will echo the requested "Access-Control-Request-Headers" back. +This returns the disk usage for the local directory passed in as dir. -### Using POST with URL parameters only +If the directory is not passed in, it defaults to the directory +pointed to by --cache-dir. -``` -curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2' -``` +- dir - string (optional) -Response +Returns: ``` { - "potato": "1", - "sausage": "2" + "dir": "/", + "info": { + "Available": 361769115648, + "Free": 361785892864, + "Total": 982141468672 + } } ``` -Here is what an error response looks like: +### core/gc: Runs a garbage collection. {#core-gc} -``` -curl -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' -``` +This tells the go runtime to do a garbage collection run. It isn't +necessary to call this normally, but it can be useful for debugging +memory problems. + +### core/group-list: Returns list of stats. {#core-group-list} +This returns list of stats groups currently in memory. + +Returns the following values: ``` { - "error": "arbitrary error on input map[potato:1 sausage:2]", - "input": { - "potato": "1", - "sausage": "2" - } + "groups": an array of group names: + [ + "group1", + "group2", + ... + ] } ``` -Note that curl doesn't return errors to the shell unless you use the `-f` option +### core/memstats: Returns the memory statistics {#core-memstats} -``` -$ curl -f -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' -curl: (22) The requested URL returned error: 400 Bad Request -$ echo $? -22 -``` +This returns the memory statistics of the running program. What the values mean +are explained in the go docs: https://golang.org/pkg/runtime/#MemStats -### Using POST with a form +The most interesting values for most people are: -``` -curl --data "potato=1" --data "sausage=2" http://localhost:5572/rc/noop -``` +- HeapAlloc - this is the amount of memory rclone is actually using +- HeapSys - this is the amount of memory rclone has obtained from the OS +- Sys - this is the total amount of memory requested from the OS + - It is virtual memory so may include unused memory -Response +### core/obscure: Obscures a string passed in. {#core-obscure} -``` -{ - "potato": "1", - "sausage": "2" -} -``` +Pass a clear string and rclone will obscure it for the config file: +- clear - string -Note that you can combine these with URL parameters too with the POST -parameters taking precedence. +Returns: +- obscured - string -``` -curl --data "potato=1" --data "sausage=2" "http://localhost:5572/rc/noop?rutabaga=3&sausage=4" -``` +### core/pid: Return PID of current process {#core-pid} -Response +This returns PID of current process. +Useful for stopping rclone process. -``` -{ - "potato": "1", - "rutabaga": "3", - "sausage": "4" -} +### core/quit: Terminates the app. {#core-quit} -``` +(Optional) Pass an exit code to be used for terminating the app: +- exitCode - int -### Using POST with a JSON blob +### core/stats: Returns stats about current transfers. {#core-stats} -``` -curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' http://localhost:5572/rc/noop -``` +This returns all available stats: -response + rclone rc core/stats + +If group is not provided then summed up stats for all groups will be +returned. + +Parameters + +- group - name of the stats group (string) + +Returns the following values: ``` { - "password": "xyz", - "username": "xyz" + "bytes": total transferred bytes since the start of the group, + "checks": number of files checked, + "deletes" : number of files deleted, + "elapsedTime": time in floating point seconds since rclone was started, + "errors": number of errors, + "eta": estimated time in seconds until the group completes, + "fatalError": boolean whether there has been at least one fatal error, + "lastError": last error string, + "renames" : number of files renamed, + "retryError": boolean showing whether there has been at least one non-NoRetryError, + "serverSideCopies": number of server side copies done, + "serverSideCopyBytes": number bytes server side copied, + "serverSideMoves": number of server side moves done, + "serverSideMoveBytes": number bytes server side moved, + "speed": average speed in bytes per second since start of the group, + "totalBytes": total number of bytes in the group, + "totalChecks": total number of checks in the group, + "totalTransfers": total number of transfers in the group, + "transferTime" : total time spent on running jobs, + "transfers": number of transferred files, + "transferring": an array of currently active file transfers: + [ + { + "bytes": total transferred bytes for this file, + "eta": estimated time in seconds until file transfer completion + "name": name of the file, + "percentage": progress of the file transfer in percent, + "speed": average speed over the whole transfer in bytes per second, + "speedAvg": current speed in bytes per second as an exponentially weighted moving average, + "size": size of the file in bytes + } + ], + "checking": an array of names of currently active file checks + [] } ``` +Values for "transferring", "checking" and "lastError" are only assigned if data is available. +The value for "eta" is null if an eta cannot be determined. -This can be combined with URL parameters too if required. The JSON -blob takes precedence. +### core/stats-delete: Delete stats group. {#core-stats-delete} -``` -curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' 'http://localhost:5572/rc/noop?rutabaga=3&potato=4' -``` +This deletes entire stats group. + +Parameters + +- group - name of the stats group (string) + +### core/stats-reset: Reset stats. {#core-stats-reset} + +This clears counters, errors and finished transfers for all stats or specific +stats group if group is provided. + +Parameters + +- group - name of the stats group (string) + +### core/transferred: Returns stats about completed transfers. {#core-transferred} + +This returns stats about completed transfers: + + rclone rc core/transferred + +If group is not provided then completed transfers for all groups will be +returned. +Note only the last 100 completed transfers are returned. + +Parameters + +- group - name of the stats group (string) + +Returns the following values: ``` { - "potato": 2, - "rutabaga": "3", - "sausage": 1 + "transferred": an array of completed transfers (including failed ones): + [ + { + "name": name of the file, + "size": size of the file in bytes, + "bytes": total transferred bytes for this file, + "checked": if the transfer is only checked (skipped, deleted), + "timestamp": integer representing millisecond unix epoch, + "error": string description of the error (empty if successful), + "jobid": id of the job that this transfer belongs to + } + ] } ``` -## Debugging rclone with pprof ## +### core/version: Shows the current version of rclone and the go runtime. {#core-version} -If you use the `--rc` flag this will also enable the use of the go -profiling tools on the same port. +This shows the current version of go and the go runtime: -To use these, first [install go](https://golang.org/doc/install). +- version - rclone version, e.g. "v1.53.0" +- decomposed - version number as [major, minor, patch] +- isGit - boolean - true if this was compiled from the git version +- isBeta - boolean - true if this is a beta version +- os - OS in use as according to Go +- arch - cpu architecture in use according to Go +- goVersion - version of Go runtime in use +- linking - type of rclone executable (static or dynamic) +- goTags - space separated build tags or "none" -### Debugging memory use +### debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. {#debug-set-block-profile-rate} -To profile rclone's memory use you can run: +SetBlockProfileRate controls the fraction of goroutine blocking events +that are reported in the blocking profile. The profiler aims to sample +an average of one blocking event per rate nanoseconds spent blocked. - go tool pprof -web http://localhost:5572/debug/pprof/heap +To include every blocking event in the profile, pass rate = 1. To turn +off profiling entirely, pass rate <= 0. -This should open a page in your browser showing what is using what -memory. +After calling this you can use this to see the blocking profile: -You can also use the `-text` flag to produce a textual summary + go tool pprof http://localhost:5572/debug/pprof/block -``` -$ go tool pprof -text http://localhost:5572/debug/pprof/heap -Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total - flat flat% sum% cum cum% - 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode - 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 - 0 0% 100% 1024.03kB 66.62% main.init - 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest - 0 0% 100% 513kB 33.38% net/http.(*conn).serve - 0 0% 100% 1024.03kB 66.62% runtime.main -``` +Parameters: -### Debugging go routine leaks +- rate - int -Memory leaks are most often caused by go routine leaks keeping memory -alive which should have been garbage collected. +### debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. {#debug-set-gc-percent} -See all active go routines using +SetGCPercent sets the garbage collection target percentage: a collection is triggered +when the ratio of freshly allocated data to live data remaining after the previous collection +reaches this percentage. SetGCPercent returns the previous setting. The initial setting is the +value of the GOGC environment variable at startup, or 100 if the variable is not set. - curl http://localhost:5572/debug/pprof/goroutine?debug=1 +This setting may be effectively reduced in order to maintain a memory limit. +A negative percentage effectively disables garbage collection, unless the memory limit is reached. -Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your browser. +See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. -### Other profiles to look at +Parameters: -You can see a summary of profiles available at http://localhost:5572/debug/pprof/ +- gc-percent - int -Here is how to use some of them: +### debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. {#debug-set-mutex-profile-fraction} -- Memory: `go tool pprof http://localhost:5572/debug/pprof/heap` -- Go routines: `curl http://localhost:5572/debug/pprof/goroutine?debug=1` -- 30-second CPU profile: `go tool pprof http://localhost:5572/debug/pprof/profile` -- 5-second execution trace: `wget http://localhost:5572/debug/pprof/trace?seconds=5` -- Goroutine blocking profile - - Enable first with: `rclone rc debug/set-block-profile-rate rate=1` ([docs](#debug-set-block-profile-rate)) - - `go tool pprof http://localhost:5572/debug/pprof/block` -- Contended mutexes: - - Enable first with: `rclone rc debug/set-mutex-profile-fraction rate=1` ([docs](#debug-set-mutex-profile-fraction)) - - `go tool pprof http://localhost:5572/debug/pprof/mutex` +SetMutexProfileFraction controls the fraction of mutex contention +events that are reported in the mutex profile. On average 1/rate +events are reported. The previous rate is returned. -See the [net/http/pprof docs](https://golang.org/pkg/net/http/pprof/) -for more info on how to use the profiling and for a general overview -see [the Go team's blog post on profiling go programs](https://blog.golang.org/profiling-go-programs). +To turn off profiling entirely, pass rate 0. To just read the current +rate, pass rate < 0. (For n>1 the details of sampling may change.) -The profiling hook is [zero overhead unless it is used](https://stackoverflow.com/q/26545159/164234). +Once this is set you can look use this to profile the mutex contention: -# Overview of cloud storage systems # + go tool pprof http://localhost:5572/debug/pprof/mutex -Each cloud storage system is slightly different. Rclone attempts to -provide a unified interface to them, but some underlying differences -show through. +Parameters: -## Features ## +- rate - int -Here is an overview of the major features of each cloud storage system. +Results: -| Name | Hash | ModTime | Case Insensitive | Duplicate Files | MIME Type | Metadata | -| ---------------------------- |:----------------:|:-------:|:----------------:|:---------------:|:---------:|:--------:| -| 1Fichier | Whirlpool | - | No | Yes | R | - | -| Akamai Netstorage | MD5, SHA256 | R/W | No | No | R | - | -| Amazon Drive | MD5 | - | Yes | No | R | - | -| Amazon S3 (or S3 compatible) | MD5 | R/W | No | No | R/W | RWU | -| Backblaze B2 | SHA1 | R/W | No | No | R/W | - | -| Box | SHA1 | R/W | Yes | No | - | - | -| Citrix ShareFile | MD5 | R/W | Yes | No | - | - | -| Dropbox | DBHASH ¹ | R | Yes | No | - | - | -| Enterprise File Fabric | - | R/W | Yes | No | R/W | - | -| FTP | - | R/W ¹⁰ | No | No | - | - | -| Google Cloud Storage | MD5 | R/W | No | No | R/W | - | -| Google Drive | MD5 | R/W | No | Yes | R/W | - | -| Google Photos | - | - | No | Yes | R | - | -| HDFS | - | R/W | No | No | - | - | -| HiDrive | HiDrive ¹² | R/W | No | No | - | - | -| HTTP | - | R | No | No | R | - | -| Internet Archive | MD5, SHA1, CRC32 | R/W ¹¹ | No | No | - | RWU | -| Jottacloud | MD5 | R/W | Yes | No | R | - | -| Koofr | MD5 | - | Yes | No | - | - | -| Mail.ru Cloud | Mailru ⁶ | R/W | Yes | No | - | - | -| Mega | - | - | No | Yes | - | - | -| Memory | MD5 | R/W | No | No | - | - | -| Microsoft Azure Blob Storage | MD5 | R/W | No | No | R/W | - | -| Microsoft OneDrive | QuickXorHash ⁵ | R/W | Yes | No | R | - | -| OpenDrive | MD5 | R/W | Yes | Partial ⁸ | - | - | -| OpenStack Swift | MD5 | R/W | No | No | R/W | - | -| Oracle Object Storage | MD5 | R/W | No | No | R/W | - | -| pCloud | MD5, SHA1 ⁷ | R | No | No | W | - | -| premiumize.me | - | - | Yes | No | R | - | -| put.io | CRC-32 | R/W | No | Yes | R | - | -| QingStor | MD5 | - ⁹ | No | No | R/W | - | -| Seafile | - | - | No | No | - | - | -| SFTP | MD5, SHA1 ² | R/W | Depends | No | - | - | -| Sia | - | - | No | No | - | - | -| SMB | - | - | Yes | No | - | - | -| SugarSync | - | - | No | No | - | - | -| Storj | - | R | No | No | - | - | -| Uptobox | - | - | No | Yes | - | - | -| WebDAV | MD5, SHA1 ³ | R ⁴ | Depends | No | - | - | -| Yandex Disk | MD5 | R/W | No | No | R | - | -| Zoho WorkDrive | - | - | No | No | - | - | -| The local filesystem | All | R/W | Depends | No | - | RWU | - -### Notes +- previousRate - int -¹ Dropbox supports [its own custom -hash](https://www.dropbox.com/developers/reference/content-hash). -This is an SHA256 sum of all the 4 MiB block SHA256s. +### debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. {#debug-set-soft-memory-limit} -² SFTP supports checksums if the same login has shell access and -`md5sum` or `sha1sum` as well as `echo` are in the remote's PATH. +SetMemoryLimit provides the runtime with a soft memory limit. -³ WebDAV supports hashes when used with Owncloud and Nextcloud only. +The runtime undertakes several processes to try to respect this memory limit, including +adjustments to the frequency of garbage collections and returning memory to the underlying +system more aggressively. This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) is executed). -⁴ WebDAV supports modtimes when used with Owncloud and Nextcloud only. +The input limit is provided as bytes, and includes all memory mapped, managed, and not +released by the Go runtime. Notably, it does not account for space used by the Go binary +and memory external to Go, such as memory managed by the underlying system on behalf of +the process, or memory managed by non-Go code inside the same process. +Examples of excluded memory sources include: OS kernel memory held on behalf of the process, +memory allocated by C code, and memory mapped by syscall.Mmap (because it is not managed by the Go runtime). -⁵ [QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash) is Microsoft's own hash. +A zero limit or a limit that's lower than the amount of memory used by the Go runtime may cause +the garbage collector to run nearly continuously. However, the application may still make progress. -⁶ Mail.ru uses its own modified SHA1 hash +The memory limit is always respected by the Go runtime, so to effectively disable this behavior, +set the limit very high. math.MaxInt64 is the canonical value for disabling the limit, but values +much greater than the available memory on the underlying system work just as well. -⁷ pCloud only supports SHA1 (not MD5) in its EU region +See https://go.dev/doc/gc-guide for a detailed guide explaining the soft memory limit in more detail, +as well as a variety of common use-cases and scenarios. -⁸ Opendrive does not support creation of duplicate files using -their web client interface or other stock clients, but the underlying -storage platform has been determined to allow duplicate files, and it -is possible to create them with `rclone`. It may be that this is a -mistake or an unsupported feature. +SetMemoryLimit returns the previously set memory limit. A negative input does not adjust the limit, +and allows for retrieval of the currently set memory limit. -⁹ QingStor does not support SetModTime for objects bigger than 5 GiB. +Parameters: -¹⁰ FTP supports modtimes for the major FTP servers, and also others -if they advertised required protocol extensions. See [this](https://rclone.org/ftp/#modified-time) -for more details. +- mem-limit - int -¹¹ Internet Archive requires option `wait_archive` to be set to a non-zero value -for full modtime support. +### fscache/clear: Clear the Fs cache. {#fscache-clear} -¹² HiDrive supports [its own custom -hash](https://static.hidrive.com/dev/0001). -It combines SHA1 sums for each 4 KiB block hierarchically to a single -top-level sum. +This clears the fs cache. This is where remotes created from backends +are cached for a short while to make repeated rc calls more efficient. -### Hash ### +If you change the parameters of a backend then you may want to call +this to clear an existing remote out of the cache before re-creating +it. -The cloud storage system supports various hash types of the objects. -The hashes are used when transferring data as an integrity check and -can be specifically used with the `--checksum` flag in syncs and in -the `check` command. +**Authentication is required for this call.** -To use the verify checksums when transferring between cloud storage -systems they must support a common hash type. +### fscache/entries: Returns the number of entries in the fs cache. {#fscache-entries} -### ModTime ### +This returns the number of entries in the fs cache. -Almost all cloud storage systems store some sort of timestamp -on objects, but several of them not something that is appropriate -to use for syncing. E.g. some backends will only write a timestamp -that represent the time of the upload. To be relevant for syncing -it should be able to store the modification time of the source -object. If this is not the case, rclone will only check the file -size by default, though can be configured to check the file hash -(with the `--checksum` flag). Ideally it should also be possible to -change the timestamp of an existing file without having to re-upload it. +Returns +- entries - number of items in the cache -Storage systems with a `-` in the ModTime column, means the -modification read on objects is not the modification time of the -file when uploaded. It is most likely the time the file was uploaded, -or possibly something else (like the time the picture was taken in -Google Photos). +**Authentication is required for this call.** -Storage systems with a `R` (for read-only) in the ModTime column, -means the it keeps modification times on objects, and updates them -when uploading objects, but it does not support changing only the -modification time (`SetModTime` operation) without re-uploading, -possibly not even without deleting existing first. Some operations -in rclone, such as `copy` and `sync` commands, will automatically -check for `SetModTime` support and re-upload if necessary to keep -the modification times in sync. Other commands will not work -without `SetModTime` support, e.g. `touch` command on an existing -file will fail, and changes to modification time only on a files -in a `mount` will be silently ignored. +### job/list: Lists the IDs of the running jobs {#job-list} -Storage systems with `R/W` (for read/write) in the ModTime column, -means they do also support modtime-only operations. +Parameters: None. -### Case Insensitive ### +Results: -If a cloud storage systems is case sensitive then it is possible to -have two files which differ only in case, e.g. `file.txt` and -`FILE.txt`. If a cloud storage system is case insensitive then that -isn't possible. +- executeId - string id of rclone executing (change after restart) +- jobids - array of integer job ids (starting at 1 on each restart) -This can cause problems when syncing between a case insensitive -system and a case sensitive system. The symptom of this is that no -matter how many times you run the sync it never completes fully. +### job/status: Reads the status of the job ID {#job-status} -The local filesystem and SFTP may or may not be case sensitive -depending on OS. +Parameters: - * Windows - usually case insensitive, though case is preserved - * OSX - usually case insensitive, though it is possible to format case sensitive - * Linux - usually case sensitive, but there are case insensitive file systems (e.g. FAT formatted USB keys) +- jobid - id of the job (integer). -Most of the time this doesn't cause any problems as people tend to -avoid files whose name differs only by case even on case sensitive -systems. +Results: -### Duplicate files ### +- finished - boolean +- duration - time in seconds that the job ran for +- endTime - time the job finished (e.g. "2018-10-26T18:50:20.528746884+01:00") +- error - error from the job or empty string for no error +- finished - boolean whether the job has finished or not +- id - as passed in above +- startTime - time the job started (e.g. "2018-10-26T18:50:20.528336039+01:00") +- success - boolean - true for success false otherwise +- output - output of the job as would have been returned if called synchronously +- progress - output of the progress related to the underlying job -If a cloud storage system allows duplicate files then it can have two -objects with the same name. +### job/stop: Stop the running job {#job-stop} -This confuses rclone greatly when syncing - use the `rclone dedupe` -command to rename or remove duplicates. +Parameters: -### Restricted filenames ### +- jobid - id of the job (integer). -Some cloud storage systems might have restrictions on the characters -that are usable in file or directory names. -When `rclone` detects such a name during a file upload, it will -transparently replace the restricted characters with similar looking -Unicode characters. To handle the different sets of restricted characters -for different backends, rclone uses something it calls [encoding](#encoding). +### job/stopgroup: Stop all running jobs in a group {#job-stopgroup} -This process is designed to avoid ambiguous file names as much as -possible and allow to move files between many cloud storage systems -transparently. +Parameters: -The name shown by `rclone` to the user or during log output will only -contain a minimal set of [replaced characters](#restricted-characters) -to ensure correct formatting and not necessarily the actual name used -on the cloud storage. +- group - name of the group (string). -This transformation is reversed when downloading a file or parsing -`rclone` arguments. For example, when uploading a file named `my file?.txt` -to Onedrive, it will be displayed as `my file?.txt` on the console, but -stored as `my file?.txt` to Onedrive (the `?` gets replaced by the similar -looking `?` character, the so-called "fullwidth question mark"). -The reverse transformation allows to read a file `unusual/name.txt` -from Google Drive, by passing the name `unusual/name.txt` on the command line -(the `/` needs to be replaced by the similar looking `/` character). +### mount/listmounts: Show current mount points {#mount-listmounts} -#### Caveats {#restricted-filenames-caveats} +This shows currently mounted points, which can be used for performing an unmount. -The filename encoding system works well in most cases, at least -where file names are written in English or similar languages. -You might not even notice it: It just works. In some cases it may -lead to issues, though. E.g. when file names are written in Chinese, -or Japanese, where it is always the Unicode fullwidth variants of the -punctuation marks that are used. +This takes no parameters and returns -On Windows, the characters `:`, `*` and `?` are examples of restricted -characters. If these are used in filenames on a remote that supports it, -Rclone will transparently convert them to their fullwidth Unicode -variants `*`, `?` and `:` when downloading to Windows, and back again -when uploading. This way files with names that are not allowed on Windows -can still be stored. +- mountPoints: list of current mount points -However, if you have files on your Windows system originally with these same -Unicode characters in their names, they will be included in the same conversion -process. E.g. if you create a file in your Windows filesystem with name -`Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol, and use -rclone to upload it to Google Drive, which supports regular `:` (halfwidth -question mark), rclone will replace the fullwidth `:` with the -halfwidth `:` and store the file as `Test:1.jpg` in Google Drive. Since -both Windows and Google Drive allows the name `Test:1.jpg`, it would -probably be better if rclone just kept the name as is in this case. +Eg -With the opposite situation; if you have a file named `Test:1.jpg`, -in your Google Drive, e.g. uploaded from a Linux system where `:` is valid -in file names. Then later use rclone to copy this file to your Windows -computer you will notice that on your local disk it gets renamed -to `Test:1.jpg`. The original filename is not legal on Windows, due to -the `:`, and rclone therefore renames it to make the copy possible. -That is all good. However, this can also lead to an issue: If you already -had a *different* file named `Test:1.jpg` on Windows, and then use rclone -to copy either way. Rclone will then treat the file originally named -`Test:1.jpg` on Google Drive and the file originally named `Test:1.jpg` -on Windows as the same file, and replace the contents from one with the other. + rclone rc mount/listmounts -Its virtually impossible to handle all cases like these correctly in all -situations, but by customizing the [encoding option](#encoding), changing the -set of characters that rclone should convert, you should be able to -create a configuration that works well for your specific situation. -See also the [example](https://rclone.org/overview/#encoding-example-windows) below. +**Authentication is required for this call.** -(Windows was used as an example of a file system with many restricted -characters, and Google drive a storage system with few.) +### mount/mount: Create a new mount point {#mount-mount} -#### Default restricted characters {#restricted-characters} +rclone allows Linux, FreeBSD, macOS and Windows to mount any of +Rclone's cloud storage systems as a file system with FUSE. -The table below shows the characters that are replaced by default. +If no mountType is provided, the priority is given as follows: 1. mount 2.cmount 3.mount2 -When a replacement character is found in a filename, this character -will be escaped with the `‛` character to avoid ambiguous file names. -(e.g. a file named `␀.txt` would shown as `‛␀.txt`) +This takes the following parameters: -Each cloud storage backend can use a different set of characters, -which will be specified in the documentation for each backend. +- fs - a remote path to be mounted (required) +- mountPoint: valid path on the local machine (required) +- mountType: one of the values (mount, cmount, mount2) specifies the mount implementation to use +- mountOpt: a JSON object with Mount options in. +- vfsOpt: a JSON object with VFS options in. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| SOH | 0x01 | ␁ | -| STX | 0x02 | ␂ | -| ETX | 0x03 | ␃ | -| EOT | 0x04 | ␄ | -| ENQ | 0x05 | ␅ | -| ACK | 0x06 | ␆ | -| BEL | 0x07 | ␇ | -| BS | 0x08 | ␈ | -| HT | 0x09 | ␉ | -| LF | 0x0A | ␊ | -| VT | 0x0B | ␋ | -| FF | 0x0C | ␌ | -| CR | 0x0D | ␍ | -| SO | 0x0E | ␎ | -| SI | 0x0F | ␏ | -| DLE | 0x10 | ␐ | -| DC1 | 0x11 | ␑ | -| DC2 | 0x12 | ␒ | -| DC3 | 0x13 | ␓ | -| DC4 | 0x14 | ␔ | -| NAK | 0x15 | ␕ | -| SYN | 0x16 | ␖ | -| ETB | 0x17 | ␗ | -| CAN | 0x18 | ␘ | -| EM | 0x19 | ␙ | -| SUB | 0x1A | ␚ | -| ESC | 0x1B | ␛ | -| FS | 0x1C | ␜ | -| GS | 0x1D | ␝ | -| RS | 0x1E | ␞ | -| US | 0x1F | ␟ | -| / | 0x2F | / | -| DEL | 0x7F | ␡ | +Example: -The default encoding will also encode these file names as they are -problematic with many cloud storage systems. + rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint + rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount + rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}' -| File name | Replacement | -| --------- |:-----------:| -| . | . | -| .. | .. | +The vfsOpt are as described in options/get and can be seen in the the +"vfs" section when running and the mountOpt can be seen in the "mount" section: -#### Invalid UTF-8 bytes {#invalid-utf8} + rclone rc options/get -Some backends only support a sequence of well formed UTF-8 bytes -as file or directory names. +**Authentication is required for this call.** -In this case all invalid UTF-8 bytes will be replaced with a quoted -representation of the byte value to allow uploading a file to such a -backend. For example, the invalid byte `0xFE` will be encoded as `‛FE`. +### mount/types: Show all possible mount types {#mount-types} -A common source of invalid UTF-8 bytes are local filesystems, that store -names in a different encoding than UTF-8 or UTF-16, like latin1. See the -[local filenames](https://rclone.org/local/#filenames) section for details. +This shows all possible mount types and returns them as a list. -#### Encoding option {#encoding} +This takes no parameters and returns -Most backends have an encoding option, specified as a flag -`--backend-encoding` where `backend` is the name of the backend, or as -a config parameter `encoding` (you'll need to select the Advanced -config in `rclone config` to see it). +- mountTypes: list of mount types -This will have default value which encodes and decodes characters in -such a way as to preserve the maximum number of characters (see -above). +The mount types are strings like "mount", "mount2", "cmount" and can +be passed to mount/mount as the mountType parameter. -However this can be incorrect in some scenarios, for example if you -have a Windows file system with Unicode fullwidth characters -`*`, `?` or `:`, that you want to remain as those characters on the -remote rather than being translated to regular (halfwidth) `*`, `?` and `:`. +Eg -The `--backend-encoding` flags allow you to change that. You can -disable the encoding completely with `--backend-encoding None` or set -`encoding = None` in the config file. + rclone rc mount/types -Encoding takes a comma separated list of encodings. You can see the -list of all possible values by passing an invalid value to this -flag, e.g. `--local-encoding "help"`. The command `rclone help flags encoding` -will show you the defaults for the backends. +**Authentication is required for this call.** -| Encoding | Characters | Encoded as | -| --------- | ---------- | ---------- | -| Asterisk | `*` | `*` | -| BackQuote | `` ` `` | ``` | -| BackSlash | `\` | `\` | -| Colon | `:` | `:` | -| CrLf | CR 0x0D, LF 0x0A | `␍`, `␊` | -| Ctl | All control characters 0x00-0x1F | `␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟` | -| Del | DEL 0x7F | `␡` | -| Dollar | `$` | `$` | -| Dot | `.` or `..` as entire string | `.`, `..` | -| DoubleQuote | `"` | `"` | -| Hash | `#` | `#` | -| InvalidUtf8 | An invalid UTF-8 character (e.g. latin1) | `�` | -| LeftCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the left of a string | `␍`, `␊`, `␉`, `␋` | -| LeftPeriod | `.` on the left of a string | `.` | -| LeftSpace | SPACE on the left of a string | `␠` | -| LeftTilde | `~` on the left of a string | `~` | -| LtGt | `<`, `>` | `<`, `>` | -| None | No characters are encoded | | -| Percent | `%` | `%` | -| Pipe | \| | `|` | -| Question | `?` | `?` | -| RightCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the right of a string | `␍`, `␊`, `␉`, `␋` | -| RightPeriod | `.` on the right of a string | `.` | -| RightSpace | SPACE on the right of a string | `␠` | -| Semicolon | `;` | `;` | -| SingleQuote | `'` | `'` | -| Slash | `/` | `/` | -| SquareBracket | `[`, `]` | `[`, `]` | +### mount/unmount: Unmount selected active mount {#mount-unmount} -##### Encoding example: FTP +rclone allows Linux, FreeBSD, macOS and Windows to +mount any of Rclone's cloud storage systems as a file system with +FUSE. -To take a specific example, the FTP backend's default encoding is +This takes the following parameters: - --ftp-encoding "Slash,Del,Ctl,RightSpace,Dot" +- mountPoint: valid path on the local machine where the mount was created (required) -However, let's say the FTP server is running on Windows and can't have -any of the invalid Windows characters in file names. You are backing -up Linux servers to this FTP server which do have those characters in -file names. So you would add the Windows set which are +Example: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot + rclone rc mount/unmount mountPoint=/home//mountPoint -to the existing ones, giving: +**Authentication is required for this call.** - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace +### mount/unmountall: Unmount all active mounts {#mount-unmountall} -This can be specified using the `--ftp-encoding` flag or using an `encoding` parameter in the config file. +rclone allows Linux, FreeBSD, macOS and Windows to +mount any of Rclone's cloud storage systems as a file system with +FUSE. -##### Encoding example: Windows +This takes no parameters and returns error if unmount does not succeed. -As a nother example, take a Windows system where there is a file with -name `Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol. -When using rclone to copy this to a remote which supports `:`, -the regular (halfwidth) colon (such as Google Drive), you will notice -that the file gets renamed to `Test:1.jpg`. +Eg -To avoid this you can change the set of characters rclone should convert -for the local filesystem, using command-line argument `--local-encoding`. -Rclone's default behavior on Windows corresponds to + rclone rc mount/unmountall -``` ---local-encoding "Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" -``` +**Authentication is required for this call.** -If you want to use fullwidth characters `:`, `*` and `?` in your filenames -without rclone changing them when uploading to a remote, then set the same as -the default value but without `Colon,Question,Asterisk`: +### operations/about: Return the space used on the remote {#operations-about} -``` ---local-encoding "Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" -``` +This takes the following parameters: -Alternatively, you can disable the conversion of any characters with `--local-encoding None`. +- fs - a remote name string e.g. "drive:" -Instead of using command-line argument `--local-encoding`, you may also set it -as [environment variable](https://rclone.org/docs/#environment-variables) `RCLONE_LOCAL_ENCODING`, -or [configure](https://rclone.org/docs/#configure) a remote of type `local` in your config, -and set the `encoding` option there. +The result is as returned from rclone about --json -The risk by doing this is that if you have a filename with the regular (halfwidth) -`:`, `*` and `?` in your cloud storage, and you try to download -it to your Windows filesystem, this will fail. These characters are not -valid in filenames on Windows, and you have told rclone not to work around -this by converting them to valid fullwidth variants. +See the [about](https://rclone.org/commands/rclone_about/) command for more information on the above. -### MIME Type ### +**Authentication is required for this call.** -MIME types (also known as media types) classify types of documents -using a simple text classification, e.g. `text/html` or -`application/pdf`. +### operations/check: check the source and destination are the same {#operations-check} -Some cloud storage systems support reading (`R`) the MIME type of -objects and some support writing (`W`) the MIME type of objects. +Checks the files in the source and destination match. It compares +sizes and hashes and logs a report of files that don't +match. It doesn't alter the source or destination. -The MIME type can be important if you are serving files directly to -HTTP from the storage system. +This takes the following parameters: -If you are copying from a remote which supports reading (`R`) to a -remote which supports writing (`W`) then rclone will preserve the MIME -types. Otherwise they will be guessed from the extension, or the -remote itself may assign the MIME type. +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- download - check by downloading rather than with hash +- checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- oneWay - check one way only, source files must exist on remote +- combined - make a combined report of changes (default false) +- missingOnSrc - report all files missing from the source (default true) +- missingOnDst - report all files missing from the destination (default true) +- match - report all matching files (default false) +- differ - report all non-matching files (default true) +- error - report all files with errors (hashing or reading) (default true) + +If you supply the download flag, it will download the data from +both remotes and check them against each other on the fly. This can +be useful for remotes that don't support hashes or if you really want +to check all the data. -### Metadata +If you supply the size-only global flag, it will only compare the sizes not +the hashes as well. Use this for a quick check. -Backends may or may support reading or writing metadata. They may -support reading and writing system metadata (metadata intrinsic to -that backend) and/or user metadata (general purpose metadata). +If you supply the checkFileHash option with a valid hash name, the +checkFileFs:checkFileRemote must point to a text file in the SUM +format. This treats the checksum file as the source and dstFs as the +destination. Note that srcFs is not used and should not be supplied in +this case. -The levels of metadata support are +Returns: -| Key | Explanation | -|-----|-------------| -| `R` | Read only System Metadata | -| `RW` | Read and write System Metadata | -| `RWU` | Read and write System Metadata and read and write User Metadata | +- success - true if no error, false otherwise +- status - textual summary of check, OK or text string +- hashType - hash used in check, may be missing +- combined - array of strings of combined report of changes +- missingOnSrc - array of strings of all files missing from the source +- missingOnDst - array of strings of all files missing from the destination +- match - array of strings of all matching files +- differ - array of strings of all non-matching files +- error - array of strings of all files with errors (hashing or reading) -See [the metadata docs](https://rclone.org/docs/#metadata) for more info. +**Authentication is required for this call.** -## Optional Features ## +### operations/cleanup: Remove trashed files in the remote or path {#operations-cleanup} -All rclone remotes support a base command set. Other features depend -upon backend-specific capabilities. +This takes the following parameters: -| Name | Purge | Copy | Move | DirMove | CleanUp | ListR | StreamUpload | LinkSharing | About | EmptyDir | -| ---------------------------- |:-----:|:----:|:----:|:-------:|:-------:|:-----:|:------------:|:------------:|:-----:|:--------:| -| 1Fichier | No | Yes | Yes | No | No | No | No | Yes | No | Yes | -| Akamai Netstorage | Yes | No | No | No | No | Yes | Yes | No | No | Yes | -| Amazon Drive | Yes | No | Yes | Yes | No | No | No | No | No | Yes | -| Amazon S3 (or S3 compatible) | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | -| Backblaze B2 | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | -| Box | Yes | Yes | Yes | Yes | Yes ‡‡ | No | Yes | Yes | Yes | Yes | -| Citrix ShareFile | Yes | Yes | Yes | Yes | No | No | Yes | No | No | Yes | -| Dropbox | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | Yes | -| Enterprise File Fabric | Yes | Yes | Yes | Yes | Yes | No | No | No | No | Yes | -| FTP | No | No | Yes | Yes | No | No | Yes | No | No | Yes | -| Google Cloud Storage | Yes | Yes | No | No | No | Yes | Yes | No | No | No | -| Google Drive | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | -| Google Photos | No | No | No | No | No | No | No | No | No | No | -| HDFS | Yes | No | Yes | Yes | No | No | Yes | No | Yes | Yes | -| HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | Yes | -| HTTP | No | No | No | No | No | No | No | No | No | Yes | -| Internet Archive | No | Yes | No | No | Yes | Yes | No | Yes | Yes | No | -| Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | -| Koofr | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | Yes | -| Mail.ru Cloud | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | -| Mega | Yes | No | Yes | Yes | Yes | No | No | Yes | Yes | Yes | -| Memory | No | Yes | No | No | No | Yes | Yes | No | No | No | -| Microsoft Azure Blob Storage | Yes | Yes | No | No | No | Yes | Yes | No | No | No | -| Microsoft OneDrive | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | -| OpenDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | -| OpenStack Swift | Yes † | Yes | No | No | No | Yes | Yes | No | Yes | No | -| Oracle Object Storage | No | Yes | No | No | Yes | Yes | Yes | No | No | No | -| pCloud | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | -| premiumize.me | Yes | No | Yes | Yes | No | No | No | Yes | Yes | Yes | -| put.io | Yes | No | Yes | Yes | Yes | No | Yes | No | Yes | Yes | -| QingStor | No | Yes | No | No | Yes | Yes | No | No | No | No | -| Seafile | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | -| SFTP | No | No | Yes | Yes | No | No | Yes | No | Yes | Yes | -| Sia | No | No | No | No | No | No | Yes | No | No | Yes | -| SMB | No | No | Yes | Yes | No | No | Yes | No | No | Yes | -| SugarSync | Yes | Yes | Yes | Yes | No | No | Yes | Yes | No | Yes | -| Storj | Yes ☨ | Yes | Yes | No | No | Yes | Yes | Yes | No | No | -| Uptobox | No | Yes | Yes | Yes | No | No | No | No | No | No | -| WebDAV | Yes | Yes | Yes | Yes | No | No | Yes ‡ | No | Yes | Yes | -| Yandex Disk | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | Yes | -| Zoho WorkDrive | Yes | Yes | Yes | Yes | No | No | No | No | Yes | Yes | -| The local filesystem | Yes | No | Yes | Yes | No | No | Yes | No | Yes | Yes | +- fs - a remote name string e.g. "drive:" -### Purge ### +See the [cleanup](https://rclone.org/commands/rclone_cleanup/) command for more information on the above. -This deletes a directory quicker than just deleting all the files in -the directory. +**Authentication is required for this call.** -† Note Swift implements this in order to delete directory markers but -they don't actually have a quicker way of deleting files other than -deleting them individually. +### operations/copyfile: Copy a file from source remote to destination remote {#operations-copyfile} -☨ Storj implements this efficiently only for entire buckets. If -purging a directory inside a bucket, files are deleted individually. +This takes the following parameters: -‡ StreamUpload is not supported with Nextcloud +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- srcRemote - a path within that remote e.g. "file.txt" for the source +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- dstRemote - a path within that remote e.g. "file2.txt" for the destination -### Copy ### +**Authentication is required for this call.** -Used when copying an object to and from the same remote. This known -as a server-side copy so you can copy a file without downloading it -and uploading it again. It is used if you use `rclone copy` or -`rclone move` if the remote doesn't support `Move` directly. +### operations/copyurl: Copy the URL to the object {#operations-copyurl} -If the server doesn't support `Copy` directly then for copy operations -the file is downloaded then re-uploaded. +This takes the following parameters: -### Move ### +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- url - string, URL to read from + - autoFilename - boolean, set to true to retrieve destination file name from url -Used when moving/renaming an object on the same remote. This is known -as a server-side move of a file. This is used in `rclone move` if the -server doesn't support `DirMove`. +See the [copyurl](https://rclone.org/commands/rclone_copyurl/) command for more information on the above. -If the server isn't capable of `Move` then rclone simulates it with -`Copy` then delete. If the server doesn't support `Copy` then rclone -will download the file and re-upload it. +**Authentication is required for this call.** -### DirMove ### +### operations/delete: Remove files in the path {#operations-delete} -This is used to implement `rclone move` to move a directory if -possible. If it isn't then it will use `Move` on each file (which -falls back to `Copy` then download and upload - see `Move` section). +This takes the following parameters: -### CleanUp ### +- fs - a remote name string e.g. "drive:" -This is used for emptying the trash for a remote by `rclone cleanup`. +See the [delete](https://rclone.org/commands/rclone_delete/) command for more information on the above. -If the server can't do `CleanUp` then `rclone cleanup` will return an -error. +**Authentication is required for this call.** -‡‡ Note that while Box implements this it has to delete every file -individually so it will be slower than emptying the trash via the WebUI +### operations/deletefile: Remove the single file pointed to {#operations-deletefile} -### ListR ### +This takes the following parameters: -The remote supports a recursive list to list all the contents beneath -a directory quickly. This enables the `--fast-list` flag to work. -See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -### StreamUpload ### +See the [deletefile](https://rclone.org/commands/rclone_deletefile/) command for more information on the above. -Some remotes allow files to be uploaded without knowing the file size -in advance. This allows certain operations to work without spooling the -file to local disk first, e.g. `rclone rcat`. +**Authentication is required for this call.** -### LinkSharing ### +### operations/fsinfo: Return information about the remote {#operations-fsinfo} -Sets the necessary permissions on a file or folder and prints a link -that allows others to access them, even if they don't have an account -on the particular cloud provider. +This takes the following parameters: -### About ### +- fs - a remote name string e.g. "drive:" -Rclone `about` prints quota information for a remote. Typical output -includes bytes used, free, quota and in trash. +This returns info about the remote passed in; -If a remote lacks about capability `rclone about remote:`returns -an error. +``` +{ + // optional features and whether they are available or not + "Features": { + "About": true, + "BucketBased": false, + "BucketBasedRootOK": false, + "CanHaveEmptyDirectories": true, + "CaseInsensitive": false, + "ChangeNotify": false, + "CleanUp": false, + "Command": true, + "Copy": false, + "DirCacheFlush": false, + "DirMove": true, + "Disconnect": false, + "DuplicateFiles": false, + "GetTier": false, + "IsLocal": true, + "ListR": false, + "MergeDirs": false, + "MetadataInfo": true, + "Move": true, + "OpenWriterAt": true, + "PublicLink": false, + "Purge": true, + "PutStream": true, + "PutUnchecked": false, + "ReadMetadata": true, + "ReadMimeType": false, + "ServerSideAcrossConfigs": false, + "SetTier": false, + "SetWrapper": false, + "Shutdown": false, + "SlowHash": true, + "SlowModTime": false, + "UnWrap": false, + "UserInfo": false, + "UserMetadata": true, + "WrapFs": false, + "WriteMetadata": true, + "WriteMimeType": false + }, + // Names of hashes available + "Hashes": [ + "md5", + "sha1", + "whirlpool", + "crc32", + "sha256", + "dropbox", + "mailru", + "quickxor" + ], + "Name": "local", // Name as created + "Precision": 1, // Precision of timestamps in ns + "Root": "/", // Path as created + "String": "Local file system at /", // how the remote will appear in logs + // Information about the system metadata for this backend + "MetadataInfo": { + "System": { + "atime": { + "Help": "Time of last access", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "btime": { + "Help": "Time of file birth (creation)", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "gid": { + "Help": "Group ID of owner", + "Type": "decimal number", + "Example": "500" + }, + "mode": { + "Help": "File type and mode", + "Type": "octal, unix style", + "Example": "0100664" + }, + "mtime": { + "Help": "Time of last modification", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "rdev": { + "Help": "Device ID (if special file)", + "Type": "hexadecimal", + "Example": "1abc" + }, + "uid": { + "Help": "User ID of owner", + "Type": "decimal number", + "Example": "500" + } + }, + "Help": "Textual help string\n" + } +} +``` -Backends without about capability cannot determine free space for an -rclone mount, or use policy `mfs` (most free space) as a member of an -rclone union remote. +This command does not have a command line equivalent so use this instead: -See [rclone about command](https://rclone.org/commands/rclone_about/) + rclone rc --loopback operations/fsinfo fs=remote: -### EmptyDir ### +### operations/list: List the given remote and path in JSON format {#operations-list} -The remote supports empty directories. See [Limitations](https://rclone.org/bugs/#limitations) - for details. Most Object/Bucket-based remotes do not support this. +This takes the following parameters: -# Global Flags +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- opt - a dictionary of options to control the listing (optional) + - recurse - If set recurse directories + - noModTime - If set return modification time + - showEncrypted - If set show decrypted names + - showOrigIDs - If set show the IDs for each item if known + - showHash - If set return a dictionary of hashes + - noMimeType - If set don't show mime types + - dirsOnly - If set only show directories + - filesOnly - If set only show files + - metadata - If set return metadata of objects also + - hashTypes - array of strings of hash types to show if showHash set -This describes the global flags available to every rclone command -split into two groups, non backend and backend flags. - -## Non Backend Flags - -These flags are available for every command. - -``` - --ask-password Allow prompt for password for encrypted configuration (default true) - --auto-confirm If enabled, do not request console confirmation - --backup-dir string Make backups into hierarchy based in DIR - --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name - --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) - --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --ca-cert stringArray CA certificate used to verify servers - --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") - --check-first Do all the checks before starting transfers - --checkers int Number of checkers to run in parallel (default 8) - -c, --checksum Skip based on checksum (if available) & size, not mod-time & size - --client-cert string Client SSL certificate (PEM) for mutual TLS auth - --client-key string Client SSL private key (PEM) for mutual TLS auth - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") - --compare-dest stringArray Include additional comma separated server-side paths during comparison - --config string Config file (default "$HOME/.config/rclone/rclone.conf") - --contimeout Duration Connect timeout (default 1m0s) - --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cpuprofile string Write cpu profile to file - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") - --delete-after When synchronizing, delete files on destination after transferring (default) - --delete-before When synchronizing, delete files on destination before transferring - --delete-during When synchronizing, delete files during transfer - --delete-excluded Delete files on dest excluded from sync - --disable string Disable a comma separated list of features (use --disable help to see a list) - --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. - --disable-http2 Disable HTTP/2 in the global transport - -n, --dry-run Do a trial run with no permanent changes - --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles - --dump-bodies Dump HTTP headers and bodies - may contain sensitive info - --dump-headers Dump HTTP headers - may contain sensitive info - --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) - --fast-list Use recursive list if available; uses more memory but fewer transactions - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) - --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) - --header stringArray Set HTTP header for all transactions - --header-download stringArray Set HTTP header for download transactions - --header-upload stringArray Set HTTP header for upload transactions - --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi - --ignore-case Ignore case in filters (case insensitive) - --ignore-case-sync Ignore case when synchronizing - --ignore-checksum Skip post copy check of checksums - --ignore-errors Delete even if there are I/O errors - --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum - -I, --ignore-times Don't skip files that match size and time - transfer all files - --immutable Do not modify files, fail if existing files have been modified - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - -i, --interactive Enable interactive mode - --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) - --log-file string Log everything to this file - --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") - --log-systemd Activate systemd integration for the logger - --low-level-retries int Number of low level retries to do (default 10) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) - --max-delete int When synchronizing, limit the number of deletes (default -1) - --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-duration Duration Maximum duration rclone will transfer data for (default 0s) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) - --max-transfer SizeSuffix Maximum size of data to transfer (default off) - --memprofile string Write memory profile to file - -M, --metadata If set, preserve metadata when copying objects - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --metadata-set stringArray Add metadata key=value when uploading - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) - --modify-window Duration Max time diff to be considered the same (default 1ns) - --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 250Mi) - --multi-thread-streams int Max number of streams to use for multi-thread downloads (default 4) - --no-check-certificate Do not verify the server SSL certificate (insecure) - --no-check-dest Don't check the destination, copy regardless - --no-console Hide console window (supported on Windows only) - --no-gzip-encoding Don't set Accept-Encoding: gzip - --no-traverse Don't traverse destination file system on copy - --no-unicode-normalization Don't normalize unicode characters in filenames - --no-update-modtime Don't update destination mod-time if files identical - --order-by string Instructions on how to order the transfers, e.g. 'size,descending' - --password-command SpaceSepList Command for supplying password for encrypted configuration - -P, --progress Show progress during transfer - --progress-terminal-title Show progress on the terminal title (requires -P/--progress) - -q, --quiet Print as little stuff as possible - --rc Enable the remote control server - --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) - --rc-allow-origin string Set the allowed origin for CORS - --rc-baseurl string Prefix for URLs - leave blank for root - --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) - --rc-client-ca string Client certificate authority to verify clients with - --rc-enable-metrics Enable prometheus metrics on /metrics - --rc-files string Path to local files to serve on the HTTP server - --rc-htpasswd string A htpasswd file - if not provided no authentication is done - --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) - --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) - --rc-key string TLS PEM Private key - --rc-max-header-bytes int Maximum size of request header (default 4096) - --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --rc-no-auth Don't require auth for certain methods - --rc-pass string Password for authentication - --rc-realm string Realm for authentication - --rc-salt string Password hashing salt (default "dlPL2MqE") - --rc-serve Enable the serving of remote objects - --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --rc-template string User-specified template - --rc-user string User name for authentication - --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") - --rc-web-gui Launch WebGUI on localhost - --rc-web-gui-force-update Force update to latest version of web gui - --rc-web-gui-no-open-browser Don't open the browser automatically - --rc-web-gui-update Check and update to latest version of web gui - --refresh-times Refresh the modtime of remote files - --retries int Retry operations this many times if they fail (default 3) - --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) - --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum - --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) - --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") - --stats-one-line Make the stats fit on one line - --stats-one-line-date Enable --stats-one-line and add current date/time prefix - --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format - --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") - --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) - --suffix string Suffix to add to changed files - --suffix-keep-extension Preserve the extension when using --suffix - --syslog Use Syslog for logging - --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") - --temp-dir string Directory rclone will use for temporary files (default "/tmp") - --timeout Duration IO idle timeout (default 5m0s) - --tpslimit float Limit HTTP transactions per second to this - --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) - --track-renames When synchronizing, track file renames and do a server-side move if possible - --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") - --transfers int Number of file transfers to run in parallel (default 4) - -u, --update Skip files that are newer on the destination - --use-cookies Enable session cookiejar - --use-json-log Use json log format - --use-mmap Use mmap allocator (see docs) - --use-server-modtime Use server modified time instead of object metadata - --user-agent string Set the user-agent to a specified string (default "rclone/v1.62.0") - -v, --verbose count Print lots more stuff (repeat for more) -``` - -## Backend Flags - -These flags are available for every command. They control the backends -and may be set in the config file. - -``` - --acd-auth-url string Auth server URL - --acd-client-id string OAuth Client Id - --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) - --acd-token string OAuth Access Token as a JSON blob - --acd-token-url string Token server url - --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) - --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive - --azureblob-account string Azure Storage Account Name - --azureblob-archive-tier-delete Delete archive tier blobs before overwriting - --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) - --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) - --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key - --azureblob-client-id string The ID of the client in use - --azureblob-client-secret string One of the service principal's client secrets - --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth - --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) - --azureblob-endpoint string Endpoint for the service - --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) - --azureblob-key string Storage Account Shared Key - --azureblob-list-chunk int Size of blob list (default 5000) - --azureblob-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --azureblob-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any - --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any - --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any - --azureblob-no-check-container If set, don't attempt to check the container exists or create it - --azureblob-no-head-object If set, do not do HEAD before GET when getting objects - --azureblob-password string The user's password (obscured) - --azureblob-public-access string Public access level of a container: blob or container - --azureblob-sas-url string SAS URL for container level access only - --azureblob-service-principal-file string Path to file containing credentials for use with a service principal - --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID - --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) - --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) - --azureblob-use-emulator Uses local storage emulator if provided as 'true' - --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) - --azureblob-username string User name (usually an email address) - --b2-account string Account ID or Application Key ID - --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) - --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) - --b2-disable-checksum Disable checksums for large (> upload cutoff) files - --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) - --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --b2-endpoint string Endpoint for the service - --b2-hard-delete Permanently delete files on remote removal, otherwise hide files - --b2-key string Application Key - --b2-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --b2-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --b2-version-at Time Show file versions as they were at the specified time (default off) - --b2-versions Include old versions in directory listings - --box-access-token string Box App Primary Access Token - --box-auth-url string Auth server URL - --box-box-config-file string Box App config.json location - --box-box-sub-type string (default "user") - --box-client-id string OAuth Client Id - --box-client-secret string OAuth Client Secret - --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) - --box-list-chunk int Size of listing chunk 1-1000 (default 1000) - --box-owned-by string Only show items owned by the login (email address) passed in - --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point - --box-token string OAuth Access Token as a JSON blob - --box-token-url string Token server url - --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) - --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) - --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming - --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") - --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) - --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) - --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") - --cache-db-purge Clear all the cached data for this remote on start - --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) - --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) - --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server - --cache-plex-password string The password of the Plex user (obscured) - --cache-plex-url string The URL of the Plex server - --cache-plex-username string The username of the Plex user - --cache-read-retries int How many times to retry a read from a cache storage (default 10) - --cache-remote string Remote to cache - --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) - --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded - --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) - --cache-workers int How many workers should run in parallel to download chunks (default 4) - --cache-writes Cache file data on writes through the FS - --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) - --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks - --chunker-hash-type string Choose how chunker handles hash sums (default "md5") - --chunker-remote string Remote to chunk/unchunk - --combine-upstreams SpaceSepList Upstreams for combining - --compress-level int GZIP compression level (-2 to 9) (default -1) - --compress-mode string Compression mode (default "gzip") - --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) - --compress-remote string Remote to compress - -L, --copy-links Follow symlinks and copy the pointed to item - --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) - --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") - --crypt-filename-encryption string How to encrypt the filenames (default "standard") - --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted - --crypt-password string Password or pass phrase for encryption (obscured) - --crypt-password2 string Password or pass phrase for salt (obscured) - --crypt-remote string Remote to encrypt/decrypt - --crypt-server-side-across-configs Allow server-side operations (e.g. copy) to work across different crypt configs - --crypt-show-mapping For all files listed show how the names encrypt - --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded - --drive-allow-import-name-change Allow the filetype to change when uploading Google docs - --drive-auth-owner-only Only consider files owned by the authenticated user - --drive-auth-url string Auth server URL - --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) - --drive-client-id string Google Application Client Id - --drive-client-secret string OAuth Client Secret - --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut - --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) - --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") - --drive-formats string Deprecated: See export_formats - --drive-impersonate string Impersonate this user when using a service account - --drive-import-formats string Comma separated list of preferred formats for uploading Google docs - --drive-keep-revision-forever Keep new head revision of each file forever - --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) - --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) - --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) - --drive-resource-key string Resource key for accessing a link-shared file - --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive - --drive-server-side-across-configs Allow server-side operations (e.g. copy) to work across different drive configs - --drive-service-account-credentials string Service Account Credentials JSON blob - --drive-service-account-file string Service Account Credentials JSON file path - --drive-shared-with-me Only show files that are shared with me - --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only - --drive-skip-dangling-shortcuts If set skip dangling shortcut files - --drive-skip-gdocs Skip google documents in all listings - --drive-skip-shortcuts If set skip shortcut files - --drive-starred-only Only show files that are starred - --drive-stop-on-download-limit Make download limit errors be fatal - --drive-stop-on-upload-limit Make upload limit errors be fatal - --drive-team-drive string ID of the Shared Drive (Team Drive) - --drive-token string OAuth Access Token as a JSON blob - --drive-token-url string Token server url - --drive-trashed-only Only show files that are in the trash - --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) - --drive-use-created-date Use file created date instead of modified date - --drive-use-shared-date Use date file was shared instead of modified date - --drive-use-trash Send files to the trash instead of deleting permanently (default true) - --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) - --dropbox-auth-url string Auth server URL - --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) - --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") - --dropbox-batch-size int Max number of files in upload batch - --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) - --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) - --dropbox-client-id string OAuth Client Id - --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) - --dropbox-impersonate string Impersonate this user when using a business account - --dropbox-shared-files Instructs rclone to work on individual shared files - --dropbox-shared-folders Instructs rclone to work on shared folders - --dropbox-token string OAuth Access Token as a JSON blob - --dropbox-token-url string Token server url - --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) - --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) - --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) - --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --filefabric-permanent-token string Permanent Authentication Token - --filefabric-root-folder-id string ID of the root folder - --filefabric-token string Session Token - --filefabric-token-expiry string Token expiry time - --filefabric-url string URL of the Enterprise File Fabric to connect to - --filefabric-version string Version read from the file fabric - --ftp-ask-password Allow asking for FTP password when needed - --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) - --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited - --ftp-disable-epsv Disable using EPSV even if server advertises support - --ftp-disable-mlsd Disable using MLSD even if server advertises support - --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) - --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) - --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD - --ftp-host string FTP host to connect to - --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --ftp-no-check-certificate Do not verify the TLS certificate of the server - --ftp-pass string FTP password (obscured) - --ftp-port int FTP port number (default 21) - --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) - --ftp-tls Use Implicit FTPS (FTP over TLS) - --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) - --ftp-user string FTP username (default "$USER") - --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) - --gcs-anonymous Access public buckets and objects without credentials - --gcs-auth-url string Auth server URL - --gcs-bucket-acl string Access Control List for new buckets - --gcs-bucket-policy-only Access checks should use bucket-level IAM policies - --gcs-client-id string OAuth Client Id - --gcs-client-secret string OAuth Client Secret - --gcs-decompress If set this will decompress gzip encoded objects - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gcs-endpoint string Endpoint for the service - --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) - --gcs-location string Location for the newly created buckets - --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it - --gcs-object-acl string Access Control List for new objects - --gcs-project-number string Project number - --gcs-service-account-file string Service Account Credentials JSON file path - --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage - --gcs-token string OAuth Access Token as a JSON blob - --gcs-token-url string Token server url - --gphotos-auth-url string Auth server URL - --gphotos-client-id string OAuth Client Id - --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gphotos-include-archived Also view and download archived media - --gphotos-read-only Set to make the Google Photos backend read only - --gphotos-read-size Set to read the size of media items - --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) - --gphotos-token string OAuth Access Token as a JSON blob - --gphotos-token-url string Token server url - --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) - --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) - --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) - --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) - --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port - --hdfs-service-principal-name string Kerberos service principal name for the namenode - --hdfs-username string Hadoop user name - --hidrive-auth-url string Auth server URL - --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) - --hidrive-client-id string OAuth Client Id - --hidrive-client-secret string OAuth Client Secret - --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") - --hidrive-root-prefix string The root/parent folder for all paths (default "/") - --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") - --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") - --hidrive-token string OAuth Access Token as a JSON blob - --hidrive-token-url string Token server url - --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) - --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) - --http-headers CommaSepList Set HTTP headers for all transactions - --http-no-head Don't use HEAD requests - --http-no-slash Set this if the site doesn't end directories with / - --http-url string URL of HTTP host to connect to - --internetarchive-access-key-id string IAS3 Access Key - --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) - --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") - --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") - --internetarchive-secret-access-key string IAS3 Secret Key (password) - --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) - --jottacloud-hard-delete Delete files permanently rather than putting them into the trash - --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) - --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them - --jottacloud-trashed-only Only show files that are in the trash - --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --koofr-endpoint string The Koofr API endpoint to use - --koofr-mountid string Mount ID of the mount to use - --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) - --koofr-provider string Choose your storage provider - --koofr-setmtime Does the backend support setting modification time (default true) - --koofr-user string Your user name - -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension - --local-case-insensitive Force the filesystem to report itself as case insensitive - --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --local-no-check-updated Don't check to see if the files change during upload - --local-no-preallocate Disable preallocation of disk space for transferred files - --local-no-set-modtime Disable setting modtime - --local-no-sparse Disable sparse files for multi-thread downloads - --local-nounc Disable UNC (long path names) conversion on Windows - --local-unicode-normalization Apply unicode NFC normalization to paths and filenames - --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) - --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --mailru-pass string Password (obscured) - --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) - --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") - --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) - --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) - --mailru-user string User name (usually email) - --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --mega-hard-delete Delete files permanently rather than putting them into the trash - --mega-pass string Password (obscured) - --mega-use-https Use HTTPS for transfers - --mega-user string User name - --netstorage-account string Set the NetStorage account name - --netstorage-host string Domain+path of NetStorage host to connect to - --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") - --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) - -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) - --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) - --onedrive-auth-url string Auth server URL - --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) - --onedrive-client-id string OAuth Client Id - --onedrive-client-secret string OAuth Client Secret - --onedrive-drive-id string The ID of the drive to use - --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) - --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings - --onedrive-hash-type string Specify the hash in use for the backend (default "auto") - --onedrive-link-password string Set the password for links created by the link command - --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") - --onedrive-link-type string Set the type of the links created by the link command (default "view") - --onedrive-list-chunk int Size of listing chunk (default 1000) - --onedrive-no-versions Remove all versions on modifying operations - --onedrive-region string Choose national cloud region for OneDrive (default "global") - --onedrive-root-folder-id string ID of the root folder - --onedrive-server-side-across-configs Allow server-side operations (e.g. copy) to work across different onedrive configs - --onedrive-token string OAuth Access Token as a JSON blob - --onedrive-token-url string Token server url - --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --oos-compartment string Object storage compartment OCID - --oos-config-file string Path to OCI config file (default "~/.oci/config") - --oos-config-profile string Profile name inside the oci config file (default "Default") - --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --oos-copy-timeout Duration Timeout for copy (default 1m0s) - --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --oos-endpoint string Endpoint for Object storage API - --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --oos-namespace string Object storage namespace - --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it - --oos-provider string Choose your Auth Provider (default "env_auth") - --oos-region string Object storage Region - --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm - --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to - --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated - --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption - --oos-sse-kms-key-id string if using using your own master key in vault, this header specifies the - --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") - --oos-upload-concurrency int Concurrency for multipart uploads (default 10) - --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) - --opendrive-password string Password (obscured) - --opendrive-username string Username - --pcloud-auth-url string Auth server URL - --pcloud-client-id string OAuth Client Id - --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") - --pcloud-password string Your pcloud password (obscured) - --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") - --pcloud-token string OAuth Access Token as a JSON blob - --pcloud-token-url string Token server url - --pcloud-username string Your pcloud username - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --qingstor-access-key-id string QingStor Access Key ID - --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) - --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) - --qingstor-endpoint string Enter an endpoint URL to connection QingStor API - --qingstor-env-auth Get QingStor credentials from runtime - --qingstor-secret-access-key string QingStor Secret Access Key (password) - --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) - --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --qingstor-zone string Zone to connect to - --s3-access-key-id string AWS Access Key ID - --s3-acl string Canned ACL used when creating buckets and storing or copying objects - --s3-bucket-acl string Canned ACL used when creating buckets - --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --s3-decompress If set this will decompress gzip encoded objects - --s3-disable-checksum Don't store MD5 checksum with object metadata - --s3-disable-http2 Disable usage of http2 for S3 backends - --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --s3-endpoint string Endpoint for S3 API - --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) - --s3-force-path-style If true use path style access if false use virtual hosted style (default true) - --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) - --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) - --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto - --s3-location-constraint string Location constraint - must be set to match the Region - --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --s3-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --s3-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) - --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it - --s3-no-head If set, don't HEAD uploaded objects to check integrity - --s3-no-head-object If set, do not do HEAD before GET when getting objects - --s3-no-system-metadata Suppress setting and reading of system metadata - --s3-profile string Profile to use in the shared credentials file - --s3-provider string Choose your S3 provider - --s3-region string Region to connect to - --s3-requester-pays Enables requester pays option when interacting with S3 bucket - --s3-secret-access-key string AWS Secret Access Key (password) - --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 - --s3-session-token string An AWS session token - --s3-shared-credentials-file string Path to the shared credentials file - --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 - --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data - --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data - --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) - --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key - --s3-storage-class string The storage class to use when storing new objects in S3 - --s3-sts-endpoint string Endpoint for STS - --s3-upload-concurrency int Concurrency for multipart uploads (default 4) - --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint - --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) - --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads - --s3-v2-auth If true use v2 authentication - --s3-version-at Time Show file versions as they were at the specified time (default off) - --s3-versions Include old versions in directory listings - --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) - --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) - --seafile-library string Name of the library - --seafile-library-key string Library password (for encrypted libraries only) (obscured) - --seafile-pass string Password (obscured) - --seafile-url string URL of seafile host to connect to - --seafile-user string User name (usually email address) - --sftp-ask-password Allow asking for SFTP password when needed - --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) - --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference - --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) - --sftp-disable-concurrent-reads If set don't use concurrent reads - --sftp-disable-concurrent-writes If set don't use concurrent writes - --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available - --sftp-host string SSH host to connect to - --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference - --sftp-key-file string Path to PEM-encoded private key file - --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) - --sftp-key-pem string Raw PEM-encoded private key - --sftp-key-use-agent When set forces the usage of the ssh-agent - --sftp-known-hosts-file string Optional path to known_hosts file - --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference - --sftp-md5sum-command string The command used to read md5 hashes - --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) - --sftp-path-override string Override path used by SSH shell commands - --sftp-port int SSH port number (default 22) - --sftp-pubkey-file string Optional path to public key file - --sftp-server-command string Specifies the path or command to run a sftp server on the remote host - --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands - --sftp-set-modtime Set the modified time on the remote if set (default true) - --sftp-sha1sum-command string The command used to read sha1 hashes - --sftp-shell-type string The type of SSH shell on remote server, if any - --sftp-skip-links Set to skip any symlinks and any other non regular files - --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") - --sftp-use-fstat If set use fstat instead of stat - --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods - --sftp-user string SSH username (default "$USER") - --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) - --sharefile-endpoint string Endpoint for API calls - --sharefile-root-folder-id string ID of the root folder - --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) - --sia-api-password string Sia Daemon API Password (obscured) - --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) - --sia-user-agent string Siad User Agent (default "Sia-Agent") - --skip-links Don't warn about skipped symlinks - --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) - --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) - --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) - --smb-host string SMB server hostname to connect to - --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --smb-pass string SMB password (obscured) - --smb-port int SMB port number (default 445) - --smb-spn string Service principal name - --smb-user string SMB username (default "$USER") - --storj-access-grant string Access grant - --storj-api-key string API key - --storj-passphrase string Encryption passphrase - --storj-provider string Choose an authentication method (default "existing") - --storj-satellite-address string Satellite address (default "us1.storj.io") - --sugarsync-access-key-id string Sugarsync Access Key ID - --sugarsync-app-id string Sugarsync App ID - --sugarsync-authorization string Sugarsync authorization - --sugarsync-authorization-expiry string Sugarsync authorization expiry - --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) - --sugarsync-hard-delete Permanently delete files if true - --sugarsync-private-access-key string Sugarsync Private Access Key - --sugarsync-refresh-token string Sugarsync refresh token - --sugarsync-root-id string Sugarsync root id - --sugarsync-user string Sugarsync user - --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) - --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) - --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) - --swift-auth string Authentication URL for server (OS_AUTH_URL) - --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) - --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) - --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) - --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) - --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") - --swift-env-auth Get swift credentials from environment variables in standard OpenStack form - --swift-key string API key or password (OS_PASSWORD) - --swift-leave-parts-on-error If true avoid calling abort upload on a failure - --swift-no-chunk Don't chunk files during streaming upload - --swift-no-large-objects Disable support for static and dynamic large objects - --swift-region string Region name - optional (OS_REGION_NAME) - --swift-storage-policy string The storage policy to use when creating a new container - --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) - --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) - --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) - --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) - --swift-user string User name to log in (OS_USERNAME) - --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) - --union-action-policy string Policy to choose upstream on ACTION category (default "epall") - --union-cache-time int Cache time of usage and free space (in seconds) (default 120) - --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") - --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) - --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") - --union-upstreams string List of space separated upstreams - --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) - --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) - --webdav-bearer-token-command string Command to run to get a bearer token - --webdav-encoding string The encoding for the backend - --webdav-headers CommaSepList Set HTTP headers for all transactions - --webdav-pass string Password (obscured) - --webdav-url string URL of http host to connect to - --webdav-user string User name - --webdav-vendor string Name of the WebDAV site/service/software you are using - --yandex-auth-url string Auth server URL - --yandex-client-id string OAuth Client Id - --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --yandex-hard-delete Delete files permanently rather than putting them into the trash - --yandex-token string OAuth Access Token as a JSON blob - --yandex-token-url string Token server url - --zoho-auth-url string Auth server URL - --zoho-client-id string OAuth Client Id - --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) - --zoho-region string Zoho region to connect to - --zoho-token string OAuth Access Token as a JSON blob - --zoho-token-url string Token server url -``` +Returns: -# Docker Volume Plugin +- list + - This is an array of objects as described in the lsjson command -## Introduction +See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. -Docker 1.9 has added support for creating -[named volumes](https://docs.docker.com/storage/volumes/) via -[command-line interface](https://docs.docker.com/engine/reference/commandline/volume_create/) -and mounting them in containers as a way to share data between them. -Since Docker 1.10 you can create named volumes with -[Docker Compose](https://docs.docker.com/compose/) by descriptions in -[docker-compose.yml](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) -files for use by container groups on a single host. -As of Docker 1.12 volumes are supported by -[Docker Swarm](https://docs.docker.com/engine/swarm/key-concepts/) -included with Docker Engine and created from descriptions in -[swarm compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) -files for use with _swarm stacks_ across multiple cluster nodes. +**Authentication is required for this call.** -[Docker Volume Plugins](https://docs.docker.com/engine/extend/plugins_volume/) -augment the default `local` volume driver included in Docker with stateful -volumes shared across containers and hosts. Unlike local volumes, your -data will _not_ be deleted when such volume is removed. Plugins can run -managed by the docker daemon, as a native system service -(under systemd, _sysv_ or _upstart_) or as a standalone executable. -Rclone can run as docker volume plugin in all these modes. -It interacts with the local docker daemon -via [plugin API](https://docs.docker.com/engine/extend/plugin_api/) and -handles mounting of remote file systems into docker containers so it must -run on the same host as the docker daemon or on every Swarm node. +### operations/mkdir: Make a destination directory or container {#operations-mkdir} -## Getting started +This takes the following parameters: -In the first example we will use the [SFTP](https://rclone.org/sftp/) -rclone volume with Docker engine on a standalone Ubuntu machine. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -Start from [installing Docker](https://docs.docker.com/engine/install/) -on the host. +See the [mkdir](https://rclone.org/commands/rclone_mkdir/) command for more information on the above. -The _FUSE_ driver is a prerequisite for rclone mounting and should be -installed on host: -``` -sudo apt-get -y install fuse -``` +**Authentication is required for this call.** -Create two directories required by rclone docker plugin: -``` -sudo mkdir -p /var/lib/docker-plugins/rclone/config -sudo mkdir -p /var/lib/docker-plugins/rclone/cache -``` +### operations/movefile: Move a file from source remote to destination remote {#operations-movefile} -Install the managed rclone docker plugin for your architecture (here `amd64`): -``` -docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions -docker plugin list -``` +This takes the following parameters: -Create your [SFTP volume](https://rclone.org/sftp/#standard-options): -``` -docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true -``` +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- srcRemote - a path within that remote e.g. "file.txt" for the source +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- dstRemote - a path within that remote e.g. "file2.txt" for the destination -Note that since all options are static, you don't even have to run -`rclone config` or create the `rclone.conf` file (but the `config` directory -should still be present). In the simplest case you can use `localhost` -as _hostname_ and your SSH credentials as _username_ and _password_. -You can also change the remote path to your home directory on the host, -for example `-o path=/home/username`. +**Authentication is required for this call.** +### operations/publiclink: Create or retrieve a public link to the given file or folder. {#operations-publiclink} -Time to create a test container and mount the volume into it: -``` -docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash -``` +This takes the following parameters: -If all goes well, you will enter the new container and change right to -the mounted SFTP remote. You can type `ls` to list the mounted directory -or otherwise play with it. Type `exit` when you are done. -The container will stop but the volume will stay, ready to be reused. -When it's not needed anymore, remove it: -``` -docker volume list -docker volume remove firstvolume -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- unlink - boolean - if set removes the link rather than adding it (optional) +- expire - string - the expiry time of the link e.g. "1d" (optional) -Now let us try **something more elaborate**: -[Google Drive](https://rclone.org/drive/) volume on multi-node Docker Swarm. +Returns: -You should start from installing Docker and FUSE, creating plugin -directories and installing rclone plugin on _every_ swarm node. -Then [setup the Swarm](https://docs.docker.com/engine/swarm/swarm-mode/). +- url - URL of the resource -Google Drive volumes need an access token which can be setup via web -browser and will be periodically renewed by rclone. The managed -plugin cannot run a browser so we will use a technique similar to the -[rclone setup on a headless box](https://rclone.org/remote_setup/). +See the [link](https://rclone.org/commands/rclone_link/) command for more information on the above. -Run [rclone config](https://rclone.org/commands/rclone_config_create/) -on _another_ machine equipped with _web browser_ and graphical user interface. -Create the [Google Drive remote](https://rclone.org/drive/#standard-options). -When done, transfer the resulting `rclone.conf` to the Swarm cluster -and save as `/var/lib/docker-plugins/rclone/config/rclone.conf` -on _every_ node. By default this location is accessible only to the -root user so you will need appropriate privileges. The resulting config -will look like this: -``` -[gdrive] -type = drive -scope = drive -drive_id = 1234567... -root_folder_id = 0Abcd... -token = {"access_token":...} -``` +**Authentication is required for this call.** -Now create the file named `example.yml` with a swarm stack description -like this: -``` -version: '3' -services: - heimdall: - image: linuxserver/heimdall:latest - ports: [8080:80] - volumes: [configdata:/config] -volumes: - configdata: - driver: rclone - driver_opts: - remote: 'gdrive:heimdall' - allow_other: 'true' - vfs_cache_mode: full - poll_interval: 0 -``` +### operations/purge: Remove a directory or container and all of its contents {#operations-purge} -and run the stack: -``` -docker stack deploy example -c ./example.yml -``` +This takes the following parameters: -After a few seconds docker will spread the parsed stack description -over cluster, create the `example_heimdall` service on port _8080_, -run service containers on one or more cluster nodes and request -the `example_configdata` volume from rclone plugins on the node hosts. -You can use the following commands to confirm results: -``` -docker service ls -docker service ps example_heimdall -docker volume ls -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -Point your browser to `http://cluster.host.address:8080` and play with -the service. Stop it with `docker stack remove example` when you are done. -Note that the `example_configdata` volume(s) created on demand at the -cluster nodes will not be automatically removed together with the stack -but stay for future reuse. You can remove them manually by invoking -the `docker volume remove example_configdata` command on every node. +See the [purge](https://rclone.org/commands/rclone_purge/) command for more information on the above. -## Creating Volumes via CLI +**Authentication is required for this call.** -Volumes can be created with [docker volume create](https://docs.docker.com/engine/reference/commandline/volume_create/). -Here are a few examples: -``` -docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full -docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall -docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 -``` +### operations/rmdir: Remove an empty directory or container {#operations-rmdir} -Note the `-d rclone` flag that tells docker to request volume from the -rclone driver. This works even if you installed managed driver by its full -name `rclone/docker-volume-rclone` because you provided the `--alias rclone` -option. +This takes the following parameters: -Volumes can be inspected as follows: -``` -docker volume list -docker volume inspect vol1 -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -## Volume Configuration +See the [rmdir](https://rclone.org/commands/rclone_rmdir/) command for more information on the above. -Rclone flags and volume options are set via the `-o` flag to the -`docker volume create` command. They include backend-specific parameters -as well as mount and _VFS_ options. Also there are a few -special `-o` options: -`remote`, `fs`, `type`, `path`, `mount-type` and `persist`. +**Authentication is required for this call.** -`remote` determines an existing remote name from the config file, with -trailing colon and optionally with a remote path. See the full syntax in -the [rclone documentation](https://rclone.org/docs/#syntax-of-remote-paths). -This option can be aliased as `fs` to prevent confusion with the -_remote_ parameter of such backends as _crypt_ or _alias_. +### operations/rmdirs: Remove all the empty directories in the path {#operations-rmdirs} -The `remote=:backend:dir/subdir` syntax can be used to create -[on-the-fly (config-less) remotes](https://rclone.org/docs/#backend-path-to-dir), -while the `type` and `path` options provide a simpler alternative for this. -Using two split options -``` --o type=backend -o path=dir/subdir -``` -is equivalent to the combined syntax -``` --o remote=:backend:dir/subdir -``` -but is arguably easier to parameterize in scripts. -The `path` part is optional. +This takes the following parameters: -[Mount and VFS options](https://rclone.org/commands/rclone_serve_docker/#options) -as well as [backend parameters](https://rclone.org/flags/#backend-flags) are named -like their twin command-line flags without the `--` CLI prefix. -Optionally you can use underscores instead of dashes in option names. -For example, `--vfs-cache-mode full` becomes -`-o vfs-cache-mode=full` or `-o vfs_cache_mode=full`. -Boolean CLI flags without value will gain the `true` value, e.g. -`--allow-other` becomes `-o allow-other=true` or `-o allow_other=true`. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- leaveRoot - boolean, set to true not to delete the root -Please note that you can provide parameters only for the backend immediately -referenced by the backend type of mounted `remote`. -If this is a wrapping backend like _alias, chunker or crypt_, you cannot -provide options for the referred to remote or backend. This limitation is -imposed by the rclone connection string parser. The only workaround is to -feed plugin with `rclone.conf` or configure plugin arguments (see below). +See the [rmdirs](https://rclone.org/commands/rclone_rmdirs/) command for more information on the above. -## Special Volume Options +**Authentication is required for this call.** -`mount-type` determines the mount method and in general can be one of: -`mount`, `cmount`, or `mount2`. This can be aliased as `mount_type`. -It should be noted that the managed rclone docker plugin currently does -not support the `cmount` method and `mount2` is rarely needed. -This option defaults to the first found method, which is usually `mount` -so you generally won't need it. +### operations/settier: Changes storage tier or class on all files in the path {#operations-settier} -`persist` is a reserved boolean (true/false) option. -In future it will allow to persist on-the-fly remotes in the plugin -`rclone.conf` file. +This takes the following parameters: -## Connection Strings +- fs - a remote name string e.g. "drive:" -The `remote` value can be extended -with [connection strings](https://rclone.org/docs/#connection-strings) -as an alternative way to supply backend parameters. This is equivalent -to the `-o` backend options with one _syntactic difference_. -Inside connection string the backend prefix must be dropped from parameter -names but in the `-o param=value` array it must be present. -For instance, compare the following option array -``` --o remote=:sftp:/home -o sftp-host=localhost -``` -with equivalent connection string: -``` --o remote=:sftp,host=localhost:/home -``` -This difference exists because flag options `-o key=val` include not only -backend parameters but also mount/VFS flags and possibly other settings. -Also it allows to discriminate the `remote` option from the `crypt-remote` -(or similarly named backend parameters) and arguably simplifies scripting -due to clearer value substitution. +See the [settier](https://rclone.org/commands/rclone_settier/) command for more information on the above. -## Using with Swarm or Compose +**Authentication is required for this call.** -Both _Docker Swarm_ and _Docker Compose_ use -[YAML](http://yaml.org/spec/1.2/spec.html)-formatted text files to describe -groups (stacks) of containers, their properties, networks and volumes. -_Compose_ uses the [compose v2](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) format, -_Swarm_ uses the [compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) format. -They are mostly similar, differences are explained in the -[docker documentation](https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading). +### operations/settierfile: Changes storage tier or class on the single file pointed to {#operations-settierfile} -Volumes are described by the children of the top-level `volumes:` node. -Each of them should be named after its volume and have at least two -elements, the self-explanatory `driver: rclone` value and the -`driver_opts:` structure playing the same role as `-o key=val` CLI flags: +This takes the following parameters: -``` -volumes: - volume_name_1: - driver: rclone - driver_opts: - remote: 'gdrive:' - allow_other: 'true' - vfs_cache_mode: full - token: '{"type": "borrower", "expires": "2021-12-31"}' - poll_interval: 0 -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -Notice a few important details: -- YAML prefers `_` in option names instead of `-`. -- YAML treats single and double quotes interchangeably. - Simple strings and integers can be left unquoted. -- Boolean values must be quoted like `'true'` or `"false"` because - these two words are reserved by YAML. -- The filesystem string is keyed with `remote` (or with `fs`). - Normally you can omit quotes here, but if the string ends with colon, - you **must** quote it like `remote: "storage_box:"`. -- YAML is picky about surrounding braces in values as this is in fact - another [syntax for key/value mappings](http://yaml.org/spec/1.2/spec.html#id2790832). - For example, JSON access tokens usually contain double quotes and - surrounding braces, so you must put them in single quotes. +See the [settierfile](https://rclone.org/commands/rclone_settierfile/) command for more information on the above. -## Installing as Managed Plugin +**Authentication is required for this call.** -Docker daemon can install plugins from an image registry and run them managed. -We maintain the -[docker-volume-rclone](https://hub.docker.com/p/rclone/docker-volume-rclone/) -plugin image on [Docker Hub](https://hub.docker.com). +### operations/size: Count the number of bytes and files in remote {#operations-size} -Rclone volume plugin requires **Docker Engine >= 19.03.15** +This takes the following parameters: -The plugin requires presence of two directories on the host before it can -be installed. Note that plugin will **not** create them automatically. -By default they must exist on host at the following locations -(though you can tweak the paths): -- `/var/lib/docker-plugins/rclone/config` - is reserved for the `rclone.conf` config file and **must** exist - even if it's empty and the config file is not present. -- `/var/lib/docker-plugins/rclone/cache` - holds the plugin state file as well as optional VFS caches. +- fs - a remote name string e.g. "drive:path/to/dir" -You can [install managed plugin](https://docs.docker.com/engine/reference/commandline/plugin_install/) -with default settings as follows: -``` -docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone -``` +Returns: -The `:amd64` part of the image specification after colon is called a _tag_. -Usually you will want to install the latest plugin for your architecture. In -this case the tag will just name it, like `amd64` above. The following plugin -architectures are currently available: -- `amd64` -- `arm64` -- `arm-v7` +- count - number of files +- bytes - number of bytes in those files -Sometimes you might want a concrete plugin version, not the latest one. -Then you should use image tag in the form `:ARCHITECTURE-VERSION`. -For example, to install plugin version `v1.56.2` on architecture `arm64` -you will use tag `arm64-1.56.2` (note the removed `v`) so the full image -specification becomes `rclone/docker-volume-rclone:arm64-1.56.2`. +See the [size](https://rclone.org/commands/rclone_size/) command for more information on the above. -We also provide the `latest` plugin tag, but since docker does not support -multi-architecture plugins as of the time of this writing, this tag is -currently an **alias for `amd64`**. -By convention the `latest` tag is the default one and can be omitted, thus -both `rclone/docker-volume-rclone:latest` and just `rclone/docker-volume-rclone` -will refer to the latest plugin release for the `amd64` platform. +**Authentication is required for this call.** -Also the `amd64` part can be omitted from the versioned rclone plugin tags. -For example, rclone image reference `rclone/docker-volume-rclone:amd64-1.56.2` -can be abbreviated as `rclone/docker-volume-rclone:1.56.2` for convenience. -However, for non-intel architectures you still have to use the full tag as -`amd64` or `latest` will fail to start. +### operations/stat: Give information about the supplied file or directory {#operations-stat} -Managed plugin is in fact a special container running in a namespace separate -from normal docker containers. Inside it runs the `rclone serve docker` -command. The config and cache directories are bind-mounted into the -container at start. The docker daemon connects to a unix socket created -by the command inside the container. The command creates on-demand remote -mounts right inside, then docker machinery propagates them through kernel -mount namespaces and bind-mounts into requesting user containers. +This takes the following parameters -You can tweak a few plugin settings after installation when it's disabled -(not in use), for instance: -``` -docker plugin disable rclone -docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args="--vfs-cache-mode=writes --allow-other" -docker plugin enable rclone -docker plugin inspect rclone -``` +- fs - a remote name string eg "drive:" +- remote - a path within that remote eg "dir" +- opt - a dictionary of options to control the listing (optional) + - see operations/list for the options -Note that if docker refuses to disable the plugin, you should find and -remove all active volumes connected with it as well as containers and -swarm services that use them. This is rather tedious so please carefully -plan in advance. +The result is -You can tweak the following settings: -`args`, `config`, `cache`, `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` -and `RCLONE_VERBOSE`. -It's _your_ task to keep plugin settings in sync across swarm cluster nodes. +- item - an object as described in the lsjson command. Will be null if not found. -`args` sets command-line arguments for the `rclone serve docker` command -(_none_ by default). Arguments should be separated by space so you will -normally want to put them in quotes on the -[docker plugin set](https://docs.docker.com/engine/reference/commandline/plugin_set/) -command line. Both [serve docker flags](https://rclone.org/commands/rclone_serve_docker/#options) -and [generic rclone flags](https://rclone.org/flags/) are supported, including backend -parameters that will be used as defaults for volume creation. -Note that plugin will fail (due to [this docker bug](https://github.com/moby/moby/blob/v20.10.7/plugin/v2/plugin.go#L195)) -if the `args` value is empty. Use e.g. `args="-v"` as a workaround. +Note that if you are only interested in files then it is much more +efficient to set the filesOnly flag in the options. -`config=/host/dir` sets alternative host location for the config directory. -Plugin will look for `rclone.conf` here. It's not an error if the config -file is not present but the directory must exist. Please note that plugin -can periodically rewrite the config file, for example when it renews -storage access tokens. Keep this in mind and try to avoid races between -the plugin and other instances of rclone on the host that might try to -change the config simultaneously resulting in corrupted `rclone.conf`. -You can also put stuff like private key files for SFTP remotes in this -directory. Just note that it's bind-mounted inside the plugin container -at the predefined path `/data/config`. For example, if your key file is -named `sftp-box1.key` on the host, the corresponding volume config option -should read `-o sftp-key-file=/data/config/sftp-box1.key`. +See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. -`cache=/host/dir` sets alternative host location for the _cache_ directory. -The plugin will keep VFS caches here. Also it will create and maintain -the `docker-plugin.state` file in this directory. When the plugin is -restarted or reinstalled, it will look in this file to recreate any volumes -that existed previously. However, they will not be re-mounted into -consuming containers after restart. Usually this is not a problem as -the docker daemon normally will restart affected user containers after -failures, daemon restarts or host reboots. +**Authentication is required for this call.** -`RCLONE_VERBOSE` sets plugin verbosity from `0` (errors only, by default) -to `2` (debugging). Verbosity can be also tweaked via `args="-v [-v] ..."`. -Since arguments are more generic, you will rarely need this setting. -The plugin output by default feeds the docker daemon log on local host. -Log entries are reflected as _errors_ in the docker log but retain their -actual level assigned by rclone in the encapsulated message string. +### operations/uploadfile: Upload file using multiform/form-data {#operations-uploadfile} -`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` customize the plugin proxy settings. +This takes the following parameters: -You can set custom plugin options right when you install it, _in one go_: -``` -docker plugin remove rclone -docker plugin install rclone/docker-volume-rclone:amd64 \ - --alias rclone --grant-all-permissions \ - args="-v --allow-other" config=/etc/rclone -docker plugin inspect rclone -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- each part in body represents a file to be uploaded -## Healthchecks +See the [uploadfile](https://rclone.org/commands/rclone_uploadfile/) command for more information on the above. -The docker plugin volume protocol doesn't provide a way for plugins -to inform the docker daemon that a volume is (un-)available. -As a workaround you can setup a healthcheck to verify that the mount -is responding, for example: -``` -services: - my_service: - image: my_image - healthcheck: - test: ls /path/to/rclone/mount || exit 1 - interval: 1m - timeout: 15s - retries: 3 - start_period: 15s -``` +**Authentication is required for this call.** -## Running Plugin under Systemd +### options/blocks: List all the option blocks {#options-blocks} -In most cases you should prefer managed mode. Moreover, MacOS and Windows -do not support native Docker plugins. Please use managed mode on these -systems. Proceed further only if you are on Linux. +Returns: +- options - a list of the options block names -First, [install rclone](https://rclone.org/install/). -You can just run it (type `rclone serve docker` and hit enter) for the test. +### options/get: Get all the global options {#options-get} -Install _FUSE_: -``` -sudo apt-get -y install fuse -``` +Returns an object where keys are option block names and values are an +object with the current option values in. -Download two systemd configuration files: -[docker-volume-rclone.service](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.service) -and [docker-volume-rclone.socket](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.socket). +Note that these are the global options which are unaffected by use of +the _config and _filter parameters. If you wish to read the parameters +set in _config then use options/config and for _filter use options/filter. -Put them to the `/etc/systemd/system/` directory: -``` -cp docker-volume-plugin.service /etc/systemd/system/ -cp docker-volume-plugin.socket /etc/systemd/system/ -``` +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. -Please note that all commands in this section must be run as _root_ but -we omit `sudo` prefix for brevity. -Now create directories required by the service: -``` -mkdir -p /var/lib/docker-volumes/rclone -mkdir -p /var/lib/docker-plugins/rclone/config -mkdir -p /var/lib/docker-plugins/rclone/cache -``` +### options/local: Get the currently active config for this call {#options-local} -Run the docker plugin service in the socket activated mode: -``` -systemctl daemon-reload -systemctl start docker-volume-rclone.service -systemctl enable docker-volume-rclone.socket -systemctl start docker-volume-rclone.socket -systemctl restart docker -``` +Returns an object with the keys "config" and "filter". +The "config" key contains the local config and the "filter" key contains +the local filters. -Or run the service directly: -- run `systemctl daemon-reload` to let systemd pick up new config -- run `systemctl enable docker-volume-rclone.service` to make the new - service start automatically when you power on your machine. -- run `systemctl start docker-volume-rclone.service` - to start the service now. -- run `systemctl restart docker` to restart docker daemon and let it - detect the new plugin socket. Note that this step is not needed in - managed mode where docker knows about plugin state changes. +Note that these are the local options specific to this rc call. If +_config was not supplied then they will be the global options. +Likewise with "_filter". -The two methods are equivalent from the user perspective, but I personally -prefer socket activation. +This call is mostly useful for seeing if _config and _filter passing +is working. -## Troubleshooting +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. -You can [see managed plugin settings](https://docs.docker.com/engine/extend/#debugging-plugins) -with -``` -docker plugin list -docker plugin inspect rclone -``` -Note that docker (including latest 20.10.7) will not show actual values -of `args`, just the defaults. +### options/set: Set an option {#options-set} -Use `journalctl --unit docker` to see managed plugin output as part of -the docker daemon log. Note that docker reflects plugin lines as _errors_ -but their actual level can be seen from encapsulated message string. +Parameters: -You will usually install the latest version of managed plugin for your platform. -Use the following commands to print the actual installed version: -``` -PLUGID=$(docker plugin list --no-trunc | awk '/rclone/{print$1}') -sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version -``` +- option block name containing an object with + - key: value -You can even use `runc` to run shell inside the plugin container: -``` -sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash -``` +Repeated as often as required. -Also you can use curl to check the plugin socket connectivity: -``` -docker plugin list --no-trunc -PLUGID=123abc... -sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate -``` -though this is rarely needed. +Only supply the options you wish to change. If an option is unknown +it will be silently ignored. Not all options will have an effect when +changed like this. -## Caveats +For example: -Finally I'd like to mention a _caveat with updating volume settings_. -Docker CLI does not have a dedicated command like `docker volume update`. -It may be tempting to invoke `docker volume create` with updated options -on existing volume, but there is a gotcha. The command will do nothing, -it won't even return an error. I hope that docker maintainers will fix -this some day. In the meantime be aware that you must remove your volume -before recreating it with new settings: -``` -docker volume remove my_vol -docker volume create my_vol -d rclone -o opt1=new_val1 ... -``` +This sets DEBUG level logs (-vv) (these can be set by number or string) -and verify that settings did update: -``` -docker volume list -docker volume inspect my_vol -``` + rclone rc options/set --json '{"main": {"LogLevel": "DEBUG"}}' + rclone rc options/set --json '{"main": {"LogLevel": 8}}' -If docker refuses to remove the volume, you should find containers -or swarm services that use it and stop them first. +And this sets INFO level logs (-v) -## Getting started {#getting-started} + rclone rc options/set --json '{"main": {"LogLevel": "INFO"}}' -- [Install rclone](https://rclone.org/install/) and setup your remotes. -- Bisync will create its working directory - at `~/.cache/rclone/bisync` on Linux - or `C:\Users\MyLogin\AppData\Local\rclone\bisync` on Windows. - Make sure that this location is writable. -- Run bisync with the `--resync` flag, specifying the paths - to the local and remote sync directory roots. -- For successive sync runs, leave off the `--resync` flag. -- Consider using a [filters file](#filtering) for excluding - unnecessary files and directories from the sync. -- Consider setting up the [--check-access](#check-access) feature - for safety. -- On Linux, consider setting up a [crontab entry](#cron). bisync can - safely run in concurrent cron jobs thanks to lock files it maintains. +And this sets NOTICE level logs (normal without -v) -Here is a typical run log (with timestamps removed for clarity): + rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}' -``` -rclone bisync /testdir/path1/ /testdir/path2/ --verbose -INFO : Synching Path1 "/testdir/path1/" with Path2 "/testdir/path2/" -INFO : Path1 checking for diffs -INFO : - Path1 File is new - file11.txt -INFO : - Path1 File is newer - file2.txt -INFO : - Path1 File is newer - file5.txt -INFO : - Path1 File is newer - file7.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file6.txt -INFO : - Path1 File was deleted - file8.txt -INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted -INFO : Path2 checking for diffs -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file5.txt -INFO : - Path2 File is newer - file6.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file7.txt -INFO : - Path2 File was deleted - file8.txt -INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted -INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt -INFO : - Path2 Queue delete - /testdir/path2/file4.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt -INFO : - Path1 Queue delete - /testdir/path1/file3.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 -INFO : - Do queued deletes on - Path1 -INFO : - Do queued deletes on - Path2 -INFO : Updating listings -INFO : Validating listings for Path1 "/testdir/path1/" vs Path2 "/testdir/path2/" -INFO : Bisync successful -``` +### pluginsctl/addPlugin: Add a plugin using url {#pluginsctl-addPlugin} -## Command line syntax +Used for adding a plugin to the webgui. -``` -$ rclone bisync --help -Usage: - rclone bisync remote1:path1 remote2:path2 [flags] +This takes the following parameters: -Positional arguments: - Path1, Path2 Local path, or remote storage with ':' plus optional path. - Type 'rclone listremotes' for list of configured remotes. +- url - http url of the github repo where the plugin is hosted (http://github.com/rclone/rclone-webui-react). -Optional Flags: - --check-access Ensure expected `RCLONE_TEST` files are found on - both Path1 and Path2 filesystems, else abort. - --check-filename FILENAME Filename for `--check-access` (default: `RCLONE_TEST`) - --check-sync CHOICE Controls comparison of final listings: - `true | false | only` (default: true) - If set to `only`, bisync will only compare listings - from the last run but skip actual sync. - --filters-file PATH Read filtering patterns from a file - --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. - If exceeded, the bisync run will abort. (default: 50%) - --force Bypass `--max-delete` safety check and run the sync. - Consider using with `--verbose` - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. - Warning: Path1 files may overwrite Path2 versions. - Consider using `--verbose` or `--dry-run` first. - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --workdir PATH Use custom working directory (useful for testing). - (default: `~/.cache/rclone/bisync`) - -n, --dry-run Go through the motions - No files are copied/deleted. - -v, --verbose Increases logging verbosity. - May be specified more than once for more details. - -h, --help help for bisync -``` +Example: -Arbitrary rclone flags may be specified on the -[bisync command line](https://rclone.org/commands/rclone_bisync/), for example -`rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s` -Note that interactions of various rclone flags with bisync process flow -has not been fully tested yet. + rclone rc pluginsctl/addPlugin -### Paths +**Authentication is required for this call.** -Path1 and Path2 arguments may be references to any mix of local directory -paths (absolute or relative), UNC paths (`//server/share/path`), -Windows drive paths (with a drive letter and `:`) or configured -[remotes](https://rclone.org/docs/#syntax-of-remote-paths) with optional subdirectory paths. -Cloud references are distinguished by having a `:` in the argument -(see [Windows support](#windows) below). +### pluginsctl/getPluginsForType: Get plugins with type criteria {#pluginsctl-getPluginsForType} -Path1 and Path2 are treated equally, in that neither has priority for -file changes, and access efficiency does not change whether a remote -is on Path1 or Path2. +This shows all possible plugins by a mime type. -The listings in bisync working directory (default: `~/.cache/rclone/bisync`) -are named based on the Path1 and Path2 arguments so that separate syncs -to individual directories within the tree may be set up, e.g.: -`path_to_local_tree..dropbox_subdir.lst`. +This takes the following parameters: -Any empty directories after the sync on both the Path1 and Path2 -filesystems are not deleted by default. If the `--remove-empty-dirs` -flag is specified, then both paths will have any empty directories purged -as the last step in the process. +- type - supported mime type by a loaded plugin e.g. (video/mp4, audio/mp3). +- pluginType - filter plugins based on their type e.g. (DASHBOARD, FILE_HANDLER, TERMINAL). -## Command-line flags +Returns: -#### --resync +- loadedPlugins - list of current production plugins. +- testPlugins - list of temporarily loaded development plugins, usually running on a different server. -This will effectively make both Path1 and Path2 filesystems contain a -matching superset of all files. Path2 files that do not exist in Path1 will -be copied to Path1, and the process will then sync the Path1 tree to Path2. +Example: -The base directories on the both Path1 and Path2 filesystems must exist -or bisync will fail. This is required for safety - that bisync can verify -that both paths are valid. + rclone rc pluginsctl/getPluginsForType type=video/mp4 -When using `--resync`, a newer version of a file either on Path1 or Path2 -filesystem, will overwrite the file on the other path (only the last version -will be kept). Carefully evaluate deltas using [--dry-run](https://rclone.org/flags/#non-backend-flags). +**Authentication is required for this call.** -For a resync run, one of the paths may be empty (no files in the path tree). -The resync run should result in files on both paths, else a normal non-resync -run will fail. +### pluginsctl/listPlugins: Get the list of currently loaded plugins {#pluginsctl-listPlugins} -For a non-resync run, either path being empty (no files in the tree) fails with -`Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst` -This is a safety check that an unexpected empty path does not result in -deleting **everything** in the other path. +This allows you to get the currently enabled plugins and their details. -#### --check-access +This takes no parameters and returns: -Access check files are an additional safety measure against data loss. -bisync will ensure it can find matching `RCLONE_TEST` files in the same places -in the Path1 and Path2 filesystems. -`RCLONE_TEST` files are not generated automatically. -For `--check-access`to succeed, you must first either: -**A)** Place one or more `RCLONE_TEST` files in the Path1 or Path2 filesystem -and then do either a run without `--check-access` or a [--resync](#resync) to -set matching files on both filesystems, or -**B)** Set `--check-filename` to a filename already in use in various locations -throughout your sync'd fileset. -Time stamps and file contents are not important, just the names and locations. -If you have symbolic links in your sync tree it is recommended to place -`RCLONE_TEST` files in the linked-to directory tree to protect against -bisync assuming a bunch of deleted files if the linked-to tree should not be -accessible. -See also the [--check-filename](--check-filename) flag. +- loadedPlugins - list of current production plugins. +- testPlugins - list of temporarily loaded development plugins, usually running on a different server. -#### --check-filename +E.g. -Name of the file(s) used in access health validation. -The default `--check-filename` is `RCLONE_TEST`. -One or more files having this filename must exist, synchronized between your -source and destination filesets, in order for `--check-access` to succeed. -See [--check-access](#check-access) for additional details. + rclone rc pluginsctl/listPlugins -#### --max-delete +**Authentication is required for this call.** -As a safety check, if greater than the `--max-delete` percent of files were -deleted on either the Path1 or Path2 filesystem, then bisync will abort with -a warning message, without making any changes. -The default `--max-delete` is `50%`. -One way to trigger this limit is to rename a directory that contains more -than half of your files. This will appear to bisync as a bunch of deleted -files and a bunch of new files. -This safety check is intended to block bisync from deleting all of the -files on both filesystems due to a temporary network access issue, or if -the user had inadvertently deleted the files on one side or the other. -To force the sync either set a different delete percentage limit, -e.g. `--max-delete 75` (allows up to 75% deletion), or use `--force` -to bypass the check. +### pluginsctl/listTestPlugins: Show currently loaded test plugins {#pluginsctl-listTestPlugins} -Also see the [all files changed](#all-files-changed) check. +Allows listing of test plugins with the rclone.test set to true in package.json of the plugin. -#### --filters-file {#filters-file} +This takes no parameters and returns: -By using rclone filter features you can exclude file types or directory -sub-trees from the sync. -See the [bisync filters](#filtering) section and generic -[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) -documentation. -An [example filters file](#example-filters-file) contains filters for -non-allowed files for synching with Dropbox. +- loadedTestPlugins - list of currently available test plugins. -If you make changes to your filters file then bisync requires a run -with `--resync`. This is a safety feature, which avoids existing files -on the Path1 and/or Path2 side from seeming to disappear from view -(since they are excluded in the new listings), which would fool bisync -into seeing them as deleted (as compared to the prior run listings), -and then bisync would proceed to delete them for real. +E.g. -To block this from happening bisync calculates an MD5 hash of the filters file -and stores the hash in a `.md5` file in the same place as your filters file. -On the next runs with `--filters-file` set, bisync re-calculates the MD5 hash -of the current filters file and compares it to the hash stored in `.md5` file. -If they don't match the run aborts with a critical error and thus forces you -to do a `--resync`, likely avoiding a disaster. + rclone rc pluginsctl/listTestPlugins -#### --check-sync +**Authentication is required for this call.** -Enabled by default, the check-sync function checks that all of the same -files exist in both the Path1 and Path2 history listings. This _check-sync_ -integrity check is performed at the end of the sync run by default. -Any untrapped failing copy/deletes between the two paths might result -in differences between the two listings and in the untracked file content -differences between the two paths. A resync run would correct the error. +### pluginsctl/removePlugin: Remove a loaded plugin {#pluginsctl-removePlugin} -Note that the default-enabled integrity check locally executes a load of both -the final Path1 and Path2 listings, and thus adds to the run time of a sync. -Using `--check-sync=false` will disable it and may significantly reduce the -sync run times for very large numbers of files. +This allows you to remove a plugin using it's name. -The check may be run manually with `--check-sync=only`. It runs only the -integrity check and terminates without actually synching. +This takes parameters: -## Operation +- name - name of the plugin in the format `author`/`plugin_name`. -### Runtime flow details +E.g. -bisync retains the listings of the `Path1` and `Path2` filesystems -from the prior run. -On each successive run it will: + rclone rc pluginsctl/removePlugin name=rclone/video-plugin -- list files on `path1` and `path2`, and check for changes on each side. - Changes include `New`, `Newer`, `Older`, and `Deleted` files. -- Propagate changes on `path1` to `path2`, and vice-versa. +**Authentication is required for this call.** -### Safety measures +### pluginsctl/removeTestPlugin: Remove a test plugin {#pluginsctl-removeTestPlugin} -- Lock file prevents multiple simultaneous runs when taking a while. - This can be particularly useful if bisync is run by cron scheduler. -- Handle change conflicts non-destructively by creating - `..path1` and `..path2` file versions. -- File system access health check using `RCLONE_TEST` files - (see the `--check-access` flag). -- Abort on excessive deletes - protects against a failed listing - being interpreted as all the files were deleted. - See the `--max-delete` and `--force` flags. -- If something evil happens, bisync goes into a safe state to block - damage by later runs. (See [Error Handling](#error-handling)) +This allows you to remove a plugin using it's name. -### Normal sync checks +This takes the following parameters: - Type | Description | Result | Implementation ---------------|-----------------------------------------------|--------------------------|----------------------------- -Path2 new | File is new on Path2, does not exist on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 -Path2 newer | File is newer on Path2, unchanged on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 -Path2 deleted | File is deleted on Path2, unchanged on Path1 | File is deleted | `rclone delete` Path1 -Path1 new | File is new on Path1, does not exist on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 -Path1 newer | File is newer on Path1, unchanged on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 -Path1 older | File is older on Path1, unchanged on Path2 | _Path1 version survives_ | `rclone copy` Path1 to Path2 -Path2 older | File is older on Path2, unchanged on Path1 | _Path2 version survives_ | `rclone copy` Path2 to Path1 -Path1 deleted | File no longer exists on Path1 | File is deleted | `rclone delete` Path2 +- name - name of the plugin in the format `author`/`plugin_name`. -### Unusual sync checks +Example: - Type | Description | Result | Implementation ---------------------------------|---------------------------------------|------------------------------------|----------------------- -Path1 new AND Path2 new | File is new on Path1 AND new on Path2 | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 -Path2 newer AND Path1 changed | File is newer on Path2 AND also changed (newer/older/size) on Path1 | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 -Path2 newer AND Path1 deleted | File is newer on Path2 AND also deleted on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 -Path2 deleted AND Path1 changed | File is deleted on Path2 AND changed (newer/older/size) on Path1 | Path1 version survives |`rclone copy` Path1 to Path2 -Path1 deleted AND Path2 changed | File is deleted on Path1 AND changed (newer/older/size) on Path2 | Path2 version survives | `rclone copy` Path2 to Path1 + rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react -### All files changed check {#all-files-changed} +**Authentication is required for this call.** -if _all_ prior existing files on either of the filesystems have changed -(e.g. timestamps have changed due to changing the system's timezone) -then bisync will abort without making any changes. -Any new files are not considered for this check. You could use `--force` -to force the sync (whichever side has the changed timestamp files wins). -Alternately, a `--resync` may be used (Path1 versions will be pushed -to Path2). Consider the situation carefully and perhaps use `--dry-run` -before you commit to the changes. +### rc/error: This returns an error {#rc-error} -### Modification time +This returns an error with the input as part of its error string. +Useful for testing error handling. -Bisync relies on file timestamps to identify changed files and will -_refuse_ to operate if backend lacks the modification time support. +### rc/list: List all the registered remote control commands {#rc-list} -If you or your application should change the content of a file -without changing the modification time then bisync will _not_ -notice the change, and thus will not copy it to the other side. +This lists all the registered remote control commands as a JSON map in +the commands response. -Note that on some cloud storage systems it is not possible to have file -timestamps that match _precisely_ between the local and other filesystems. +### rc/noop: Echo the input to the output parameters {#rc-noop} -Bisync's approach to this problem is by tracking the changes on each side -_separately_ over time with a local database of files in that side then -applying the resulting changes on the other side. +This echoes the input parameters to the output parameters for testing +purposes. It can be used to check that rclone is still alive and to +check that parameter passing is working properly. -### Error handling {#error-handling} +### rc/noopauth: Echo the input to the output parameters requiring auth {#rc-noopauth} -Certain bisync critical errors, such as file copy/move failing, will result in -a bisync lockout of following runs. The lockout is asserted because the sync -status and history of the Path1 and Path2 filesystems cannot be trusted, -so it is safer to block any further changes until someone checks things out. -The recovery is to do a `--resync` again. +This echoes the input parameters to the output parameters for testing +purposes. It can be used to check that rclone is still alive and to +check that parameter passing is working properly. -It is recommended to use `--resync --dry-run --verbose` initially and -_carefully_ review what changes will be made before running the `--resync` -without `--dry-run`. +**Authentication is required for this call.** -Most of these events come up due to a error status from an internal call. -On such a critical error the `{...}.path1.lst` and `{...}.path2.lst` -listing files are renamed to extension `.lst-err`, which blocks any future -bisync runs (since the normal `.lst` files are not found). -Bisync keeps them under `bisync` subdirectory of the rclone cache directory, -typically at `${HOME}/.cache/rclone/bisync/` on Linux. +### sync/bisync: Perform bidirectional synchronization between two paths. {#sync-bisync} -Some errors are considered temporary and re-running the bisync is not blocked. -The _critical return_ blocks further bisync runs. +This takes the following parameters -### Lock file +- path1 - a remote directory string e.g. `drive:path1` +- path2 - a remote directory string e.g. `drive:path2` +- dryRun - dry-run mode +- resync - performs the resync run +- checkAccess - abort if RCLONE_TEST files are not found on both filesystems +- checkFilename - file name for checkAccess (default: RCLONE_TEST) +- maxDelete - abort sync if percentage of deleted files is above + this threshold (default: 50) +- force - Bypass maxDelete safety check and run the sync +- checkSync - `true` by default, `false` disables comparison of final listings, + `only` will skip sync, only compare listings from the last run +- createEmptySrcDirs - Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) +- removeEmptyDirs - remove empty directories at the final cleanup step +- filtersFile - read filtering patterns from a file +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. + Use at your own risk! +- workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync) +- noCleanup - retain working files -When bisync is running, a lock file is created in the bisync working directory, -typically at `~/.cache/rclone/bisync/PATH1..PATH2.lck` on Linux. -If bisync should crash or hang, the lock file will remain in place and block -any further runs of bisync _for the same paths_. -Delete the lock file as part of debugging the situation. -The lock file effectively blocks follow-on (e.g., scheduled by _cron_) runs -when the prior invocation is taking a long time. -The lock file contains _PID_ of the blocking process, which may help in debug. +See [bisync command help](https://rclone.org/commands/rclone_bisync/) +and [full bisync description](https://rclone.org/bisync/) +for more information. -**Note** -that while concurrent bisync runs are allowed, _be very cautious_ -that there is no overlap in the trees being synched between concurrent runs, -lest there be replicated files, deleted files and general mayhem. +**Authentication is required for this call.** -### Return codes +### sync/copy: copy a directory from source remote to destination remote {#sync-copy} -`rclone bisync` returns the following codes to calling program: -- `0` on a successful run, -- `1` for a non-critical failing run (a rerun may be successful), -- `2` for a critically aborted run (requires a `--resync` to recover). +This takes the following parameters: -## Limitations +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if set -### Supported backends -Bisync is considered _BETA_ and has been tested with the following backends: -- Local filesystem -- Google Drive -- Dropbox -- OneDrive -- S3 -- SFTP -- Yandex Disk +See the [copy](https://rclone.org/commands/rclone_copy/) command for more information on the above. -It has not been fully tested with other services yet. -If it works, or sorta works, please let us know and we'll update the list. -Run the test suite to check for proper operation as described below. +**Authentication is required for this call.** -First release of `rclone bisync` requires that underlying backend supported -the modification time feature and will refuse to run otherwise. -This limitation will be lifted in a future `rclone bisync` release. +### sync/move: move a directory from source remote to destination remote {#sync-move} -### Concurrent modifications +This takes the following parameters: -When using **Local, FTP or SFTP** remotes rclone does not create _temporary_ -files at the destination when copying, and thus if the connection is lost -the created file may be corrupt, which will likely propagate back to the -original path on the next sync, resulting in data loss. -This will be solved in a future release, there is no workaround at the moment. +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if set +- deleteEmptySrcDirs - delete empty src directories if set -Files that **change during** a bisync run may result in data loss. -This has been seen in a highly dynamic environment, where the filesystem -is getting hammered by running processes during the sync. -The solution is to sync at quiet times or [filter out](#filtering) -unnecessary directories and files. -### Empty directories +See the [move](https://rclone.org/commands/rclone_move/) command for more information on the above. -New empty directories on one path are _not_ propagated to the other side. -This is because bisync (and rclone) natively works on files not directories. -The following sequence is a workaround but will not propagate the delete -of an empty directory to the other side: +**Authentication is required for this call.** -``` -rclone bisync PATH1 PATH2 -rclone copy PATH1 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs -rclone copy PATH2 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs -``` +### sync/sync: sync a directory from source remote to destination remote {#sync-sync} -### Renamed directories +This takes the following parameters: -Renaming a folder on the Path1 side results is deleting all files on -the Path2 side and then copying all files again from Path1 to Path2. -Bisync sees this as all files in the old directory name as deleted and all -files in the new directory name as new. Similarly, renaming a directory on -both sides to the same name will result in creating `..path1` and `..path2` -files on both sides. -Currently the most effective and efficient method of renaming a directory -is to rename it on both sides, then do a `--resync`. +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if set -### Case sensitivity -Synching with **case-insensitive** filesystems, such as Windows or `Box`, -can result in file name conflicts. This will be fixed in a future release. -The near term workaround is to make sure that files on both sides -don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). +See the [sync](https://rclone.org/commands/rclone_sync/) command for more information on the above. -## Windows support {#windows} +**Authentication is required for this call.** -Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows -GitHub runners. +### vfs/forget: Forget files or directories in the directory cache. {#vfs-forget} -Drive letters are allowed, including drive letters mapped to network drives -(`rclone bisync J:\localsync GDrive:`). -If a drive letter is omitted, the shell current drive is the default. -Drive letters are a single character follows by `:`, so cloud names -must be more than one character long. +This forgets the paths in the directory cache causing them to be +re-read from the remote when needed. -Absolute paths (with or without a drive letter), and relative paths -(with or without a drive letter) are supported. +If no paths are passed in then it will forget all the paths in the +directory cache. -Working directory is created at `C:\Users\MyLogin\AppData\Local\rclone\bisync`. + rclone rc vfs/forget -Note that bisync output may show a mix of forward `/` and back `\` slashes. +Otherwise pass files or dirs in as file=path or dir=path. Any +parameter key starting with file will forget that file and any +starting with dir will forget that dir, e.g. -Be careful of case independent directory and file naming on Windows -vs. case dependent Linux + rclone rc vfs/forget file=hello file2=goodbye dir=home/junk + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. -## Filtering {#filtering} +### vfs/list: List active VFSes. {#vfs-list} -See [filtering documentation](https://rclone.org/filtering/) -for how filter rules are written and interpreted. +This lists the active VFSes. -Bisync's [`--filters-file`](#filters-file) flag slightly extends the rclone's -[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) -filtering mechanism. -For a given bisync run you may provide _only one_ `--filters-file`. -The `--include*`, `--exclude*`, and `--filter` flags are also supported. +It returns a list under the key "vfses" where the values are the VFS +names that could be passed to the other VFS commands in the "fs" +parameter. -### How to filter directories +### vfs/poll-interval: Get the status or update the value of the poll-interval option. {#vfs-poll-interval} -Filtering portions of the directory tree is a critical feature for synching. +Without any parameter given this returns the current status of the +poll-interval setting. -Examples of directory trees (always beneath the Path1/Path2 root level) -you may want to exclude from your sync: -- Directory trees containing only software build intermediate files. -- Directory trees containing application temporary files and data - such as the Windows `C:\Users\MyLogin\AppData\` tree. -- Directory trees containing files that are large, less important, - or are getting thrashed continuously by ongoing processes. +When the interval=duration parameter is set, the poll-interval value +is updated and the polling function is notified. +Setting interval=0 disables poll-interval. -On the other hand, there may be only select directories that you -actually want to sync, and exclude all others. See the -[Example include-style filters for Windows user directories](#include-filters) -below. + rclone rc vfs/poll-interval interval=5m -### Filters file writing guidelines +The timeout=duration parameter can be used to specify a time to wait +for the current poll function to apply the new value. +If timeout is less or equal 0, which is the default, wait indefinitely. -1. Begin with excluding directory trees: - - e.g. `- /AppData/` - - `**` on the end is not necessary. Once a given directory level - is excluded then everything beneath it won't be looked at by rclone. - - Exclude such directories that are unneeded, are big, dynamically thrashed, - or where there may be access permission issues. - - Excluding such dirs first will make rclone operations (much) faster. - - Specific files may also be excluded, as with the Dropbox exclusions - example below. -2. Decide if its easier (or cleaner) to: - - Include select directories and therefore _exclude everything else_ -- or -- - - Exclude select directories and therefore _include everything else_ -3. Include select directories: - - Add lines like: `+ /Documents/PersonalFiles/**` to select which - directories to include in the sync. - - `**` on the end specifies to include the full depth of the specified tree. - - With Include-style filters, files at the Path1/Path2 root are not included. - They may be included with `+ /*`. - - Place RCLONE_TEST files within these included directory trees. - They will only be looked for in these directory trees. - - Finish by excluding everything else by adding `- **` at the end - of the filters file. - - Disregard step 4. -4. Exclude select directories: - - Add more lines like in step 1. - For example: `-/Desktop/tempfiles/`, or `- /testdir/`. - Again, a `**` on the end is not necessary. - - Do _not_ add a `- **` in the file. Without this line, everything - will be included that has not be explicitly excluded. - - Disregard step 3. +The new poll-interval value will only be active when the timeout is +not reached. -A few rules for the syntax of a filter file expanding on -[filtering documentation](https://rclone.org/filtering/): +If poll-interval is updated or disabled temporarily, some changes +might not get picked up by the polling function, depending on the +used remote. + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. -- Lines may start with spaces and tabs - rclone strips leading whitespace. -- If the first non-whitespace character is a `#` then the line is a comment - and will be ignored. -- Blank lines are ignored. -- The first non-whitespace character on a filter line must be a `+` or `-`. -- Exactly 1 space is allowed between the `+/-` and the path term. -- Only forward slashes (`/`) are used in path terms, even on Windows. -- The rest of the line is taken as the path term. - Trailing whitespace is taken literally, and probably is an error. +### vfs/refresh: Refresh the directory cache. {#vfs-refresh} -### Example include-style filters for Windows user directories {#include-filters} +This reads the directories for the specified paths and freshens the +directory cache. -This Windows _include-style_ example is based on the sync root (Path1) -set to `C:\Users\MyLogin`. The strategy is to select specific directories -to be synched with a network drive (Path2). +If no paths are passed in then it will refresh the root directory. -- `- /AppData/` excludes an entire tree of Windows stored stuff - that need not be synched. - In my case, AppData has >11 GB of stuff I don't care about, and there are - some subdirectories beneath AppData that are not accessible to my - user login, resulting in bisync critical aborts. -- Windows creates cache files starting with both upper and - lowercase `NTUSER` at `C:\Users\MyLogin`. These files may be dynamic, - locked, and are generally _don't care_. -- There are just a few directories with _my_ data that I do want synched, - in the form of `+ /`. By selecting only the directory trees I - want to avoid the dozen plus directories that various apps make - at `C:\Users\MyLogin\Documents`. -- Include files in the root of the sync point, `C:\Users\MyLogin`, - by adding the `+ /*` line. -- This is an Include-style filters file, therefore it ends with `- **` - which excludes everything not explicitly included. + rclone rc vfs/refresh -``` -- /AppData/ -- NTUSER* -- ntuser* -+ /Documents/Family/** -+ /Documents/Sketchup/** -+ /Documents/Microcapture_Photo/** -+ /Documents/Microcapture_Video/** -+ /Desktop/** -+ /Pictures/** -+ /* -- ** -``` +Otherwise pass directories in as dir=path. Any parameter key +starting with dir will refresh that directory, e.g. -Note also that Windows implements several "library" links such as -`C:\Users\MyLogin\My Documents\My Music` pointing to `C:\Users\MyLogin\Music`. -rclone sees these as links, so you must add `--links` to the -bisync command line if you which to follow these links. I find that I get -permission errors in trying to follow the links, so I don't include the -rclone `--links` flag, but then you get lots of `Can't follow symlink…` -noise from rclone about not following the links. This noise can be -quashed by adding `--quiet` to the bisync command line. + rclone rc vfs/refresh dir=home/junk dir2=data/misc -## Example exclude-style filters files for use with Dropbox {#exclude-filters} +If the parameter recursive=true is given the whole directory tree +will get refreshed. This refresh will use --fast-list if enabled. + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. -- Dropbox disallows synching the listed temporary and configuration/data files. - The `- ` filters exclude these files where ever they may occur - in the sync tree. Consider adding similar exclusions for file types - you don't need to sync, such as core dump and software build files. -- bisync testing creates `/testdir/` at the top level of the sync tree, - and usually deletes the tree after the test. If a normal sync should run - while the `/testdir/` tree exists the `--check-access` phase may fail - due to unbalanced RCLONE_TEST files. - The `- /testdir/` filter blocks this tree from being synched. - You don't need this exclusion if you are not doing bisync development testing. -- Everything else beneath the Path1/Path2 root will be synched. -- RCLONE_TEST files may be placed anywhere within the tree, including the root. +### vfs/stats: Stats for a VFS. {#vfs-stats} -### Example filters file for Dropbox {#example-filters-file} +This returns stats for the selected VFS. -``` -# Filter file for use with bisync -# See https://rclone.org/filtering/ for filtering rules -# NOTICE: If you make changes to this file you MUST do a --resync run. -# Run with --dry-run to see what changes will be made. + { + // Status of the disk cache - only present if --vfs-cache-mode > off + "diskCache": { + "bytesUsed": 0, + "erroredFiles": 0, + "files": 0, + "hashType": 1, + "outOfSpace": false, + "path": "/home/user/.cache/rclone/vfs/local/mnt/a", + "pathMeta": "/home/user/.cache/rclone/vfsMeta/local/mnt/a", + "uploadsInProgress": 0, + "uploadsQueued": 0 + }, + "fs": "/mnt/a", + "inUse": 1, + // Status of the in memory metadata cache + "metadataCache": { + "dirs": 1, + "files": 0 + }, + // Options as returned by options/get + "opt": { + "CacheMaxAge": 3600000000000, + // ... + "WriteWait": 1000000000 + } + } -# Dropbox wont sync some files so filter them away here. -# See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing -- .dropbox.attr -- ~*.tmp -- ~$* -- .~* -- desktop.ini -- .dropbox + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. -# Used for bisync testing, so excluded from normal runs -- /testdir/ -# Other example filters -#- /TiBU/ -#- /Photos/ -``` -### How --check-access handles filters +## Accessing the remote control via HTTP {#api-http} -At the start of a bisync run, listings are gathered for Path1 and Path2 -while using the user's `--filters-file`. During the check access phase, -bisync scans these listings for `RCLONE_TEST` files. -Any `RCLONE_TEST` files hidden by the `--filters-file` are _not_ in the -listings and thus not checked during the check access phase. +Rclone implements a simple HTTP based protocol. -## Troubleshooting {#troubleshooting} +Each endpoint takes an JSON object and returns a JSON object or an +error. The JSON objects are essentially a map of string names to +values. -### Reading bisync logs +All calls must made using POST. -Here are two normal runs. The first one has a newer file on the remote. -The second has no deltas between local and remote. +The input objects can be supplied using URL parameters, POST +parameters or by supplying "Content-Type: application/json" and a JSON +blob in the body. There are examples of these below using `curl`. -``` -2021/05/16 00:24:38 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" -2021/05/16 00:24:38 INFO : Path1 checking for diffs -2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt -2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted -2021/05/16 00:24:38 INFO : Path2 checking for diffs -2021/05/16 00:24:38 INFO : Applying changes -2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt -2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 -2021/05/16 00:24:38 INFO : Updating listings -2021/05/16 00:24:38 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" -2021/05/16 00:24:38 INFO : Bisync successful +The response will be a JSON blob in the body of the response. This is +formatted to be reasonably human-readable. + +### Error returns + +If an error occurs then there will be an HTTP error status (e.g. 500) +and the body of the response will contain a JSON encoded error object, +e.g. -2021/05/16 00:36:52 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" -2021/05/16 00:36:52 INFO : Path1 checking for diffs -2021/05/16 00:36:52 INFO : Path2 checking for diffs -2021/05/16 00:36:52 INFO : No changes found -2021/05/16 00:36:52 INFO : Updating listings -2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" -2021/05/16 00:36:52 INFO : Bisync successful +``` +{ + "error": "Expecting string value for key \"remote\" (was float64)", + "input": { + "fs": "/tmp", + "remote": 3 + }, + "status": 400 + "path": "operations/rmdir", +} ``` -### Dry run oddity +The keys in the error response are +- error - error string +- input - the input parameters to the call +- status - the HTTP status code +- path - the path of the call -The `--dry-run` messages may indicate that it would try to delete some files. -For example, if a file is new on Path2 and does not exist on Path1 then -it would normally be copied to Path1, but with `--dry-run` enabled those -copies don't happen, which leads to the attempted delete on the Path2, -blocked again by --dry-run: `... Not deleting as --dry-run`. +### CORS -This whole confusing situation is an artifact of the `--dry-run` flag. -Scrutinize the proposed deletes carefully, and if the files would have been -copied to Path1 then the threatened deletes on Path2 may be disregarded. +The sever implements basic CORS support and allows all origins for that. +The response to a preflight OPTIONS request will echo the requested "Access-Control-Request-Headers" back. -### Retries +### Using POST with URL parameters only -Rclone has built in retries. If you run with `--verbose` you'll see -error and retry messages such as shown below. This is usually not a bug. -If at the end of the run you see `Bisync successful` and not -`Bisync critical error` or `Bisync aborted` then the run was successful, -and you can ignore the error messages. +``` +curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2' +``` -The following run shows an intermittent fail. Lines _5_ and _6- are -low level messages. Line _6_ is a bubbled-up _warning_ message, conveying -the error. Rclone normally retries failing commands, so there may be -numerous such messages in the log. +Response -Since there are no final error/warning messages on line _7_, rclone has -recovered from failure after a retry, and the overall sync was successful. +``` +{ + "potato": "1", + "sausage": "2" +} +``` + +Here is what an error response looks like: ``` -1: 2021/05/14 00:44:12 INFO : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:" -2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs -3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs -4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted -5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input -6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: -7: 2021/05/14 00:44:12 INFO : Bisync successful +curl -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' ``` -This log shows a _Critical failure_ which requires a `--resync` to recover from. -See the [Runtime Error Handling](#error-handling) section. +``` +{ + "error": "arbitrary error on input map[potato:1 sausage:2]", + "input": { + "potato": "1", + "sausage": "2" + } +} +``` + +Note that curl doesn't return errors to the shell unless you use the `-f` option ``` -2021/05/12 00:49:40 INFO : Google drive root '': Waiting for checks to finish -2021/05/12 00:49:40 INFO : Google drive root '': Waiting for transfers to finish -2021/05/12 00:49:40 INFO : Google drive root '': not deleting files as there were IO errors -2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors -2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors -2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ -2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. +$ curl -f -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' +curl: (22) The requested URL returned error: 400 Bad Request +$ echo $? +22 ``` -### Denied downloads of "infected" or "abusive" files +### Using POST with a form -Google Drive has a filter for certain file types (`.exe`, `.apk`, et cetera) -that by default cannot be copied from Google Drive to the local filesystem. -If you are having problems, run with `--verbose` to see specifically which -files are generating complaints. If the error is -`This file has been identified as malware or spam and cannot be downloaded`, -consider using the flag -[--drive-acknowledge-abuse](https://rclone.org/drive/#drive-acknowledge-abuse). +``` +curl --data "potato=1" --data "sausage=2" http://localhost:5572/rc/noop +``` -### Google Doc files +Response -Google docs exist as virtual files on Google Drive and cannot be transferred -to other filesystems natively. While it is possible to export a Google doc to -a normal file (with `.xlsx` extension, for example), it is not possible -to import a normal file back into a Google document. +``` +{ + "potato": "1", + "sausage": "2" +} +``` -Bisync's handling of Google Doc files is to flag them in the run log output -for user's attention and ignore them for any file transfers, deletes, or syncs. -They will show up with a length of `-1` in the listings. -This bisync run is otherwise successful: +Note that you can combine these with URL parameters too with the POST +parameters taking precedence. ``` -2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" -2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" -2021/05/11 08:23:15 INFO : Bisync successful +curl --data "potato=1" --data "sausage=2" "http://localhost:5572/rc/noop?rutabaga=3&sausage=4" ``` -## Usage examples +Response -### Cron {#cron} +``` +{ + "potato": "1", + "rutabaga": "3", + "sausage": "4" +} -Rclone does not yet have a built-in capability to monitor the local file -system for changes and must be blindly run periodically. -On Windows this can be done using a _Task Scheduler_, -on Linux you can use _Cron_ which is described below. +``` -The 1st example runs a sync every 5 minutes between a local directory -and an OwnCloud server, with output logged to a runlog file: +### Using POST with a JSON blob ``` -# Minute (0-59) -# Hour (0-23) -# Day of Month (1-31) -# Month (1-12 or Jan-Dec) -# Day of Week (0-6 or Sun-Sat) -# Command - */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log +curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' http://localhost:5572/rc/noop ``` -See [crontab syntax](https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES)). -for the details of crontab time interval expressions. +response -If you run `rclone bisync` as a cron job, redirect stdout/stderr to a file. -The 2nd example runs a sync to Dropbox every hour and logs all stdout (via the `>>`) -and stderr (via `2>&1`) to a log file. +``` +{ + "password": "xyz", + "username": "xyz" +} +``` + +This can be combined with URL parameters too if required. The JSON +blob takes precedence. ``` -0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 +curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' 'http://localhost:5572/rc/noop?rutabaga=3&potato=4' ``` -### Sharing an encrypted folder tree between hosts +``` +{ + "potato": 2, + "rutabaga": "3", + "sausage": 1 +} +``` -bisync can keep a local folder in sync with a cloud service, -but what if you have some highly sensitive files to be synched? +## Debugging rclone with pprof ## -Usage of a cloud service is for exchanging both routine and sensitive -personal files between one's home network, one's personal notebook when on the -road, and with one's work computer. The routine data is not sensitive. -For the sensitive data, configure an rclone [crypt remote](https://rclone.org/crypt/) to point to -a subdirectory within the local disk tree that is bisync'd to Dropbox, -and then set up an bisync for this local crypt directory to a directory -outside of the main sync tree. +If you use the `--rc` flag this will also enable the use of the go +profiling tools on the same port. -### Linux server setup +To use these, first [install go](https://golang.org/doc/install). -- `/path/to/DBoxroot` is the root of my local sync tree. - There are numerous subdirectories. -- `/path/to/DBoxroot/crypt` is the root subdirectory for files - that are encrypted. This local directory target is setup as an - rclone crypt remote named `Dropcrypt:`. - See [rclone.conf](#rclone-conf-snippet) snippet below. -- `/path/to/my/unencrypted/files` is the root of my sensitive - files - not encrypted, not within the tree synched to Dropbox. -- To sync my local unencrypted files with the encrypted Dropbox versions - I manually run `bisync /path/to/my/unencrypted/files DropCrypt:`. - This step could be bundled into a script to run before and after - the full Dropbox tree sync in the last step, - thus actively keeping the sensitive files in sync. -- `bisync /path/to/DBoxroot Dropbox:` runs periodically via cron, - keeping my full local sync tree in sync with Dropbox. +### Debugging memory use -### Windows notebook setup +To profile rclone's memory use you can run: -- The Dropbox client runs keeping the local tree `C:\Users\MyLogin\Dropbox` - always in sync with Dropbox. I could have used `rclone bisync` instead. -- A separate directory tree at `C:\Users\MyLogin\Documents\DropLocal` - hosts the tree of unencrypted files/folders. -- To sync my local unencrypted files with the encrypted - Dropbox versions I manually run the following command: - `rclone bisync C:\Users\MyLogin\Documents\DropLocal Dropcrypt:`. -- The Dropbox client then syncs the changes with Dropbox. + go tool pprof -web http://localhost:5572/debug/pprof/heap -### rclone.conf snippet {#rclone-conf-snippet} +This should open a page in your browser showing what is using what +memory. -``` -[Dropbox] -type = dropbox -... +You can also use the `-text` flag to produce a textual summary -[Dropcrypt] -type = crypt -remote = /path/to/DBoxroot/crypt # on the Linux server -remote = C:\Users\MyLogin\Dropbox\crypt # on the Windows notebook -filename_encryption = standard -directory_name_encryption = true -password = ... -... +``` +$ go tool pprof -text http://localhost:5572/debug/pprof/heap +Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total + flat flat% sum% cum cum% + 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode + 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 + 0 0% 100% 1024.03kB 66.62% main.init + 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest + 0 0% 100% 513kB 33.38% net/http.(*conn).serve + 0 0% 100% 1024.03kB 66.62% runtime.main ``` -## Testing {#testing} +### Debugging go routine leaks -You should read this section only if you are developing for rclone. -You need to have rclone source code locally to work with bisync tests. +Memory leaks are most often caused by go routine leaks keeping memory +alive which should have been garbage collected. -Bisync has a dedicated test framework implemented in the `bisync_test.go` -file located in the rclone source tree. The test suite is based on the -`go test` command. Series of tests are stored in subdirectories below the -`cmd/bisync/testdata` directory. Individual tests can be invoked by their -directory name, e.g. -`go test . -case basic -remote local -remote2 gdrive: -v` +See all active go routines using -Tests will make a temporary folder on remote and purge it afterwards. -If during test run there are intermittent errors and rclone retries, -these errors will be captured and flagged as invalid MISCOMPAREs. -Rerunning the test will let it pass. Consider such failures as noise. + curl http://localhost:5572/debug/pprof/goroutine?debug=1 -### Test command syntax +Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your browser. -``` -usage: go test ./cmd/bisync [options...] +### Other profiles to look at -Options: - -case NAME Name(s) of the test case(s) to run. Multiple names should - be separated by commas. You can remove the `test_` prefix - and replace `_` by `-` in test name for convenience. - If not `all`, the name(s) should map to a directory under - `./cmd/bisync/testdata`. - Use `all` to run all tests (default: all) - -remote PATH1 `local` or name of cloud service with `:` (default: local) - -remote2 PATH2 `local` or name of cloud service with `:` (default: local) - -no-compare Disable comparing test results with the golden directory - (default: compare) - -no-cleanup Disable cleanup of Path1 and Path2 testdirs. - Useful for troubleshooting. (default: cleanup) - -golden Store results in the golden directory (default: false) - This flag can be used with multiple tests. - -debug Print debug messages - -stop-at NUM Stop test after given step number. (default: run to the end) - Implies `-no-compare` and `-no-cleanup`, if the test really - ends prematurely. Only meaningful for a single test case. - -refresh-times Force refreshing the target modtime, useful for Dropbox - (default: false) - -verbose Run tests verbosely -``` +You can see a summary of profiles available at http://localhost:5572/debug/pprof/ -Note: unlike rclone flags which must be prefixed by double dash (`--`), the -test command flags can be equally prefixed by a single `-` or double dash. +Here is how to use some of them: -### Running tests +- Memory: `go tool pprof http://localhost:5572/debug/pprof/heap` +- Go routines: `curl http://localhost:5572/debug/pprof/goroutine?debug=1` +- 30-second CPU profile: `go tool pprof http://localhost:5572/debug/pprof/profile` +- 5-second execution trace: `wget http://localhost:5572/debug/pprof/trace?seconds=5` +- Goroutine blocking profile + - Enable first with: `rclone rc debug/set-block-profile-rate rate=1` ([docs](#debug-set-block-profile-rate)) + - `go tool pprof http://localhost:5572/debug/pprof/block` +- Contended mutexes: + - Enable first with: `rclone rc debug/set-mutex-profile-fraction rate=1` ([docs](#debug-set-mutex-profile-fraction)) + - `go tool pprof http://localhost:5572/debug/pprof/mutex` -- `go test . -case basic -remote local -remote2 local` - runs the `test_basic` test case using only the local filesystem, - synching one local directory with another local directory. - Test script output is to the console, while commands within scenario.txt - have their output sent to the `.../workdir/test.log` file, - which is finally compared to the golden copy. -- The first argument after `go test` should be a relative name of the - directory containing bisync source code. If you run tests right from there, - the argument will be `.` (current directory) as in most examples below. - If you run bisync tests from the rclone source directory, the command - should be `go test ./cmd/bisync ...`. -- The test engine will mangle rclone output to ensure comparability - with golden listings and logs. -- Test scenarios are located in `./cmd/bisync/testdata`. The test `-case` - argument should match the full name of a subdirectory under that - directory. Every test subdirectory name on disk must start with `test_`, - this prefix can be omitted on command line for brevity. Also, underscores - in the name can be replaced by dashes for convenience. -- `go test . -remote local -remote2 local -case all` runs all tests. -- Path1 and Path2 may either be the keyword `local` - or may be names of configured cloud services. - `go test . -remote gdrive: -remote2 dropbox: -case basic` - will run the test between these two services, without transferring - any files to the local filesystem. -- Test run stdout and stderr console output may be directed to a file, e.g. - `go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1` +See the [net/http/pprof docs](https://golang.org/pkg/net/http/pprof/) +for more info on how to use the profiling and for a general overview +see [the Go team's blog post on profiling go programs](https://blog.golang.org/profiling-go-programs). -### Test execution flow +The profiling hook is [zero overhead unless it is used](https://stackoverflow.com/q/26545159/164234). -1. The base setup in the `initial` directory of the testcase is applied - on the Path1 and Path2 filesystems (via rclone copy the initial directory - to Path1, then rclone sync Path1 to Path2). -2. The commands in the scenario.txt file are applied, with output directed - to the `test.log` file in the test working directory. - Typically, the first actual command in the `scenario.txt` file is - to do a `--resync`, which establishes the baseline - `{...}.path1.lst` and `{...}.path2.lst` files in the test working - directory (`.../workdir/` relative to the temporary test directory). - Various commands and listing snapshots are done within the test. -3. Finally, the contents of the test working directory are compared - to the contents of the testcase's golden directory. +# Overview of cloud storage systems # -### Notes about testing +Each cloud storage system is slightly different. Rclone attempts to +provide a unified interface to them, but some underlying differences +show through. -- Test cases are in individual directories beneath `./cmd/bisync/testdata`. - A command line reference to a test is understood to reference a directory - beneath `testdata`. For example, - `go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local` - refers to the test case in `./cmd/bisync/testdata/test_dry_run`. -- The test working directory is located at `.../workdir` relative to a - temporary test directory, usually under `/tmp` on Linux. -- The local test sync tree is created at a temporary directory named - like `bisync.XXX` under system temporary directory. -- The remote test sync tree is located at a temporary directory - under `/bisync.XXX/`. -- `path1` and/or `path2` subdirectories are created in a temporary - directory under the respective local or cloud test remote. -- By default, the Path1 and Path2 test dirs and workdir will be deleted - after each test run. The `-no-cleanup` flag disables purging these - directories when validating and debugging a given test. - These directories will be flushed before running another test, - independent of the `-no-cleanup` usage. -- You will likely want to add `- /testdir/` to your normal - bisync `--filters-file` so that normal syncs do not attempt to sync - the test temporary directories, which may have `RCLONE_TEST` miscompares - in some testcases which would otherwise trip the `--check-access` system. - The `--check-access` mechanism is hard-coded to ignore `RCLONE_TEST` - files beneath `bisync/testdata`, so the test cases may reside on the - synched tree even if there are check file mismatches in the test tree. -- Some Dropbox tests can fail, notably printing the following message: - `src and dst identical but can't set mod time without deleting and re-uploading` - This is expected and happens due a way Dropbox handles modification times. - You should use the `-refresh-times` test flag to make up for this. -- If Dropbox tests hit request limit for you and print error message - `too_many_requests/...: Too many requests or write operations.` - then follow the - [Dropbox App ID instructions](https://rclone.org/dropbox/#get-your-own-dropbox-app-id). - -### Updating golden results - -Sometimes even a slight change in the bisync source can cause little changes -spread around many log files. Updating them manually would be a nightmare. - -The `-golden` flag will store the `test.log` and `*.lst` listings from each -test case into respective golden directories. Golden results will -automatically contain generic strings instead of local or cloud paths which -means that they should match when run with a different cloud service. +## Features ## -Your normal workflow might be as follows: -1. Git-clone the rclone sources locally -2. Modify bisync source and check that it builds -3. Run the whole test suite `go test ./cmd/bisync -remote local` -4. If some tests show log difference, recheck them individually, e.g.: - `go test ./cmd/bisync -remote local -case basic` -5. If you are convinced with the difference, goldenize all tests at once: - `go test ./cmd/bisync -remote local -golden` -6. Use word diff: `git diff --word-diff ./cmd/bisync/testdata/`. - Please note that normal line-level diff is generally useless here. -7. Check the difference _carefully_! -8. Commit the change (`git commit`) _only_ if you are sure. - If unsure, save your code changes then wipe the log diffs from git: - `git reset [--hard]`. +Here is an overview of the major features of each cloud storage system. -### Structure of test scenarios +| Name | Hash | ModTime | Case Insensitive | Duplicate Files | MIME Type | Metadata | +| ---------------------------- |:-----------------:|:-------:|:----------------:|:---------------:|:---------:|:--------:| +| 1Fichier | Whirlpool | - | No | Yes | R | - | +| Akamai Netstorage | MD5, SHA256 | R/W | No | No | R | - | +| Amazon Drive | MD5 | - | Yes | No | R | - | +| Amazon S3 (or S3 compatible) | MD5 | R/W | No | No | R/W | RWU | +| Backblaze B2 | SHA1 | R/W | No | No | R/W | - | +| Box | SHA1 | R/W | Yes | No | - | - | +| Citrix ShareFile | MD5 | R/W | Yes | No | - | - | +| Dropbox | DBHASH ¹ | R | Yes | No | - | - | +| Enterprise File Fabric | - | R/W | Yes | No | R/W | - | +| FTP | - | R/W ¹⁰ | No | No | - | - | +| Google Cloud Storage | MD5 | R/W | No | No | R/W | - | +| Google Drive | MD5, SHA1, SHA256 | R/W | No | Yes | R/W | - | +| Google Photos | - | - | No | Yes | R | - | +| HDFS | - | R/W | No | No | - | - | +| HiDrive | HiDrive ¹² | R/W | No | No | - | - | +| HTTP | - | R | No | No | R | - | +| Internet Archive | MD5, SHA1, CRC32 | R/W ¹¹ | No | No | - | RWU | +| Jottacloud | MD5 | R/W | Yes | No | R | RW | +| Koofr | MD5 | - | Yes | No | - | - | +| Linkbox | - | R | No | No | - | - | +| Mail.ru Cloud | Mailru ⁶ | R/W | Yes | No | - | - | +| Mega | - | - | No | Yes | - | - | +| Memory | MD5 | R/W | No | No | - | - | +| Microsoft Azure Blob Storage | MD5 | R/W | No | No | R/W | - | +| Microsoft Azure Files Storage | MD5 | R/W | Yes | No | R/W | - | +| Microsoft OneDrive | QuickXorHash ⁵ | R/W | Yes | No | R | - | +| OpenDrive | MD5 | R/W | Yes | Partial ⁸ | - | - | +| OpenStack Swift | MD5 | R/W | No | No | R/W | - | +| Oracle Object Storage | MD5 | R/W | No | No | R/W | - | +| pCloud | MD5, SHA1 ⁷ | R | No | No | W | - | +| PikPak | MD5 | R | No | No | R | - | +| premiumize.me | - | - | Yes | No | R | - | +| put.io | CRC-32 | R/W | No | Yes | R | - | +| Proton Drive | SHA1 | R/W | No | No | R | - | +| QingStor | MD5 | - ⁹ | No | No | R/W | - | +| Quatrix by Maytech | - | R/W | No | No | - | - | +| Seafile | - | - | No | No | - | - | +| SFTP | MD5, SHA1 ² | R/W | Depends | No | - | - | +| Sia | - | - | No | No | - | - | +| SMB | - | R/W | Yes | No | - | - | +| SugarSync | - | - | No | No | - | - | +| Storj | - | R | No | No | - | - | +| Uptobox | - | - | No | Yes | - | - | +| WebDAV | MD5, SHA1 ³ | R ⁴ | Depends | No | - | - | +| Yandex Disk | MD5 | R/W | No | No | R | - | +| Zoho WorkDrive | - | - | No | No | - | - | +| The local filesystem | All | R/W | Depends | No | - | RWU | -- `/initial/` contains a tree of files that will be set - as the initial condition on both Path1 and Path2 testdirs. -- `/modfiles/` contains files that will be used to - modify the Path1 and/or Path2 filesystems. -- `/golden/` contains the expected content of the test - working directory (`workdir`) at the completion of the testcase. -- `/scenario.txt` contains the body of the test, in the form of - various commands to modify files, run bisync, and snapshot listings. - Output from these commands is captured to `.../workdir/test.log` - for comparison to the golden files. +¹ Dropbox supports [its own custom +hash](https://www.dropbox.com/developers/reference/content-hash). +This is an SHA256 sum of all the 4 MiB block SHA256s. -### Supported test commands +² SFTP supports checksums if the same login has shell access and +`md5sum` or `sha1sum` as well as `echo` are in the remote's PATH. -- `test ` - Print the line to the console and to the `test.log`: - `test sync is working correctly with options x, y, z` -- `copy-listings ` - Save a copy of all `.lst` listings in the test working directory - with the specified prefix: - `save-listings exclude-pass-run` -- `move-listings ` - Similar to `copy-listings` but removes the source -- `purge-children ` - This will delete all child files and purge all child subdirs under given - directory but keep the parent intact. This behavior is important for tests - with Google Drive because removing and re-creating the parent would change - its ID. -- `delete-file ` - Delete a single file. -- `delete-glob ` - Delete a group of files located one level deep in the given directory - with names maching a given glob pattern. -- `touch-glob YYYY-MM-DD ` - Change modification time on a group of files. -- `touch-copy YYYY-MM-DD ` - Change file modification time then copy it to destination. -- `copy-file ` - Copy a single file to given directory. -- `copy-as ` - Similar to above but destination must include both directory - and the new file name at destination. -- `copy-dir ` and `sync-dir ` - Copy/sync a directory. Equivalent of `rclone copy` and `rclone sync`. -- `list-dirs ` - Equivalent to `rclone lsf -R --dirs-only ` -- `bisync [options]` - Runs bisync against `-remote` and `-remote2`. +³ WebDAV supports hashes when used with Fastmail Files, Owncloud and Nextcloud only. -### Supported substitution terms +⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and Nextcloud only. -- `{testdir/}` - the root dir of the testcase -- `{datadir/}` - the `modfiles` dir under the testcase root -- `{workdir/}` - the temporary test working directory -- `{path1/}` - the root of the Path1 test directory tree -- `{path2/}` - the root of the Path2 test directory tree -- `{session}` - base name of the test listings -- `{/}` - OS-specific path separator -- `{spc}`, `{tab}`, `{eol}` - whitespace -- `{chr:HH}` - raw byte with given hexadecimal code +⁵ [QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash) is Microsoft's own hash. -Substitution results of the terms named like `{dir/}` will end with -`/` (or backslash on Windows), so it is not necessary to include -slash in the usage, for example `delete-file {path1/}file1.txt`. +⁶ Mail.ru uses its own modified SHA1 hash -## Benchmarks +⁷ pCloud only supports SHA1 (not MD5) in its EU region -_This section is work in progress._ +⁸ Opendrive does not support creation of duplicate files using +their web client interface or other stock clients, but the underlying +storage platform has been determined to allow duplicate files, and it +is possible to create them with `rclone`. It may be that this is a +mistake or an unsupported feature. -Here are a few data points for scale, execution times, and memory usage. +⁹ QingStor does not support SetModTime for objects bigger than 5 GiB. -The first set of data was taken between a local disk to Dropbox. -The [speedtest.net](https://speedtest.net) download speed was ~170 Mbps, -and upload speed was ~10 Mbps. 500 files (~9.5 MB each) had been already -synched. 50 files were added in a new directory, each ~9.5 MB, ~475 MB total. +¹⁰ FTP supports modtimes for the major FTP servers, and also others +if they advertised required protocol extensions. See [this](https://rclone.org/ftp/#modification-times) +for more details. -Change | Operations and times | Overall run time ---------------------------------------|--------------------------------------------------------|------------------ -500 files synched (nothing to move) | 1x listings for Path1 & Path2 | 1.5 sec -500 files synched with --check-access | 1x listings for Path1 & Path2 | 1.5 sec -50 new files on remote | Queued 50 copies down: 27 sec | 29 sec -Moved local dir | Queued 50 copies up: 410 sec, 50 deletes up: 9 sec | 421 sec -Moved remote dir | Queued 50 copies down: 31 sec, 50 deletes down: <1 sec | 33 sec -Delete local dir | Queued 50 deletes up: 9 sec | 13 sec +¹¹ Internet Archive requires option `wait_archive` to be set to a non-zero value +for full modtime support. -This next data is from a user's application. They had ~400GB of data -over 1.96 million files being sync'ed between a Windows local disk and some -remote cloud. The file full path length was on average 35 characters -(which factors into load time and RAM required). +¹² HiDrive supports [its own custom +hash](https://static.hidrive.com/dev/0001). +It combines SHA1 sums for each 4 KiB block hierarchically to a single +top-level sum. -- Loading the prior listing into memory (1.96 million files, listing file - size 140 MB) took ~30 sec and occupied about 1 GB of RAM. -- Getting a fresh listing of the local file system (producing the - 140 MB output file) took about XXX sec. -- Getting a fresh listing of the remote file system (producing the 140 MB - output file) took about XXX sec. The network download speed was measured - at XXX Mb/s. -- Once the prior and current Path1 and Path2 listings were loaded (a total - of four to be loaded, two at a time), determining the deltas was pretty - quick (a few seconds for this test case), and the transfer time for any - files to be copied was dominated by the network bandwidth. +### Hash ### -## References +The cloud storage system supports various hash types of the objects. +The hashes are used when transferring data as an integrity check and +can be specifically used with the `--checksum` flag in syncs and in +the `check` command. -rclone's bisync implementation was derived from -the [rclonesync-V2](https://github.com/cjnaz/rclonesync-V2) project, -including documentation and test mechanisms, -with [@cjnaz](https://github.com/cjnaz)'s full support and encouragement. +To use the verify checksums when transferring between cloud storage +systems they must support a common hash type. -`rclone bisync` is similar in nature to a range of other projects: +### ModTime ### -- [unison](https://github.com/bcpierce00/unison) -- [syncthing](https://github.com/syncthing/syncthing) -- [cjnaz/rclonesync](https://github.com/cjnaz/rclonesync-V2) -- [ConorWilliams/rsinc](https://github.com/ConorWilliams/rsinc) -- [jwink3101/syncrclone](https://github.com/Jwink3101/syncrclone) -- [DavideRossi/upback](https://github.com/DavideRossi/upback) +Almost all cloud storage systems store some sort of timestamp +on objects, but several of them not something that is appropriate +to use for syncing. E.g. some backends will only write a timestamp +that represent the time of the upload. To be relevant for syncing +it should be able to store the modification time of the source +object. If this is not the case, rclone will only check the file +size by default, though can be configured to check the file hash +(with the `--checksum` flag). Ideally it should also be possible to +change the timestamp of an existing file without having to re-upload it. -Bisync adopts the differential synchronization technique, which is -based on keeping history of changes performed by both synchronizing sides. -See the _Dual Shadow Method_ section in the -[Neil Fraser's article](https://neil.fraser.name/writing/sync/). +Storage systems with a `-` in the ModTime column, means the +modification read on objects is not the modification time of the +file when uploaded. It is most likely the time the file was uploaded, +or possibly something else (like the time the picture was taken in +Google Photos). -Also note a number of academic publications by -[Benjamin Pierce](http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) -about _Unison_ and synchronization in general. +Storage systems with a `R` (for read-only) in the ModTime column, +means the it keeps modification times on objects, and updates them +when uploading objects, but it does not support changing only the +modification time (`SetModTime` operation) without re-uploading, +possibly not even without deleting existing first. Some operations +in rclone, such as `copy` and `sync` commands, will automatically +check for `SetModTime` support and re-upload if necessary to keep +the modification times in sync. Other commands will not work +without `SetModTime` support, e.g. `touch` command on an existing +file will fail, and changes to modification time only on a files +in a `mount` will be silently ignored. -# 1Fichier +Storage systems with `R/W` (for read/write) in the ModTime column, +means they do also support modtime-only operations. -This is a backend for the [1fichier](https://1fichier.com) cloud -storage service. Note that a Premium subscription is required to use -the API. +### Case Insensitive ### -Paths are specified as `remote:path` +If a cloud storage systems is case sensitive then it is possible to +have two files which differ only in case, e.g. `file.txt` and +`FILE.txt`. If a cloud storage system is case insensitive then that +isn't possible. -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +This can cause problems when syncing between a case insensitive +system and a case sensitive system. The symptom of this is that no +matter how many times you run the sync it never completes fully. -## Configuration +The local filesystem and SFTP may or may not be case sensitive +depending on OS. -The initial setup for 1Fichier involves getting the API key from the website which you -need to do in your browser. + * Windows - usually case insensitive, though case is preserved + * OSX - usually case insensitive, though it is possible to format case sensitive + * Linux - usually case sensitive, but there are case insensitive file systems (e.g. FAT formatted USB keys) -Here is an example of how to make a remote called `remote`. First run: +Most of the time this doesn't cause any problems as people tend to +avoid files whose name differs only by case even on case sensitive +systems. - rclone config +### Duplicate files ### -This will guide you through an interactive setup process: +If a cloud storage system allows duplicate files then it can have two +objects with the same name. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / 1Fichier - \ "fichier" -[snip] -Storage> fichier -** See help for fichier backend at: https://rclone.org/fichier/ ** +This confuses rclone greatly when syncing - use the `rclone dedupe` +command to rename or remove duplicates. -Your API Key, get it from https://1fichier.com/console/params.pl -Enter a string value. Press Enter for the default (""). -api_key> example_key +### Restricted filenames ### -Edit advanced config? (y/n) -y) Yes -n) No -y/n> -Remote config --------------------- -[remote] -type = fichier -api_key = example_key --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Some cloud storage systems might have restrictions on the characters +that are usable in file or directory names. +When `rclone` detects such a name during a file upload, it will +transparently replace the restricted characters with similar looking +Unicode characters. To handle the different sets of restricted characters +for different backends, rclone uses something it calls [encoding](#encoding). -Once configured you can then use `rclone` like this, +This process is designed to avoid ambiguous file names as much as +possible and allow to move files between many cloud storage systems +transparently. -List directories in top level of your 1Fichier account +The name shown by `rclone` to the user or during log output will only +contain a minimal set of [replaced characters](#restricted-characters) +to ensure correct formatting and not necessarily the actual name used +on the cloud storage. - rclone lsd remote: +This transformation is reversed when downloading a file or parsing +`rclone` arguments. For example, when uploading a file named `my file?.txt` +to Onedrive, it will be displayed as `my file?.txt` on the console, but +stored as `my file?.txt` to Onedrive (the `?` gets replaced by the similar +looking `?` character, the so-called "fullwidth question mark"). +The reverse transformation allows to read a file `unusual/name.txt` +from Google Drive, by passing the name `unusual/name.txt` on the command line +(the `/` needs to be replaced by the similar looking `/` character). -List all the files in your 1Fichier account +#### Caveats {#restricted-filenames-caveats} - rclone ls remote: +The filename encoding system works well in most cases, at least +where file names are written in English or similar languages. +You might not even notice it: It just works. In some cases it may +lead to issues, though. E.g. when file names are written in Chinese, +or Japanese, where it is always the Unicode fullwidth variants of the +punctuation marks that are used. -To copy a local directory to a 1Fichier directory called backup +On Windows, the characters `:`, `*` and `?` are examples of restricted +characters. If these are used in filenames on a remote that supports it, +Rclone will transparently convert them to their fullwidth Unicode +variants `*`, `?` and `:` when downloading to Windows, and back again +when uploading. This way files with names that are not allowed on Windows +can still be stored. - rclone copy /home/source remote:backup +However, if you have files on your Windows system originally with these same +Unicode characters in their names, they will be included in the same conversion +process. E.g. if you create a file in your Windows filesystem with name +`Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol, and use +rclone to upload it to Google Drive, which supports regular `:` (halfwidth +question mark), rclone will replace the fullwidth `:` with the +halfwidth `:` and store the file as `Test:1.jpg` in Google Drive. Since +both Windows and Google Drive allows the name `Test:1.jpg`, it would +probably be better if rclone just kept the name as is in this case. -### Modified time and hashes ### +With the opposite situation; if you have a file named `Test:1.jpg`, +in your Google Drive, e.g. uploaded from a Linux system where `:` is valid +in file names. Then later use rclone to copy this file to your Windows +computer you will notice that on your local disk it gets renamed +to `Test:1.jpg`. The original filename is not legal on Windows, due to +the `:`, and rclone therefore renames it to make the copy possible. +That is all good. However, this can also lead to an issue: If you already +had a *different* file named `Test:1.jpg` on Windows, and then use rclone +to copy either way. Rclone will then treat the file originally named +`Test:1.jpg` on Google Drive and the file originally named `Test:1.jpg` +on Windows as the same file, and replace the contents from one with the other. -1Fichier does not support modification times. It supports the Whirlpool hash algorithm. +Its virtually impossible to handle all cases like these correctly in all +situations, but by customizing the [encoding option](#encoding), changing the +set of characters that rclone should convert, you should be able to +create a configuration that works well for your specific situation. +See also the [example](https://rclone.org/overview/#encoding-example-windows) below. -### Duplicated files ### +(Windows was used as an example of a file system with many restricted +characters, and Google drive a storage system with few.) -1Fichier can have two files with exactly the same name and path (unlike a -normal file system). +#### Default restricted characters {#restricted-characters} -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +The table below shows the characters that are replaced by default. -### Restricted filename characters +When a replacement character is found in a filename, this character +will be escaped with the `‛` character to avoid ambiguous file names. +(e.g. a file named `␀.txt` would shown as `‛␀.txt`) -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Each cloud storage backend can use a different set of characters, +which will be specified in the documentation for each backend. | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| \ | 0x5C | \ | -| < | 0x3C | < | -| > | 0x3E | > | -| " | 0x22 | " | -| $ | 0x24 | $ | -| ` | 0x60 | ` | -| ' | 0x27 | ' | +| NUL | 0x00 | ␀ | +| SOH | 0x01 | ␁ | +| STX | 0x02 | ␂ | +| ETX | 0x03 | ␃ | +| EOT | 0x04 | ␄ | +| ENQ | 0x05 | ␅ | +| ACK | 0x06 | ␆ | +| BEL | 0x07 | ␇ | +| BS | 0x08 | ␈ | +| HT | 0x09 | ␉ | +| LF | 0x0A | ␊ | +| VT | 0x0B | ␋ | +| FF | 0x0C | ␌ | +| CR | 0x0D | ␍ | +| SO | 0x0E | ␎ | +| SI | 0x0F | ␏ | +| DLE | 0x10 | ␐ | +| DC1 | 0x11 | ␑ | +| DC2 | 0x12 | ␒ | +| DC3 | 0x13 | ␓ | +| DC4 | 0x14 | ␔ | +| NAK | 0x15 | ␕ | +| SYN | 0x16 | ␖ | +| ETB | 0x17 | ␗ | +| CAN | 0x18 | ␘ | +| EM | 0x19 | ␙ | +| SUB | 0x1A | ␚ | +| ESC | 0x1B | ␛ | +| FS | 0x1C | ␜ | +| GS | 0x1D | ␝ | +| RS | 0x1E | ␞ | +| US | 0x1F | ␟ | +| / | 0x2F | / | +| DEL | 0x7F | ␡ | -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: +The default encoding will also encode these file names as they are +problematic with many cloud storage systems. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | +| File name | Replacement | +| --------- |:-----------:| +| . | . | +| .. | .. | -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +#### Invalid UTF-8 bytes {#invalid-utf8} +Some backends only support a sequence of well formed UTF-8 bytes +as file or directory names. -### Standard options +In this case all invalid UTF-8 bytes will be replaced with a quoted +representation of the byte value to allow uploading a file to such a +backend. For example, the invalid byte `0xFE` will be encoded as `‛FE`. -Here are the Standard options specific to fichier (1Fichier). +A common source of invalid UTF-8 bytes are local filesystems, that store +names in a different encoding than UTF-8 or UTF-16, like latin1. See the +[local filenames](https://rclone.org/local/#filenames) section for details. -#### --fichier-api-key +#### Encoding option {#encoding} -Your API Key, get it from https://1fichier.com/console/params.pl. +Most backends have an encoding option, specified as a flag +`--backend-encoding` where `backend` is the name of the backend, or as +a config parameter `encoding` (you'll need to select the Advanced +config in `rclone config` to see it). -Properties: +This will have default value which encodes and decodes characters in +such a way as to preserve the maximum number of characters (see +above). -- Config: api_key -- Env Var: RCLONE_FICHIER_API_KEY -- Type: string -- Required: false +However this can be incorrect in some scenarios, for example if you +have a Windows file system with Unicode fullwidth characters +`*`, `?` or `:`, that you want to remain as those characters on the +remote rather than being translated to regular (halfwidth) `*`, `?` and `:`. -### Advanced options +The `--backend-encoding` flags allow you to change that. You can +disable the encoding completely with `--backend-encoding None` or set +`encoding = None` in the config file. -Here are the Advanced options specific to fichier (1Fichier). +Encoding takes a comma separated list of encodings. You can see the +list of all possible values by passing an invalid value to this +flag, e.g. `--local-encoding "help"`. The command `rclone help flags encoding` +will show you the defaults for the backends. -#### --fichier-shared-folder +| Encoding | Characters | Encoded as | +| --------- | ---------- | ---------- | +| Asterisk | `*` | `*` | +| BackQuote | `` ` `` | ``` | +| BackSlash | `\` | `\` | +| Colon | `:` | `:` | +| CrLf | CR 0x0D, LF 0x0A | `␍`, `␊` | +| Ctl | All control characters 0x00-0x1F | `␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟` | +| Del | DEL 0x7F | `␡` | +| Dollar | `$` | `$` | +| Dot | `.` or `..` as entire string | `.`, `..` | +| DoubleQuote | `"` | `"` | +| Hash | `#` | `#` | +| InvalidUtf8 | An invalid UTF-8 character (e.g. latin1) | `�` | +| LeftCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the left of a string | `␍`, `␊`, `␉`, `␋` | +| LeftPeriod | `.` on the left of a string | `.` | +| LeftSpace | SPACE on the left of a string | `␠` | +| LeftTilde | `~` on the left of a string | `~` | +| LtGt | `<`, `>` | `<`, `>` | +| None | No characters are encoded | | +| Percent | `%` | `%` | +| Pipe | \| | `|` | +| Question | `?` | `?` | +| RightCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the right of a string | `␍`, `␊`, `␉`, `␋` | +| RightPeriod | `.` on the right of a string | `.` | +| RightSpace | SPACE on the right of a string | `␠` | +| Semicolon | `;` | `;` | +| SingleQuote | `'` | `'` | +| Slash | `/` | `/` | +| SquareBracket | `[`, `]` | `[`, `]` | -If you want to download a shared folder, add this parameter. +##### Encoding example: FTP -Properties: +To take a specific example, the FTP backend's default encoding is -- Config: shared_folder -- Env Var: RCLONE_FICHIER_SHARED_FOLDER -- Type: string -- Required: false + --ftp-encoding "Slash,Del,Ctl,RightSpace,Dot" -#### --fichier-file-password +However, let's say the FTP server is running on Windows and can't have +any of the invalid Windows characters in file names. You are backing +up Linux servers to this FTP server which do have those characters in +file names. So you would add the Windows set which are -If you want to download a shared file that is password protected, add this parameter. + Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +to the existing ones, giving: -Properties: + Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace -- Config: file_password -- Env Var: RCLONE_FICHIER_FILE_PASSWORD -- Type: string -- Required: false +This can be specified using the `--ftp-encoding` flag or using an `encoding` parameter in the config file. -#### --fichier-folder-password +##### Encoding example: Windows -If you want to list the files in a shared folder that is password protected, add this parameter. +As a nother example, take a Windows system where there is a file with +name `Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol. +When using rclone to copy this to a remote which supports `:`, +the regular (halfwidth) colon (such as Google Drive), you will notice +that the file gets renamed to `Test:1.jpg`. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +To avoid this you can change the set of characters rclone should convert +for the local filesystem, using command-line argument `--local-encoding`. +Rclone's default behavior on Windows corresponds to -Properties: +``` +--local-encoding "Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" +``` -- Config: folder_password -- Env Var: RCLONE_FICHIER_FOLDER_PASSWORD -- Type: string -- Required: false +If you want to use fullwidth characters `:`, `*` and `?` in your filenames +without rclone changing them when uploading to a remote, then set the same as +the default value but without `Colon,Question,Asterisk`: -#### --fichier-encoding +``` +--local-encoding "Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" +``` -The encoding for the backend. +Alternatively, you can disable the conversion of any characters with `--local-encoding None`. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Instead of using command-line argument `--local-encoding`, you may also set it +as [environment variable](https://rclone.org/docs/#environment-variables) `RCLONE_LOCAL_ENCODING`, +or [configure](https://rclone.org/docs/#configure) a remote of type `local` in your config, +and set the `encoding` option there. -Properties: +The risk by doing this is that if you have a filename with the regular (halfwidth) +`:`, `*` and `?` in your cloud storage, and you try to download +it to your Windows filesystem, this will fail. These characters are not +valid in filenames on Windows, and you have told rclone not to work around +this by converting them to valid fullwidth variants. -- Config: encoding -- Env Var: RCLONE_FICHIER_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot +### MIME Type ### +MIME types (also known as media types) classify types of documents +using a simple text classification, e.g. `text/html` or +`application/pdf`. +Some cloud storage systems support reading (`R`) the MIME type of +objects and some support writing (`W`) the MIME type of objects. -## Limitations +The MIME type can be important if you are serving files directly to +HTTP from the storage system. -`rclone about` is not supported by the 1Fichier backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +If you are copying from a remote which supports reading (`R`) to a +remote which supports writing (`W`) then rclone will preserve the MIME +types. Otherwise they will be guessed from the extension, or the +remote itself may assign the MIME type. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +### Metadata -# Alias +Backends may or may support reading or writing metadata. They may +support reading and writing system metadata (metadata intrinsic to +that backend) and/or user metadata (general purpose metadata). -The `alias` remote provides a new name for another remote. +The levels of metadata support are -Paths may be as deep as required or a local path, -e.g. `remote:directory/subdirectory` or `/directory/subdirectory`. +| Key | Explanation | +|-----|-------------| +| `R` | Read only System Metadata | +| `RW` | Read and write System Metadata | +| `RWU` | Read and write System Metadata and read and write User Metadata | -During the initial setup with `rclone config` you will specify the target -remote. The target remote can either be a local path or another remote. +See [the metadata docs](https://rclone.org/docs/#metadata) for more info. -Subfolders can be used in target remote. Assume an alias remote named `backup` -with the target `mydrive:private/backup`. Invoking `rclone mkdir backup:desktop` -is exactly the same as invoking `rclone mkdir mydrive:private/backup/desktop`. +## Optional Features ## -There will be no special handling of paths containing `..` segments. -Invoking `rclone mkdir backup:../desktop` is exactly the same as invoking -`rclone mkdir mydrive:private/backup/../desktop`. -The empty path is not allowed as a remote. To alias the current directory -use `.` instead. +All rclone remotes support a base command set. Other features depend +upon backend-specific capabilities. -The target remote can also be a [connection string](https://rclone.org/docs/#connection-strings). -This can be used to modify the config of a remote for different uses, e.g. -the alias `myDriveTrash` with the target remote `myDrive,trashed_only:` -can be used to only show the trashed files in `myDrive`. +| Name | Purge | Copy | Move | DirMove | CleanUp | ListR | StreamUpload | MultithreadUpload | LinkSharing | About | EmptyDir | +| ---------------------------- |:-----:|:----:|:----:|:-------:|:-------:|:-----:|:------------:|:------------------|:------------:|:-----:|:--------:| +| 1Fichier | No | Yes | Yes | No | No | No | No | No | Yes | No | Yes | +| Akamai Netstorage | Yes | No | No | No | No | Yes | Yes | No | No | No | Yes | +| Amazon Drive | Yes | No | Yes | Yes | No | No | No | No | No | No | Yes | +| Amazon S3 (or S3 compatible) | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | +| Backblaze B2 | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | +| Box | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | +| Citrix ShareFile | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | +| Dropbox | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | +| Enterprise File Fabric | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | +| FTP | No | No | Yes | Yes | No | No | Yes | No | No | No | Yes | +| Google Cloud Storage | Yes | Yes | No | No | No | Yes | Yes | No | No | No | No | +| Google Drive | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | +| Google Photos | No | No | No | No | No | No | No | No | No | No | No | +| HDFS | Yes | No | Yes | Yes | No | No | Yes | No | No | Yes | Yes | +| HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | +| HTTP | No | No | No | No | No | No | No | No | No | No | Yes | +| Internet Archive | No | Yes | No | No | Yes | Yes | No | No | Yes | Yes | No | +| Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | +| Koofr | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | +| Mail.ru Cloud | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| Mega | Yes | No | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| Memory | No | Yes | No | No | No | Yes | Yes | No | No | No | No | +| Microsoft Azure Blob Storage | Yes | Yes | No | No | No | Yes | Yes | Yes | No | No | No | +| Microsoft Azure Files Storage | No | Yes | Yes | Yes | No | No | Yes | Yes | No | Yes | Yes | +| Microsoft OneDrive | Yes | Yes | Yes | Yes | Yes | Yes ⁵ | No | No | Yes | Yes | Yes | +| OpenDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | +| OpenStack Swift | Yes ¹ | Yes | No | No | No | Yes | Yes | No | No | Yes | No | +| Oracle Object Storage | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | No | +| pCloud | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| PikPak | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| premiumize.me | Yes | No | Yes | Yes | No | No | No | No | Yes | Yes | Yes | +| put.io | Yes | No | Yes | Yes | Yes | No | Yes | No | No | Yes | Yes | +| Proton Drive | Yes | No | Yes | Yes | Yes | No | No | No | No | Yes | Yes | +| QingStor | No | Yes | No | No | Yes | Yes | No | No | No | No | No | +| Quatrix by Maytech | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | Yes | +| Seafile | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | +| SFTP | No | Yes ⁴| Yes | Yes | No | No | Yes | No | No | Yes | Yes | +| Sia | No | No | No | No | No | No | Yes | No | No | No | Yes | +| SMB | No | No | Yes | Yes | No | No | Yes | Yes | No | No | Yes | +| SugarSync | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | No | Yes | +| Storj | Yes ² | Yes | Yes | No | No | Yes | Yes | No | Yes | No | No | +| Uptobox | No | Yes | Yes | Yes | No | No | No | No | No | No | No | +| WebDAV | Yes | Yes | Yes | Yes | No | No | Yes ³ | No | No | Yes | Yes | +| Yandex Disk | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | +| Zoho WorkDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | Yes | +| The local filesystem | Yes | No | Yes | Yes | No | No | Yes | Yes | No | Yes | Yes | + +¹ Note Swift implements this in order to delete directory markers but +it doesn't actually have a quicker way of deleting files other than +deleting them individually. -## Configuration +² Storj implements this efficiently only for entire buckets. If +purging a directory inside a bucket, files are deleted individually. -Here is an example of how to make an alias called `remote` for local folder. -First run: +³ StreamUpload is not supported with Nextcloud - rclone config +⁴ Use the `--sftp-copy-is-hardlink` flag to enable. -This will guide you through an interactive setup process: +⁵ Use the `--onedrive-delta` flag to enable. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Alias for an existing remote - \ "alias" -[snip] -Storage> alias -Remote or path to alias. -Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". -remote> /mnt/storage/backup -Remote config --------------------- -[remote] -remote = /mnt/storage/backup --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +### Purge ### -Name Type -==== ==== -remote alias +This deletes a directory quicker than just deleting all the files in +the directory. -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q -``` +### Copy ### -Once configured you can then use `rclone` like this, +Used when copying an object to and from the same remote. This known +as a server-side copy so you can copy a file without downloading it +and uploading it again. It is used if you use `rclone copy` or +`rclone move` if the remote doesn't support `Move` directly. -List directories in top level in `/mnt/storage/backup` +If the server doesn't support `Copy` directly then for copy operations +the file is downloaded then re-uploaded. - rclone lsd remote: +### Move ### -List all the files in `/mnt/storage/backup` +Used when moving/renaming an object on the same remote. This is known +as a server-side move of a file. This is used in `rclone move` if the +server doesn't support `DirMove`. - rclone ls remote: +If the server isn't capable of `Move` then rclone simulates it with +`Copy` then delete. If the server doesn't support `Copy` then rclone +will download the file and re-upload it. -Copy another local directory to the alias directory called source +### DirMove ### - rclone copy /home/source remote:source +This is used to implement `rclone move` to move a directory if +possible. If it isn't then it will use `Move` on each file (which +falls back to `Copy` then download and upload - see `Move` section). +### CleanUp ### -### Standard options +This is used for emptying the trash for a remote by `rclone cleanup`. -Here are the Standard options specific to alias (Alias for an existing remote). +If the server can't do `CleanUp` then `rclone cleanup` will return an +error. -#### --alias-remote +‡‡ Note that while Box implements this it has to delete every file +individually so it will be slower than emptying the trash via the WebUI -Remote or path to alias. +### ListR ### -Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". +The remote supports a recursive list to list all the contents beneath +a directory quickly. This enables the `--fast-list` flag to work. +See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. -Properties: +### StreamUpload ### -- Config: remote -- Env Var: RCLONE_ALIAS_REMOTE -- Type: string -- Required: true +Some remotes allow files to be uploaded without knowing the file size +in advance. This allows certain operations to work without spooling the +file to local disk first, e.g. `rclone rcat`. +### MultithreadUpload ### +Some remotes allow transfers to the remote to be sent as chunks in +parallel. If this is supported then rclone will use multi-thread +copying to transfer files much faster. -# Amazon Drive +### LinkSharing ### -Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage -service run by Amazon for consumers. +Sets the necessary permissions on a file or folder and prints a link +that allows others to access them, even if they don't have an account +on the particular cloud provider. -## Status +### About ### -**Important:** rclone supports Amazon Drive only if you have your own -set of API keys. Unfortunately the [Amazon Drive developer -program](https://developer.amazon.com/amazon-drive) is now closed to -new entries so if you don't already have your own set of keys you will -not be able to use rclone with Amazon Drive. +Rclone `about` prints quota information for a remote. Typical output +includes bytes used, free, quota and in trash. -For the history on why rclone no longer has a set of Amazon Drive API -keys see [the forum](https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). +If a remote lacks about capability `rclone about remote:`returns +an error. -If you happen to know anyone who works at Amazon then please ask them -to re-instate rclone into the Amazon Drive developer program - thanks! +Backends without about capability cannot determine free space for an +rclone mount, or use policy `mfs` (most free space) as a member of an +rclone union remote. -## Configuration +See [rclone about command](https://rclone.org/commands/rclone_about/) -The initial setup for Amazon Drive involves getting a token from -Amazon which you need to do in your browser. `rclone config` walks -you through it. +### EmptyDir ### -The configuration process for Amazon Drive may involve using an [oauth -proxy](https://github.com/ncw/oauthproxy). This is used to keep the -Amazon credentials out of the source code. The proxy runs in Google's -very secure App Engine environment and doesn't store any credentials -which pass through it. +The remote supports empty directories. See [Limitations](https://rclone.org/bugs/#limitations) + for details. Most Object/Bucket-based remotes do not support this. -Since rclone doesn't currently have its own Amazon Drive credentials -so you will either need to have your own `client_id` and -`client_secret` with Amazon Drive, or use a third-party oauth proxy -in which case you will need to enter `client_id`, `client_secret`, -`auth_url` and `token_url`. +# Global Flags -Note also if you are not using Amazon's `auth_url` and `token_url`, -(ie you filled in something for those) then if setting up on a remote -machine you can only use the [copying the config method of -configuration](https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) -- `rclone authorize` will not work. +This describes the global flags available to every rclone command +split into groups. -Here is an example of how to make a remote called `remote`. First run: - rclone config +## Copy -This will guide you through an interactive setup process: +Flags for anything which can Copy a file. ``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon Drive - \ "amazon cloud drive" -[snip] -Storage> amazon cloud drive -Amazon Application Client Id - required. -client_id> your client ID goes here -Amazon Application Client Secret - required. -client_secret> your client secret goes here -Auth server URL - leave blank to use Amazon's. -auth_url> Optional auth URL -Token server url - leave blank to use Amazon's. -token_url> Optional token URL -Remote config -Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth -Log in and authorize rclone for access -Waiting for code... -Got code --------------------- -[remote] -client_id = your client ID goes here -client_secret = your client secret goes here -auth_url = Optional auth URL -token_url = Optional token URL -token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination ``` -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. - -Note that rclone runs a webserver on your local machine to collect the -token as returned from Amazon. This only runs from the moment it -opens your browser to the moment you get back the verification -code. This is on `http://127.0.0.1:53682/` and this it may require -you to unblock it temporarily if you are running a host firewall. -Once configured you can then use `rclone` like this, +## Sync -List directories in top level of your Amazon Drive +Flags just used for `rclone sync`. - rclone lsd remote: +``` + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") +``` -List all the files in your Amazon Drive - rclone ls remote: +## Important -To copy a local directory to an Amazon Drive directory called backup +Important flags useful for most commands. - rclone copy /home/source remote:backup +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` -### Modified time and MD5SUMs -Amazon Drive doesn't allow modification times to be changed via -the API so these won't be accurate or used for syncing. +## Check -It does store MD5SUMs so for a more accurate sync, you can use the -`--checksum` flag. +Flags used for `rclone check`. -### Restricted filename characters +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +## Networking -### Deleting files +General networking and HTTP stuff. -Any files you delete with rclone will end up in the trash. Amazon -don't provide an API to permanently delete files, nor to empty the -trash, so you will have to do that with one of Amazon's apps or via -the Amazon Drive website. As of November 17, 2016, files are -automatically deleted by Amazon from the trash after 30 days. +``` + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --contimeout Duration Connect timeout (default 1m0s) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-gzip-encoding Don't set Accept-Encoding: gzip + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --use-cookies Enable session cookiejar + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") +``` -### Using with non `.com` Amazon accounts -Let's say you usually use `amazon.co.uk`. When you authenticate with -rclone it will take you to an `amazon.com` page to log in. Your -`amazon.co.uk` email and password should work here just fine. +## Performance +Flags helpful for increasing performance. -### Standard options +``` + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --checkers int Number of checkers to run in parallel (default 8) + --transfers int Number of file transfers to run in parallel (default 4) +``` -Here are the Standard options specific to amazon cloud drive (Amazon Drive). -#### --acd-client-id +## Config -OAuth Client Id. +General configuration of rclone. -Leave blank normally. +``` + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --config string Config file (default "$HOME/.config/rclone/rclone.conf") + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --disable string Disable a comma separated list of features (use --disable help to see a list) + -n, --dry-run Do a trial run with no permanent changes + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + -i, --interactive Enable interactive mode + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --low-level-retries int Number of low level retries to do (default 10) + --no-console Hide console window (supported on Windows only) + --no-unicode-normalization Don't normalize unicode characters in filenames + --password-command SpaceSepList Command for supplying password for encrypted configuration + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --temp-dir string Directory rclone will use for temporary files (default "/tmp") + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata +``` -Properties: -- Config: client_id -- Env Var: RCLONE_ACD_CLIENT_ID -- Type: string -- Required: false +## Debugging -#### --acd-client-secret +Flags for developers. -OAuth Client Secret. +``` + --cpuprofile string Write cpu profile to file + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --memprofile string Write memory profile to file +``` -Leave blank normally. -Properties: +## Filter -- Config: client_secret -- Env Var: RCLONE_ACD_CLIENT_SECRET -- Type: string -- Required: false +Flags for filtering directory listings. -### Advanced options +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -Here are the Advanced options specific to amazon cloud drive (Amazon Drive). -#### --acd-token +## Listing -OAuth Access Token as a JSON blob. +Flags for listing directories. -Properties: +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` -- Config: token -- Env Var: RCLONE_ACD_TOKEN -- Type: string -- Required: false -#### --acd-auth-url +## Logging -Auth server URL. +Logging and statistics. -Leave blank to use the provider defaults. +``` + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default "date,time") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + -q, --quiet Print as little stuff as possible + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") + --use-json-log Use json log format + -v, --verbose count Print lots more stuff (repeat for more) +``` + + +## Metadata + +Flags to control metadata. + +``` + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading +``` + + +## RC + +Flags to control the Remote Control API. + +``` + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui +``` + + +## Backend + +Backend only flags. These can be set in the config file also. + +``` + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal's client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don't store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don't attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user's password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as 'true' + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default "user") + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default "md5") + --chunker-remote string Remote to chunk/unchunk + --combine-upstreams SpaceSepList Upstreams for combining + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default "gzip") + --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + -L, --copy-links Follow symlinks and copy the pointed to item + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") + --crypt-filename-encryption string How to encrypt the filenames (default "standard") + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default "$USER") + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) + --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports + --hdfs-service-principal-name string Kerberos service principal name for the namenode + --hdfs-username string Hadoop user name + --hidrive-auth-url string Auth server URL + --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) + --hidrive-client-id string OAuth Client Id + --hidrive-client-secret string OAuth Client Secret + --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) + --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") + --hidrive-root-prefix string The root/parent folder for all paths (default "/") + --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") + --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") + --hidrive-token string OAuth Access Token as a JSON blob + --hidrive-token-url string Token server url + --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) + --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) + --http-headers CommaSepList Set HTTP headers for all transactions + --http-no-head Don't use HEAD requests + --http-no-slash Set this if the site doesn't end directories with / + --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings + --internetarchive-access-key-id string IAS3 Access Key + --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") + --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") + --internetarchive-secret-access-key string IAS3 Secret Key (password) + --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) + --jottacloud-auth-url string Auth server URL + --jottacloud-client-id string OAuth Client Id + --jottacloud-client-secret string OAuth Client Secret + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-hard-delete Delete files permanently rather than putting them into the trash + --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) + --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them + --jottacloud-token string OAuth Access Token as a JSON blob + --jottacloud-token-url string Token server url + --jottacloud-trashed-only Only show files that are in the trash + --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-endpoint string The Koofr API endpoint to use + --koofr-mountid string Mount ID of the mount to use + --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) + --koofr-provider string Choose your storage provider + --koofr-setmtime Does the backend support setting modification time (default true) + --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account + -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension + --local-case-insensitive Force the filesystem to report itself as case insensitive + --local-case-sensitive Force the filesystem to report itself as case sensitive + --local-encoding Encoding The encoding for the backend (default Slash,Dot) + --local-no-check-updated Don't check to see if the files change during upload + --local-no-preallocate Disable preallocation of disk space for transferred files + --local-no-set-modtime Disable setting modtime + --local-no-sparse Disable sparse files for multi-thread downloads + --local-nounc Disable UNC (long path names) conversion on Windows + --local-unicode-normalization Apply unicode NFC normalization to paths and filenames + --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) + --mailru-auth-url string Auth server URL + --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) + --mailru-client-id string OAuth Client Id + --mailru-client-secret string OAuth Client Secret + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-pass string Password (obscured) + --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) + --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") + --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) + --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) + --mailru-token string OAuth Access Token as a JSON blob + --mailru-token-url string Token server url + --mailru-user string User name (usually email) + --mega-debug Output more debug from Mega + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-hard-delete Delete files permanently rather than putting them into the trash + --mega-pass string Password (obscured) + --mega-use-https Use HTTPS for transfers + --mega-user string User name + --netstorage-account string Set the NetStorage account name + --netstorage-host string Domain+path of NetStorage host to connect to + --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") + --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) + -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) + --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) + --onedrive-auth-url string Auth server URL + --onedrive-av-override Allows download of files the server thinks has a virus + --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) + --onedrive-client-id string OAuth Client Id + --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings + --onedrive-drive-id string The ID of the drive to use + --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings + --onedrive-hash-type string Specify the hash in use for the backend (default "auto") + --onedrive-link-password string Set the password for links created by the link command + --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") + --onedrive-link-type string Set the type of the links created by the link command (default "view") + --onedrive-list-chunk int Size of listing chunk (default 1000) + --onedrive-no-versions Remove all versions on modifying operations + --onedrive-region string Choose national cloud region for OneDrive (default "global") + --onedrive-root-folder-id string ID of the root folder + --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --onedrive-token string OAuth Access Token as a JSON blob + --onedrive-token-url string Token server url + --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object + --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --oos-compartment string Object storage compartment OCID + --oos-config-file string Path to OCI config file (default "~/.oci/config") + --oos-config-profile string Profile name inside the oci config file (default "Default") + --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --oos-copy-timeout Duration Timeout for copy (default 1m0s) + --oos-disable-checksum Don't store MD5 checksum with object metadata + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-endpoint string Endpoint for Object storage API + --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery + --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --oos-namespace string Object storage namespace + --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it + --oos-provider string Choose your Auth Provider (default "env_auth") + --oos-region string Object storage Region + --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm + --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the + --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") + --oos-upload-concurrency int Concurrency for multipart uploads (default 10) + --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-password string Password (obscured) + --opendrive-username string Username + --pcloud-auth-url string Auth server URL + --pcloud-client-id string OAuth Client Id + --pcloud-client-secret string OAuth Client Secret + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") + --pcloud-password string Your pcloud password (obscured) + --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") + --pcloud-token string OAuth Access Token as a JSON blob + --pcloud-token-url string Token server url + --pcloud-username string Your pcloud username + --pikpak-auth-url string Auth server URL + --pikpak-client-id string OAuth Client Id + --pikpak-client-secret string OAuth Client Secret + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) + --pikpak-pass string Pikpak password (obscured) + --pikpak-root-folder-id string ID of the root folder + --pikpak-token string OAuth Access Token as a JSON blob + --pikpak-token-url string Token server url + --pikpak-trashed-only Only show files that are in the trash + --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) + --pikpak-user string Pikpak username + --premiumizeme-auth-url string Auth server URL + --premiumizeme-client-id string OAuth Client Id + --premiumizeme-client-secret string OAuth Client Secret + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-token string OAuth Access Token as a JSON blob + --premiumizeme-token-url string Token server url + --protondrive-2fa string The 2FA code + --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") + --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) + --protondrive-original-file-size Return the file size before encryption (default true) + --protondrive-password string The password of your proton account (obscured) + --protondrive-replace-existing-draft Create a new revision when filename conflict is detected + --protondrive-username string The username of your proton account + --putio-auth-url string Auth server URL + --putio-client-id string OAuth Client Id + --putio-client-secret string OAuth Client Secret + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-token string OAuth Access Token as a JSON blob + --putio-token-url string Token server url + --qingstor-access-key-id string QingStor Access Key ID + --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) + --qingstor-connection-retries int Number of connection retries (default 3) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-endpoint string Enter an endpoint URL to connection QingStor API + --qingstor-env-auth Get QingStor credentials from runtime + --qingstor-secret-access-key string QingStor Secret Access Key (password) + --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) + --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --qingstor-zone string Zone to connect to + --quatrix-api-key string API key for accessing Quatrix account + --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-hard-delete Delete files permanently rather than putting them into the trash + --quatrix-host string Host name of Quatrix account + --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) + --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) + --s3-access-key-id string AWS Access Key ID + --s3-acl string Canned ACL used when creating buckets and storing or copying objects + --s3-bucket-acl string Canned ACL used when creating buckets + --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --s3-decompress If set this will decompress gzip encoded objects + --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created + --s3-disable-checksum Don't store MD5 checksum with object metadata + --s3-disable-http2 Disable usage of http2 for S3 backends + --s3-download-url string Custom endpoint for downloads + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-endpoint string Endpoint for S3 API + --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) + --s3-force-path-style If true use path style access if false use virtual hosted style (default true) + --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery + --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) + --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) + --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto + --s3-location-constraint string Location constraint - must be set to match the Region + --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) + --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it + --s3-no-head If set, don't HEAD uploaded objects to check integrity + --s3-no-head-object If set, do not do HEAD before GET when getting objects + --s3-no-system-metadata Suppress setting and reading of system metadata + --s3-profile string Profile to use in the shared credentials file + --s3-provider string Choose your S3 provider + --s3-region string Region to connect to + --s3-requester-pays Enables requester pays option when interacting with S3 bucket + --s3-secret-access-key string AWS Secret Access Key (password) + --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 + --s3-session-token string An AWS session token + --s3-shared-credentials-file string Path to the shared credentials file + --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 + --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data + --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data + --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) + --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key + --s3-storage-class string The storage class to use when storing new objects in S3 + --s3-sts-endpoint string Endpoint for STS + --s3-upload-concurrency int Concurrency for multipart uploads (default 4) + --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint + --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) + --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) + --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads + --s3-v2-auth If true use v2 authentication + --s3-version-at Time Show file versions as they were at the specified time (default off) + --s3-versions Include old versions in directory listings + --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) + --seafile-create-library Should rclone create a library if it doesn't exist + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-library string Name of the library + --seafile-library-key string Library password (for encrypted libraries only) (obscured) + --seafile-pass string Password (obscured) + --seafile-url string URL of seafile host to connect to + --seafile-user string User name (usually email address) + --sftp-ask-password Allow asking for SFTP password when needed + --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) + --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference + --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks + --sftp-disable-concurrent-reads If set don't use concurrent reads + --sftp-disable-concurrent-writes If set don't use concurrent writes + --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available + --sftp-host string SSH host to connect to + --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference + --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference + --sftp-key-file string Path to PEM-encoded private key file + --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) + --sftp-key-pem string Raw PEM-encoded private key + --sftp-key-use-agent When set forces the usage of the ssh-agent + --sftp-known-hosts-file string Optional path to known_hosts file + --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference + --sftp-md5sum-command string The command used to read md5 hashes + --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) + --sftp-path-override string Override path used by SSH shell commands + --sftp-port int SSH port number (default 22) + --sftp-pubkey-file string Optional path to public key file + --sftp-server-command string Specifies the path or command to run a sftp server on the remote host + --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands + --sftp-set-modtime Set the modified time on the remote if set (default true) + --sftp-sha1sum-command string The command used to read sha1 hashes + --sftp-shell-type string The type of SSH shell on remote server, if any + --sftp-skip-links Set to skip any symlinks and any other non regular files + --sftp-socks-proxy string Socks 5 proxy host + --sftp-ssh SpaceSepList Path and arguments to external ssh binary + --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") + --sftp-use-fstat If set use fstat instead of stat + --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods + --sftp-user string SSH username (default "$USER") + --sharefile-auth-url string Auth server URL + --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) + --sharefile-client-id string OAuth Client Id + --sharefile-client-secret string OAuth Client Secret + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-endpoint string Endpoint for API calls + --sharefile-root-folder-id string ID of the root folder + --sharefile-token string OAuth Access Token as a JSON blob + --sharefile-token-url string Token server url + --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) + --sia-api-password string Sia Daemon API Password (obscured) + --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-user-agent string Siad User Agent (default "Sia-Agent") + --skip-links Don't warn about skipped symlinks + --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) + --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) + --smb-host string SMB server hostname to connect to + --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --smb-pass string SMB password (obscured) + --smb-port int SMB port number (default 445) + --smb-spn string Service principal name + --smb-user string SMB username (default "$USER") + --storj-access-grant string Access grant + --storj-api-key string API key + --storj-passphrase string Encryption passphrase + --storj-provider string Choose an authentication method (default "existing") + --storj-satellite-address string Satellite address (default "us1.storj.io") + --sugarsync-access-key-id string Sugarsync Access Key ID + --sugarsync-app-id string Sugarsync App ID + --sugarsync-authorization string Sugarsync authorization + --sugarsync-authorization-expiry string Sugarsync authorization expiry + --sugarsync-deleted-id string Sugarsync deleted folder id + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-hard-delete Permanently delete files if true + --sugarsync-private-access-key string Sugarsync Private Access Key + --sugarsync-refresh-token string Sugarsync refresh token + --sugarsync-root-id string Sugarsync root id + --sugarsync-user string Sugarsync user + --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) + --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) + --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) + --swift-auth string Authentication URL for server (OS_AUTH_URL) + --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) + --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) + --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) + --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) + --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") + --swift-env-auth Get swift credentials from environment variables in standard OpenStack form + --swift-key string API key or password (OS_PASSWORD) + --swift-leave-parts-on-error If true avoid calling abort upload on a failure + --swift-no-chunk Don't chunk files during streaming upload + --swift-no-large-objects Disable support for static and dynamic large objects + --swift-region string Region name - optional (OS_REGION_NAME) + --swift-storage-policy string The storage policy to use when creating a new container + --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) + --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) + --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) + --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) + --swift-user string User name to log in (OS_USERNAME) + --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) + --union-action-policy string Policy to choose upstream on ACTION category (default "epall") + --union-cache-time int Cache time of usage and free space (in seconds) (default 120) + --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") + --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) + --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") + --union-upstreams string List of space separated upstreams + --uptobox-access-token string Your access token + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-private Set to make uploaded files private + --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) + --webdav-bearer-token-command string Command to run to get a bearer token + --webdav-encoding string The encoding for the backend + --webdav-headers CommaSepList Set HTTP headers for all transactions + --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) + --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --webdav-pass string Password (obscured) + --webdav-url string URL of http host to connect to + --webdav-user string User name + --webdav-vendor string Name of the WebDAV site/service/software you are using + --yandex-auth-url string Auth server URL + --yandex-client-id string OAuth Client Id + --yandex-client-secret string OAuth Client Secret + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-hard-delete Delete files permanently rather than putting them into the trash + --yandex-token string OAuth Access Token as a JSON blob + --yandex-token-url string Token server url + --zoho-auth-url string Auth server URL + --zoho-client-id string OAuth Client Id + --zoho-client-secret string OAuth Client Secret + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-region string Zoho region to connect to + --zoho-token string OAuth Access Token as a JSON blob + --zoho-token-url string Token server url +``` -Properties: +# Docker Volume Plugin -- Config: auth_url -- Env Var: RCLONE_ACD_AUTH_URL -- Type: string -- Required: false +## Introduction -#### --acd-token-url +Docker 1.9 has added support for creating +[named volumes](https://docs.docker.com/storage/volumes/) via +[command-line interface](https://docs.docker.com/engine/reference/commandline/volume_create/) +and mounting them in containers as a way to share data between them. +Since Docker 1.10 you can create named volumes with +[Docker Compose](https://docs.docker.com/compose/) by descriptions in +[docker-compose.yml](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) +files for use by container groups on a single host. +As of Docker 1.12 volumes are supported by +[Docker Swarm](https://docs.docker.com/engine/swarm/key-concepts/) +included with Docker Engine and created from descriptions in +[swarm compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) +files for use with _swarm stacks_ across multiple cluster nodes. -Token server url. +[Docker Volume Plugins](https://docs.docker.com/engine/extend/plugins_volume/) +augment the default `local` volume driver included in Docker with stateful +volumes shared across containers and hosts. Unlike local volumes, your +data will _not_ be deleted when such volume is removed. Plugins can run +managed by the docker daemon, as a native system service +(under systemd, _sysv_ or _upstart_) or as a standalone executable. +Rclone can run as docker volume plugin in all these modes. +It interacts with the local docker daemon +via [plugin API](https://docs.docker.com/engine/extend/plugin_api/) and +handles mounting of remote file systems into docker containers so it must +run on the same host as the docker daemon or on every Swarm node. -Leave blank to use the provider defaults. +## Getting started -Properties: +In the first example we will use the [SFTP](https://rclone.org/sftp/) +rclone volume with Docker engine on a standalone Ubuntu machine. -- Config: token_url -- Env Var: RCLONE_ACD_TOKEN_URL -- Type: string -- Required: false +Start from [installing Docker](https://docs.docker.com/engine/install/) +on the host. -#### --acd-checkpoint +The _FUSE_ driver is a prerequisite for rclone mounting and should be +installed on host: +``` +sudo apt-get -y install fuse +``` -Checkpoint for internal polling (debug). +Create two directories required by rclone docker plugin: +``` +sudo mkdir -p /var/lib/docker-plugins/rclone/config +sudo mkdir -p /var/lib/docker-plugins/rclone/cache +``` -Properties: +Install the managed rclone docker plugin for your architecture (here `amd64`): +``` +docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions +docker plugin list +``` -- Config: checkpoint -- Env Var: RCLONE_ACD_CHECKPOINT -- Type: string -- Required: false +Create your [SFTP volume](https://rclone.org/sftp/#standard-options): +``` +docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true +``` -#### --acd-upload-wait-per-gb +Note that since all options are static, you don't even have to run +`rclone config` or create the `rclone.conf` file (but the `config` directory +should still be present). In the simplest case you can use `localhost` +as _hostname_ and your SSH credentials as _username_ and _password_. +You can also change the remote path to your home directory on the host, +for example `-o path=/home/username`. -Additional time per GiB to wait after a failed complete upload to see if it appears. -Sometimes Amazon Drive gives an error when a file has been fully -uploaded but the file appears anyway after a little while. This -happens sometimes for files over 1 GiB in size and nearly every time for -files bigger than 10 GiB. This parameter controls the time rclone waits -for the file to appear. +Time to create a test container and mount the volume into it: +``` +docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash +``` -The default value for this parameter is 3 minutes per GiB, so by -default it will wait 3 minutes for every GiB uploaded to see if the -file appears. +If all goes well, you will enter the new container and change right to +the mounted SFTP remote. You can type `ls` to list the mounted directory +or otherwise play with it. Type `exit` when you are done. +The container will stop but the volume will stay, ready to be reused. +When it's not needed anymore, remove it: +``` +docker volume list +docker volume remove firstvolume +``` -You can disable this feature by setting it to 0. This may cause -conflict errors as rclone retries the failed upload but the file will -most likely appear correctly eventually. +Now let us try **something more elaborate**: +[Google Drive](https://rclone.org/drive/) volume on multi-node Docker Swarm. -These values were determined empirically by observing lots of uploads -of big files for a range of file sizes. +You should start from installing Docker and FUSE, creating plugin +directories and installing rclone plugin on _every_ swarm node. +Then [setup the Swarm](https://docs.docker.com/engine/swarm/swarm-mode/). -Upload with the "-v" flag to see more info about what rclone is doing -in this situation. +Google Drive volumes need an access token which can be setup via web +browser and will be periodically renewed by rclone. The managed +plugin cannot run a browser so we will use a technique similar to the +[rclone setup on a headless box](https://rclone.org/remote_setup/). -Properties: +Run [rclone config](https://rclone.org/commands/rclone_config_create/) +on _another_ machine equipped with _web browser_ and graphical user interface. +Create the [Google Drive remote](https://rclone.org/drive/#standard-options). +When done, transfer the resulting `rclone.conf` to the Swarm cluster +and save as `/var/lib/docker-plugins/rclone/config/rclone.conf` +on _every_ node. By default this location is accessible only to the +root user so you will need appropriate privileges. The resulting config +will look like this: +``` +[gdrive] +type = drive +scope = drive +drive_id = 1234567... +root_folder_id = 0Abcd... +token = {"access_token":...} +``` -- Config: upload_wait_per_gb -- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB -- Type: Duration -- Default: 3m0s +Now create the file named `example.yml` with a swarm stack description +like this: +``` +version: '3' +services: + heimdall: + image: linuxserver/heimdall:latest + ports: [8080:80] + volumes: [configdata:/config] +volumes: + configdata: + driver: rclone + driver_opts: + remote: 'gdrive:heimdall' + allow_other: 'true' + vfs_cache_mode: full + poll_interval: 0 +``` -#### --acd-templink-threshold +and run the stack: +``` +docker stack deploy example -c ./example.yml +``` -Files >= this size will be downloaded via their tempLink. +After a few seconds docker will spread the parsed stack description +over cluster, create the `example_heimdall` service on port _8080_, +run service containers on one or more cluster nodes and request +the `example_configdata` volume from rclone plugins on the node hosts. +You can use the following commands to confirm results: +``` +docker service ls +docker service ps example_heimdall +docker volume ls +``` -Files this size or more will be downloaded via their "tempLink". This -is to work around a problem with Amazon Drive which blocks downloads -of files bigger than about 10 GiB. The default for this is 9 GiB which -shouldn't need to be changed. +Point your browser to `http://cluster.host.address:8080` and play with +the service. Stop it with `docker stack remove example` when you are done. +Note that the `example_configdata` volume(s) created on demand at the +cluster nodes will not be automatically removed together with the stack +but stay for future reuse. You can remove them manually by invoking +the `docker volume remove example_configdata` command on every node. -To download files above this threshold, rclone requests a "tempLink" -which downloads the file through a temporary URL directly from the -underlying S3 storage. +## Creating Volumes via CLI -Properties: +Volumes can be created with [docker volume create](https://docs.docker.com/engine/reference/commandline/volume_create/). +Here are a few examples: +``` +docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full +docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall +docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 +``` -- Config: templink_threshold -- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD -- Type: SizeSuffix -- Default: 9Gi +Note the `-d rclone` flag that tells docker to request volume from the +rclone driver. This works even if you installed managed driver by its full +name `rclone/docker-volume-rclone` because you provided the `--alias rclone` +option. -#### --acd-encoding +Volumes can be inspected as follows: +``` +docker volume list +docker volume inspect vol1 +``` -The encoding for the backend. +## Volume Configuration -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Rclone flags and volume options are set via the `-o` flag to the +`docker volume create` command. They include backend-specific parameters +as well as mount and _VFS_ options. Also there are a few +special `-o` options: +`remote`, `fs`, `type`, `path`, `mount-type` and `persist`. -Properties: +`remote` determines an existing remote name from the config file, with +trailing colon and optionally with a remote path. See the full syntax in +the [rclone documentation](https://rclone.org/docs/#syntax-of-remote-paths). +This option can be aliased as `fs` to prevent confusion with the +_remote_ parameter of such backends as _crypt_ or _alias_. -- Config: encoding -- Env Var: RCLONE_ACD_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot +The `remote=:backend:dir/subdir` syntax can be used to create +[on-the-fly (config-less) remotes](https://rclone.org/docs/#backend-path-to-dir), +while the `type` and `path` options provide a simpler alternative for this. +Using two split options +``` +-o type=backend -o path=dir/subdir +``` +is equivalent to the combined syntax +``` +-o remote=:backend:dir/subdir +``` +but is arguably easier to parameterize in scripts. +The `path` part is optional. +[Mount and VFS options](https://rclone.org/commands/rclone_serve_docker/#options) +as well as [backend parameters](https://rclone.org/flags/#backend-flags) are named +like their twin command-line flags without the `--` CLI prefix. +Optionally you can use underscores instead of dashes in option names. +For example, `--vfs-cache-mode full` becomes +`-o vfs-cache-mode=full` or `-o vfs_cache_mode=full`. +Boolean CLI flags without value will gain the `true` value, e.g. +`--allow-other` becomes `-o allow-other=true` or `-o allow_other=true`. +Please note that you can provide parameters only for the backend immediately +referenced by the backend type of mounted `remote`. +If this is a wrapping backend like _alias, chunker or crypt_, you cannot +provide options for the referred to remote or backend. This limitation is +imposed by the rclone connection string parser. The only workaround is to +feed plugin with `rclone.conf` or configure plugin arguments (see below). -## Limitations +## Special Volume Options -Note that Amazon Drive is case insensitive so you can't have a -file called "Hello.doc" and one called "hello.doc". +`mount-type` determines the mount method and in general can be one of: +`mount`, `cmount`, or `mount2`. This can be aliased as `mount_type`. +It should be noted that the managed rclone docker plugin currently does +not support the `cmount` method and `mount2` is rarely needed. +This option defaults to the first found method, which is usually `mount` +so you generally won't need it. -Amazon Drive has rate limiting so you may notice errors in the -sync (429 errors). rclone will automatically retry the sync up to 3 -times by default (see `--retries` flag) which should hopefully work -around this problem. +`persist` is a reserved boolean (true/false) option. +In future it will allow to persist on-the-fly remotes in the plugin +`rclone.conf` file. -Amazon Drive has an internal limit of file sizes that can be uploaded -to the service. This limit is not officially published, but all files -larger than this will fail. +## Connection Strings -At the time of writing (Jan 2016) is in the area of 50 GiB per file. -This means that larger files are likely to fail. +The `remote` value can be extended +with [connection strings](https://rclone.org/docs/#connection-strings) +as an alternative way to supply backend parameters. This is equivalent +to the `-o` backend options with one _syntactic difference_. +Inside connection string the backend prefix must be dropped from parameter +names but in the `-o param=value` array it must be present. +For instance, compare the following option array +``` +-o remote=:sftp:/home -o sftp-host=localhost +``` +with equivalent connection string: +``` +-o remote=:sftp,host=localhost:/home +``` +This difference exists because flag options `-o key=val` include not only +backend parameters but also mount/VFS flags and possibly other settings. +Also it allows to discriminate the `remote` option from the `crypt-remote` +(or similarly named backend parameters) and arguably simplifies scripting +due to clearer value substitution. -Unfortunately there is no way for rclone to see that this failure is -because of file size, so it will retry the operation, as any other -failure. To avoid this problem, use `--max-size 50000M` option to limit -the maximum size of uploaded files. Note that `--max-size` does not split -files into segments, it only ignores files over this size. +## Using with Swarm or Compose -`rclone about` is not supported by the Amazon Drive backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Both _Docker Swarm_ and _Docker Compose_ use +[YAML](http://yaml.org/spec/1.2/spec.html)-formatted text files to describe +groups (stacks) of containers, their properties, networks and volumes. +_Compose_ uses the [compose v2](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) format, +_Swarm_ uses the [compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) format. +They are mostly similar, differences are explained in the +[docker documentation](https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading). -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +Volumes are described by the children of the top-level `volumes:` node. +Each of them should be named after its volume and have at least two +elements, the self-explanatory `driver: rclone` value and the +`driver_opts:` structure playing the same role as `-o key=val` CLI flags: -# Amazon S3 Storage Providers +``` +volumes: + volume_name_1: + driver: rclone + driver_opts: + remote: 'gdrive:' + allow_other: 'true' + vfs_cache_mode: full + token: '{"type": "borrower", "expires": "2021-12-31"}' + poll_interval: 0 +``` -The S3 backend can be used with a number of different providers: +Notice a few important details: +- YAML prefers `_` in option names instead of `-`. +- YAML treats single and double quotes interchangeably. + Simple strings and integers can be left unquoted. +- Boolean values must be quoted like `'true'` or `"false"` because + these two words are reserved by YAML. +- The filesystem string is keyed with `remote` (or with `fs`). + Normally you can omit quotes here, but if the string ends with colon, + you **must** quote it like `remote: "storage_box:"`. +- YAML is picky about surrounding braces in values as this is in fact + another [syntax for key/value mappings](http://yaml.org/spec/1.2/spec.html#id2790832). + For example, JSON access tokens usually contain double quotes and + surrounding braces, so you must put them in single quotes. +## Installing as Managed Plugin -- AWS S3 -- Alibaba Cloud (Aliyun) Object Storage System (OSS) -- Ceph -- China Mobile Ecloud Elastic Object Storage (EOS) -- Cloudflare R2 -- Arvan Cloud Object Storage (AOS) -- DigitalOcean Spaces -- Dreamhost -- Huawei OBS -- IBM COS S3 -- IDrive e2 -- IONOS Cloud -- Liara Object Storage -- Minio -- Qiniu Cloud Object Storage (Kodo) -- RackCorp Object Storage -- Scaleway -- Seagate Lyve Cloud -- SeaweedFS -- StackPath -- Storj -- Tencent Cloud Object Storage (COS) -- Wasabi +Docker daemon can install plugins from an image registry and run them managed. +We maintain the +[docker-volume-rclone](https://hub.docker.com/p/rclone/docker-volume-rclone/) +plugin image on [Docker Hub](https://hub.docker.com). +Rclone volume plugin requires **Docker Engine >= 19.03.15** -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +The plugin requires presence of two directories on the host before it can +be installed. Note that plugin will **not** create them automatically. +By default they must exist on host at the following locations +(though you can tweak the paths): +- `/var/lib/docker-plugins/rclone/config` + is reserved for the `rclone.conf` config file and **must** exist + even if it's empty and the config file is not present. +- `/var/lib/docker-plugins/rclone/cache` + holds the plugin state file as well as optional VFS caches. -Once you have made a remote (see the provider specific section above) -you can use it like this: +You can [install managed plugin](https://docs.docker.com/engine/reference/commandline/plugin_install/) +with default settings as follows: +``` +docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone +``` -See all buckets +The `:amd64` part of the image specification after colon is called a _tag_. +Usually you will want to install the latest plugin for your architecture. In +this case the tag will just name it, like `amd64` above. The following plugin +architectures are currently available: +- `amd64` +- `arm64` +- `arm-v7` - rclone lsd remote: +Sometimes you might want a concrete plugin version, not the latest one. +Then you should use image tag in the form `:ARCHITECTURE-VERSION`. +For example, to install plugin version `v1.56.2` on architecture `arm64` +you will use tag `arm64-1.56.2` (note the removed `v`) so the full image +specification becomes `rclone/docker-volume-rclone:arm64-1.56.2`. -Make a new bucket +We also provide the `latest` plugin tag, but since docker does not support +multi-architecture plugins as of the time of this writing, this tag is +currently an **alias for `amd64`**. +By convention the `latest` tag is the default one and can be omitted, thus +both `rclone/docker-volume-rclone:latest` and just `rclone/docker-volume-rclone` +will refer to the latest plugin release for the `amd64` platform. - rclone mkdir remote:bucket +Also the `amd64` part can be omitted from the versioned rclone plugin tags. +For example, rclone image reference `rclone/docker-volume-rclone:amd64-1.56.2` +can be abbreviated as `rclone/docker-volume-rclone:1.56.2` for convenience. +However, for non-intel architectures you still have to use the full tag as +`amd64` or `latest` will fail to start. -List the contents of a bucket +Managed plugin is in fact a special container running in a namespace separate +from normal docker containers. Inside it runs the `rclone serve docker` +command. The config and cache directories are bind-mounted into the +container at start. The docker daemon connects to a unix socket created +by the command inside the container. The command creates on-demand remote +mounts right inside, then docker machinery propagates them through kernel +mount namespaces and bind-mounts into requesting user containers. - rclone ls remote:bucket +You can tweak a few plugin settings after installation when it's disabled +(not in use), for instance: +``` +docker plugin disable rclone +docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args="--vfs-cache-mode=writes --allow-other" +docker plugin enable rclone +docker plugin inspect rclone +``` -Sync `/home/local/directory` to the remote bucket, deleting any excess -files in the bucket. +Note that if docker refuses to disable the plugin, you should find and +remove all active volumes connected with it as well as containers and +swarm services that use them. This is rather tedious so please carefully +plan in advance. - rclone sync --interactive /home/local/directory remote:bucket +You can tweak the following settings: +`args`, `config`, `cache`, `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` +and `RCLONE_VERBOSE`. +It's _your_ task to keep plugin settings in sync across swarm cluster nodes. -## Configuration +`args` sets command-line arguments for the `rclone serve docker` command +(_none_ by default). Arguments should be separated by space so you will +normally want to put them in quotes on the +[docker plugin set](https://docs.docker.com/engine/reference/commandline/plugin_set/) +command line. Both [serve docker flags](https://rclone.org/commands/rclone_serve_docker/#options) +and [generic rclone flags](https://rclone.org/flags/) are supported, including backend +parameters that will be used as defaults for volume creation. +Note that plugin will fail (due to [this docker bug](https://github.com/moby/moby/blob/v20.10.7/plugin/v2/plugin.go#L195)) +if the `args` value is empty. Use e.g. `args="-v"` as a workaround. -Here is an example of making an s3 configuration for the AWS S3 provider. -Most applies to the other providers as well, any differences are described [below](#providers). +`config=/host/dir` sets alternative host location for the config directory. +Plugin will look for `rclone.conf` here. It's not an error if the config +file is not present but the directory must exist. Please note that plugin +can periodically rewrite the config file, for example when it renews +storage access tokens. Keep this in mind and try to avoid races between +the plugin and other instances of rclone on the host that might try to +change the config simultaneously resulting in corrupted `rclone.conf`. +You can also put stuff like private key files for SFTP remotes in this +directory. Just note that it's bind-mounted inside the plugin container +at the predefined path `/data/config`. For example, if your key file is +named `sftp-box1.key` on the host, the corresponding volume config option +should read `-o sftp-key-file=/data/config/sftp-box1.key`. -First run +`cache=/host/dir` sets alternative host location for the _cache_ directory. +The plugin will keep VFS caches here. Also it will create and maintain +the `docker-plugin.state` file in this directory. When the plugin is +restarted or reinstalled, it will look in this file to recreate any volumes +that existed previously. However, they will not be re-mounted into +consuming containers after restart. Usually this is not a problem as +the docker daemon normally will restart affected user containers after +failures, daemon restarts or host reboots. - rclone config +`RCLONE_VERBOSE` sets plugin verbosity from `0` (errors only, by default) +to `2` (debugging). Verbosity can be also tweaked via `args="-v [-v] ..."`. +Since arguments are more generic, you will rarely need this setting. +The plugin output by default feeds the docker daemon log on local host. +Log entries are reflected as _errors_ in the docker log but retain their +actual level assigned by rclone in the encapsulated message string. -This will guide you through an interactive setup process. +`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` customize the plugin proxy settings. +You can set custom plugin options right when you install it, _in one go_: ``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS - \ "s3" -[snip] -Storage> s3 -Choose your S3 provider. -Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - 2 / Ceph Object Storage - \ "Ceph" - 3 / DigitalOcean Spaces - \ "DigitalOcean" - 4 / Dreamhost DreamObjects - \ "Dreamhost" - 5 / IBM COS S3 - \ "IBMCOS" - 6 / Minio Object Storage - \ "Minio" - 7 / Wasabi Object Storage - \ "Wasabi" - 8 / Any other S3 compatible provider - \ "Other" -provider> 1 -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID - leave blank for anonymous access or runtime credentials. -access_key_id> XXX -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YYY -Region to connect to. -Choose a number from below, or type in your own value - / The default endpoint - a good choice if you are unsure. - 1 | US Region, Northern Virginia, or Pacific Northwest. - | Leave location constraint empty. - \ "us-east-1" - / US East (Ohio) Region - 2 | Needs location constraint us-east-2. - \ "us-east-2" - / US West (Oregon) Region - 3 | Needs location constraint us-west-2. - \ "us-west-2" - / US West (Northern California) Region - 4 | Needs location constraint us-west-1. - \ "us-west-1" - / Canada (Central) Region - 5 | Needs location constraint ca-central-1. - \ "ca-central-1" - / EU (Ireland) Region - 6 | Needs location constraint EU or eu-west-1. - \ "eu-west-1" - / EU (London) Region - 7 | Needs location constraint eu-west-2. - \ "eu-west-2" - / EU (Frankfurt) Region - 8 | Needs location constraint eu-central-1. - \ "eu-central-1" - / Asia Pacific (Singapore) Region - 9 | Needs location constraint ap-southeast-1. - \ "ap-southeast-1" - / Asia Pacific (Sydney) Region -10 | Needs location constraint ap-southeast-2. - \ "ap-southeast-2" - / Asia Pacific (Tokyo) Region -11 | Needs location constraint ap-northeast-1. - \ "ap-northeast-1" - / Asia Pacific (Seoul) -12 | Needs location constraint ap-northeast-2. - \ "ap-northeast-2" - / Asia Pacific (Mumbai) -13 | Needs location constraint ap-south-1. - \ "ap-south-1" - / Asia Pacific (Hong Kong) Region -14 | Needs location constraint ap-east-1. - \ "ap-east-1" - / South America (Sao Paulo) Region -15 | Needs location constraint sa-east-1. - \ "sa-east-1" -region> 1 -Endpoint for S3 API. -Leave blank if using AWS to use the default endpoint for the region. -endpoint> -Location constraint - must be set to match the Region. Used when creating buckets only. -Choose a number from below, or type in your own value - 1 / Empty for US Region, Northern Virginia, or Pacific Northwest. - \ "" - 2 / US East (Ohio) Region. - \ "us-east-2" - 3 / US West (Oregon) Region. - \ "us-west-2" - 4 / US West (Northern California) Region. - \ "us-west-1" - 5 / Canada (Central) Region. - \ "ca-central-1" - 6 / EU (Ireland) Region. - \ "eu-west-1" - 7 / EU (London) Region. - \ "eu-west-2" - 8 / EU Region. - \ "EU" - 9 / Asia Pacific (Singapore) Region. - \ "ap-southeast-1" -10 / Asia Pacific (Sydney) Region. - \ "ap-southeast-2" -11 / Asia Pacific (Tokyo) Region. - \ "ap-northeast-1" -12 / Asia Pacific (Seoul) - \ "ap-northeast-2" -13 / Asia Pacific (Mumbai) - \ "ap-south-1" -14 / Asia Pacific (Hong Kong) - \ "ap-east-1" -15 / South America (Sao Paulo) Region. - \ "sa-east-1" -location_constraint> 1 -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \ "public-read" - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. - 3 | Granting this on a bucket is generally not recommended. - \ "public-read-write" - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. - \ "authenticated-read" - / Object owner gets FULL_CONTROL. Bucket owner gets READ access. - 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ "bucket-owner-read" - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ "bucket-owner-full-control" -acl> 1 -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> 1 -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Reduced redundancy storage class - \ "REDUCED_REDUNDANCY" - 4 / Standard Infrequent Access storage class - \ "STANDARD_IA" - 5 / One Zone Infrequent Access storage class - \ "ONEZONE_IA" - 6 / Glacier storage class - \ "GLACIER" - 7 / Glacier Deep Archive storage class - \ "DEEP_ARCHIVE" - 8 / Intelligent-Tiering storage class - \ "INTELLIGENT_TIERING" - 9 / Glacier Instant Retrieval storage class - \ "GLACIER_IR" -storage_class> 1 -Remote config --------------------- -[remote] -type = s3 -provider = AWS -env_auth = false -access_key_id = XXX -secret_access_key = YYY -region = us-east-1 -endpoint = -location_constraint = -acl = private -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> +docker plugin remove rclone +docker plugin install rclone/docker-volume-rclone:amd64 \ + --alias rclone --grant-all-permissions \ + args="-v --allow-other" config=/etc/rclone +docker plugin inspect rclone ``` -### Modified time +## Healthchecks -The modified time is stored as metadata on the object as -`X-Amz-Meta-Mtime` as floating point since the epoch, accurate to 1 ns. +The docker plugin volume protocol doesn't provide a way for plugins +to inform the docker daemon that a volume is (un-)available. +As a workaround you can setup a healthcheck to verify that the mount +is responding, for example: +``` +services: + my_service: + image: my_image + healthcheck: + test: ls /path/to/rclone/mount || exit 1 + interval: 1m + timeout: 15s + retries: 3 + start_period: 15s +``` -If the modification time needs to be updated rclone will attempt to perform a server -side copy to update the modification if the object can be copied in a single part. -In the case the object is larger than 5Gb or is in Glacier or Glacier Deep Archive -storage the object will be uploaded rather than copied. +## Running Plugin under Systemd -Note that reading this from the object takes an additional `HEAD` -request as the metadata isn't returned in object listings. +In most cases you should prefer managed mode. Moreover, MacOS and Windows +do not support native Docker plugins. Please use managed mode on these +systems. Proceed further only if you are on Linux. -### Reducing costs +First, [install rclone](https://rclone.org/install/). +You can just run it (type `rclone serve docker` and hit enter) for the test. -#### Avoiding HEAD requests to read the modification time +Install _FUSE_: +``` +sudo apt-get -y install fuse +``` -By default, rclone will use the modification time of objects stored in -S3 for syncing. This is stored in object metadata which unfortunately -takes an extra HEAD request to read which can be expensive (in time -and money). +Download two systemd configuration files: +[docker-volume-rclone.service](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.service) +and [docker-volume-rclone.socket](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.socket). -The modification time is used by default for all operations that -require checking the time a file was last updated. It allows rclone to -treat the remote more like a true filesystem, but it is inefficient on -S3 because it requires an extra API call to retrieve the metadata. +Put them to the `/etc/systemd/system/` directory: +``` +cp docker-volume-plugin.service /etc/systemd/system/ +cp docker-volume-plugin.socket /etc/systemd/system/ +``` -The extra API calls can be avoided when syncing (using `rclone sync` -or `rclone copy`) in a few different ways, each with its own -tradeoffs. +Please note that all commands in this section must be run as _root_ but +we omit `sudo` prefix for brevity. +Now create directories required by the service: +``` +mkdir -p /var/lib/docker-volumes/rclone +mkdir -p /var/lib/docker-plugins/rclone/config +mkdir -p /var/lib/docker-plugins/rclone/cache +``` -- `--size-only` - - Only checks the size of files. - - Uses no extra transactions. - - If the file doesn't change size then rclone won't detect it has - changed. - - `rclone sync --size-only /path/to/source s3:bucket` -- `--checksum` - - Checks the size and MD5 checksum of files. - - Uses no extra transactions. - - The most accurate detection of changes possible. - - Will cause the source to read an MD5 checksum which, if it is a - local disk, will cause lots of disk activity. - - If the source and destination are both S3 this is the - **recommended** flag to use for maximum efficiency. - - `rclone sync --checksum /path/to/source s3:bucket` -- `--update --use-server-modtime` - - Uses no extra transactions. - - Modification time becomes the time the object was uploaded. - - For many operations this is sufficient to determine if it needs - uploading. - - Using `--update` along with `--use-server-modtime`, avoids the - extra API call and uploads files whose local modification time - is newer than the time it was last uploaded. - - Files created with timestamps in the past will be missed by the sync. - - `rclone sync --update --use-server-modtime /path/to/source s3:bucket` +Run the docker plugin service in the socket activated mode: +``` +systemctl daemon-reload +systemctl start docker-volume-rclone.service +systemctl enable docker-volume-rclone.socket +systemctl start docker-volume-rclone.socket +systemctl restart docker +``` -These flags can and should be used in combination with `--fast-list` - -see below. +Or run the service directly: +- run `systemctl daemon-reload` to let systemd pick up new config +- run `systemctl enable docker-volume-rclone.service` to make the new + service start automatically when you power on your machine. +- run `systemctl start docker-volume-rclone.service` + to start the service now. +- run `systemctl restart docker` to restart docker daemon and let it + detect the new plugin socket. Note that this step is not needed in + managed mode where docker knows about plugin state changes. -If using `rclone mount` or any command using the VFS (eg `rclone -serve`) commands then you might want to consider using the VFS flag -`--no-modtime` which will stop rclone reading the modification time -for every object. You could also use `--use-server-modtime` if you are -happy with the modification times of the objects being the time of -upload. +The two methods are equivalent from the user perspective, but I personally +prefer socket activation. -#### Avoiding GET requests to read directory listings +## Troubleshooting -Rclone's default directory traversal is to process each directory -individually. This takes one API call per directory. Using the -`--fast-list` flag will read all info about the objects into -memory first using a smaller number of API calls (one per 1000 -objects). See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. +You can [see managed plugin settings](https://docs.docker.com/engine/extend/#debugging-plugins) +with +``` +docker plugin list +docker plugin inspect rclone +``` +Note that docker (including latest 20.10.7) will not show actual values +of `args`, just the defaults. - rclone sync --fast-list --checksum /path/to/source s3:bucket +Use `journalctl --unit docker` to see managed plugin output as part of +the docker daemon log. Note that docker reflects plugin lines as _errors_ +but their actual level can be seen from encapsulated message string. -`--fast-list` trades off API transactions for memory use. As a rough -guide rclone uses 1k of memory per object stored, so using -`--fast-list` on a sync of a million objects will use roughly 1 GiB of -RAM. +You will usually install the latest version of managed plugin for your platform. +Use the following commands to print the actual installed version: +``` +PLUGID=$(docker plugin list --no-trunc | awk '/rclone/{print$1}') +sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version +``` -If you are only copying a small number of files into a big repository -then using `--no-traverse` is a good idea. This finds objects directly -instead of through directory listings. You can do a "top-up" sync very -cheaply by using `--max-age` and `--no-traverse` to copy only recent -files, eg +You can even use `runc` to run shell inside the plugin container: +``` +sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash +``` - rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket +Also you can use curl to check the plugin socket connectivity: +``` +docker plugin list --no-trunc +PLUGID=123abc... +sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate +``` +though this is rarely needed. -You'd then do a full `rclone sync` less often. +## Caveats -Note that `--fast-list` isn't required in the top-up sync. +Finally I'd like to mention a _caveat with updating volume settings_. +Docker CLI does not have a dedicated command like `docker volume update`. +It may be tempting to invoke `docker volume create` with updated options +on existing volume, but there is a gotcha. The command will do nothing, +it won't even return an error. I hope that docker maintainers will fix +this some day. In the meantime be aware that you must remove your volume +before recreating it with new settings: +``` +docker volume remove my_vol +docker volume create my_vol -d rclone -o opt1=new_val1 ... +``` -#### Avoiding HEAD requests after PUT +and verify that settings did update: +``` +docker volume list +docker volume inspect my_vol +``` -By default, rclone will HEAD every object it uploads. It does this to -check the object got uploaded correctly. +If docker refuses to remove the volume, you should find containers +or swarm services that use it and stop them first. -You can disable this with the [--s3-no-head](#s3-no-head) option - see -there for more details. +## Getting started {#getting-started} -Setting this flag increases the chance for undetected upload failures. +- [Install rclone](https://rclone.org/install/) and setup your remotes. +- Bisync will create its working directory + at `~/.cache/rclone/bisync` on Linux + or `C:\Users\MyLogin\AppData\Local\rclone\bisync` on Windows. + Make sure that this location is writable. +- Run bisync with the `--resync` flag, specifying the paths + to the local and remote sync directory roots. +- For successive sync runs, leave off the `--resync` flag. +- Consider using a [filters file](#filtering) for excluding + unnecessary files and directories from the sync. +- Consider setting up the [--check-access](#check-access) feature + for safety. +- On Linux, consider setting up a [crontab entry](#cron). bisync can + safely run in concurrent cron jobs thanks to lock files it maintains. -### Hashes +Here is a typical run log (with timestamps removed for clarity): -For small objects which weren't uploaded as multipart uploads (objects -sized below `--s3-upload-cutoff` if uploaded with rclone) rclone uses -the `ETag:` header as an MD5 checksum. +``` +rclone bisync /testdir/path1/ /testdir/path2/ --verbose +INFO : Synching Path1 "/testdir/path1/" with Path2 "/testdir/path2/" +INFO : Path1 checking for diffs +INFO : - Path1 File is new - file11.txt +INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File is newer - file7.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File was deleted - file8.txt +INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is new - file10.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File was deleted - file8.txt +INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt +INFO : - Path2 Queue delete - /testdir/path2/file4.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt +INFO : - Path1 Queue delete - /testdir/path1/file3.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : - Do queued deletes on - Path1 +INFO : - Do queued deletes on - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "/testdir/path1/" vs Path2 "/testdir/path2/" +INFO : Bisync successful +``` -However for objects which were uploaded as multipart uploads or with -server side encryption (SSE-AWS or SSE-C) the `ETag` header is no -longer the MD5 sum of the data, so rclone adds an additional piece of -metadata `X-Amz-Meta-Md5chksum` which is a base64 encoded MD5 hash (in -the same format as is required for `Content-MD5`). +## Command line syntax -For large objects, calculating this hash can take some time so the -addition of this hash can be disabled with `--s3-disable-checksum`. -This will mean that these objects do not have an MD5 checksum. +``` +$ rclone bisync --help +Usage: + rclone bisync remote1:path1 remote2:path2 [flags] -Note that reading this from the object takes an additional `HEAD` -request as the metadata isn't returned in object listings. +Positional arguments: + Path1, Path2 Local path, or remote storage with ':' plus optional path. + Type 'rclone listremotes' for list of configured remotes. -### Versions +Optional Flags: + --check-access Ensure expected `RCLONE_TEST` files are found on + both Path1 and Path2 filesystems, else abort. + --check-filename FILENAME Filename for `--check-access` (default: `RCLONE_TEST`) + --check-sync CHOICE Controls comparison of final listings: + `true | false | only` (default: true) + If set to `only`, bisync will only compare listings + from the last run but skip actual sync. + --filters-file PATH Read filtering patterns from a file + --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. + If exceeded, the bisync run will abort. (default: 50%) + --force Bypass `--max-delete` safety check and run the sync. + Consider using with `--verbose` + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) + --remove-empty-dirs Remove empty directories at the final cleanup step. + -1, --resync Performs the resync run. + Warning: Path1 files may overwrite Path2 versions. + Consider using `--verbose` or `--dry-run` first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --workdir PATH Use custom working directory (useful for testing). + (default: `~/.cache/rclone/bisync`) + -n, --dry-run Go through the motions - No files are copied/deleted. + -v, --verbose Increases logging verbosity. + May be specified more than once for more details. + -h, --help help for bisync +``` -When bucket versioning is enabled (this can be done with rclone with -the [`rclone backend versioning`](#versioning) command) when rclone -uploads a new version of a file it creates a -[new version of it](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) -Likewise when you delete a file, the old version will be marked hidden -and still be available. +Arbitrary rclone flags may be specified on the +[bisync command line](https://rclone.org/commands/rclone_bisync/), for example +`rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s` +Note that interactions of various rclone flags with bisync process flow +has not been fully tested yet. -Old versions of files, where available, are visible using the -[`--s3-versions`](#s3-versions) flag. +### Paths -It is also possible to view a bucket as it was at a certain point in -time, using the [`--s3-version-at`](#s3-version-at) flag. This will -show the file versions as they were at that time, showing files that -have been deleted afterwards, and hiding files that were created -since. +Path1 and Path2 arguments may be references to any mix of local directory +paths (absolute or relative), UNC paths (`//server/share/path`), +Windows drive paths (with a drive letter and `:`) or configured +[remotes](https://rclone.org/docs/#syntax-of-remote-paths) with optional subdirectory paths. +Cloud references are distinguished by having a `:` in the argument +(see [Windows support](#windows) below). -If you wish to remove all the old versions then you can use the -[`rclone backend cleanup-hidden remote:bucket`](#cleanup-hidden) -command which will delete all the old hidden versions of files, -leaving the current ones intact. You can also supply a path and only -old versions under that path will be deleted, e.g. -`rclone backend cleanup-hidden remote:bucket/path/to/stuff`. +Path1 and Path2 are treated equally, in that neither has priority for +file changes (except during [`--resync`](#resync)), and access efficiency does not change whether a remote +is on Path1 or Path2. -When you `purge` a bucket, the current and the old versions will be -deleted then the bucket will be deleted. +The listings in bisync working directory (default: `~/.cache/rclone/bisync`) +are named based on the Path1 and Path2 arguments so that separate syncs +to individual directories within the tree may be set up, e.g.: +`path_to_local_tree..dropbox_subdir.lst`. -However `delete` will cause the current versions of the files to -become hidden old versions. +Any empty directories after the sync on both the Path1 and Path2 +filesystems are not deleted by default, unless `--create-empty-src-dirs` is specified. +If the `--remove-empty-dirs` flag is specified, then both paths will have ALL empty directories purged +as the last step in the process. -Here is a session showing the listing and retrieval of an old -version followed by a `cleanup` of the old versions. +## Command-line flags -Show current version and all the versions with `--s3-versions` flag. +#### --resync -``` -$ rclone -q ls s3:cleanup-test - 9 one.txt +This will effectively make both Path1 and Path2 filesystems contain a +matching superset of all files. Path2 files that do not exist in Path1 will +be copied to Path1, and the process will then copy the Path1 tree to Path2. -$ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt +The `--resync` sequence is roughly equivalent to: ``` - -Retrieve an old version - +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 ``` -$ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp - -$ ls -l /tmp/one-v2016-07-04-141003-000.txt --rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +Or, if using `--create-empty-src-dirs`: ``` - -Clean up all the old versions and show that they've gone. - +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 --create-empty-src-dirs +rclone copy Path2 Path1 --create-empty-src-dirs ``` -$ rclone -q backend cleanup-hidden s3:cleanup-test -$ rclone -q ls s3:cleanup-test - 9 one.txt +The base directories on both Path1 and Path2 filesystems must exist +or bisync will fail. This is required for safety - that bisync can verify +that both paths are valid. -$ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt -``` +When using `--resync`, a newer version of a file on the Path2 filesystem +will be overwritten by the Path1 filesystem version. +(Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) +Carefully evaluate deltas using [--dry-run](https://rclone.org/flags/#non-backend-flags). -### Cleanup +[//]: # (I reverted a recent change in the above paragraph, as it was incorrect. +https://github.com/rclone/rclone/commit/dd72aff98a46c6e20848ac7ae5f7b19d45802493 ) -If you run `rclone cleanup s3:bucket` then it will remove all pending -multipart uploads older than 24 hours. You can use the `--interactive`/`i` -or `--dry-run` flag to see exactly what it will do. If you want more control over the -expiry date then run `rclone backend cleanup s3:bucket -o max-age=1h` -to expire all uploads older than one hour. You can use `rclone backend -list-multipart-uploads s3:bucket` to see the pending multipart -uploads. +For a resync run, one of the paths may be empty (no files in the path tree). +The resync run should result in files on both paths, else a normal non-resync +run will fail. -### Restricted filename characters +For a non-resync run, either path being empty (no files in the tree) fails with +`Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst` +This is a safety check that an unexpected empty path does not result in +deleting **everything** in the other path. -S3 allows any valid UTF-8 string as a key. +#### --check-access -Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), as -they can't be used in XML. +Access check files are an additional safety measure against data loss. +bisync will ensure it can find matching `RCLONE_TEST` files in the same places +in the Path1 and Path2 filesystems. +`RCLONE_TEST` files are not generated automatically. +For `--check-access` to succeed, you must first either: +**A)** Place one or more `RCLONE_TEST` files in both systems, or +**B)** Set `--check-filename` to a filename already in use in various locations +throughout your sync'd fileset. Recommended methods for **A)** include: +* `rclone touch Path1/RCLONE_TEST` (create a new file) +* `rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST` (copy an existing file) +* `rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST"` (copy multiple files at once, recursively) +* create the files manually (outside of rclone) +* run `bisync` once *without* `--check-access` to set matching files on both filesystems +will also work, but is not preferred, due to potential for user error +(you are temporarily disabling the safety feature). + +Note that `--check-access` is still enforced on `--resync`, so `bisync --resync --check-access` +will not work as a method of initially setting the files (this is to ensure that bisync can't +[inadvertently circumvent its own safety switch](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should).) + +Time stamps and file contents for `RCLONE_TEST` files are not important, just the names and locations. +If you have symbolic links in your sync tree it is recommended to place +`RCLONE_TEST` files in the linked-to directory tree to protect against +bisync assuming a bunch of deleted files if the linked-to tree should not be +accessible. +See also the [--check-filename](--check-filename) flag. -The following characters are replaced since these are problematic when -dealing with the REST API: +#### --check-filename -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | +Name of the file(s) used in access health validation. +The default `--check-filename` is `RCLONE_TEST`. +One or more files having this filename must exist, synchronized between your +source and destination filesets, in order for `--check-access` to succeed. +See [--check-access](#check-access) for additional details. -The encoding will also encode these file names as they don't seem to -work with the SDK properly: +#### --max-delete -| File name | Replacement | -| --------- |:-----------:| -| . | . | -| .. | .. | +As a safety check, if greater than the `--max-delete` percent of files were +deleted on either the Path1 or Path2 filesystem, then bisync will abort with +a warning message, without making any changes. +The default `--max-delete` is `50%`. +One way to trigger this limit is to rename a directory that contains more +than half of your files. This will appear to bisync as a bunch of deleted +files and a bunch of new files. +This safety check is intended to block bisync from deleting all of the +files on both filesystems due to a temporary network access issue, or if +the user had inadvertently deleted the files on one side or the other. +To force the sync, either set a different delete percentage limit, +e.g. `--max-delete 75` (allows up to 75% deletion), or use `--force` +to bypass the check. -### Multipart uploads +Also see the [all files changed](#all-files-changed) check. -rclone supports multipart uploads with S3 which means that it can -upload files bigger than 5 GiB. +#### --filters-file {#filters-file} -Note that files uploaded *both* with multipart upload *and* through -crypt remotes do not have MD5 sums. +By using rclone filter features you can exclude file types or directory +sub-trees from the sync. +See the [bisync filters](#filtering) section and generic +[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) +documentation. +An [example filters file](#example-filters-file) contains filters for +non-allowed files for synching with Dropbox. -rclone switches from single part uploads to multipart uploads at the -point specified by `--s3-upload-cutoff`. This can be a maximum of 5 GiB -and a minimum of 0 (ie always upload multipart files). +If you make changes to your filters file then bisync requires a run +with `--resync`. This is a safety feature, which prevents existing files +on the Path1 and/or Path2 side from seeming to disappear from view +(since they are excluded in the new listings), which would fool bisync +into seeing them as deleted (as compared to the prior run listings), +and then bisync would proceed to delete them for real. -The chunk sizes used in the multipart upload are specified by -`--s3-chunk-size` and the number of chunks uploaded concurrently is -specified by `--s3-upload-concurrency`. +To block this from happening, bisync calculates an MD5 hash of the filters file +and stores the hash in a `.md5` file in the same place as your filters file. +On the next run with `--filters-file` set, bisync re-calculates the MD5 hash +of the current filters file and compares it to the hash stored in the `.md5` file. +If they don't match, the run aborts with a critical error and thus forces you +to do a `--resync`, likely avoiding a disaster. -Multipart uploads will use `--transfers` * `--s3-upload-concurrency` * -`--s3-chunk-size` extra memory. Single part uploads to not use extra -memory. +#### --check-sync -Single part transfers can be faster than multipart transfers or slower -depending on your latency from S3 - the more latency, the more likely -single part transfers will be faster. - -Increasing `--s3-upload-concurrency` will increase throughput (8 would -be a sensible value) and increasing `--s3-chunk-size` also increases -throughput (16M would be sensible). Increasing either of these will -use more memory. The default values are high enough to gain most of -the possible performance without using too much memory. +Enabled by default, the check-sync function checks that all of the same +files exist in both the Path1 and Path2 history listings. This _check-sync_ +integrity check is performed at the end of the sync run by default. +Any untrapped failing copy/deletes between the two paths might result +in differences between the two listings and in the untracked file content +differences between the two paths. A resync run would correct the error. +Note that the default-enabled integrity check locally executes a load of both +the final Path1 and Path2 listings, and thus adds to the run time of a sync. +Using `--check-sync=false` will disable it and may significantly reduce the +sync run times for very large numbers of files. -### Buckets and Regions +The check may be run manually with `--check-sync=only`. It runs only the +integrity check and terminates without actually synching. -With Amazon S3 you can list buckets (`rclone lsd`) using any region, -but you can only access the content of a bucket from the region it was -created in. If you attempt to access a bucket from the wrong region, -you will get an error, `incorrect region, the bucket is not in 'XXX' -region`. +See also: [Concurrent modifications](#concurrent-modifications) + + +#### --ignore-listing-checksum + +By default, bisync will retrieve (or generate) checksums (for backends that support them) +when creating the listings for both paths, and store the checksums in the listing files. +`--ignore-listing-checksum` will disable this behavior, which may speed things up considerably, +especially on backends (such as [local](https://rclone.org/local/)) where hashes must be computed on the fly instead of retrieved. +Please note the following: + +* While checksums are (by default) generated and stored in the listing files, +they are NOT currently used for determining diffs (deltas). +It is anticipated that full checksum support will be added in a future version. +* `--ignore-listing-checksum` is NOT the same as [`--ignore-checksum`](https://rclone.org/docs/#ignore-checksum), +and you may wish to use one or the other, or both. In a nutshell: +`--ignore-listing-checksum` controls whether checksums are considered when scanning for diffs, +while `--ignore-checksum` controls whether checksums are considered during the copy/sync operations that follow, +if there ARE diffs. +* Unless `--ignore-listing-checksum` is passed, bisync currently computes hashes for one path +*even when there's no common hash with the other path* +(for example, a [crypt](https://rclone.org/crypt/#modification-times-and-hashes) remote.) +* If both paths support checksums and have a common hash, +AND `--ignore-listing-checksum` was not specified when creating the listings, +`--check-sync=only` can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) +However, `--check-sync=only` will NOT include checksums if the previous listings +were generated on a run using `--ignore-listing-checksum`. For a more robust integrity check of the current state, +consider using [`check`](commands/rclone_check/) +(or [`cryptcheck`](https://rclone.org/commands/rclone_cryptcheck/), if at least one path is a `crypt` remote.) + +#### --resilient + +***Caution: this is an experimental feature. Use at your own risk!*** + +By default, most errors or interruptions will cause bisync to abort and +require [`--resync`](#resync) to recover. This is a safety feature, +to prevent bisync from running again until a user checks things out. +However, in some cases, bisync can go too far and enforce a lockout when one isn't actually necessary, +like for certain less-serious errors that might resolve themselves on the next run. +When `--resilient` is specified, bisync tries its best to recover and self-correct, +and only requires `--resync` as a last resort when a human's involvement is absolutely necessary. +The intended use case is for running bisync as a background process (such as via scheduled [cron](#cron)). + +When using `--resilient` mode, bisync will still report the error and abort, +however it will not lock out future runs -- allowing the possibility of retrying at the next normally scheduled time, +without requiring a `--resync` first. Examples of such retryable errors include +access test failures, missing listing files, and filter change detections. +These safety features will still prevent the *current* run from proceeding -- +the difference is that if conditions have improved by the time of the *next* run, +that next run will be allowed to proceed. +Certain more serious errors will still enforce a `--resync` lockout, even in `--resilient` mode, to prevent data loss. + +Behavior of `--resilient` may change in a future version. -### Authentication +## Operation -There are a number of ways to supply `rclone` with a set of AWS -credentials, with and without using the environment. +### Runtime flow details -The different authentication methods are tried in this order: +bisync retains the listings of the `Path1` and `Path2` filesystems +from the prior run. +On each successive run it will: - - Directly in the rclone configuration file (`env_auth = false` in the config file): - - `access_key_id` and `secret_access_key` are required. - - `session_token` can be optionally set when using AWS STS. - - Runtime configuration (`env_auth = true` in the config file): - - Export the following environment variables before running `rclone`: - - Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` - - Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` - - Session Token: `AWS_SESSION_TOKEN` (optional) - - Or, use a [named profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html): - - Profile files are standard files used by AWS CLI tools - - By default it will use the profile in your home directory (e.g. `~/.aws/credentials` on unix based systems) file and the "default" profile, to change set these environment variables: - - `AWS_SHARED_CREDENTIALS_FILE` to control which file. - - `AWS_PROFILE` to control which profile to use. - - Or, run `rclone` in an ECS task with an IAM role (AWS only). - - Or, run `rclone` on an EC2 instance with an IAM role (AWS only). - - Or, run `rclone` in an EKS pod with an IAM role that is associated with a service account (AWS only). +- list files on `path1` and `path2`, and check for changes on each side. + Changes include `New`, `Newer`, `Older`, and `Deleted` files. +- Propagate changes on `path1` to `path2`, and vice-versa. -If none of these option actually end up providing `rclone` with AWS -credentials then S3 interaction will be non-authenticated (see below). +### Safety measures -### S3 Permissions +- Lock file prevents multiple simultaneous runs when taking a while. + This can be particularly useful if bisync is run by cron scheduler. +- Handle change conflicts non-destructively by creating + `..path1` and `..path2` file versions. +- File system access health check using `RCLONE_TEST` files + (see the `--check-access` flag). +- Abort on excessive deletes - protects against a failed listing + being interpreted as all the files were deleted. + See the `--max-delete` and `--force` flags. +- If something evil happens, bisync goes into a safe state to block + damage by later runs. (See [Error Handling](#error-handling)) -When using the `sync` subcommand of `rclone` the following minimum -permissions are required to be available on the bucket being written to: +### Normal sync checks -* `ListBucket` -* `DeleteObject` -* `GetObject` -* `PutObject` -* `PutObjectACL` + Type | Description | Result | Implementation +--------------|-----------------------------------------------|--------------------------|----------------------------- +Path2 new | File is new on Path2, does not exist on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 +Path2 newer | File is newer on Path2, unchanged on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 +Path2 deleted | File is deleted on Path2, unchanged on Path1 | File is deleted | `rclone delete` Path1 +Path1 new | File is new on Path1, does not exist on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 +Path1 newer | File is newer on Path1, unchanged on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 +Path1 older | File is older on Path1, unchanged on Path2 | _Path1 version survives_ | `rclone copy` Path1 to Path2 +Path2 older | File is older on Path2, unchanged on Path1 | _Path2 version survives_ | `rclone copy` Path2 to Path1 +Path1 deleted | File no longer exists on Path1 | File is deleted | `rclone delete` Path2 -When using the `lsd` subcommand, the `ListAllMyBuckets` permission is required. +### Unusual sync checks -Example policy: + Type | Description | Result | Implementation +--------------------------------|---------------------------------------|------------------------------------|----------------------- +Path1 new/changed AND Path2 new/changed AND Path1 == Path2 | File is new/changed on Path1 AND new/changed on Path2 AND Path1 version is currently identical to Path2 | No change | None +Path1 new AND Path2 new | File is new on Path1 AND new on Path2 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 +Path2 newer AND Path1 changed | File is newer on Path2 AND also changed (newer/older/size) on Path1 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 +Path2 newer AND Path1 deleted | File is newer on Path2 AND also deleted on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 +Path2 deleted AND Path1 changed | File is deleted on Path2 AND changed (newer/older/size) on Path1 | Path1 version survives |`rclone copy` Path1 to Path2 +Path1 deleted AND Path2 changed | File is deleted on Path1 AND changed (newer/older/size) on Path2 | Path2 version survives | `rclone copy` Path2 to Path1 -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::USER_SID:user/USER_NAME" - }, - "Action": [ - "s3:ListBucket", - "s3:DeleteObject", - "s3:GetObject", - "s3:PutObject", - "s3:PutObjectAcl" - ], - "Resource": [ - "arn:aws:s3:::BUCKET_NAME/*", - "arn:aws:s3:::BUCKET_NAME" - ] - }, - { - "Effect": "Allow", - "Action": "s3:ListAllMyBuckets", - "Resource": "arn:aws:s3:::*" - } - ] -} -``` +As of `rclone v1.64`, bisync is now better at detecting *false positive* sync conflicts, +which would previously have resulted in unnecessary renames and duplicates. +Now, when bisync comes to a file that it wants to rename (because it is new/changed on both sides), +it first checks whether the Path1 and Path2 versions are currently *identical* +(using the same underlying function as [`check`](commands/rclone_check/).) +If bisync concludes that the files are identical, it will skip them and move on. +Otherwise, it will create renamed `..Path1` and `..Path2` duplicates, as before. +This behavior also [improves the experience of renaming directories](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=Renamed%20directories), +as a `--resync` is no longer required, so long as the same change has been made on both sides. -Notes on above: +### All files changed check {#all-files-changed} -1. This is a policy that can be used when creating bucket. It assumes - that `USER_NAME` has been created. -2. The Resource entry must include both resource ARNs, as one implies - the bucket and the other implies the bucket's objects. +If _all_ prior existing files on either of the filesystems have changed +(e.g. timestamps have changed due to changing the system's timezone) +then bisync will abort without making any changes. +Any new files are not considered for this check. You could use `--force` +to force the sync (whichever side has the changed timestamp files wins). +Alternately, a `--resync` may be used (Path1 versions will be pushed +to Path2). Consider the situation carefully and perhaps use `--dry-run` +before you commit to the changes. -For reference, [here's an Ansible script](https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) -that will generate one or more buckets that will work with `rclone sync`. +### Modification times -### Key Management System (KMS) +Bisync relies on file timestamps to identify changed files and will +_refuse_ to operate if backend lacks the modification time support. -If you are using server-side encryption with KMS then you must make -sure rclone is configured with `server_side_encryption = aws:kms` -otherwise you will find you can't transfer small objects - these will -create checksum errors. +If you or your application should change the content of a file +without changing the modification time then bisync will _not_ +notice the change, and thus will not copy it to the other side. -### Glacier and Glacier Deep Archive +Note that on some cloud storage systems it is not possible to have file +timestamps that match _precisely_ between the local and other filesystems. -You can upload objects using the glacier storage class or transition them to glacier using a [lifecycle policy](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html). -The bucket can still be synced or copied into normally, but if rclone -tries to access data from the glacier storage class you will see an error like below. +Bisync's approach to this problem is by tracking the changes on each side +_separately_ over time with a local database of files in that side then +applying the resulting changes on the other side. - 2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file +### Error handling {#error-handling} -In this case you need to [restore](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/restore-archived-objects.html) -the object(s) in question before using rclone. +Certain bisync critical errors, such as file copy/move failing, will result in +a bisync lockout of following runs. The lockout is asserted because the sync +status and history of the Path1 and Path2 filesystems cannot be trusted, +so it is safer to block any further changes until someone checks things out. +The recovery is to do a `--resync` again. -Note that rclone only speaks the S3 API it does not speak the Glacier -Vault API, so rclone cannot directly access Glacier Vaults. +It is recommended to use `--resync --dry-run --verbose` initially and +_carefully_ review what changes will be made before running the `--resync` +without `--dry-run`. -### Object-lock enabled S3 bucket +Most of these events come up due to an error status from an internal call. +On such a critical error the `{...}.path1.lst` and `{...}.path2.lst` +listing files are renamed to extension `.lst-err`, which blocks any future +bisync runs (since the normal `.lst` files are not found). +Bisync keeps them under `bisync` subdirectory of the rclone cache directory, +typically at `${HOME}/.cache/rclone/bisync/` on Linux. -According to AWS's [documentation on S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-permission): +Some errors are considered temporary and re-running the bisync is not blocked. +The _critical return_ blocks further bisync runs. -> If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header. +See also: [`--resilient`](#resilient) -As mentioned in the [Hashes](#hashes) section, small files that are not uploaded as multipart, use a different tag, causing the upload to fail. -A simple solution is to set the `--s3-upload-cutoff 0` and force all the files to be uploaded as multipart. +### Lock file +When bisync is running, a lock file is created in the bisync working directory, +typically at `~/.cache/rclone/bisync/PATH1..PATH2.lck` on Linux. +If bisync should crash or hang, the lock file will remain in place and block +any further runs of bisync _for the same paths_. +Delete the lock file as part of debugging the situation. +The lock file effectively blocks follow-on (e.g., scheduled by _cron_) runs +when the prior invocation is taking a long time. +The lock file contains _PID_ of the blocking process, which may help in debug. -### Standard options +**Note** +that while concurrent bisync runs are allowed, _be very cautious_ +that there is no overlap in the trees being synched between concurrent runs, +lest there be replicated files, deleted files and general mayhem. -Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi). +### Return codes -#### --s3-provider +`rclone bisync` returns the following codes to calling program: +- `0` on a successful run, +- `1` for a non-critical failing run (a rerun may be successful), +- `2` for a critically aborted run (requires a `--resync` to recover). -Choose your S3 provider. +## Limitations -Properties: +### Supported backends -- Config: provider -- Env Var: RCLONE_S3_PROVIDER -- Type: string -- Required: false -- Examples: - - "AWS" - - Amazon Web Services (AWS) S3 - - "Alibaba" - - Alibaba Cloud Object Storage System (OSS) formerly Aliyun - - "Ceph" - - Ceph Object Storage - - "ChinaMobile" - - China Mobile Ecloud Elastic Object Storage (EOS) - - "Cloudflare" - - Cloudflare R2 Storage - - "ArvanCloud" - - Arvan Cloud Object Storage (AOS) - - "DigitalOcean" - - DigitalOcean Spaces - - "Dreamhost" - - Dreamhost DreamObjects - - "HuaweiOBS" - - Huawei Object Storage Service - - "IBMCOS" - - IBM COS S3 - - "IDrive" - - IDrive e2 - - "IONOS" - - IONOS Cloud - - "LyveCloud" - - Seagate Lyve Cloud - - "Liara" - - Liara Object Storage - - "Minio" - - Minio Object Storage - - "Netease" - - Netease Object Storage (NOS) - - "RackCorp" - - RackCorp Object Storage - - "Scaleway" - - Scaleway Object Storage - - "SeaweedFS" - - SeaweedFS S3 - - "StackPath" - - StackPath Object Storage - - "Storj" - - Storj (S3 Compatible Gateway) - - "TencentCOS" - - Tencent Cloud Object Storage (COS) - - "Wasabi" - - Wasabi Object Storage - - "Qiniu" - - Qiniu Object Storage (Kodo) - - "Other" - - Any other S3 compatible provider +Bisync is considered _BETA_ and has been tested with the following backends: +- Local filesystem +- Google Drive +- Dropbox +- OneDrive +- S3 +- SFTP +- Yandex Disk -#### --s3-env-auth +It has not been fully tested with other services yet. +If it works, or sorta works, please let us know and we'll update the list. +Run the test suite to check for proper operation as described below. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +First release of `rclone bisync` requires that underlying backend supports +the modification time feature and will refuse to run otherwise. +This limitation will be lifted in a future `rclone bisync` release. -Only applies if access_key_id and secret_access_key is blank. +### Concurrent modifications -Properties: +When using **Local, FTP or SFTP** remotes rclone does not create _temporary_ +files at the destination when copying, and thus if the connection is lost +the created file may be corrupt, which will likely propagate back to the +original path on the next sync, resulting in data loss. +This will be solved in a future release, there is no workaround at the moment. -- Config: env_auth -- Env Var: RCLONE_S3_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter AWS credentials in the next step. - - "true" - - Get AWS credentials from the environment (env vars or IAM). +Files that **change during** a bisync run may result in data loss. +This has been seen in a highly dynamic environment, where the filesystem +is getting hammered by running processes during the sync. +The currently recommended solution is to sync at quiet times or [filter out](#filtering) +unnecessary directories and files. -#### --s3-access-key-id +As an [alternative approach](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), +consider using `--check-sync=false` (and possibly `--resilient`) to make bisync more forgiving +of filesystems that change during the sync. +Be advised that this may cause bisync to miss events that occur during a bisync run, +so it is a good idea to supplement this with a periodic independent integrity check, +and corrective sync if diffs are found. For example, a possible sequence could look like this: -AWS Access Key ID. +1. Normally scheduled bisync run: -Leave blank for anonymous access or runtime credentials. +``` +rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient +``` -Properties: +2. Periodic independent integrity check (perhaps scheduled nightly or weekly): -- Config: access_key_id -- Env Var: RCLONE_S3_ACCESS_KEY_ID -- Type: string -- Required: false +``` +rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt +``` -#### --s3-secret-access-key +3. If diffs are found, you have some choices to correct them. +If one side is more up-to-date and you want to make the other side match it, you could run: -AWS Secret Access Key (password). +``` +rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v +``` +(or switch Path1 and Path2 to make Path2 the source-of-truth) -Leave blank for anonymous access or runtime credentials. +Or, if neither side is totally up-to-date, you could run a `--resync` to bring them back into agreement +(but remember that this could cause deleted files to re-appear.) -Properties: +*Note also that `rclone check` does not currently include empty directories, +so if you want to know if any empty directories are out of sync, +consider alternatively running the above `rclone sync` command with `--dry-run` added. -- Config: secret_access_key -- Env Var: RCLONE_S3_SECRET_ACCESS_KEY -- Type: string -- Required: false +### Empty directories -#### --s3-region +By default, new/deleted empty directories on one path are _not_ propagated to the other side. +This is because bisync (and rclone) natively works on files, not directories. +However, this can be changed with the `--create-empty-src-dirs` flag, which works in +much the same way as in [`sync`](https://rclone.org/commands/rclone_sync/) and [`copy`](https://rclone.org/commands/rclone_copy/). +When used, empty directories created or deleted on one side will also be created or deleted on the other side. +The following should be noted: +* `--create-empty-src-dirs` is not compatible with `--remove-empty-dirs`. Use only one or the other (or neither). +* It is not recommended to switch back and forth between `--create-empty-src-dirs` +and the default (no `--create-empty-src-dirs`) without running `--resync`. +This is because it may appear as though all directories (not just the empty ones) were created/deleted, +when actually you've just toggled between making them visible/invisible to bisync. +It looks scarier than it is, but it's still probably best to stick to one or the other, +and use `--resync` when you need to switch. -Region to connect to. +### Renamed directories -Properties: +Renaming a folder on the Path1 side results in deleting all files on +the Path2 side and then copying all files again from Path1 to Path2. +Bisync sees this as all files in the old directory name as deleted and all +files in the new directory name as new. +Currently, the most effective and efficient method of renaming a directory +is to rename it to the same name on both sides. (As of `rclone v1.64`, +a `--resync` is no longer required after doing so, as bisync will automatically +detect that Path1 and Path2 are in agreement.) + +### `--fast-list` used by default + +Unlike most other rclone commands, bisync uses [`--fast-list`](https://rclone.org/docs/#fast-list) by default, +for backends that support it. In many cases this is desirable, however, +there are some scenarios in which bisync could be faster *without* `--fast-list`, +and there is also a [known issue concerning Google Drive users with many empty directories](https://github.com/rclone/rclone/commit/cbf3d4356135814921382dd3285d859d15d0aa77). +For now, the recommended way to avoid using `--fast-list` is to add `--disable ListR` +to all bisync commands. The default behavior may change in a future version. + +### Overridden Configs + +When rclone detects an overridden config, it adds a suffix like `{ABCDE}` on the fly +to the internal name of the remote. Bisync follows suit by including this suffix in its listing filenames. +However, this suffix does not necessarily persist from run to run, especially if different flags are provided. +So if next time the suffix assigned is `{FGHIJ}`, bisync will get confused, +because it's looking for a listing file with `{FGHIJ}`, when the file it wants has `{ABCDE}`. +As a result, it throws +`Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run` +and refuses to run again until the user runs a `--resync` (unless using `--resilient`). +The best workaround at the moment is to set any backend-specific flags in the [config file](https://rclone.org/commands/rclone_config/) +instead of specifying them with command flags. (You can still override them as needed for other rclone commands.) -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "us-east-1" - - The default endpoint - a good choice if you are unsure. - - US Region, Northern Virginia, or Pacific Northwest. - - Leave location constraint empty. - - "us-east-2" - - US East (Ohio) Region. - - Needs location constraint us-east-2. - - "us-west-1" - - US West (Northern California) Region. - - Needs location constraint us-west-1. - - "us-west-2" - - US West (Oregon) Region. - - Needs location constraint us-west-2. - - "ca-central-1" - - Canada (Central) Region. - - Needs location constraint ca-central-1. - - "eu-west-1" - - EU (Ireland) Region. - - Needs location constraint EU or eu-west-1. - - "eu-west-2" - - EU (London) Region. - - Needs location constraint eu-west-2. - - "eu-west-3" - - EU (Paris) Region. - - Needs location constraint eu-west-3. - - "eu-north-1" - - EU (Stockholm) Region. - - Needs location constraint eu-north-1. - - "eu-south-1" - - EU (Milan) Region. - - Needs location constraint eu-south-1. - - "eu-central-1" - - EU (Frankfurt) Region. - - Needs location constraint eu-central-1. - - "ap-southeast-1" - - Asia Pacific (Singapore) Region. - - Needs location constraint ap-southeast-1. - - "ap-southeast-2" - - Asia Pacific (Sydney) Region. - - Needs location constraint ap-southeast-2. - - "ap-northeast-1" - - Asia Pacific (Tokyo) Region. - - Needs location constraint ap-northeast-1. - - "ap-northeast-2" - - Asia Pacific (Seoul). - - Needs location constraint ap-northeast-2. - - "ap-northeast-3" - - Asia Pacific (Osaka-Local). - - Needs location constraint ap-northeast-3. - - "ap-south-1" - - Asia Pacific (Mumbai). - - Needs location constraint ap-south-1. - - "ap-east-1" - - Asia Pacific (Hong Kong) Region. - - Needs location constraint ap-east-1. - - "sa-east-1" - - South America (Sao Paulo) Region. - - Needs location constraint sa-east-1. - - "me-south-1" - - Middle East (Bahrain) Region. - - Needs location constraint me-south-1. - - "af-south-1" - - Africa (Cape Town) Region. - - Needs location constraint af-south-1. - - "cn-north-1" - - China (Beijing) Region. - - Needs location constraint cn-north-1. - - "cn-northwest-1" - - China (Ningxia) Region. - - Needs location constraint cn-northwest-1. - - "us-gov-east-1" - - AWS GovCloud (US-East) Region. - - Needs location constraint us-gov-east-1. - - "us-gov-west-1" - - AWS GovCloud (US) Region. - - Needs location constraint us-gov-west-1. +### Case sensitivity -#### --s3-region +Synching with **case-insensitive** filesystems, such as Windows or `Box`, +can result in file name conflicts. This will be fixed in a future release. +The near-term workaround is to make sure that files on both sides +don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). -region - the location where your bucket will be created and your data stored. +## Windows support {#windows} +Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows +GitHub runners. -Properties: +Drive letters are allowed, including drive letters mapped to network drives +(`rclone bisync J:\localsync GDrive:`). +If a drive letter is omitted, the shell current drive is the default. +Drive letters are a single character follows by `:`, so cloud names +must be more than one character long. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN (All locations) Region - - "au" - - Australia (All states) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region +Absolute paths (with or without a drive letter), and relative paths +(with or without a drive letter) are supported. -#### --s3-region +Working directory is created at `C:\Users\MyLogin\AppData\Local\rclone\bisync`. -Region to connect to. +Note that bisync output may show a mix of forward `/` and back `\` slashes. -Properties: +Be careful of case independent directory and file naming on Windows +vs. case dependent Linux -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "nl-ams" - - Amsterdam, The Netherlands - - "fr-par" - - Paris, France - - "pl-waw" - - Warsaw, Poland +## Filtering {#filtering} -#### --s3-region +See [filtering documentation](https://rclone.org/filtering/) +for how filter rules are written and interpreted. -Region to connect to. - the location where your bucket will be created and your data stored. Need bo be same with your endpoint. +Bisync's [`--filters-file`](#filters-file) flag slightly extends the rclone's +[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) +filtering mechanism. +For a given bisync run you may provide _only one_ `--filters-file`. +The `--include*`, `--exclude*`, and `--filter` flags are also supported. +### How to filter directories -Properties: +Filtering portions of the directory tree is a critical feature for synching. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "af-south-1" - - AF-Johannesburg - - "ap-southeast-2" - - AP-Bangkok - - "ap-southeast-3" - - AP-Singapore - - "cn-east-3" - - CN East-Shanghai1 - - "cn-east-2" - - CN East-Shanghai2 - - "cn-north-1" - - CN North-Beijing1 - - "cn-north-4" - - CN North-Beijing4 - - "cn-south-1" - - CN South-Guangzhou - - "ap-southeast-1" - - CN-Hong Kong - - "sa-argentina-1" - - LA-Buenos Aires1 - - "sa-peru-1" - - LA-Lima1 - - "na-mexico-1" - - LA-Mexico City1 - - "sa-chile-1" - - LA-Santiago2 - - "sa-brazil-1" - - LA-Sao Paulo1 - - "ru-northwest-2" - - RU-Moscow2 +Examples of directory trees (always beneath the Path1/Path2 root level) +you may want to exclude from your sync: +- Directory trees containing only software build intermediate files. +- Directory trees containing application temporary files and data + such as the Windows `C:\Users\MyLogin\AppData\` tree. +- Directory trees containing files that are large, less important, + or are getting thrashed continuously by ongoing processes. -#### --s3-region +On the other hand, there may be only select directories that you +actually want to sync, and exclude all others. See the +[Example include-style filters for Windows user directories](#include-filters) +below. -Region to connect to. +### Filters file writing guidelines -Properties: +1. Begin with excluding directory trees: + - e.g. `- /AppData/` + - `**` on the end is not necessary. Once a given directory level + is excluded then everything beneath it won't be looked at by rclone. + - Exclude such directories that are unneeded, are big, dynamically thrashed, + or where there may be access permission issues. + - Excluding such dirs first will make rclone operations (much) faster. + - Specific files may also be excluded, as with the Dropbox exclusions + example below. +2. Decide if it's easier (or cleaner) to: + - Include select directories and therefore _exclude everything else_ -- or -- + - Exclude select directories and therefore _include everything else_ +3. Include select directories: + - Add lines like: `+ /Documents/PersonalFiles/**` to select which + directories to include in the sync. + - `**` on the end specifies to include the full depth of the specified tree. + - With Include-style filters, files at the Path1/Path2 root are not included. + They may be included with `+ /*`. + - Place RCLONE_TEST files within these included directory trees. + They will only be looked for in these directory trees. + - Finish by excluding everything else by adding `- **` at the end + of the filters file. + - Disregard step 4. +4. Exclude select directories: + - Add more lines like in step 1. + For example: `-/Desktop/tempfiles/`, or `- /testdir/`. + Again, a `**` on the end is not necessary. + - Do _not_ add a `- **` in the file. Without this line, everything + will be included that has not been explicitly excluded. + - Disregard step 3. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Cloudflare -- Type: string -- Required: false -- Examples: - - "auto" - - R2 buckets are automatically distributed across Cloudflare's data centers for low latency. +A few rules for the syntax of a filter file expanding on +[filtering documentation](https://rclone.org/filtering/): -#### --s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - The default endpoint - a good choice if you are unsure. - - East China Region 1. - - Needs location constraint cn-east-1. - - "cn-east-2" - - East China Region 2. - - Needs location constraint cn-east-2. - - "cn-north-1" - - North China Region 1. - - Needs location constraint cn-north-1. - - "cn-south-1" - - South China Region 1. - - Needs location constraint cn-south-1. - - "us-north-1" - - North America Region. - - Needs location constraint us-north-1. - - "ap-southeast-1" - - Southeast Asia Region 1. - - Needs location constraint ap-southeast-1. - - "ap-northeast-1" - - Northeast Asia Region 1. - - Needs location constraint ap-northeast-1. - -#### --s3-region +- Lines may start with spaces and tabs - rclone strips leading whitespace. +- If the first non-whitespace character is a `#` then the line is a comment + and will be ignored. +- Blank lines are ignored. +- The first non-whitespace character on a filter line must be a `+` or `-`. +- Exactly 1 space is allowed between the `+/-` and the path term. +- Only forward slashes (`/`) are used in path terms, even on Windows. +- The rest of the line is taken as the path term. + Trailing whitespace is taken literally, and probably is an error. -Region where your bucket will be created and your data stored. +### Example include-style filters for Windows user directories {#include-filters} +This Windows _include-style_ example is based on the sync root (Path1) +set to `C:\Users\MyLogin`. The strategy is to select specific directories +to be synched with a network drive (Path2). -Properties: +- `- /AppData/` excludes an entire tree of Windows stored stuff + that need not be synched. + In my case, AppData has >11 GB of stuff I don't care about, and there are + some subdirectories beneath AppData that are not accessible to my + user login, resulting in bisync critical aborts. +- Windows creates cache files starting with both upper and + lowercase `NTUSER` at `C:\Users\MyLogin`. These files may be dynamic, + locked, and are generally _don't care_. +- There are just a few directories with _my_ data that I do want synched, + in the form of `+ /`. By selecting only the directory trees I + want to avoid the dozen plus directories that various apps make + at `C:\Users\MyLogin\Documents`. +- Include files in the root of the sync point, `C:\Users\MyLogin`, + by adding the `+ /*` line. +- This is an Include-style filters file, therefore it ends with `- **` + which excludes everything not explicitly included. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "de" - - Frankfurt, Germany - - "eu-central-2" - - Berlin, Germany - - "eu-south-2" - - Logrono, Spain +``` +- /AppData/ +- NTUSER* +- ntuser* ++ /Documents/Family/** ++ /Documents/Sketchup/** ++ /Documents/Microcapture_Photo/** ++ /Documents/Microcapture_Video/** ++ /Desktop/** ++ /Pictures/** ++ /* +- ** +``` -#### --s3-region +Note also that Windows implements several "library" links such as +`C:\Users\MyLogin\My Documents\My Music` pointing to `C:\Users\MyLogin\Music`. +rclone sees these as links, so you must add `--links` to the +bisync command line if you which to follow these links. I find that I get +permission errors in trying to follow the links, so I don't include the +rclone `--links` flag, but then you get lots of `Can't follow symlink…` +noise from rclone about not following the links. This noise can be +quashed by adding `--quiet` to the bisync command line. -Region to connect to. +## Example exclude-style filters files for use with Dropbox {#exclude-filters} -Leave blank if you are using an S3 clone and you don't have a region. +- Dropbox disallows synching the listed temporary and configuration/data files. + The `- ` filters exclude these files where ever they may occur + in the sync tree. Consider adding similar exclusions for file types + you don't need to sync, such as core dump and software build files. +- bisync testing creates `/testdir/` at the top level of the sync tree, + and usually deletes the tree after the test. If a normal sync should run + while the `/testdir/` tree exists the `--check-access` phase may fail + due to unbalanced RCLONE_TEST files. + The `- /testdir/` filter blocks this tree from being synched. + You don't need this exclusion if you are not doing bisync development testing. +- Everything else beneath the Path1/Path2 root will be synched. +- RCLONE_TEST files may be placed anywhere within the tree, including the root. -Properties: +### Example filters file for Dropbox {#example-filters-file} -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: !AWS,Alibaba,ChinaMobile,Cloudflare,IONOS,ArvanCloud,Liara,Qiniu,RackCorp,Scaleway,Storj,TencentCOS,HuaweiOBS,IDrive -- Type: string -- Required: false -- Examples: - - "" - - Use this if unsure. - - Will use v4 signatures and an empty region. - - "other-v2-signature" - - Use this only if v4 signatures don't work. - - E.g. pre Jewel/v10 CEPH. +``` +# Filter file for use with bisync +# See https://rclone.org/filtering/ for filtering rules +# NOTICE: If you make changes to this file you MUST do a --resync run. +# Run with --dry-run to see what changes will be made. -#### --s3-endpoint +# Dropbox won't sync some files so filter them away here. +# See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing +- .dropbox.attr +- ~*.tmp +- ~$* +- .~* +- desktop.ini +- .dropbox -Endpoint for S3 API. +# Used for bisync testing, so excluded from normal runs +- /testdir/ -Leave blank if using AWS to use the default endpoint for the region. +# Other example filters +#- /TiBU/ +#- /Photos/ +``` -Properties: +### How --check-access handles filters -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: AWS -- Type: string -- Required: false +At the start of a bisync run, listings are gathered for Path1 and Path2 +while using the user's `--filters-file`. During the check access phase, +bisync scans these listings for `RCLONE_TEST` files. +Any `RCLONE_TEST` files hidden by the `--filters-file` are _not_ in the +listings and thus not checked during the check access phase. -#### --s3-endpoint +## Troubleshooting {#troubleshooting} -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. +### Reading bisync logs -Properties: +Here are two normal runs. The first one has a newer file on the remote. +The second has no deltas between local and remote. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "eos-wuxi-1.cmecloud.cn" - - The default endpoint - a good choice if you are unsure. - - East China (Suzhou) - - "eos-jinan-1.cmecloud.cn" - - East China (Jinan) - - "eos-ningbo-1.cmecloud.cn" - - East China (Hangzhou) - - "eos-shanghai-1.cmecloud.cn" - - East China (Shanghai-1) - - "eos-zhengzhou-1.cmecloud.cn" - - Central China (Zhengzhou) - - "eos-hunan-1.cmecloud.cn" - - Central China (Changsha-1) - - "eos-zhuzhou-1.cmecloud.cn" - - Central China (Changsha-2) - - "eos-guangzhou-1.cmecloud.cn" - - South China (Guangzhou-2) - - "eos-dongguan-1.cmecloud.cn" - - South China (Guangzhou-3) - - "eos-beijing-1.cmecloud.cn" - - North China (Beijing-1) - - "eos-beijing-2.cmecloud.cn" - - North China (Beijing-2) - - "eos-beijing-4.cmecloud.cn" - - North China (Beijing-3) - - "eos-huhehaote-1.cmecloud.cn" - - North China (Huhehaote) - - "eos-chengdu-1.cmecloud.cn" - - Southwest China (Chengdu) - - "eos-chongqing-1.cmecloud.cn" - - Southwest China (Chongqing) - - "eos-guiyang-1.cmecloud.cn" - - Southwest China (Guiyang) - - "eos-xian-1.cmecloud.cn" - - Nouthwest China (Xian) - - "eos-yunnan.cmecloud.cn" - - Yunnan China (Kunming) - - "eos-yunnan-2.cmecloud.cn" - - Yunnan China (Kunming-2) - - "eos-tianjin-1.cmecloud.cn" - - Tianjin China (Tianjin) - - "eos-jilin-1.cmecloud.cn" - - Jilin China (Changchun) - - "eos-hubei-1.cmecloud.cn" - - Hubei China (Xiangyan) - - "eos-jiangxi-1.cmecloud.cn" - - Jiangxi China (Nanchang) - - "eos-gansu-1.cmecloud.cn" - - Gansu China (Lanzhou) - - "eos-shanxi-1.cmecloud.cn" - - Shanxi China (Taiyuan) - - "eos-liaoning-1.cmecloud.cn" - - Liaoning China (Shenyang) - - "eos-hebei-1.cmecloud.cn" - - Hebei China (Shijiazhuang) - - "eos-fujian-1.cmecloud.cn" - - Fujian China (Xiamen) - - "eos-guangxi-1.cmecloud.cn" - - Guangxi China (Nanning) - - "eos-anhui-1.cmecloud.cn" - - Anhui China (Huainan) +``` +2021/05/16 00:24:38 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" +2021/05/16 00:24:38 INFO : Path1 checking for diffs +2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt +2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted +2021/05/16 00:24:38 INFO : Path2 checking for diffs +2021/05/16 00:24:38 INFO : Applying changes +2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt +2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 +2021/05/16 00:24:38 INFO : Updating listings +2021/05/16 00:24:38 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" +2021/05/16 00:24:38 INFO : Bisync successful -#### --s3-endpoint +2021/05/16 00:36:52 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" +2021/05/16 00:36:52 INFO : Path1 checking for diffs +2021/05/16 00:36:52 INFO : Path2 checking for diffs +2021/05/16 00:36:52 INFO : No changes found +2021/05/16 00:36:52 INFO : Updating listings +2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" +2021/05/16 00:36:52 INFO : Bisync successful +``` -Endpoint for Arvan Cloud Object Storage (AOS) API. +### Dry run oddity -Properties: +The `--dry-run` messages may indicate that it would try to delete some files. +For example, if a file is new on Path2 and does not exist on Path1 then +it would normally be copied to Path1, but with `--dry-run` enabled those +copies don't happen, which leads to the attempted delete on Path2, +blocked again by --dry-run: `... Not deleting as --dry-run`. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "s3.ir-thr-at1.arvanstorage.com" - - The default endpoint - a good choice if you are unsure. - - Tehran Iran (Asiatech) - - "s3.ir-tbz-sh1.arvanstorage.com" - - Tabriz Iran (Shahriar) +This whole confusing situation is an artifact of the `--dry-run` flag. +Scrutinize the proposed deletes carefully, and if the files would have been +copied to Path1 then the threatened deletes on Path2 may be disregarded. -#### --s3-endpoint +### Retries -Endpoint for IBM COS S3 API. +Rclone has built-in retries. If you run with `--verbose` you'll see +error and retry messages such as shown below. This is usually not a bug. +If at the end of the run, you see `Bisync successful` and not +`Bisync critical error` or `Bisync aborted` then the run was successful, +and you can ignore the error messages. -Specify if using an IBM COS On Premise. +The following run shows an intermittent fail. Lines _5_ and _6- are +low-level messages. Line _6_ is a bubbled-up _warning_ message, conveying +the error. Rclone normally retries failing commands, so there may be +numerous such messages in the log. -Properties: +Since there are no final error/warning messages on line _7_, rclone has +recovered from failure after a retry, and the overall sync was successful. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "s3.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Endpoint - - "s3.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Endpoint - - "s3.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Endpoint - - "s3.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Endpoint - - "s3.private.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Private Endpoint - - "s3.private.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Private Endpoint - - "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Private Endpoint - - "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Private Endpoint - - "s3.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Endpoint - - "s3.private.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Private Endpoint - - "s3.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Endpoint - - "s3.private.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Private Endpoint - - "s3.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Endpoint - - "s3.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Endpoint - - "s3.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Endpoint - - "s3.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Endpoint - - "s3.private.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Private Endpoint - - "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Private Endpoint - - "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Private Endpoint - - "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Private Endpoint - - "s3.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Endpoint - - "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Private Endpoint - - "s3.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Endpoint - - "s3.private.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Private Endpoint - - "s3.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Endpoint - - "s3.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Endpoint - - "s3.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Endpoint - - "s3.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Endpoint - - "s3.private.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Private Endpoint - - "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Private Endpoint - - "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Private Endpoint - - "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Private Endpoint - - "s3.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Endpoint - - "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Private Endpoint - - "s3.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Endpoint - - "s3.private.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Private Endpoint - - "s3.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Endpoint - - "s3.private.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Private Endpoint - - "s3.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Endpoint - - "s3.private.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Private Endpoint - - "s3.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Endpoint - - "s3.private.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Private Endpoint - - "s3.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Endpoint - - "s3.private.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Private Endpoint - - "s3.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Endpoint - - "s3.private.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Private Endpoint - - "s3.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Endpoint - - "s3.private.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Private Endpoint - - "s3.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Endpoint - - "s3.private.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Private Endpoint - - "s3.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Endpoint - - "s3.private.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Private Endpoint - - "s3.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Endpoint - - "s3.private.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Private Endpoint - - "s3.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Endpoint - - "s3.private.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Private Endpoint - - "s3.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Endpoint - - "s3.private.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Private Endpoint - - "s3.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Endpoint - - "s3.private.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Private Endpoint - - "s3.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Endpoint - - "s3.private.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Private Endpoint +``` +1: 2021/05/14 00:44:12 INFO : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:" +2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs +3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs +4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted +5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input +6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: +7: 2021/05/14 00:44:12 INFO : Bisync successful +``` -#### --s3-endpoint +This log shows a _Critical failure_ which requires a `--resync` to recover from. +See the [Runtime Error Handling](#error-handling) section. -Endpoint for IONOS S3 Object Storage. +``` +2021/05/12 00:49:40 INFO : Google drive root '': Waiting for checks to finish +2021/05/12 00:49:40 INFO : Google drive root '': Waiting for transfers to finish +2021/05/12 00:49:40 INFO : Google drive root '': not deleting files as there were IO errors +2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors +2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors +2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ +2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. +``` -Specify the endpoint from the same region. +### Denied downloads of "infected" or "abusive" files -Properties: +Google Drive has a filter for certain file types (`.exe`, `.apk`, et cetera) +that by default cannot be copied from Google Drive to the local filesystem. +If you are having problems, run with `--verbose` to see specifically which +files are generating complaints. If the error is +`This file has been identified as malware or spam and cannot be downloaded`, +consider using the flag +[--drive-acknowledge-abuse](https://rclone.org/drive/#drive-acknowledge-abuse). -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "s3-eu-central-1.ionoscloud.com" - - Frankfurt, Germany - - "s3-eu-central-2.ionoscloud.com" - - Berlin, Germany - - "s3-eu-south-2.ionoscloud.com" - - Logrono, Spain +### Google Doc files -#### --s3-endpoint +Google docs exist as virtual files on Google Drive and cannot be transferred +to other filesystems natively. While it is possible to export a Google doc to +a normal file (with `.xlsx` extension, for example), it is not possible +to import a normal file back into a Google document. -Endpoint for Liara Object Storage API. +Bisync's handling of Google Doc files is to flag them in the run log output +for user's attention and ignore them for any file transfers, deletes, or syncs. +They will show up with a length of `-1` in the listings. +This bisync run is otherwise successful: -Properties: +``` +2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" +2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" +2021/05/11 08:23:15 INFO : Bisync successful +``` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "storage.iran.liara.space" - - The default endpoint - - Iran +## Usage examples -#### --s3-endpoint +### Cron {#cron} -Endpoint for OSS API. +Rclone does not yet have a built-in capability to monitor the local file +system for changes and must be blindly run periodically. +On Windows this can be done using a _Task Scheduler_, +on Linux you can use _Cron_ which is described below. -Properties: +The 1st example runs a sync every 5 minutes between a local directory +and an OwnCloud server, with output logged to a runlog file: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "oss-accelerate.aliyuncs.com" - - Global Accelerate - - "oss-accelerate-overseas.aliyuncs.com" - - Global Accelerate (outside mainland China) - - "oss-cn-hangzhou.aliyuncs.com" - - East China 1 (Hangzhou) - - "oss-cn-shanghai.aliyuncs.com" - - East China 2 (Shanghai) - - "oss-cn-qingdao.aliyuncs.com" - - North China 1 (Qingdao) - - "oss-cn-beijing.aliyuncs.com" - - North China 2 (Beijing) - - "oss-cn-zhangjiakou.aliyuncs.com" - - North China 3 (Zhangjiakou) - - "oss-cn-huhehaote.aliyuncs.com" - - North China 5 (Hohhot) - - "oss-cn-wulanchabu.aliyuncs.com" - - North China 6 (Ulanqab) - - "oss-cn-shenzhen.aliyuncs.com" - - South China 1 (Shenzhen) - - "oss-cn-heyuan.aliyuncs.com" - - South China 2 (Heyuan) - - "oss-cn-guangzhou.aliyuncs.com" - - South China 3 (Guangzhou) - - "oss-cn-chengdu.aliyuncs.com" - - West China 1 (Chengdu) - - "oss-cn-hongkong.aliyuncs.com" - - Hong Kong (Hong Kong) - - "oss-us-west-1.aliyuncs.com" - - US West 1 (Silicon Valley) - - "oss-us-east-1.aliyuncs.com" - - US East 1 (Virginia) - - "oss-ap-southeast-1.aliyuncs.com" - - Southeast Asia Southeast 1 (Singapore) - - "oss-ap-southeast-2.aliyuncs.com" - - Asia Pacific Southeast 2 (Sydney) - - "oss-ap-southeast-3.aliyuncs.com" - - Southeast Asia Southeast 3 (Kuala Lumpur) - - "oss-ap-southeast-5.aliyuncs.com" - - Asia Pacific Southeast 5 (Jakarta) - - "oss-ap-northeast-1.aliyuncs.com" - - Asia Pacific Northeast 1 (Japan) - - "oss-ap-south-1.aliyuncs.com" - - Asia Pacific South 1 (Mumbai) - - "oss-eu-central-1.aliyuncs.com" - - Central Europe 1 (Frankfurt) - - "oss-eu-west-1.aliyuncs.com" - - West Europe (London) - - "oss-me-east-1.aliyuncs.com" - - Middle East 1 (Dubai) +``` +# Minute (0-59) +# Hour (0-23) +# Day of Month (1-31) +# Month (1-12 or Jan-Dec) +# Day of Week (0-6 or Sun-Sat) +# Command + */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log +``` -#### --s3-endpoint +See [crontab syntax](https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES) +for the details of crontab time interval expressions. -Endpoint for OBS API. +If you run `rclone bisync` as a cron job, redirect stdout/stderr to a file. +The 2nd example runs a sync to Dropbox every hour and logs all stdout (via the `>>`) +and stderr (via `2>&1`) to a log file. -Properties: +``` +0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 +``` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "obs.af-south-1.myhuaweicloud.com" - - AF-Johannesburg - - "obs.ap-southeast-2.myhuaweicloud.com" - - AP-Bangkok - - "obs.ap-southeast-3.myhuaweicloud.com" - - AP-Singapore - - "obs.cn-east-3.myhuaweicloud.com" - - CN East-Shanghai1 - - "obs.cn-east-2.myhuaweicloud.com" - - CN East-Shanghai2 - - "obs.cn-north-1.myhuaweicloud.com" - - CN North-Beijing1 - - "obs.cn-north-4.myhuaweicloud.com" - - CN North-Beijing4 - - "obs.cn-south-1.myhuaweicloud.com" - - CN South-Guangzhou - - "obs.ap-southeast-1.myhuaweicloud.com" - - CN-Hong Kong - - "obs.sa-argentina-1.myhuaweicloud.com" - - LA-Buenos Aires1 - - "obs.sa-peru-1.myhuaweicloud.com" - - LA-Lima1 - - "obs.na-mexico-1.myhuaweicloud.com" - - LA-Mexico City1 - - "obs.sa-chile-1.myhuaweicloud.com" - - LA-Santiago2 - - "obs.sa-brazil-1.myhuaweicloud.com" - - LA-Sao Paulo1 - - "obs.ru-northwest-2.myhuaweicloud.com" - - RU-Moscow2 +### Sharing an encrypted folder tree between hosts -#### --s3-endpoint +bisync can keep a local folder in sync with a cloud service, +but what if you have some highly sensitive files to be synched? -Endpoint for Scaleway Object Storage. +Usage of a cloud service is for exchanging both routine and sensitive +personal files between one's home network, one's personal notebook when on the +road, and with one's work computer. The routine data is not sensitive. +For the sensitive data, configure an rclone [crypt remote](https://rclone.org/crypt/) to point to +a subdirectory within the local disk tree that is bisync'd to Dropbox, +and then set up an bisync for this local crypt directory to a directory +outside of the main sync tree. -Properties: +### Linux server setup -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "s3.nl-ams.scw.cloud" - - Amsterdam Endpoint - - "s3.fr-par.scw.cloud" - - Paris Endpoint - - "s3.pl-waw.scw.cloud" - - Warsaw Endpoint +- `/path/to/DBoxroot` is the root of my local sync tree. + There are numerous subdirectories. +- `/path/to/DBoxroot/crypt` is the root subdirectory for files + that are encrypted. This local directory target is setup as an + rclone crypt remote named `Dropcrypt:`. + See [rclone.conf](#rclone-conf-snippet) snippet below. +- `/path/to/my/unencrypted/files` is the root of my sensitive + files - not encrypted, not within the tree synched to Dropbox. +- To sync my local unencrypted files with the encrypted Dropbox versions + I manually run `bisync /path/to/my/unencrypted/files DropCrypt:`. + This step could be bundled into a script to run before and after + the full Dropbox tree sync in the last step, + thus actively keeping the sensitive files in sync. +- `bisync /path/to/DBoxroot Dropbox:` runs periodically via cron, + keeping my full local sync tree in sync with Dropbox. -#### --s3-endpoint +### Windows notebook setup -Endpoint for StackPath Object Storage. +- The Dropbox client runs keeping the local tree `C:\Users\MyLogin\Dropbox` + always in sync with Dropbox. I could have used `rclone bisync` instead. +- A separate directory tree at `C:\Users\MyLogin\Documents\DropLocal` + hosts the tree of unencrypted files/folders. +- To sync my local unencrypted files with the encrypted + Dropbox versions I manually run the following command: + `rclone bisync C:\Users\MyLogin\Documents\DropLocal Dropcrypt:`. +- The Dropbox client then syncs the changes with Dropbox. -Properties: +### rclone.conf snippet {#rclone-conf-snippet} -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: StackPath -- Type: string -- Required: false -- Examples: - - "s3.us-east-2.stackpathstorage.com" - - US East Endpoint - - "s3.us-west-1.stackpathstorage.com" - - US West Endpoint - - "s3.eu-central-1.stackpathstorage.com" - - EU Endpoint +``` +[Dropbox] +type = dropbox +... -#### --s3-endpoint +[Dropcrypt] +type = crypt +remote = /path/to/DBoxroot/crypt # on the Linux server +remote = C:\Users\MyLogin\Dropbox\crypt # on the Windows notebook +filename_encryption = standard +directory_name_encryption = true +password = ... +... +``` -Endpoint for Storj Gateway. +## Testing {#testing} -Properties: +You should read this section only if you are developing for rclone. +You need to have rclone source code locally to work with bisync tests. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Storj -- Type: string -- Required: false -- Examples: - - "gateway.storjshare.io" - - Global Hosted Gateway +Bisync has a dedicated test framework implemented in the `bisync_test.go` +file located in the rclone source tree. The test suite is based on the +`go test` command. Series of tests are stored in subdirectories below the +`cmd/bisync/testdata` directory. Individual tests can be invoked by their +directory name, e.g. +`go test . -case basic -remote local -remote2 gdrive: -v` -#### --s3-endpoint +Tests will make a temporary folder on remote and purge it afterwards. +If during test run there are intermittent errors and rclone retries, +these errors will be captured and flagged as invalid MISCOMPAREs. +Rerunning the test will let it pass. Consider such failures as noise. -Endpoint for Tencent COS API. +### Test command syntax -Properties: +``` +usage: go test ./cmd/bisync [options...] -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "cos.ap-beijing.myqcloud.com" - - Beijing Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-shanghai.myqcloud.com" - - Shanghai Region - - "cos.ap-guangzhou.myqcloud.com" - - Guangzhou Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-chengdu.myqcloud.com" - - Chengdu Region - - "cos.ap-chongqing.myqcloud.com" - - Chongqing Region - - "cos.ap-hongkong.myqcloud.com" - - Hong Kong (China) Region - - "cos.ap-singapore.myqcloud.com" - - Singapore Region - - "cos.ap-mumbai.myqcloud.com" - - Mumbai Region - - "cos.ap-seoul.myqcloud.com" - - Seoul Region - - "cos.ap-bangkok.myqcloud.com" - - Bangkok Region - - "cos.ap-tokyo.myqcloud.com" - - Tokyo Region - - "cos.na-siliconvalley.myqcloud.com" - - Silicon Valley Region - - "cos.na-ashburn.myqcloud.com" - - Virginia Region - - "cos.na-toronto.myqcloud.com" - - Toronto Region - - "cos.eu-frankfurt.myqcloud.com" - - Frankfurt Region - - "cos.eu-moscow.myqcloud.com" - - Moscow Region - - "cos.accelerate.myqcloud.com" - - Use Tencent COS Accelerate Endpoint +Options: + -case NAME Name(s) of the test case(s) to run. Multiple names should + be separated by commas. You can remove the `test_` prefix + and replace `_` by `-` in test name for convenience. + If not `all`, the name(s) should map to a directory under + `./cmd/bisync/testdata`. + Use `all` to run all tests (default: all) + -remote PATH1 `local` or name of cloud service with `:` (default: local) + -remote2 PATH2 `local` or name of cloud service with `:` (default: local) + -no-compare Disable comparing test results with the golden directory + (default: compare) + -no-cleanup Disable cleanup of Path1 and Path2 testdirs. + Useful for troubleshooting. (default: cleanup) + -golden Store results in the golden directory (default: false) + This flag can be used with multiple tests. + -debug Print debug messages + -stop-at NUM Stop test after given step number. (default: run to the end) + Implies `-no-compare` and `-no-cleanup`, if the test really + ends prematurely. Only meaningful for a single test case. + -refresh-times Force refreshing the target modtime, useful for Dropbox + (default: false) + -verbose Run tests verbosely +``` -#### --s3-endpoint +Note: unlike rclone flags which must be prefixed by double dash (`--`), the +test command flags can be equally prefixed by a single `-` or double dash. -Endpoint for RackCorp Object Storage. +### Running tests -Properties: +- `go test . -case basic -remote local -remote2 local` + runs the `test_basic` test case using only the local filesystem, + synching one local directory with another local directory. + Test script output is to the console, while commands within scenario.txt + have their output sent to the `.../workdir/test.log` file, + which is finally compared to the golden copy. +- The first argument after `go test` should be a relative name of the + directory containing bisync source code. If you run tests right from there, + the argument will be `.` (current directory) as in most examples below. + If you run bisync tests from the rclone source directory, the command + should be `go test ./cmd/bisync ...`. +- The test engine will mangle rclone output to ensure comparability + with golden listings and logs. +- Test scenarios are located in `./cmd/bisync/testdata`. The test `-case` + argument should match the full name of a subdirectory under that + directory. Every test subdirectory name on disk must start with `test_`, + this prefix can be omitted on command line for brevity. Also, underscores + in the name can be replaced by dashes for convenience. +- `go test . -remote local -remote2 local -case all` runs all tests. +- Path1 and Path2 may either be the keyword `local` + or may be names of configured cloud services. + `go test . -remote gdrive: -remote2 dropbox: -case basic` + will run the test between these two services, without transferring + any files to the local filesystem. +- Test run stdout and stderr console output may be directed to a file, e.g. + `go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "s3.rackcorp.com" - - Global (AnyCast) Endpoint - - "au.s3.rackcorp.com" - - Australia (Anycast) Endpoint - - "au-nsw.s3.rackcorp.com" - - Sydney (Australia) Endpoint - - "au-qld.s3.rackcorp.com" - - Brisbane (Australia) Endpoint - - "au-vic.s3.rackcorp.com" - - Melbourne (Australia) Endpoint - - "au-wa.s3.rackcorp.com" - - Perth (Australia) Endpoint - - "ph.s3.rackcorp.com" - - Manila (Philippines) Endpoint - - "th.s3.rackcorp.com" - - Bangkok (Thailand) Endpoint - - "hk.s3.rackcorp.com" - - HK (Hong Kong) Endpoint - - "mn.s3.rackcorp.com" - - Ulaanbaatar (Mongolia) Endpoint - - "kg.s3.rackcorp.com" - - Bishkek (Kyrgyzstan) Endpoint - - "id.s3.rackcorp.com" - - Jakarta (Indonesia) Endpoint - - "jp.s3.rackcorp.com" - - Tokyo (Japan) Endpoint - - "sg.s3.rackcorp.com" - - SG (Singapore) Endpoint - - "de.s3.rackcorp.com" - - Frankfurt (Germany) Endpoint - - "us.s3.rackcorp.com" - - USA (AnyCast) Endpoint - - "us-east-1.s3.rackcorp.com" - - New York (USA) Endpoint - - "us-west-1.s3.rackcorp.com" - - Freemont (USA) Endpoint - - "nz.s3.rackcorp.com" - - Auckland (New Zealand) Endpoint +### Test execution flow -#### --s3-endpoint +1. The base setup in the `initial` directory of the testcase is applied + on the Path1 and Path2 filesystems (via rclone copy the initial directory + to Path1, then rclone sync Path1 to Path2). +2. The commands in the scenario.txt file are applied, with output directed + to the `test.log` file in the test working directory. + Typically, the first actual command in the `scenario.txt` file is + to do a `--resync`, which establishes the baseline + `{...}.path1.lst` and `{...}.path2.lst` files in the test working + directory (`.../workdir/` relative to the temporary test directory). + Various commands and listing snapshots are done within the test. +3. Finally, the contents of the test working directory are compared + to the contents of the testcase's golden directory. -Endpoint for Qiniu Object Storage. +### Notes about testing -Properties: +- Test cases are in individual directories beneath `./cmd/bisync/testdata`. + A command line reference to a test is understood to reference a directory + beneath `testdata`. For example, + `go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local` + refers to the test case in `./cmd/bisync/testdata/test_dry_run`. +- The test working directory is located at `.../workdir` relative to a + temporary test directory, usually under `/tmp` on Linux. +- The local test sync tree is created at a temporary directory named + like `bisync.XXX` under system temporary directory. +- The remote test sync tree is located at a temporary directory + under `/bisync.XXX/`. +- `path1` and/or `path2` subdirectories are created in a temporary + directory under the respective local or cloud test remote. +- By default, the Path1 and Path2 test dirs and workdir will be deleted + after each test run. The `-no-cleanup` flag disables purging these + directories when validating and debugging a given test. + These directories will be flushed before running another test, + independent of the `-no-cleanup` usage. +- You will likely want to add `- /testdir/` to your normal + bisync `--filters-file` so that normal syncs do not attempt to sync + the test temporary directories, which may have `RCLONE_TEST` miscompares + in some testcases which would otherwise trip the `--check-access` system. + The `--check-access` mechanism is hard-coded to ignore `RCLONE_TEST` + files beneath `bisync/testdata`, so the test cases may reside on the + synched tree even if there are check file mismatches in the test tree. +- Some Dropbox tests can fail, notably printing the following message: + `src and dst identical but can't set mod time without deleting and re-uploading` + This is expected and happens due to the way Dropbox handles modification times. + You should use the `-refresh-times` test flag to make up for this. +- If Dropbox tests hit request limit for you and print error message + `too_many_requests/...: Too many requests or write operations.` + then follow the + [Dropbox App ID instructions](https://rclone.org/dropbox/#get-your-own-dropbox-app-id). -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "s3-cn-east-1.qiniucs.com" - - East China Endpoint 1 - - "s3-cn-east-2.qiniucs.com" - - East China Endpoint 2 - - "s3-cn-north-1.qiniucs.com" - - North China Endpoint 1 - - "s3-cn-south-1.qiniucs.com" - - South China Endpoint 1 - - "s3-us-north-1.qiniucs.com" - - North America Endpoint 1 - - "s3-ap-southeast-1.qiniucs.com" - - Southeast Asia Endpoint 1 - - "s3-ap-northeast-1.qiniucs.com" - - Northeast Asia Endpoint 1 +### Updating golden results -#### --s3-endpoint +Sometimes even a slight change in the bisync source can cause little changes +spread around many log files. Updating them manually would be a nightmare. -Endpoint for S3 API. +The `-golden` flag will store the `test.log` and `*.lst` listings from each +test case into respective golden directories. Golden results will +automatically contain generic strings instead of local or cloud paths which +means that they should match when run with a different cloud service. -Required when using an S3 clone. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: !AWS,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,Liara,ArvanCloud,Scaleway,StackPath,Storj,RackCorp,Qiniu -- Type: string -- Required: false -- Examples: - - "objects-us-east-1.dream.io" - - Dream Objects endpoint - - "syd1.digitaloceanspaces.com" - - DigitalOcean Spaces Sydney 1 - - "sfo3.digitaloceanspaces.com" - - DigitalOcean Spaces San Francisco 3 - - "fra1.digitaloceanspaces.com" - - DigitalOcean Spaces Frankfurt 1 - - "nyc3.digitaloceanspaces.com" - - DigitalOcean Spaces New York 3 - - "ams3.digitaloceanspaces.com" - - DigitalOcean Spaces Amsterdam 3 - - "sgp1.digitaloceanspaces.com" - - DigitalOcean Spaces Singapore 1 - - "localhost:8333" - - SeaweedFS S3 localhost - - "s3.us-east-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US East 1 (Virginia) - - "s3.us-west-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US West 1 (California) - - "s3.ap-southeast-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud AP Southeast 1 (Singapore) - - "s3.wasabisys.com" - - Wasabi US East 1 (N. Virginia) - - "s3.us-east-2.wasabisys.com" - - Wasabi US East 2 (N. Virginia) - - "s3.us-central-1.wasabisys.com" - - Wasabi US Central 1 (Texas) - - "s3.us-west-1.wasabisys.com" - - Wasabi US West 1 (Oregon) - - "s3.ca-central-1.wasabisys.com" - - Wasabi CA Central 1 (Toronto) - - "s3.eu-central-1.wasabisys.com" - - Wasabi EU Central 1 (Amsterdam) - - "s3.eu-central-2.wasabisys.com" - - Wasabi EU Central 2 (Frankfurt) - - "s3.eu-west-1.wasabisys.com" - - Wasabi EU West 1 (London) - - "s3.eu-west-2.wasabisys.com" - - Wasabi EU West 2 (Paris) - - "s3.ap-northeast-1.wasabisys.com" - - Wasabi AP Northeast 1 (Tokyo) endpoint - - "s3.ap-northeast-2.wasabisys.com" - - Wasabi AP Northeast 2 (Osaka) endpoint - - "s3.ap-southeast-1.wasabisys.com" - - Wasabi AP Southeast 1 (Singapore) - - "s3.ap-southeast-2.wasabisys.com" - - Wasabi AP Southeast 2 (Sydney) - - "storage.iran.liara.space" - - Liara Iran endpoint - - "s3.ir-thr-at1.arvanstorage.com" - - ArvanCloud Tehran Iran (Asiatech) endpoint - -#### --s3-location-constraint +Your normal workflow might be as follows: +1. Git-clone the rclone sources locally +2. Modify bisync source and check that it builds +3. Run the whole test suite `go test ./cmd/bisync -remote local` +4. If some tests show log difference, recheck them individually, e.g.: + `go test ./cmd/bisync -remote local -case basic` +5. If you are convinced with the difference, goldenize all tests at once: + `go test ./cmd/bisync -remote local -golden` +6. Use word diff: `git diff --word-diff ./cmd/bisync/testdata/`. + Please note that normal line-level diff is generally useless here. +7. Check the difference _carefully_! +8. Commit the change (`git commit`) _only_ if you are sure. + If unsure, save your code changes then wipe the log diffs from git: + `git reset [--hard]`. -Location constraint - must be set to match the Region. +### Structure of test scenarios -Used when creating buckets only. +- `/initial/` contains a tree of files that will be set + as the initial condition on both Path1 and Path2 testdirs. +- `/modfiles/` contains files that will be used to + modify the Path1 and/or Path2 filesystems. +- `/golden/` contains the expected content of the test + working directory (`workdir`) at the completion of the testcase. +- `/scenario.txt` contains the body of the test, in the form of + various commands to modify files, run bisync, and snapshot listings. + Output from these commands is captured to `.../workdir/test.log` + for comparison to the golden files. -Properties: +### Supported test commands -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "" - - Empty for US Region, Northern Virginia, or Pacific Northwest - - "us-east-2" - - US East (Ohio) Region - - "us-west-1" - - US West (Northern California) Region - - "us-west-2" - - US West (Oregon) Region - - "ca-central-1" - - Canada (Central) Region - - "eu-west-1" - - EU (Ireland) Region - - "eu-west-2" - - EU (London) Region - - "eu-west-3" - - EU (Paris) Region - - "eu-north-1" - - EU (Stockholm) Region - - "eu-south-1" - - EU (Milan) Region - - "EU" - - EU Region - - "ap-southeast-1" - - Asia Pacific (Singapore) Region - - "ap-southeast-2" - - Asia Pacific (Sydney) Region - - "ap-northeast-1" - - Asia Pacific (Tokyo) Region - - "ap-northeast-2" - - Asia Pacific (Seoul) Region - - "ap-northeast-3" - - Asia Pacific (Osaka-Local) Region - - "ap-south-1" - - Asia Pacific (Mumbai) Region - - "ap-east-1" - - Asia Pacific (Hong Kong) Region - - "sa-east-1" - - South America (Sao Paulo) Region - - "me-south-1" - - Middle East (Bahrain) Region - - "af-south-1" - - Africa (Cape Town) Region - - "cn-north-1" - - China (Beijing) Region - - "cn-northwest-1" - - China (Ningxia) Region - - "us-gov-east-1" - - AWS GovCloud (US-East) Region - - "us-gov-west-1" - - AWS GovCloud (US) Region +- `test ` + Print the line to the console and to the `test.log`: + `test sync is working correctly with options x, y, z` +- `copy-listings ` + Save a copy of all `.lst` listings in the test working directory + with the specified prefix: + `save-listings exclude-pass-run` +- `move-listings ` + Similar to `copy-listings` but removes the source +- `purge-children ` + This will delete all child files and purge all child subdirs under given + directory but keep the parent intact. This behavior is important for tests + with Google Drive because removing and re-creating the parent would change + its ID. +- `delete-file ` + Delete a single file. +- `delete-glob ` + Delete a group of files located one level deep in the given directory + with names matching a given glob pattern. +- `touch-glob YYYY-MM-DD ` + Change modification time on a group of files. +- `touch-copy YYYY-MM-DD ` + Change file modification time then copy it to destination. +- `copy-file ` + Copy a single file to given directory. +- `copy-as ` + Similar to above but destination must include both directory + and the new file name at destination. +- `copy-dir ` and `sync-dir ` + Copy/sync a directory. Equivalent of `rclone copy` and `rclone sync`. +- `list-dirs ` + Equivalent to `rclone lsf -R --dirs-only ` +- `bisync [options]` + Runs bisync against `-remote` and `-remote2`. -#### --s3-location-constraint +### Supported substitution terms -Location constraint - must match endpoint. +- `{testdir/}` - the root dir of the testcase +- `{datadir/}` - the `modfiles` dir under the testcase root +- `{workdir/}` - the temporary test working directory +- `{path1/}` - the root of the Path1 test directory tree +- `{path2/}` - the root of the Path2 test directory tree +- `{session}` - base name of the test listings +- `{/}` - OS-specific path separator +- `{spc}`, `{tab}`, `{eol}` - whitespace +- `{chr:HH}` - raw byte with given hexadecimal code -Used when creating buckets only. +Substitution results of the terms named like `{dir/}` will end with +`/` (or backslash on Windows), so it is not necessary to include +slash in the usage, for example `delete-file {path1/}file1.txt`. -Properties: +## Benchmarks -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "wuxi1" - - East China (Suzhou) - - "jinan1" - - East China (Jinan) - - "ningbo1" - - East China (Hangzhou) - - "shanghai1" - - East China (Shanghai-1) - - "zhengzhou1" - - Central China (Zhengzhou) - - "hunan1" - - Central China (Changsha-1) - - "zhuzhou1" - - Central China (Changsha-2) - - "guangzhou1" - - South China (Guangzhou-2) - - "dongguan1" - - South China (Guangzhou-3) - - "beijing1" - - North China (Beijing-1) - - "beijing2" - - North China (Beijing-2) - - "beijing4" - - North China (Beijing-3) - - "huhehaote1" - - North China (Huhehaote) - - "chengdu1" - - Southwest China (Chengdu) - - "chongqing1" - - Southwest China (Chongqing) - - "guiyang1" - - Southwest China (Guiyang) - - "xian1" - - Nouthwest China (Xian) - - "yunnan" - - Yunnan China (Kunming) - - "yunnan2" - - Yunnan China (Kunming-2) - - "tianjin1" - - Tianjin China (Tianjin) - - "jilin1" - - Jilin China (Changchun) - - "hubei1" - - Hubei China (Xiangyan) - - "jiangxi1" - - Jiangxi China (Nanchang) - - "gansu1" - - Gansu China (Lanzhou) - - "shanxi1" - - Shanxi China (Taiyuan) - - "liaoning1" - - Liaoning China (Shenyang) - - "hebei1" - - Hebei China (Shijiazhuang) - - "fujian1" - - Fujian China (Xiamen) - - "guangxi1" - - Guangxi China (Nanning) - - "anhui1" - - Anhui China (Huainan) +_This section is work in progress._ -#### --s3-location-constraint +Here are a few data points for scale, execution times, and memory usage. -Location constraint - must match endpoint. +The first set of data was taken between a local disk to Dropbox. +The [speedtest.net](https://speedtest.net) download speed was ~170 Mbps, +and upload speed was ~10 Mbps. 500 files (~9.5 MB each) had been already +synched. 50 files were added in a new directory, each ~9.5 MB, ~475 MB total. -Used when creating buckets only. +Change | Operations and times | Overall run time +--------------------------------------|--------------------------------------------------------|------------------ +500 files synched (nothing to move) | 1x listings for Path1 & Path2 | 1.5 sec +500 files synched with --check-access | 1x listings for Path1 & Path2 | 1.5 sec +50 new files on remote | Queued 50 copies down: 27 sec | 29 sec +Moved local dir | Queued 50 copies up: 410 sec, 50 deletes up: 9 sec | 421 sec +Moved remote dir | Queued 50 copies down: 31 sec, 50 deletes down: <1 sec | 33 sec +Delete local dir | Queued 50 deletes up: 9 sec | 13 sec -Properties: +This next data is from a user's application. They had ~400GB of data +over 1.96 million files being sync'ed between a Windows local disk and some +remote cloud. The file full path length was on average 35 characters +(which factors into load time and RAM required). -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "ir-thr-at1" - - Tehran Iran (Asiatech) - - "ir-tbz-sh1" - - Tabriz Iran (Shahriar) +- Loading the prior listing into memory (1.96 million files, listing file + size 140 MB) took ~30 sec and occupied about 1 GB of RAM. +- Getting a fresh listing of the local file system (producing the + 140 MB output file) took about XXX sec. +- Getting a fresh listing of the remote file system (producing the 140 MB + output file) took about XXX sec. The network download speed was measured + at XXX Mb/s. +- Once the prior and current Path1 and Path2 listings were loaded (a total + of four to be loaded, two at a time), determining the deltas was pretty + quick (a few seconds for this test case), and the transfer time for any + files to be copied was dominated by the network bandwidth. -#### --s3-location-constraint +## References -Location constraint - must match endpoint when using IBM Cloud Public. +rclone's bisync implementation was derived from +the [rclonesync-V2](https://github.com/cjnaz/rclonesync-V2) project, +including documentation and test mechanisms, +with [@cjnaz](https://github.com/cjnaz)'s full support and encouragement. -For on-prem COS, do not make a selection from this list, hit enter. +`rclone bisync` is similar in nature to a range of other projects: -Properties: +- [unison](https://github.com/bcpierce00/unison) +- [syncthing](https://github.com/syncthing/syncthing) +- [cjnaz/rclonesync](https://github.com/cjnaz/rclonesync-V2) +- [ConorWilliams/rsinc](https://github.com/ConorWilliams/rsinc) +- [jwink3101/syncrclone](https://github.com/Jwink3101/syncrclone) +- [DavideRossi/upback](https://github.com/DavideRossi/upback) -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "us-standard" - - US Cross Region Standard - - "us-vault" - - US Cross Region Vault - - "us-cold" - - US Cross Region Cold - - "us-flex" - - US Cross Region Flex - - "us-east-standard" - - US East Region Standard - - "us-east-vault" - - US East Region Vault - - "us-east-cold" - - US East Region Cold - - "us-east-flex" - - US East Region Flex - - "us-south-standard" - - US South Region Standard - - "us-south-vault" - - US South Region Vault - - "us-south-cold" - - US South Region Cold - - "us-south-flex" - - US South Region Flex - - "eu-standard" - - EU Cross Region Standard - - "eu-vault" - - EU Cross Region Vault - - "eu-cold" - - EU Cross Region Cold - - "eu-flex" - - EU Cross Region Flex - - "eu-gb-standard" - - Great Britain Standard - - "eu-gb-vault" - - Great Britain Vault - - "eu-gb-cold" - - Great Britain Cold - - "eu-gb-flex" - - Great Britain Flex - - "ap-standard" - - APAC Standard - - "ap-vault" - - APAC Vault - - "ap-cold" - - APAC Cold - - "ap-flex" - - APAC Flex - - "mel01-standard" - - Melbourne Standard - - "mel01-vault" - - Melbourne Vault - - "mel01-cold" - - Melbourne Cold - - "mel01-flex" - - Melbourne Flex - - "tor01-standard" - - Toronto Standard - - "tor01-vault" - - Toronto Vault - - "tor01-cold" - - Toronto Cold - - "tor01-flex" - - Toronto Flex +Bisync adopts the differential synchronization technique, which is +based on keeping history of changes performed by both synchronizing sides. +See the _Dual Shadow Method_ section in +[Neil Fraser's article](https://neil.fraser.name/writing/sync/). -#### --s3-location-constraint +Also note a number of academic publications by +[Benjamin Pierce](http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) +about _Unison_ and synchronization in general. -Location constraint - the location where your bucket will be located and your data stored. +## Changelog + +### `v1.64` +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) +causing dry runs to inadvertently commit filter changes +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs) +causing `--resync` to erroneously delete empty folders and duplicate files unique to Path2 +* `--check-access` is now enforced during `--resync`, preventing data loss in [certain user error scenarios](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should) +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations) +causing bisync to consider more files than necessary due to overbroad filters during delete operations +* [Improved detection of false positive change conflicts](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides) +(identical files are now left alone instead of renamed) +* Added [support for `--create-empty-src-dirs`](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed) +* Added experimental `--resilient` mode to allow [recovery from self-correctable errors](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20Bisync%20should%20be%20more%20resilient%20to%20self%2Dcorrectable%20errors) +* Added [new `--ignore-listing-checksum` flag](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20%2D%2Dignore%2Dchecksum%20should%20be%20split%20into%20two%20flags%20for%20separate%20purposes) +to distinguish from `--ignore-checksum` +* [Performance improvements](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20Deletes%20take%20several%20times%20longer%20than%20copies) for large remotes +* Documentation and testing improvements + +# Release signing + +The hashes of the binary artefacts of the rclone release are signed +with a public PGP/GPG key. This can be verified manually as described +below. +The same mechanism is also used by [rclone selfupdate](https://rclone.org/commands/rclone_selfupdate/) +to verify that the release has not been tampered with before the new +update is installed. This checks the SHA256 hash and the signature +with a public key compiled into the rclone binary. -Properties: +## Release signing key -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN Region - - "au" - - Australia (All locations) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region +You may obtain the release signing key from: -#### --s3-location-constraint +- From [KEYS](/KEYS) on this website - this file contains all past signing keys also. +- The git repository hosted on GitHub - https://github.com/rclone/rclone/blob/master/docs/content/KEYS +- `gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com` +- `gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com` +- https://www.craig-wood.com/nick/pub/pgp-key.txt -Location constraint - must be set to match the Region. +After importing the key, verify that the fingerprint of one of the +keys matches: `FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA` as this key is used for signing. -Used when creating buckets only. +We recommend that you cross-check the fingerprint shown above through +the domains listed below. By cross-checking the integrity of the +fingerprint across multiple domains you can be confident that you +obtained the correct key. -Properties: +- The [source for this page on GitHub](https://github.com/rclone/rclone/blob/master/docs/content/release_signing.md). +- Through DNS `dig key.rclone.org txt` -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - East China Region 1 - - "cn-east-2" - - East China Region 2 - - "cn-north-1" - - North China Region 1 - - "cn-south-1" - - South China Region 1 - - "us-north-1" - - North America Region 1 - - "ap-southeast-1" - - Southeast Asia Region 1 - - "ap-northeast-1" - - Northeast Asia Region 1 +If you find anything that doesn't not match, please contact the +developers at once. -#### --s3-location-constraint +## How to verify the release -Location constraint - must be set to match the Region. +In the release directory you will see the release files and some files called `MD5SUMS`, `SHA1SUMS` and `SHA256SUMS`. -Leave blank if not sure. Used when creating buckets only. +``` +$ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: +MD5SUMS +SHA1SUMS +SHA256SUMS +rclone-v1.63.1-freebsd-386.zip +rclone-v1.63.1-freebsd-amd64.zip +... +rclone-v1.63.1-windows-arm64.zip +rclone-v1.63.1.tar.gz +version.txt +``` -Properties: +The `MD5SUMS`, `SHA1SUMS` and `SHA256SUMS` contain hashes of the +binary files in the release directory along with a signature. -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: !AWS,Alibaba,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Liara,ArvanCloud,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS -- Type: string -- Required: false +For example: -#### --s3-acl +``` +$ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 -Canned ACL used when creating buckets and storing or copying objects. +f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip +7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip +... +66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip +bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip +-----BEGIN PGP SIGNATURE----- -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU ++pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= +=8qrL +-----END PGP SIGNATURE----- +``` -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +### Download the files -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. +The first step is to download the binary and SUMs file and verify that +the SUMs you have downloaded match. Here we download +`rclone-v1.63.1-windows-amd64.zip` - choose the binary (or binaries) +appropriate to your architecture. We've also chosen the `SHA256SUMS` +as these are the most secure. You could verify the other types of hash +also for extra security. `rclone selfupdate` verifies just the +`SHA256SUMS`. -If the acl is an empty string then no X-Amz-Acl: header is added and -the default (private) will be used. +``` +$ mkdir /tmp/check +$ cd /tmp/check +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . +``` +### Verify the signatures -Properties: +First verify the signatures on the SHA256 file. -- Config: acl -- Env Var: RCLONE_S3_ACL -- Provider: !Storj,Cloudflare -- Type: string -- Required: false -- Examples: - - "default" - - Owner gets Full_CONTROL. - - No one else has access rights (default). - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - Granting this on a bucket is generally not recommended. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. - - "bucket-owner-read" - - Object owner gets FULL_CONTROL. - - Bucket owner gets READ access. - - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - - "bucket-owner-full-control" - - Both the object owner and the bucket owner get FULL_CONTROL over the object. - - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS. - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - This acl is available on IBM Cloud (Infra), On-Premise IBM COS. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. - - Not supported on Buckets. - - This acl is available on IBM Cloud (Infra) and On-Premise IBM COS. +Import the key. See above for ways to verify this key is correct. -#### --s3-server-side-encryption +``` +$ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood " imported +gpg: Total number processed: 1 +gpg: imported: 1 +``` -The server-side encryption algorithm used when storing this object in S3. +Then check the signature: -Properties: +``` +$ gpg --verify SHA256SUMS +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST +gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: Good signature from "Nick Craig-Wood " [ultimate] +``` -- Config: server_side_encryption -- Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 - - "aws:kms" - - aws:kms +Verify the signature was good and is using the fingerprint shown above. -#### --s3-sse-kms-key-id +Repeat for `MD5SUMS` and `SHA1SUMS` if desired. -If using KMS ID you must provide the ARN of Key. +### Verify the hashes -Properties: +Now that we know the signatures on the hashes are OK we can verify the +binaries match the hashes, completing the verification. -- Config: sse_kms_key_id -- Env Var: RCLONE_S3_SSE_KMS_KEY_ID -- Provider: AWS,Ceph,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "arn:aws:kms:us-east-1:*" - - arn:aws:kms:* +``` +$ sha256sum -c SHA256SUMS 2>&1 | grep OK +rclone-v1.63.1-windows-amd64.zip: OK +``` -#### --s3-storage-class +Or do the check with rclone -The storage class to use when storing new objects in S3. +``` +$ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... += rclone-v1.63.1-windows-amd64.zip +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files +``` -Properties: +### Verify signatures and hashes together -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "REDUCED_REDUNDANCY" - - Reduced redundancy storage class - - "STANDARD_IA" - - Standard Infrequent Access storage class - - "ONEZONE_IA" - - One Zone Infrequent Access storage class - - "GLACIER" - - Glacier storage class - - "DEEP_ARCHIVE" - - Glacier Deep Archive storage class - - "INTELLIGENT_TIERING" - - Intelligent-Tiering storage class - - "GLACIER_IR" - - Glacier Instant Retrieval storage class +You can verify the signatures and hashes in one command line like this: -#### --s3-storage-class +``` +$ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST +gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: Good signature from "Nick Craig-Wood " [ultimate] +gpg: aka "Nick Craig-Wood " [unknown] +rclone-v1.63.1-windows-amd64.zip: OK +``` -The storage class to use when storing new objects in OSS. +# 1Fichier -Properties: +This is a backend for the [1fichier](https://1fichier.com) cloud +storage service. Note that a Premium subscription is required to use +the API. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode +Paths are specified as `remote:path` -#### --s3-storage-class +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -The storage class to use when storing new objects in ChinaMobile. +## Configuration -Properties: +The initial setup for 1Fichier involves getting the API key from the website which you +need to do in your browser. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode +Here is an example of how to make a remote called `remote`. First run: -#### --s3-storage-class + rclone config -The storage class to use when storing new objects in Liara +This will guide you through an interactive setup process: -Properties: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / 1Fichier + \ "fichier" +[snip] +Storage> fichier +** See help for fichier backend at: https://rclone.org/fichier/ ** -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class +Your API Key, get it from https://1fichier.com/console/params.pl +Enter a string value. Press Enter for the default (""). +api_key> example_key -#### --s3-storage-class +Edit advanced config? (y/n) +y) Yes +n) No +y/n> +Remote config +-------------------- +[remote] +type = fichier +api_key = example_key +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -The storage class to use when storing new objects in ArvanCloud. +Once configured you can then use `rclone` like this, -Properties: +List directories in top level of your 1Fichier account -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class + rclone lsd remote: -#### --s3-storage-class +List all the files in your 1Fichier account -The storage class to use when storing new objects in Tencent COS. + rclone ls remote: -Properties: +To copy a local directory to a 1Fichier directory called backup -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "ARCHIVE" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode + rclone copy /home/source remote:backup -#### --s3-storage-class +### Modification times and hashes -The storage class to use when storing new objects in S3. +1Fichier does not support modification times. It supports the Whirlpool hash algorithm. -Properties: +### Duplicated files -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "" - - Default. - - "STANDARD" - - The Standard class for any upload. - - Suitable for on-demand content like streaming or CDN. - - "GLACIER" - - Archived storage. - - Prices are lower, but it needs to be restored first to be accessed. +1Fichier can have two files with exactly the same name and path (unlike a +normal file system). -#### --s3-storage-class +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -The storage class to use when storing new objects in Qiniu. +### Restricted filename characters -Properties: +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - - "LINE" - - Infrequent access storage mode - - "GLACIER" - - Archive storage mode - - "DEEP_ARCHIVE" - - Deep archive storage mode +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | +| < | 0x3C | < | +| > | 0x3E | > | +| " | 0x22 | " | +| $ | 0x24 | $ | +| ` | 0x60 | ` | +| ' | 0x27 | ' | -### Advanced options +File names can also not start or end with the following characters. +These only get replaced if they are the first or last character in the +name: -Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi). +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | -#### --s3-bucket-acl +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Canned ACL used when creating buckets. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +### Standard options -Note that this ACL is applied when only when creating buckets. If it -isn't set then "acl" is used instead. +Here are the Standard options specific to fichier (1Fichier). -If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: -header is added and the default (private) will be used. +#### --fichier-api-key +Your API Key, get it from https://1fichier.com/console/params.pl. Properties: -- Config: bucket_acl -- Env Var: RCLONE_S3_BUCKET_ACL +- Config: api_key +- Env Var: RCLONE_FICHIER_API_KEY - Type: string - Required: false -- Examples: - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - Granting this on a bucket is generally not recommended. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. -#### --s3-requester-pays - -Enables requester pays option when interacting with S3 bucket. - -Properties: +### Advanced options -- Config: requester_pays -- Env Var: RCLONE_S3_REQUESTER_PAYS -- Provider: AWS -- Type: bool -- Default: false +Here are the Advanced options specific to fichier (1Fichier). -#### --s3-sse-customer-algorithm +#### --fichier-shared-folder -If using SSE-C, the server-side encryption algorithm used when storing this object in S3. +If you want to download a shared folder, add this parameter. Properties: -- Config: sse_customer_algorithm -- Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM -- Provider: AWS,Ceph,ChinaMobile,Minio +- Config: shared_folder +- Env Var: RCLONE_FICHIER_SHARED_FOLDER - Type: string - Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 -#### --s3-sse-customer-key +#### --fichier-file-password -To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data. +If you want to download a shared file that is password protected, add this parameter. -Alternatively you can provide --sse-customer-key-base64. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: sse_customer_key -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY -- Provider: AWS,Ceph,ChinaMobile,Minio +- Config: file_password +- Env Var: RCLONE_FICHIER_FILE_PASSWORD - Type: string - Required: false -- Examples: - - "" - - None -#### --s3-sse-customer-key-base64 +#### --fichier-folder-password -If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data. +If you want to list the files in a shared folder that is password protected, add this parameter. -Alternatively you can provide --sse-customer-key. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: sse_customer_key_base64 -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64 -- Provider: AWS,Ceph,ChinaMobile,Minio +- Config: folder_password +- Env Var: RCLONE_FICHIER_FOLDER_PASSWORD - Type: string - Required: false -- Examples: - - "" - - None - -#### --s3-sse-customer-key-md5 -If using SSE-C you may provide the secret encryption key MD5 checksum (optional). - -If you leave it blank, this is calculated automatically from the sse_customer_key provided. +#### --fichier-cdn +Set if you wish to use CDN download links. Properties: -- Config: sse_customer_key_md5 -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5 -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +- Config: cdn +- Env Var: RCLONE_FICHIER_CDN +- Type: bool +- Default: false -#### --s3-upload-cutoff +#### --fichier-encoding -Cutoff for switching to chunked upload. +The encoding for the backend. -Any files larger than this will be uploaded in chunks of chunk_size. -The minimum is 0 and the maximum is 5 GiB. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: upload_cutoff -- Env Var: RCLONE_S3_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi - -#### --s3-chunk-size +- Config: encoding +- Env Var: RCLONE_FICHIER_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot -Chunk size to use for uploading. -When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads -using this chunk size. -Note that "--s3-upload-concurrency" chunks of this size are buffered -in memory per transfer. +## Limitations -If you are transferring large files over high-speed links and you have -enough memory, then increasing this will speed up the transfers. +`rclone about` is not supported by the 1Fichier backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -Rclone will automatically increase the chunk size when uploading a -large file of known size to stay below the 10,000 chunks limit. +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Files of unknown size are uploaded with the configured -chunk_size. Since the default chunk size is 5 MiB and there can be at -most 10,000 chunks, this means that by default the maximum size of -a file you can stream upload is 48 GiB. If you wish to stream upload -larger files then you will need to increase chunk_size. +# Alias -Increasing the chunk size decreases the accuracy of the progress -statistics displayed with "-P" flag. Rclone treats chunk as sent when -it's buffered by the AWS SDK, when in fact it may still be uploading. -A bigger chunk size means a bigger AWS SDK buffer and progress -reporting more deviating from the truth. +The `alias` remote provides a new name for another remote. +Paths may be as deep as required or a local path, +e.g. `remote:directory/subdirectory` or `/directory/subdirectory`. -Properties: +During the initial setup with `rclone config` you will specify the target +remote. The target remote can either be a local path or another remote. -- Config: chunk_size -- Env Var: RCLONE_S3_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi +Subfolders can be used in target remote. Assume an alias remote named `backup` +with the target `mydrive:private/backup`. Invoking `rclone mkdir backup:desktop` +is exactly the same as invoking `rclone mkdir mydrive:private/backup/desktop`. -#### --s3-max-upload-parts +There will be no special handling of paths containing `..` segments. +Invoking `rclone mkdir backup:../desktop` is exactly the same as invoking +`rclone mkdir mydrive:private/backup/../desktop`. +The empty path is not allowed as a remote. To alias the current directory +use `.` instead. -Maximum number of parts in a multipart upload. +The target remote can also be a [connection string](https://rclone.org/docs/#connection-strings). +This can be used to modify the config of a remote for different uses, e.g. +the alias `myDriveTrash` with the target remote `myDrive,trashed_only:` +can be used to only show the trashed files in `myDrive`. -This option defines the maximum number of multipart chunks to use -when doing a multipart upload. +## Configuration -This can be useful if a service does not support the AWS S3 -specification of 10,000 chunks. +Here is an example of how to make an alias called `remote` for local folder. +First run: -Rclone will automatically increase the chunk size when uploading a -large file of a known size to stay below this number of chunks limit. + rclone config +This will guide you through an interactive setup process: -Properties: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Alias for an existing remote + \ "alias" +[snip] +Storage> alias +Remote or path to alias. +Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". +remote> /mnt/storage/backup +Remote config +-------------------- +[remote] +remote = /mnt/storage/backup +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -- Config: max_upload_parts -- Env Var: RCLONE_S3_MAX_UPLOAD_PARTS -- Type: int -- Default: 10000 +Name Type +==== ==== +remote alias -#### --s3-copy-cutoff +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +``` -Cutoff for switching to multipart copy. +Once configured you can then use `rclone` like this, -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. +List directories in top level in `/mnt/storage/backup` -The minimum is 0 and the maximum is 5 GiB. + rclone lsd remote: -Properties: +List all the files in `/mnt/storage/backup` -- Config: copy_cutoff -- Env Var: RCLONE_S3_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4.656Gi + rclone ls remote: -#### --s3-disable-checksum +Copy another local directory to the alias directory called source -Don't store MD5 checksum with object metadata. + rclone copy /home/source remote:source -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. -Properties: +### Standard options -- Config: disable_checksum -- Env Var: RCLONE_S3_DISABLE_CHECKSUM -- Type: bool -- Default: false +Here are the Standard options specific to alias (Alias for an existing remote). -#### --s3-shared-credentials-file +#### --alias-remote -Path to the shared credentials file. +Remote or path to alias. -If env_auth = true then rclone can use a shared credentials file. +Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". -If this variable is empty rclone will look for the -"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty -it will default to the current user's home directory. +Properties: - Linux/OSX: "$HOME/.aws/credentials" - Windows: "%USERPROFILE%\.aws\credentials" +- Config: remote +- Env Var: RCLONE_ALIAS_REMOTE +- Type: string +- Required: true -Properties: -- Config: shared_credentials_file -- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE -- Type: string -- Required: false +# Amazon Drive -#### --s3-profile +Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage +service run by Amazon for consumers. -Profile to use in the shared credentials file. +## Status -If env_auth = true then rclone can use a shared credentials file. This -variable controls which profile is used in that file. +**Important:** rclone supports Amazon Drive only if you have your own +set of API keys. Unfortunately the [Amazon Drive developer +program](https://developer.amazon.com/amazon-drive) is now closed to +new entries so if you don't already have your own set of keys you will +not be able to use rclone with Amazon Drive. -If empty it will default to the environment variable "AWS_PROFILE" or -"default" if that environment variable is also not set. +For the history on why rclone no longer has a set of Amazon Drive API +keys see [the forum](https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). +If you happen to know anyone who works at Amazon then please ask them +to re-instate rclone into the Amazon Drive developer program - thanks! -Properties: +## Configuration -- Config: profile -- Env Var: RCLONE_S3_PROFILE -- Type: string -- Required: false +The initial setup for Amazon Drive involves getting a token from +Amazon which you need to do in your browser. `rclone config` walks +you through it. -#### --s3-session-token +The configuration process for Amazon Drive may involve using an [oauth +proxy](https://github.com/ncw/oauthproxy). This is used to keep the +Amazon credentials out of the source code. The proxy runs in Google's +very secure App Engine environment and doesn't store any credentials +which pass through it. -An AWS session token. +Since rclone doesn't currently have its own Amazon Drive credentials +so you will either need to have your own `client_id` and +`client_secret` with Amazon Drive, or use a third-party oauth proxy +in which case you will need to enter `client_id`, `client_secret`, +`auth_url` and `token_url`. -Properties: +Note also if you are not using Amazon's `auth_url` and `token_url`, +(ie you filled in something for those) then if setting up on a remote +machine you can only use the [copying the config method of +configuration](https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) +- `rclone authorize` will not work. -- Config: session_token -- Env Var: RCLONE_S3_SESSION_TOKEN -- Type: string -- Required: false +Here is an example of how to make a remote called `remote`. First run: -#### --s3-upload-concurrency + rclone config -Concurrency for multipart uploads. +This will guide you through an interactive setup process: -This is the number of chunks of the same file that are uploaded -concurrently. +``` +No remotes found, make a new one? +n) New remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +n/r/c/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon Drive + \ "amazon cloud drive" +[snip] +Storage> amazon cloud drive +Amazon Application Client Id - required. +client_id> your client ID goes here +Amazon Application Client Secret - required. +client_secret> your client secret goes here +Auth server URL - leave blank to use Amazon's. +auth_url> Optional auth URL +Token server url - leave blank to use Amazon's. +token_url> Optional token URL +Remote config +Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes +n) No +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code +-------------------- +[remote] +client_id = your client ID goes here +client_secret = your client secret goes here +auth_url = Optional auth URL +token_url = Optional token URL +token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -Properties: +Note that rclone runs a webserver on your local machine to collect the +token as returned from Amazon. This only runs from the moment it +opens your browser to the moment you get back the verification +code. This is on `http://127.0.0.1:53682/` and this it may require +you to unblock it temporarily if you are running a host firewall. -- Config: upload_concurrency -- Env Var: RCLONE_S3_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 +Once configured you can then use `rclone` like this, -#### --s3-force-path-style +List directories in top level of your Amazon Drive -If true use path style access if false use virtual hosted style. + rclone lsd remote: -If this is true (the default) then rclone will use path style access, -if false then rclone will use virtual path style. See [the AWS S3 -docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) -for more info. +List all the files in your Amazon Drive -Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to -false - rclone will do this automatically based on the provider -setting. + rclone ls remote: -Properties: +To copy a local directory to an Amazon Drive directory called backup -- Config: force_path_style -- Env Var: RCLONE_S3_FORCE_PATH_STYLE -- Type: bool -- Default: true + rclone copy /home/source remote:backup -#### --s3-v2-auth +### Modification times and hashes -If true use v2 authentication. +Amazon Drive doesn't allow modification times to be changed via +the API so these won't be accurate or used for syncing. -If this is false (the default) then rclone will use v4 authentication. -If it is set then rclone will use v2 authentication. +It does support the MD5 hash algorithm, so for a more accurate sync, +you can use the `--checksum` flag. -Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH. +### Restricted filename characters -Properties: +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | -- Config: v2_auth -- Env Var: RCLONE_S3_V2_AUTH -- Type: bool -- Default: false +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -#### --s3-use-accelerate-endpoint +### Deleting files -If true use the AWS S3 accelerated endpoint. +Any files you delete with rclone will end up in the trash. Amazon +don't provide an API to permanently delete files, nor to empty the +trash, so you will have to do that with one of Amazon's apps or via +the Amazon Drive website. As of November 17, 2016, files are +automatically deleted by Amazon from the trash after 30 days. -See: [AWS S3 Transfer acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration-examples.html) +### Using with non `.com` Amazon accounts -Properties: +Let's say you usually use `amazon.co.uk`. When you authenticate with +rclone it will take you to an `amazon.com` page to log in. Your +`amazon.co.uk` email and password should work here just fine. -- Config: use_accelerate_endpoint -- Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT -- Provider: AWS -- Type: bool -- Default: false -#### --s3-leave-parts-on-error +### Standard options -If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. +Here are the Standard options specific to amazon cloud drive (Amazon Drive). -It should be set to true for resuming uploads across different sessions. +#### --acd-client-id -WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up. +OAuth Client Id. +Leave blank normally. Properties: -- Config: leave_parts_on_error -- Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR -- Provider: AWS -- Type: bool -- Default: false - -#### --s3-list-chunk +- Config: client_id +- Env Var: RCLONE_ACD_CLIENT_ID +- Type: string +- Required: false -Size of listing chunk (response list for each ListObject S3 request). +#### --acd-client-secret -This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. -Most services truncate the response list to 1000 objects even if requested more than that. -In AWS S3 this is a global maximum and cannot be changed, see [AWS S3](https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html). -In Ceph, this can be increased with the "rgw list buckets max chunk" option. +OAuth Client Secret. +Leave blank normally. Properties: -- Config: list_chunk -- Env Var: RCLONE_S3_LIST_CHUNK -- Type: int -- Default: 1000 - -#### --s3-list-version - -Version of ListObjects to use: 1,2 or 0 for auto. +- Config: client_secret +- Env Var: RCLONE_ACD_CLIENT_SECRET +- Type: string +- Required: false -When S3 originally launched it only provided the ListObjects call to -enumerate objects in a bucket. +### Advanced options -However in May 2016 the ListObjectsV2 call was introduced. This is -much higher performance and should be used if at all possible. +Here are the Advanced options specific to amazon cloud drive (Amazon Drive). -If set to the default, 0, rclone will guess according to the provider -set which list objects method to call. If it guesses wrong, then it -may be set manually here. +#### --acd-token +OAuth Access Token as a JSON blob. Properties: -- Config: list_version -- Env Var: RCLONE_S3_LIST_VERSION -- Type: int -- Default: 0 - -#### --s3-list-url-encode +- Config: token +- Env Var: RCLONE_ACD_TOKEN +- Type: string +- Required: false -Whether to url encode listings: true/false/unset +#### --acd-auth-url -Some providers support URL encoding listings and where this is -available this is more reliable when using control characters in file -names. If this is set to unset (the default) then rclone will choose -according to the provider setting what to apply, but you can override -rclone's choice here. +Auth server URL. +Leave blank to use the provider defaults. Properties: -- Config: list_url_encode -- Env Var: RCLONE_S3_LIST_URL_ENCODE -- Type: Tristate -- Default: unset - -#### --s3-no-check-bucket - -If set, don't attempt to check the bucket exists or create it. +- Config: auth_url +- Env Var: RCLONE_ACD_AUTH_URL +- Type: string +- Required: false -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. +#### --acd-token-url -It can also be needed if the user you are using does not have bucket -creation permissions. Before v1.52.0 this would have passed silently -due to a bug. +Token server url. +Leave blank to use the provider defaults. Properties: -- Config: no_check_bucket -- Env Var: RCLONE_S3_NO_CHECK_BUCKET -- Type: bool -- Default: false - -#### --s3-no-head +- Config: token_url +- Env Var: RCLONE_ACD_TOKEN_URL +- Type: string +- Required: false -If set, don't HEAD uploaded objects to check integrity. +#### --acd-checkpoint -This can be useful when trying to minimise the number of transactions -rclone does. +Checkpoint for internal polling (debug). -Setting it means that if rclone receives a 200 OK message after -uploading an object with PUT then it will assume that it got uploaded -properly. +Properties: -In particular it will assume: +- Config: checkpoint +- Env Var: RCLONE_ACD_CHECKPOINT +- Type: string +- Required: false -- the metadata, including modtime, storage class and content type was as uploaded -- the size was as uploaded +#### --acd-upload-wait-per-gb -It reads the following items from the response for a single part PUT: +Additional time per GiB to wait after a failed complete upload to see if it appears. -- the MD5SUM -- The uploaded date +Sometimes Amazon Drive gives an error when a file has been fully +uploaded but the file appears anyway after a little while. This +happens sometimes for files over 1 GiB in size and nearly every time for +files bigger than 10 GiB. This parameter controls the time rclone waits +for the file to appear. -For multipart uploads these items aren't read. +The default value for this parameter is 3 minutes per GiB, so by +default it will wait 3 minutes for every GiB uploaded to see if the +file appears. -If an source object of unknown length is uploaded then rclone **will** do a -HEAD request. +You can disable this feature by setting it to 0. This may cause +conflict errors as rclone retries the failed upload but the file will +most likely appear correctly eventually. -Setting this flag increases the chance for undetected upload failures, -in particular an incorrect size, so it isn't recommended for normal -operation. In practice the chance of an undetected upload failure is -very small even with this flag. +These values were determined empirically by observing lots of uploads +of big files for a range of file sizes. +Upload with the "-v" flag to see more info about what rclone is doing +in this situation. Properties: -- Config: no_head -- Env Var: RCLONE_S3_NO_HEAD -- Type: bool -- Default: false +- Config: upload_wait_per_gb +- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB +- Type: Duration +- Default: 3m0s -#### --s3-no-head-object +#### --acd-templink-threshold -If set, do not do HEAD before GET when getting objects. +Files >= this size will be downloaded via their tempLink. + +Files this size or more will be downloaded via their "tempLink". This +is to work around a problem with Amazon Drive which blocks downloads +of files bigger than about 10 GiB. The default for this is 9 GiB which +shouldn't need to be changed. + +To download files above this threshold, rclone requests a "tempLink" +which downloads the file through a temporary URL directly from the +underlying S3 storage. Properties: -- Config: no_head_object -- Env Var: RCLONE_S3_NO_HEAD_OBJECT -- Type: bool -- Default: false +- Config: templink_threshold +- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD +- Type: SizeSuffix +- Default: 9Gi -#### --s3-encoding +#### --acd-encoding The encoding for the backend. @@ -20562,2104 +21701,3920 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_S3_ENCODING -- Type: MultiEncoder +- Env Var: RCLONE_ACD_ENCODING +- Type: Encoding - Default: Slash,InvalidUtf8,Dot -#### --s3-memory-pool-flush-time - -How often internal memory buffer pools will be flushed. -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool. -Properties: +## Limitations -- Config: memory_pool_flush_time -- Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s +Note that Amazon Drive is case insensitive so you can't have a +file called "Hello.doc" and one called "hello.doc". -#### --s3-memory-pool-use-mmap +Amazon Drive has rate limiting so you may notice errors in the +sync (429 errors). rclone will automatically retry the sync up to 3 +times by default (see `--retries` flag) which should hopefully work +around this problem. -Whether to use mmap buffers in internal memory pool. +Amazon Drive has an internal limit of file sizes that can be uploaded +to the service. This limit is not officially published, but all files +larger than this will fail. -Properties: +At the time of writing (Jan 2016) is in the area of 50 GiB per file. +This means that larger files are likely to fail. -- Config: memory_pool_use_mmap -- Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false +Unfortunately there is no way for rclone to see that this failure is +because of file size, so it will retry the operation, as any other +failure. To avoid this problem, use `--max-size 50000M` option to limit +the maximum size of uploaded files. Note that `--max-size` does not split +files into segments, it only ignores files over this size. -#### --s3-disable-http2 +`rclone about` is not supported by the Amazon Drive backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -Disable usage of http2 for S3 backends. +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -There is currently an unsolved issue with the s3 (specifically minio) backend -and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be -disabled here. When the issue is solved this flag will be removed. +# Amazon S3 Storage Providers -See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631 +The S3 backend can be used with a number of different providers: +- AWS S3 +- Alibaba Cloud (Aliyun) Object Storage System (OSS) +- Ceph +- China Mobile Ecloud Elastic Object Storage (EOS) +- Cloudflare R2 +- Arvan Cloud Object Storage (AOS) +- DigitalOcean Spaces +- Dreamhost +- GCS +- Huawei OBS +- IBM COS S3 +- IDrive e2 +- IONOS Cloud +- Leviia Object Storage +- Liara Object Storage +- Linode Object Storage +- Minio +- Petabox +- Qiniu Cloud Object Storage (Kodo) +- RackCorp Object Storage +- Rclone Serve S3 +- Scaleway +- Seagate Lyve Cloud +- SeaweedFS +- StackPath +- Storj +- Synology C2 Object Storage +- Tencent Cloud Object Storage (COS) +- Wasabi -Properties: -- Config: disable_http2 -- Env Var: RCLONE_S3_DISABLE_HTTP2 -- Type: bool -- Default: false +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -#### --s3-download-url +Once you have made a remote (see the provider specific section above) +you can use it like this: -Custom endpoint for downloads. -This is usually set to a CloudFront CDN URL as AWS S3 offers -cheaper egress for data downloaded through the CloudFront network. +See all buckets -Properties: + rclone lsd remote: -- Config: download_url -- Env Var: RCLONE_S3_DOWNLOAD_URL -- Type: string -- Required: false +Make a new bucket -#### --s3-use-multipart-etag + rclone mkdir remote:bucket -Whether to use ETag in multipart uploads for verification +List the contents of a bucket -This should be true, false or left unset to use the default for the provider. + rclone ls remote:bucket +Sync `/home/local/directory` to the remote bucket, deleting any excess +files in the bucket. -Properties: + rclone sync --interactive /home/local/directory remote:bucket -- Config: use_multipart_etag -- Env Var: RCLONE_S3_USE_MULTIPART_ETAG -- Type: Tristate -- Default: unset +## Configuration -#### --s3-use-presigned-request +Here is an example of making an s3 configuration for the AWS S3 provider. +Most applies to the other providers as well, any differences are described [below](#providers). -Whether to use a presigned request or PutObject for single part uploads +First run -If this is false rclone will use PutObject from the AWS SDK to upload -an object. + rclone config -Versions of rclone < 1.59 use presigned requests to upload a single -part object and setting this flag to true will re-enable that -functionality. This shouldn't be necessary except in exceptional -circumstances or for testing. +This will guide you through an interactive setup process. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS + \ "s3" +[snip] +Storage> s3 +Choose your S3 provider. +Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + 2 / Ceph Object Storage + \ "Ceph" + 3 / DigitalOcean Spaces + \ "DigitalOcean" + 4 / Dreamhost DreamObjects + \ "Dreamhost" + 5 / IBM COS S3 + \ "IBMCOS" + 6 / Minio Object Storage + \ "Minio" + 7 / Wasabi Object Storage + \ "Wasabi" + 8 / Any other S3 compatible provider + \ "Other" +provider> 1 +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID - leave blank for anonymous access or runtime credentials. +access_key_id> XXX +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YYY +Region to connect to. +Choose a number from below, or type in your own value + / The default endpoint - a good choice if you are unsure. + 1 | US Region, Northern Virginia, or Pacific Northwest. + | Leave location constraint empty. + \ "us-east-1" + / US East (Ohio) Region + 2 | Needs location constraint us-east-2. + \ "us-east-2" + / US West (Oregon) Region + 3 | Needs location constraint us-west-2. + \ "us-west-2" + / US West (Northern California) Region + 4 | Needs location constraint us-west-1. + \ "us-west-1" + / Canada (Central) Region + 5 | Needs location constraint ca-central-1. + \ "ca-central-1" + / EU (Ireland) Region + 6 | Needs location constraint EU or eu-west-1. + \ "eu-west-1" + / EU (London) Region + 7 | Needs location constraint eu-west-2. + \ "eu-west-2" + / EU (Frankfurt) Region + 8 | Needs location constraint eu-central-1. + \ "eu-central-1" + / Asia Pacific (Singapore) Region + 9 | Needs location constraint ap-southeast-1. + \ "ap-southeast-1" + / Asia Pacific (Sydney) Region +10 | Needs location constraint ap-southeast-2. + \ "ap-southeast-2" + / Asia Pacific (Tokyo) Region +11 | Needs location constraint ap-northeast-1. + \ "ap-northeast-1" + / Asia Pacific (Seoul) +12 | Needs location constraint ap-northeast-2. + \ "ap-northeast-2" + / Asia Pacific (Mumbai) +13 | Needs location constraint ap-south-1. + \ "ap-south-1" + / Asia Pacific (Hong Kong) Region +14 | Needs location constraint ap-east-1. + \ "ap-east-1" + / South America (Sao Paulo) Region +15 | Needs location constraint sa-east-1. + \ "sa-east-1" +region> 1 +Endpoint for S3 API. +Leave blank if using AWS to use the default endpoint for the region. +endpoint> +Location constraint - must be set to match the Region. Used when creating buckets only. +Choose a number from below, or type in your own value + 1 / Empty for US Region, Northern Virginia, or Pacific Northwest. + \ "" + 2 / US East (Ohio) Region. + \ "us-east-2" + 3 / US West (Oregon) Region. + \ "us-west-2" + 4 / US West (Northern California) Region. + \ "us-west-1" + 5 / Canada (Central) Region. + \ "ca-central-1" + 6 / EU (Ireland) Region. + \ "eu-west-1" + 7 / EU (London) Region. + \ "eu-west-2" + 8 / EU Region. + \ "EU" + 9 / Asia Pacific (Singapore) Region. + \ "ap-southeast-1" +10 / Asia Pacific (Sydney) Region. + \ "ap-southeast-2" +11 / Asia Pacific (Tokyo) Region. + \ "ap-northeast-1" +12 / Asia Pacific (Seoul) + \ "ap-northeast-2" +13 / Asia Pacific (Mumbai) + \ "ap-south-1" +14 / Asia Pacific (Hong Kong) + \ "ap-east-1" +15 / South America (Sao Paulo) Region. + \ "sa-east-1" +location_constraint> 1 +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \ "public-read" + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. + 3 | Granting this on a bucket is generally not recommended. + \ "public-read-write" + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. + \ "authenticated-read" + / Object owner gets FULL_CONTROL. Bucket owner gets READ access. + 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ "bucket-owner-read" + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ "bucket-owner-full-control" +acl> 1 +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> 1 +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Reduced redundancy storage class + \ "REDUCED_REDUNDANCY" + 4 / Standard Infrequent Access storage class + \ "STANDARD_IA" + 5 / One Zone Infrequent Access storage class + \ "ONEZONE_IA" + 6 / Glacier storage class + \ "GLACIER" + 7 / Glacier Deep Archive storage class + \ "DEEP_ARCHIVE" + 8 / Intelligent-Tiering storage class + \ "INTELLIGENT_TIERING" + 9 / Glacier Instant Retrieval storage class + \ "GLACIER_IR" +storage_class> 1 +Remote config +-------------------- +[remote] +type = s3 +provider = AWS +env_auth = false +access_key_id = XXX +secret_access_key = YYY +region = us-east-1 +endpoint = +location_constraint = +acl = private +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> +``` -Properties: +### Modification times and hashes -- Config: use_presigned_request -- Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST -- Type: bool -- Default: false +#### Modification times -#### --s3-versions +The modified time is stored as metadata on the object as +`X-Amz-Meta-Mtime` as floating point since the epoch, accurate to 1 ns. -Include old versions in directory listings. +If the modification time needs to be updated rclone will attempt to perform a server +side copy to update the modification if the object can be copied in a single part. +In the case the object is larger than 5Gb or is in Glacier or Glacier Deep Archive +storage the object will be uploaded rather than copied. -Properties: +Note that reading this from the object takes an additional `HEAD` +request as the metadata isn't returned in object listings. -- Config: versions -- Env Var: RCLONE_S3_VERSIONS -- Type: bool -- Default: false +#### Hashes -#### --s3-version-at +For small objects which weren't uploaded as multipart uploads (objects +sized below `--s3-upload-cutoff` if uploaded with rclone) rclone uses +the `ETag:` header as an MD5 checksum. -Show file versions as they were at the specified time. +However for objects which were uploaded as multipart uploads or with +server side encryption (SSE-AWS or SSE-C) the `ETag` header is no +longer the MD5 sum of the data, so rclone adds an additional piece of +metadata `X-Amz-Meta-Md5chksum` which is a base64 encoded MD5 hash (in +the same format as is required for `Content-MD5`). You can use base64 -d and hexdump to check this value manually: -The parameter should be a date, "2006-01-02", datetime "2006-01-02 -15:04:05" or a duration for that long ago, eg "100d" or "1h". + echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump -Note that when using this no file write operations are permitted, -so you can't upload files or delete them. +or you can use `rclone check` to verify the hashes are OK. -See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. +For large objects, calculating this hash can take some time so the +addition of this hash can be disabled with `--s3-disable-checksum`. +This will mean that these objects do not have an MD5 checksum. +Note that reading this from the object takes an additional `HEAD` +request as the metadata isn't returned in object listings. -Properties: +### Reducing costs -- Config: version_at -- Env Var: RCLONE_S3_VERSION_AT -- Type: Time -- Default: off +#### Avoiding HEAD requests to read the modification time -#### --s3-decompress +By default, rclone will use the modification time of objects stored in +S3 for syncing. This is stored in object metadata which unfortunately +takes an extra HEAD request to read which can be expensive (in time +and money). -If set this will decompress gzip encoded objects. +The modification time is used by default for all operations that +require checking the time a file was last updated. It allows rclone to +treat the remote more like a true filesystem, but it is inefficient on +S3 because it requires an extra API call to retrieve the metadata. -It is possible to upload objects to S3 with "Content-Encoding: gzip" -set. Normally rclone will download these files as compressed objects. +The extra API calls can be avoided when syncing (using `rclone sync` +or `rclone copy`) in a few different ways, each with its own +tradeoffs. -If this flag is set then rclone will decompress these files with -"Content-Encoding: gzip" as they are received. This means that rclone -can't check the size and hash but the file contents will be decompressed. +- `--size-only` + - Only checks the size of files. + - Uses no extra transactions. + - If the file doesn't change size then rclone won't detect it has + changed. + - `rclone sync --size-only /path/to/source s3:bucket` +- `--checksum` + - Checks the size and MD5 checksum of files. + - Uses no extra transactions. + - The most accurate detection of changes possible. + - Will cause the source to read an MD5 checksum which, if it is a + local disk, will cause lots of disk activity. + - If the source and destination are both S3 this is the + **recommended** flag to use for maximum efficiency. + - `rclone sync --checksum /path/to/source s3:bucket` +- `--update --use-server-modtime` + - Uses no extra transactions. + - Modification time becomes the time the object was uploaded. + - For many operations this is sufficient to determine if it needs + uploading. + - Using `--update` along with `--use-server-modtime`, avoids the + extra API call and uploads files whose local modification time + is newer than the time it was last uploaded. + - Files created with timestamps in the past will be missed by the sync. + - `rclone sync --update --use-server-modtime /path/to/source s3:bucket` +These flags can and should be used in combination with `--fast-list` - +see below. -Properties: +If using `rclone mount` or any command using the VFS (eg `rclone +serve`) commands then you might want to consider using the VFS flag +`--no-modtime` which will stop rclone reading the modification time +for every object. You could also use `--use-server-modtime` if you are +happy with the modification times of the objects being the time of +upload. -- Config: decompress -- Env Var: RCLONE_S3_DECOMPRESS -- Type: bool -- Default: false +#### Avoiding GET requests to read directory listings -#### --s3-might-gzip +Rclone's default directory traversal is to process each directory +individually. This takes one API call per directory. Using the +`--fast-list` flag will read all info about the objects into +memory first using a smaller number of API calls (one per 1000 +objects). See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. -Set this if the backend might gzip objects. + rclone sync --fast-list --checksum /path/to/source s3:bucket -Normally providers will not alter objects when they are downloaded. If -an object was not uploaded with `Content-Encoding: gzip` then it won't -be set on download. +`--fast-list` trades off API transactions for memory use. As a rough +guide rclone uses 1k of memory per object stored, so using +`--fast-list` on a sync of a million objects will use roughly 1 GiB of +RAM. -However some providers may gzip objects even if they weren't uploaded -with `Content-Encoding: gzip` (eg Cloudflare). +If you are only copying a small number of files into a big repository +then using `--no-traverse` is a good idea. This finds objects directly +instead of through directory listings. You can do a "top-up" sync very +cheaply by using `--max-age` and `--no-traverse` to copy only recent +files, eg -A symptom of this would be receiving errors like + rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket - ERROR corrupted on transfer: sizes differ NNN vs MMM +You'd then do a full `rclone sync` less often. -If you set this flag and rclone downloads an object with -Content-Encoding: gzip set and chunked transfer encoding, then rclone -will decompress the object on the fly. +Note that `--fast-list` isn't required in the top-up sync. -If this is set to unset (the default) then rclone will choose -according to the provider setting what to apply, but you can override -rclone's choice here. +#### Avoiding HEAD requests after PUT +By default, rclone will HEAD every object it uploads. It does this to +check the object got uploaded correctly. -Properties: +You can disable this with the [--s3-no-head](#s3-no-head) option - see +there for more details. -- Config: might_gzip -- Env Var: RCLONE_S3_MIGHT_GZIP -- Type: Tristate -- Default: unset +Setting this flag increases the chance for undetected upload failures. -#### --s3-no-system-metadata +### Versions -Suppress setting and reading of system metadata +When bucket versioning is enabled (this can be done with rclone with +the [`rclone backend versioning`](#versioning) command) when rclone +uploads a new version of a file it creates a +[new version of it](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) +Likewise when you delete a file, the old version will be marked hidden +and still be available. -Properties: +Old versions of files, where available, are visible using the +[`--s3-versions`](#s3-versions) flag. -- Config: no_system_metadata -- Env Var: RCLONE_S3_NO_SYSTEM_METADATA -- Type: bool -- Default: false +It is also possible to view a bucket as it was at a certain point in +time, using the [`--s3-version-at`](#s3-version-at) flag. This will +show the file versions as they were at that time, showing files that +have been deleted afterwards, and hiding files that were created +since. -#### --s3-sts-endpoint +If you wish to remove all the old versions then you can use the +[`rclone backend cleanup-hidden remote:bucket`](#cleanup-hidden) +command which will delete all the old hidden versions of files, +leaving the current ones intact. You can also supply a path and only +old versions under that path will be deleted, e.g. +`rclone backend cleanup-hidden remote:bucket/path/to/stuff`. -Endpoint for STS. +When you `purge` a bucket, the current and the old versions will be +deleted then the bucket will be deleted. -Leave blank if using AWS to use the default endpoint for the region. +However `delete` will cause the current versions of the files to +become hidden old versions. -Properties: +Here is a session showing the listing and retrieval of an old +version followed by a `cleanup` of the old versions. -- Config: sts_endpoint -- Env Var: RCLONE_S3_STS_ENDPOINT -- Provider: AWS -- Type: string -- Required: false +Show current version and all the versions with `--s3-versions` flag. -### Metadata +``` +$ rclone -q ls s3:cleanup-test + 9 one.txt -User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case. +$ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +``` -Here are the possible system metadata items for the s3 backend. +Retrieve an old version -| Name | Help | Type | Example | Read Only | -|------|------|------|---------|-----------| -| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | -| cache-control | Cache-Control header | string | no-cache | N | -| content-disposition | Content-Disposition header | string | inline | N | -| content-encoding | Content-Encoding header | string | gzip | N | -| content-language | Content-Language header | string | en-US | N | -| content-type | Content-Type header | string | text/plain | N | -| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | -| tier | Tier of the object | string | GLACIER | **Y** | +``` +$ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +$ ls -l /tmp/one-v2016-07-04-141003-000.txt +-rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +``` -## Backend commands +Clean up all the old versions and show that they've gone. -Here are the commands specific to the s3 backend. +``` +$ rclone -q backend cleanup-hidden s3:cleanup-test -Run them with +$ rclone -q ls s3:cleanup-test + 9 one.txt - rclone backend COMMAND remote: +$ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt +``` -The help below will explain what arguments each command takes. +#### Versions naming caveat -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +When using `--s3-versions` flag rclone is relying on the file name +to work out whether the objects are versions or not. Versions' names +are created by inserting timestamp between file name and its extension. +``` + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt +``` +If there are real files present with the same names as versions, then +behaviour of `--s3-versions` can be unpredictable. -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +### Cleanup -### restore +If you run `rclone cleanup s3:bucket` then it will remove all pending +multipart uploads older than 24 hours. You can use the `--interactive`/`i` +or `--dry-run` flag to see exactly what it will do. If you want more control over the +expiry date then run `rclone backend cleanup s3:bucket -o max-age=1h` +to expire all uploads older than one hour. You can use `rclone backend +list-multipart-uploads s3:bucket` to see the pending multipart +uploads. -Restore objects from GLACIER to normal storage +### Restricted filename characters - rclone backend restore remote: [options] [+] +S3 allows any valid UTF-8 string as a key. -This command can be used to restore one or more objects from GLACIER -to normal storage. +Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), as +they can't be used in XML. -Usage Examples: +The following characters are replaced since these are problematic when +dealing with the REST API: - rclone backend restore s3:bucket/path/to/object [-o priority=PRIORITY] [-o lifetime=DAYS] - rclone backend restore s3:bucket/path/to/directory [-o priority=PRIORITY] [-o lifetime=DAYS] - rclone backend restore s3:bucket [-o priority=PRIORITY] [-o lifetime=DAYS] +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | -This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags +The encoding will also encode these file names as they don't seem to +work with the SDK properly: - rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard +| File name | Replacement | +| --------- |:-----------:| +| . | . | +| .. | .. | -All the objects shown will be marked for restore, then +### Multipart uploads - rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard +rclone supports multipart uploads with S3 which means that it can +upload files bigger than 5 GiB. -It returns a list of status dictionaries with Remote and Status -keys. The Status will be OK if it was successful or an error message -if not. +Note that files uploaded *both* with multipart upload *and* through +crypt remotes do not have MD5 sums. - [ - { - "Status": "OK", - "Path": "test.txt" - }, - { - "Status": "OK", - "Path": "test/file4.txt" - } - ] +rclone switches from single part uploads to multipart uploads at the +point specified by `--s3-upload-cutoff`. This can be a maximum of 5 GiB +and a minimum of 0 (ie always upload multipart files). +The chunk sizes used in the multipart upload are specified by +`--s3-chunk-size` and the number of chunks uploaded concurrently is +specified by `--s3-upload-concurrency`. +Multipart uploads will use `--transfers` * `--s3-upload-concurrency` * +`--s3-chunk-size` extra memory. Single part uploads to not use extra +memory. -Options: +Single part transfers can be faster than multipart transfers or slower +depending on your latency from S3 - the more latency, the more likely +single part transfers will be faster. -- "description": The optional description for the job. -- "lifetime": Lifetime of the active copy in days -- "priority": Priority of restore: Standard|Expedited|Bulk +Increasing `--s3-upload-concurrency` will increase throughput (8 would +be a sensible value) and increasing `--s3-chunk-size` also increases +throughput (16M would be sensible). Increasing either of these will +use more memory. The default values are high enough to gain most of +the possible performance without using too much memory. -### list-multipart-uploads -List the unfinished multipart uploads +### Buckets and Regions - rclone backend list-multipart-uploads remote: [options] [+] +With Amazon S3 you can list buckets (`rclone lsd`) using any region, +but you can only access the content of a bucket from the region it was +created in. If you attempt to access a bucket from the wrong region, +you will get an error, `incorrect region, the bucket is not in 'XXX' +region`. -This command lists the unfinished multipart uploads in JSON format. +### Authentication - rclone backend list-multipart s3:bucket/path/to/object +There are a number of ways to supply `rclone` with a set of AWS +credentials, with and without using the environment. -It returns a dictionary of buckets with values as lists of unfinished -multipart uploads. +The different authentication methods are tried in this order: -You can call it with no bucket in which case it lists all bucket, with -a bucket or with a bucket and path. + - Directly in the rclone configuration file (`env_auth = false` in the config file): + - `access_key_id` and `secret_access_key` are required. + - `session_token` can be optionally set when using AWS STS. + - Runtime configuration (`env_auth = true` in the config file): + - Export the following environment variables before running `rclone`: + - Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` + - Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` + - Session Token: `AWS_SESSION_TOKEN` (optional) + - Or, use a [named profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html): + - Profile files are standard files used by AWS CLI tools + - By default it will use the profile in your home directory (e.g. `~/.aws/credentials` on unix based systems) file and the "default" profile, to change set these environment variables: + - `AWS_SHARED_CREDENTIALS_FILE` to control which file. + - `AWS_PROFILE` to control which profile to use. + - Or, run `rclone` in an ECS task with an IAM role (AWS only). + - Or, run `rclone` on an EC2 instance with an IAM role (AWS only). + - Or, run `rclone` in an EKS pod with an IAM role that is associated with a service account (AWS only). - { - "rclone": [ - { - "Initiated": "2020-06-26T14:20:36Z", - "Initiator": { - "DisplayName": "XXX", - "ID": "arn:aws:iam::XXX:user/XXX" - }, - "Key": "KEY", - "Owner": { - "DisplayName": null, - "ID": "XXX" - }, - "StorageClass": "STANDARD", - "UploadId": "XXX" - } - ], - "rclone-1000files": [], - "rclone-dst": [] - } +If none of these option actually end up providing `rclone` with AWS +credentials then S3 interaction will be non-authenticated (see below). +### S3 Permissions +When using the `sync` subcommand of `rclone` the following minimum +permissions are required to be available on the bucket being written to: -### cleanup +* `ListBucket` +* `DeleteObject` +* `GetObject` +* `PutObject` +* `PutObjectACL` -Remove unfinished multipart uploads. +When using the `lsd` subcommand, the `ListAllMyBuckets` permission is required. - rclone backend cleanup remote: [options] [+] +Example policy: -This command removes unfinished multipart uploads of age greater than -max-age which defaults to 24 hours. +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::USER_SID:user/USER_NAME" + }, + "Action": [ + "s3:ListBucket", + "s3:DeleteObject", + "s3:GetObject", + "s3:PutObject", + "s3:PutObjectAcl" + ], + "Resource": [ + "arn:aws:s3:::BUCKET_NAME/*", + "arn:aws:s3:::BUCKET_NAME" + ] + }, + { + "Effect": "Allow", + "Action": "s3:ListAllMyBuckets", + "Resource": "arn:aws:s3:::*" + } + ] +} +``` -Note that you can use --interactive/-i or --dry-run with this command to see what -it would do. +Notes on above: - rclone backend cleanup s3:bucket/path/to/object - rclone backend cleanup -o max-age=7w s3:bucket/path/to/object +1. This is a policy that can be used when creating bucket. It assumes + that `USER_NAME` has been created. +2. The Resource entry must include both resource ARNs, as one implies + the bucket and the other implies the bucket's objects. -Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. +For reference, [here's an Ansible script](https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) +that will generate one or more buckets that will work with `rclone sync`. +### Key Management System (KMS) -Options: +If you are using server-side encryption with KMS then you must make +sure rclone is configured with `server_side_encryption = aws:kms` +otherwise you will find you can't transfer small objects - these will +create checksum errors. -- "max-age": Max age of upload to delete +### Glacier and Glacier Deep Archive -### cleanup-hidden +You can upload objects using the glacier storage class or transition them to glacier using a [lifecycle policy](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html). +The bucket can still be synced or copied into normally, but if rclone +tries to access data from the glacier storage class you will see an error like below. -Remove old versions of files. + 2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file - rclone backend cleanup-hidden remote: [options] [+] +In this case you need to [restore](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/restore-archived-objects.html) +the object(s) in question before using rclone. -This command removes any old hidden versions of files -on a versions enabled bucket. +Note that rclone only speaks the S3 API it does not speak the Glacier +Vault API, so rclone cannot directly access Glacier Vaults. -Note that you can use --interactive/-i or --dry-run with this command to see what -it would do. +### Object-lock enabled S3 bucket - rclone backend cleanup-hidden s3:bucket/path/to/dir +According to AWS's [documentation on S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-permission): +> If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header. -### versioning +As mentioned in the [Modification times and hashes](#modification-times-and-hashes) section, +small files that are not uploaded as multipart, use a different tag, causing the upload to fail. +A simple solution is to set the `--s3-upload-cutoff 0` and force all the files to be uploaded as multipart. -Set/get versioning support for a bucket. - rclone backend versioning remote: [options] [+] +### Standard options -This command sets versioning support if a parameter is -passed and then returns the current versioning status for the bucket -supplied. +Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others). - rclone backend versioning s3:bucket # read status only - rclone backend versioning s3:bucket Enabled - rclone backend versioning s3:bucket Suspended +#### --s3-provider -It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning -has been enabled the status can't be set back to "Unversioned". +Choose your S3 provider. +Properties: +- Config: provider +- Env Var: RCLONE_S3_PROVIDER +- Type: string +- Required: false +- Examples: + - "AWS" + - Amazon Web Services (AWS) S3 + - "Alibaba" + - Alibaba Cloud Object Storage System (OSS) formerly Aliyun + - "ArvanCloud" + - Arvan Cloud Object Storage (AOS) + - "Ceph" + - Ceph Object Storage + - "ChinaMobile" + - China Mobile Ecloud Elastic Object Storage (EOS) + - "Cloudflare" + - Cloudflare R2 Storage + - "DigitalOcean" + - DigitalOcean Spaces + - "Dreamhost" + - Dreamhost DreamObjects + - "GCS" + - Google Cloud Storage + - "HuaweiOBS" + - Huawei Object Storage Service + - "IBMCOS" + - IBM COS S3 + - "IDrive" + - IDrive e2 + - "IONOS" + - IONOS Cloud + - "LyveCloud" + - Seagate Lyve Cloud + - "Leviia" + - Leviia Object Storage + - "Liara" + - Liara Object Storage + - "Linode" + - Linode Object Storage + - "Minio" + - Minio Object Storage + - "Netease" + - Netease Object Storage (NOS) + - "Petabox" + - Petabox Object Storage + - "RackCorp" + - RackCorp Object Storage + - "Rclone" + - Rclone S3 Server + - "Scaleway" + - Scaleway Object Storage + - "SeaweedFS" + - SeaweedFS S3 + - "StackPath" + - StackPath Object Storage + - "Storj" + - Storj (S3 Compatible Gateway) + - "Synology" + - Synology C2 Object Storage + - "TencentCOS" + - Tencent Cloud Object Storage (COS) + - "Wasabi" + - Wasabi Object Storage + - "Qiniu" + - Qiniu Object Storage (Kodo) + - "Other" + - Any other S3 compatible provider +#### --s3-env-auth -### Anonymous access to public buckets +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -If you want to use rclone to access a public bucket, configure with a -blank `access_key_id` and `secret_access_key`. Your config should end -up looking like this: +Only applies if access_key_id and secret_access_key is blank. -``` -[anons3] -type = s3 -provider = AWS -env_auth = false -access_key_id = -secret_access_key = -region = us-east-1 -endpoint = -location_constraint = -acl = private -server_side_encryption = -storage_class = -``` +Properties: -Then use it as normal with the name of the public bucket, e.g. +- Config: env_auth +- Env Var: RCLONE_S3_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter AWS credentials in the next step. + - "true" + - Get AWS credentials from the environment (env vars or IAM). - rclone lsd anons3:1000genomes +#### --s3-access-key-id -You will be able to list and copy data but not upload it. +AWS Access Key ID. -## Providers +Leave blank for anonymous access or runtime credentials. -### AWS S3 +Properties: -This is the provider used as main example and described in the [configuration](#configuration) section above. +- Config: access_key_id +- Env Var: RCLONE_S3_ACCESS_KEY_ID +- Type: string +- Required: false -### AWS Snowball Edge +#### --s3-secret-access-key -[AWS Snowball](https://aws.amazon.com/snowball/) is a hardware -appliance used for transferring bulk data back to AWS. Its main -software interface is S3 object storage. +AWS Secret Access Key (password). -To use rclone with AWS Snowball Edge devices, configure as standard -for an 'S3 Compatible Service'. +Leave blank for anonymous access or runtime credentials. -If using rclone pre v1.59 be sure to set `upload_cutoff = 0` otherwise -you will run into authentication header issues as the snowball device -does not support query parameter based authentication. +Properties: -With rclone v1.59 or later setting `upload_cutoff` should not be necessary. +- Config: secret_access_key +- Env Var: RCLONE_S3_SECRET_ACCESS_KEY +- Type: string +- Required: false -eg. -``` -[snowball] -type = s3 -provider = Other -access_key_id = YOUR_ACCESS_KEY -secret_access_key = YOUR_SECRET_KEY -endpoint = http://[IP of Snowball]:8080 -upload_cutoff = 0 -``` +#### --s3-region -### Ceph +Region to connect to. -[Ceph](https://ceph.com/) is an open-source, unified, distributed -storage system designed for excellent performance, reliability and -scalability. It has an S3 compatible object storage interface. +Properties: -To use rclone with Ceph, configure as above but leave the region blank -and set the endpoint. You should end up with something like this in -your config: +- Config: region +- Env Var: RCLONE_S3_REGION +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "us-east-1" + - The default endpoint - a good choice if you are unsure. + - US Region, Northern Virginia, or Pacific Northwest. + - Leave location constraint empty. + - "us-east-2" + - US East (Ohio) Region. + - Needs location constraint us-east-2. + - "us-west-1" + - US West (Northern California) Region. + - Needs location constraint us-west-1. + - "us-west-2" + - US West (Oregon) Region. + - Needs location constraint us-west-2. + - "ca-central-1" + - Canada (Central) Region. + - Needs location constraint ca-central-1. + - "eu-west-1" + - EU (Ireland) Region. + - Needs location constraint EU or eu-west-1. + - "eu-west-2" + - EU (London) Region. + - Needs location constraint eu-west-2. + - "eu-west-3" + - EU (Paris) Region. + - Needs location constraint eu-west-3. + - "eu-north-1" + - EU (Stockholm) Region. + - Needs location constraint eu-north-1. + - "eu-south-1" + - EU (Milan) Region. + - Needs location constraint eu-south-1. + - "eu-central-1" + - EU (Frankfurt) Region. + - Needs location constraint eu-central-1. + - "ap-southeast-1" + - Asia Pacific (Singapore) Region. + - Needs location constraint ap-southeast-1. + - "ap-southeast-2" + - Asia Pacific (Sydney) Region. + - Needs location constraint ap-southeast-2. + - "ap-northeast-1" + - Asia Pacific (Tokyo) Region. + - Needs location constraint ap-northeast-1. + - "ap-northeast-2" + - Asia Pacific (Seoul). + - Needs location constraint ap-northeast-2. + - "ap-northeast-3" + - Asia Pacific (Osaka-Local). + - Needs location constraint ap-northeast-3. + - "ap-south-1" + - Asia Pacific (Mumbai). + - Needs location constraint ap-south-1. + - "ap-east-1" + - Asia Pacific (Hong Kong) Region. + - Needs location constraint ap-east-1. + - "sa-east-1" + - South America (Sao Paulo) Region. + - Needs location constraint sa-east-1. + - "me-south-1" + - Middle East (Bahrain) Region. + - Needs location constraint me-south-1. + - "af-south-1" + - Africa (Cape Town) Region. + - Needs location constraint af-south-1. + - "cn-north-1" + - China (Beijing) Region. + - Needs location constraint cn-north-1. + - "cn-northwest-1" + - China (Ningxia) Region. + - Needs location constraint cn-northwest-1. + - "us-gov-east-1" + - AWS GovCloud (US-East) Region. + - Needs location constraint us-gov-east-1. + - "us-gov-west-1" + - AWS GovCloud (US) Region. + - Needs location constraint us-gov-west-1. +#### --s3-endpoint -``` -[ceph] -type = s3 -provider = Ceph -env_auth = false -access_key_id = XXX -secret_access_key = YYY -region = -endpoint = https://ceph.endpoint.example.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +Endpoint for S3 API. -If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a -version of rclone before v1.59 then you may need to supply the -parameter `--s3-upload-cutoff 0` or put this in the config file as -`upload_cutoff 0` to work around a bug which causes uploading of small -files to fail. +Leave blank if using AWS to use the default endpoint for the region. -Note also that Ceph sometimes puts `/` in the passwords it gives -users. If you read the secret access key using the command line tools -you will get a JSON blob with the `/` escaped as `\/`. Make sure you -only write `/` in the secret access key. +Properties: -Eg the dump from Ceph looks something like this (irrelevant keys -removed). +- Config: endpoint +- Env Var: RCLONE_S3_ENDPOINT +- Provider: AWS +- Type: string +- Required: false -``` -{ - "user_id": "xxx", - "display_name": "xxxx", - "keys": [ - { - "user": "xxx", - "access_key": "xxxxxx", - "secret_key": "xxxxxx\/xxxx" - } - ], -} -``` +#### --s3-location-constraint -Because this is a json dump, it is encoding the `/` as `\/`, so if you -use the secret key as `xxxxxx/xxxx` it will work fine. +Location constraint - must be set to match the Region. -### Cloudflare R2 {#cloudflare-r2} +Used when creating buckets only. -[Cloudflare R2](https://blog.cloudflare.com/r2-open-beta/) Storage -allows developers to store large amounts of unstructured data without -the costly egress bandwidth fees associated with typical cloud storage -services. +Properties: -Here is an example of making a Cloudflare R2 configuration. First run: +- Config: location_constraint +- Env Var: RCLONE_S3_LOCATION_CONSTRAINT +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "" + - Empty for US Region, Northern Virginia, or Pacific Northwest + - "us-east-2" + - US East (Ohio) Region + - "us-west-1" + - US West (Northern California) Region + - "us-west-2" + - US West (Oregon) Region + - "ca-central-1" + - Canada (Central) Region + - "eu-west-1" + - EU (Ireland) Region + - "eu-west-2" + - EU (London) Region + - "eu-west-3" + - EU (Paris) Region + - "eu-north-1" + - EU (Stockholm) Region + - "eu-south-1" + - EU (Milan) Region + - "EU" + - EU Region + - "ap-southeast-1" + - Asia Pacific (Singapore) Region + - "ap-southeast-2" + - Asia Pacific (Sydney) Region + - "ap-northeast-1" + - Asia Pacific (Tokyo) Region + - "ap-northeast-2" + - Asia Pacific (Seoul) Region + - "ap-northeast-3" + - Asia Pacific (Osaka-Local) Region + - "ap-south-1" + - Asia Pacific (Mumbai) Region + - "ap-east-1" + - Asia Pacific (Hong Kong) Region + - "sa-east-1" + - South America (Sao Paulo) Region + - "me-south-1" + - Middle East (Bahrain) Region + - "af-south-1" + - Africa (Cape Town) Region + - "cn-north-1" + - China (Beijing) Region + - "cn-northwest-1" + - China (Ningxia) Region + - "us-gov-east-1" + - AWS GovCloud (US-East) Region + - "us-gov-west-1" + - AWS GovCloud (US) Region - rclone config +#### --s3-acl -This will guide you through an interactive setup process. +Canned ACL used when creating buckets and storing or copying objects. -Note that all buckets are private, and all are stored in the same -"auto" region. It is necessary to use Cloudflare workers to share the -content of a bucket publicly. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> r2 -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -... -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi - \ (s3) -... -Storage> s3 -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -... -XX / Cloudflare R2 Storage - \ (Cloudflare) -... -provider> Cloudflare -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> ACCESS_KEY -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> SECRET_ACCESS_KEY -Option region. -Region to connect to. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. - \ (auto) -region> 1 -Option endpoint. -Endpoint for S3 API. -Required when using an S3 clone. -Enter a value. Press Enter to leave empty. -endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -This will leave your config looking something like: +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. -``` -[r2] -type = s3 -provider = Cloudflare -access_key_id = ACCESS_KEY -secret_access_key = SECRET_ACCESS_KEY -region = auto -endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com -acl = private -``` +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. -Now run `rclone lsf r2:` to see your buckets and `rclone lsf -r2:bucket` to look within a bucket. -### Dreamhost +Properties: -Dreamhost [DreamObjects](https://www.dreamhost.com/cloud/storage/) is -an object storage system based on CEPH. +- Config: acl +- Env Var: RCLONE_S3_ACL +- Provider: !Storj,Synology,Cloudflare +- Type: string +- Required: false +- Examples: + - "default" + - Owner gets Full_CONTROL. + - No one else has access rights (default). + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - Granting this on a bucket is generally not recommended. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. + - "bucket-owner-read" + - Object owner gets FULL_CONTROL. + - Bucket owner gets READ access. + - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + - "bucket-owner-full-control" + - Both the object owner and the bucket owner get FULL_CONTROL over the object. + - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS. + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - This acl is available on IBM Cloud (Infra), On-Premise IBM COS. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. + - Not supported on Buckets. + - This acl is available on IBM Cloud (Infra) and On-Premise IBM COS. -To use rclone with Dreamhost, configure as above but leave the region blank -and set the endpoint. You should end up with something like this in -your config: +#### --s3-server-side-encryption -``` -[dreamobjects] -type = s3 -provider = DreamHost -env_auth = false -access_key_id = your_access_key -secret_access_key = your_secret_key -region = -endpoint = objects-us-west-1.dream.io -location_constraint = -acl = private -server_side_encryption = -storage_class = -``` +The server-side encryption algorithm used when storing this object in S3. -### DigitalOcean Spaces +Properties: -[Spaces](https://www.digitalocean.com/products/object-storage/) is an [S3-interoperable](https://developers.digitalocean.com/documentation/spaces/) object storage service from cloud provider DigitalOcean. +- Config: server_side_encryption +- Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "AES256" + - AES256 + - "aws:kms" + - aws:kms -To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "[Applications & API](https://cloud.digitalocean.com/settings/api/tokens)" page of the DigitalOcean control panel. They will be needed when prompted by `rclone config` for your `access_key_id` and `secret_access_key`. +#### --s3-sse-kms-key-id -When prompted for a `region` or `location_constraint`, press enter to use the default value. The region must be included in the `endpoint` setting (e.g. `nyc3.digitaloceanspaces.com`). The default values can be used for other settings. +If using KMS ID you must provide the ARN of Key. -Going through the whole process of creating a new remote by running `rclone config`, each prompt should be answered as shown below: +Properties: -``` -Storage> s3 -env_auth> 1 -access_key_id> YOUR_ACCESS_KEY -secret_access_key> YOUR_SECRET_KEY -region> -endpoint> nyc3.digitaloceanspaces.com -location_constraint> -acl> -storage_class> -``` +- Config: sse_kms_key_id +- Env Var: RCLONE_S3_SSE_KMS_KEY_ID +- Provider: AWS,Ceph,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "arn:aws:kms:us-east-1:*" + - arn:aws:kms:* -The resulting configuration file should look like: +#### --s3-storage-class -``` -[spaces] -type = s3 -provider = DigitalOcean -env_auth = false -access_key_id = YOUR_ACCESS_KEY -secret_access_key = YOUR_SECRET_KEY -region = -endpoint = nyc3.digitaloceanspaces.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +The storage class to use when storing new objects in S3. -Once configured, you can create a new Space and begin copying files. For example: +Properties: -``` -rclone mkdir spaces:my-new-space -rclone copy /path/to/files spaces:my-new-space -``` -### Huawei OBS {#huawei-obs} +- Config: storage_class +- Env Var: RCLONE_S3_STORAGE_CLASS +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "" + - Default + - "STANDARD" + - Standard storage class + - "REDUCED_REDUNDANCY" + - Reduced redundancy storage class + - "STANDARD_IA" + - Standard Infrequent Access storage class + - "ONEZONE_IA" + - One Zone Infrequent Access storage class + - "GLACIER" + - Glacier storage class + - "DEEP_ARCHIVE" + - Glacier Deep Archive storage class + - "INTELLIGENT_TIERING" + - Intelligent-Tiering storage class + - "GLACIER_IR" + - Glacier Instant Retrieval storage class -Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere. +### Advanced options -OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file. -``` -[obs] -type = s3 -provider = HuaweiOBS -access_key_id = your-access-key-id -secret_access_key = your-secret-access-key -region = af-south-1 -endpoint = obs.af-south-1.myhuaweicloud.com -acl = private -``` +Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others). -Or you can also configure via the interactive command line: -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> obs -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi - \ (s3) -[snip] -Storage> 5 -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] - 9 / Huawei Object Storage Service - \ (HuaweiOBS) -[snip] -provider> 9 -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> your-access-key-id -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> your-secret-access-key -Option region. -Region to connect to. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / AF-Johannesburg - \ (af-south-1) - 2 / AP-Bangkok - \ (ap-southeast-2) -[snip] -region> 1 -Option endpoint. -Endpoint for OBS API. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / AF-Johannesburg - \ (obs.af-south-1.myhuaweicloud.com) - 2 / AP-Bangkok - \ (obs.ap-southeast-2.myhuaweicloud.com) -[snip] -endpoint> 1 -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) -[snip] -acl> 1 -Edit advanced config? -y) Yes -n) No (default) -y/n> --------------------- -[obs] -type = s3 -provider = HuaweiOBS -access_key_id = your-access-key-id -secret_access_key = your-secret-access-key -region = af-south-1 -endpoint = obs.af-south-1.myhuaweicloud.com -acl = private --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +#### --s3-bucket-acl -Name Type -==== ==== -obs s3 +Canned ACL used when creating buckets. -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q -``` +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -### IBM COS (S3) +Note that this ACL is applied when only when creating buckets. If it +isn't set then "acl" is used instead. -Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage) +If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: +header is added and the default (private) will be used. -To configure access to IBM COS S3, follow the steps below: -1. Run rclone config and select n for a new remote. -``` - 2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n -``` +Properties: -2. Enter the name for the configuration -``` - name> -``` +- Config: bucket_acl +- Env Var: RCLONE_S3_BUCKET_ACL +- Type: string +- Required: false +- Examples: + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - Granting this on a bucket is generally not recommended. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. -3. Select "s3" storage. -``` -Choose a number from below, or type in your own value - 1 / Alias for an existing remote - \ "alias" - 2 / Amazon Drive - \ "amazon cloud drive" - 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) - \ "s3" - 4 / Backblaze B2 - \ "b2" -[snip] - 23 / HTTP - \ "http" -Storage> 3 -``` +#### --s3-requester-pays -4. Select IBM COS as the S3 Storage Provider. -``` -Choose the S3 provider. -Choose a number from below, or type in your own value - 1 / Choose this option to configure Storage to AWS S3 - \ "AWS" - 2 / Choose this option to configure Storage to Ceph Systems - \ "Ceph" - 3 / Choose this option to configure Storage to Dreamhost - \ "Dreamhost" - 4 / Choose this option to the configure Storage to IBM COS S3 - \ "IBMCOS" - 5 / Choose this option to the configure Storage to Minio - \ "Minio" - Provider>4 -``` +Enables requester pays option when interacting with S3 bucket. -5. Enter the Access Key and Secret. -``` - AWS Access Key ID - leave blank for anonymous access or runtime credentials. - access_key_id> <> - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> <> -``` +Properties: -6. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address. -``` - Endpoint for IBM COS S3 API. - Specify if using an IBM COS On Premise. - Choose a number from below, or type in your own value - 1 / US Cross Region Endpoint - \ "s3-api.us-geo.objectstorage.softlayer.net" - 2 / US Cross Region Dallas Endpoint - \ "s3-api.dal.us-geo.objectstorage.softlayer.net" - 3 / US Cross Region Washington DC Endpoint - \ "s3-api.wdc-us-geo.objectstorage.softlayer.net" - 4 / US Cross Region San Jose Endpoint - \ "s3-api.sjc-us-geo.objectstorage.softlayer.net" - 5 / US Cross Region Private Endpoint - \ "s3-api.us-geo.objectstorage.service.networklayer.com" - 6 / US Cross Region Dallas Private Endpoint - \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com" - 7 / US Cross Region Washington DC Private Endpoint - \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com" - 8 / US Cross Region San Jose Private Endpoint - \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com" - 9 / US Region East Endpoint - \ "s3.us-east.objectstorage.softlayer.net" - 10 / US Region East Private Endpoint - \ "s3.us-east.objectstorage.service.networklayer.com" - 11 / US Region South Endpoint -[snip] - 34 / Toronto Single Site Private Endpoint - \ "s3.tor01.objectstorage.service.networklayer.com" - endpoint>1 -``` +- Config: requester_pays +- Env Var: RCLONE_S3_REQUESTER_PAYS +- Provider: AWS +- Type: bool +- Default: false +#### --s3-sse-customer-algorithm -7. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter -``` - 1 / US Cross Region Standard - \ "us-standard" - 2 / US Cross Region Vault - \ "us-vault" - 3 / US Cross Region Cold - \ "us-cold" - 4 / US Cross Region Flex - \ "us-flex" - 5 / US East Region Standard - \ "us-east-standard" - 6 / US East Region Vault - \ "us-east-vault" - 7 / US East Region Cold - \ "us-east-cold" - 8 / US East Region Flex - \ "us-east-flex" - 9 / US South Region Standard - \ "us-south-standard" - 10 / US South Region Vault - \ "us-south-vault" -[snip] - 32 / Toronto Flex - \ "tor01-flex" -location_constraint>1 -``` +If using SSE-C, the server-side encryption algorithm used when storing this object in S3. -9. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs. -``` -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS - \ "public-read" - 3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS - \ "public-read-write" - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS - \ "authenticated-read" -acl> 1 -``` +Properties: +- Config: sse_customer_algorithm +- Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "AES256" + - AES256 -12. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this -``` - [xxx] - type = s3 - Provider = IBMCOS - access_key_id = xxx - secret_access_key = yyy - endpoint = s3-api.us-geo.objectstorage.softlayer.net - location_constraint = us-standard - acl = private -``` +#### --s3-sse-customer-key -13. Execute rclone commands -``` - 1) Create a bucket. - rclone mkdir IBM-COS-XREGION:newbucket - 2) List available buckets. - rclone lsd IBM-COS-XREGION: - -1 2017-11-08 21:16:22 -1 test - -1 2018-02-14 20:16:39 -1 newbucket - 3) List contents of a bucket. - rclone ls IBM-COS-XREGION:newbucket - 18685952 test.exe - 4) Copy a file from local to remote. - rclone copy /Users/file.txt IBM-COS-XREGION:newbucket - 5) Copy a file from remote to local. - rclone copy IBM-COS-XREGION:newbucket/file.txt . - 6) Delete a file on remote. - rclone delete IBM-COS-XREGION:newbucket/file.txt -``` +To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data. -### IDrive e2 {#idrive-e2} +Alternatively you can provide --sse-customer-key-base64. -Here is an example of making an [IDrive e2](https://www.idrive.com/e2/) -configuration. First run: +Properties: - rclone config +- Config: sse_customer_key +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None -This will guide you through an interactive setup process. +#### --s3-sse-customer-key-base64 -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n +If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data. -Enter name for new remote. -name> e2 +Alternatively you can provide --sse-customer-key. -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi - \ (s3) -[snip] -Storage> s3 +Properties: -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / IDrive e2 - \ (IDrive) -[snip] -provider> IDrive +- Config: sse_customer_key_base64 +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64 +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> +#### --s3-sse-customer-key-md5 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> YOUR_ACCESS_KEY +If using SSE-C you may provide the secret encryption key MD5 checksum (optional). -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YOUR_SECRET_KEY +If you leave it blank, this is calculated automatically from the sse_customer_key provided. -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. - 5 | Bucket owner gets READ access. - | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-read) - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-full-control) -acl> -Edit advanced config? -y) Yes -n) No (default) -y/n> +Properties: -Configuration complete. -Options: -- type: s3 -- provider: IDrive -- access_key_id: YOUR_ACCESS_KEY -- secret_access_key: YOUR_SECRET_KEY -- endpoint: q9d9.la12.idrivee2-5.com -Keep this "e2" remote? -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: sse_customer_key_md5 +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5 +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None -### IONOS Cloud {#ionos} +#### --s3-upload-cutoff -[IONOS S3 Object Storage](https://cloud.ionos.com/storage/object-storage) is a service offered by IONOS for storing and accessing unstructured data. -To connect to the service, you will need an access key and a secret key. These can be found in the [Data Center Designer](https://dcd.ionos.com/), by selecting **Manager resources** > **Object Storage Key Manager**. +Cutoff for switching to chunked upload. +Any files larger than this will be uploaded in chunks of chunk_size. +The minimum is 0 and the maximum is 5 GiB. -Here is an example of a configuration. First, run `rclone config`. This will walk you through an interactive setup process. Type `n` to add the new remote, and then enter a name: +Properties: -``` -Enter name for new remote. -name> ionos-fra -``` +- Config: upload_cutoff +- Env Var: RCLONE_S3_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 200Mi -Type `s3` to choose the connection type: -``` -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi - \ (s3) -[snip] -Storage> s3 -``` +#### --s3-chunk-size -Type `IONOS`: -``` -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / IONOS Cloud - \ (IONOS) -[snip] -provider> IONOS -``` +Chunk size to use for uploading. -Press Enter to choose the default option `Enter AWS credentials in the next step`: -``` -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> -``` +When uploading files larger than upload_cutoff or files with unknown +size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google +photos or google docs) they will be uploaded as multipart uploads +using this chunk size. -Enter your Access Key and Secret key. These can be retrieved in the [Data Center Designer](https://dcd.ionos.com/), click on the menu “Manager resources” / "Object Storage Key Manager". -``` -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> YOUR_ACCESS_KEY +Note that "--s3-upload-concurrency" chunks of this size are buffered +in memory per transfer. -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YOUR_SECRET_KEY -``` +If you are transferring large files over high-speed links and you have +enough memory, then increasing this will speed up the transfers. -Choose the region where your bucket is located: -``` -Option region. -Region where your bucket will be created and your data stored. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Frankfurt, Germany - \ (de) - 2 / Berlin, Germany - \ (eu-central-2) - 3 / Logrono, Spain - \ (eu-south-2) -region> 2 -``` +Rclone will automatically increase the chunk size when uploading a +large file of known size to stay below the 10,000 chunks limit. -Choose the endpoint from the same region: -``` -Option endpoint. -Endpoint for IONOS S3 Object Storage. -Specify the endpoint from the same region. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Frankfurt, Germany - \ (s3-eu-central-1.ionoscloud.com) - 2 / Berlin, Germany - \ (s3-eu-central-2.ionoscloud.com) - 3 / Logrono, Spain - \ (s3-eu-south-2.ionoscloud.com) -endpoint> 1 -``` +Files of unknown size are uploaded with the configured +chunk_size. Since the default chunk size is 5 MiB and there can be at +most 10,000 chunks, this means that by default the maximum size of +a file you can stream upload is 48 GiB. If you wish to stream upload +larger files then you will need to increase chunk_size. -Press Enter to choose the default option or choose the desired ACL setting: -``` -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. -[snip] -acl> -``` +Increasing the chunk size decreases the accuracy of the progress +statistics displayed with "-P" flag. Rclone treats chunk as sent when +it's buffered by the AWS SDK, when in fact it may still be uploading. +A bigger chunk size means a bigger AWS SDK buffer and progress +reporting more deviating from the truth. -Press Enter to skip the advanced config: -``` -Edit advanced config? -y) Yes -n) No (default) -y/n> -``` -Press Enter to save the configuration, and then `q` to quit the configuration process: -``` -Configuration complete. -Options: -- type: s3 -- provider: IONOS -- access_key_id: YOUR_ACCESS_KEY -- secret_access_key: YOUR_SECRET_KEY -- endpoint: s3-eu-central-1.ionoscloud.com -Keep this "ionos-fra" remote? -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Properties: -Done! Now you can try some commands (for macOS, use `./rclone` instead of `rclone`). +- Config: chunk_size +- Env Var: RCLONE_S3_CHUNK_SIZE +- Type: SizeSuffix +- Default: 5Mi -1) Create a bucket (the name must be unique within the whole IONOS S3) -``` -rclone mkdir ionos-fra:my-bucket -``` -2) List available buckets -``` -rclone lsd ionos-fra: -``` -4) Copy a file from local to remote -``` -rclone copy /Users/file.txt ionos-fra:my-bucket -``` -3) List contents of a bucket -``` -rclone ls ionos-fra:my-bucket -``` -5) Copy a file from remote to local -``` -rclone copy ionos-fra:my-bucket/file.txt -``` +#### --s3-max-upload-parts -### Minio +Maximum number of parts in a multipart upload. -[Minio](https://minio.io/) is an object storage server built for cloud application developers and devops. +This option defines the maximum number of multipart chunks to use +when doing a multipart upload. -It is very easy to install and provides an S3 compatible server which can be used by rclone. +This can be useful if a service does not support the AWS S3 +specification of 10,000 chunks. -To use it, install Minio following the instructions [here](https://docs.minio.io/docs/minio-quickstart-guide). +Rclone will automatically increase the chunk size when uploading a +large file of a known size to stay below this number of chunks limit. -When it configures itself Minio will print something like this -``` -Endpoint: http://192.168.1.106:9000 http://172.23.0.1:9000 -AccessKey: USWUXHGYZQYFYFFIT3RE -SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -Region: us-east-1 -SQS ARNs: arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis +Properties: -Browser Access: - http://192.168.1.106:9000 http://172.23.0.1:9000 +- Config: max_upload_parts +- Env Var: RCLONE_S3_MAX_UPLOAD_PARTS +- Type: int +- Default: 10000 -Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide - $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +#### --s3-copy-cutoff -Object API (Amazon S3 compatible): - Go: https://docs.minio.io/docs/golang-client-quickstart-guide - Java: https://docs.minio.io/docs/java-client-quickstart-guide - Python: https://docs.minio.io/docs/python-client-quickstart-guide - JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide - .NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide +Cutoff for switching to multipart copy. -Drive Capacity: 26 GiB Free, 165 GiB Total -``` +Any files larger than this that need to be server-side copied will be +copied in chunks of this size. -These details need to go into `rclone config` like this. Note that it -is important to put the region in as stated above. +The minimum is 0 and the maximum is 5 GiB. -``` -env_auth> 1 -access_key_id> USWUXHGYZQYFYFFIT3RE -secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -region> us-east-1 -endpoint> http://192.168.1.106:9000 -location_constraint> -server_side_encryption> -``` +Properties: -Which makes the config file look like this +- Config: copy_cutoff +- Env Var: RCLONE_S3_COPY_CUTOFF +- Type: SizeSuffix +- Default: 4.656Gi -``` -[minio] -type = s3 -provider = Minio -env_auth = false -access_key_id = USWUXHGYZQYFYFFIT3RE -secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -region = us-east-1 -endpoint = http://192.168.1.106:9000 -location_constraint = -server_side_encryption = -``` +#### --s3-disable-checksum -So once set up, for example, to copy files into a bucket +Don't store MD5 checksum with object metadata. -``` -rclone copy /path/to/files minio:bucket -``` +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. -### Qiniu Cloud Object Storage (Kodo) {#qiniu} +Properties: -[Qiniu Cloud Object Storage (Kodo)](https://www.qiniu.com/en/products/kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management. +- Config: disable_checksum +- Env Var: RCLONE_S3_DISABLE_CHECKSUM +- Type: bool +- Default: false -To configure access to Qiniu Kodo, follow the steps below: +#### --s3-shared-credentials-file -1. Run `rclone config` and select `n` for a new remote. +Path to the shared credentials file. -``` -rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -``` +If env_auth = true then rclone can use a shared credentials file. -2. Give the name of the configuration. For example, name it 'qiniu'. +If this variable is empty rclone will look for the +"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty +it will default to the current user's home directory. -``` -name> qiniu -``` + Linux/OSX: "$HOME/.aws/credentials" + Windows: "%USERPROFILE%\.aws\credentials" -3. Select `s3` storage. -``` -Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi - \ (s3) -[snip] -Storage> s3 -``` +Properties: -4. Select `Qiniu` provider. -``` -Choose a number from below, or type in your own value -1 / Amazon Web Services (AWS) S3 - \ "AWS" -[snip] -22 / Qiniu Object Storage (Kodo) - \ (Qiniu) -[snip] -provider> Qiniu -``` +- Config: shared_credentials_file +- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE +- Type: string +- Required: false -5. Enter your SecretId and SecretKey of Qiniu Kodo. +#### --s3-profile -``` -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -access_key_id> AKIDxxxxxxxxxx -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> xxxxxxxxxxx -``` +Profile to use in the shared credentials file. -6. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region. +If env_auth = true then rclone can use a shared credentials file. This +variable controls which profile is used in that file. -``` - / The default endpoint - a good choice if you are unsure. - 1 | East China Region 1. - | Needs location constraint cn-east-1. - \ (cn-east-1) - / East China Region 2. - 2 | Needs location constraint cn-east-2. - \ (cn-east-2) - / North China Region 1. - 3 | Needs location constraint cn-north-1. - \ (cn-north-1) - / South China Region 1. - 4 | Needs location constraint cn-south-1. - \ (cn-south-1) - / North America Region. - 5 | Needs location constraint us-north-1. - \ (us-north-1) - / Southeast Asia Region 1. - 6 | Needs location constraint ap-southeast-1. - \ (ap-southeast-1) - / Northeast Asia Region 1. - 7 | Needs location constraint ap-northeast-1. - \ (ap-northeast-1) -[snip] -endpoint> 1 +If empty it will default to the environment variable "AWS_PROFILE" or +"default" if that environment variable is also not set. -Option endpoint. -Endpoint for Qiniu Object Storage. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / East China Endpoint 1 - \ (s3-cn-east-1.qiniucs.com) - 2 / East China Endpoint 2 - \ (s3-cn-east-2.qiniucs.com) - 3 / North China Endpoint 1 - \ (s3-cn-north-1.qiniucs.com) - 4 / South China Endpoint 1 - \ (s3-cn-south-1.qiniucs.com) - 5 / North America Endpoint 1 - \ (s3-us-north-1.qiniucs.com) - 6 / Southeast Asia Endpoint 1 - \ (s3-ap-southeast-1.qiniucs.com) - 7 / Northeast Asia Endpoint 1 - \ (s3-ap-northeast-1.qiniucs.com) -endpoint> 1 -Option location_constraint. -Location constraint - must be set to match the Region. -Used when creating buckets only. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / East China Region 1 - \ (cn-east-1) - 2 / East China Region 2 - \ (cn-east-2) - 3 / North China Region 1 - \ (cn-north-1) - 4 / South China Region 1 - \ (cn-south-1) - 5 / North America Region 1 - \ (us-north-1) - 6 / Southeast Asia Region 1 - \ (ap-southeast-1) - 7 / Northeast Asia Region 1 - \ (ap-northeast-1) -location_constraint> 1 -``` +Properties: -7. Choose acl and storage class. +- Config: profile +- Env Var: RCLONE_S3_PROFILE +- Type: string +- Required: false -``` -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) -[snip] -acl> 2 -The storage class to use when storing new objects in Tencent COS. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Standard storage class - \ (STANDARD) - 2 / Infrequent access storage mode - \ (LINE) - 3 / Archive storage mode - \ (GLACIER) - 4 / Deep archive storage mode - \ (DEEP_ARCHIVE) -[snip] -storage_class> 1 -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[qiniu] -- type: s3 -- provider: Qiniu -- access_key_id: xxx -- secret_access_key: xxx -- region: cn-east-1 -- endpoint: s3-cn-east-1.qiniucs.com -- location_constraint: cn-east-1 -- acl: public-read -- storage_class: STANDARD --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +#### --s3-session-token -Name Type -==== ==== -qiniu s3 -``` +An AWS session token. -### RackCorp {#RackCorp} +Properties: -[RackCorp Object Storage](https://www.rackcorp.com/storage/s3storage) is an S3 compatible object storage platform from your friendly cloud provider RackCorp. -The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty. +- Config: session_token +- Env Var: RCLONE_S3_SESSION_TOKEN +- Type: string +- Required: false -Before you can use RackCorp Object Storage, you'll need to "[sign up](https://www.rackcorp.com/signup)" for an account on our "[portal](https://portal.rackcorp.com)". -Next you can create an `access key`, a `secret key` and `buckets`, in your location of choice with ease. -These details are required for the next steps of configuration, when `rclone config` asks for your `access_key_id` and `secret_access_key`. +#### --s3-upload-concurrency -Your config should end up looking a bit like this: +Concurrency for multipart uploads. -``` -[RCS3-demo-config] -type = s3 -provider = RackCorp -env_auth = true -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = au-nsw -endpoint = s3.rackcorp.com -location_constraint = au-nsw -``` +This is the number of chunks of the same file that are uploaded +concurrently. +If you are uploading small numbers of large files over high-speed links +and these uploads do not fully utilize your bandwidth, then increasing +this may help to speed up the transfers. -### Scaleway +Properties: -[Scaleway](https://www.scaleway.com/object-storage/) The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. -Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool. +- Config: upload_concurrency +- Env Var: RCLONE_S3_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 -Scaleway provides an S3 interface which can be configured for use with rclone like this: +#### --s3-force-path-style -``` -[scaleway] -type = s3 -provider = Scaleway -env_auth = false -endpoint = s3.nl-ams.scw.cloud -access_key_id = SCWXXXXXXXXXXXXXX -secret_access_key = 1111111-2222-3333-44444-55555555555555 -region = nl-ams -location_constraint = -acl = private -server_side_encryption = -storage_class = -``` +If true use path style access if false use virtual hosted style. -[C14 Cold Storage](https://www.online.net/en/storage/c14-cold-storage) is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" `storage_class`. -So you can configure your remote with the `storage_class = GLACIER` option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above) +If this is true (the default) then rclone will use path style access, +if false then rclone will use virtual path style. See [the AWS S3 +docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) +for more info. -### Seagate Lyve Cloud {#lyve} +Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to +false - rclone will do this automatically based on the provider +setting. -[Seagate Lyve Cloud](https://www.seagate.com/gb/en/services/cloud/storage/) is an S3 -compatible object storage platform from [Seagate](https://seagate.com/) intended for enterprise use. +Properties: -Here is a config run through for a remote called `remote` - you may -choose a different name of course. Note that to create an access key -and secret key you will need to create a service account first. +- Config: force_path_style +- Env Var: RCLONE_S3_FORCE_PATH_STYLE +- Type: bool +- Default: true -``` -$ rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -``` +#### --s3-v2-auth -Choose `s3` backend +If true use v2 authentication. -``` -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS - \ (s3) -[snip] -Storage> s3 -``` +If this is false (the default) then rclone will use v4 authentication. +If it is set then rclone will use v2 authentication. -Choose `LyveCloud` as S3 provider +Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH. -``` -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / Seagate Lyve Cloud - \ (LyveCloud) -[snip] -provider> LyveCloud -``` +Properties: -Take the default (just press enter) to enter access key and secret in the config file. +- Config: v2_auth +- Env Var: RCLONE_S3_V2_AUTH +- Type: bool +- Default: false -``` -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> -``` +#### --s3-use-accelerate-endpoint -``` -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> XXX -``` +If true use the AWS S3 accelerated endpoint. -``` -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YYY -``` +See: [AWS S3 Transfer acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration-examples.html) -Leave region blank +Properties: -``` -Region to connect to. -Leave blank if you are using an S3 clone and you don't have a region. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Use this if unsure. - 1 | Will use v4 signatures and an empty region. - \ () - / Use this only if v4 signatures don't work. - 2 | E.g. pre Jewel/v10 CEPH. - \ (other-v2-signature) -region> -``` +- Config: use_accelerate_endpoint +- Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT +- Provider: AWS +- Type: bool +- Default: false -Choose an endpoint from the list +#### --s3-leave-parts-on-error -``` -Endpoint for S3 API. -Required when using an S3 clone. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Seagate Lyve Cloud US East 1 (Virginia) - \ (s3.us-east-1.lyvecloud.seagate.com) - 2 / Seagate Lyve Cloud US West 1 (California) - \ (s3.us-west-1.lyvecloud.seagate.com) - 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore) - \ (s3.ap-southeast-1.lyvecloud.seagate.com) -endpoint> 1 -``` +If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. -Leave location constraint blank +It should be set to true for resuming uploads across different sessions. -``` -Location constraint - must be set to match the Region. -Leave blank if not sure. Used when creating buckets only. -Enter a value. Press Enter to leave empty. -location_constraint> -``` +WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up. -Choose default ACL (`private`). -``` -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) -[snip] -acl> -``` +Properties: -And the config file should end up looking like this: +- Config: leave_parts_on_error +- Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR +- Provider: AWS +- Type: bool +- Default: false -``` -[remote] -type = s3 -provider = LyveCloud -access_key_id = XXX -secret_access_key = YYY -endpoint = s3.us-east-1.lyvecloud.seagate.com -``` +#### --s3-list-chunk -### SeaweedFS +Size of listing chunk (response list for each ListObject S3 request). -[SeaweedFS](https://github.com/chrislusf/seaweedfs/) is a distributed storage system for -blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. -It has an S3 compatible object storage interface. SeaweedFS can also act as a -[gateway to remote S3 compatible object store](https://github.com/chrislusf/seaweedfs/wiki/Gateway-to-Remote-Object-Storage) -to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost. +This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. +Most services truncate the response list to 1000 objects even if requested more than that. +In AWS S3 this is a global maximum and cannot be changed, see [AWS S3](https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html). +In Ceph, this can be increased with the "rgw list buckets max chunk" option. -Assuming the SeaweedFS are configured with `weed shell` as such: -``` -> s3.bucket.create -name foo -> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply -{ - "identities": [ - { - "name": "me", - "credentials": [ - { - "accessKey": "any", - "secretKey": "any" - } - ], - "actions": [ - "Read:foo", - "Write:foo", - "List:foo", - "Tagging:foo", - "Admin:foo" - ] - } - ] -} -``` -To use rclone with SeaweedFS, above configuration should end up with something like this in -your config: +Properties: -``` -[seaweedfs_s3] -type = s3 -provider = SeaweedFS -access_key_id = any -secret_access_key = any -endpoint = localhost:8333 -``` +- Config: list_chunk +- Env Var: RCLONE_S3_LIST_CHUNK +- Type: int +- Default: 1000 -So once set up, for example to copy files into a bucket +#### --s3-list-version -``` -rclone copy /path/to/files seaweedfs_s3:foo -``` +Version of ListObjects to use: 1,2 or 0 for auto. -### Wasabi +When S3 originally launched it only provided the ListObjects call to +enumerate objects in a bucket. -[Wasabi](https://wasabi.com) is a cloud-based object storage service for a -broad range of applications and use cases. Wasabi is designed for -individuals and organizations that require a high-performance, -reliable, and secure data storage infrastructure at minimal cost. +However in May 2016 the ListObjectsV2 call was introduced. This is +much higher performance and should be used if at all possible. -Wasabi provides an S3 interface which can be configured for use with -rclone like this. +If set to the default, 0, rclone will guess according to the provider +set which list objects method to call. If it guesses wrong, then it +may be set manually here. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -n/s> n -name> wasabi -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara) - \ "s3" -[snip] -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID - leave blank for anonymous access or runtime credentials. -access_key_id> YOURACCESSKEY -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YOURSECRETACCESSKEY -Region to connect to. -Choose a number from below, or type in your own value - / The default endpoint - a good choice if you are unsure. - 1 | US Region, Northern Virginia, or Pacific Northwest. - | Leave location constraint empty. - \ "us-east-1" -[snip] -region> us-east-1 -Endpoint for S3 API. -Leave blank if using AWS to use the default endpoint for the region. -Specify if using an S3 clone such as Ceph. -endpoint> s3.wasabisys.com -Location constraint - must be set to match the Region. Used when creating buckets only. -Choose a number from below, or type in your own value - 1 / Empty for US Region, Northern Virginia, or Pacific Northwest. - \ "" -[snip] -location_constraint> -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" -[snip] -acl> -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Reduced redundancy storage class - \ "REDUCED_REDUNDANCY" - 4 / Standard Infrequent Access storage class - \ "STANDARD_IA" -storage_class> -Remote config --------------------- -[wasabi] -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = us-east-1 -endpoint = s3.wasabisys.com -location_constraint = -acl = -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` -This will leave the config file looking like this. +Properties: -``` -[wasabi] -type = s3 -provider = Wasabi -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = -endpoint = s3.wasabisys.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +- Config: list_version +- Env Var: RCLONE_S3_LIST_VERSION +- Type: int +- Default: 0 -### Alibaba OSS {#alibaba-oss} +#### --s3-list-url-encode -Here is an example of making an [Alibaba Cloud (Aliyun) OSS](https://www.alibabacloud.com/product/oss/) -configuration. First run: +Whether to url encode listings: true/false/unset - rclone config +Some providers support URL encoding listings and where this is +available this is more reliable when using control characters in file +names. If this is set to unset (the default) then rclone will choose +according to the provider setting what to apply, but you can override +rclone's choice here. -This will guide you through an interactive setup process. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> oss -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS - \ "s3" -[snip] -Storage> s3 -Choose your S3 provider. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun - \ "Alibaba" - 3 / Ceph Object Storage - \ "Ceph" -[snip] -provider> Alibaba -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -access_key_id> accesskeyid -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> secretaccesskey -Endpoint for OSS API. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / East China 1 (Hangzhou) - \ "oss-cn-hangzhou.aliyuncs.com" - 2 / East China 2 (Shanghai) - \ "oss-cn-shanghai.aliyuncs.com" - 3 / North China 1 (Qingdao) - \ "oss-cn-qingdao.aliyuncs.com" -[snip] -endpoint> 1 -Canned ACL used when creating buckets and storing or copying objects. +Properties: -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \ "public-read" - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. -[snip] -acl> 1 -The storage class to use when storing new objects in OSS. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Archive storage mode. - \ "GLACIER" - 4 / Infrequent access storage mode. - \ "STANDARD_IA" -storage_class> 1 -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config --------------------- -[oss] -type = s3 -provider = Alibaba -env_auth = false -access_key_id = accesskeyid -secret_access_key = secretaccesskey -endpoint = oss-cn-hangzhou.aliyuncs.com -acl = private -storage_class = Standard --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: list_url_encode +- Env Var: RCLONE_S3_LIST_URL_ENCODE +- Type: Tristate +- Default: unset -### China Mobile Ecloud Elastic Object Storage (EOS) {#china-mobile-ecloud-eos} +#### --s3-no-check-bucket -Here is an example of making an [China Mobile Ecloud Elastic Object Storage (EOS)](https:///ecloud.10086.cn/home/product-introduction/eos/) -configuration. First run: +If set, don't attempt to check the bucket exists or create it. - rclone config +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. -This will guide you through an interactive setup process. +It can also be needed if the user you are using does not have bucket +creation permissions. Before v1.52.0 this would have passed silently +due to a bug. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> ChinaMobile -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. - ... - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS - \ (s3) - ... -Storage> s3 -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - ... - 4 / China Mobile Ecloud Elastic Object Storage (EOS) - \ (ChinaMobile) - ... -provider> ChinaMobile -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> accesskeyid -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> secretaccesskey -Option endpoint. -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / The default endpoint - a good choice if you are unsure. - 1 | East China (Suzhou) - \ (eos-wuxi-1.cmecloud.cn) - 2 / East China (Jinan) - \ (eos-jinan-1.cmecloud.cn) - 3 / East China (Hangzhou) - \ (eos-ningbo-1.cmecloud.cn) - 4 / East China (Shanghai-1) - \ (eos-shanghai-1.cmecloud.cn) - 5 / Central China (Zhengzhou) - \ (eos-zhengzhou-1.cmecloud.cn) - 6 / Central China (Changsha-1) - \ (eos-hunan-1.cmecloud.cn) - 7 / Central China (Changsha-2) - \ (eos-zhuzhou-1.cmecloud.cn) - 8 / South China (Guangzhou-2) - \ (eos-guangzhou-1.cmecloud.cn) - 9 / South China (Guangzhou-3) - \ (eos-dongguan-1.cmecloud.cn) -10 / North China (Beijing-1) - \ (eos-beijing-1.cmecloud.cn) -11 / North China (Beijing-2) - \ (eos-beijing-2.cmecloud.cn) -12 / North China (Beijing-3) - \ (eos-beijing-4.cmecloud.cn) -13 / North China (Huhehaote) - \ (eos-huhehaote-1.cmecloud.cn) -14 / Southwest China (Chengdu) - \ (eos-chengdu-1.cmecloud.cn) -15 / Southwest China (Chongqing) - \ (eos-chongqing-1.cmecloud.cn) -16 / Southwest China (Guiyang) - \ (eos-guiyang-1.cmecloud.cn) -17 / Nouthwest China (Xian) - \ (eos-xian-1.cmecloud.cn) -18 / Yunnan China (Kunming) - \ (eos-yunnan.cmecloud.cn) -19 / Yunnan China (Kunming-2) - \ (eos-yunnan-2.cmecloud.cn) -20 / Tianjin China (Tianjin) - \ (eos-tianjin-1.cmecloud.cn) -21 / Jilin China (Changchun) - \ (eos-jilin-1.cmecloud.cn) -22 / Hubei China (Xiangyan) - \ (eos-hubei-1.cmecloud.cn) -23 / Jiangxi China (Nanchang) - \ (eos-jiangxi-1.cmecloud.cn) -24 / Gansu China (Lanzhou) - \ (eos-gansu-1.cmecloud.cn) -25 / Shanxi China (Taiyuan) - \ (eos-shanxi-1.cmecloud.cn) -26 / Liaoning China (Shenyang) - \ (eos-liaoning-1.cmecloud.cn) -27 / Hebei China (Shijiazhuang) - \ (eos-hebei-1.cmecloud.cn) -28 / Fujian China (Xiamen) - \ (eos-fujian-1.cmecloud.cn) -29 / Guangxi China (Nanning) - \ (eos-guangxi-1.cmecloud.cn) -30 / Anhui China (Huainan) - \ (eos-anhui-1.cmecloud.cn) -endpoint> 1 -Option location_constraint. -Location constraint - must match endpoint. -Used when creating buckets only. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / East China (Suzhou) - \ (wuxi1) - 2 / East China (Jinan) - \ (jinan1) - 3 / East China (Hangzhou) + +Properties: + +- Config: no_check_bucket +- Env Var: RCLONE_S3_NO_CHECK_BUCKET +- Type: bool +- Default: false + +#### --s3-no-head + +If set, don't HEAD uploaded objects to check integrity. + +This can be useful when trying to minimise the number of transactions +rclone does. + +Setting it means that if rclone receives a 200 OK message after +uploading an object with PUT then it will assume that it got uploaded +properly. + +In particular it will assume: + +- the metadata, including modtime, storage class and content type was as uploaded +- the size was as uploaded + +It reads the following items from the response for a single part PUT: + +- the MD5SUM +- The uploaded date + +For multipart uploads these items aren't read. + +If an source object of unknown length is uploaded then rclone **will** do a +HEAD request. + +Setting this flag increases the chance for undetected upload failures, +in particular an incorrect size, so it isn't recommended for normal +operation. In practice the chance of an undetected upload failure is +very small even with this flag. + + +Properties: + +- Config: no_head +- Env Var: RCLONE_S3_NO_HEAD +- Type: bool +- Default: false + +#### --s3-no-head-object + +If set, do not do HEAD before GET when getting objects. + +Properties: + +- Config: no_head_object +- Env Var: RCLONE_S3_NO_HEAD_OBJECT +- Type: bool +- Default: false + +#### --s3-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_S3_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot + +#### --s3-memory-pool-flush-time + +How often internal memory buffer pools will be flushed. (no longer used) + +Properties: + +- Config: memory_pool_flush_time +- Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s + +#### --s3-memory-pool-use-mmap + +Whether to use mmap buffers in internal memory pool. (no longer used) + +Properties: + +- Config: memory_pool_use_mmap +- Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false + +#### --s3-disable-http2 + +Disable usage of http2 for S3 backends. + +There is currently an unsolved issue with the s3 (specifically minio) backend +and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be +disabled here. When the issue is solved this flag will be removed. + +See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631 + + + +Properties: + +- Config: disable_http2 +- Env Var: RCLONE_S3_DISABLE_HTTP2 +- Type: bool +- Default: false + +#### --s3-download-url + +Custom endpoint for downloads. +This is usually set to a CloudFront CDN URL as AWS S3 offers +cheaper egress for data downloaded through the CloudFront network. + +Properties: + +- Config: download_url +- Env Var: RCLONE_S3_DOWNLOAD_URL +- Type: string +- Required: false + +#### --s3-directory-markers + +Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. + + +Properties: + +- Config: directory_markers +- Env Var: RCLONE_S3_DIRECTORY_MARKERS +- Type: bool +- Default: false + +#### --s3-use-multipart-etag + +Whether to use ETag in multipart uploads for verification + +This should be true, false or left unset to use the default for the provider. + + +Properties: + +- Config: use_multipart_etag +- Env Var: RCLONE_S3_USE_MULTIPART_ETAG +- Type: Tristate +- Default: unset + +#### --s3-use-presigned-request + +Whether to use a presigned request or PutObject for single part uploads + +If this is false rclone will use PutObject from the AWS SDK to upload +an object. + +Versions of rclone < 1.59 use presigned requests to upload a single +part object and setting this flag to true will re-enable that +functionality. This shouldn't be necessary except in exceptional +circumstances or for testing. + + +Properties: + +- Config: use_presigned_request +- Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST +- Type: bool +- Default: false + +#### --s3-versions + +Include old versions in directory listings. + +Properties: + +- Config: versions +- Env Var: RCLONE_S3_VERSIONS +- Type: bool +- Default: false + +#### --s3-version-at + +Show file versions as they were at the specified time. + +The parameter should be a date, "2006-01-02", datetime "2006-01-02 +15:04:05" or a duration for that long ago, eg "100d" or "1h". + +Note that when using this no file write operations are permitted, +so you can't upload files or delete them. + +See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. + + +Properties: + +- Config: version_at +- Env Var: RCLONE_S3_VERSION_AT +- Type: Time +- Default: off + +#### --s3-decompress + +If set this will decompress gzip encoded objects. + +It is possible to upload objects to S3 with "Content-Encoding: gzip" +set. Normally rclone will download these files as compressed objects. + +If this flag is set then rclone will decompress these files with +"Content-Encoding: gzip" as they are received. This means that rclone +can't check the size and hash but the file contents will be decompressed. + + +Properties: + +- Config: decompress +- Env Var: RCLONE_S3_DECOMPRESS +- Type: bool +- Default: false + +#### --s3-might-gzip + +Set this if the backend might gzip objects. + +Normally providers will not alter objects when they are downloaded. If +an object was not uploaded with `Content-Encoding: gzip` then it won't +be set on download. + +However some providers may gzip objects even if they weren't uploaded +with `Content-Encoding: gzip` (eg Cloudflare). + +A symptom of this would be receiving errors like + + ERROR corrupted on transfer: sizes differ NNN vs MMM + +If you set this flag and rclone downloads an object with +Content-Encoding: gzip set and chunked transfer encoding, then rclone +will decompress the object on the fly. + +If this is set to unset (the default) then rclone will choose +according to the provider setting what to apply, but you can override +rclone's choice here. + + +Properties: + +- Config: might_gzip +- Env Var: RCLONE_S3_MIGHT_GZIP +- Type: Tristate +- Default: unset + +#### --s3-use-accept-encoding-gzip + +Whether to send `Accept-Encoding: gzip` header. + +By default, rclone will append `Accept-Encoding: gzip` to the request to download +compressed objects whenever possible. + +However some providers such as Google Cloud Storage may alter the HTTP headers, breaking +the signature of the request. + +A symptom of this would be receiving errors like + + SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. + +In this case, you might want to try disabling this option. + + +Properties: + +- Config: use_accept_encoding_gzip +- Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP +- Type: Tristate +- Default: unset + +#### --s3-no-system-metadata + +Suppress setting and reading of system metadata + +Properties: + +- Config: no_system_metadata +- Env Var: RCLONE_S3_NO_SYSTEM_METADATA +- Type: bool +- Default: false + +#### --s3-sts-endpoint + +Endpoint for STS. + +Leave blank if using AWS to use the default endpoint for the region. + +Properties: + +- Config: sts_endpoint +- Env Var: RCLONE_S3_STS_ENDPOINT +- Provider: AWS +- Type: string +- Required: false + +#### --s3-use-already-exists + +Set if rclone should report BucketAlreadyExists errors on bucket creation. + +At some point during the evolution of the s3 protocol, AWS started +returning an `AlreadyOwnedByYou` error when attempting to create a +bucket that the user already owned, rather than a +`BucketAlreadyExists` error. + +Unfortunately exactly what has been implemented by s3 clones is a +little inconsistent, some return `AlreadyOwnedByYou`, some return +`BucketAlreadyExists` and some return no error at all. + +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless +`--s3-no-check-bucket` is used). + +If rclone knows the provider can return `AlreadyOwnedByYou` or returns +no error then it can report `BucketAlreadyExists` errors when the user +attempts to create a bucket not owned by them. Otherwise rclone +ignores the `BucketAlreadyExists` error which can lead to confusion. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + + +Properties: + +- Config: use_already_exists +- Env Var: RCLONE_S3_USE_ALREADY_EXISTS +- Type: Tristate +- Default: unset + +#### --s3-use-multipart-uploads + +Set if rclone should use multipart uploads. + +You can change this if you want to disable the use of multipart uploads. +This shouldn't be necessary in normal operation. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + + +Properties: + +- Config: use_multipart_uploads +- Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS +- Type: Tristate +- Default: unset + +### Metadata + +User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case. + +Here are the possible system metadata items for the s3 backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| cache-control | Cache-Control header | string | no-cache | N | +| content-disposition | Content-Disposition header | string | inline | N | +| content-encoding | Content-Encoding header | string | gzip | N | +| content-language | Content-Language header | string | en-US | N | +| content-type | Content-Type header | string | text/plain | N | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| tier | Tier of the object | string | GLACIER | **Y** | + +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + +## Backend commands + +Here are the commands specific to the s3 backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). + +### restore + +Restore objects from GLACIER to normal storage + + rclone backend restore remote: [options] [+] + +This command can be used to restore one or more objects from GLACIER +to normal storage. + +Usage Examples: + + rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS + +This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags + + rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 + +All the objects shown will be marked for restore, then + + rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 + +It returns a list of status dictionaries with Remote and Status +keys. The Status will be OK if it was successful or an error message +if not. + + [ + { + "Status": "OK", + "Remote": "test.txt" + }, + { + "Status": "OK", + "Remote": "test/file4.txt" + } + ] + + + +Options: + +- "description": The optional description for the job. +- "lifetime": Lifetime of the active copy in days +- "priority": Priority of restore: Standard|Expedited|Bulk + +### restore-status + +Show the restore status for objects being restored from GLACIER to normal storage + + rclone backend restore-status remote: [options] [+] + +This command can be used to show the status for objects being restored from GLACIER +to normal storage. + +Usage Examples: + + rclone backend restore-status s3:bucket/path/to/object + rclone backend restore-status s3:bucket/path/to/directory + rclone backend restore-status -o all s3:bucket/path/to/directory + +This command does not obey the filters. + +It returns a list of status dictionaries. + + [ + { + "Remote": "file.txt", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": true, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "GLACIER" + }, + { + "Remote": "test.pdf", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": false, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "DEEP_ARCHIVE" + } + ] + + +Options: + +- "all": if set then show all objects, not just ones with restore status + +### list-multipart-uploads + +List the unfinished multipart uploads + + rclone backend list-multipart-uploads remote: [options] [+] + +This command lists the unfinished multipart uploads in JSON format. + + rclone backend list-multipart s3:bucket/path/to/object + +It returns a dictionary of buckets with values as lists of unfinished +multipart uploads. + +You can call it with no bucket in which case it lists all bucket, with +a bucket or with a bucket and path. + + { + "rclone": [ + { + "Initiated": "2020-06-26T14:20:36Z", + "Initiator": { + "DisplayName": "XXX", + "ID": "arn:aws:iam::XXX:user/XXX" + }, + "Key": "KEY", + "Owner": { + "DisplayName": null, + "ID": "XXX" + }, + "StorageClass": "STANDARD", + "UploadId": "XXX" + } + ], + "rclone-1000files": [], + "rclone-dst": [] + } + + + +### cleanup + +Remove unfinished multipart uploads. + + rclone backend cleanup remote: [options] [+] + +This command removes unfinished multipart uploads of age greater than +max-age which defaults to 24 hours. + +Note that you can use --interactive/-i or --dry-run with this command to see what +it would do. + + rclone backend cleanup s3:bucket/path/to/object + rclone backend cleanup -o max-age=7w s3:bucket/path/to/object + +Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. + + +Options: + +- "max-age": Max age of upload to delete + +### cleanup-hidden + +Remove old versions of files. + + rclone backend cleanup-hidden remote: [options] [+] + +This command removes any old hidden versions of files +on a versions enabled bucket. + +Note that you can use --interactive/-i or --dry-run with this command to see what +it would do. + + rclone backend cleanup-hidden s3:bucket/path/to/dir + + +### versioning + +Set/get versioning support for a bucket. + + rclone backend versioning remote: [options] [+] + +This command sets versioning support if a parameter is +passed and then returns the current versioning status for the bucket +supplied. + + rclone backend versioning s3:bucket # read status only + rclone backend versioning s3:bucket Enabled + rclone backend versioning s3:bucket Suspended + +It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning +has been enabled the status can't be set back to "Unversioned". + + +### set + +Set command for updating the config parameters. + + rclone backend set remote: [options] [+] + +This set command can be used to update the config parameters +for a running s3 backend. + +Usage Examples: + + rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X + +The option keys are named as they are in the config file. + +This rebuilds the connection to the s3 backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn't return anything. + + + + +### Anonymous access to public buckets + +If you want to use rclone to access a public bucket, configure with a +blank `access_key_id` and `secret_access_key`. Your config should end +up looking like this: + +``` +[anons3] +type = s3 +provider = AWS +env_auth = false +access_key_id = +secret_access_key = +region = us-east-1 +endpoint = +location_constraint = +acl = private +server_side_encryption = +storage_class = +``` + +Then use it as normal with the name of the public bucket, e.g. + + rclone lsd anons3:1000genomes + +You will be able to list and copy data but not upload it. + +## Providers + +### AWS S3 + +This is the provider used as main example and described in the [configuration](#configuration) section above. + +### AWS Snowball Edge + +[AWS Snowball](https://aws.amazon.com/snowball/) is a hardware +appliance used for transferring bulk data back to AWS. Its main +software interface is S3 object storage. + +To use rclone with AWS Snowball Edge devices, configure as standard +for an 'S3 Compatible Service'. + +If using rclone pre v1.59 be sure to set `upload_cutoff = 0` otherwise +you will run into authentication header issues as the snowball device +does not support query parameter based authentication. + +With rclone v1.59 or later setting `upload_cutoff` should not be necessary. + +eg. +``` +[snowball] +type = s3 +provider = Other +access_key_id = YOUR_ACCESS_KEY +secret_access_key = YOUR_SECRET_KEY +endpoint = http://[IP of Snowball]:8080 +upload_cutoff = 0 +``` + +### Ceph + +[Ceph](https://ceph.com/) is an open-source, unified, distributed +storage system designed for excellent performance, reliability and +scalability. It has an S3 compatible object storage interface. + +To use rclone with Ceph, configure as above but leave the region blank +and set the endpoint. You should end up with something like this in +your config: + + +``` +[ceph] +type = s3 +provider = Ceph +env_auth = false +access_key_id = XXX +secret_access_key = YYY +region = +endpoint = https://ceph.endpoint.example.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` + +If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a +version of rclone before v1.59 then you may need to supply the +parameter `--s3-upload-cutoff 0` or put this in the config file as +`upload_cutoff 0` to work around a bug which causes uploading of small +files to fail. + +Note also that Ceph sometimes puts `/` in the passwords it gives +users. If you read the secret access key using the command line tools +you will get a JSON blob with the `/` escaped as `\/`. Make sure you +only write `/` in the secret access key. + +Eg the dump from Ceph looks something like this (irrelevant keys +removed). + +``` +{ + "user_id": "xxx", + "display_name": "xxxx", + "keys": [ + { + "user": "xxx", + "access_key": "xxxxxx", + "secret_key": "xxxxxx\/xxxx" + } + ], +} +``` + +Because this is a json dump, it is encoding the `/` as `\/`, so if you +use the secret key as `xxxxxx/xxxx` it will work fine. + +### Cloudflare R2 {#cloudflare-r2} + +[Cloudflare R2](https://blog.cloudflare.com/r2-open-beta/) Storage +allows developers to store large amounts of unstructured data without +the costly egress bandwidth fees associated with typical cloud storage +services. + +Here is an example of making a Cloudflare R2 configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +Note that all buckets are private, and all are stored in the same +"auto" region. It is necessary to use Cloudflare workers to share the +content of a bucket publicly. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> r2 +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +... +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +... +Storage> s3 +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +... +XX / Cloudflare R2 Storage + \ (Cloudflare) +... +provider> Cloudflare +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> ACCESS_KEY +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> SECRET_ACCESS_KEY +Option region. +Region to connect to. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. + \ (auto) +region> 1 +Option endpoint. +Endpoint for S3 API. +Required when using an S3 clone. +Enter a value. Press Enter to leave empty. +endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This will leave your config looking something like: + +``` +[r2] +type = s3 +provider = Cloudflare +access_key_id = ACCESS_KEY +secret_access_key = SECRET_ACCESS_KEY +region = auto +endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com +acl = private +``` + +Now run `rclone lsf r2:` to see your buckets and `rclone lsf +r2:bucket` to look within a bucket. + +### Dreamhost + +Dreamhost [DreamObjects](https://www.dreamhost.com/cloud/storage/) is +an object storage system based on CEPH. + +To use rclone with Dreamhost, configure as above but leave the region blank +and set the endpoint. You should end up with something like this in +your config: + +``` +[dreamobjects] +type = s3 +provider = DreamHost +env_auth = false +access_key_id = your_access_key +secret_access_key = your_secret_key +region = +endpoint = objects-us-west-1.dream.io +location_constraint = +acl = private +server_side_encryption = +storage_class = +``` + +### Google Cloud Storage + +[GoogleCloudStorage](https://cloud.google.com/storage/docs) is an [S3-interoperable](https://cloud.google.com/storage/docs/interoperability) object storage service from Google Cloud Platform. + +To connect to Google Cloud Storage you will need an access key and secret key. These can be retrieved by creating an [HMAC key](https://cloud.google.com/storage/docs/authentication/managing-hmackeys). + +``` +[gs] +type = s3 +provider = GCS +access_key_id = your_access_key +secret_access_key = your_secret_key +endpoint = https://storage.googleapis.com +``` + +**Note** that `--s3-versions` does not work with GCS when it needs to do directory paging. Rclone will return the error: + + s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker + +This is Google bug [#312292516](https://issuetracker.google.com/u/0/issues/312292516). + +### DigitalOcean Spaces + +[Spaces](https://www.digitalocean.com/products/object-storage/) is an [S3-interoperable](https://developers.digitalocean.com/documentation/spaces/) object storage service from cloud provider DigitalOcean. + +To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "[Applications & API](https://cloud.digitalocean.com/settings/api/tokens)" page of the DigitalOcean control panel. They will be needed when prompted by `rclone config` for your `access_key_id` and `secret_access_key`. + +When prompted for a `region` or `location_constraint`, press enter to use the default value. The region must be included in the `endpoint` setting (e.g. `nyc3.digitaloceanspaces.com`). The default values can be used for other settings. + +Going through the whole process of creating a new remote by running `rclone config`, each prompt should be answered as shown below: + +``` +Storage> s3 +env_auth> 1 +access_key_id> YOUR_ACCESS_KEY +secret_access_key> YOUR_SECRET_KEY +region> +endpoint> nyc3.digitaloceanspaces.com +location_constraint> +acl> +storage_class> +``` + +The resulting configuration file should look like: + +``` +[spaces] +type = s3 +provider = DigitalOcean +env_auth = false +access_key_id = YOUR_ACCESS_KEY +secret_access_key = YOUR_SECRET_KEY +region = +endpoint = nyc3.digitaloceanspaces.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` + +Once configured, you can create a new Space and begin copying files. For example: + +``` +rclone mkdir spaces:my-new-space +rclone copy /path/to/files spaces:my-new-space +``` +### Huawei OBS {#huawei-obs} + +Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere. + +OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file. +``` +[obs] +type = s3 +provider = HuaweiOBS +access_key_id = your-access-key-id +secret_access_key = your-secret-access-key +region = af-south-1 +endpoint = obs.af-south-1.myhuaweicloud.com +acl = private +``` + +Or you can also configure via the interactive command line: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> obs +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +[snip] +Storage> 5 +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] + 9 / Huawei Object Storage Service + \ (HuaweiOBS) +[snip] +provider> 9 +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> your-access-key-id +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> your-secret-access-key +Option region. +Region to connect to. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / AF-Johannesburg + \ (af-south-1) + 2 / AP-Bangkok + \ (ap-southeast-2) +[snip] +region> 1 +Option endpoint. +Endpoint for OBS API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / AF-Johannesburg + \ (obs.af-south-1.myhuaweicloud.com) + 2 / AP-Bangkok + \ (obs.ap-southeast-2.myhuaweicloud.com) +[snip] +endpoint> 1 +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) +[snip] +acl> 1 +Edit advanced config? +y) Yes +n) No (default) +y/n> +-------------------- +[obs] +type = s3 +provider = HuaweiOBS +access_key_id = your-access-key-id +secret_access_key = your-secret-access-key +region = af-south-1 +endpoint = obs.af-south-1.myhuaweicloud.com +acl = private +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: + +Name Type +==== ==== +obs s3 + +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +``` + +### IBM COS (S3) + +Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage) + +To configure access to IBM COS S3, follow the steps below: + +1. Run rclone config and select n for a new remote. +``` + 2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n +``` + +2. Enter the name for the configuration +``` + name> +``` + +3. Select "s3" storage. +``` +Choose a number from below, or type in your own value + 1 / Alias for an existing remote + \ "alias" + 2 / Amazon Drive + \ "amazon cloud drive" + 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) + \ "s3" + 4 / Backblaze B2 + \ "b2" +[snip] + 23 / HTTP + \ "http" +Storage> 3 +``` + +4. Select IBM COS as the S3 Storage Provider. +``` +Choose the S3 provider. +Choose a number from below, or type in your own value + 1 / Choose this option to configure Storage to AWS S3 + \ "AWS" + 2 / Choose this option to configure Storage to Ceph Systems + \ "Ceph" + 3 / Choose this option to configure Storage to Dreamhost + \ "Dreamhost" + 4 / Choose this option to the configure Storage to IBM COS S3 + \ "IBMCOS" + 5 / Choose this option to the configure Storage to Minio + \ "Minio" + Provider>4 +``` + +5. Enter the Access Key and Secret. +``` + AWS Access Key ID - leave blank for anonymous access or runtime credentials. + access_key_id> <> + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> <> +``` + +6. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address. +``` + Endpoint for IBM COS S3 API. + Specify if using an IBM COS On Premise. + Choose a number from below, or type in your own value + 1 / US Cross Region Endpoint + \ "s3-api.us-geo.objectstorage.softlayer.net" + 2 / US Cross Region Dallas Endpoint + \ "s3-api.dal.us-geo.objectstorage.softlayer.net" + 3 / US Cross Region Washington DC Endpoint + \ "s3-api.wdc-us-geo.objectstorage.softlayer.net" + 4 / US Cross Region San Jose Endpoint + \ "s3-api.sjc-us-geo.objectstorage.softlayer.net" + 5 / US Cross Region Private Endpoint + \ "s3-api.us-geo.objectstorage.service.networklayer.com" + 6 / US Cross Region Dallas Private Endpoint + \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com" + 7 / US Cross Region Washington DC Private Endpoint + \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com" + 8 / US Cross Region San Jose Private Endpoint + \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com" + 9 / US Region East Endpoint + \ "s3.us-east.objectstorage.softlayer.net" + 10 / US Region East Private Endpoint + \ "s3.us-east.objectstorage.service.networklayer.com" + 11 / US Region South Endpoint +[snip] + 34 / Toronto Single Site Private Endpoint + \ "s3.tor01.objectstorage.service.networklayer.com" + endpoint>1 +``` + + +7. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter +``` + 1 / US Cross Region Standard + \ "us-standard" + 2 / US Cross Region Vault + \ "us-vault" + 3 / US Cross Region Cold + \ "us-cold" + 4 / US Cross Region Flex + \ "us-flex" + 5 / US East Region Standard + \ "us-east-standard" + 6 / US East Region Vault + \ "us-east-vault" + 7 / US East Region Cold + \ "us-east-cold" + 8 / US East Region Flex + \ "us-east-flex" + 9 / US South Region Standard + \ "us-south-standard" + 10 / US South Region Vault + \ "us-south-vault" +[snip] + 32 / Toronto Flex + \ "tor01-flex" +location_constraint>1 +``` + +9. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs. +``` +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS + \ "public-read" + 3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS + \ "public-read-write" + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS + \ "authenticated-read" +acl> 1 +``` + + +12. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this +``` + [xxx] + type = s3 + Provider = IBMCOS + access_key_id = xxx + secret_access_key = yyy + endpoint = s3-api.us-geo.objectstorage.softlayer.net + location_constraint = us-standard + acl = private +``` + +13. Execute rclone commands +``` + 1) Create a bucket. + rclone mkdir IBM-COS-XREGION:newbucket + 2) List available buckets. + rclone lsd IBM-COS-XREGION: + -1 2017-11-08 21:16:22 -1 test + -1 2018-02-14 20:16:39 -1 newbucket + 3) List contents of a bucket. + rclone ls IBM-COS-XREGION:newbucket + 18685952 test.exe + 4) Copy a file from local to remote. + rclone copy /Users/file.txt IBM-COS-XREGION:newbucket + 5) Copy a file from remote to local. + rclone copy IBM-COS-XREGION:newbucket/file.txt . + 6) Delete a file on remote. + rclone delete IBM-COS-XREGION:newbucket/file.txt +``` + +### IDrive e2 {#idrive-e2} + +Here is an example of making an [IDrive e2](https://www.idrive.com/e2/) +configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter name for new remote. +name> e2 + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +[snip] +Storage> s3 + +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / IDrive e2 + \ (IDrive) +[snip] +provider> IDrive + +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> + +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> YOUR_ACCESS_KEY + +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YOUR_SECRET_KEY + +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) +acl> + +Edit advanced config? +y) Yes +n) No (default) +y/n> + +Configuration complete. +Options: +- type: s3 +- provider: IDrive +- access_key_id: YOUR_ACCESS_KEY +- secret_access_key: YOUR_SECRET_KEY +- endpoint: q9d9.la12.idrivee2-5.com +Keep this "e2" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +### IONOS Cloud {#ionos} + +[IONOS S3 Object Storage](https://cloud.ionos.com/storage/object-storage) is a service offered by IONOS for storing and accessing unstructured data. +To connect to the service, you will need an access key and a secret key. These can be found in the [Data Center Designer](https://dcd.ionos.com/), by selecting **Manager resources** > **Object Storage Key Manager**. + + +Here is an example of a configuration. First, run `rclone config`. This will walk you through an interactive setup process. Type `n` to add the new remote, and then enter a name: + +``` +Enter name for new remote. +name> ionos-fra +``` + +Type `s3` to choose the connection type: +``` +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +[snip] +Storage> s3 +``` + +Type `IONOS`: +``` +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / IONOS Cloud + \ (IONOS) +[snip] +provider> IONOS +``` + +Press Enter to choose the default option `Enter AWS credentials in the next step`: +``` +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> +``` + +Enter your Access Key and Secret key. These can be retrieved in the [Data Center Designer](https://dcd.ionos.com/), click on the menu “Manager resources” / "Object Storage Key Manager". +``` +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> YOUR_ACCESS_KEY + +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YOUR_SECRET_KEY +``` + +Choose the region where your bucket is located: +``` +Option region. +Region where your bucket will be created and your data stored. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Frankfurt, Germany + \ (de) + 2 / Berlin, Germany + \ (eu-central-2) + 3 / Logrono, Spain + \ (eu-south-2) +region> 2 +``` + +Choose the endpoint from the same region: +``` +Option endpoint. +Endpoint for IONOS S3 Object Storage. +Specify the endpoint from the same region. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Frankfurt, Germany + \ (s3-eu-central-1.ionoscloud.com) + 2 / Berlin, Germany + \ (s3-eu-central-2.ionoscloud.com) + 3 / Logrono, Spain + \ (s3-eu-south-2.ionoscloud.com) +endpoint> 1 +``` + +Press Enter to choose the default option or choose the desired ACL setting: +``` +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. +[snip] +acl> +``` + +Press Enter to skip the advanced config: +``` +Edit advanced config? +y) Yes +n) No (default) +y/n> +``` + +Press Enter to save the configuration, and then `q` to quit the configuration process: +``` +Configuration complete. +Options: +- type: s3 +- provider: IONOS +- access_key_id: YOUR_ACCESS_KEY +- secret_access_key: YOUR_SECRET_KEY +- endpoint: s3-eu-central-1.ionoscloud.com +Keep this "ionos-fra" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +Done! Now you can try some commands (for macOS, use `./rclone` instead of `rclone`). + +1) Create a bucket (the name must be unique within the whole IONOS S3) +``` +rclone mkdir ionos-fra:my-bucket +``` +2) List available buckets +``` +rclone lsd ionos-fra: +``` +4) Copy a file from local to remote +``` +rclone copy /Users/file.txt ionos-fra:my-bucket +``` +3) List contents of a bucket +``` +rclone ls ionos-fra:my-bucket +``` +5) Copy a file from remote to local +``` +rclone copy ionos-fra:my-bucket/file.txt +``` + +### Minio + +[Minio](https://minio.io/) is an object storage server built for cloud application developers and devops. + +It is very easy to install and provides an S3 compatible server which can be used by rclone. + +To use it, install Minio following the instructions [here](https://docs.minio.io/docs/minio-quickstart-guide). + +When it configures itself Minio will print something like this + +``` +Endpoint: http://192.168.1.106:9000 http://172.23.0.1:9000 +AccessKey: USWUXHGYZQYFYFFIT3RE +SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +Region: us-east-1 +SQS ARNs: arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis + +Browser Access: + http://192.168.1.106:9000 http://172.23.0.1:9000 + +Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide + $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 + +Object API (Amazon S3 compatible): + Go: https://docs.minio.io/docs/golang-client-quickstart-guide + Java: https://docs.minio.io/docs/java-client-quickstart-guide + Python: https://docs.minio.io/docs/python-client-quickstart-guide + JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide + .NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide + +Drive Capacity: 26 GiB Free, 165 GiB Total +``` + +These details need to go into `rclone config` like this. Note that it +is important to put the region in as stated above. + +``` +env_auth> 1 +access_key_id> USWUXHGYZQYFYFFIT3RE +secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +region> us-east-1 +endpoint> http://192.168.1.106:9000 +location_constraint> +server_side_encryption> +``` + +Which makes the config file look like this + +``` +[minio] +type = s3 +provider = Minio +env_auth = false +access_key_id = USWUXHGYZQYFYFFIT3RE +secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +region = us-east-1 +endpoint = http://192.168.1.106:9000 +location_constraint = +server_side_encryption = +``` + +So once set up, for example, to copy files into a bucket + +``` +rclone copy /path/to/files minio:bucket +``` + +### Qiniu Cloud Object Storage (Kodo) {#qiniu} + +[Qiniu Cloud Object Storage (Kodo)](https://www.qiniu.com/en/products/kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management. + +To configure access to Qiniu Kodo, follow the steps below: + +1. Run `rclone config` and select `n` for a new remote. + +``` +rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +``` + +2. Give the name of the configuration. For example, name it 'qiniu'. + +``` +name> qiniu +``` + +3. Select `s3` storage. + +``` +Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) +[snip] +Storage> s3 +``` + +4. Select `Qiniu` provider. +``` +Choose a number from below, or type in your own value +1 / Amazon Web Services (AWS) S3 + \ "AWS" +[snip] +22 / Qiniu Object Storage (Kodo) + \ (Qiniu) +[snip] +provider> Qiniu +``` + +5. Enter your SecretId and SecretKey of Qiniu Kodo. + +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +access_key_id> AKIDxxxxxxxxxx +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> xxxxxxxxxxx +``` + +6. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region. + +``` + / The default endpoint - a good choice if you are unsure. + 1 | East China Region 1. + | Needs location constraint cn-east-1. + \ (cn-east-1) + / East China Region 2. + 2 | Needs location constraint cn-east-2. + \ (cn-east-2) + / North China Region 1. + 3 | Needs location constraint cn-north-1. + \ (cn-north-1) + / South China Region 1. + 4 | Needs location constraint cn-south-1. + \ (cn-south-1) + / North America Region. + 5 | Needs location constraint us-north-1. + \ (us-north-1) + / Southeast Asia Region 1. + 6 | Needs location constraint ap-southeast-1. + \ (ap-southeast-1) + / Northeast Asia Region 1. + 7 | Needs location constraint ap-northeast-1. + \ (ap-northeast-1) +[snip] +endpoint> 1 + +Option endpoint. +Endpoint for Qiniu Object Storage. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / East China Endpoint 1 + \ (s3-cn-east-1.qiniucs.com) + 2 / East China Endpoint 2 + \ (s3-cn-east-2.qiniucs.com) + 3 / North China Endpoint 1 + \ (s3-cn-north-1.qiniucs.com) + 4 / South China Endpoint 1 + \ (s3-cn-south-1.qiniucs.com) + 5 / North America Endpoint 1 + \ (s3-us-north-1.qiniucs.com) + 6 / Southeast Asia Endpoint 1 + \ (s3-ap-southeast-1.qiniucs.com) + 7 / Northeast Asia Endpoint 1 + \ (s3-ap-northeast-1.qiniucs.com) +endpoint> 1 + +Option location_constraint. +Location constraint - must be set to match the Region. +Used when creating buckets only. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / East China Region 1 + \ (cn-east-1) + 2 / East China Region 2 + \ (cn-east-2) + 3 / North China Region 1 + \ (cn-north-1) + 4 / South China Region 1 + \ (cn-south-1) + 5 / North America Region 1 + \ (us-north-1) + 6 / Southeast Asia Region 1 + \ (ap-southeast-1) + 7 / Northeast Asia Region 1 + \ (ap-northeast-1) +location_constraint> 1 +``` + +7. Choose acl and storage class. + +``` +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) +[snip] +acl> 2 +The storage class to use when storing new objects in Tencent COS. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Standard storage class + \ (STANDARD) + 2 / Infrequent access storage mode + \ (LINE) + 3 / Archive storage mode + \ (GLACIER) + 4 / Deep archive storage mode + \ (DEEP_ARCHIVE) +[snip] +storage_class> 1 +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[qiniu] +- type: s3 +- provider: Qiniu +- access_key_id: xxx +- secret_access_key: xxx +- region: cn-east-1 +- endpoint: s3-cn-east-1.qiniucs.com +- location_constraint: cn-east-1 +- acl: public-read +- storage_class: STANDARD +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: + +Name Type +==== ==== +qiniu s3 +``` + +### RackCorp {#RackCorp} + +[RackCorp Object Storage](https://www.rackcorp.com/storage/s3storage) is an S3 compatible object storage platform from your friendly cloud provider RackCorp. +The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty. + +Before you can use RackCorp Object Storage, you'll need to "[sign up](https://www.rackcorp.com/signup)" for an account on our "[portal](https://portal.rackcorp.com)". +Next you can create an `access key`, a `secret key` and `buckets`, in your location of choice with ease. +These details are required for the next steps of configuration, when `rclone config` asks for your `access_key_id` and `secret_access_key`. + +Your config should end up looking a bit like this: + +``` +[RCS3-demo-config] +type = s3 +provider = RackCorp +env_auth = true +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = au-nsw +endpoint = s3.rackcorp.com +location_constraint = au-nsw +``` + +### Rclone Serve S3 {#rclone} + +Rclone can serve any remote over the S3 protocol. For details see the +[rclone serve s3](https://rclone.org/commands/rclone_serve_http/) documentation. + +For example, to serve `remote:path` over s3, run the server like this: + +``` +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +``` + +This will be compatible with an rclone remote which is defined like this: + +``` +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +``` + +Note that setting `disable_multipart_uploads = true` is to work around +[a bug](https://rclone.org/commands/rclone_serve_http/#bugs) which will be fixed in due course. + +### Scaleway + +[Scaleway](https://www.scaleway.com/object-storage/) The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. +Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool. + +Scaleway provides an S3 interface which can be configured for use with rclone like this: + +``` +[scaleway] +type = s3 +provider = Scaleway +env_auth = false +endpoint = s3.nl-ams.scw.cloud +access_key_id = SCWXXXXXXXXXXXXXX +secret_access_key = 1111111-2222-3333-44444-55555555555555 +region = nl-ams +location_constraint = +acl = private +server_side_encryption = +storage_class = +``` + +[C14 Cold Storage](https://www.online.net/en/storage/c14-cold-storage) is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" `storage_class`. +So you can configure your remote with the `storage_class = GLACIER` option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above) + +### Seagate Lyve Cloud {#lyve} + +[Seagate Lyve Cloud](https://www.seagate.com/gb/en/services/cloud/storage/) is an S3 +compatible object storage platform from [Seagate](https://seagate.com/) intended for enterprise use. + +Here is a config run through for a remote called `remote` - you may +choose a different name of course. Note that to create an access key +and secret key you will need to create a service account first. + +``` +$ rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +``` + +Choose `s3` backend + +``` +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS + \ (s3) +[snip] +Storage> s3 +``` + +Choose `LyveCloud` as S3 provider + +``` +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Seagate Lyve Cloud + \ (LyveCloud) +[snip] +provider> LyveCloud +``` + +Take the default (just press enter) to enter access key and secret in the config file. + +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> +``` + +``` +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> XXX +``` + +``` +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YYY +``` + +Leave region blank + +``` +Region to connect to. +Leave blank if you are using an S3 clone and you don't have a region. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Use this if unsure. + 1 | Will use v4 signatures and an empty region. + \ () + / Use this only if v4 signatures don't work. + 2 | E.g. pre Jewel/v10 CEPH. + \ (other-v2-signature) +region> +``` + +Choose an endpoint from the list + +``` +Endpoint for S3 API. +Required when using an S3 clone. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Seagate Lyve Cloud US East 1 (Virginia) + \ (s3.us-east-1.lyvecloud.seagate.com) + 2 / Seagate Lyve Cloud US West 1 (California) + \ (s3.us-west-1.lyvecloud.seagate.com) + 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore) + \ (s3.ap-southeast-1.lyvecloud.seagate.com) +endpoint> 1 +``` + +Leave location constraint blank + +``` +Location constraint - must be set to match the Region. +Leave blank if not sure. Used when creating buckets only. +Enter a value. Press Enter to leave empty. +location_constraint> +``` + +Choose default ACL (`private`). + +``` +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) +[snip] +acl> +``` + +And the config file should end up looking like this: + +``` +[remote] +type = s3 +provider = LyveCloud +access_key_id = XXX +secret_access_key = YYY +endpoint = s3.us-east-1.lyvecloud.seagate.com +``` + +### SeaweedFS + +[SeaweedFS](https://github.com/chrislusf/seaweedfs/) is a distributed storage system for +blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. +It has an S3 compatible object storage interface. SeaweedFS can also act as a +[gateway to remote S3 compatible object store](https://github.com/chrislusf/seaweedfs/wiki/Gateway-to-Remote-Object-Storage) +to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost. + +Assuming the SeaweedFS are configured with `weed shell` as such: +``` +> s3.bucket.create -name foo +> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply +{ + "identities": [ + { + "name": "me", + "credentials": [ + { + "accessKey": "any", + "secretKey": "any" + } + ], + "actions": [ + "Read:foo", + "Write:foo", + "List:foo", + "Tagging:foo", + "Admin:foo" + ] + } + ] +} +``` + +To use rclone with SeaweedFS, above configuration should end up with something like this in +your config: + +``` +[seaweedfs_s3] +type = s3 +provider = SeaweedFS +access_key_id = any +secret_access_key = any +endpoint = localhost:8333 +``` + +So once set up, for example to copy files into a bucket + +``` +rclone copy /path/to/files seaweedfs_s3:foo +``` + +### Wasabi + +[Wasabi](https://wasabi.com) is a cloud-based object storage service for a +broad range of applications and use cases. Wasabi is designed for +individuals and organizations that require a high-performance, +reliable, and secure data storage infrastructure at minimal cost. + +Wasabi provides an S3 interface which can be configured for use with +rclone like this. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n +name> wasabi +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara) + \ "s3" +[snip] +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID - leave blank for anonymous access or runtime credentials. +access_key_id> YOURACCESSKEY +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YOURSECRETACCESSKEY +Region to connect to. +Choose a number from below, or type in your own value + / The default endpoint - a good choice if you are unsure. + 1 | US Region, Northern Virginia, or Pacific Northwest. + | Leave location constraint empty. + \ "us-east-1" +[snip] +region> us-east-1 +Endpoint for S3 API. +Leave blank if using AWS to use the default endpoint for the region. +Specify if using an S3 clone such as Ceph. +endpoint> s3.wasabisys.com +Location constraint - must be set to match the Region. Used when creating buckets only. +Choose a number from below, or type in your own value + 1 / Empty for US Region, Northern Virginia, or Pacific Northwest. + \ "" +[snip] +location_constraint> +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" +[snip] +acl> +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Reduced redundancy storage class + \ "REDUCED_REDUNDANCY" + 4 / Standard Infrequent Access storage class + \ "STANDARD_IA" +storage_class> +Remote config +-------------------- +[wasabi] +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = us-east-1 +endpoint = s3.wasabisys.com +location_constraint = +acl = +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This will leave the config file looking like this. + +``` +[wasabi] +type = s3 +provider = Wasabi +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = +endpoint = s3.wasabisys.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` + +### Alibaba OSS {#alibaba-oss} + +Here is an example of making an [Alibaba Cloud (Aliyun) OSS](https://www.alibabacloud.com/product/oss/) +configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> oss +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS + \ "s3" +[snip] +Storage> s3 +Choose your S3 provider. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun + \ "Alibaba" + 3 / Ceph Object Storage + \ "Ceph" +[snip] +provider> Alibaba +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +access_key_id> accesskeyid +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> secretaccesskey +Endpoint for OSS API. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / East China 1 (Hangzhou) + \ "oss-cn-hangzhou.aliyuncs.com" + 2 / East China 2 (Shanghai) + \ "oss-cn-shanghai.aliyuncs.com" + 3 / North China 1 (Qingdao) + \ "oss-cn-qingdao.aliyuncs.com" +[snip] +endpoint> 1 +Canned ACL used when creating buckets and storing or copying objects. + +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \ "public-read" + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. +[snip] +acl> 1 +The storage class to use when storing new objects in OSS. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Archive storage mode. + \ "GLACIER" + 4 / Infrequent access storage mode. + \ "STANDARD_IA" +storage_class> 1 +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[oss] +type = s3 +provider = Alibaba +env_auth = false +access_key_id = accesskeyid +secret_access_key = secretaccesskey +endpoint = oss-cn-hangzhou.aliyuncs.com +acl = private +storage_class = Standard +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +### China Mobile Ecloud Elastic Object Storage (EOS) {#china-mobile-ecloud-eos} + +Here is an example of making an [China Mobile Ecloud Elastic Object Storage (EOS)](https:///ecloud.10086.cn/home/product-introduction/eos/) +configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> ChinaMobile +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. + ... + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS + \ (s3) + ... +Storage> s3 +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + ... + 4 / China Mobile Ecloud Elastic Object Storage (EOS) + \ (ChinaMobile) + ... +provider> ChinaMobile +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> accesskeyid +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> secretaccesskey +Option endpoint. +Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / The default endpoint - a good choice if you are unsure. + 1 | East China (Suzhou) + \ (eos-wuxi-1.cmecloud.cn) + 2 / East China (Jinan) + \ (eos-jinan-1.cmecloud.cn) + 3 / East China (Hangzhou) + \ (eos-ningbo-1.cmecloud.cn) + 4 / East China (Shanghai-1) + \ (eos-shanghai-1.cmecloud.cn) + 5 / Central China (Zhengzhou) + \ (eos-zhengzhou-1.cmecloud.cn) + 6 / Central China (Changsha-1) + \ (eos-hunan-1.cmecloud.cn) + 7 / Central China (Changsha-2) + \ (eos-zhuzhou-1.cmecloud.cn) + 8 / South China (Guangzhou-2) + \ (eos-guangzhou-1.cmecloud.cn) + 9 / South China (Guangzhou-3) + \ (eos-dongguan-1.cmecloud.cn) +10 / North China (Beijing-1) + \ (eos-beijing-1.cmecloud.cn) +11 / North China (Beijing-2) + \ (eos-beijing-2.cmecloud.cn) +12 / North China (Beijing-3) + \ (eos-beijing-4.cmecloud.cn) +13 / North China (Huhehaote) + \ (eos-huhehaote-1.cmecloud.cn) +14 / Southwest China (Chengdu) + \ (eos-chengdu-1.cmecloud.cn) +15 / Southwest China (Chongqing) + \ (eos-chongqing-1.cmecloud.cn) +16 / Southwest China (Guiyang) + \ (eos-guiyang-1.cmecloud.cn) +17 / Nouthwest China (Xian) + \ (eos-xian-1.cmecloud.cn) +18 / Yunnan China (Kunming) + \ (eos-yunnan.cmecloud.cn) +19 / Yunnan China (Kunming-2) + \ (eos-yunnan-2.cmecloud.cn) +20 / Tianjin China (Tianjin) + \ (eos-tianjin-1.cmecloud.cn) +21 / Jilin China (Changchun) + \ (eos-jilin-1.cmecloud.cn) +22 / Hubei China (Xiangyan) + \ (eos-hubei-1.cmecloud.cn) +23 / Jiangxi China (Nanchang) + \ (eos-jiangxi-1.cmecloud.cn) +24 / Gansu China (Lanzhou) + \ (eos-gansu-1.cmecloud.cn) +25 / Shanxi China (Taiyuan) + \ (eos-shanxi-1.cmecloud.cn) +26 / Liaoning China (Shenyang) + \ (eos-liaoning-1.cmecloud.cn) +27 / Hebei China (Shijiazhuang) + \ (eos-hebei-1.cmecloud.cn) +28 / Fujian China (Xiamen) + \ (eos-fujian-1.cmecloud.cn) +29 / Guangxi China (Nanning) + \ (eos-guangxi-1.cmecloud.cn) +30 / Anhui China (Huainan) + \ (eos-anhui-1.cmecloud.cn) +endpoint> 1 +Option location_constraint. +Location constraint - must match endpoint. +Used when creating buckets only. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / East China (Suzhou) + \ (wuxi1) + 2 / East China (Jinan) + \ (jinan1) + 3 / East China (Hangzhou) \ (ningbo1) 4 / East China (Shanghai-1) \ (shanghai1) @@ -22738,1097 +25693,3445 @@ Press Enter to leave empty. 4 | The AuthenticatedUsers group gets READ access. \ (authenticated-read) / Object owner gets FULL_CONTROL. -acl> private -Option server_side_encryption. -The server-side encryption algorithm used when storing this object in S3. +acl> private +Option server_side_encryption. +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / None + \ () + 2 / AES256 + \ (AES256) +server_side_encryption> +Option storage_class. +The storage class to use when storing new objects in ChinaMobile. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Default + \ () + 2 / Standard storage class + \ (STANDARD) + 3 / Archive storage mode + \ (GLACIER) + 4 / Infrequent access storage mode + \ (STANDARD_IA) +storage_class> +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +[ChinaMobile] +type = s3 +provider = ChinaMobile +access_key_id = accesskeyid +secret_access_key = secretaccesskey +endpoint = eos-wuxi-1.cmecloud.cn +location_constraint = wuxi1 +acl = private +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` +### Leviia Cloud Object Storage {#leviia} + +[Leviia Object Storage](https://www.leviia.com/object-storage/), backup and secure your data in a 100% French cloud, independent of GAFAM.. + +To configure access to Leviia, follow the steps below: + +1. Run `rclone config` and select `n` for a new remote. + +``` +rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +``` + +2. Give the name of the configuration. For example, name it 'leviia'. + +``` +name> leviia +``` + +3. Select `s3` storage. + +``` +Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) +[snip] +Storage> s3 +``` + +4. Select `Leviia` provider. +``` +Choose a number from below, or type in your own value +1 / Amazon Web Services (AWS) S3 + \ "AWS" +[snip] +15 / Leviia Object Storage + \ (Leviia) +[snip] +provider> Leviia +``` + +5. Enter your SecretId and SecretKey of Leviia. + +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +access_key_id> ZnIx.xxxxxxxxxxxxxxx +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> xxxxxxxxxxx +``` + +6. Select endpoint for Leviia. + +``` + / The default endpoint + 1 | Leviia. + \ (s3.leviia.com) +[snip] +endpoint> 1 +``` +7. Choose acl. + +``` +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) +[snip] +acl> 1 +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[leviia] +- type: s3 +- provider: Leviia +- access_key_id: ZnIx.xxxxxxx +- secret_access_key: xxxxxxxx +- endpoint: s3.leviia.com +- acl: private +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: + +Name Type +==== ==== +leviia s3 +``` + +### Liara {#liara-cloud} + +Here is an example of making a [Liara Object Storage](https://liara.ir/landing/object-storage) +configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n +name> Liara +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) + \ "s3" +[snip] +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID - leave blank for anonymous access or runtime credentials. +access_key_id> YOURACCESSKEY +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YOURSECRETACCESSKEY +Region to connect to. +Choose a number from below, or type in your own value + / The default endpoint + 1 | US Region, Northern Virginia, or Pacific Northwest. + | Leave location constraint empty. + \ "us-east-1" +[snip] +region> +Endpoint for S3 API. +Leave blank if using Liara to use the default endpoint for the region. +Specify if using an S3 clone such as Ceph. +endpoint> storage.iran.liara.space +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" +[snip] +acl> +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" +storage_class> +Remote config +-------------------- +[Liara] +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +endpoint = storage.iran.liara.space +location_constraint = +acl = +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This will leave the config file looking like this. + +``` +[Liara] +type = s3 +provider = Liara +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = +endpoint = storage.iran.liara.space +location_constraint = +acl = +server_side_encryption = +storage_class = +``` + +### Linode {#linode} + +Here is an example of making a [Linode Object Storage](https://www.linode.com/products/object-storage/) +configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter name for new remote. +name> linode + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others + \ (s3) +[snip] +Storage> s3 + +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Linode Object Storage + \ (Linode) +[snip] +provider> Linode + +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> + +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> ACCESS_KEY + +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> SECRET_ACCESS_KEY + +Option endpoint. +Endpoint for Linode Object Storage API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Atlanta, GA (USA), us-southeast-1 + \ (us-southeast-1.linodeobjects.com) + 2 / Chicago, IL (USA), us-ord-1 + \ (us-ord-1.linodeobjects.com) + 3 / Frankfurt (Germany), eu-central-1 + \ (eu-central-1.linodeobjects.com) + 4 / Milan (Italy), it-mil-1 + \ (it-mil-1.linodeobjects.com) + 5 / Newark, NJ (USA), us-east-1 + \ (us-east-1.linodeobjects.com) + 6 / Paris (France), fr-par-1 + \ (fr-par-1.linodeobjects.com) + 7 / Seattle, WA (USA), us-sea-1 + \ (us-sea-1.linodeobjects.com) + 8 / Singapore ap-south-1 + \ (ap-south-1.linodeobjects.com) + 9 / Stockholm (Sweden), se-sto-1 + \ (se-sto-1.linodeobjects.com) +10 / Washington, DC, (USA), us-iad-1 + \ (us-iad-1.linodeobjects.com) +endpoint> 3 + +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) +[snip] +acl> + +Edit advanced config? +y) Yes +n) No (default) +y/n> n + +Configuration complete. +Options: +- type: s3 +- provider: Linode +- access_key_id: ACCESS_KEY +- secret_access_key: SECRET_ACCESS_KEY +- endpoint: eu-central-1.linodeobjects.com +Keep this "linode" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This will leave the config file looking like this. + +``` +[linode] +type = s3 +provider = Linode +access_key_id = ACCESS_KEY +secret_access_key = SECRET_ACCESS_KEY +endpoint = eu-central-1.linodeobjects.com +``` + +### ArvanCloud {#arvan-cloud} + +[ArvanCloud](https://www.arvancloud.com/en/products/cloud-storage) ArvanCloud Object Storage goes beyond the limited traditional file storage. +It gives you access to backup and archived files and allows sharing. +Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service. + +ArvanCloud provides an S3 interface which can be configured for use with +rclone like this. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n +name> ArvanCloud +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) + \ "s3" +[snip] +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID - leave blank for anonymous access or runtime credentials. +access_key_id> YOURACCESSKEY +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YOURSECRETACCESSKEY +Region to connect to. +Choose a number from below, or type in your own value + / The default endpoint - a good choice if you are unsure. + 1 | US Region, Northern Virginia, or Pacific Northwest. + | Leave location constraint empty. + \ "us-east-1" +[snip] +region> +Endpoint for S3 API. +Leave blank if using ArvanCloud to use the default endpoint for the region. +Specify if using an S3 clone such as Ceph. +endpoint> s3.arvanstorage.com +Location constraint - must be set to match the Region. Used when creating buckets only. +Choose a number from below, or type in your own value + 1 / Empty for Iran-Tehran Region. + \ "" +[snip] +location_constraint> +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" +[snip] +acl> +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" +storage_class> +Remote config +-------------------- +[ArvanCloud] +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = ir-thr-at1 +endpoint = s3.arvanstorage.com +location_constraint = +acl = +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This will leave the config file looking like this. + +``` +[ArvanCloud] +type = s3 +provider = ArvanCloud +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = +endpoint = s3.arvanstorage.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` + +### Tencent COS {#tencent-cos} + +[Tencent Cloud Object Storage (COS)](https://intl.cloud.tencent.com/product/cos) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost. + +To configure access to Tencent COS, follow the steps below: + +1. Run `rclone config` and select `n` for a new remote. + +``` +rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +``` + +2. Give the name of the configuration. For example, name it 'cos'. + +``` +name> cos +``` + +3. Select `s3` storage. + +``` +Choose a number from below, or type in your own value +1 / 1Fichier + \ "fichier" + 2 / Alias for an existing remote + \ "alias" + 3 / Amazon Drive + \ "amazon cloud drive" + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS + \ "s3" +[snip] +Storage> s3 +``` + +4. Select `TencentCOS` provider. +``` +Choose a number from below, or type in your own value +1 / Amazon Web Services (AWS) S3 + \ "AWS" +[snip] +11 / Tencent Cloud Object Storage (COS) + \ "TencentCOS" +[snip] +provider> TencentCOS +``` + +5. Enter your SecretId and SecretKey of Tencent Cloud. + +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" +env_auth> 1 +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +access_key_id> AKIDxxxxxxxxxx +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> xxxxxxxxxxx +``` + +6. Select endpoint for Tencent COS. This is the standard endpoint for different region. + +``` + 1 / Beijing Region. + \ "cos.ap-beijing.myqcloud.com" + 2 / Nanjing Region. + \ "cos.ap-nanjing.myqcloud.com" + 3 / Shanghai Region. + \ "cos.ap-shanghai.myqcloud.com" + 4 / Guangzhou Region. + \ "cos.ap-guangzhou.myqcloud.com" +[snip] +endpoint> 4 +``` + +7. Choose acl and storage class. + +``` +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Owner gets Full_CONTROL. No one else has access rights (default). + \ "default" +[snip] +acl> 1 +The storage class to use when storing new objects in Tencent COS. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Default + \ "" +[snip] +storage_class> 1 +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[cos] +type = s3 +provider = TencentCOS +env_auth = false +access_key_id = xxx +secret_access_key = xxx +endpoint = cos.ap-guangzhou.myqcloud.com +acl = default +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: + +Name Type +==== ==== +cos s3 +``` + +### Netease NOS + +For Netease NOS configure as per the configurator `rclone config` +setting the provider `Netease`. This will automatically set +`force_path_style = false` which is necessary for it to run properly. + +### Petabox + +Here is an example of making a [Petabox](https://petabox.io/) +configuration. First run: + +```bash +rclone config +``` + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n + +Enter name for new remote. +name> My Petabox Storage + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, ... + \ "s3" +[snip] +Storage> s3 + +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Petabox Object Storage + \ (Petabox) +[snip] +provider> Petabox + +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 + +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> YOUR_ACCESS_KEY_ID + +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YOUR_SECRET_ACCESS_KEY + +Option region. +Region where your bucket will be created and your data stored. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / US East (N. Virginia) + \ (us-east-1) + 2 / Europe (Frankfurt) + \ (eu-central-1) + 3 / Asia Pacific (Singapore) + \ (ap-southeast-1) + 4 / Middle East (Bahrain) + \ (me-south-1) + 5 / South America (São Paulo) + \ (sa-east-1) +region> 1 + +Option endpoint. +Endpoint for Petabox S3 Object Storage. +Specify the endpoint from the same region. +Choose a number from below, or type in your own value. + 1 / US East (N. Virginia) + \ (s3.petabox.io) + 2 / US East (N. Virginia) + \ (s3.us-east-1.petabox.io) + 3 / Europe (Frankfurt) + \ (s3.eu-central-1.petabox.io) + 4 / Asia Pacific (Singapore) + \ (s3.ap-southeast-1.petabox.io) + 5 / Middle East (Bahrain) + \ (s3.me-south-1.petabox.io) + 6 / South America (São Paulo) + \ (s3.sa-east-1.petabox.io) +endpoint> 1 + +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) +acl> 1 + +Edit advanced config? +y) Yes +n) No (default) +y/n> No + +Configuration complete. +Options: +- type: s3 +- provider: Petabox +- access_key_id: YOUR_ACCESS_KEY_ID +- secret_access_key: YOUR_SECRET_ACCESS_KEY +- region: us-east-1 +- endpoint: s3.petabox.io +Keep this "My Petabox Storage" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This will leave the config file looking like this. + +``` +[My Petabox Storage] +type = s3 +provider = Petabox +access_key_id = YOUR_ACCESS_KEY_ID +secret_access_key = YOUR_SECRET_ACCESS_KEY +region = us-east-1 +endpoint = s3.petabox.io +``` + +### Storj + +Storj is a decentralized cloud storage which can be used through its +native protocol or an S3 compatible gateway. + +The S3 compatible gateway is configured using `rclone config` with a +type of `s3` and with a provider name of `Storj`. Here is an example +run of the configurator. + +``` +Type of storage to configure. +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Choose a number from below, or type in your own boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> XXXX (as shown when creating the access grant) +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> XXXX (as shown when creating the access grant) +Option endpoint. +Endpoint of the Shared Gateway. Choose a number from below, or type in your own value. Press Enter to leave empty. - 1 / None - \ () - 2 / AES256 - \ (AES256) -server_side_encryption> -Option storage_class. -The storage class to use when storing new objects in ChinaMobile. + 1 / EU1 Shared Gateway + \ (gateway.eu1.storjshare.io) + 2 / US1 Shared Gateway + \ (gateway.us1.storjshare.io) + 3 / Asia-Pacific Shared Gateway + \ (gateway.ap1.storjshare.io) +endpoint> 1 (as shown when creating the access grant) +Edit advanced config? +y) Yes +n) No (default) +y/n> n +``` + +Note that s3 credentials are generated when you [create an access +grant](https://docs.storj.io/dcs/api-reference/s3-compatible-gateway#usage). + +#### Backend quirks + +- `--chunk-size` is forced to be 64 MiB or greater. This will use more + memory than the default of 5 MiB. +- Server side copy is disabled as it isn't currently supported in the + gateway. +- GetTier and SetTier are not supported. + +#### Backend bugs + +Due to [issue #39](https://github.com/storj/gateway-mt/issues/39) +uploading multipart files via the S3 gateway causes them to lose their +metadata. For rclone's purpose this means that the modification time +is not stored, nor is any MD5SUM (if one is available from the +source). + +This has the following consequences: + +- Using `rclone rcat` will fail as the medatada doesn't match after upload +- Uploading files with `rclone mount` will fail for the same reason + - This can worked around by using `--vfs-cache-mode writes` or `--vfs-cache-mode full` or setting `--s3-upload-cutoff` large +- Files uploaded via a multipart upload won't have their modtimes + - This will mean that `rclone sync` will likely keep trying to upload files bigger than `--s3-upload-cutoff` + - This can be worked around with `--checksum` or `--size-only` or setting `--s3-upload-cutoff` large + - The maximum value for `--s3-upload-cutoff` is 5GiB though + +One general purpose workaround is to set `--s3-upload-cutoff 5G`. This +means that rclone will upload files smaller than 5GiB as single parts. +Note that this can be set in the config file with `upload_cutoff = 5G` +or configured in the advanced settings. If you regularly transfer +files larger than 5G then using `--checksum` or `--size-only` in +`rclone sync` is the recommended workaround. + +#### Comparison with the native protocol + +Use the [the native protocol](/storj) to take advantage of +client-side encryption as well as to achieve the best possible +download performance. Uploads will be erasure-coded locally, thus a +1gb upload will result in 2.68gb of data being uploaded to storage +nodes across the network. + +Use this backend and the S3 compatible Hosted Gateway to increase +upload performance and reduce the load on your systems and network. +Uploads will be encrypted and erasure-coded server-side, thus a 1GB +upload will result in only in 1GB of data being uploaded to storage +nodes across the network. + +For more detailed comparison please check the documentation of the +[storj](/storj) backend. + +## Limitations + +`rclone about` is not supported by the S3 backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. + +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + + + +### Synology C2 Object Storage {#synology-c2} + +[Synology C2 Object Storage](https://c2.synology.com/en-global/object-storage/overview) provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty. + +The S3 compatible gateway is configured using `rclone config` with a +type of `s3` and with a provider name of `Synology`. Here is an example +run of the configurator. + +First run: + +``` +rclone config +``` + +This will guide you through an interactive setup process. + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config + +n/s/q> n + +Enter name for new remote.1 +name> syno + +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ "s3" + +Storage> s3 + +Choose your S3 provider. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 24 / Synology C2 Object Storage + \ (Synology) + +provider> Synology + +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" + +env_auth> 1 + +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). + +access_key_id> accesskeyid + +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). + +secret_access_key> secretaccesskey + +Region where your data stored. Choose a number from below, or type in your own value. Press Enter to leave empty. - 1 / Default - \ () - 2 / Standard storage class - \ (STANDARD) - 3 / Archive storage mode - \ (GLACIER) - 4 / Infrequent access storage mode - \ (STANDARD_IA) -storage_class> -Edit advanced config? + 1 / Europe Region 1 + \ (eu-001) + 2 / Europe Region 2 + \ (eu-002) + 3 / US Region 1 + \ (us-001) + 4 / US Region 2 + \ (us-002) + 5 / Asia (Taiwan) + \ (tw-001) + +region > 1 + +Option endpoint. +Endpoint for Synology C2 Object Storage API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / EU Endpoint 1 + \ (eu-001.s3.synologyc2.net) + 2 / US Endpoint 1 + \ (us-001.s3.synologyc2.net) + 3 / TW Endpoint 1 + \ (tw-001.s3.synologyc2.net) + +endpoint> 1 + +Option location_constraint. +Location constraint - must be set to match the Region. +Leave blank if not sure. Used when creating buckets only. +Enter a value. Press Enter to leave empty. +location_constraint> + +Edit advanced config? (y/n) +y) Yes +n) No +y/n> y + +Option no_check_bucket. +If set, don't attempt to check the bucket exists or create it. +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. +It can also be needed if the user you are using does not have bucket +creation permissions. Before v1.52.0 this would have passed silently +due to a bug. +Enter a boolean value (true or false). Press Enter for the default (true). + +no_check_bucket> true + +Configuration complete. +Options: +- type: s3 +- provider: Synology +- region: eu-001 +- endpoint: eu-001.s3.synologyc2.net +- no_check_bucket: true +Keep this "syno" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote + +y/e/d> y + +# Backblaze B2 + +B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). + +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. + +## Configuration + +Here is an example of making a b2 configuration. First run + + rclone config + +This will guide you through an interactive setup process. To authenticate +you will either need your Account ID (a short hex number) and Master +Application Key (a long hex number) OR an Application Key, which is the +recommended method. See below for further details on generating and using +an Application Key. + +``` +No remotes found, make a new one? +n) New remote +q) Quit config +n/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Backblaze B2 + \ "b2" +[snip] +Storage> b2 +Account ID or Application Key ID +account> 123456789abc +Application Key +key> 0123456789abcdef0123456789abcdef0123456789 +Endpoint for the service - leave blank normally. +endpoint> +Remote config +-------------------- +[remote] +account = 123456789abc +key = 0123456789abcdef0123456789abcdef0123456789 +endpoint = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This remote is called `remote` and can now be used like this + +See all buckets + + rclone lsd remote: + +Create a new bucket + + rclone mkdir remote:bucket + +List the contents of a bucket + + rclone ls remote:bucket + +Sync `/home/local/directory` to the remote bucket, deleting any +excess files in the bucket. + + rclone sync --interactive /home/local/directory remote:bucket + +### Application Keys + +B2 supports multiple [Application Keys for different access permission +to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). + +You can use these with rclone too; you will need to use rclone version 1.43 +or later. + +Follow Backblaze's docs to create an Application Key with the required +permission and add the `applicationKeyId` as the `account` and the +`Application Key` itself as the `key`. + +Note that you must put the _applicationKeyId_ as the `account` – you +can't use the master Account ID. If you try then B2 will return 401 +errors. + +### --fast-list + +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +### Modification times + +The modification time is stored as metadata on the object as +`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 +in the Backblaze standard. Other tools should be able to use this as +a modified time. + +Modified times are used in syncing and are fully supported. Note that +if a modification time needs to be updated on an object then it will +create a new version of the object. + +### Restricted filename characters + +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. + +Note that in 2020-05 Backblaze started allowing \ characters in file +names. Rclone hasn't changed its encoding as this could cause syncs to +re-transfer files. If you want rclone not to replace \ then see the +`--b2-encoding` flag below and remove the `BackSlash` from the +string. This can be set in the config. + +### SHA1 checksums + +The SHA1 checksums of the files are checked on upload and download and +will be used in the syncing process. + +Large files (bigger than the limit in `--b2-upload-cutoff`) which are +uploaded in chunks will store their SHA1 on the object as +`X-Bz-Info-large_file_sha1` as recommended by Backblaze. + +For a large file to be uploaded with an SHA1 checksum, the source +needs to support SHA1 checksums. The local disk supports SHA1 +checksums so large file transfers from local disk will have an SHA1. +See [the overview](https://rclone.org/overview/#features) for exactly which remotes +support SHA1. + +Sources which don't support SHA1, in particular `crypt` will upload +large files without SHA1 checksums. This may be fixed in the future +(see [#1767](https://github.com/rclone/rclone/issues/1767)). + +Files sizes below `--b2-upload-cutoff` will always have an SHA1 +regardless of the source. + +### Transfers + +Backblaze recommends that you do lots of transfers simultaneously for +maximum speed. In tests from my SSD equipped laptop the optimum +setting is about `--transfers 32` though higher numbers may be used +for a slight speed improvement. The optimum number for you may vary +depending on your hardware, how big the files are, how much you want +to load your computer, etc. The default of `--transfers 4` is +definitely too low for Backblaze B2 though. + +Note that uploading big files (bigger than 200 MiB by default) will use +a 96 MiB RAM buffer by default. There can be at most `--transfers` of +these in use at any moment, so this sets the upper limit on the memory +used. + +### Versions + +When rclone uploads a new version of a file it creates a [new version +of it](https://www.backblaze.com/b2/docs/file_versions.html). +Likewise when you delete a file, the old version will be marked hidden +and still be available. Conversely, you may opt in to a "hard delete" +of files with the `--b2-hard-delete` flag which would permanently remove +the file instead of hiding it. + +Old versions of files, where available, are visible using the +`--b2-versions` flag. + +It is also possible to view a bucket as it was at a certain point in time, +using the `--b2-version-at` flag. This will show the file versions as they +were at that time, showing files that have been deleted afterwards, and +hiding files that were created since. + +If you wish to remove all the old versions then you can use the +`rclone cleanup remote:bucket` command which will delete all the old +versions of files, leaving the current ones intact. You can also +supply a path and only old versions under that path will be deleted, +e.g. `rclone cleanup remote:bucket/path/to/stuff`. + +Note that `cleanup` will remove partially uploaded files from the bucket +if they are more than a day old. + +When you `purge` a bucket, the current and the old versions will be +deleted then the bucket will be deleted. + +However `delete` will cause the current versions of the files to +become hidden old versions. + +Here is a session showing the listing and retrieval of an old +version followed by a `cleanup` of the old versions. + +Show current version and all the versions with `--b2-versions` flag. + +``` +$ rclone -q ls b2:cleanup-test + 9 one.txt + +$ rclone -q --b2-versions ls b2:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +``` + +Retrieve an old version + +``` +$ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp + +$ ls -l /tmp/one-v2016-07-04-141003-000.txt +-rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +``` + +Clean up all the old versions and show that they've gone. + +``` +$ rclone -q cleanup b2:cleanup-test + +$ rclone -q ls b2:cleanup-test + 9 one.txt + +$ rclone -q --b2-versions ls b2:cleanup-test + 9 one.txt +``` + +#### Versions naming caveat + +When using `--b2-versions` flag rclone is relying on the file name +to work out whether the objects are versions or not. Versions' names +are created by inserting timestamp between file name and its extension. +``` + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt +``` +If there are real files present with the same names as versions, then +behaviour of `--b2-versions` can be unpredictable. + +### Data usage + +It is useful to know how many requests are sent to the server in different scenarios. + +All copy commands send the following 4 requests: + +``` +/b2api/v1/b2_authorize_account +/b2api/v1/b2_create_bucket +/b2api/v1/b2_list_buckets +/b2api/v1/b2_list_file_names +``` + +The `b2_list_file_names` request will be sent once for every 1k files +in the remote path, providing the checksum and modification time of +the listed files. As of version 1.33 issue +[#818](https://github.com/rclone/rclone/issues/818) causes extra requests +to be sent when using B2 with Crypt. When a copy operation does not +require any files to be uploaded, no more requests will be sent. + +Uploading files that do not require chunking, will send 2 requests per +file upload: + +``` +/b2api/v1/b2_get_upload_url +/b2api/v1/b2_upload_file/ +``` + +Uploading files requiring chunking, will send 2 requests (one each to +start and finish the upload) and another 2 requests for each chunk: + +``` +/b2api/v1/b2_start_large_file +/b2api/v1/b2_get_upload_part_url +/b2api/v1/b2_upload_part/ +/b2api/v1/b2_finish_large_file +``` + +#### Versions + +Versions can be viewed with the `--b2-versions` flag. When it is set +rclone will show and act on older versions of files. For example + +Listing without `--b2-versions` + +``` +$ rclone -q ls b2:cleanup-test + 9 one.txt +``` + +And with + +``` +$ rclone -q --b2-versions ls b2:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +``` + +Showing that the current version is unchanged but older versions can +be seen. These have the UTC date that they were uploaded to the +server to the nearest millisecond appended to them. + +Note that when using `--b2-versions` no file write operations are +permitted, so you can't upload files or delete them. + +### B2 and rclone link + +Rclone supports generating file share links for private B2 buckets. +They can either be for a file for example: + +``` +./rclone link B2:bucket/path/to/file.txt +https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx + +``` + +or if run on a directory you will get: + +``` +./rclone link B2:bucket/path +https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx +``` + +you can then use the authorization token (the part of the url from the + `?Authorization=` on) on any file path under that directory. For example: + +``` +https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx + +``` + + +### Standard options + +Here are the Standard options specific to b2 (Backblaze B2). + +#### --b2-account + +Account ID or Application Key ID. + +Properties: + +- Config: account +- Env Var: RCLONE_B2_ACCOUNT +- Type: string +- Required: true + +#### --b2-key + +Application Key. + +Properties: + +- Config: key +- Env Var: RCLONE_B2_KEY +- Type: string +- Required: true + +#### --b2-hard-delete + +Permanently delete files on remote removal, otherwise hide files. + +Properties: + +- Config: hard_delete +- Env Var: RCLONE_B2_HARD_DELETE +- Type: bool +- Default: false + +### Advanced options + +Here are the Advanced options specific to b2 (Backblaze B2). + +#### --b2-endpoint + +Endpoint for the service. + +Leave blank normally. + +Properties: + +- Config: endpoint +- Env Var: RCLONE_B2_ENDPOINT +- Type: string +- Required: false + +#### --b2-test-mode + +A flag string for X-Bz-Test-Mode header for debugging. + +This is for debugging purposes only. Setting it to one of the strings +below will cause b2 to return specific errors: + + * "fail_some_uploads" + * "expire_some_account_authorization_tokens" + * "force_cap_exceeded" + +These will be set in the "X-Bz-Test-Mode" header which is documented +in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). + +Properties: + +- Config: test_mode +- Env Var: RCLONE_B2_TEST_MODE +- Type: string +- Required: false + +#### --b2-versions + +Include old versions in directory listings. + +Note that when using this no file write operations are permitted, +so you can't upload files or delete them. + +Properties: + +- Config: versions +- Env Var: RCLONE_B2_VERSIONS +- Type: bool +- Default: false + +#### --b2-version-at + +Show file versions as they were at the specified time. + +Note that when using this no file write operations are permitted, +so you can't upload files or delete them. + +Properties: + +- Config: version_at +- Env Var: RCLONE_B2_VERSION_AT +- Type: Time +- Default: off + +#### --b2-upload-cutoff + +Cutoff for switching to chunked upload. + +Files above this size will be uploaded in chunks of "--b2-chunk-size". + +This value should be set no larger than 4.657 GiB (== 5 GB). + +Properties: + +- Config: upload_cutoff +- Env Var: RCLONE_B2_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 200Mi + +#### --b2-copy-cutoff + +Cutoff for switching to multipart copy. + +Any files larger than this that need to be server-side copied will be +copied in chunks of this size. + +The minimum is 0 and the maximum is 4.6 GiB. + +Properties: + +- Config: copy_cutoff +- Env Var: RCLONE_B2_COPY_CUTOFF +- Type: SizeSuffix +- Default: 4Gi + +#### --b2-chunk-size + +Upload chunk size. + +When uploading large files, chunk the file into this size. + +Must fit in memory. These chunks are buffered in memory and there +might a maximum of "--transfers" chunks in progress at once. + +5,000,000 Bytes is the minimum size. + +Properties: + +- Config: chunk_size +- Env Var: RCLONE_B2_CHUNK_SIZE +- Type: SizeSuffix +- Default: 96Mi + +#### --b2-upload-concurrency + +Concurrency for multipart uploads. + +This is the number of chunks of the same file that are uploaded +concurrently. + +Note that chunks are stored in memory and there may be up to +"--transfers" * "--b2-upload-concurrency" chunks stored at once +in memory. + +Properties: + +- Config: upload_concurrency +- Env Var: RCLONE_B2_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 + +#### --b2-disable-checksum + +Disable checksums for large (> upload cutoff) files. + +Normally rclone will calculate the SHA1 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. + +Properties: + +- Config: disable_checksum +- Env Var: RCLONE_B2_DISABLE_CHECKSUM +- Type: bool +- Default: false + +#### --b2-download-url + +Custom endpoint for downloads. + +This is usually set to a Cloudflare CDN URL as Backblaze offers +free egress for data downloaded through the Cloudflare network. +Rclone works with private buckets by sending an "Authorization" header. +If the custom endpoint rewrites the requests for authentication, +e.g., in Cloudflare Workers, this header needs to be handled properly. +Leave blank if you want to use the endpoint provided by Backblaze. + +The URL provided here SHOULD have the protocol and SHOULD NOT have +a trailing slash or specify the /file/bucket subpath as rclone will +request files with "{download_url}/file/{bucket_name}/{path}". + +Example: +> https://mysubdomain.mydomain.tld +(No trailing "/", "file" or "bucket") + +Properties: + +- Config: download_url +- Env Var: RCLONE_B2_DOWNLOAD_URL +- Type: string +- Required: false + +#### --b2-download-auth-duration + +Time before the authorization token will expire in s or suffix ms|s|m|h|d. + +The duration before the download authorization token will expire. +The minimum value is 1 second. The maximum value is one week. + +Properties: + +- Config: download_auth_duration +- Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION +- Type: Duration +- Default: 1w + +#### --b2-memory-pool-flush-time + +How often internal memory buffer pools will be flushed. (no longer used) + +Properties: + +- Config: memory_pool_flush_time +- Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s + +#### --b2-memory-pool-use-mmap + +Whether to use mmap buffers in internal memory pool. (no longer used) + +Properties: + +- Config: memory_pool_use_mmap +- Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false + +#### --b2-lifecycle + +Set the number of days deleted files should be kept when creating a bucket. + +On bucket creation, this parameter is used to create a lifecycle rule +for the entire bucket. + +If lifecycle is 0 (the default) it does not create a lifecycle rule so +the default B2 behaviour applies. This is to create versions of files +on delete and overwrite and to keep them indefinitely. + +If lifecycle is >0 then it creates a single rule setting the number of +days before a file that is deleted or overwritten is deleted +permanently. This is known as daysFromHidingToDeleting in the b2 docs. + +The minimum value for this parameter is 1 day. + +You can also enable hard_delete in the config also which will mean +deletions won't cause versions but overwrites will still cause +versions to be made. + +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. + + +Properties: + +- Config: lifecycle +- Env Var: RCLONE_B2_LIFECYCLE +- Type: int +- Default: 0 + +#### --b2-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_B2_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + +## Backend commands + +Here are the commands specific to the b2 backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). + +### lifecycle + +Read or set the lifecycle for a bucket + + rclone backend lifecycle remote: [options] [+] + +This command can be used to read or set the lifecycle for a bucket. + +Usage Examples: + +To show the current lifecycle rules: + + rclone backend lifecycle b2:bucket + +This will dump something like this showing the lifecycle rules. + + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] + +If there are no lifecycle rules (the default) then it will just return []. + +To reset the current lifecycle rules: + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 + +This will run and then print the new lifecycle rules as above. + +Rclone only lets you set lifecycles for the whole bucket with the +fileNamePrefix = "". + +You can't disable versioning with B2. The best you can do is to set +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in +the config also which will mean deletions won't cause versions but +overwrites will still cause versions to be made. + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 + +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules + + +Options: + +- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off. +- "daysFromUploadingToHiding": This many days after uploading a file is hidden + + + +## Limitations + +`rclone about` is not supported by the B2 backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. + +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + +# Box + +Paths are specified as `remote:path` + +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + +The initial setup for Box involves getting a token from Box which you +can do either in your browser, or with a config.json downloaded from Box +to use JWT authentication. `rclone config` walks you through it. + +## Configuration + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Box + \ "box" +[snip] +Storage> box +Box App Client Id - leave blank normally. +client_id> +Box App Client Secret - leave blank normally. +client_secret> +Box App config.json location +Leave blank normally. +Enter a string value. Press Enter for the default (""). +box_config_file> +Box App Primary Access Token +Leave blank normally. +Enter a string value. Press Enter for the default (""). +access_token> + +Enter a string value. Press Enter for the default ("user"). +Choose a number from below, or type in your own value + 1 / Rclone should act on behalf of a user + \ "user" + 2 / Rclone should act on behalf of a service account + \ "enterprise" +box_sub_type> +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. y) Yes -n) No (default) +n) No +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code +-------------------- +[remote] +client_id = +client_secret = +token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. + +Note that rclone runs a webserver on your local machine to collect the +token as returned from Box. This only runs from the moment it opens +your browser to the moment you get back the verification code. This +is on `http://127.0.0.1:53682/` and this it may require you to unblock +it temporarily if you are running a host firewall. + +Once configured you can then use `rclone` like this, + +List directories in top level of your Box + + rclone lsd remote: + +List all the files in your Box + + rclone ls remote: + +To copy a local directory to an Box directory called backup + + rclone copy /home/source remote:backup + +### Using rclone with an Enterprise account with SSO + +If you have an "Enterprise" account type with Box with single sign on +(SSO), you need to create a password to use Box with rclone. This can +be done at your Enterprise Box account by going to Settings, "Account" +Tab, and then set the password in the "Authentication" field. + +Once you have done this, you can setup your Enterprise Box account +using the same procedure detailed above in the, using the password you +have just set. + +### Invalid refresh token + +According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): + +> Each refresh_token is valid for one use in 60 days. + +This means that if you + + * Don't use the box remote for 60 days + * Copy the config file with a box refresh token in and use it in two places + * Get an error on a token refresh + +then rclone will return an error which includes the text `Invalid +refresh token`. + +To fix this you will need to use oauth2 again to update the refresh +token. You can use the methods in [the remote setup +docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the +config file method, you should not use that remote on the computer you +did the authentication on. + +Here is how to do it. + +``` +$ rclone config +Current remotes: + +Name Type +==== ==== +remote box + +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> e +Choose a number from below, or type in an existing value + 1 > remote +remote> remote +-------------------- +[remote] +type = box +token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} +-------------------- +Edit remote +Value "client_id" = "" +Edit? (y/n)> +y) Yes +n) No +y/n> n +Value "client_secret" = "" +Edit? (y/n)> +y) Yes +n) No y/n> n +Remote config +Already have a token - refresh? +y) Yes +n) No +y/n> y +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes +n) No +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code -------------------- -[ChinaMobile] -type = s3 -provider = ChinaMobile -access_key_id = accesskeyid -secret_access_key = secretaccesskey -endpoint = eos-wuxi-1.cmecloud.cn -location_constraint = wuxi1 -acl = private +[remote] +type = box +token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -### Liara {#liara-cloud} +### Modification times and hashes + +Box allows modification times to be set on objects accurate to 1 +second. These will be used to detect whether objects need syncing or +not. + +Box supports SHA1 type hashes, so you can use the `--checksum` +flag. + +### Restricted filename characters + +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | + +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. + +### Transfers + +For files above 50 MiB rclone will use a chunked transfer. Rclone will +upload up to `--transfers` chunks at the same time (shared among all +the multipart uploads). Chunks are buffered in memory and are +normally 8 MiB so increasing `--transfers` will increase memory use. + +### Deleting files + +Depending on the enterprise settings for your user, the item will +either be actually deleted from Box or moved to the trash. + +Emptying the trash is supported via the rclone however cleanup command +however this deletes every trashed file and folder individually so it +may take a very long time. +Emptying the trash via the WebUI does not have this limitation +so it is advised to empty the trash via the WebUI. + +### Root folder ID + +You can set the `root_folder_id` for rclone. This is the directory +(identified by its `Folder ID`) that rclone considers to be the root +of your Box drive. + +Normally you will leave this blank and rclone will determine the +correct root to use itself. + +However you can set this to restrict rclone to a specific folder +hierarchy. + +In order to do this you will have to find the `Folder ID` of the +directory you wish rclone to display. This will be the last segment +of the URL when you open the relevant folder in the Box web +interface. + +So if the folder you want rclone to use has a URL which looks like +`https://app.box.com/folder/11xxxxxxxxx8` +in the browser, then you use `11xxxxxxxxx8` as +the `root_folder_id` in the config. + + +### Standard options + +Here are the Standard options specific to box (Box). + +#### --box-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_BOX_CLIENT_ID +- Type: string +- Required: false + +#### --box-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_BOX_CLIENT_SECRET +- Type: string +- Required: false + +#### --box-box-config-file + +Box App config.json location + +Leave blank normally. + +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. + +Properties: + +- Config: box_config_file +- Env Var: RCLONE_BOX_BOX_CONFIG_FILE +- Type: string +- Required: false + +#### --box-access-token + +Box App Primary Access Token + +Leave blank normally. + +Properties: + +- Config: access_token +- Env Var: RCLONE_BOX_ACCESS_TOKEN +- Type: string +- Required: false + +#### --box-box-sub-type + + + +Properties: + +- Config: box_sub_type +- Env Var: RCLONE_BOX_BOX_SUB_TYPE +- Type: string +- Default: "user" +- Examples: + - "user" + - Rclone should act on behalf of a user. + - "enterprise" + - Rclone should act on behalf of a service account. + +### Advanced options + +Here are the Advanced options specific to box (Box). + +#### --box-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_BOX_TOKEN +- Type: string +- Required: false + +#### --box-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_BOX_AUTH_URL +- Type: string +- Required: false + +#### --box-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_BOX_TOKEN_URL +- Type: string +- Required: false + +#### --box-root-folder-id + +Fill in for rclone to use a non root folder as its starting point. + +Properties: + +- Config: root_folder_id +- Env Var: RCLONE_BOX_ROOT_FOLDER_ID +- Type: string +- Default: "0" + +#### --box-upload-cutoff + +Cutoff for switching to multipart upload (>= 50 MiB). + +Properties: + +- Config: upload_cutoff +- Env Var: RCLONE_BOX_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 50Mi + +#### --box-commit-retries + +Max number of times to try committing a multipart file. + +Properties: + +- Config: commit_retries +- Env Var: RCLONE_BOX_COMMIT_RETRIES +- Type: int +- Default: 100 + +#### --box-list-chunk + +Size of listing chunk 1-1000. + +Properties: + +- Config: list_chunk +- Env Var: RCLONE_BOX_LIST_CHUNK +- Type: int +- Default: 1000 + +#### --box-owned-by + +Only show items owned by the login (email address) passed in. + +Properties: + +- Config: owned_by +- Env Var: RCLONE_BOX_OWNED_BY +- Type: string +- Required: false + +#### --box-impersonate + +Impersonate this user ID when using a service account. + +Setting this flag allows rclone, when using a JWT service account, to +act on behalf of another user by setting the as-user header. + +The user ID is the Box identifier for a user. User IDs can found for +any user via the GET /users endpoint, which is only available to +admins, or by calling the GET /users/me endpoint with an authenticated +user session. + +See: https://developer.box.com/guides/authentication/jwt/as-user/ + + +Properties: + +- Config: impersonate +- Env Var: RCLONE_BOX_IMPERSONATE +- Type: string +- Required: false + +#### --box-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_BOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot + + + +## Limitations + +Note that Box is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". + +Box file names can't have the `\` character in. rclone maps this to +and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth +Reverse Solidus). + +Box only supports filenames up to 255 characters in length. + +Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. + +`rclone about` is not supported by the Box backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. + +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Here is an example of making a [Liara Object Storage](https://liara.ir/landing/object-storage) -configuration. First run: +## Get your own Box App ID - rclone config +Here is how to create your own Box App ID for rclone: -This will guide you through an interactive setup process. +1. Go to the [Box Developer Console](https://app.box.com/developers/console) +and login, then click `My Apps` on the sidebar. Click `Create New App` +and select `Custom App`. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -n/s> n -name> Liara -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) - \ "s3" -[snip] -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID - leave blank for anonymous access or runtime credentials. -access_key_id> YOURACCESSKEY -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YOURSECRETACCESSKEY -Region to connect to. -Choose a number from below, or type in your own value - / The default endpoint - 1 | US Region, Northern Virginia, or Pacific Northwest. - | Leave location constraint empty. - \ "us-east-1" -[snip] -region> -Endpoint for S3 API. -Leave blank if using Liara to use the default endpoint for the region. -Specify if using an S3 clone such as Ceph. -endpoint> storage.iran.liara.space -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" -[snip] -acl> -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" -storage_class> -Remote config --------------------- -[Liara] -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -endpoint = storage.iran.liara.space -location_constraint = -acl = -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +2. In the first screen on the box that pops up, you can pretty much enter +whatever you want. The `App Name` can be whatever. For `Purpose` choose +automation to avoid having to fill out anything else. Click `Next`. -This will leave the config file looking like this. +3. In the second screen of the creation screen, select +`User Authentication (OAuth 2.0)`. Then click `Create App`. -``` -[Liara] -type = s3 -provider = Liara -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = -endpoint = storage.iran.liara.space -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +4. You should now be on the `Configuration` tab of your new app. If not, +click on it at the top of the webpage. Copy down `Client ID` +and `Client Secret`, you'll need those for rclone. -### ArvanCloud {#arvan-cloud} +5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` -[ArvanCloud](https://www.arvancloud.com/en/products/cloud-storage) ArvanCloud Object Storage goes beyond the limited traditional file storage. -It gives you access to backup and archived files and allows sharing. -Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service. +6. For `Application Scopes`, select `Read all files and folders stored in Box` +and `Write all files and folders stored in box` (assuming you want to do both). +Leave others unchecked. Click `Save Changes` at the top right. -ArvanCloud provides an S3 interface which can be configured for use with -rclone like this. +# Cache + +The `cache` remote wraps another existing remote and stores file structure +and its data for long running tasks like `rclone mount`. + +## Status + +The cache backend code is working but it currently doesn't +have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. + +The cache backend is due to be phased out in favour of the VFS caching +layer eventually which is more tightly integrated into rclone. + +Until this happens we recommend only using the cache backend if you +find you can't work without it. There are many docs online describing +the use of the cache backend to minimize API hits and by-and-large +these are out of date and the cache backend isn't needed in those +scenarios any more. + +## Configuration + +To get started you just need to have an existing remote which can be configured +with `cache`. + +Here is an example of how to make a remote called `test-cache`. First run: + + rclone config + +This will guide you through an interactive setup process: ``` No remotes found, make a new one? n) New remote +r) Rename remote +c) Copy remote s) Set configuration password -n/s> n -name> ArvanCloud +q) Quit config +n/r/c/s/q> n +name> test-cache Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) - \ "s3" -[snip] -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID - leave blank for anonymous access or runtime credentials. -access_key_id> YOURACCESSKEY -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YOURSECRETACCESSKEY -Region to connect to. -Choose a number from below, or type in your own value - / The default endpoint - a good choice if you are unsure. - 1 | US Region, Northern Virginia, or Pacific Northwest. - | Leave location constraint empty. - \ "us-east-1" -[snip] -region> -Endpoint for S3 API. -Leave blank if using ArvanCloud to use the default endpoint for the region. -Specify if using an S3 clone such as Ceph. -endpoint> s3.arvanstorage.com -Location constraint - must be set to match the Region. Used when creating buckets only. -Choose a number from below, or type in your own value - 1 / Empty for Iran-Tehran Region. - \ "" +XX / Cache a remote + \ "cache" [snip] -location_constraint> -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Storage> cache +Remote to cache. +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). +remote> local:/test +Optional: The URL of the Plex server +plex_url> http://127.0.0.1:32400 +Optional: The username of the Plex user +plex_username> dummyusername +Optional: The password of the Plex user +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank +y/g/n> y +Enter the password: +password: +Confirm the password: +password: +The size of a chunk. Lower value good for slow connections but can affect seamless reading. +Default: 5M Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" -[snip] -acl> -The server-side encryption algorithm used when storing this object in S3. + 1 / 1 MiB + \ "1M" + 2 / 5 MiB + \ "5M" + 3 / 10 MiB + \ "10M" +chunk_size> 2 +How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. +Accepted units are: "s", "m", "h". +Default: 5m Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> -The storage class to use when storing objects in S3. + 1 / 1 hour + \ "1h" + 2 / 24 hours + \ "24h" + 3 / 24 hours + \ "48h" +info_age> 2 +The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. +Default: 10G Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" -storage_class> + 1 / 500 MiB + \ "500M" + 2 / 1 GiB + \ "1G" + 3 / 10 GiB + \ "10G" +chunk_total_size> 3 Remote config -------------------- -[ArvanCloud] -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = ir-thr-at1 -endpoint = s3.arvanstorage.com -location_constraint = -acl = -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y +[test-cache] +remote = local:/test +plex_url = http://127.0.0.1:32400 +plex_username = dummyusername +plex_password = *** ENCRYPTED *** +chunk_size = 5M +info_age = 48h +chunk_total_size = 10G ``` -This will leave the config file looking like this. +You can then use it like this, -``` -[ArvanCloud] -type = s3 -provider = ArvanCloud -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = -endpoint = s3.arvanstorage.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +List directories in top level of your drive -### Tencent COS {#tencent-cos} + rclone lsd test-cache: -[Tencent Cloud Object Storage (COS)](https://intl.cloud.tencent.com/product/cos) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost. +List all the files in your drive -To configure access to Tencent COS, follow the steps below: + rclone ls test-cache: -1. Run `rclone config` and select `n` for a new remote. +To start a cached mount -``` -rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -``` + rclone mount --allow-other test-cache: /var/tmp/test-cache + +### Write Features ### + +### Offline uploading ### + +In an effort to make writing through cache more reliable, the backend +now supports this feature which can be activated by specifying a +`cache-tmp-upload-path`. + +A files goes through these states when using this feature: + +1. An upload is started (usually by copying a file on the cache remote) +2. When the copy to the temporary location is complete the file is part +of the cached remote and looks and behaves like any other file (reading included) +3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` +is used to move the file to the cloud provider +4. Reading the file still works during the upload but most modifications on it will be prohibited +5. Once the move is complete the file is unlocked for modifications as it +becomes as any other regular file +6. If the file is being read through `cache` when it's actually +deleted from the temporary path then `cache` will simply swap the source +to the cloud provider without interrupting the reading (small blip can happen though) + +Files are uploaded in sequence and only one file is uploaded at a time. +Uploads will be stored in a queue and be processed based on the order they were added. +The queue and the temporary storage is persistent across restarts but +can be cleared on startup with the `--cache-db-purge` flag. + +### Write Support ### + +Writes are supported through `cache`. +One caveat is that a mounted cache remote does not add any retry or fallback +mechanism to the upload operation. This will depend on the implementation +of the wrapped remote. Consider using `Offline uploading` for reliable writes. + +One special case is covered with `cache-writes` which will cache the file +data at the same time as the upload when it is enabled making it available +from the cache store immediately once the upload is finished. + +### Read Features ### + +#### Multiple connections #### + +To counter the high latency between a local PC where rclone is running +and cloud providers, the cache remote can split multiple requests to the +cloud provider for smaller file chunks and combines them together locally +where they can be available almost immediately before the reader usually +needs them. + +This is similar to buffering when media files are played online. Rclone +will stay around the current marker but always try its best to stay ahead +and prepare the data before. + +#### Plex Integration #### + +There is a direct integration with Plex which allows cache to detect during reading +if the file is in playback or not. This helps cache to adapt how it queries +the cloud provider depending on what is needed for. + +Scans will have a minimum amount of workers (1) while in a confirmed playback cache +will deploy the configured number of workers. + +This integration opens the doorway to additional performance improvements +which will be explored in the near future. + +**Note:** If Plex options are not configured, `cache` will function with its +configured options without adapting any of its settings. + +How to enable? Run `rclone config` and add all the Plex options (endpoint, username +and password) in your remote and it will be automatically enabled. + +Affected settings: +- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times + +##### Certificate Validation ##### + +When the Plex server is configured to only accept secure connections, it is +possible to use `.plex.direct` URLs to ensure certificate validation succeeds. +These URLs are used by Plex internally to connect to the Plex server securely. + +The format for these URLs is the following: + +`https://ip-with-dots-replaced.server-hash.plex.direct:32400/` + +The `ip-with-dots-replaced` part can be any IPv4 address, where the dots +have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. + +To get the `server-hash` part, the easiest way is to visit + +https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token + +This page will list all the available Plex servers for your account +with at least one `.plex.direct` link for each. Copy one URL and replace +the IP address with the desired address. This can be used as the +`plex_url` value. + +### Known issues ### + +#### Mount and --dir-cache-time #### + +--dir-cache-time controls the first layer of directory caching which works at the mount layer. +Being an independent caching mechanism from the `cache` backend, it will manage its own entries +based on the configured time. + +To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct +one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are +already configured in this way. + +#### Windows support - Experimental #### + +There are a couple of issues with Windows `mount` functionality that still require some investigations. +It should be considered as experimental thus far as fixes come in for this OS. + +Most of the issues seem to be related to the difference between filesystems +on Linux flavors and Windows as cache is heavily dependent on them. + +Any reports or feedback on how cache behaves on this OS is greatly appreciated. + +- https://github.com/rclone/rclone/issues/1935 +- https://github.com/rclone/rclone/issues/1907 +- https://github.com/rclone/rclone/issues/1834 + +#### Risk of throttling #### + +Future iterations of the cache backend will make use of the pooling functionality +of the cloud provider to synchronize and at the same time make writing through it +more tolerant to failures. + +There are a couple of enhancements in track to add these but in the meantime +there is a valid concern that the expiring cache listings can lead to cloud provider +throttles or bans due to repeated queries on it for very large mounts. + +Some recommendations: +- don't use a very small interval for entry information (`--cache-info-age`) +- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage +of adding the file in the cache at the same time if configured to do so. + +Future enhancements: + +- https://github.com/rclone/rclone/issues/1937 +- https://github.com/rclone/rclone/issues/1936 + +#### cache and crypt #### + +One common scenario is to keep your data encrypted in the cloud provider +using the `crypt` remote. `crypt` uses a similar technique to wrap around +an existing remote and handles this translation in a seamless way. + +There is an issue with wrapping the remotes in this order: +**cloud remote** -> **crypt** -> **cache** + +During testing, I experienced a lot of bans with the remotes in this order. +I suspect it might be related to how crypt opens files on the cloud provider +which makes it think we're downloading the full file instead of small chunks. +Organizing the remotes in this order yields better results: +**cloud remote** -> **cache** -> **crypt** + +#### absolute remote paths #### + +`cache` can not differentiate between relative and absolute paths for the wrapped remote. +Any path given in the `remote` config setting and on the command line will be passed to +the wrapped remote as is, but for storing the chunks on disk the path will be made +relative by removing any leading `/` character. + +This behavior is irrelevant for most backend types, but there are backends where a leading `/` +changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are +relative to the root of the SSH server and paths without are relative to the user home directory. +As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent +a different directory on the SSH server. + +### Cache and Remote Control (--rc) ### +Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: +By default, the listener is disabled if you do not add the flag. + +### rc cache/expire +Purge a remote from the cache backend. Supports either a directory or a file. +It supports both encrypted and unencrypted file names if cache is wrapped by crypt. + +Params: + - **remote** = path to remote **(required)** + - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ + + +### Standard options + +Here are the Standard options specific to cache (Cache a remote). + +#### --cache-remote + +Remote to cache. + +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). + +Properties: + +- Config: remote +- Env Var: RCLONE_CACHE_REMOTE +- Type: string +- Required: true + +#### --cache-plex-url + +The URL of the Plex server. + +Properties: + +- Config: plex_url +- Env Var: RCLONE_CACHE_PLEX_URL +- Type: string +- Required: false + +#### --cache-plex-username + +The username of the Plex user. + +Properties: + +- Config: plex_username +- Env Var: RCLONE_CACHE_PLEX_USERNAME +- Type: string +- Required: false -2. Give the name of the configuration. For example, name it 'cos'. +#### --cache-plex-password -``` -name> cos -``` +The password of the Plex user. -3. Select `s3` storage. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -``` -Choose a number from below, or type in your own value -1 / 1Fichier - \ "fichier" - 2 / Alias for an existing remote - \ "alias" - 3 / Amazon Drive - \ "amazon cloud drive" - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS - \ "s3" -[snip] -Storage> s3 -``` +Properties: -4. Select `TencentCOS` provider. -``` -Choose a number from below, or type in your own value -1 / Amazon Web Services (AWS) S3 - \ "AWS" -[snip] -11 / Tencent Cloud Object Storage (COS) - \ "TencentCOS" -[snip] -provider> TencentCOS -``` +- Config: plex_password +- Env Var: RCLONE_CACHE_PLEX_PASSWORD +- Type: string +- Required: false -5. Enter your SecretId and SecretKey of Tencent Cloud. +#### --cache-chunk-size -``` -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -Choose a number from below, or type in your own value - 1 / Enter AWS credentials in the next step - \ "false" - 2 / Get AWS credentials from the environment (env vars or IAM) - \ "true" -env_auth> 1 -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -access_key_id> AKIDxxxxxxxxxx -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> xxxxxxxxxxx -``` +The size of a chunk (partial file data). -6. Select endpoint for Tencent COS. This is the standard endpoint for different region. +Use lower numbers for slower connections. If the chunk size is +changed, any downloaded chunks will be invalid and cache-chunk-path +will need to be cleared or unexpected EOF errors will occur. -``` - 1 / Beijing Region. - \ "cos.ap-beijing.myqcloud.com" - 2 / Nanjing Region. - \ "cos.ap-nanjing.myqcloud.com" - 3 / Shanghai Region. - \ "cos.ap-shanghai.myqcloud.com" - 4 / Guangzhou Region. - \ "cos.ap-guangzhou.myqcloud.com" -[snip] -endpoint> 4 -``` +Properties: -7. Choose acl and storage class. +- Config: chunk_size +- Env Var: RCLONE_CACHE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 5Mi +- Examples: + - "1M" + - 1 MiB + - "5M" + - 5 MiB + - "10M" + - 10 MiB -``` -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Owner gets Full_CONTROL. No one else has access rights (default). - \ "default" -[snip] -acl> 1 -The storage class to use when storing new objects in Tencent COS. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Default - \ "" -[snip] -storage_class> 1 -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[cos] -type = s3 -provider = TencentCOS -env_auth = false -access_key_id = xxx -secret_access_key = xxx -endpoint = cos.ap-guangzhou.myqcloud.com -acl = default --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +#### --cache-info-age -Name Type -==== ==== -cos s3 -``` +How long to cache file structure information (directory listings, file size, times, etc.). +If all write operations are done through the cache then you can safely make +this value very large as the cache store will also be updated in real time. -### Netease NOS +Properties: -For Netease NOS configure as per the configurator `rclone config` -setting the provider `Netease`. This will automatically set -`force_path_style = false` which is necessary for it to run properly. +- Config: info_age +- Env Var: RCLONE_CACHE_INFO_AGE +- Type: Duration +- Default: 6h0m0s +- Examples: + - "1h" + - 1 hour + - "24h" + - 24 hours + - "48h" + - 48 hours -### Storj +#### --cache-chunk-total-size -Storj is a decentralized cloud storage which can be used through its -native protocol or an S3 compatible gateway. +The total size that the chunks can take up on the local disk. -The S3 compatible gateway is configured using `rclone config` with a -type of `s3` and with a provider name of `Storj`. Here is an example -run of the configurator. +If the cache exceeds this value then it will start to delete the +oldest chunks until it goes under this value. -``` -Type of storage to configure. -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Choose a number from below, or type in your own boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> XXXX (as shown when creating the access grant) -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> XXXX (as shown when creating the access grant) -Option endpoint. -Endpoint of the Shared Gateway. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / EU1 Shared Gateway - \ (gateway.eu1.storjshare.io) - 2 / US1 Shared Gateway - \ (gateway.us1.storjshare.io) - 3 / Asia-Pacific Shared Gateway - \ (gateway.ap1.storjshare.io) -endpoint> 1 (as shown when creating the access grant) -Edit advanced config? -y) Yes -n) No (default) -y/n> n -``` +Properties: -Note that s3 credentials are generated when you [create an access -grant](https://docs.storj.io/dcs/api-reference/s3-compatible-gateway#usage). +- Config: chunk_total_size +- Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE +- Type: SizeSuffix +- Default: 10Gi +- Examples: + - "500M" + - 500 MiB + - "1G" + - 1 GiB + - "10G" + - 10 GiB -#### Backend quirks +### Advanced options -- `--chunk-size` is forced to be 64 MiB or greater. This will use more - memory than the default of 5 MiB. -- Server side copy is disabled as it isn't currently supported in the - gateway. -- GetTier and SetTier are not supported. +Here are the Advanced options specific to cache (Cache a remote). -#### Backend bugs +#### --cache-plex-token -Due to [issue #39](https://github.com/storj/gateway-mt/issues/39) -uploading multipart files via the S3 gateway causes them to lose their -metadata. For rclone's purpose this means that the modification time -is not stored, nor is any MD5SUM (if one is available from the -source). +The plex token for authentication - auto set normally. -This has the following consequences: +Properties: -- Using `rclone rcat` will fail as the medatada doesn't match after upload -- Uploading files with `rclone mount` will fail for the same reason - - This can worked around by using `--vfs-cache-mode writes` or `--vfs-cache-mode full` or setting `--s3-upload-cutoff` large -- Files uploaded via a multipart upload won't have their modtimes - - This will mean that `rclone sync` will likely keep trying to upload files bigger than `--s3-upload-cutoff` - - This can be worked around with `--checksum` or `--size-only` or setting `--s3-upload-cutoff` large - - The maximum value for `--s3-upload-cutoff` is 5GiB though +- Config: plex_token +- Env Var: RCLONE_CACHE_PLEX_TOKEN +- Type: string +- Required: false -One general purpose workaround is to set `--s3-upload-cutoff 5G`. This -means that rclone will upload files smaller than 5GiB as single parts. -Note that this can be set in the config file with `upload_cutoff = 5G` -or configured in the advanced settings. If you regularly transfer -files larger than 5G then using `--checksum` or `--size-only` in -`rclone sync` is the recommended workaround. +#### --cache-plex-insecure -#### Comparison with the native protocol +Skip all certificate verification when connecting to the Plex server. -Use the [the native protocol](/storj) to take advantage of -client-side encryption as well as to achieve the best possible -download performance. Uploads will be erasure-coded locally, thus a -1gb upload will result in 2.68gb of data being uploaded to storage -nodes across the network. +Properties: -Use this backend and the S3 compatible Hosted Gateway to increase -upload performance and reduce the load on your systems and network. -Uploads will be encrypted and erasure-coded server-side, thus a 1GB -upload will result in only in 1GB of data being uploaded to storage -nodes across the network. +- Config: plex_insecure +- Env Var: RCLONE_CACHE_PLEX_INSECURE +- Type: string +- Required: false -For more detailed comparison please check the documentation of the -[storj](/storj) backend. +#### --cache-db-path -## Limitations +Directory to store file structure metadata DB. -`rclone about` is not supported by the S3 backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +The remote name is used as the DB file name. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +Properties: -# Backblaze B2 +- Config: db_path +- Env Var: RCLONE_CACHE_DB_PATH +- Type: string +- Default: "$HOME/.cache/rclone/cache-backend" -B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). +#### --cache-chunk-path -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +Directory to cache chunk files. -## Configuration +Path to where partial file data (chunks) are stored locally. The remote +name is appended to the final path. -Here is an example of making a b2 configuration. First run +This config follows the "--cache-db-path". If you specify a custom +location for "--cache-db-path" and don't specify one for "--cache-chunk-path" +then "--cache-chunk-path" will use the same path as "--cache-db-path". - rclone config +Properties: -This will guide you through an interactive setup process. To authenticate -you will either need your Account ID (a short hex number) and Master -Application Key (a long hex number) OR an Application Key, which is the -recommended method. See below for further details on generating and using -an Application Key. +- Config: chunk_path +- Env Var: RCLONE_CACHE_CHUNK_PATH +- Type: string +- Default: "$HOME/.cache/rclone/cache-backend" -``` -No remotes found, make a new one? -n) New remote -q) Quit config -n/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Backblaze B2 - \ "b2" -[snip] -Storage> b2 -Account ID or Application Key ID -account> 123456789abc -Application Key -key> 0123456789abcdef0123456789abcdef0123456789 -Endpoint for the service - leave blank normally. -endpoint> -Remote config --------------------- -[remote] -account = 123456789abc -key = 0123456789abcdef0123456789abcdef0123456789 -endpoint = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +#### --cache-db-purge -This remote is called `remote` and can now be used like this +Clear all the cached data for this remote on start. -See all buckets +Properties: - rclone lsd remote: +- Config: db_purge +- Env Var: RCLONE_CACHE_DB_PURGE +- Type: bool +- Default: false -Create a new bucket +#### --cache-chunk-clean-interval - rclone mkdir remote:bucket +How often should the cache perform cleanups of the chunk storage. -List the contents of a bucket +The default value should be ok for most people. If you find that the +cache goes over "cache-chunk-total-size" too often then try to lower +this value to force it to perform cleanups more often. - rclone ls remote:bucket +Properties: -Sync `/home/local/directory` to the remote bucket, deleting any -excess files in the bucket. +- Config: chunk_clean_interval +- Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL +- Type: Duration +- Default: 1m0s - rclone sync --interactive /home/local/directory remote:bucket +#### --cache-read-retries -### Application Keys +How many times to retry a read from a cache storage. -B2 supports multiple [Application Keys for different access permission -to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). +Since reading from a cache stream is independent from downloading file +data, readers can get to a point where there's no more data in the +cache. Most of the times this can indicate a connectivity issue if +cache isn't able to provide file data anymore. -You can use these with rclone too; you will need to use rclone version 1.43 -or later. +For really slow connections, increase this to a point where the stream is +able to provide data but your experience will be very stuttering. -Follow Backblaze's docs to create an Application Key with the required -permission and add the `applicationKeyId` as the `account` and the -`Application Key` itself as the `key`. +Properties: -Note that you must put the _applicationKeyId_ as the `account` – you -can't use the master Account ID. If you try then B2 will return 401 -errors. +- Config: read_retries +- Env Var: RCLONE_CACHE_READ_RETRIES +- Type: int +- Default: 10 -### --fast-list +#### --cache-workers -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +How many workers should run in parallel to download chunks. -### Modified time +Higher values will mean more parallel processing (better CPU needed) +and more concurrent requests on the cloud provider. This impacts +several aspects like the cloud provider API limits, more stress on the +hardware that rclone runs on but it also means that streams will be +more fluid and data will be available much more faster to readers. -The modified time is stored as metadata on the object as -`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 -in the Backblaze standard. Other tools should be able to use this as -a modified time. +**Note**: If the optional Plex integration is enabled then this +setting will adapt to the type of reading performed and the value +specified here will be used as a maximum number of workers to use. -Modified times are used in syncing and are fully supported. Note that -if a modification time needs to be updated on an object then it will -create a new version of the object. +Properties: -### Restricted filename characters +- Config: workers +- Env Var: RCLONE_CACHE_WORKERS +- Type: int +- Default: 4 -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +#### --cache-chunk-no-memory -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \ | 0x5C | \ | +Disable the in-memory cache for storing chunks during streaming. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +By default, cache will keep file data during streaming in RAM as well +to provide it to readers as fast as possible. -Note that in 2020-05 Backblaze started allowing \ characters in file -names. Rclone hasn't changed its encoding as this could cause syncs to -re-transfer files. If you want rclone not to replace \ then see the -`--b2-encoding` flag below and remove the `BackSlash` from the -string. This can be set in the config. +This transient data is evicted as soon as it is read and the number of +chunks stored doesn't exceed the number of workers. However, depending +on other settings like "cache-chunk-size" and "cache-workers" this footprint +can increase if there are parallel streams too (multiple files being read +at the same time). -### SHA1 checksums +If the hardware permits it, use this feature to provide an overall better +performance during streaming but it can also be disabled if RAM is not +available on the local machine. -The SHA1 checksums of the files are checked on upload and download and -will be used in the syncing process. +Properties: -Large files (bigger than the limit in `--b2-upload-cutoff`) which are -uploaded in chunks will store their SHA1 on the object as -`X-Bz-Info-large_file_sha1` as recommended by Backblaze. +- Config: chunk_no_memory +- Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY +- Type: bool +- Default: false -For a large file to be uploaded with an SHA1 checksum, the source -needs to support SHA1 checksums. The local disk supports SHA1 -checksums so large file transfers from local disk will have an SHA1. -See [the overview](https://rclone.org/overview/#features) for exactly which remotes -support SHA1. +#### --cache-rps -Sources which don't support SHA1, in particular `crypt` will upload -large files without SHA1 checksums. This may be fixed in the future -(see [#1767](https://github.com/rclone/rclone/issues/1767)). +Limits the number of requests per second to the source FS (-1 to disable). -Files sizes below `--b2-upload-cutoff` will always have an SHA1 -regardless of the source. +This setting places a hard limit on the number of requests per second +that cache will be doing to the cloud provider remote and try to +respect that value by setting waits between reads. -### Transfers +If you find that you're getting banned or limited on the cloud +provider through cache and know that a smaller number of requests per +second will allow you to work with it then you can use this setting +for that. -Backblaze recommends that you do lots of transfers simultaneously for -maximum speed. In tests from my SSD equipped laptop the optimum -setting is about `--transfers 32` though higher numbers may be used -for a slight speed improvement. The optimum number for you may vary -depending on your hardware, how big the files are, how much you want -to load your computer, etc. The default of `--transfers 4` is -definitely too low for Backblaze B2 though. +A good balance of all the other settings should make this setting +useless but it is available to set for more special cases. -Note that uploading big files (bigger than 200 MiB by default) will use -a 96 MiB RAM buffer by default. There can be at most `--transfers` of -these in use at any moment, so this sets the upper limit on the memory -used. +**NOTE**: This will limit the number of requests during streams but +other API calls to the cloud provider like directory listings will +still pass. -### Versions +Properties: -When rclone uploads a new version of a file it creates a [new version -of it](https://www.backblaze.com/b2/docs/file_versions.html). -Likewise when you delete a file, the old version will be marked hidden -and still be available. Conversely, you may opt in to a "hard delete" -of files with the `--b2-hard-delete` flag which would permanently remove -the file instead of hiding it. +- Config: rps +- Env Var: RCLONE_CACHE_RPS +- Type: int +- Default: -1 -Old versions of files, where available, are visible using the -`--b2-versions` flag. +#### --cache-writes -It is also possible to view a bucket as it was at a certain point in time, -using the `--b2-version-at` flag. This will show the file versions as they -were at that time, showing files that have been deleted afterwards, and -hiding files that were created since. +Cache file data on writes through the FS. + +If you need to read files immediately after you upload them through +cache you can enable this flag to have their data stored in the +cache store at the same time during upload. -If you wish to remove all the old versions then you can use the -`rclone cleanup remote:bucket` command which will delete all the old -versions of files, leaving the current ones intact. You can also -supply a path and only old versions under that path will be deleted, -e.g. `rclone cleanup remote:bucket/path/to/stuff`. +Properties: -Note that `cleanup` will remove partially uploaded files from the bucket -if they are more than a day old. +- Config: writes +- Env Var: RCLONE_CACHE_WRITES +- Type: bool +- Default: false -When you `purge` a bucket, the current and the old versions will be -deleted then the bucket will be deleted. +#### --cache-tmp-upload-path -However `delete` will cause the current versions of the files to -become hidden old versions. +Directory to keep temporary files until they are uploaded. -Here is a session showing the listing and retrieval of an old -version followed by a `cleanup` of the old versions. +This is the path where cache will use as a temporary storage for new +files that need to be uploaded to the cloud provider. -Show current version and all the versions with `--b2-versions` flag. +Specifying a value will enable this feature. Without it, it is +completely disabled and files will be uploaded directly to the cloud +provider -``` -$ rclone -q ls b2:cleanup-test - 9 one.txt +Properties: -$ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt -``` +- Config: tmp_upload_path +- Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH +- Type: string +- Required: false -Retrieve an old version +#### --cache-tmp-wait-time -``` -$ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp +How long should files be stored in local cache before being uploaded. -$ ls -l /tmp/one-v2016-07-04-141003-000.txt --rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt -``` +This is the duration that a file must wait in the temporary location +_cache-tmp-upload-path_ before it is selected for upload. -Clean up all the old versions and show that they've gone. +Note that only one file is uploaded at a time and it can take longer +to start the upload if a queue formed for this purpose. -``` -$ rclone -q cleanup b2:cleanup-test +Properties: -$ rclone -q ls b2:cleanup-test - 9 one.txt +- Config: tmp_wait_time +- Env Var: RCLONE_CACHE_TMP_WAIT_TIME +- Type: Duration +- Default: 15s -$ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt -``` +#### --cache-db-wait-time -### Data usage +How long to wait for the DB to be available - 0 is unlimited. -It is useful to know how many requests are sent to the server in different scenarios. +Only one process can have the DB open at any one time, so rclone waits +for this duration for the DB to become available before it gives an +error. -All copy commands send the following 4 requests: +If you set it to 0 then it will wait forever. -``` -/b2api/v1/b2_authorize_account -/b2api/v1/b2_create_bucket -/b2api/v1/b2_list_buckets -/b2api/v1/b2_list_file_names -``` +Properties: -The `b2_list_file_names` request will be sent once for every 1k files -in the remote path, providing the checksum and modification time of -the listed files. As of version 1.33 issue -[#818](https://github.com/rclone/rclone/issues/818) causes extra requests -to be sent when using B2 with Crypt. When a copy operation does not -require any files to be uploaded, no more requests will be sent. +- Config: db_wait_time +- Env Var: RCLONE_CACHE_DB_WAIT_TIME +- Type: Duration +- Default: 1s -Uploading files that do not require chunking, will send 2 requests per -file upload: +## Backend commands -``` -/b2api/v1/b2_get_upload_url -/b2api/v1/b2_upload_file/ -``` +Here are the commands specific to the cache backend. -Uploading files requiring chunking, will send 2 requests (one each to -start and finish the upload) and another 2 requests for each chunk: +Run them with -``` -/b2api/v1/b2_start_large_file -/b2api/v1/b2_get_upload_part_url -/b2api/v1/b2_upload_part/ -/b2api/v1/b2_finish_large_file -``` + rclone backend COMMAND remote: -#### Versions +The help below will explain what arguments each command takes. -Versions can be viewed with the `--b2-versions` flag. When it is set -rclone will show and act on older versions of files. For example +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -Listing without `--b2-versions` +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -``` -$ rclone -q ls b2:cleanup-test - 9 one.txt -``` +### stats -And with +Print stats on the cache backend in JSON format. -``` -$ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt -``` + rclone backend stats remote: [options] [+] -Showing that the current version is unchanged but older versions can -be seen. These have the UTC date that they were uploaded to the -server to the nearest millisecond appended to them. -Note that when using `--b2-versions` no file write operations are -permitted, so you can't upload files or delete them. -### B2 and rclone link +# Chunker -Rclone supports generating file share links for private B2 buckets. -They can either be for a file for example: +The `chunker` overlay transparently splits large files into smaller chunks +during upload to wrapped remote and transparently assembles them back +when the file is downloaded. This allows to effectively overcome size limits +imposed by storage providers. -``` -./rclone link B2:bucket/path/to/file.txt -https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx +## Configuration -``` +To use it, first set up the underlying remote following the configuration +instructions for that remote. You can also use a local pathname instead of +a remote. -or if run on a directory you will get: +First check your chosen remote is working - we'll call it `remote:path` here. +Note that anything inside `remote:path` will be chunked and anything outside +won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) +then you should probably put the bucket in the remote `s3:bucket`. + +Now configure `chunker` using `rclone config`. We will call this one `overlay` +to separate it from the `remote` itself. ``` -./rclone link B2:bucket/path -https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> overlay +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Transparently chunk/split large files + \ "chunker" +[snip] +Storage> chunker +Remote to chunk/unchunk. +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). +Enter a string value. Press Enter for the default (""). +remote> remote:path +Files larger than chunk size will be split in chunks. +Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). +chunk_size> 100M +Choose how chunker handles hash sums. All modes but "none" require metadata. +Enter a string value. Press Enter for the default ("md5"). +Choose a number from below, or type in your own value + 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise + \ "none" + 2 / MD5 for composite files + \ "md5" + 3 / SHA1 for composite files + \ "sha1" + 4 / MD5 for all files + \ "md5all" + 5 / SHA1 for all files + \ "sha1all" + 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported + \ "md5quick" + 7 / Similar to "md5quick" but prefers SHA1 over MD5 + \ "sha1quick" +hash_type> md5 +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[overlay] +type = chunker +remote = remote:bucket +chunk_size = 100M +hash_type = md5 +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y ``` -you can then use the authorization token (the part of the url from the - `?Authorization=` on) on any file path under that directory. For example: +### Specifying the remote -``` -https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx -https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx -https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx +In normal use, make sure the remote has a `:` in. If you specify the remote +without a `:` then rclone will use a local directory of that name. +So if you use a remote of `/path/to/secret/files` then rclone will +chunk stuff in that directory. If you use a remote of `name` then rclone +will put files in a directory called `name` in the current directory. -``` +### Chunking -### Standard options +When rclone starts a file upload, chunker checks the file size. If it +doesn't exceed the configured chunk size, chunker will just pass the file +to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut +data in pieces with temporary names and stream them one by one, on the fly. +Each data chunk will contain the specified number of bytes, except for the +last one which may have less data. If file size is unknown in advance +(this is called a streaming upload), chunker will internally create +a temporary copy, record its size and repeat the above process. -Here are the Standard options specific to b2 (Backblaze B2). +When upload completes, temporary chunk files are finally renamed. +This scheme guarantees that operations can be run in parallel and look +from outside as atomic. +A similar method with hidden temporary chunks is used for other operations +(copy/move/rename, etc.). If an operation fails, hidden chunks are normally +destroyed, and the target composite file stays intact. -#### --b2-account +When a composite file download is requested, chunker transparently +assembles it by concatenating data chunks in order. As the split is trivial +one could even manually concatenate data chunks together to obtain the +original content. -Account ID or Application Key ID. +When the `list` rclone command scans a directory on wrapped remote, +the potential chunk files are accounted for, grouped and assembled into +composite directory entries. Any temporary chunks are hidden. -Properties: +List and other commands can sometimes come across composite files with +missing or invalid chunks, e.g. shadowed by like-named directory or +another file. This usually means that wrapped file system has been directly +tampered with or damaged. If chunker detects a missing chunk it will +by default print warning, skip the whole incomplete group of chunks but +proceed with current command. +You can set the `--chunker-fail-hard` flag to have commands abort with +error message in such cases. -- Config: account -- Env Var: RCLONE_B2_ACCOUNT -- Type: string -- Required: true +**Caveat**: As it is now, chunker will always create a temporary file in the +backend and then rename it, even if the file is below the chunk threshold. +This will result in unnecessary API calls and can severely restrict throughput +when handling transfers primarily composed of small files on some backends (e.g. Box). +A workaround to this issue is to use chunker only for files above the chunk threshold +via `--min-size` and then perform a separate call without chunker on the remaining +files. -#### --b2-key -Application Key. +#### Chunk names -Properties: +The default chunk name format is `*.rclone_chunk.###`, hence by default +chunk names are `BIG_FILE_NAME.rclone_chunk.001`, +`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format +using the `name_format` configuration file option. The format uses asterisk +`*` as a placeholder for the base file name and one or more consecutive +hash characters `#` as a placeholder for sequential chunk number. +There must be one and only one asterisk. The number of consecutive hash +characters defines the minimum length of a string representing a chunk number. +If decimal chunk number has less digits than the number of hashes, it is +left-padded by zeros. If the decimal string is longer, it is left intact. +By default numbering starts from 1 but there is another option that allows +user to start from 0, e.g. for compatibility with legacy software. -- Config: key -- Env Var: RCLONE_B2_KEY -- Type: string -- Required: true +For example, if name format is `big_*-##.part` and original file name is +`data.txt` and numbering starts from 0, then the first chunk will be named +`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` +and the 302nd chunk will become `big_data.txt-301.part`. -#### --b2-hard-delete +Note that `list` assembles composite directory entries only when chunk names +match the configured format and treats non-conforming file names as normal +non-chunked files. -Permanently delete files on remote removal, otherwise hide files. +When using `norename` transactions, chunk names will additionally have a unique +file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. -Properties: -- Config: hard_delete -- Env Var: RCLONE_B2_HARD_DELETE -- Type: bool -- Default: false +### Metadata -### Advanced options +Besides data chunks chunker will by default create metadata object for +a composite file. The object is named after the original file. +Chunker allows user to disable metadata completely (the `none` format). +Note that metadata is normally not created for files smaller than the +configured chunk size. This may change in future rclone releases. -Here are the Advanced options specific to b2 (Backblaze B2). +#### Simple JSON metadata format -#### --b2-endpoint +This is the default format. It supports hash sums and chunk validation +for composite files. Meta objects carry the following fields: -Endpoint for the service. +- `ver` - version of format, currently `1` +- `size` - total size of composite file +- `nchunks` - number of data chunks in file +- `md5` - MD5 hashsum of composite file (if present) +- `sha1` - SHA1 hashsum (if present) +- `txn` - identifies current version of the file -Leave blank normally. +There is no field for composite file name as it's simply equal to the name +of meta object on the wrapped remote. Please refer to respective sections +for details on hashsums and modified time handling. -Properties: +#### No metadata -- Config: endpoint -- Env Var: RCLONE_B2_ENDPOINT -- Type: string -- Required: false +You can disable meta objects by setting the meta format option to `none`. +In this mode chunker will scan directory for all files that follow +configured chunk name format, group them by detecting chunks with the same +base name and show group names as virtual composite files. +This method is more prone to missing chunk errors (especially missing +last chunk) than format with metadata enabled. -#### --b2-test-mode -A flag string for X-Bz-Test-Mode header for debugging. +### Hashsums -This is for debugging purposes only. Setting it to one of the strings -below will cause b2 to return specific errors: +Chunker supports hashsums only when a compatible metadata is present. +Hence, if you choose metadata format of `none`, chunker will report hashsum +as `UNSUPPORTED`. - * "fail_some_uploads" - * "expire_some_account_authorization_tokens" - * "force_cap_exceeded" +Please note that by default metadata is stored only for composite files. +If a file is smaller than configured chunk size, chunker will transparently +redirect hash requests to wrapped remote, so support depends on that. +You will see the empty string as a hashsum of requested type for small +files if the wrapped remote doesn't support it. -These will be set in the "X-Bz-Test-Mode" header which is documented -in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). +Many storage backends support MD5 and SHA1 hash types, so does chunker. +With chunker you can choose one or another but not both. +MD5 is set by default as the most supported type. +Since chunker keeps hashes for composite files and falls back to the +wrapped remote hash for non-chunked ones, we advise you to choose the same +hash type as supported by wrapped remote so that your file listings +look coherent. -Properties: +If your storage backend does not support MD5 or SHA1 but you need consistent +file hashing, configure chunker with `md5all` or `sha1all`. These two modes +guarantee given hash for all files. If wrapped remote doesn't support it, +chunker will then add metadata to all files, even small. However, this can +double the amount of small files in storage and incur additional service charges. +You can even use chunker to force md5/sha1 support in any other remote +at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` +to force hashsums and `chunk_size=1P` to effectively disable chunking. -- Config: test_mode -- Env Var: RCLONE_B2_TEST_MODE -- Type: string -- Required: false +Normally, when a file is copied to chunker controlled remote, chunker +will ask the file source for compatible file hash and revert to on-the-fly +calculation if none is found. This involves some CPU overhead but provides +a guarantee that given hashsum is available. Also, chunker will reject +a server-side copy or move operation if source and destination hashsum +types are different resulting in the extra network bandwidth, too. +In some rare cases this may be undesired, so chunker provides two optional +choices: `sha1quick` and `md5quick`. If the source does not support primary +hash type and the quick mode is enabled, chunker will try to fall back to +the secondary type. This will save CPU and bandwidth but can result in empty +hashsums at destination. Beware of consequences: the `sync` command will +revert (sometimes silently) to time/size comparison if compatible hashsums +between source and target are not found. -#### --b2-versions -Include old versions in directory listings. +### Modification times -Note that when using this no file write operations are permitted, -so you can't upload files or delete them. +Chunker stores modification times using the wrapped remote so support +depends on that. For a small non-chunked file the chunker overlay simply +manipulates modification time of the wrapped remote file. +For a composite file with metadata chunker will get and set +modification time of the metadata object on the wrapped remote. +If file is chunked but metadata format is `none` then chunker will +use modification time of the first data chunk. -Properties: -- Config: versions -- Env Var: RCLONE_B2_VERSIONS -- Type: bool -- Default: false +### Migrations -#### --b2-version-at +The idiomatic way to migrate to a different chunk size, hash type, transaction +style or chunk naming scheme is to: -Show file versions as they were at the specified time. +- Collect all your chunked files under a directory and have your + chunker remote point to it. +- Create another directory (most probably on the same cloud storage) + and configure a new remote with desired metadata format, + hash type, chunk naming etc. +- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data + will be transparently converted in transfer. + This may take some time, yet chunker will try server-side + copy if possible. +- After checking data integrity you may remove configuration section + of the old remote. -Note that when using this no file write operations are permitted, -so you can't upload files or delete them. +If rclone gets killed during a long operation on a big composite file, +hidden temporary chunks may stay in the directory. They will not be +shown by the `list` command but will eat up your account quota. +Please note that the `deletefile` command deletes only active +chunks of a file. As a workaround, you can use remote of the wrapped +file system to see them. +An easy way to get rid of hidden garbage is to copy littered directory +somewhere using the chunker remote and purge the original directory. +The `copy` command will copy only active chunks while the `purge` will +remove everything including garbage. -Properties: -- Config: version_at -- Env Var: RCLONE_B2_VERSION_AT -- Type: Time -- Default: off +### Caveats and Limitations -#### --b2-upload-cutoff +Chunker requires wrapped remote to support server-side `move` (or `copy` + +`delete`) operations, otherwise it will explicitly refuse to start. +This is because it internally renames temporary chunk files to their final +names when an operation completes successfully. -Cutoff for switching to chunked upload. +Chunker encodes chunk number in file name, so with default `name_format` +setting it adds 17 characters. Also chunker adds 7 characters of temporary +suffix during operations. Many file systems limit base file name without path +by 255 characters. Using rclone's crypt remote as a base file system limits +file name by 143 characters. Thus, maximum name length is 231 for most files +and 119 for chunker-over-crypt. A user in need can change name format to +e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). -Files above this size will be uploaded in chunks of "--b2-chunk-size". +Note that a move implemented using the copy-and-delete method may incur +double charging with some cloud storage providers. -This value should be set no larger than 4.657 GiB (== 5 GB). +Chunker will not automatically rename existing chunks when you run +`rclone config` on a live remote and change the chunk name format. +Beware that in result of this some files which have been treated as chunks +before the change can pop up in directory listings as normal files +and vice versa. The same warning holds for the chunk size. +If you desperately need to change critical chunking settings, you should +run data migration as described above. -Properties: +If wrapped remote is case insensitive, the chunker overlay will inherit +that property (so you can't have a file called "Hello.doc" and "hello.doc" +in the same directory). -- Config: upload_cutoff -- Env Var: RCLONE_B2_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi +Chunker included in rclone releases up to `v1.54` can sometimes fail to +detect metadata produced by recent versions of rclone. We recommend users +to keep rclone up-to-date to avoid data corruption. -#### --b2-copy-cutoff +Changing `transactions` is dangerous and requires explicit migration. -Cutoff for switching to multipart copy. -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. +### Standard options -The minimum is 0 and the maximum is 4.6 GiB. +Here are the Standard options specific to chunker (Transparently chunk/split large files). -Properties: +#### --chunker-remote -- Config: copy_cutoff -- Env Var: RCLONE_B2_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4Gi +Remote to chunk/unchunk. -#### --b2-chunk-size +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). -Upload chunk size. +Properties: -When uploading large files, chunk the file into this size. +- Config: remote +- Env Var: RCLONE_CHUNKER_REMOTE +- Type: string +- Required: true -Must fit in memory. These chunks are buffered in memory and there -might a maximum of "--transfers" chunks in progress at once. +#### --chunker-chunk-size -5,000,000 Bytes is the minimum size. +Files larger than chunk size will be split in chunks. Properties: - Config: chunk_size -- Env Var: RCLONE_B2_CHUNK_SIZE +- Env Var: RCLONE_CHUNKER_CHUNK_SIZE - Type: SizeSuffix -- Default: 96Mi +- Default: 2Gi -#### --b2-disable-checksum +#### --chunker-hash-type -Disable checksums for large (> upload cutoff) files. +Choose how chunker handles hash sums. -Normally rclone will calculate the SHA1 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. +All modes but "none" require metadata. Properties: -- Config: disable_checksum -- Env Var: RCLONE_B2_DISABLE_CHECKSUM -- Type: bool -- Default: false +- Config: hash_type +- Env Var: RCLONE_CHUNKER_HASH_TYPE +- Type: string +- Default: "md5" +- Examples: + - "none" + - Pass any hash supported by wrapped remote for non-chunked files. + - Return nothing otherwise. + - "md5" + - MD5 for composite files. + - "sha1" + - SHA1 for composite files. + - "md5all" + - MD5 for all files. + - "sha1all" + - SHA1 for all files. + - "md5quick" + - Copying a file to chunker will request MD5 from the source. + - Falling back to SHA1 if unsupported. + - "sha1quick" + - Similar to "md5quick" but prefers SHA1 over MD5. -#### --b2-download-url +### Advanced options -Custom endpoint for downloads. +Here are the Advanced options specific to chunker (Transparently chunk/split large files). -This is usually set to a Cloudflare CDN URL as Backblaze offers -free egress for data downloaded through the Cloudflare network. -Rclone works with private buckets by sending an "Authorization" header. -If the custom endpoint rewrites the requests for authentication, -e.g., in Cloudflare Workers, this header needs to be handled properly. -Leave blank if you want to use the endpoint provided by Backblaze. +#### --chunker-name-format -The URL provided here SHOULD have the protocol and SHOULD NOT have -a trailing slash or specify the /file/bucket subpath as rclone will -request files with "{download_url}/file/{bucket_name}/{path}". +String format of chunk file names. -Example: -> https://mysubdomain.mydomain.tld -(No trailing "/", "file" or "bucket") +The two placeholders are: base file name (*) and chunk number (#...). +There must be one and only one asterisk and one or more consecutive hash characters. +If chunk number has less digits than the number of hashes, it is left-padded by zeros. +If there are more digits in the number, they are left as is. +Possible chunk files are ignored if their name does not match given format. Properties: -- Config: download_url -- Env Var: RCLONE_B2_DOWNLOAD_URL +- Config: name_format +- Env Var: RCLONE_CHUNKER_NAME_FORMAT - Type: string -- Required: false +- Default: "*.rclone_chunk.###" -#### --b2-download-auth-duration +#### --chunker-start-from -Time before the authorization token will expire in s or suffix ms|s|m|h|d. +Minimum valid chunk number. Usually 0 or 1. -The duration before the download authorization token will expire. -The minimum value is 1 second. The maximum value is one week. +By default chunk numbers start from 1. Properties: -- Config: download_auth_duration -- Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION -- Type: Duration -- Default: 1w +- Config: start_from +- Env Var: RCLONE_CHUNKER_START_FROM +- Type: int +- Default: 1 -#### --b2-memory-pool-flush-time +#### --chunker-meta-format + +Format of the metadata object or "none". -How often internal memory buffer pools will be flushed. -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool. +By default "simplejson". +Metadata is a small JSON file named after the composite file. Properties: -- Config: memory_pool_flush_time -- Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s +- Config: meta_format +- Env Var: RCLONE_CHUNKER_META_FORMAT +- Type: string +- Default: "simplejson" +- Examples: + - "none" + - Do not use metadata files at all. + - Requires hash type "none". + - "simplejson" + - Simple JSON supports hash sums and chunk validation. + - + - It has the following fields: ver, size, nchunks, md5, sha1. -#### --b2-memory-pool-use-mmap +#### --chunker-fail-hard -Whether to use mmap buffers in internal memory pool. +Choose how chunker should handle files with missing or invalid chunks. Properties: -- Config: memory_pool_use_mmap -- Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP +- Config: fail_hard +- Env Var: RCLONE_CHUNKER_FAIL_HARD - Type: bool - Default: false +- Examples: + - "true" + - Report errors and abort current command. + - "false" + - Warn user, skip incomplete file and proceed. -#### --b2-encoding - -The encoding for the backend. +#### --chunker-transactions -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Choose how chunker should handle temporary files during transactions. Properties: -- Config: encoding -- Env Var: RCLONE_B2_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot - - - -## Limitations - -`rclone about` is not supported by the B2 backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +- Config: transactions +- Env Var: RCLONE_CHUNKER_TRANSACTIONS +- Type: string +- Default: "rename" +- Examples: + - "rename" + - Rename temporary files after a successful transaction. + - "norename" + - Leave temporary file names and write transaction ID to metadata file. + - Metadata is required for no rename transactions (meta format cannot be "none"). + - If you are using norename transactions you should be careful not to downgrade Rclone + - as older versions of Rclone don't support this transaction style and will misinterpret + - files manipulated by norename transactions. + - This method is EXPERIMENTAL, don't use on production systems. + - "auto" + - Rename or norename will be used depending on capabilities of the backend. + - If meta format is set to "none", rename transactions will always be used. + - This method is EXPERIMENTAL, don't use on production systems. -# Box -Paths are specified as `remote:path` -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +# Citrix ShareFile -The initial setup for Box involves getting a token from Box which you -can do either in your browser, or with a config.json downloaded from Box -to use JWT authentication. `rclone config` walks you through it. +[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. ## Configuration +The initial setup for Citrix ShareFile involves getting a token from +Citrix ShareFile which you can in your browser. `rclone config` walks you +through it. + Here is an example of how to make a remote called `remote`. First run: rclone config @@ -23843,32 +29146,34 @@ q) Quit config n/s/q> n name> remote Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Box - \ "box" -[snip] -Storage> box -Box App Client Id - leave blank normally. -client_id> -Box App Client Secret - leave blank normally. -client_secret> -Box App config.json location -Leave blank normally. -Enter a string value. Press Enter for the default (""). -box_config_file> -Box App Primary Access Token -Leave blank normally. Enter a string value. Press Enter for the default (""). -access_token> +Choose a number from below, or type in your own value +XX / Citrix Sharefile + \ "sharefile" +Storage> sharefile +** See help for sharefile backend at: https://rclone.org/sharefile/ ** -Enter a string value. Press Enter for the default ("user"). +ID of the root folder + +Leave blank to access "Personal Folders". You can use one of the +standard values here or any folder ID (long hex number ID). +Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value - 1 / Rclone should act on behalf of a user - \ "user" - 2 / Rclone should act on behalf of a service account - \ "enterprise" -box_sub_type> + 1 / Access the Personal Folders. (Default) + \ "" + 2 / Access the Favorites folder. + \ "favorites" + 3 / Access all the shared folders. + \ "allshared" + 4 / Access all the individual connectors. + \ "connectors" + 5 / Access the home, favorites, and shared folders as well as the connectors. + \ "top" +root_folder_id> +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use @@ -23877,15 +29182,15 @@ If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXX Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] -client_id = -client_secret = -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} +type = sharefile +endpoint = https://XXX.sharefile.com +token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} -------------------- y) Yes this is OK e) Edit this remote @@ -23897,1876 +29202,1876 @@ See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it machine with no Internet browser available. Note that rclone runs a webserver on your local machine to collect the -token as returned from Box. This only runs from the moment it opens +token as returned from Citrix ShareFile. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on `http://127.0.0.1:53682/` and this it may require you to unblock it temporarily if you are running a host firewall. Once configured you can then use `rclone` like this, -List directories in top level of your Box +List directories in top level of your ShareFile rclone lsd remote: -List all the files in your Box +List all the files in your ShareFile rclone ls remote: -To copy a local directory to an Box directory called backup +To copy a local directory to an ShareFile directory called backup rclone copy /home/source remote:backup -### Using rclone with an Enterprise account with SSO +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -If you have an "Enterprise" account type with Box with single sign on -(SSO), you need to create a password to use Box with rclone. This can -be done at your Enterprise Box account by going to Settings, "Account" -Tab, and then set the password in the "Authentication" field. +### Modification times and hashes -Once you have done this, you can setup your Enterprise Box account -using the same procedure detailed above in the, using the password you -have just set. +ShareFile allows modification times to be set on objects accurate to 1 +second. These will be used to detect whether objects need syncing or +not. -### Invalid refresh token +ShareFile supports MD5 type hashes, so you can use the `--checksum` +flag. -According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): +### Transfers -> Each refresh_token is valid for one use in 60 days. +For files above 128 MiB rclone will use a chunked transfer. Rclone will +upload up to `--transfers` chunks at the same time (shared among all +the multipart uploads). Chunks are buffered in memory and are +normally 64 MiB so increasing `--transfers` will increase memory use. -This means that if you +### Restricted filename characters - * Don't use the box remote for 60 days - * Copy the config file with a box refresh token in and use it in two places - * Get an error on a token refresh +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -then rclone will return an error which includes the text `Invalid -refresh token`. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \\ | 0x5C | \ | +| * | 0x2A | * | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| : | 0x3A | : | +| \| | 0x7C | | | +| " | 0x22 | " | -To fix this you will need to use oauth2 again to update the refresh -token. You can use the methods in [the remote setup -docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the -config file method, you should not use that remote on the computer you -did the authentication on. +File names can also not start or end with the following characters. +These only get replaced if they are the first or last character in the +name: -Here is how to do it. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | +| . | 0x2E | . | -``` -$ rclone config -Current remotes: +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Name Type -==== ==== -remote box -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> e -Choose a number from below, or type in an existing value - 1 > remote -remote> remote --------------------- -[remote] -type = box -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} --------------------- -Edit remote -Value "client_id" = "" -Edit? (y/n)> -y) Yes -n) No -y/n> n -Value "client_secret" = "" -Edit? (y/n)> -y) Yes -n) No -y/n> n -Remote config -Already have a token - refresh? -y) Yes -n) No -y/n> y -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth -Log in and authorize rclone for access -Waiting for code... -Got code --------------------- -[remote] -type = box -token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +### Standard options -### Modified time and hashes +Here are the Standard options specific to sharefile (Citrix Sharefile). -Box allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. +#### --sharefile-client-id -Box supports SHA1 type hashes, so you can use the `--checksum` -flag. +OAuth Client Id. -### Restricted filename characters +Leave blank normally. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Properties: -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \ | 0x5C | \ | +- Config: client_id +- Env Var: RCLONE_SHAREFILE_CLIENT_ID +- Type: string +- Required: false + +#### --sharefile-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_SHAREFILE_CLIENT_SECRET +- Type: string +- Required: false + +#### --sharefile-root-folder-id + +ID of the root folder. + +Leave blank to access "Personal Folders". You can use one of the +standard values here or any folder ID (long hex number ID). + +Properties: + +- Config: root_folder_id +- Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID +- Type: string +- Required: false +- Examples: + - "" + - Access the Personal Folders (default). + - "favorites" + - Access the Favorites folder. + - "allshared" + - Access all the shared folders. + - "connectors" + - Access all the individual connectors. + - "top" + - Access the home, favorites, and shared folders as well as the connectors. + +### Advanced options + +Here are the Advanced options specific to sharefile (Citrix Sharefile). + +#### --sharefile-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_SHAREFILE_TOKEN +- Type: string +- Required: false + +#### --sharefile-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_SHAREFILE_AUTH_URL +- Type: string +- Required: false + +#### --sharefile-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_SHAREFILE_TOKEN_URL +- Type: string +- Required: false + +#### --sharefile-upload-cutoff + +Cutoff for switching to multipart upload. + +Properties: + +- Config: upload_cutoff +- Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 128Mi + +#### --sharefile-chunk-size + +Upload chunk size. + +Must a power of 2 >= 256k. + +Making this larger will improve performance, but note that each chunk +is buffered in memory one per transfer. + +Reducing this will reduce memory usage but decrease performance. + +Properties: + +- Config: chunk_size +- Env Var: RCLONE_SHAREFILE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 64Mi + +#### --sharefile-endpoint + +Endpoint for API calls. + +This is usually auto discovered as part of the oauth process, but can +be set manually to something like: https://XXX.sharefile.com + + +Properties: + +- Config: endpoint +- Env Var: RCLONE_SHAREFILE_ENDPOINT +- Type: string +- Required: false + +#### --sharefile-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_SHAREFILE_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot + + +## Limitations + +Note that ShareFile is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". + +ShareFile only supports filenames up to 256 characters in length. + +`rclone about` is not supported by the Citrix ShareFile backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. + +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + +# Crypt + +Rclone `crypt` remotes encrypt and decrypt other remotes. + +A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) +directly, but instead wraps another remote, which in turn accesses +the storage system. This is similar to how [alias](https://rclone.org/alias/), +[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) +and a few others work. It makes the usage very flexible, as you can +add a layer, in this case an encryption layer, on top of any other +backend, even in multiple layers. Rclone's functionality +can be used as with any other remote, for example you can +[mount](https://rclone.org/commands/rclone_mount/) a crypt remote. -File names can also not end with the following characters. -These only get replaced if they are the last character in the name: +Accessing a storage system through a crypt remote realizes client-side +encryption, which makes it safe to keep your data in a location you do +not trust will not get compromised. +When working against the `crypt` remote, rclone will automatically +encrypt (before uploading) and decrypt (after downloading) on your local +system as needed on the fly, leaving the data encrypted at rest in the +wrapped remote. If you access the storage system using an application +other than rclone, or access the wrapped remote directly using rclone, +there will not be any encryption/decryption: Downloading existing content +will just give you the encrypted (scrambled) format, and anything you +upload will *not* become encrypted. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | +The encryption is a secret-key encryption (also called symmetric key encryption) +algorithm, where a password (or pass phrase) is used to generate real encryption key. +The password can be supplied by user, or you may chose to let rclone +generate one. It will be stored in the configuration file, in a lightly obscured form. +If you are in an environment where you are not able to keep your configuration +secured, you should add +[configuration encryption](https://rclone.org/docs/#configuration-encryption) +as protection. As long as you have this configuration file, you will be able to +decrypt your data. Without the configuration file, as long as you remember +the password (or keep it in a safe place), you can re-create the configuration +and gain access to the existing data. You may also configure a corresponding +remote in a different installation to access the same data. +See below for guidance to [changing password](#changing-password). -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), +to permute the encryption key so that the same string may be encrypted in +different ways. When configuring the crypt remote it is optional to enter a salt, +or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. +Normally in cryptography, the salt is stored together with the encrypted content, +and do not have to be memorized by the user. This is not the case in rclone, +because rclone does not store any additional information on the remotes. Use of +custom salt is effectively a second password that must be memorized. -### Transfers +[File content](#file-encryption) encryption is performed using +[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), +based on XSalsa20 cipher and Poly1305 for integrity. +[Names](#name-encryption) (file- and directory names) are also encrypted +by default, but this has some implications and is therefore +possible to be turned off. -For files above 50 MiB rclone will use a chunked transfer. Rclone will -upload up to `--transfers` chunks at the same time (shared among all -the multipart uploads). Chunks are buffered in memory and are -normally 8 MiB so increasing `--transfers` will increase memory use. +## Configuration -### Deleting files +Here is an example of how to make a remote called `secret`. -Depending on the enterprise settings for your user, the item will -either be actually deleted from Box or moved to the trash. +To use `crypt`, first set up the underlying remote. Follow the +`rclone config` instructions for the specific backend. -Emptying the trash is supported via the rclone however cleanup command -however this deletes every trashed file and folder individually so it -may take a very long time. -Emptying the trash via the WebUI does not have this limitation -so it is advised to empty the trash via the WebUI. +Before configuring the crypt remote, check the underlying remote is +working. In this example the underlying remote is called `remote`. +We will configure a path `path` within this remote to contain the +encrypted content. Anything inside `remote:path` will be encrypted +and anything outside will not. -### Root folder ID +Configure `crypt` using `rclone config`. In this example the `crypt` +remote is called `secret`, to differentiate it from the underlying +`remote`. -You can set the `root_folder_id` for rclone. This is the directory -(identified by its `Folder ID`) that rclone considers to be the root -of your Box drive. +When you are done you can use the crypt remote named `secret` just +as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, +and rclone will encrypt and decrypt as needed on the fly. +If you access the wrapped remote `remote:path` directly you will bypass +the encryption, and anything you read will be in encrypted form, and +anything you write will be unencrypted. To avoid issues it is best to +configure a dedicated path for encrypted content, and access it +exclusively through a crypt remote. -Normally you will leave this blank and rclone will determine the -correct root to use itself. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> secret +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / Encrypt/Decrypt a remote + \ "crypt" +[snip] +Storage> crypt +** See help for crypt backend at: https://rclone.org/crypt/ ** -However you can set this to restrict rclone to a specific folder -hierarchy. +Remote to encrypt/decrypt. +Normally should contain a ':' and a path, eg "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). +Enter a string value. Press Enter for the default (""). +remote> remote:path +How to encrypt the filenames. +Enter a string value. Press Enter for the default ("standard"). +Choose a number from below, or type in your own value. + / Encrypt the filenames. + 1 | See the docs for the details. + \ "standard" + 2 / Very simple filename obfuscation. + \ "obfuscate" + / Don't encrypt the file names. + 3 | Adds a ".bin" extension only. + \ "off" +filename_encryption> +Option to either encrypt directory names or leave them intact. -In order to do this you will have to find the `Folder ID` of the -directory you wish rclone to display. This will be the last segment -of the URL when you open the relevant folder in the Box web -interface. +NB If filename_encryption is "off" then this option will do nothing. +Enter a boolean value (true or false). Press Enter for the default ("true"). +Choose a number from below, or type in your own value + 1 / Encrypt directory names. + \ "true" + 2 / Don't encrypt directory names, leave them intact. + \ "false" +directory_name_encryption> +Password or pass phrase for encryption. +y) Yes type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Password or pass phrase for salt. Optional but recommended. +Should be different to the previous password. +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank (default) +y/g/n> g +Password strength in bits. +64 is just about memorable +128 is secure +1024 is the maximum +Bits> 128 +Your password is: JAsJvRcgR-_veXNfy_sGmQ +Use this password? Please note that an obscured version of this +password (and not the password itself) will be stored under your +configuration file, so keep this generated password in a safe place. +y) Yes (default) +n) No +y/n> +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> +Remote config +-------------------- +[secret] +type = crypt +remote = remote:path +password = *** ENCRYPTED *** +password2 = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> +``` -So if the folder you want rclone to use has a URL which looks like -`https://app.box.com/folder/11xxxxxxxxx8` -in the browser, then you use `11xxxxxxxxx8` as -the `root_folder_id` in the config. +**Important** The crypt password stored in `rclone.conf` is lightly +obscured. That only protects it from cursory inspection. It is not +secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. +A long passphrase is recommended, or `rclone config` can generate a +random one. -### Standard options +The obscured password is created using AES-CTR with a static key. The +salt is stored verbatim at the beginning of the obscured password. This +static key is shared between all versions of rclone. -Here are the Standard options specific to box (Box). +If you reconfigure rclone with the same passwords/passphrases +elsewhere it will be compatible, but the obscured version will be different +due to the different salt. -#### --box-client-id +Rclone does not encrypt -OAuth Client Id. + * file length - this can be calculated within 16 bytes + * modification time - used for syncing -Leave blank normally. +### Specifying the remote -Properties: +When configuring the remote to encrypt/decrypt, you may specify any +string that rclone accepts as a source/destination of other commands. -- Config: client_id -- Env Var: RCLONE_BOX_CLIENT_ID -- Type: string -- Required: false +The primary use case is to specify the path into an already configured +remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that +data in a remote untrusted location can be stored encrypted. -#### --box-client-secret +You may also specify a local filesystem path, such as +`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating +a crypt remote pointing to such a local filesystem path, you can +use rclone as a utility for pure local file encryption, for example +to keep encrypted files on a removable USB drive. -OAuth Client Secret. +**Note**: A string which do not contain a `:` will by rclone be treated +as a relative path in the local filesystem. For example, if you enter +the name `remote` without the trailing `:`, it will be treated as +a subdirectory of the current directory with name "remote". -Leave blank normally. +If a path `remote:path/to/dir` is specified, rclone stores encrypted +files in `path/to/dir` on the remote. With file name encryption, files +saved to `secret:subdir/subfile` are stored in the unencrypted path +`path/to/dir` but the `subdir/subpath` element is encrypted. -Properties: +The path you specify does not have to exist, rclone will create +it when needed. -- Config: client_secret -- Env Var: RCLONE_BOX_CLIENT_SECRET -- Type: string -- Required: false +If you intend to use the wrapped remote both directly for keeping +unencrypted content, as well as through a crypt remote for encrypted +content, it is recommended to point the crypt remote to a separate +directory within the wrapped remote. If you use a bucket-based storage +system (e.g. Swift, S3, Google Compute Storage, B2) it is generally +advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). +If wrapping around the entire root of the storage (`s3:`), and use the +optional file name encryption, rclone will encrypt the bucket name. -#### --box-box-config-file +### Changing password -Box App config.json location +Should the password, or the configuration file containing a lightly obscured +form of the password, be compromised, you need to re-encrypt your data with +a new password. Since rclone uses secret-key encryption, where the encryption +key is generated directly from the password kept on the client, it is not +possible to change the password/key of already encrypted content. Just changing +the password configured for an existing crypt remote means you will no longer +able to decrypt any of the previously encrypted content. The only possibility +is to re-upload everything via a crypt remote configured with your new password. -Leave blank normally. +Depending on the size of your data, your bandwidth, storage quota etc, there are +different approaches you can take: +- If you have everything in a different location, for example on your local system, +you could remove all of the prior encrypted files, change the password for your +configured crypt remote (or delete and re-create the crypt configuration), +and then re-upload everything from the alternative location. +- If you have enough space on the storage system you can create a new crypt +remote pointing to a separate directory on the same backend, and then use +rclone to copy everything from the original crypt remote to the new, +effectively decrypting everything on the fly using the old password and +re-encrypting using the new password. When done, delete the original crypt +remote directory and finally the rclone crypt configuration with the old password. +All data will be streamed from the storage system and back, so you will +get half the bandwidth and be charged twice if you have upload and download quota +on the storage system. -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. +**Note**: A security problem related to the random password generator +was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated +by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 +(released 2020-10-26) are not considered secure and should be changed. +If you made up your own password, or used rclone version older than 1.49.0 or +newer than 1.53.2 to generate it, you are *not* affected by this issue. +See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more +details, and a tool you can use to check if you are affected. -Properties: +### Example -- Config: box_config_file -- Env Var: RCLONE_BOX_BOX_CONFIG_FILE -- Type: string -- Required: false +Create the following file structure using "standard" file name +encryption. -#### --box-access-token +``` +plaintext/ +├── file0.txt +├── file1.txt +└── subdir + ├── file2.txt + ├── file3.txt + └── subsubdir + └── file4.txt +``` -Box App Primary Access Token +Copy these to the remote, and list them -Leave blank normally. +``` +$ rclone -q copy plaintext secret: +$ rclone -q ls secret: + 7 file1.txt + 6 file0.txt + 8 subdir/file2.txt + 10 subdir/subsubdir/file4.txt + 9 subdir/file3.txt +``` -Properties: +The crypt remote looks like -- Config: access_token -- Env Var: RCLONE_BOX_ACCESS_TOKEN -- Type: string -- Required: false +``` +$ rclone -q ls remote:path + 55 hagjclgavj2mbiqm6u6cnjjqcg + 54 v05749mltvv1tf4onltun46gls + 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo + 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc + 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps +``` -#### --box-box-sub-type +The directory structure is preserved +``` +$ rclone -q ls secret:subdir + 8 file2.txt + 9 file3.txt + 10 subsubdir/file4.txt +``` +Without file name encryption `.bin` extensions are added to underlying +names. This prevents the cloud provider attempting to interpret file +content. -Properties: +``` +$ rclone -q ls remote:path + 54 file0.txt.bin + 57 subdir/file3.txt.bin + 56 subdir/file2.txt.bin + 58 subdir/subsubdir/file4.txt.bin + 55 file1.txt.bin +``` -- Config: box_sub_type -- Env Var: RCLONE_BOX_BOX_SUB_TYPE -- Type: string -- Default: "user" -- Examples: - - "user" - - Rclone should act on behalf of a user. - - "enterprise" - - Rclone should act on behalf of a service account. +### File name encryption modes -### Advanced options +Off -Here are the Advanced options specific to box (Box). + * doesn't hide file names or directory structure + * allows for longer file names (~246 characters) + * can use sub paths and copy single files -#### --box-token +Standard -OAuth Access Token as a JSON blob. + * file names encrypted + * file names can't be as long (~143 characters) + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names + * can use shortcuts to shorten the directory recursion -Properties: +Obfuscation -- Config: token -- Env Var: RCLONE_BOX_TOKEN -- Type: string -- Required: false +This is a simple "rotate" of the filename, with each file having a rot +distance based on the filename. Rclone stores the distance at the +beginning of the filename. A file called "hello" may become "53.jgnnq". -#### --box-auth-url +Obfuscation is not a strong encryption of filenames, but hinders +automated scanning tools picking up on filename patterns. It is an +intermediate between "off" and "standard" which allows for longer path +segment names. -Auth server URL. +There is a possibility with some unicode based filenames that the +obfuscation is weak and may map lower case characters to upper case +equivalents. -Leave blank to use the provider defaults. +Obfuscation cannot be relied upon for strong protection. -Properties: + * file names very lightly obfuscated + * file names can be longer than standard encryption + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names -- Config: auth_url -- Env Var: RCLONE_BOX_AUTH_URL -- Type: string -- Required: false +Cloud storage systems have limits on file name length and +total path length which rclone is more likely to breach using +"Standard" file name encryption. Where file names are less than 156 +characters in length issues should not be encountered, irrespective of +cloud storage provider. -#### --box-token-url +An experimental advanced option `filename_encoding` is now provided to +address this problem to a certain degree. +For cloud storage systems with case sensitive file names (e.g. Google Drive), +`base64` can be used to reduce file name length. +For cloud storage systems using UTF-16 to store file names internally +(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce +file name length. -Token server url. +An alternative, future rclone file name encryption mode may tolerate +backend provider path length limits. -Leave blank to use the provider defaults. +### Directory name encryption -Properties: +Crypt offers the option of encrypting dir names or leaving them intact. +There are two options: -- Config: token_url -- Env Var: RCLONE_BOX_TOKEN_URL -- Type: string -- Required: false +True -#### --box-root-folder-id +Encrypts the whole file path including directory names +Example: +`1/12/123.txt` is encrypted to +`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` -Fill in for rclone to use a non root folder as its starting point. +False -Properties: +Only encrypts file names, skips directory names +Example: +`1/12/123.txt` is encrypted to +`1/12/qgm4avr35m5loi1th53ato71v0` -- Config: root_folder_id -- Env Var: RCLONE_BOX_ROOT_FOLDER_ID -- Type: string -- Default: "0" -#### --box-upload-cutoff +### Modification times and hashes -Cutoff for switching to multipart upload (>= 50 MiB). +Crypt stores modification times using the underlying remote so support +depends on that. -Properties: +Hashes are not stored for crypt. However the data integrity is +protected by an extremely strong crypto authenticator. -- Config: upload_cutoff -- Env Var: RCLONE_BOX_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 50Mi +Use the `rclone cryptcheck` command to check the +integrity of an encrypted remote instead of `rclone check` which can't +check the checksums properly. -#### --box-commit-retries -Max number of times to try committing a multipart file. +### Standard options -Properties: +Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). -- Config: commit_retries -- Env Var: RCLONE_BOX_COMMIT_RETRIES -- Type: int -- Default: 100 +#### --crypt-remote -#### --box-list-chunk +Remote to encrypt/decrypt. -Size of listing chunk 1-1000. +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). Properties: -- Config: list_chunk -- Env Var: RCLONE_BOX_LIST_CHUNK -- Type: int -- Default: 1000 +- Config: remote +- Env Var: RCLONE_CRYPT_REMOTE +- Type: string +- Required: true -#### --box-owned-by +#### --crypt-filename-encryption -Only show items owned by the login (email address) passed in. +How to encrypt the filenames. Properties: -- Config: owned_by -- Env Var: RCLONE_BOX_OWNED_BY +- Config: filename_encryption +- Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION - Type: string -- Required: false +- Default: "standard" +- Examples: + - "standard" + - Encrypt the filenames. + - See the docs for the details. + - "obfuscate" + - Very simple filename obfuscation. + - "off" + - Don't encrypt the file names. + - Adds a ".bin", or "suffix" extension only. -#### --box-encoding +#### --crypt-directory-name-encryption -The encoding for the backend. +Option to either encrypt directory names or leave them intact. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +NB If filename_encryption is "off" then this option will do nothing. Properties: -- Config: encoding -- Env Var: RCLONE_BOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot - - - -## Limitations +- Config: directory_name_encryption +- Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION +- Type: bool +- Default: true +- Examples: + - "true" + - Encrypt directory names. + - "false" + - Don't encrypt directory names, leave them intact. -Note that Box is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +#### --crypt-password -Box file names can't have the `\` character in. rclone maps this to -and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth -Reverse Solidus). +Password or pass phrase for encryption. -Box only supports filenames up to 255 characters in length. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. +Properties: -`rclone about` is not supported by the Box backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +- Config: password +- Env Var: RCLONE_CRYPT_PASSWORD +- Type: string +- Required: true -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +#### --crypt-password2 -# Cache +Password or pass phrase for salt. -The `cache` remote wraps another existing remote and stores file structure -and its data for long running tasks like `rclone mount`. +Optional but recommended. +Should be different to the previous password. -## Status +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -The cache backend code is working but it currently doesn't -have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. +Properties: -The cache backend is due to be phased out in favour of the VFS caching -layer eventually which is more tightly integrated into rclone. +- Config: password2 +- Env Var: RCLONE_CRYPT_PASSWORD2 +- Type: string +- Required: false -Until this happens we recommend only using the cache backend if you -find you can't work without it. There are many docs online describing -the use of the cache backend to minimize API hits and by-and-large -these are out of date and the cache backend isn't needed in those -scenarios any more. +### Advanced options -## Configuration +Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). -To get started you just need to have an existing remote which can be configured -with `cache`. +#### --crypt-server-side-across-configs -Here is an example of how to make a remote called `test-cache`. First run: +Deprecated: use --server-side-across-configs instead. - rclone config +Allow server-side operations (e.g. copy) to work across different crypt configs. -This will guide you through an interactive setup process: +Normally this option is not what you want, but if you have two crypts +pointing to the same backend you can use it. -``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> test-cache -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Cache a remote - \ "cache" -[snip] -Storage> cache -Remote to cache. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). -remote> local:/test -Optional: The URL of the Plex server -plex_url> http://127.0.0.1:32400 -Optional: The username of the Plex user -plex_username> dummyusername -Optional: The password of the Plex user -y) Yes type in my own password -g) Generate random password -n) No leave this optional password blank -y/g/n> y -Enter the password: -password: -Confirm the password: -password: -The size of a chunk. Lower value good for slow connections but can affect seamless reading. -Default: 5M -Choose a number from below, or type in your own value - 1 / 1 MiB - \ "1M" - 2 / 5 MiB - \ "5M" - 3 / 10 MiB - \ "10M" -chunk_size> 2 -How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. -Accepted units are: "s", "m", "h". -Default: 5m -Choose a number from below, or type in your own value - 1 / 1 hour - \ "1h" - 2 / 24 hours - \ "24h" - 3 / 24 hours - \ "48h" -info_age> 2 -The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. -Default: 10G -Choose a number from below, or type in your own value - 1 / 500 MiB - \ "500M" - 2 / 1 GiB - \ "1G" - 3 / 10 GiB - \ "10G" -chunk_total_size> 3 -Remote config --------------------- -[test-cache] -remote = local:/test -plex_url = http://127.0.0.1:32400 -plex_username = dummyusername -plex_password = *** ENCRYPTED *** -chunk_size = 5M -info_age = 48h -chunk_total_size = 10G -``` +This can be used, for example, to change file name encryption type +without re-uploading all the data. Just make two crypt backends +pointing to two different directories with the single changed +parameter and use rclone move to move the files between the crypt +remotes. -You can then use it like this, +Properties: -List directories in top level of your drive +- Config: server_side_across_configs +- Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS +- Type: bool +- Default: false - rclone lsd test-cache: +#### --crypt-show-mapping -List all the files in your drive +For all files listed show how the names encrypt. - rclone ls test-cache: +If this flag is set then for each file that the remote is asked to +list, it will log (at level INFO) a line stating the decrypted file +name and the encrypted file name. -To start a cached mount +This is so you can work out which encrypted names are which decrypted +names just in case you need to do something with the encrypted file +names, or for debugging purposes. - rclone mount --allow-other test-cache: /var/tmp/test-cache +Properties: -### Write Features ### +- Config: show_mapping +- Env Var: RCLONE_CRYPT_SHOW_MAPPING +- Type: bool +- Default: false -### Offline uploading ### +#### --crypt-no-data-encryption -In an effort to make writing through cache more reliable, the backend -now supports this feature which can be activated by specifying a -`cache-tmp-upload-path`. +Option to either encrypt file data or leave it unencrypted. -A files goes through these states when using this feature: +Properties: -1. An upload is started (usually by copying a file on the cache remote) -2. When the copy to the temporary location is complete the file is part -of the cached remote and looks and behaves like any other file (reading included) -3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` -is used to move the file to the cloud provider -4. Reading the file still works during the upload but most modifications on it will be prohibited -5. Once the move is complete the file is unlocked for modifications as it -becomes as any other regular file -6. If the file is being read through `cache` when it's actually -deleted from the temporary path then `cache` will simply swap the source -to the cloud provider without interrupting the reading (small blip can happen though) +- Config: no_data_encryption +- Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION +- Type: bool +- Default: false +- Examples: + - "true" + - Don't encrypt file data, leave it unencrypted. + - "false" + - Encrypt file data. -Files are uploaded in sequence and only one file is uploaded at a time. -Uploads will be stored in a queue and be processed based on the order they were added. -The queue and the temporary storage is persistent across restarts but -can be cleared on startup with the `--cache-db-purge` flag. +#### --crypt-pass-bad-blocks -### Write Support ### +If set this will pass bad blocks through as all 0. -Writes are supported through `cache`. -One caveat is that a mounted cache remote does not add any retry or fallback -mechanism to the upload operation. This will depend on the implementation -of the wrapped remote. Consider using `Offline uploading` for reliable writes. +This should not be set in normal operation, it should only be set if +trying to recover an encrypted file with errors and it is desired to +recover as much of the file as possible. -One special case is covered with `cache-writes` which will cache the file -data at the same time as the upload when it is enabled making it available -from the cache store immediately once the upload is finished. +Properties: -### Read Features ### +- Config: pass_bad_blocks +- Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS +- Type: bool +- Default: false -#### Multiple connections #### +#### --crypt-filename-encoding -To counter the high latency between a local PC where rclone is running -and cloud providers, the cache remote can split multiple requests to the -cloud provider for smaller file chunks and combines them together locally -where they can be available almost immediately before the reader usually -needs them. +How to encode the encrypted filename to text string. -This is similar to buffering when media files are played online. Rclone -will stay around the current marker but always try its best to stay ahead -and prepare the data before. +This option could help with shortening the encrypted filename. The +suitable option would depend on the way your remote count the filename +length and if it's case sensitive. -#### Plex Integration #### +Properties: -There is a direct integration with Plex which allows cache to detect during reading -if the file is in playback or not. This helps cache to adapt how it queries -the cloud provider depending on what is needed for. +- Config: filename_encoding +- Env Var: RCLONE_CRYPT_FILENAME_ENCODING +- Type: string +- Default: "base32" +- Examples: + - "base32" + - Encode using base32. Suitable for all remote. + - "base64" + - Encode using base64. Suitable for case sensitive remote. + - "base32768" + - Encode using base32768. Suitable if your remote counts UTF-16 or + - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) -Scans will have a minimum amount of workers (1) while in a confirmed playback cache -will deploy the configured number of workers. +#### --crypt-suffix -This integration opens the doorway to additional performance improvements -which will be explored in the near future. +If this is set it will override the default suffix of ".bin". -**Note:** If Plex options are not configured, `cache` will function with its -configured options without adapting any of its settings. +Setting suffix to "none" will result in an empty suffix. This may be useful +when the path length is critical. -How to enable? Run `rclone config` and add all the Plex options (endpoint, username -and password) in your remote and it will be automatically enabled. +Properties: -Affected settings: -- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times +- Config: suffix +- Env Var: RCLONE_CRYPT_SUFFIX +- Type: string +- Default: ".bin" -##### Certificate Validation ##### +### Metadata -When the Plex server is configured to only accept secure connections, it is -possible to use `.plex.direct` URLs to ensure certificate validation succeeds. -These URLs are used by Plex internally to connect to the Plex server securely. +Any metadata supported by the underlying remote is read and written. -The format for these URLs is the following: +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -`https://ip-with-dots-replaced.server-hash.plex.direct:32400/` +## Backend commands -The `ip-with-dots-replaced` part can be any IPv4 address, where the dots -have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. +Here are the commands specific to the crypt backend. -To get the `server-hash` part, the easiest way is to visit +Run them with -https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token + rclone backend COMMAND remote: -This page will list all the available Plex servers for your account -with at least one `.plex.direct` link for each. Copy one URL and replace -the IP address with the desired address. This can be used as the -`plex_url` value. +The help below will explain what arguments each command takes. -### Known issues ### +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -#### Mount and --dir-cache-time #### +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). ---dir-cache-time controls the first layer of directory caching which works at the mount layer. -Being an independent caching mechanism from the `cache` backend, it will manage its own entries -based on the configured time. +### encode -To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct -one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are -already configured in this way. +Encode the given filename(s) -#### Windows support - Experimental #### + rclone backend encode remote: [options] [+] -There are a couple of issues with Windows `mount` functionality that still require some investigations. -It should be considered as experimental thus far as fixes come in for this OS. +This encodes the filenames given as arguments returning a list of +strings of the encoded results. -Most of the issues seem to be related to the difference between filesystems -on Linux flavors and Windows as cache is heavily dependent on them. +Usage Example: -Any reports or feedback on how cache behaves on this OS is greatly appreciated. - -- https://github.com/rclone/rclone/issues/1935 -- https://github.com/rclone/rclone/issues/1907 -- https://github.com/rclone/rclone/issues/1834 + rclone backend encode crypt: file1 [file2...] + rclone rc backend/command command=encode fs=crypt: file1 [file2...] -#### Risk of throttling #### -Future iterations of the cache backend will make use of the pooling functionality -of the cloud provider to synchronize and at the same time make writing through it -more tolerant to failures. +### decode -There are a couple of enhancements in track to add these but in the meantime -there is a valid concern that the expiring cache listings can lead to cloud provider -throttles or bans due to repeated queries on it for very large mounts. +Decode the given filename(s) -Some recommendations: -- don't use a very small interval for entry information (`--cache-info-age`) -- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage -of adding the file in the cache at the same time if configured to do so. + rclone backend decode remote: [options] [+] -Future enhancements: +This decodes the filenames given as arguments returning a list of +strings of the decoded results. It will return an error if any of the +inputs are invalid. -- https://github.com/rclone/rclone/issues/1937 -- https://github.com/rclone/rclone/issues/1936 +Usage Example: -#### cache and crypt #### + rclone backend decode crypt: encryptedfile1 [encryptedfile2...] + rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] -One common scenario is to keep your data encrypted in the cloud provider -using the `crypt` remote. `crypt` uses a similar technique to wrap around -an existing remote and handles this translation in a seamless way. -There is an issue with wrapping the remotes in this order: -**cloud remote** -> **crypt** -> **cache** -During testing, I experienced a lot of bans with the remotes in this order. -I suspect it might be related to how crypt opens files on the cloud provider -which makes it think we're downloading the full file instead of small chunks. -Organizing the remotes in this order yields better results: -**cloud remote** -> **cache** -> **crypt** -#### absolute remote paths #### +## Backing up an encrypted remote -`cache` can not differentiate between relative and absolute paths for the wrapped remote. -Any path given in the `remote` config setting and on the command line will be passed to -the wrapped remote as is, but for storing the chunks on disk the path will be made -relative by removing any leading `/` character. +If you wish to backup an encrypted remote, it is recommended that you use +`rclone sync` on the encrypted files, and make sure the passwords are +the same in the new encrypted remote. -This behavior is irrelevant for most backend types, but there are backends where a leading `/` -changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are -relative to the root of the SSH server and paths without are relative to the user home directory. -As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent -a different directory on the SSH server. +This will have the following advantages -### Cache and Remote Control (--rc) ### -Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: -By default, the listener is disabled if you do not add the flag. + * `rclone sync` will check the checksums while copying + * you can use `rclone check` between the encrypted remotes + * you don't decrypt and encrypt unnecessarily -### rc cache/expire -Purge a remote from the cache backend. Supports either a directory or a file. -It supports both encrypted and unencrypted file names if cache is wrapped by crypt. +For example, let's say you have your original remote at `remote:` with +the encrypted version at `eremote:` with path `remote:crypt`. You +would then set up the new remote `remote2:` and then the encrypted +version `eremote2:` with path `remote2:crypt` using the same passwords +as `eremote:`. -Params: - - **remote** = path to remote **(required)** - - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ +To sync the two remotes you would do + rclone sync --interactive remote:crypt remote2:crypt -### Standard options +And to check the integrity you would do -Here are the Standard options specific to cache (Cache a remote). + rclone check remote:crypt remote2:crypt -#### --cache-remote +## File formats -Remote to cache. +### File encryption -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). +Files are encrypted 1:1 source file to destination object. The file +has a header and is divided into chunks. -Properties: +#### Header -- Config: remote -- Env Var: RCLONE_CACHE_REMOTE -- Type: string -- Required: true + * 8 bytes magic string `RCLONE\x00\x00` + * 24 bytes Nonce (IV) -#### --cache-plex-url +The initial nonce is generated from the operating systems crypto +strong random number generator. The nonce is incremented for each +chunk read making sure each nonce is unique for each block written. +The chance of a nonce being reused is minuscule. If you wrote an +exabyte of data (10¹⁸ bytes) you would have a probability of +approximately 2×10⁻³² of re-using a nonce. -The URL of the Plex server. +#### Chunk -Properties: +Each chunk will contain 64 KiB of data, except for the last one which +may have less data. The data chunk is in standard NaCl SecretBox +format. SecretBox uses XSalsa20 and Poly1305 to encrypt and +authenticate messages. -- Config: plex_url -- Env Var: RCLONE_CACHE_PLEX_URL -- Type: string -- Required: false +Each chunk contains: -#### --cache-plex-username + * 16 Bytes of Poly1305 authenticator + * 1 - 65536 bytes XSalsa20 encrypted data -The username of the Plex user. +64k chunk size was chosen as the best performing chunk size (the +authenticator takes too much time below this and the performance drops +off due to cache effects above this). Note that these chunks are +buffered in memory so they can't be too big. -Properties: +This uses a 32 byte (256 bit key) key derived from the user password. -- Config: plex_username -- Env Var: RCLONE_CACHE_PLEX_USERNAME -- Type: string -- Required: false +#### Examples -#### --cache-plex-password +1 byte file will encrypt to -The password of the Plex user. + * 32 bytes header + * 17 bytes data chunk -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +49 bytes total -Properties: +1 MiB (1048576 bytes) file will encrypt to -- Config: plex_password -- Env Var: RCLONE_CACHE_PLEX_PASSWORD -- Type: string -- Required: false + * 32 bytes header + * 16 chunks of 65568 bytes -#### --cache-chunk-size +1049120 bytes total (a 0.05% overhead). This is the overhead for big +files. -The size of a chunk (partial file data). +### Name encryption -Use lower numbers for slower connections. If the chunk size is -changed, any downloaded chunks will be invalid and cache-chunk-path -will need to be cleared or unexpected EOF errors will occur. +File names are encrypted segment by segment - the path is broken up +into `/` separated strings and these are encrypted individually. -Properties: +File segments are padded using PKCS#7 to a multiple of 16 bytes +before encryption. -- Config: chunk_size -- Env Var: RCLONE_CACHE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi -- Examples: - - "1M" - - 1 MiB - - "5M" - - 5 MiB - - "10M" - - 10 MiB +They are then encrypted with EME using AES with 256 bit key. EME +(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 +paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. -#### --cache-info-age +This makes for deterministic encryption which is what we want - the +same filename must encrypt to the same thing otherwise we can't find +it on the cloud storage system. -How long to cache file structure information (directory listings, file size, times, etc.). -If all write operations are done through the cache then you can safely make -this value very large as the cache store will also be updated in real time. +This means that -Properties: + * filenames with the same name will encrypt the same + * filenames which start the same won't have a common prefix -- Config: info_age -- Env Var: RCLONE_CACHE_INFO_AGE -- Type: Duration -- Default: 6h0m0s -- Examples: - - "1h" - - 1 hour - - "24h" - - 24 hours - - "48h" - - 48 hours +This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of +which are derived from the user password. -#### --cache-chunk-total-size +After encryption they are written out using a modified version of +standard `base32` encoding as described in RFC4648. The standard +encoding is modified in two ways: -The total size that the chunks can take up on the local disk. + * it becomes lower case (no-one likes upper case filenames!) + * we strip the padding character `=` -If the cache exceeds this value then it will start to delete the -oldest chunks until it goes under this value. +`base32` is used rather than the more efficient `base64` so rclone can be +used on case insensitive remotes (e.g. Windows, Amazon Drive). -Properties: +### Key derivation -- Config: chunk_total_size -- Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE -- Type: SizeSuffix -- Default: 10Gi -- Examples: - - "500M" - - 500 MiB - - "1G" - - 1 GiB - - "10G" - - 10 GiB +Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an +optional user supplied salt (password2) to derive the 32+32+16 = 80 +bytes of key material required. If the user doesn't supply a salt +then rclone uses an internal one. -### Advanced options +`scrypt` makes it impractical to mount a dictionary attack on rclone +encrypted data. For full protection against this you should always use +a salt. -Here are the Advanced options specific to cache (Cache a remote). +## SEE ALSO -#### --cache-plex-token +* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames -The plex token for authentication - auto set normally. +# Compress -Properties: +## Warning -- Config: plex_token -- Env Var: RCLONE_CACHE_PLEX_TOKEN -- Type: string -- Required: false +This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is +at your own risk. Please understand the risks associated with using experimental code and don't use this remote in +critical applications. -#### --cache-plex-insecure +The `Compress` remote adds compression to another remote. It is best used with remotes containing +many large compressible files. -Skip all certificate verification when connecting to the Plex server. +## Configuration -Properties: +To use this remote, all you need to do is specify another remote and a compression mode to use: -- Config: plex_insecure -- Env Var: RCLONE_CACHE_PLEX_INSECURE -- Type: string -- Required: false +``` +Current remotes: -#### --cache-db-path +Name Type +==== ==== +remote_to_press sometype -Directory to store file structure metadata DB. +e) Edit existing remote +$ rclone config +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> n +name> compress +... + 8 / Compress a remote + \ "compress" +... +Storage> compress +** See help for compress backend at: https://rclone.org/compress/ ** -The remote name is used as the DB file name. +Remote to compress. +Enter a string value. Press Enter for the default (""). +remote> remote_to_press:subdir +Compression mode. +Enter a string value. Press Enter for the default ("gzip"). +Choose a number from below, or type in your own value + 1 / Gzip compression balanced for speed and compression strength. + \ "gzip" +compression_mode> gzip +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[compress] +type = compress +remote = remote_to_press:subdir +compression_mode = gzip +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Properties: +### Compression Modes -- Config: db_path -- Env Var: RCLONE_CACHE_DB_PATH -- Type: string -- Default: "$HOME/.cache/rclone/cache-backend" +Currently only gzip compression is supported. It provides a decent balance between speed and size and is well +supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no +compression and 9 is strongest compression. -#### --cache-chunk-path +### File types -Directory to cache chunk files. +If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to +the compression algorithm you chose. These files are standard files that can be opened by various archive programs, +but they have some hidden metadata that allows them to be used by rclone. +While you may download and decompress these files at will, do **not** manually delete or rename files. Files without +correct metadata files will not be recognized by rclone. -Path to where partial file data (chunks) are stored locally. The remote -name is appended to the final path. +### File names -This config follows the "--cache-db-path". If you specify a custom -location for "--cache-db-path" and don't specify one for "--cache-chunk-path" -then "--cache-chunk-path" will use the same path as "--cache-db-path". +The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded +size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. -Properties: -- Config: chunk_path -- Env Var: RCLONE_CACHE_CHUNK_PATH -- Type: string -- Default: "$HOME/.cache/rclone/cache-backend" +### Standard options -#### --cache-db-purge +Here are the Standard options specific to compress (Compress a remote). -Clear all the cached data for this remote on start. +#### --compress-remote -Properties: +Remote to compress. -- Config: db_purge -- Env Var: RCLONE_CACHE_DB_PURGE -- Type: bool -- Default: false +Properties: -#### --cache-chunk-clean-interval +- Config: remote +- Env Var: RCLONE_COMPRESS_REMOTE +- Type: string +- Required: true -How often should the cache perform cleanups of the chunk storage. +#### --compress-mode -The default value should be ok for most people. If you find that the -cache goes over "cache-chunk-total-size" too often then try to lower -this value to force it to perform cleanups more often. +Compression mode. Properties: -- Config: chunk_clean_interval -- Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL -- Type: Duration -- Default: 1m0s +- Config: mode +- Env Var: RCLONE_COMPRESS_MODE +- Type: string +- Default: "gzip" +- Examples: + - "gzip" + - Standard gzip compression with fastest parameters. -#### --cache-read-retries +### Advanced options -How many times to retry a read from a cache storage. +Here are the Advanced options specific to compress (Compress a remote). -Since reading from a cache stream is independent from downloading file -data, readers can get to a point where there's no more data in the -cache. Most of the times this can indicate a connectivity issue if -cache isn't able to provide file data anymore. +#### --compress-level -For really slow connections, increase this to a point where the stream is -able to provide data but your experience will be very stuttering. +GZIP compression level (-2 to 9). + +Generally -1 (default, equivalent to 5) is recommended. +Levels 1 to 9 increase compression at the cost of speed. Going past 6 +generally offers very little return. + +Level -2 uses Huffman encoding only. Only use if you know what you +are doing. +Level 0 turns off compression. Properties: -- Config: read_retries -- Env Var: RCLONE_CACHE_READ_RETRIES +- Config: level +- Env Var: RCLONE_COMPRESS_LEVEL - Type: int -- Default: 10 - -#### --cache-workers +- Default: -1 -How many workers should run in parallel to download chunks. +#### --compress-ram-cache-limit -Higher values will mean more parallel processing (better CPU needed) -and more concurrent requests on the cloud provider. This impacts -several aspects like the cloud provider API limits, more stress on the -hardware that rclone runs on but it also means that streams will be -more fluid and data will be available much more faster to readers. +Some remotes don't allow the upload of files with unknown size. +In this case the compressed file will need to be cached to determine +it's size. -**Note**: If the optional Plex integration is enabled then this -setting will adapt to the type of reading performed and the value -specified here will be used as a maximum number of workers to use. +Files smaller than this limit will be cached in RAM, files larger than +this limit will be cached on disk. Properties: -- Config: workers -- Env Var: RCLONE_CACHE_WORKERS -- Type: int -- Default: 4 +- Config: ram_cache_limit +- Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT +- Type: SizeSuffix +- Default: 20Mi -#### --cache-chunk-no-memory +### Metadata -Disable the in-memory cache for storing chunks during streaming. +Any metadata supported by the underlying remote is read and written. -By default, cache will keep file data during streaming in RAM as well -to provide it to readers as fast as possible. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -This transient data is evicted as soon as it is read and the number of -chunks stored doesn't exceed the number of workers. However, depending -on other settings like "cache-chunk-size" and "cache-workers" this footprint -can increase if there are parallel streams too (multiple files being read -at the same time). -If the hardware permits it, use this feature to provide an overall better -performance during streaming but it can also be disabled if RAM is not -available on the local machine. -Properties: +# Combine -- Config: chunk_no_memory -- Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY -- Type: bool -- Default: false +The `combine` backend joins remotes together into a single directory +tree. -#### --cache-rps +For example you might have a remote for images on one provider: -Limits the number of requests per second to the source FS (-1 to disable). +``` +$ rclone tree s3:imagesbucket +/ +├── image1.jpg +└── image2.jpg +``` -This setting places a hard limit on the number of requests per second -that cache will be doing to the cloud provider remote and try to -respect that value by setting waits between reads. +And a remote for files on another: -If you find that you're getting banned or limited on the cloud -provider through cache and know that a smaller number of requests per -second will allow you to work with it then you can use this setting -for that. +``` +$ rclone tree drive:important/files +/ +├── file1.txt +└── file2.txt +``` -A good balance of all the other settings should make this setting -useless but it is available to set for more special cases. +The `combine` backend can join these together into a synthetic +directory structure like this: -**NOTE**: This will limit the number of requests during streams but -other API calls to the cloud provider like directory listings will -still pass. +``` +$ rclone tree combined: +/ +├── files +│ ├── file1.txt +│ └── file2.txt +└── images + ├── image1.jpg + └── image2.jpg +``` -Properties: +You'd do this by specifying an `upstreams` parameter in the config +like this -- Config: rps -- Env Var: RCLONE_CACHE_RPS -- Type: int -- Default: -1 + upstreams = images=s3:imagesbucket files=drive:important/files -#### --cache-writes +During the initial setup with `rclone config` you will specify the +upstreams remotes as a space separated list. The upstream remotes can +either be a local paths or other remotes. -Cache file data on writes through the FS. +## Configuration -If you need to read files immediately after you upload them through -cache you can enable this flag to have their data stored in the -cache store at the same time during upload. +Here is an example of how to make a combine called `remote` for the +example above. First run: -Properties: + rclone config -- Config: writes -- Env Var: RCLONE_CACHE_WRITES -- Type: bool -- Default: false +This will guide you through an interactive setup process: -#### --cache-tmp-upload-path +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +... +XX / Combine several remotes into one + \ (combine) +... +Storage> combine +Option upstreams. +Upstreams for combining +These should be in the form + dir=remote:path dir2=remote2:path +Where before the = is specified the root directory and after is the remote to +put there. +Embedded spaces can be added using quotes + "dir=remote:path with space" "dir2=remote2:path with space" +Enter a fs.SpaceSepList value. +upstreams> images=s3:imagesbucket files=drive:important/files +-------------------- +[remote] +type = combine +upstreams = images=s3:imagesbucket files=drive:important/files +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Directory to keep temporary files until they are uploaded. +### Configuring for Google Drive Shared Drives -This is the path where cache will use as a temporary storage for new -files that need to be uploaded to the cloud provider. +Rclone has a convenience feature for making a combine backend for all +the shared drives you have access to. -Specifying a value will enable this feature. Without it, it is -completely disabled and files will be uploaded directly to the cloud -provider +Assuming your main (non shared drive) Google drive remote is called +`drive:` you would run -Properties: + rclone backend -o config drives drive: -- Config: tmp_upload_path -- Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH -- Type: string -- Required: false +This would produce something like this: -#### --cache-tmp-wait-time + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: -How long should files be stored in local cache before being uploaded. + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: -This is the duration that a file must wait in the temporary location -_cache-tmp-upload-path_ before it is selected for upload. + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" -Note that only one file is uploaded at a time and it can take longer -to start the upload if a queue formed for this purpose. +If you then add that config to your config file (find it with `rclone +config file`) then you can access all the shared drives in one place +with the `AllDrives:` remote. -Properties: +See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. -- Config: tmp_wait_time -- Env Var: RCLONE_CACHE_TMP_WAIT_TIME -- Type: Duration -- Default: 15s -#### --cache-db-wait-time +### Standard options -How long to wait for the DB to be available - 0 is unlimited. +Here are the Standard options specific to combine (Combine several remotes into one). -Only one process can have the DB open at any one time, so rclone waits -for this duration for the DB to become available before it gives an -error. +#### --combine-upstreams -If you set it to 0 then it will wait forever. +Upstreams for combining -Properties: +These should be in the form -- Config: db_wait_time -- Env Var: RCLONE_CACHE_DB_WAIT_TIME -- Type: Duration -- Default: 1s + dir=remote:path dir2=remote2:path -## Backend commands +Where before the = is specified the root directory and after is the remote to +put there. -Here are the commands specific to the cache backend. +Embedded spaces can be added using quotes -Run them with + "dir=remote:path with space" "dir2=remote2:path with space" - rclone backend COMMAND remote: -The help below will explain what arguments each command takes. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +Properties: -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +- Config: upstreams +- Env Var: RCLONE_COMBINE_UPSTREAMS +- Type: SpaceSepList +- Default: -### stats +### Metadata -Print stats on the cache backend in JSON format. +Any metadata supported by the underlying remote is read and written. - rclone backend stats remote: [options] [+] +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -# Chunker +# Dropbox -The `chunker` overlay transparently splits large files into smaller chunks -during upload to wrapped remote and transparently assembles them back -when the file is downloaded. This allows to effectively overcome size limits -imposed by storage providers. +Paths are specified as `remote:path` + +Dropbox paths may be as deep as required, e.g. +`remote:directory/subdirectory`. ## Configuration -To use it, first set up the underlying remote following the configuration -instructions for that remote. You can also use a local pathname instead of -a remote. +The initial setup for dropbox involves getting a token from Dropbox +which you need to do in your browser. `rclone config` walks you +through it. -First check your chosen remote is working - we'll call it `remote:path` here. -Note that anything inside `remote:path` will be chunked and anything outside -won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) -then you should probably put the bucket in the remote `s3:bucket`. +Here is an example of how to make a remote called `remote`. First run: -Now configure `chunker` using `rclone config`. We will call this one `overlay` -to separate it from the `remote` itself. + rclone config + +This will guide you through an interactive setup process: ``` -No remotes found, make a new one? n) New remote -s) Set configuration password +d) Delete remote q) Quit config -n/s/q> n -name> overlay +e/n/d/q> n +name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Transparently chunk/split large files - \ "chunker" +XX / Dropbox + \ "dropbox" [snip] -Storage> chunker -Remote to chunk/unchunk. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). -Enter a string value. Press Enter for the default (""). -remote> remote:path -Files larger than chunk size will be split in chunks. -Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). -chunk_size> 100M -Choose how chunker handles hash sums. All modes but "none" require metadata. -Enter a string value. Press Enter for the default ("md5"). -Choose a number from below, or type in your own value - 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise - \ "none" - 2 / MD5 for composite files - \ "md5" - 3 / SHA1 for composite files - \ "sha1" - 4 / MD5 for all files - \ "md5all" - 5 / SHA1 for all files - \ "sha1all" - 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported - \ "md5quick" - 7 / Similar to "md5quick" but prefers SHA1 over MD5 - \ "sha1quick" -hash_type> md5 -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n +Storage> dropbox +Dropbox App Key - leave blank normally. +app_key> +Dropbox App Secret - leave blank normally. +app_secret> Remote config +Please visit: +https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code +Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX -------------------- -[overlay] -type = chunker -remote = remote:bucket -chunk_size = 100M -hash_type = md5 +[remote] +app_key = +app_secret = +token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX -------------------- y) Yes this is OK e) Edit this remote -d) Delete this remote -y/e/d> y -``` - -### Specifying the remote - -In normal use, make sure the remote has a `:` in. If you specify the remote -without a `:` then rclone will use a local directory of that name. -So if you use a remote of `/path/to/secret/files` then rclone will -chunk stuff in that directory. If you use a remote of `name` then rclone -will put files in a directory called `name` in the current directory. - - -### Chunking - -When rclone starts a file upload, chunker checks the file size. If it -doesn't exceed the configured chunk size, chunker will just pass the file -to the wrapped remote. If a file is large, chunker will transparently cut -data in pieces with temporary names and stream them one by one, on the fly. -Each data chunk will contain the specified number of bytes, except for the -last one which may have less data. If file size is unknown in advance -(this is called a streaming upload), chunker will internally create -a temporary copy, record its size and repeat the above process. +d) Delete this remote +y/e/d> y +``` -When upload completes, temporary chunk files are finally renamed. -This scheme guarantees that operations can be run in parallel and look -from outside as atomic. -A similar method with hidden temporary chunks is used for other operations -(copy/move/rename, etc.). If an operation fails, hidden chunks are normally -destroyed, and the target composite file stays intact. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -When a composite file download is requested, chunker transparently -assembles it by concatenating data chunks in order. As the split is trivial -one could even manually concatenate data chunks together to obtain the -original content. +Note that rclone runs a webserver on your local machine to collect the +token as returned from Dropbox. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and it +may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -When the `list` rclone command scans a directory on wrapped remote, -the potential chunk files are accounted for, grouped and assembled into -composite directory entries. Any temporary chunks are hidden. +You can then use it like this, -List and other commands can sometimes come across composite files with -missing or invalid chunks, e.g. shadowed by like-named directory or -another file. This usually means that wrapped file system has been directly -tampered with or damaged. If chunker detects a missing chunk it will -by default print warning, skip the whole incomplete group of chunks but -proceed with current command. -You can set the `--chunker-fail-hard` flag to have commands abort with -error message in such cases. +List directories in top level of your dropbox + rclone lsd remote: -#### Chunk names +List all the files in your dropbox -The default chunk name format is `*.rclone_chunk.###`, hence by default -chunk names are `BIG_FILE_NAME.rclone_chunk.001`, -`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format -using the `name_format` configuration file option. The format uses asterisk -`*` as a placeholder for the base file name and one or more consecutive -hash characters `#` as a placeholder for sequential chunk number. -There must be one and only one asterisk. The number of consecutive hash -characters defines the minimum length of a string representing a chunk number. -If decimal chunk number has less digits than the number of hashes, it is -left-padded by zeros. If the decimal string is longer, it is left intact. -By default numbering starts from 1 but there is another option that allows -user to start from 0, e.g. for compatibility with legacy software. + rclone ls remote: -For example, if name format is `big_*-##.part` and original file name is -`data.txt` and numbering starts from 0, then the first chunk will be named -`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` -and the 302nd chunk will become `big_data.txt-301.part`. +To copy a local directory to a dropbox directory called backup -Note that `list` assembles composite directory entries only when chunk names -match the configured format and treats non-conforming file names as normal -non-chunked files. + rclone copy /home/source remote:backup -When using `norename` transactions, chunk names will additionally have a unique -file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. +### Dropbox for business +Rclone supports Dropbox for business and Team Folders. -### Metadata +When using Dropbox for business `remote:` and `remote:path/to/file` +will refer to your personal folder. -Besides data chunks chunker will by default create metadata object for -a composite file. The object is named after the original file. -Chunker allows user to disable metadata completely (the `none` format). -Note that metadata is normally not created for files smaller than the -configured chunk size. This may change in future rclone releases. +If you wish to see Team Folders you must use a leading `/` in the +path, so `rclone lsd remote:/` will refer to the root and show you all +Team Folders and your User Folder. -#### Simple JSON metadata format +You can then use team folders like this `remote:/TeamFolder` and +`remote:/TeamFolder/path/to/file`. -This is the default format. It supports hash sums and chunk validation -for composite files. Meta objects carry the following fields: +A leading `/` for a Dropbox personal account will do nothing, but it +will take an extra HTTP transaction so it should be avoided. -- `ver` - version of format, currently `1` -- `size` - total size of composite file -- `nchunks` - number of data chunks in file -- `md5` - MD5 hashsum of composite file (if present) -- `sha1` - SHA1 hashsum (if present) -- `txn` - identifies current version of the file +### Modification times and hashes -There is no field for composite file name as it's simply equal to the name -of meta object on the wrapped remote. Please refer to respective sections -for details on hashsums and modified time handling. +Dropbox supports modified times, but the only way to set a +modification time is to re-upload the file. -#### No metadata +This means that if you uploaded your data with an older version of +rclone which didn't support the v2 API and modified times, rclone will +decide to upload all your old data to fix the modification times. If +you don't want this to happen use `--size-only` or `--checksum` flag +to stop it. -You can disable meta objects by setting the meta format option to `none`. -In this mode chunker will scan directory for all files that follow -configured chunk name format, group them by detecting chunks with the same -base name and show group names as virtual composite files. -This method is more prone to missing chunk errors (especially missing -last chunk) than format with metadata enabled. +Dropbox supports [its own hash +type](https://www.dropbox.com/developers/reference/content-hash) which +is checked for all transfers. +### Restricted filename characters -### Hashsums +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | +| DEL | 0x7F | ␡ | +| \ | 0x5C | \ | -Chunker supports hashsums only when a compatible metadata is present. -Hence, if you choose metadata format of `none`, chunker will report hashsum -as `UNSUPPORTED`. +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: -Please note that by default metadata is stored only for composite files. -If a file is smaller than configured chunk size, chunker will transparently -redirect hash requests to wrapped remote, so support depends on that. -You will see the empty string as a hashsum of requested type for small -files if the wrapped remote doesn't support it. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | -Many storage backends support MD5 and SHA1 hash types, so does chunker. -With chunker you can choose one or another but not both. -MD5 is set by default as the most supported type. -Since chunker keeps hashes for composite files and falls back to the -wrapped remote hash for non-chunked ones, we advise you to choose the same -hash type as supported by wrapped remote so that your file listings -look coherent. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -If your storage backend does not support MD5 or SHA1 but you need consistent -file hashing, configure chunker with `md5all` or `sha1all`. These two modes -guarantee given hash for all files. If wrapped remote doesn't support it, -chunker will then add metadata to all files, even small. However, this can -double the amount of small files in storage and incur additional service charges. -You can even use chunker to force md5/sha1 support in any other remote -at expense of sidecar meta objects by setting e.g. `chunk_type=sha1all` -to force hashsums and `chunk_size=1P` to effectively disable chunking. +### Batch mode uploads {#batch-mode} -Normally, when a file is copied to chunker controlled remote, chunker -will ask the file source for compatible file hash and revert to on-the-fly -calculation if none is found. This involves some CPU overhead but provides -a guarantee that given hashsum is available. Also, chunker will reject -a server-side copy or move operation if source and destination hashsum -types are different resulting in the extra network bandwidth, too. -In some rare cases this may be undesired, so chunker provides two optional -choices: `sha1quick` and `md5quick`. If the source does not support primary -hash type and the quick mode is enabled, chunker will try to fall back to -the secondary type. This will save CPU and bandwidth but can result in empty -hashsums at destination. Beware of consequences: the `sync` command will -revert (sometimes silently) to time/size comparison if compatible hashsums -between source and target are not found. +Using batch mode uploads is very important for performance when using +the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) +for more info. +There are 3 modes rclone can use for uploads. -### Modified time +#### --dropbox-batch-mode off -Chunker stores modification times using the wrapped remote so support -depends on that. For a small non-chunked file the chunker overlay simply -manipulates modification time of the wrapped remote file. -For a composite file with metadata chunker will get and set -modification time of the metadata object on the wrapped remote. -If file is chunked but metadata format is `none` then chunker will -use modification time of the first data chunk. +In this mode rclone will not use upload batching. This was the default +before rclone v1.55. It has the disadvantage that it is very likely to +encounter `too_many_requests` errors like this + NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. -### Migrations +When rclone receives these it has to wait for 15s or sometimes 300s +before continuing which really slows down transfers. -The idiomatic way to migrate to a different chunk size, hash type, transaction -style or chunk naming scheme is to: +This will happen especially if `--transfers` is large, so this mode +isn't recommended except for compatibility or investigating problems. -- Collect all your chunked files under a directory and have your - chunker remote point to it. -- Create another directory (most probably on the same cloud storage) - and configure a new remote with desired metadata format, - hash type, chunk naming etc. -- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data - will be transparently converted in transfer. - This may take some time, yet chunker will try server-side - copy if possible. -- After checking data integrity you may remove configuration section - of the old remote. +#### --dropbox-batch-mode sync -If rclone gets killed during a long operation on a big composite file, -hidden temporary chunks may stay in the directory. They will not be -shown by the `list` command but will eat up your account quota. -Please note that the `deletefile` command deletes only active -chunks of a file. As a workaround, you can use remote of the wrapped -file system to see them. -An easy way to get rid of hidden garbage is to copy littered directory -somewhere using the chunker remote and purge the original directory. -The `copy` command will copy only active chunks while the `purge` will -remove everything including garbage. +In this mode rclone will batch up uploads to the size specified by +`--dropbox-batch-size` and commit them together. +Using this mode means you can use a much higher `--transfers` +parameter (32 or 64 works fine) without receiving `too_many_requests` +errors. -### Caveats and Limitations +This mode ensures full data integrity. -Chunker requires wrapped remote to support server-side `move` (or `copy` + -`delete`) operations, otherwise it will explicitly refuse to start. -This is because it internally renames temporary chunk files to their final -names when an operation completes successfully. +Note that there may be a pause when quitting rclone while rclone +finishes up the last batch using this mode. -Chunker encodes chunk number in file name, so with default `name_format` -setting it adds 17 characters. Also chunker adds 7 characters of temporary -suffix during operations. Many file systems limit base file name without path -by 255 characters. Using rclone's crypt remote as a base file system limits -file name by 143 characters. Thus, maximum name length is 231 for most files -and 119 for chunker-over-crypt. A user in need can change name format to -e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). +#### --dropbox-batch-mode async -Note that a move implemented using the copy-and-delete method may incur -double charging with some cloud storage providers. +In this mode rclone will batch up uploads to the size specified by +`--dropbox-batch-size` and commit them together. -Chunker will not automatically rename existing chunks when you run -`rclone config` on a live remote and change the chunk name format. -Beware that in result of this some files which have been treated as chunks -before the change can pop up in directory listings as normal files -and vice versa. The same warning holds for the chunk size. -If you desperately need to change critical chunking settings, you should -run data migration as described above. +However it will not wait for the status of the batch to be returned to +the caller. This means rclone can use a much bigger batch size (much +bigger than `--transfers`), at the cost of not being able to check the +status of the upload. -If wrapped remote is case insensitive, the chunker overlay will inherit -that property (so you can't have a file called "Hello.doc" and "hello.doc" -in the same directory). +This provides the maximum possible upload speed especially with lots +of small files, however rclone can't check the file got uploaded +properly using this mode. -Chunker included in rclone releases up to `v1.54` can sometimes fail to -detect metadata produced by recent versions of rclone. We recommend users -to keep rclone up-to-date to avoid data corruption. +If you are using this mode then using "rclone check" after the +transfer completes is recommended. Or you could do an initial transfer +with `--dropbox-batch-mode async` then do a final transfer with +`--dropbox-batch-mode sync` (the default). + +Note that there may be a pause when quitting rclone while rclone +finishes up the last batch using this mode. -Changing `transactions` is dangerous and requires explicit migration. ### Standard options -Here are the Standard options specific to chunker (Transparently chunk/split large files). +Here are the Standard options specific to dropbox (Dropbox). -#### --chunker-remote +#### --dropbox-client-id -Remote to chunk/unchunk. +OAuth Client Id. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). +Leave blank normally. Properties: -- Config: remote -- Env Var: RCLONE_CHUNKER_REMOTE +- Config: client_id +- Env Var: RCLONE_DROPBOX_CLIENT_ID - Type: string -- Required: true - -#### --chunker-chunk-size - -Files larger than chunk size will be split in chunks. - -Properties: - -- Config: chunk_size -- Env Var: RCLONE_CHUNKER_CHUNK_SIZE -- Type: SizeSuffix -- Default: 2Gi +- Required: false -#### --chunker-hash-type +#### --dropbox-client-secret -Choose how chunker handles hash sums. +OAuth Client Secret. -All modes but "none" require metadata. +Leave blank normally. Properties: -- Config: hash_type -- Env Var: RCLONE_CHUNKER_HASH_TYPE +- Config: client_secret +- Env Var: RCLONE_DROPBOX_CLIENT_SECRET - Type: string -- Default: "md5" -- Examples: - - "none" - - Pass any hash supported by wrapped remote for non-chunked files. - - Return nothing otherwise. - - "md5" - - MD5 for composite files. - - "sha1" - - SHA1 for composite files. - - "md5all" - - MD5 for all files. - - "sha1all" - - SHA1 for all files. - - "md5quick" - - Copying a file to chunker will request MD5 from the source. - - Falling back to SHA1 if unsupported. - - "sha1quick" - - Similar to "md5quick" but prefers SHA1 over MD5. +- Required: false ### Advanced options -Here are the Advanced options specific to chunker (Transparently chunk/split large files). - -#### --chunker-name-format +Here are the Advanced options specific to dropbox (Dropbox). -String format of chunk file names. +#### --dropbox-token -The two placeholders are: base file name (*) and chunk number (#...). -There must be one and only one asterisk and one or more consecutive hash characters. -If chunk number has less digits than the number of hashes, it is left-padded by zeros. -If there are more digits in the number, they are left as is. -Possible chunk files are ignored if their name does not match given format. +OAuth Access Token as a JSON blob. Properties: -- Config: name_format -- Env Var: RCLONE_CHUNKER_NAME_FORMAT +- Config: token +- Env Var: RCLONE_DROPBOX_TOKEN - Type: string -- Default: "*.rclone_chunk.###" +- Required: false -#### --chunker-start-from +#### --dropbox-auth-url -Minimum valid chunk number. Usually 0 or 1. +Auth server URL. -By default chunk numbers start from 1. +Leave blank to use the provider defaults. Properties: -- Config: start_from -- Env Var: RCLONE_CHUNKER_START_FROM -- Type: int -- Default: 1 +- Config: auth_url +- Env Var: RCLONE_DROPBOX_AUTH_URL +- Type: string +- Required: false -#### --chunker-meta-format +#### --dropbox-token-url -Format of the metadata object or "none". +Token server url. -By default "simplejson". -Metadata is a small JSON file named after the composite file. +Leave blank to use the provider defaults. Properties: -- Config: meta_format -- Env Var: RCLONE_CHUNKER_META_FORMAT +- Config: token_url +- Env Var: RCLONE_DROPBOX_TOKEN_URL - Type: string -- Default: "simplejson" -- Examples: - - "none" - - Do not use metadata files at all. - - Requires hash type "none". - - "simplejson" - - Simple JSON supports hash sums and chunk validation. - - - - It has the following fields: ver, size, nchunks, md5, sha1. - -#### --chunker-fail-hard - -Choose how chunker should handle files with missing or invalid chunks. +- Required: false -Properties: +#### --dropbox-chunk-size -- Config: fail_hard -- Env Var: RCLONE_CHUNKER_FAIL_HARD -- Type: bool -- Default: false -- Examples: - - "true" - - Report errors and abort current command. - - "false" - - Warn user, skip incomplete file and proceed. +Upload chunk size (< 150Mi). -#### --chunker-transactions +Any files larger than this will be uploaded in chunks of this size. -Choose how chunker should handle temporary files during transactions. +Note that chunks are buffered in memory (one at a time) so rclone can +deal with retries. Setting this larger will increase the speed +slightly (at most 10% for 128 MiB in tests) at the cost of using more +memory. It can be set smaller if you are tight on memory. Properties: -- Config: transactions -- Env Var: RCLONE_CHUNKER_TRANSACTIONS -- Type: string -- Default: "rename" -- Examples: - - "rename" - - Rename temporary files after a successful transaction. - - "norename" - - Leave temporary file names and write transaction ID to metadata file. - - Metadata is required for no rename transactions (meta format cannot be "none"). - - If you are using norename transactions you should be careful not to downgrade Rclone - - as older versions of Rclone don't support this transaction style and will misinterpret - - files manipulated by norename transactions. - - This method is EXPERIMENTAL, don't use on production systems. - - "auto" - - Rename or norename will be used depending on capabilities of the backend. - - If meta format is set to "none", rename transactions will always be used. - - This method is EXPERIMENTAL, don't use on production systems. - - - -# Citrix ShareFile - -[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. +- Config: chunk_size +- Env Var: RCLONE_DROPBOX_CHUNK_SIZE +- Type: SizeSuffix +- Default: 48Mi -## Configuration +#### --dropbox-impersonate -The initial setup for Citrix ShareFile involves getting a token from -Citrix ShareFile which you can in your browser. `rclone config` walks you -through it. +Impersonate this user when using a business account. -Here is an example of how to make a remote called `remote`. First run: +Note that if you want to use impersonate, you should make sure this +flag is set when running "rclone config" as this will cause rclone to +request the "members.read" scope which it won't normally. This is +needed to lookup a members email address into the internal ID that +dropbox uses in the API. - rclone config +Using the "members.read" scope will require a Dropbox Team Admin +to approve during the OAuth flow. -This will guide you through an interactive setup process: +You will have to use your own App (setting your own client_id and +client_secret) to use this option as currently rclone's default set of +permissions doesn't include "members.read". This can be added once +v1.55 or later is in use everywhere. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -XX / Citrix Sharefile - \ "sharefile" -Storage> sharefile -** See help for sharefile backend at: https://rclone.org/sharefile/ ** -ID of the root folder +Properties: -Leave blank to access "Personal Folders". You can use one of the -standard values here or any folder ID (long hex number ID). -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Access the Personal Folders. (Default) - \ "" - 2 / Access the Favorites folder. - \ "favorites" - 3 / Access all the shared folders. - \ "allshared" - 4 / Access all the individual connectors. - \ "connectors" - 5 / Access the home, favorites, and shared folders as well as the connectors. - \ "top" -root_folder_id> -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXX -Log in and authorize rclone for access -Waiting for code... -Got code --------------------- -[remote] -type = sharefile -endpoint = https://XXX.sharefile.com -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: impersonate +- Env Var: RCLONE_DROPBOX_IMPERSONATE +- Type: string +- Required: false -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +#### --dropbox-shared-files -Note that rclone runs a webserver on your local machine to collect the -token as returned from Citrix ShareFile. This only runs from the moment it opens -your browser to the moment you get back the verification code. This -is on `http://127.0.0.1:53682/` and this it may require you to unblock -it temporarily if you are running a host firewall. +Instructs rclone to work on individual shared files. -Once configured you can then use `rclone` like this, +In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) +operations and read operations (e.g. downloading) are supported in this mode. +All other operations will be disabled. -List directories in top level of your ShareFile +Properties: - rclone lsd remote: +- Config: shared_files +- Env Var: RCLONE_DROPBOX_SHARED_FILES +- Type: bool +- Default: false -List all the files in your ShareFile +#### --dropbox-shared-folders - rclone ls remote: +Instructs rclone to work on shared folders. + +When this flag is used with no path only the List operation is supported and +all available shared folders will be listed. If you specify a path the first part +will be interpreted as the name of shared folder. Rclone will then try to mount this +shared to the root namespace. On success shared folder rclone proceeds normally. +The shared folder is now pretty much a normal folder and all normal operations +are supported. -To copy a local directory to an ShareFile directory called backup +Note that we don't unmount the shared folder afterwards so the +--dropbox-shared-folders can be omitted after the first use of a particular +shared folder. - rclone copy /home/source remote:backup +Properties: -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +- Config: shared_folders +- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS +- Type: bool +- Default: false -### Modified time and hashes +#### --dropbox-pacer-min-sleep -ShareFile allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. +Minimum time to sleep between API calls. -ShareFile supports MD5 type hashes, so you can use the `--checksum` -flag. +Properties: -### Transfers +- Config: pacer_min_sleep +- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms -For files above 128 MiB rclone will use a chunked transfer. Rclone will -upload up to `--transfers` chunks at the same time (shared among all -the multipart uploads). Chunks are buffered in memory and are -normally 64 MiB so increasing `--transfers` will increase memory use. +#### --dropbox-encoding -### Restricted filename characters +The encoding for the backend. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \\ | 0x5C | \ | -| * | 0x2A | * | -| < | 0x3C | < | -| > | 0x3E | > | -| ? | 0x3F | ? | -| : | 0x3A | : | -| \| | 0x7C | | | -| " | 0x22 | " | +Properties: -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: +- Config: encoding +- Env Var: RCLONE_DROPBOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | -| . | 0x2E | . | +#### --dropbox-batch-mode -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Upload file batching sync|async|off. +This sets the batch mode used by rclone. -### Standard options +For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) -Here are the Standard options specific to sharefile (Citrix Sharefile). +This has 3 possible values -#### --sharefile-root-folder-id +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don't check completion -ID of the root folder. +Rclone will close any outstanding batches when it exits which may make +a delay on quit. -Leave blank to access "Personal Folders". You can use one of the -standard values here or any folder ID (long hex number ID). Properties: -- Config: root_folder_id -- Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID +- Config: batch_mode +- Env Var: RCLONE_DROPBOX_BATCH_MODE - Type: string -- Required: false -- Examples: - - "" - - Access the Personal Folders (default). - - "favorites" - - Access the Favorites folder. - - "allshared" - - Access all the shared folders. - - "connectors" - - Access all the individual connectors. - - "top" - - Access the home, favorites, and shared folders as well as the connectors. - -### Advanced options +- Default: "sync" -Here are the Advanced options specific to sharefile (Citrix Sharefile). +#### --dropbox-batch-size -#### --sharefile-upload-cutoff +Max number of files in upload batch. -Cutoff for switching to multipart upload. +This sets the batch size of files to upload. It has to be less than 1000. -Properties: +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. -- Config: upload_cutoff -- Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 128Mi +- batch_mode: async - default batch_size is 100 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use -#### --sharefile-chunk-size +Rclone will close any outstanding batches when it exits which may make +a delay on quit. -Upload chunk size. +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. -Must a power of 2 >= 256k. -Making this larger will improve performance, but note that each chunk -is buffered in memory one per transfer. +Properties: -Reducing this will reduce memory usage but decrease performance. +- Config: batch_size +- Env Var: RCLONE_DROPBOX_BATCH_SIZE +- Type: int +- Default: 0 -Properties: +#### --dropbox-batch-timeout -- Config: chunk_size -- Env Var: RCLONE_SHAREFILE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 64Mi +Max time to allow an idle upload batch before uploading. -#### --sharefile-endpoint +If an upload batch is idle for more than this long then it will be +uploaded. -Endpoint for API calls. +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. -This is usually auto discovered as part of the oauth process, but can -be set manually to something like: https://XXX.sharefile.com +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 500ms +- batch_mode: off - not in use Properties: -- Config: endpoint -- Env Var: RCLONE_SHAREFILE_ENDPOINT -- Type: string -- Required: false - -#### --sharefile-encoding +- Config: batch_timeout +- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT +- Type: Duration +- Default: 0s -The encoding for the backend. +#### --dropbox-batch-commit-timeout -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Max time to wait for a batch to finish committing Properties: -- Config: encoding -- Env Var: RCLONE_SHAREFILE_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot +- Config: batch_commit_timeout +- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s + ## Limitations -Note that ShareFile is case insensitive so you can't have a file called +Note that Dropbox is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc". -ShareFile only supports filenames up to 256 characters in length. +There are some file names such as `thumbs.db` which Dropbox can't +store. There is a full list of them in the ["Ignored Files" section +of this document](https://www.dropbox.com/en/help/145). Rclone will +issue an error message `File name disallowed - not uploading` if it +attempts to upload one of those file names, but the sync won't fail. -`rclone about` is not supported by the Citrix ShareFile backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Some errors may occur if you try to sync copyright-protected files +because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that +prevents this sort of file being downloaded. This will return the error `ERROR : +/path/to/your/file: Failed to copy: failed to open source object: +path/restricted_content/.` -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +If you have more than 10,000 files in a directory then `rclone purge +dropbox:dir` will return the error `Failed to purge: There are too +many files involved in this operation`. As a work-around do an +`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. -# Crypt +When using `rclone link` you'll need to set `--expire` if using a +non-personal account otherwise the visibility may not be correct. +(Note that `--expire` isn't supported on personal accounts). See the +[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the +[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). -Rclone `crypt` remotes encrypt and decrypt other remotes. +## Get your own Dropbox App ID -A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) -directly, but instead wraps another remote, which in turn accesses -the storage system. This is similar to how [alias](https://rclone.org/alias/), -[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) -and a few others work. It makes the usage very flexible, as you can -add a layer, in this case an encryption layer, on top of any other -backend, even in multiple layers. Rclone's functionality -can be used as with any other remote, for example you can -[mount](https://rclone.org/commands/rclone_mount/) a crypt remote. +When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. -Accessing a storage system through a crypt remote realizes client-side -encryption, which makes it safe to keep your data in a location you do -not trust will not get compromised. -When working against the `crypt` remote, rclone will automatically -encrypt (before uploading) and decrypt (after downloading) on your local -system as needed on the fly, leaving the data encrypted at rest in the -wrapped remote. If you access the storage system using an application -other than rclone, or access the wrapped remote directly using rclone, -there will not be any encryption/decryption: Downloading existing content -will just give you the encrypted (scrambled) format, and anything you -upload will *not* become encrypted. +Here is how to create your own Dropbox App ID for rclone: -The encryption is a secret-key encryption (also called symmetric key encryption) -algorithm, where a password (or pass phrase) is used to generate real encryption key. -The password can be supplied by user, or you may chose to let rclone -generate one. It will be stored in the configuration file, in a lightly obscured form. -If you are in an environment where you are not able to keep your configuration -secured, you should add -[configuration encryption](https://rclone.org/docs/#configuration-encryption) -as protection. As long as you have this configuration file, you will be able to -decrypt your data. Without the configuration file, as long as you remember -the password (or keep it in a safe place), you can re-create the configuration -and gain access to the existing data. You may also configure a corresponding -remote in a different installation to access the same data. -See below for guidance to [changing password](#changing-password). +1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not +to be the same account as the Dropbox you want to access) -Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), -to permute the encryption key so that the same string may be encrypted in -different ways. When configuring the crypt remote it is optional to enter a salt, -or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. -Normally in cryptography, the salt is stored together with the encrypted content, -and do not have to be memorized by the user. This is not the case in rclone, -because rclone does not store any additional information on the remotes. Use of -custom salt is effectively a second password that must be memorized. +2. Choose an API => Usually this should be `Dropbox API` -[File content](#file-encryption) encryption is performed using -[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), -based on XSalsa20 cipher and Poly1305 for integrity. -[Names](#name-encryption) (file- and directory names) are also encrypted -by default, but this has some implications and is therefore -possible to be turned off. +3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). -## Configuration +4. Name your App. The app name is global, so you can't use `rclone` for example -Here is an example of how to make a remote called `secret`. +5. Click the button `Create App` -To use `crypt`, first set up the underlying remote. Follow the -`rclone config` instructions for the specific backend. +6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` -Before configuring the crypt remote, check the underlying remote is -working. In this example the underlying remote is called `remote`. -We will configure a path `path` within this remote to contain the -encrypted content. Anything inside `remote:path` will be encrypted -and anything outside will not. +7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` -Configure `crypt` using `rclone config`. In this example the `crypt` -remote is called `secret`, to differentiate it from the underlying -`remote`. +8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` -When you are done you can use the crypt remote named `secret` just -as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, -and rclone will encrypt and decrypt as needed on the fly. -If you access the wrapped remote `remote:path` directly you will bypass -the encryption, and anything you read will be in encrypted form, and -anything you write will be unencrypted. To avoid issues it is best to -configure a dedicated path for encrypted content, and access it -exclusively through a crypt remote. +# Enterprise File Fabric + +This backend supports [Storage Made Easy's Enterprise File +Fabric™](https://storagemadeeasy.com/about/) which provides a software +solution to integrate and unify File and Object Storage accessible +through a global file system. + +## Configuration + +The initial setup for the Enterprise File Fabric backend involves +getting a token from the Enterprise File Fabric which you need to +do in your browser. `rclone config` walks you through it. + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: ``` No remotes found, make a new one? @@ -25774,1236 +31079,1350 @@ n) New remote s) Set configuration password q) Quit config n/s/q> n -name> secret +name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] -XX / Encrypt/Decrypt a remote - \ "crypt" +XX / Enterprise File Fabric + \ "filefabric" [snip] -Storage> crypt -** See help for crypt backend at: https://rclone.org/crypt/ ** +Storage> filefabric +** See help for filefabric backend at: https://rclone.org/filefabric/ ** -Remote to encrypt/decrypt. -Normally should contain a ':' and a path, eg "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). +URL of the Enterprise File Fabric to connect to Enter a string value. Press Enter for the default (""). -remote> remote:path -How to encrypt the filenames. -Enter a string value. Press Enter for the default ("standard"). -Choose a number from below, or type in your own value. - / Encrypt the filenames. - 1 | See the docs for the details. - \ "standard" - 2 / Very simple filename obfuscation. - \ "obfuscate" - / Don't encrypt the file names. - 3 | Adds a ".bin" extension only. - \ "off" -filename_encryption> -Option to either encrypt directory names or leave them intact. - -NB If filename_encryption is "off" then this option will do nothing. -Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value - 1 / Encrypt directory names. - \ "true" - 2 / Don't encrypt directory names, leave them intact. - \ "false" -directory_name_encryption> -Password or pass phrase for encryption. -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Password or pass phrase for salt. Optional but recommended. -Should be different to the previous password. -y) Yes type in my own password -g) Generate random password -n) No leave this optional password blank (default) -y/g/n> g -Password strength in bits. -64 is just about memorable -128 is secure -1024 is the maximum -Bits> 128 -Your password is: JAsJvRcgR-_veXNfy_sGmQ -Use this password? Please note that an obscured version of this -password (and not the password itself) will be stored under your -configuration file, so keep this generated password in a safe place. -y) Yes (default) -n) No -y/n> + 1 / Storage Made Easy US + \ "https://storagemadeeasy.com" + 2 / Storage Made Easy EU + \ "https://eu.storagemadeeasy.com" + 3 / Connect to your Enterprise File Fabric + \ "https://yourfabric.smestorage.com" +url> https://yourfabric.smestorage.com/ +ID of the root folder +Leave blank normally. + +Fill in to make rclone start with directory of a given ID. + +Enter a string value. Press Enter for the default (""). +root_folder_id> +Permanent Authentication Token + +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry +you'll see called "My Authentication Tokens". Click the Manage button +to create one. + +These tokens are normally valid for several years. + +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens + +Enter a string value. Press Enter for the default (""). +permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) No (default) -y/n> +y/n> n Remote config -------------------- -[secret] -type = crypt -remote = remote:path -password = *** ENCRYPTED *** -password2 = *** ENCRYPTED *** +[remote] +type = filefabric +url = https://yourfabric.smestorage.com/ +permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote -y/e/d> +y/e/d> y ``` -**Important** The crypt password stored in `rclone.conf` is lightly -obscured. That only protects it from cursory inspection. It is not -secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. - -A long passphrase is recommended, or `rclone config` can generate a -random one. - -The obscured password is created using AES-CTR with a static key. The -salt is stored verbatim at the beginning of the obscured password. This -static key is shared between all versions of rclone. - -If you reconfigure rclone with the same passwords/passphrases -elsewhere it will be compatible, but the obscured version will be different -due to the different salt. - -Rclone does not encrypt - - * file length - this can be calculated within 16 bytes - * modification time - used for syncing - -### Specifying the remote - -When configuring the remote to encrypt/decrypt, you may specify any -string that rclone accepts as a source/destination of other commands. - -The primary use case is to specify the path into an already configured -remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that -data in a remote untrusted location can be stored encrypted. - -You may also specify a local filesystem path, such as -`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating -a crypt remote pointing to such a local filesystem path, you can -use rclone as a utility for pure local file encryption, for example -to keep encrypted files on a removable USB drive. +Once configured you can then use `rclone` like this, -**Note**: A string which do not contain a `:` will by rclone be treated -as a relative path in the local filesystem. For example, if you enter -the name `remote` without the trailing `:`, it will be treated as -a subdirectory of the current directory with name "remote". +List directories in top level of your Enterprise File Fabric -If a path `remote:path/to/dir` is specified, rclone stores encrypted -files in `path/to/dir` on the remote. With file name encryption, files -saved to `secret:subdir/subfile` are stored in the unencrypted path -`path/to/dir` but the `subdir/subpath` element is encrypted. + rclone lsd remote: -The path you specify does not have to exist, rclone will create -it when needed. +List all the files in your Enterprise File Fabric -If you intend to use the wrapped remote both directly for keeping -unencrypted content, as well as through a crypt remote for encrypted -content, it is recommended to point the crypt remote to a separate -directory within the wrapped remote. If you use a bucket-based storage -system (e.g. Swift, S3, Google Compute Storage, B2) it is generally -advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). -If wrapping around the entire root of the storage (`s3:`), and use the -optional file name encryption, rclone will encrypt the bucket name. + rclone ls remote: -### Changing password +To copy a local directory to an Enterprise File Fabric directory called backup -Should the password, or the configuration file containing a lightly obscured -form of the password, be compromised, you need to re-encrypt your data with -a new password. Since rclone uses secret-key encryption, where the encryption -key is generated directly from the password kept on the client, it is not -possible to change the password/key of already encrypted content. Just changing -the password configured for an existing crypt remote means you will no longer -able to decrypt any of the previously encrypted content. The only possibility -is to re-upload everything via a crypt remote configured with your new password. + rclone copy /home/source remote:backup -Depending on the size of your data, your bandwidth, storage quota etc, there are -different approaches you can take: -- If you have everything in a different location, for example on your local system, -you could remove all of the prior encrypted files, change the password for your -configured crypt remote (or delete and re-create the crypt configuration), -and then re-upload everything from the alternative location. -- If you have enough space on the storage system you can create a new crypt -remote pointing to a separate directory on the same backend, and then use -rclone to copy everything from the original crypt remote to the new, -effectively decrypting everything on the fly using the old password and -re-encrypting using the new password. When done, delete the original crypt -remote directory and finally the rclone crypt configuration with the old password. -All data will be streamed from the storage system and back, so you will -get half the bandwidth and be charged twice if you have upload and download quota -on the storage system. +### Modification times and hashes -**Note**: A security problem related to the random password generator -was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated -by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 -(released 2020-10-26) are not considered secure and should be changed. -If you made up your own password, or used rclone version older than 1.49.0 or -newer than 1.53.2 to generate it, you are *not* affected by this issue. -See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more -details, and a tool you can use to check if you are affected. +The Enterprise File Fabric allows modification times to be set on +files accurate to 1 second. These will be used to detect whether +objects need syncing or not. -### Example +The Enterprise File Fabric does not support any data hashes at this time. -Create the following file structure using "standard" file name -encryption. +### Restricted filename characters -``` -plaintext/ -├── file0.txt -├── file1.txt -└── subdir - ├── file2.txt - ├── file3.txt - └── subsubdir - └── file4.txt -``` +The [default restricted characters set](https://rclone.org/overview/#restricted-characters) +will be replaced. -Copy these to the remote, and list them +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -``` -$ rclone -q copy plaintext secret: -$ rclone -q ls secret: - 7 file1.txt - 6 file0.txt - 8 subdir/file2.txt - 10 subdir/subsubdir/file4.txt - 9 subdir/file3.txt -``` +### Empty files -The crypt remote looks like +Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore +upload an empty file as a single space with a mime type of +`application/vnd.rclone.empty.file` and files with that mime type are +treated as empty. -``` -$ rclone -q ls remote:path - 55 hagjclgavj2mbiqm6u6cnjjqcg - 54 v05749mltvv1tf4onltun46gls - 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo - 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc - 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps -``` +### Root folder ID ### -The directory structure is preserved +You can set the `root_folder_id` for rclone. This is the directory +(identified by its `Folder ID`) that rclone considers to be the root +of your Enterprise File Fabric. -``` -$ rclone -q ls secret:subdir - 8 file2.txt - 9 file3.txt - 10 subsubdir/file4.txt -``` +Normally you will leave this blank and rclone will determine the +correct root to use itself. -Without file name encryption `.bin` extensions are added to underlying -names. This prevents the cloud provider attempting to interpret file -content. +However you can set this to restrict rclone to a specific folder +hierarchy. + +In order to do this you will have to find the `Folder ID` of the +directory you wish rclone to display. These aren't displayed in the +web interface, but you can use `rclone lsf` to find them, for example ``` -$ rclone -q ls remote:path - 54 file0.txt.bin - 57 subdir/file3.txt.bin - 56 subdir/file2.txt.bin - 58 subdir/subsubdir/file4.txt.bin - 55 file1.txt.bin +$ rclone lsf --dirs-only -Fip --csv filefabric: +120673758,Burnt PDFs/ +120673759,My Quick Uploads/ +120673755,My Syncs/ +120673756,My backups/ +120673757,My contacts/ +120673761,S3 Storage/ ``` -### File name encryption modes - -Off +The ID for "S3 Storage" would be `120673761`. - * doesn't hide file names or directory structure - * allows for longer file names (~246 characters) - * can use sub paths and copy single files -Standard +### Standard options - * file names encrypted - * file names can't be as long (~143 characters) - * can use sub paths and copy single files - * directory structure visible - * identical files names will have identical uploaded names - * can use shortcuts to shorten the directory recursion +Here are the Standard options specific to filefabric (Enterprise File Fabric). -Obfuscation +#### --filefabric-url -This is a simple "rotate" of the filename, with each file having a rot -distance based on the filename. Rclone stores the distance at the -beginning of the filename. A file called "hello" may become "53.jgnnq". +URL of the Enterprise File Fabric to connect to. -Obfuscation is not a strong encryption of filenames, but hinders -automated scanning tools picking up on filename patterns. It is an -intermediate between "off" and "standard" which allows for longer path -segment names. +Properties: -There is a possibility with some unicode based filenames that the -obfuscation is weak and may map lower case characters to upper case -equivalents. +- Config: url +- Env Var: RCLONE_FILEFABRIC_URL +- Type: string +- Required: true +- Examples: + - "https://storagemadeeasy.com" + - Storage Made Easy US + - "https://eu.storagemadeeasy.com" + - Storage Made Easy EU + - "https://yourfabric.smestorage.com" + - Connect to your Enterprise File Fabric -Obfuscation cannot be relied upon for strong protection. +#### --filefabric-root-folder-id - * file names very lightly obfuscated - * file names can be longer than standard encryption - * can use sub paths and copy single files - * directory structure visible - * identical files names will have identical uploaded names +ID of the root folder. -Cloud storage systems have limits on file name length and -total path length which rclone is more likely to breach using -"Standard" file name encryption. Where file names are less than 156 -characters in length issues should not be encountered, irrespective of -cloud storage provider. +Leave blank normally. -An experimental advanced option `filename_encoding` is now provided to -address this problem to a certain degree. -For cloud storage systems with case sensitive file names (e.g. Google Drive), -`base64` can be used to reduce file name length. -For cloud storage systems using UTF-16 to store file names internally -(e.g. OneDrive), `base32768` can be used to drastically reduce -file name length. +Fill in to make rclone start with directory of a given ID. -An alternative, future rclone file name encryption mode may tolerate -backend provider path length limits. -### Directory name encryption +Properties: -Crypt offers the option of encrypting dir names or leaving them intact. -There are two options: +- Config: root_folder_id +- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID +- Type: string +- Required: false -True +#### --filefabric-permanent-token -Encrypts the whole file path including directory names -Example: -`1/12/123.txt` is encrypted to -`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` +Permanent Authentication Token. -False +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry +you'll see called "My Authentication Tokens". Click the Manage button +to create one. -Only encrypts file names, skips directory names -Example: -`1/12/123.txt` is encrypted to -`1/12/qgm4avr35m5loi1th53ato71v0` +These tokens are normally valid for several years. +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens -### Modified time and hashes -Crypt stores modification times using the underlying remote so support -depends on that. +Properties: -Hashes are not stored for crypt. However the data integrity is -protected by an extremely strong crypto authenticator. +- Config: permanent_token +- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN +- Type: string +- Required: false -Use the `rclone cryptcheck` command to check the -integrity of a crypted remote instead of `rclone check` which can't -check the checksums properly. +### Advanced options +Here are the Advanced options specific to filefabric (Enterprise File Fabric). -### Standard options +#### --filefabric-token -Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). +Session Token. -#### --crypt-remote +This is a session token which rclone caches in the config file. It is +usually valid for 1 hour. -Remote to encrypt/decrypt. +Don't set this value - rclone will set it automatically. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). Properties: -- Config: remote -- Env Var: RCLONE_CRYPT_REMOTE +- Config: token +- Env Var: RCLONE_FILEFABRIC_TOKEN - Type: string -- Required: true +- Required: false -#### --crypt-filename-encryption +#### --filefabric-token-expiry + +Token expiry time. + +Don't set this value - rclone will set it automatically. -How to encrypt the filenames. Properties: -- Config: filename_encryption -- Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION +- Config: token_expiry +- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY - Type: string -- Default: "standard" -- Examples: - - "standard" - - Encrypt the filenames. - - See the docs for the details. - - "obfuscate" - - Very simple filename obfuscation. - - "off" - - Don't encrypt the file names. - - Adds a ".bin" extension only. +- Required: false -#### --crypt-directory-name-encryption +#### --filefabric-version -Option to either encrypt directory names or leave them intact. +Version read from the file fabric. + +Don't set this value - rclone will set it automatically. -NB If filename_encryption is "off" then this option will do nothing. Properties: -- Config: directory_name_encryption -- Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION -- Type: bool -- Default: true -- Examples: - - "true" - - Encrypt directory names. - - "false" - - Don't encrypt directory names, leave them intact. +- Config: version +- Env Var: RCLONE_FILEFABRIC_VERSION +- Type: string +- Required: false -#### --crypt-password +#### --filefabric-encoding -Password or pass phrase for encryption. +The encoding for the backend. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: password -- Env Var: RCLONE_CRYPT_PASSWORD -- Type: string -- Required: true +- Config: encoding +- Env Var: RCLONE_FILEFABRIC_ENCODING +- Type: Encoding +- Default: Slash,Del,Ctl,InvalidUtf8,Dot -#### --crypt-password2 -Password or pass phrase for salt. -Optional but recommended. -Should be different to the previous password. +# FTP -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +FTP is the File Transfer Protocol. Rclone FTP support is provided using the +[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) +package. -Properties: +[Limitations of Rclone's FTP backend](#limitations) -- Config: password2 -- Env Var: RCLONE_CRYPT_PASSWORD2 -- Type: string -- Required: false +Paths are specified as `remote:path`. If the path does not begin with +a `/` it is relative to the home directory of the user. An empty path +`remote:` refers to the user's home directory. -### Advanced options +## Configuration -Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). +To create an FTP configuration named `remote`, run -#### --crypt-server-side-across-configs + rclone config -Allow server-side operations (e.g. copy) to work across different crypt configs. +Rclone config guides you through an interactive setup process. A minimal +rclone FTP remote definition only requires host, username and password. +For an anonymous FTP server, see [below](#anonymous-ftp). -Normally this option is not what you want, but if you have two crypts -pointing to the same backend you can use it. +``` +No remotes found, make a new one? +n) New remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +n/r/c/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / FTP + \ "ftp" +[snip] +Storage> ftp +** See help for ftp backend at: https://rclone.org/ftp/ ** -This can be used, for example, to change file name encryption type -without re-uploading all the data. Just make two crypt backends -pointing to two different directories with the single changed -parameter and use rclone move to move the files between the crypt -remotes. +FTP host to connect to +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Connect to ftp.example.com + \ "ftp.example.com" +host> ftp.example.com +FTP username +Enter a string value. Press Enter for the default ("$USER"). +user> +FTP port number +Enter a signed integer. Press Enter for the default (21). +port> +FTP password +y) Yes type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Use FTP over TLS (Implicit) +Enter a boolean value (true or false). Press Enter for the default ("false"). +tls> +Use FTP over TLS (Explicit) +Enter a boolean value (true or false). Press Enter for the default ("false"). +explicit_tls> +Remote config +-------------------- +[remote] +type = ftp +host = ftp.example.com +pass = *** ENCRYPTED *** +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Properties: +To see all directories in the home directory of `remote` -- Config: server_side_across_configs -- Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false + rclone lsd remote: -#### --crypt-show-mapping +Make a new directory -For all files listed show how the names encrypt. + rclone mkdir remote:path/to/directory -If this flag is set then for each file that the remote is asked to -list, it will log (at level INFO) a line stating the decrypted file -name and the encrypted file name. +List the contents of a directory -This is so you can work out which encrypted names are which decrypted -names just in case you need to do something with the encrypted file -names, or for debugging purposes. + rclone ls remote:path/to/directory -Properties: +Sync `/home/local/directory` to the remote directory, deleting any +excess files in the directory. -- Config: show_mapping -- Env Var: RCLONE_CRYPT_SHOW_MAPPING -- Type: bool -- Default: false + rclone sync --interactive /home/local/directory remote:directory -#### --crypt-no-data-encryption +### Anonymous FTP -Option to either encrypt file data or leave it unencrypted. +When connecting to a FTP server that allows anonymous login, you can use the +special "anonymous" username. Traditionally, this user account accepts any +string as a password, although it is common to use either the password +"anonymous" or "guest". Some servers require the use of a valid e-mail +address as password. -Properties: +Using [on-the-fly](#backend-path-to-dir) or +[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access +such servers, without requiring any configuration in advance. The following +are examples of that: -- Config: no_data_encryption -- Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION -- Type: bool -- Default: false -- Examples: - - "true" - - Don't encrypt file data, leave it unencrypted. - - "false" - - Encrypt file data. + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): -#### --crypt-filename-encoding +The above examples work in Linux shells and in PowerShell, but not Windows +Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) +command to create a password string in the format required by the +[pass](#ftp-pass) option. The following examples are exactly the same, except use +an already obscured string representation of the same password "dummy", and +therefore works even in Windows Command Prompt: -How to encode the encrypted filename to text string. + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: -This option could help with shortening the encrypted filename. The -suitable option would depend on the way your remote count the filename -length and if it's case sensitive. +### Implicit TLS -Properties: +Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to +be enabled in the FTP backend config for the remote, or with +[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and +can be set with [`--ftp-port`](#ftp-port). -- Config: filename_encoding -- Env Var: RCLONE_CRYPT_FILENAME_ENCODING -- Type: string -- Default: "base32" -- Examples: - - "base32" - - Encode using base32. Suitable for all remote. - - "base64" - - Encode using base64. Suitable for case sensitive remote. - - "base32768" - - Encode using base32768. Suitable if your remote counts UTF-16 or - - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive) +### Restricted filename characters -### Metadata +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Any metadata supported by the underlying remote is read and written. +File names cannot end with the following characters. Replacement is +limited to the last character in a file name: -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | -## Backend commands +Not all FTP servers can have all characters in file names, for example: -Here are the commands specific to the crypt backend. +| FTP Server| Forbidden characters | +| --------- |:--------------------:| +| proftpd | `*` | +| pureftpd | `\ [ ]` | -Run them with +This backend's interactive configuration wizard provides a selection of +sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. +Just hit a selection number when prompted. - rclone backend COMMAND remote: -The help below will explain what arguments each command takes. +### Standard options -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +Here are the Standard options specific to ftp (FTP). -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +#### --ftp-host -### encode +FTP host to connect to. -Encode the given filename(s) +E.g. "ftp.example.com". - rclone backend encode remote: [options] [+] +Properties: -This encodes the filenames given as arguments returning a list of -strings of the encoded results. +- Config: host +- Env Var: RCLONE_FTP_HOST +- Type: string +- Required: true -Usage Example: +#### --ftp-user - rclone backend encode crypt: file1 [file2...] - rclone rc backend/command command=encode fs=crypt: file1 [file2...] +FTP username. +Properties: -### decode +- Config: user +- Env Var: RCLONE_FTP_USER +- Type: string +- Default: "$USER" -Decode the given filename(s) +#### --ftp-port - rclone backend decode remote: [options] [+] +FTP port number. -This decodes the filenames given as arguments returning a list of -strings of the decoded results. It will return an error if any of the -inputs are invalid. +Properties: -Usage Example: +- Config: port +- Env Var: RCLONE_FTP_PORT +- Type: int +- Default: 21 - rclone backend decode crypt: encryptedfile1 [encryptedfile2...] - rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] +#### --ftp-pass +FTP password. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Properties: -## Backing up a crypted remote +- Config: pass +- Env Var: RCLONE_FTP_PASS +- Type: string +- Required: false -If you wish to backup a crypted remote, it is recommended that you use -`rclone sync` on the encrypted files, and make sure the passwords are -the same in the new encrypted remote. +#### --ftp-tls -This will have the following advantages +Use Implicit FTPS (FTP over TLS). - * `rclone sync` will check the checksums while copying - * you can use `rclone check` between the encrypted remotes - * you don't decrypt and encrypt unnecessarily +When using implicit FTP over TLS the client connects using TLS +right from the start which breaks compatibility with +non-TLS-aware servers. This is usually served over port 990 rather +than port 21. Cannot be used in combination with explicit FTPS. -For example, let's say you have your original remote at `remote:` with -the encrypted version at `eremote:` with path `remote:crypt`. You -would then set up the new remote `remote2:` and then the encrypted -version `eremote2:` with path `remote2:crypt` using the same passwords -as `eremote:`. +Properties: -To sync the two remotes you would do +- Config: tls +- Env Var: RCLONE_FTP_TLS +- Type: bool +- Default: false - rclone sync --interactive remote:crypt remote2:crypt +#### --ftp-explicit-tls -And to check the integrity you would do +Use Explicit FTPS (FTP over TLS). - rclone check remote:crypt remote2:crypt +When using explicit FTP over TLS the client explicitly requests +security from the server in order to upgrade a plain text connection +to an encrypted one. Cannot be used in combination with implicit FTPS. -## File formats +Properties: -### File encryption +- Config: explicit_tls +- Env Var: RCLONE_FTP_EXPLICIT_TLS +- Type: bool +- Default: false -Files are encrypted 1:1 source file to destination object. The file -has a header and is divided into chunks. +### Advanced options -#### Header +Here are the Advanced options specific to ftp (FTP). - * 8 bytes magic string `RCLONE\x00\x00` - * 24 bytes Nonce (IV) +#### --ftp-concurrency -The initial nonce is generated from the operating systems crypto -strong random number generator. The nonce is incremented for each -chunk read making sure each nonce is unique for each block written. -The chance of a nonce being re-used is minuscule. If you wrote an -exabyte of data (10¹⁸ bytes) you would have a probability of -approximately 2×10⁻³² of re-using a nonce. +Maximum number of FTP simultaneous connections, 0 for unlimited. -#### Chunk +Note that setting this is very likely to cause deadlocks so it should +be used with care. -Each chunk will contain 64 KiB of data, except for the last one which -may have less data. The data chunk is in standard NaCl SecretBox -format. SecretBox uses XSalsa20 and Poly1305 to encrypt and -authenticate messages. +If you are doing a sync or copy then make sure concurrency is one more +than the sum of `--transfers` and `--checkers`. -Each chunk contains: +If you use `--check-first` then it just needs to be one more than the +maximum of `--checkers` and `--transfers`. - * 16 Bytes of Poly1305 authenticator - * 1 - 65536 bytes XSalsa20 encrypted data +So for `concurrency 3` you'd use `--checkers 2 --transfers 2 +--check-first` or `--checkers 1 --transfers 1`. -64k chunk size was chosen as the best performing chunk size (the -authenticator takes too much time below this and the performance drops -off due to cache effects above this). Note that these chunks are -buffered in memory so they can't be too big. -This uses a 32 byte (256 bit key) key derived from the user password. -#### Examples +Properties: -1 byte file will encrypt to +- Config: concurrency +- Env Var: RCLONE_FTP_CONCURRENCY +- Type: int +- Default: 0 - * 32 bytes header - * 17 bytes data chunk +#### --ftp-no-check-certificate -49 bytes total +Do not verify the TLS certificate of the server. -1 MiB (1048576 bytes) file will encrypt to +Properties: - * 32 bytes header - * 16 chunks of 65568 bytes +- Config: no_check_certificate +- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE +- Type: bool +- Default: false -1049120 bytes total (a 0.05% overhead). This is the overhead for big -files. +#### --ftp-disable-epsv -### Name encryption +Disable using EPSV even if server advertises support. -File names are encrypted segment by segment - the path is broken up -into `/` separated strings and these are encrypted individually. +Properties: -File segments are padded using PKCS#7 to a multiple of 16 bytes -before encryption. +- Config: disable_epsv +- Env Var: RCLONE_FTP_DISABLE_EPSV +- Type: bool +- Default: false -They are then encrypted with EME using AES with 256 bit key. EME -(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 -paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. +#### --ftp-disable-mlsd -This makes for deterministic encryption which is what we want - the -same filename must encrypt to the same thing otherwise we can't find -it on the cloud storage system. +Disable using MLSD even if server advertises support. -This means that +Properties: - * filenames with the same name will encrypt the same - * filenames which start the same won't have a common prefix +- Config: disable_mlsd +- Env Var: RCLONE_FTP_DISABLE_MLSD +- Type: bool +- Default: false -This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of -which are derived from the user password. +#### --ftp-disable-utf8 -After encryption they are written out using a modified version of -standard `base32` encoding as described in RFC4648. The standard -encoding is modified in two ways: +Disable using UTF-8 even if server advertises support. - * it becomes lower case (no-one likes upper case filenames!) - * we strip the padding character `=` +Properties: -`base32` is used rather than the more efficient `base64` so rclone can be -used on case insensitive remotes (e.g. Windows, Amazon Drive). +- Config: disable_utf8 +- Env Var: RCLONE_FTP_DISABLE_UTF8 +- Type: bool +- Default: false -### Key derivation +#### --ftp-writing-mdtm -Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an -optional user supplied salt (password2) to derive the 32+32+16 = 80 -bytes of key material required. If the user doesn't supply a salt -then rclone uses an internal one. +Use MDTM to set modification time (VsFtpd quirk) -`scrypt` makes it impractical to mount a dictionary attack on rclone -encrypted data. For full protection against this you should always use -a salt. +Properties: -## SEE ALSO +- Config: writing_mdtm +- Env Var: RCLONE_FTP_WRITING_MDTM +- Type: bool +- Default: false -* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames +#### --ftp-force-list-hidden -# Compress +Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. -## Warning +Properties: -This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is -at your own risk. Please understand the risks associated with using experimental code and don't use this remote in -critical applications. +- Config: force_list_hidden +- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN +- Type: bool +- Default: false -The `Compress` remote adds compression to another remote. It is best used with remotes containing -many large compressible files. +#### --ftp-idle-timeout -## Configuration +Max time before closing idle connections. -To use this remote, all you need to do is specify another remote and a compression mode to use: +If no connections have been returned to the connection pool in the time +given, rclone will empty the connection pool. -``` -Current remotes: +Set to 0 to keep connections indefinitely. -Name Type -==== ==== -remote_to_press sometype -e) Edit existing remote -$ rclone config -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> n -name> compress -... - 8 / Compress a remote - \ "compress" -... -Storage> compress -** See help for compress backend at: https://rclone.org/compress/ ** +Properties: -Remote to compress. -Enter a string value. Press Enter for the default (""). -remote> remote_to_press:subdir -Compression mode. -Enter a string value. Press Enter for the default ("gzip"). -Choose a number from below, or type in your own value - 1 / Gzip compression balanced for speed and compression strength. - \ "gzip" -compression_mode> gzip -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[compress] -type = compress -remote = remote_to_press:subdir -compression_mode = gzip --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: idle_timeout +- Env Var: RCLONE_FTP_IDLE_TIMEOUT +- Type: Duration +- Default: 1m0s -### Compression Modes +#### --ftp-close-timeout -Currently only gzip compression is supported. It provides a decent balance between speed and size and is well -supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no -compression and 9 is strongest compression. +Maximum time to wait for a response to close. -### File types +Properties: -If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to -the compression algorithm you chose. These files are standard files that can be opened by various archive programs, -but they have some hidden metadata that allows them to be used by rclone. -While you may download and decompress these files at will, do **not** manually delete or rename files. Files without -correct metadata files will not be recognized by rclone. +- Config: close_timeout +- Env Var: RCLONE_FTP_CLOSE_TIMEOUT +- Type: Duration +- Default: 1m0s -### File names +#### --ftp-tls-cache-size -The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded -size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. +Size of TLS session cache for all control and data connections. +TLS cache allows to resume TLS sessions and reuse PSK between connections. +Increase if default size is not enough resulting in TLS resumption errors. +Enabled by default. Use 0 to disable. -### Standard options +Properties: -Here are the Standard options specific to compress (Compress a remote). +- Config: tls_cache_size +- Env Var: RCLONE_FTP_TLS_CACHE_SIZE +- Type: int +- Default: 32 -#### --compress-remote +#### --ftp-disable-tls13 -Remote to compress. +Disable TLS 1.3 (workaround for FTP servers with buggy TLS) Properties: -- Config: remote -- Env Var: RCLONE_COMPRESS_REMOTE -- Type: string -- Required: true +- Config: disable_tls13 +- Env Var: RCLONE_FTP_DISABLE_TLS13 +- Type: bool +- Default: false -#### --compress-mode +#### --ftp-shut-timeout -Compression mode. +Maximum time to wait for data connection closing status. Properties: -- Config: mode -- Env Var: RCLONE_COMPRESS_MODE -- Type: string -- Default: "gzip" -- Examples: - - "gzip" - - Standard gzip compression with fastest parameters. +- Config: shut_timeout +- Env Var: RCLONE_FTP_SHUT_TIMEOUT +- Type: Duration +- Default: 1m0s -### Advanced options +#### --ftp-ask-password -Here are the Advanced options specific to compress (Compress a remote). +Allow asking for FTP password when needed. -#### --compress-level +If this is set and no password is supplied then rclone will ask for a password -GZIP compression level (-2 to 9). -Generally -1 (default, equivalent to 5) is recommended. -Levels 1 to 9 increase compression at the cost of speed. Going past 6 -generally offers very little return. +Properties: -Level -2 uses Huffman encoding only. Only use if you know what you -are doing. -Level 0 turns off compression. +- Config: ask_password +- Env Var: RCLONE_FTP_ASK_PASSWORD +- Type: bool +- Default: false + +#### --ftp-socks-proxy + +Socks 5 proxy host. + + Supports the format user:pass@host:port, user@host:port, host:port. + + Example: + + myUser:myPass@localhost:9005 + Properties: -- Config: level -- Env Var: RCLONE_COMPRESS_LEVEL -- Type: int -- Default: -1 +- Config: socks_proxy +- Env Var: RCLONE_FTP_SOCKS_PROXY +- Type: string +- Required: false -#### --compress-ram-cache-limit +#### --ftp-encoding -Some remotes don't allow the upload of files with unknown size. -In this case the compressed file will need to be cached to determine -it's size. +The encoding for the backend. -Files smaller than this limit will be cached in RAM, files larger than -this limit will be cached on disk. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: ram_cache_limit -- Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT -- Type: SizeSuffix -- Default: 20Mi +- Config: encoding +- Env Var: RCLONE_FTP_ENCODING +- Type: Encoding +- Default: Slash,Del,Ctl,RightSpace,Dot +- Examples: + - "Asterisk,Ctl,Dot,Slash" + - ProFTPd can't handle '*' in file names + - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" + - PureFTPd can't handle '[]' or '*' in file names + - "Ctl,LeftPeriod,Slash" + - VsFTPd can't handle file names starting with dot -### Metadata -Any metadata supported by the underlying remote is read and written. -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +## Limitations + +FTP servers acting as rclone remotes must support `passive` mode. +The mode cannot be configured as `passive` is the only supported one. +Rclone's FTP implementation is not compatible with `active` mode +as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). +This will likely never be supported due to security concerns. +Rclone's FTP backend does not support any checksums but can compare +file sizes. +`rclone about` is not supported by the FTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -# Combine +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -The `combine` backend joins remotes together into a single directory -tree. +The implementation of : `--dump headers`, +`--dump bodies`, `--dump auth` for debugging isn't the same as +for rclone HTTP based backends - it has less fine grained control. -For example you might have a remote for images on one provider: +`--timeout` isn't supported (but `--contimeout` is). -``` -$ rclone tree s3:imagesbucket -/ -├── image1.jpg -└── image2.jpg -``` +`--bind` isn't supported. -And a remote for files on another: +Rclone's FTP backend could support server-side move but does not +at present. -``` -$ rclone tree drive:important/files -/ -├── file1.txt -└── file2.txt -``` +The `ftp_proxy` environment variable is not currently supported. -The `combine` backend can join these together into a synthetic -directory structure like this: +### Modification times -``` -$ rclone tree combined: -/ -├── files -│ ├── file1.txt -│ └── file2.txt -└── images - ├── image1.jpg - └── image2.jpg -``` +File modification time (timestamps) is supported to 1 second resolution +for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. +The `VsFTPd` server has non-standard implementation of time related protocol +commands and needs a special configuration setting: `writing_mdtm = true`. -You'd do this by specifying an `upstreams` parameter in the config -like this +Support for precise file time with other FTP servers varies depending on what +protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` +extensions are present, rclone will use them together to provide precise time. +Otherwise the times you see on the FTP server through rclone are those of the +last file upload. - upstreams = images=s3:imagesbucket files=drive:important/files +You can use the following command to check whether rclone can use precise time +with your FTP server: `rclone backend features your_ftp_remote:` (the trailing +colon is important). Look for the number in the line tagged by `Precision` +designating the remote time precision expressed as nanoseconds. A value of +`1000000000` means that file time precision of 1 second is available. +A value of `3153600000000000000` (or another large number) means "unsupported". -During the initial setup with `rclone config` you will specify the -upstreams remotes as a space separated list. The upstream remotes can -either be a local paths or other remotes. +# Google Cloud Storage + +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. ## Configuration -Here is an example of how to make a combine called `remote` for the -example above. First run: +The initial setup for google cloud storage involves getting a token from Google Cloud Storage +which you need to do in your browser. `rclone config` walks you +through it. + +Here is an example of how to make a remote called `remote`. First run: rclone config This will guide you through an interactive setup process: ``` -No remotes found, make a new one? n) New remote -s) Set configuration password +d) Delete remote q) Quit config -n/s/q> n +e/n/d/q> n name> remote -Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value. -... -XX / Combine several remotes into one - \ (combine) -... -Storage> combine -Option upstreams. -Upstreams for combining -These should be in the form - dir=remote:path dir2=remote2:path -Where before the = is specified the root directory and after is the remote to -put there. -Embedded spaces can be added using quotes - "dir=remote:path with space" "dir2=remote2:path with space" -Enter a fs.SpaceSepList value. -upstreams> images=s3:imagesbucket files=drive:important/files +Choose a number from below, or type in your own value +[snip] +XX / Google Cloud Storage (this is not Google Drive) + \ "google cloud storage" +[snip] +Storage> google cloud storage +Google Application Client Id - leave blank normally. +client_id> +Google Application Client Secret - leave blank normally. +client_secret> +Project number optional - needed only for list/create/delete buckets - see your developer console. +project_number> 12345678 +Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. +service_account_file> +Access Control List for new objects. +Choose a number from below, or type in your own value + 1 / Object owner gets OWNER access, and all Authenticated Users get READER access. + \ "authenticatedRead" + 2 / Object owner gets OWNER access, and project team owners get OWNER access. + \ "bucketOwnerFullControl" + 3 / Object owner gets OWNER access, and project team owners get READER access. + \ "bucketOwnerRead" + 4 / Object owner gets OWNER access [default if left blank]. + \ "private" + 5 / Object owner gets OWNER access, and project team members get access according to their roles. + \ "projectPrivate" + 6 / Object owner gets OWNER access, and all Users get READER access. + \ "publicRead" +object_acl> 4 +Access Control List for new buckets. +Choose a number from below, or type in your own value + 1 / Project team owners get OWNER access, and all Authenticated Users get READER access. + \ "authenticatedRead" + 2 / Project team owners get OWNER access [default if left blank]. + \ "private" + 3 / Project team members get access according to their roles. + \ "projectPrivate" + 4 / Project team owners get OWNER access, and all Users get READER access. + \ "publicRead" + 5 / Project team owners get OWNER access, and all Users get WRITER access. + \ "publicReadWrite" +bucket_acl> 2 +Location for the newly created buckets. +Choose a number from below, or type in your own value + 1 / Empty for default location (US). + \ "" + 2 / Multi-regional location for Asia. + \ "asia" + 3 / Multi-regional location for Europe. + \ "eu" + 4 / Multi-regional location for United States. + \ "us" + 5 / Taiwan. + \ "asia-east1" + 6 / Tokyo. + \ "asia-northeast1" + 7 / Singapore. + \ "asia-southeast1" + 8 / Sydney. + \ "australia-southeast1" + 9 / Belgium. + \ "europe-west1" +10 / London. + \ "europe-west2" +11 / Iowa. + \ "us-central1" +12 / South Carolina. + \ "us-east1" +13 / Northern Virginia. + \ "us-east4" +14 / Oregon. + \ "us-west1" +location> 12 +The storage class to use when storing objects in Google Cloud Storage. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Multi-regional storage class + \ "MULTI_REGIONAL" + 3 / Regional storage class + \ "REGIONAL" + 4 / Nearline storage class + \ "NEARLINE" + 5 / Coldline storage class + \ "COLDLINE" + 6 / Durable reduced availability storage class + \ "DURABLE_REDUCED_AVAILABILITY" +storage_class> 5 +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes +n) No +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code -------------------- [remote] -type = combine -upstreams = images=s3:imagesbucket files=drive:important/files +type = google cloud storage +client_id = +client_secret = +token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} +project_number = 12345678 +object_acl = private +bucket_acl = private -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -### Configuring for Google Drive Shared Drives +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -Rclone has a convenience feature for making a combine backend for all -the shared drives you have access to. +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and this +it may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -Assuming your main (non shared drive) Google drive remote is called -`drive:` you would run +This remote is called `remote` and can now be used like this - rclone backend -o config drives drive: +See all the buckets in your project -This would produce something like this: + rclone lsd remote: - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: +Make a new bucket - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: + rclone mkdir remote:bucket - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" +List the contents of a bucket -If you then add that config to your config file (find it with `rclone -config file`) then you can access all the shared drives in one place -with the `AllDrives:` remote. + rclone ls remote:bucket -See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. +Sync `/home/local/directory` to the remote bucket, deleting any excess +files in the bucket. + rclone sync --interactive /home/local/directory remote:bucket -### Standard options +### Service Account support -Here are the Standard options specific to combine (Combine several remotes into one). +You can set up rclone with Google Cloud Storage in an unattended mode, +i.e. not tied to a specific end-user Google account. This is useful +when you want to synchronise files onto machines that don't have +actively logged-in users, for example build machines. -#### --combine-upstreams +To get credentials for Google Cloud Platform +[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), +please head to the +[Service Account](https://console.cloud.google.com/permissions/serviceaccounts) +section of the Google Developer Console. Service Accounts behave just +like normal `User` permissions in +[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), +so you can limit their access (e.g. make them read only). After +creating an account, a JSON file containing the Service Account's +credentials will be downloaded onto your machines. These credentials +are what rclone will use for authentication. -Upstreams for combining +To use a Service Account instead of OAuth2 token flow, enter the path +to your Service Account credentials at the `service_account_file` +prompt and rclone won't use the browser based authentication +flow. If you'd rather stuff the contents of the credentials file into +the rclone config file, you can set `service_account_credentials` with +the actual contents of the file instead, or set the equivalent +environment variable. -These should be in the form +### Anonymous Access - dir=remote:path dir2=remote2:path +For downloads of objects that permit public access you can configure rclone +to use anonymous access by setting `anonymous` to `true`. +With unauthorized access you can't write or create files but only read or list +those buckets and objects that have public read access. -Where before the = is specified the root directory and after is the remote to -put there. +### Application Default Credentials -Embedded spaces can be added using quotes +If no other source of credentials is provided, rclone will fall back +to +[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) +this is useful both when you already have configured authentication +for your developer account, or in production when running on a google +compute host. Note that if running in docker, you may need to run +additional commands on your google compute machine - +[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). - "dir=remote:path with space" "dir2=remote2:path with space" +Note that in the case application default credentials are used, there +is no need to explicitly configure a project number. +### --fast-list +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -Properties: +### Custom upload headers -- Config: upstreams -- Env Var: RCLONE_COMBINE_UPSTREAMS -- Type: SpaceSepList -- Default: +You can set custom upload headers with the `--header-upload` +flag. Google Cloud Storage supports the headers as described in the +[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) -### Metadata +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type +- X-Goog-Storage-Class +- X-Goog-Meta- -Any metadata supported by the underlying remote is read and written. +Eg `--header-upload "Content-Type text/potato"` -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +Note that the last of these is for setting custom metadata in the form +`--header-upload "x-goog-meta-key: value"` +### Modification times +Google Cloud Storage stores md5sum natively. +Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time +with one-second precision as `goog-reserved-file-mtime` in file metadata. -# Dropbox +To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. +`mtime` uses RFC3339 format with one-nanosecond precision. +`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. +To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. -Paths are specified as `remote:path` +Note that rclone's default modify window is 1ns. +Files uploaded by gsutil only contain timestamps with one-second precision. +If you use rclone to sync files previously uploaded by gsutil, +rclone will attempt to update modification time for all these files. +To avoid these possibly unnecessary updates, use `--modify-window 1s`. -Dropbox paths may be as deep as required, e.g. -`remote:directory/subdirectory`. +### Restricted filename characters -## Configuration +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| LF | 0x0A | ␊ | +| CR | 0x0D | ␍ | +| / | 0x2F | / | -The initial setup for dropbox involves getting a token from Dropbox -which you need to do in your browser. `rclone config` walks you -through it. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Here is an example of how to make a remote called `remote`. First run: - rclone config +### Standard options -This will guide you through an interactive setup process: +Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -``` -n) New remote -d) Delete remote -q) Quit config -e/n/d/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Dropbox - \ "dropbox" -[snip] -Storage> dropbox -Dropbox App Key - leave blank normally. -app_key> -Dropbox App Secret - leave blank normally. -app_secret> -Remote config -Please visit: -https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code -Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX --------------------- -[remote] -app_key = -app_secret = -token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +#### --gcs-client-id -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +OAuth Client Id. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Dropbox. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and it -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +Leave blank normally. -You can then use it like this, +Properties: -List directories in top level of your dropbox +- Config: client_id +- Env Var: RCLONE_GCS_CLIENT_ID +- Type: string +- Required: false - rclone lsd remote: +#### --gcs-client-secret -List all the files in your dropbox +OAuth Client Secret. - rclone ls remote: +Leave blank normally. -To copy a local directory to a dropbox directory called backup +Properties: - rclone copy /home/source remote:backup +- Config: client_secret +- Env Var: RCLONE_GCS_CLIENT_SECRET +- Type: string +- Required: false -### Dropbox for business +#### --gcs-project-number -Rclone supports Dropbox for business and Team Folders. +Project number. -When using Dropbox for business `remote:` and `remote:path/to/file` -will refer to your personal folder. +Optional - needed only for list/create/delete buckets - see your developer console. -If you wish to see Team Folders you must use a leading `/` in the -path, so `rclone lsd remote:/` will refer to the root and show you all -Team Folders and your User Folder. +Properties: -You can then use team folders like this `remote:/TeamFolder` and -`remote:/TeamFolder/path/to/file`. +- Config: project_number +- Env Var: RCLONE_GCS_PROJECT_NUMBER +- Type: string +- Required: false -A leading `/` for a Dropbox personal account will do nothing, but it -will take an extra HTTP transaction so it should be avoided. +#### --gcs-user-project -### Modified time and Hashes +User project. -Dropbox supports modified times, but the only way to set a -modification time is to re-upload the file. +Optional - needed only for requester pays. -This means that if you uploaded your data with an older version of -rclone which didn't support the v2 API and modified times, rclone will -decide to upload all your old data to fix the modification times. If -you don't want this to happen use `--size-only` or `--checksum` flag -to stop it. +Properties: -Dropbox supports [its own hash -type](https://www.dropbox.com/developers/reference/content-hash) which -is checked for all transfers. +- Config: user_project +- Env Var: RCLONE_GCS_USER_PROJECT +- Type: string +- Required: false -### Restricted filename characters +#### --gcs-service-account-file -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | -| DEL | 0x7F | ␡ | -| \ | 0x5C | \ | +Service Account Credentials JSON file path. -File names can also not end with the following characters. -These only get replaced if they are the last character in the name: +Leave blank normally. +Needed only if you want use SA instead of interactive login. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Properties: -### Batch mode uploads {#batch-mode} +- Config: service_account_file +- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE +- Type: string +- Required: false -Using batch mode uploads is very important for performance when using -the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) -for more info. +#### --gcs-service-account-credentials -There are 3 modes rclone can use for uploads. +Service Account Credentials JSON blob. -#### --dropbox-batch-mode off +Leave blank normally. +Needed only if you want use SA instead of interactive login. -In this mode rclone will not use upload batching. This was the default -before rclone v1.55. It has the disadvantage that it is very likely to -encounter `too_many_requests` errors like this +Properties: - NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. +- Config: service_account_credentials +- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS +- Type: string +- Required: false -When rclone receives these it has to wait for 15s or sometimes 300s -before continuing which really slows down transfers. +#### --gcs-anonymous -This will happen especially if `--transfers` is large, so this mode -isn't recommended except for compatibility or investigating problems. +Access public buckets and objects without credentials. -#### --dropbox-batch-mode sync +Set to 'true' if you just want to download files and don't configure credentials. -In this mode rclone will batch up uploads to the size specified by -`--dropbox-batch-size` and commit them together. +Properties: -Using this mode means you can use a much higher `--transfers` -parameter (32 or 64 works fine) without receiving `too_many_requests` -errors. +- Config: anonymous +- Env Var: RCLONE_GCS_ANONYMOUS +- Type: bool +- Default: false -This mode ensures full data integrity. +#### --gcs-object-acl -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. +Access Control List for new objects. -#### --dropbox-batch-mode async +Properties: -In this mode rclone will batch up uploads to the size specified by -`--dropbox-batch-size` and commit them together. +- Config: object_acl +- Env Var: RCLONE_GCS_OBJECT_ACL +- Type: string +- Required: false +- Examples: + - "authenticatedRead" + - Object owner gets OWNER access. + - All Authenticated Users get READER access. + - "bucketOwnerFullControl" + - Object owner gets OWNER access. + - Project team owners get OWNER access. + - "bucketOwnerRead" + - Object owner gets OWNER access. + - Project team owners get READER access. + - "private" + - Object owner gets OWNER access. + - Default if left blank. + - "projectPrivate" + - Object owner gets OWNER access. + - Project team members get access according to their roles. + - "publicRead" + - Object owner gets OWNER access. + - All Users get READER access. -However it will not wait for the status of the batch to be returned to -the caller. This means rclone can use a much bigger batch size (much -bigger than `--transfers`), at the cost of not being able to check the -status of the upload. +#### --gcs-bucket-acl -This provides the maximum possible upload speed especially with lots -of small files, however rclone can't check the file got uploaded -properly using this mode. +Access Control List for new buckets. -If you are using this mode then using "rclone check" after the -transfer completes is recommended. Or you could do an initial transfer -with `--dropbox-batch-mode async` then do a final transfer with -`--dropbox-batch-mode sync` (the default). +Properties: -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. +- Config: bucket_acl +- Env Var: RCLONE_GCS_BUCKET_ACL +- Type: string +- Required: false +- Examples: + - "authenticatedRead" + - Project team owners get OWNER access. + - All Authenticated Users get READER access. + - "private" + - Project team owners get OWNER access. + - Default if left blank. + - "projectPrivate" + - Project team members get access according to their roles. + - "publicRead" + - Project team owners get OWNER access. + - All Users get READER access. + - "publicReadWrite" + - Project team owners get OWNER access. + - All Users get WRITER access. +#### --gcs-bucket-policy-only +Access checks should use bucket-level IAM policies. -### Standard options +If you want to upload objects to a bucket with Bucket Policy Only set +then you will need to set this. -Here are the Standard options specific to dropbox (Dropbox). +When it is set, rclone: -#### --dropbox-client-id +- ignores ACLs set on buckets +- ignores ACLs set on objects +- creates buckets with Bucket Policy Only set -OAuth Client Id. +Docs: https://cloud.google.com/storage/docs/bucket-policy-only -Leave blank normally. Properties: -- Config: client_id -- Env Var: RCLONE_DROPBOX_CLIENT_ID +- Config: bucket_policy_only +- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY +- Type: bool +- Default: false + +#### --gcs-location + +Location for the newly created buckets. + +Properties: + +- Config: location +- Env Var: RCLONE_GCS_LOCATION +- Type: string +- Required: false +- Examples: + - "" + - Empty for default location (US) + - "asia" + - Multi-regional location for Asia + - "eu" + - Multi-regional location for Europe + - "us" + - Multi-regional location for United States + - "asia-east1" + - Taiwan + - "asia-east2" + - Hong Kong + - "asia-northeast1" + - Tokyo + - "asia-northeast2" + - Osaka + - "asia-northeast3" + - Seoul + - "asia-south1" + - Mumbai + - "asia-south2" + - Delhi + - "asia-southeast1" + - Singapore + - "asia-southeast2" + - Jakarta + - "australia-southeast1" + - Sydney + - "australia-southeast2" + - Melbourne + - "europe-north1" + - Finland + - "europe-west1" + - Belgium + - "europe-west2" + - London + - "europe-west3" + - Frankfurt + - "europe-west4" + - Netherlands + - "europe-west6" + - Zürich + - "europe-central2" + - Warsaw + - "us-central1" + - Iowa + - "us-east1" + - South Carolina + - "us-east4" + - Northern Virginia + - "us-west1" + - Oregon + - "us-west2" + - California + - "us-west3" + - Salt Lake City + - "us-west4" + - Las Vegas + - "northamerica-northeast1" + - Montréal + - "northamerica-northeast2" + - Toronto + - "southamerica-east1" + - São Paulo + - "southamerica-west1" + - Santiago + - "asia1" + - Dual region: asia-northeast1 and asia-northeast2. + - "eur4" + - Dual region: europe-north1 and europe-west4. + - "nam4" + - Dual region: us-central1 and us-east1. + +#### --gcs-storage-class + +The storage class to use when storing objects in Google Cloud Storage. + +Properties: + +- Config: storage_class +- Env Var: RCLONE_GCS_STORAGE_CLASS - Type: string - Required: false +- Examples: + - "" + - Default + - "MULTI_REGIONAL" + - Multi-regional storage class + - "REGIONAL" + - Regional storage class + - "NEARLINE" + - Nearline storage class + - "COLDLINE" + - Coldline storage class + - "ARCHIVE" + - Archive storage class + - "DURABLE_REDUCED_AVAILABILITY" + - Durable reduced availability storage class -#### --dropbox-client-secret +#### --gcs-env-auth -OAuth Client Secret. +Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). -Leave blank normally. +Only applies if service_account_file and service_account_credentials is blank. Properties: -- Config: client_secret -- Env Var: RCLONE_DROPBOX_CLIENT_SECRET -- Type: string -- Required: false +- Config: env_auth +- Env Var: RCLONE_GCS_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). ### Advanced options -Here are the Advanced options specific to dropbox (Dropbox). +Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -#### --dropbox-token +#### --gcs-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_DROPBOX_TOKEN +- Env Var: RCLONE_GCS_TOKEN - Type: string - Required: false -#### --dropbox-auth-url +#### --gcs-auth-url Auth server URL. @@ -27012,11 +32431,11 @@ Leave blank to use the provider defaults. Properties: - Config: auth_url -- Env Var: RCLONE_DROPBOX_AUTH_URL +- Env Var: RCLONE_GCS_AUTH_URL - Type: string - Required: false -#### --dropbox-token-url +#### --gcs-token-url Token server url. @@ -27025,1557 +32444,1470 @@ Leave blank to use the provider defaults. Properties: - Config: token_url -- Env Var: RCLONE_DROPBOX_TOKEN_URL +- Env Var: RCLONE_GCS_TOKEN_URL - Type: string - Required: false -#### --dropbox-chunk-size +#### --gcs-directory-markers -Upload chunk size (< 150Mi). +Upload an empty object with a trailing slash when a new directory is created -Any files larger than this will be uploaded in chunks of this size. +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. -Note that chunks are buffered in memory (one at a time) so rclone can -deal with retries. Setting this larger will increase the speed -slightly (at most 10% for 128 MiB in tests) at the cost of using more -memory. It can be set smaller if you are tight on memory. Properties: -- Config: chunk_size -- Env Var: RCLONE_DROPBOX_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi +- Config: directory_markers +- Env Var: RCLONE_GCS_DIRECTORY_MARKERS +- Type: bool +- Default: false -#### --dropbox-impersonate +#### --gcs-no-check-bucket -Impersonate this user when using a business account. +If set, don't attempt to check the bucket exists or create it. -Note that if you want to use impersonate, you should make sure this -flag is set when running "rclone config" as this will cause rclone to -request the "members.read" scope which it won't normally. This is -needed to lookup a members email address into the internal ID that -dropbox uses in the API. +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. -Using the "members.read" scope will require a Dropbox Team Admin -to approve during the OAuth flow. -You will have to use your own App (setting your own client_id and -client_secret) to use this option as currently rclone's default set of -permissions doesn't include "members.read". This can be added once -v1.55 or later is in use everywhere. +Properties: +- Config: no_check_bucket +- Env Var: RCLONE_GCS_NO_CHECK_BUCKET +- Type: bool +- Default: false -Properties: +#### --gcs-decompress -- Config: impersonate -- Env Var: RCLONE_DROPBOX_IMPERSONATE -- Type: string -- Required: false +If set this will decompress gzip encoded objects. -#### --dropbox-shared-files +It is possible to upload objects to GCS with "Content-Encoding: gzip" +set. Normally rclone will download these files as compressed objects. -Instructs rclone to work on individual shared files. +If this flag is set then rclone will decompress these files with +"Content-Encoding: gzip" as they are received. This means that rclone +can't check the size and hash but the file contents will be decompressed. -In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) -operations and read operations (e.g. downloading) are supported in this mode. -All other operations will be disabled. Properties: -- Config: shared_files -- Env Var: RCLONE_DROPBOX_SHARED_FILES +- Config: decompress +- Env Var: RCLONE_GCS_DECOMPRESS - Type: bool - Default: false -#### --dropbox-shared-folders +#### --gcs-endpoint -Instructs rclone to work on shared folders. - -When this flag is used with no path only the List operation is supported and -all available shared folders will be listed. If you specify a path the first part -will be interpreted as the name of shared folder. Rclone will then try to mount this -shared to the root namespace. On success shared folder rclone proceeds normally. -The shared folder is now pretty much a normal folder and all normal operations -are supported. +Endpoint for the service. -Note that we don't unmount the shared folder afterwards so the ---dropbox-shared-folders can be omitted after the first use of a particular -shared folder. +Leave blank normally. Properties: -- Config: shared_folders -- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS -- Type: bool -- Default: false +- Config: endpoint +- Env Var: RCLONE_GCS_ENDPOINT +- Type: string +- Required: false -#### --dropbox-batch-mode +#### --gcs-encoding -Upload file batching sync|async|off. +The encoding for the backend. -This sets the batch mode used by rclone. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) +Properties: -This has 3 possible values +- Config: encoding +- Env Var: RCLONE_GCS_ENCODING +- Type: Encoding +- Default: Slash,CrLf,InvalidUtf8,Dot -- off - no batching -- sync - batch uploads and check completion (default) -- async - batch upload and don't check completion -Rclone will close any outstanding batches when it exits which may make -a delay on quit. +## Limitations -Properties: +`rclone about` is not supported by the Google Cloud Storage backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -- Config: batch_mode -- Env Var: RCLONE_DROPBOX_BATCH_MODE -- Type: string -- Default: "sync" +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -#### --dropbox-batch-size +# Google Drive -Max number of files in upload batch. +Paths are specified as `drive:path` -This sets the batch size of files to upload. It has to be less than 1000. +Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. -By default this is 0 which means rclone which calculate the batch size -depending on the setting of batch_mode. +## Configuration -- batch_mode: async - default batch_size is 100 -- batch_mode: sync - default batch_size is the same as --transfers -- batch_mode: off - not in use +The initial setup for drive involves getting a token from Google drive +which you need to do in your browser. `rclone config` walks you +through it. -Rclone will close any outstanding batches when it exits which may make -a delay on quit. +Here is an example of how to make a remote called `remote`. First run: -Setting this is a great idea if you are uploading lots of small files -as it will make them a lot quicker. You can use --transfers 32 to -maximise throughput. + rclone config +This will guide you through an interactive setup process: -Properties: +``` +No remotes found, make a new one? +n) New remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +n/r/c/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Google Drive + \ "drive" +[snip] +Storage> drive +Google Application Client Id - leave blank normally. +client_id> +Google Application Client Secret - leave blank normally. +client_secret> +Scope that rclone should use when requesting access from drive. +Choose a number from below, or type in your own value + 1 / Full access all files, excluding Application Data Folder. + \ "drive" + 2 / Read-only access to file metadata and file contents. + \ "drive.readonly" + / Access to files created by rclone only. + 3 | These are visible in the drive website. + | File authorization is revoked when the user deauthorizes the app. + \ "drive.file" + / Allows read and write access to the Application Data folder. + 4 | This is not visible in the drive website. + \ "drive.appfolder" + / Allows read-only access to file metadata but + 5 | does not allow any access to read or download file content. + \ "drive.metadata.readonly" +scope> 1 +Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. +service_account_file> +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes +n) No +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code +Configure this as a Shared Drive (Team Drive)? +y) Yes +n) No +y/n> n +-------------------- +[remote] +client_id = +client_secret = +scope = drive +root_folder_id = +service_account_file = +token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -- Config: batch_size -- Env Var: RCLONE_DROPBOX_BATCH_SIZE -- Type: int -- Default: 0 +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -#### --dropbox-batch-timeout +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and it +may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -Max time to allow an idle upload batch before uploading. +You can then use it like this, -If an upload batch is idle for more than this long then it will be -uploaded. +List directories in top level of your drive -The default for this is 0 which means rclone will choose a sensible -default based on the batch_mode in use. + rclone lsd remote: -- batch_mode: async - default batch_timeout is 500ms -- batch_mode: sync - default batch_timeout is 10s -- batch_mode: off - not in use +List all the files in your drive + rclone ls remote: -Properties: +To copy a local directory to a drive directory called backup -- Config: batch_timeout -- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT -- Type: Duration -- Default: 0s + rclone copy /home/source remote:backup -#### --dropbox-batch-commit-timeout +### Scopes -Max time to wait for a batch to finish committing +Rclone allows you to select which scope you would like for rclone to +use. This changes what type of token is granted to rclone. [The +scopes are defined +here](https://developers.google.com/drive/v3/web/about-auth). -Properties: +A comma-separated list is allowed e.g. `drive.readonly,drive.file`. -- Config: batch_commit_timeout -- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT -- Type: Duration -- Default: 10m0s +The scope are -#### --dropbox-encoding +#### drive -The encoding for the backend. +This is the default scope and allows full access to all files, except +for the Application Data Folder (see below). -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Choose this one if you aren't sure. -Properties: +#### drive.readonly -- Config: encoding -- Env Var: RCLONE_DROPBOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot +This allows read only access to all files. Files may be listed and +downloaded but not uploaded, renamed or deleted. +#### drive.file +With this scope rclone can read/view/modify only those files and +folders it creates. -## Limitations +So if you uploaded files to drive via the web interface (or any other +means) they will not be visible to rclone. -Note that Dropbox is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +This can be useful if you are using rclone to backup data and you want +to be sure confidential data on your drive is not visible to rclone. -There are some file names such as `thumbs.db` which Dropbox can't -store. There is a full list of them in the ["Ignored Files" section -of this document](https://www.dropbox.com/en/help/145). Rclone will -issue an error message `File name disallowed - not uploading` if it -attempts to upload one of those file names, but the sync won't fail. +Files created with this scope are visible in the web interface. -Some errors may occur if you try to sync copyright-protected files -because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that -prevents this sort of file being downloaded. This will return the error `ERROR : -/path/to/your/file: Failed to copy: failed to open source object: -path/restricted_content/.` +#### drive.appfolder -If you have more than 10,000 files in a directory then `rclone purge -dropbox:dir` will return the error `Failed to purge: There are too -many files involved in this operation`. As a work-around do an -`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. +This gives rclone its own private area to store files. Rclone will +not be able to see any other files on your drive and you won't be able +to see rclone's files from the web interface either. -When using `rclone link` you'll need to set `--expire` if using a -non-personal account otherwise the visibility may not be correct. -(Note that `--expire` isn't supported on personal accounts). See the -[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the -[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). +#### drive.metadata.readonly -## Get your own Dropbox App ID +This allows read only access to file names only. It does not allow +rclone to download or upload data, or rename or delete files or +directories. -When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. +### Root folder ID -Here is how to create your own Dropbox App ID for rclone: +This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory +(identified by its `Folder ID`) that rclone considers to be the root +of your drive. -1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not -to be the same account as the Dropbox you want to access) +Normally you will leave this blank and rclone will determine the +correct root to use itself. -2. Choose an API => Usually this should be `Dropbox API` +However you can set this to restrict rclone to a specific folder +hierarchy or to access data within the "Computers" tab on the drive +web interface (where files from Google's Backup and Sync desktop +program go). -3. Choose the type of access you want to use => `Full Dropbox` or `App Folder` +In order to do this you will have to find the `Folder ID` of the +directory you wish rclone to display. This will be the last segment +of the URL when you open the relevant folder in the drive web +interface. -4. Name your App. The app name is global, so you can't use `rclone` for example +So if the folder you want rclone to use has a URL which looks like +`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` +in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as +the `root_folder_id` in the config. -5. Click the button `Create App` +**NB** folders under the "Computers" tab seem to be read only (drive +gives a 500 error) when using rclone. -6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` +There doesn't appear to be an API to discover the folder IDs of the +"Computers" tab - please contact us if you know otherwise! -7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` +Note also that rclone can't access any data under the "Backups" tab on +the google drive web interface yet. -8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` +### Service Account support -# Enterprise File Fabric +You can set up rclone with Google Drive in an unattended mode, +i.e. not tied to a specific end-user Google account. This is useful +when you want to synchronise files onto machines that don't have +actively logged-in users, for example build machines. -This backend supports [Storage Made Easy's Enterprise File -Fabric™](https://storagemadeeasy.com/about/) which provides a software -solution to integrate and unify File and Object Storage accessible -through a global file system. +To use a Service Account instead of OAuth2 token flow, enter the path +to your Service Account credentials at the `service_account_file` +prompt during `rclone config` and rclone won't use the browser based +authentication flow. If you'd rather stuff the contents of the +credentials file into the rclone config file, you can set +`service_account_credentials` with the actual contents of the file +instead, or set the equivalent environment variable. -## Configuration +#### Use case - Google Apps/G-suite account and individual Drive -The initial setup for the Enterprise File Fabric backend involves -getting a token from the Enterprise File Fabric which you need to -do in your browser. `rclone config` walks you through it. +Let's say that you are the administrator of a Google Apps (old) or +G-suite account. +The goal is to store data on an individual's Drive account, who IS +a member of the domain. +We'll call the domain **example.com**, and the user +**foo@example.com**. -Here is an example of how to make a remote called `remote`. First run: +There's a few steps we need to go through to accomplish this: - rclone config +##### 1. Create a service account for example.com + - To create a service account and obtain its credentials, go to the +[Google Developer Console](https://console.developers.google.com). + - You must have a project - create one if you don't. + - Then go to "IAM & admin" -> "Service Accounts". + - Use the "Create Service Account" button. Fill in "Service account name" +and "Service account ID" with something that identifies your client. + - Select "Create And Continue". Step 2 and 3 are optional. + - These credentials are what rclone will use for authentication. +If you ever need to remove access, press the "Delete service +account key" button. -This will guide you through an interactive setup process: +##### 2. Allowing API access to example.com Google Drive + - Go to example.com's admin console + - Go into "Security" (or use the search bar) + - Select "Show more" and then "Advanced settings" + - Select "Manage API client access" in the "Authentication" section + - In the "Client Name" field enter the service account's +"Client ID" - this can be found in the Developer Console under +"IAM & Admin" -> "Service Accounts", then "View Client ID" for +the newly created service account. +It is a ~21 character numerical string. + - In the next field, "One or More API Scopes", enter +`https://www.googleapis.com/auth/drive` +to grant access to Google Drive specifically. + +##### 3. Configure rclone, assuming a new install ``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Enterprise File Fabric - \ "filefabric" -[snip] -Storage> filefabric -** See help for filefabric backend at: https://rclone.org/filefabric/ ** +rclone config -URL of the Enterprise File Fabric to connect to -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Storage Made Easy US - \ "https://storagemadeeasy.com" - 2 / Storage Made Easy EU - \ "https://eu.storagemadeeasy.com" - 3 / Connect to your Enterprise File Fabric - \ "https://yourfabric.smestorage.com" -url> https://yourfabric.smestorage.com/ -ID of the root folder -Leave blank normally. +n/s/q> n # New +name>gdrive # Gdrive is an example name +Storage> # Select the number shown for Google Drive +client_id> # Can be left blank +client_secret> # Can be left blank +scope> # Select your scope, 1 for example +root_folder_id> # Can be left blank +service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! +y/n> # Auto config, n -Fill in to make rclone start with directory of a given ID. +``` -Enter a string value. Press Enter for the default (""). -root_folder_id> -Permanent Authentication Token +##### 4. Verify that it's working + - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` + - The arguments do: + - `-v` - verbose logging + - `--drive-impersonate foo@example.com` - this is what does +the magic, pretending to be user foo. + - `lsf` - list files in a parsing friendly way + - `gdrive:backup` - use the remote called gdrive, work in +the folder named backup. -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry -you'll see called "My Authentication Tokens". Click the Manage button -to create one. +Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: + - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 + - use rclone without specifying the `--drive-impersonate` option, like this: + `rclone -v lsf gdrive:backup` -These tokens are normally valid for several years. -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens +### Shared drives (team drives) -Enter a string value. Press Enter for the default (""). -permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -Edit advanced config? (y/n) +If you want to configure the remote to point to a Google Shared Drive +(previously known as Team Drives) then answer `y` to the question +`Configure this as a Shared Drive (Team Drive)?`. + +This will fetch the list of Shared Drives from google and allow you to +configure which one you want to use. You can also type in a Shared +Drive ID if you prefer. + +For example: + +``` +Configure this as a Shared Drive (Team Drive)? y) Yes -n) No (default) -y/n> n -Remote config +n) No +y/n> y +Fetching Shared Drive list... +Choose a number from below, or type in your own value + 1 / Rclone Test + \ "xxxxxxxxxxxxxxxxxxxx" + 2 / Rclone Test 2 + \ "yyyyyyyyyyyyyyyyyyyy" + 3 / Rclone Test 3 + \ "zzzzzzzzzzzzzzzzzzzz" +Enter a Shared Drive ID> 1 -------------------- [remote] -type = filefabric -url = https://yourfabric.smestorage.com/ -permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx +client_id = +client_secret = +token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null} +team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -Once configured you can then use `rclone` like this, +### --fast-list -List directories in top level of your Enterprise File Fabric +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. - rclone lsd remote: +It does this by combining multiple `list` calls into a single API request. -List all the files in your Enterprise File Fabric +This works by combining many `'%s' in parents` filters into one expression. +To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: +``` +trashed=false and 'a' in parents +trashed=false and 'b' in parents +trashed=false and 'c' in parents +``` +These can now be combined into a single request: +``` +trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) +``` - rclone ls remote: +The implementation of `ListR` will put up to 50 `parents` filters into one request. +It will use the `--checkers` value to specify the number of requests to run in parallel. -To copy a local directory to an Enterprise File Fabric directory called backup +In tests, these batch requests were up to 20x faster than the regular method. +Running the following command against different sized folders gives: +``` +rclone lsjson -vv -R --checkers=6 gdrive:folder +``` - rclone copy /home/source remote:backup +small folder (220 directories, 700 files): -### Modified time and hashes +- without `--fast-list`: 38s +- with `--fast-list`: 10s -The Enterprise File Fabric allows modification times to be set on -files accurate to 1 second. These will be used to detect whether -objects need syncing or not. +large folder (10600 directories, 39000 files): -The Enterprise File Fabric does not support any data hashes at this time. +- without `--fast-list`: 22:05 min +- with `--fast-list`: 58s -### Restricted filename characters +### Modification times and hashes -The [default restricted characters set](https://rclone.org/overview/#restricted-characters) -will be replaced. +Google drive stores modification times accurate to 1 ms. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however, +that a small fraction of files uploaded may not have SHA1 or SHA256 +hashes especially if they were uploaded before 2018. -### Empty files +### Restricted filename characters -Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore -upload an empty file as a single space with a mime type of -`application/vnd.rclone.empty.file` and files with that mime type are -treated as empty. +Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -### Root folder ID ### +In contrast to other backends, `/` can also be used in names and `.` +or `..` are valid names. -You can set the `root_folder_id` for rclone. This is the directory -(identified by its `Folder ID`) that rclone considers to be the root -of your Enterprise File Fabric. +### Revisions -Normally you will leave this blank and rclone will determine the -correct root to use itself. +Google drive stores revisions of files. When you upload a change to +an existing file to google drive using rclone it will create a new +revision of that file. -However you can set this to restrict rclone to a specific folder -hierarchy. +Revisions follow the standard google policy which at time of writing +was -In order to do this you will have to find the `Folder ID` of the -directory you wish rclone to display. These aren't displayed in the -web interface, but you can use `rclone lsf` to find them, for example + * They are deleted after 30 days or 100 revisions (whatever comes first). + * They do not count towards a user storage quota. -``` -$ rclone lsf --dirs-only -Fip --csv filefabric: -120673758,Burnt PDFs/ -120673759,My Quick Uploads/ -120673755,My Syncs/ -120673756,My backups/ -120673757,My contacts/ -120673761,S3 Storage/ -``` +### Deleting files -The ID for "S3 Storage" would be `120673761`. +By default rclone will send all files to the trash when deleting +files. If deleting them permanently is required then use the +`--drive-use-trash=false` flag, or set the equivalent environment +variable. +### Shortcuts -### Standard options +In March 2020 Google introduced a new feature in Google Drive called +[drive shortcuts](https://support.google.com/drive/answer/9700156) +([API](https://developers.google.com/drive/api/v3/shortcuts)). These +will (by September 2020) [replace the ability for files or folders to +be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). -Here are the Standard options specific to filefabric (Enterprise File Fabric). +Shortcuts are files that link to other files on Google Drive somewhat +like a symlink in unix, except they point to the underlying file data +(e.g. the inode in unix terms) so they don't break if the source is +renamed or moved about. -#### --filefabric-url +By default rclone treats these as follows. -URL of the Enterprise File Fabric to connect to. +For shortcuts pointing to files: -Properties: +- When listing a file shortcut appears as the destination file. +- When downloading the contents of the destination file is downloaded. +- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. +- When server-side moving (renaming) the shortcut is renamed, not the destination file. +- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). +- When deleting the shortcut is deleted not the linked file. +- When setting the modification time, the modification time of the linked file will be set. -- Config: url -- Env Var: RCLONE_FILEFABRIC_URL -- Type: string -- Required: true -- Examples: - - "https://storagemadeeasy.com" - - Storage Made Easy US - - "https://eu.storagemadeeasy.com" - - Storage Made Easy EU - - "https://yourfabric.smestorage.com" - - Connect to your Enterprise File Fabric +For shortcuts pointing to folders: -#### --filefabric-root-folder-id +- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) +- When downloading the contents of the linked folder and sub contents are downloaded +- When uploading to a shortcut folder the file will be placed in the linked folder +- When server-side moving (renaming) the shortcut is renamed, not the destination folder +- When server-side copying the contents of the linked folder is copied, not the shortcut. +- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. +- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. -ID of the root folder. +The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. -Leave blank normally. +Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag +or the corresponding `skip_shortcuts` configuration setting. -Fill in to make rclone start with directory of a given ID. +### Emptying trash +If you wish to empty your trash you can use the `rclone cleanup remote:` +command which will permanently delete all your trashed files. This command +does not take any path arguments. -Properties: +Note that Google Drive takes some time (minutes to days) to empty the +trash even though the command returns within a few seconds. No output +is echoed, so there will be no confirmation even using -v or -vv. -- Config: root_folder_id -- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID -- Type: string -- Required: false +### Quota information -#### --filefabric-permanent-token +To view your current quota you can use the `rclone about remote:` +command which will display your usage limit (quota), the usage in Google +Drive, the size of all files in the Trash and the space used by other +Google services such as Gmail. This command does not take any path +arguments. -Permanent Authentication Token. +#### Import/Export of google documents -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry -you'll see called "My Authentication Tokens". Click the Manage button -to create one. +Google documents can be exported from and uploaded to Google Drive. -These tokens are normally valid for several years. +When rclone downloads a Google doc it chooses a format to download +depending upon the `--drive-export-formats` setting. +By default the export formats are `docx,xlsx,pptx,svg` which are a +sensible default for an editable document. -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens +When choosing a format, rclone runs down the list provided in order +and chooses the first file format the doc can be exported as from the +list. If the file can't be exported to a format on the formats list, +then rclone will choose a format from the default list. +If you prefer an archive copy then you might use `--drive-export-formats +pdf`, or if you prefer openoffice/libreoffice formats you might use +`--drive-export-formats ods,odt,odp`. -Properties: +Note that rclone adds the extension to the google doc, so if it is +called `My Spreadsheet` on google docs, it will be exported as `My +Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. -- Config: permanent_token -- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN -- Type: string -- Required: false +When importing files into Google Drive, rclone will convert all +files with an extension in `--drive-import-formats` to their +associated document type. +rclone will not convert any files by default, since the conversion +is lossy process. -### Advanced options +The conversion must result in a file with the same extension when +the `--drive-export-formats` rules are applied to the uploaded document. -Here are the Advanced options specific to filefabric (Enterprise File Fabric). +Here are some examples for allowed and prohibited conversions. -#### --filefabric-token +| export-formats | import-formats | Upload Ext | Document Ext | Allowed | +| -------------- | -------------- | ---------- | ------------ | ------- | +| odt | odt | odt | odt | Yes | +| odt | docx,odt | odt | odt | Yes | +| | docx | docx | docx | Yes | +| | odt | odt | docx | No | +| odt,docx | docx,odt | docx | odt | No | +| docx,odt | docx,odt | docx | docx | Yes | +| docx,odt | docx,odt | odt | docx | No | -Session Token. +This limitation can be disabled by specifying `--drive-allow-import-name-change`. +When using this flag, rclone can convert multiple files types resulting +in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, +all files having these extension would result in a document represented as a docx file. +This brings the additional risk of overwriting a document, if multiple files +have the same stem. Many rclone operations will not handle this name change +in any way. They assume an equal name when copying files and might copy the +file again or delete them when the name changes. -This is a session token which rclone caches in the config file. It is -usually valid for 1 hour. +Here are the possible export extensions with their corresponding mime types. +Most of these can also be used for importing, but there more that are not +listed here. Some of these additional ones might only be available when +the operating system provides the correct MIME type entries. -Don't set this value - rclone will set it automatically. +This list can be changed by Google Drive at any time and might not +represent the currently available conversions. + +| Extension | Mime Type | Description | +| --------- |-----------| ------------| +| bmp | image/bmp | Windows Bitmap format | +| csv | text/csv | Standard CSV format for Spreadsheets | +| doc | application/msword | Classic Word file | +| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | +| epub | application/epub+zip | E-book format | +| html | text/html | An HTML Document | +| jpg | image/jpeg | A JPEG Image File | +| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | +| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | +| ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | +| ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | +| odt | application/vnd.oasis.opendocument.text | Openoffice Document | +| pdf | application/pdf | Adobe PDF Format | +| pjpeg | image/pjpeg | Progressive JPEG Image | +| png | image/png | PNG Image Format| +| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | +| rtf | application/rtf | Rich Text Format | +| svg | image/svg+xml | Scalable Vector Graphics Format | +| tsv | text/tab-separated-values | Standard TSV format for spreadsheets | +| txt | text/plain | Plain Text | +| wmf | application/x-msmetafile | Windows Meta File | +| xls | application/vnd.ms-excel | Classic Excel file | +| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | +| zip | application/zip | A ZIP file of HTML, Images CSS | +Google documents can also be exported as link files. These files will +open a browser window for the Google Docs website of that document +when opened. The link file extension has to be specified as a +`--drive-export-formats` parameter. They will match all available +Google Documents. -Properties: +| Extension | Description | OS Support | +| --------- | ----------- | ---------- | +| desktop | freedesktop.org specified desktop entry | Linux | +| link.html | An HTML Document with a redirect | All | +| url | INI style link file | macOS, Windows | +| webloc | macOS specific XML format | macOS | -- Config: token -- Env Var: RCLONE_FILEFABRIC_TOKEN -- Type: string -- Required: false -#### --filefabric-token-expiry +### Standard options -Token expiry time. +Here are the Standard options specific to drive (Google Drive). -Don't set this value - rclone will set it automatically. +#### --drive-client-id +Google Application Client Id +Setting your own is recommended. +See https://rclone.org/drive/#making-your-own-client-id for how to create your own. +If you leave this blank, it will use an internal key which is low performance. Properties: -- Config: token_expiry -- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY +- Config: client_id +- Env Var: RCLONE_DRIVE_CLIENT_ID - Type: string - Required: false -#### --filefabric-version - -Version read from the file fabric. +#### --drive-client-secret -Don't set this value - rclone will set it automatically. +OAuth Client Secret. +Leave blank normally. Properties: -- Config: version -- Env Var: RCLONE_FILEFABRIC_VERSION +- Config: client_secret +- Env Var: RCLONE_DRIVE_CLIENT_SECRET - Type: string - Required: false -#### --filefabric-encoding - -The encoding for the backend. +#### --drive-scope -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Comma separated list of scopes that rclone should use when requesting access from drive. Properties: -- Config: encoding -- Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,InvalidUtf8,Dot - - - -# FTP - -FTP is the File Transfer Protocol. Rclone FTP support is provided using the -[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) -package. - -[Limitations of Rclone's FTP backend](#limitations) - -Paths are specified as `remote:path`. If the path does not begin with -a `/` it is relative to the home directory of the user. An empty path -`remote:` refers to the user's home directory. +- Config: scope +- Env Var: RCLONE_DRIVE_SCOPE +- Type: string +- Required: false +- Examples: + - "drive" + - Full access all files, excluding Application Data Folder. + - "drive.readonly" + - Read-only access to file metadata and file contents. + - "drive.file" + - Access to files created by rclone only. + - These are visible in the drive website. + - File authorization is revoked when the user deauthorizes the app. + - "drive.appfolder" + - Allows read and write access to the Application Data folder. + - This is not visible in the drive website. + - "drive.metadata.readonly" + - Allows read-only access to file metadata but + - does not allow any access to read or download file content. -## Configuration +#### --drive-service-account-file -To create an FTP configuration named `remote`, run +Service Account Credentials JSON file path. - rclone config +Leave blank normally. +Needed only if you want use SA instead of interactive login. -Rclone config guides you through an interactive setup process. A minimal -rclone FTP remote definition only requires host, username and password. -For an anonymous FTP server, see [below](#anonymous-ftp). +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. -``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / FTP - \ "ftp" -[snip] -Storage> ftp -** See help for ftp backend at: https://rclone.org/ftp/ ** +Properties: -FTP host to connect to -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Connect to ftp.example.com - \ "ftp.example.com" -host> ftp.example.com -FTP username -Enter a string value. Press Enter for the default ("$USER"). -user> -FTP port number -Enter a signed integer. Press Enter for the default (21). -port> -FTP password -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Use FTP over TLS (Implicit) -Enter a boolean value (true or false). Press Enter for the default ("false"). -tls> -Use FTP over TLS (Explicit) -Enter a boolean value (true or false). Press Enter for the default ("false"). -explicit_tls> -Remote config --------------------- -[remote] -type = ftp -host = ftp.example.com -pass = *** ENCRYPTED *** --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: service_account_file +- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE +- Type: string +- Required: false -To see all directories in the home directory of `remote` +#### --drive-alternate-export - rclone lsd remote: +Deprecated: No longer needed. -Make a new directory +Properties: - rclone mkdir remote:path/to/directory +- Config: alternate_export +- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT +- Type: bool +- Default: false -List the contents of a directory +### Advanced options - rclone ls remote:path/to/directory +Here are the Advanced options specific to drive (Google Drive). -Sync `/home/local/directory` to the remote directory, deleting any -excess files in the directory. +#### --drive-token - rclone sync --interactive /home/local/directory remote:directory +OAuth Access Token as a JSON blob. -### Anonymous FTP +Properties: -When connecting to a FTP server that allows anonymous login, you can use the -special "anonymous" username. Traditionally, this user account accepts any -string as a password, although it is common to use either the password -"anonymous" or "guest". Some servers require the use of a valid e-mail -address as password. +- Config: token +- Env Var: RCLONE_DRIVE_TOKEN +- Type: string +- Required: false -Using [on-the-fly](#backend-path-to-dir) or -[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access -such servers, without requiring any configuration in advance. The following -are examples of that: +#### --drive-auth-url - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): +Auth server URL. -The above examples work in Linux shells and in PowerShell, but not Windows -Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) -command to create a password string in the format required by the -[pass](#ftp-pass) option. The following examples are exactly the same, except use -an already obscured string representation of the same password "dummy", and -therefore works even in Windows Command Prompt: +Leave blank to use the provider defaults. - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: +Properties: -### Implicit TLS +- Config: auth_url +- Env Var: RCLONE_DRIVE_AUTH_URL +- Type: string +- Required: false -Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to -be enabled in the FTP backend config for the remote, or with -[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and -can be set with [`--ftp-port`](#ftp-port). +#### --drive-token-url -### Restricted filename characters +Token server url. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Leave blank to use the provider defaults. -File names cannot end with the following characters. Replacement is -limited to the last character in a file name: +Properties: -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | +- Config: token_url +- Env Var: RCLONE_DRIVE_TOKEN_URL +- Type: string +- Required: false -Not all FTP servers can have all characters in file names, for example: +#### --drive-root-folder-id -| FTP Server| Forbidden characters | -| --------- |:--------------------:| -| proftpd | `*` | -| pureftpd | `\ [ ]` | +ID of the root folder. +Leave blank normally. -This backend's interactive configuration wizard provides a selection of -sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. -Just hit a selection number when prompted. +Fill in to access "Computers" folders (see docs), or for rclone to use +a non root folder as its starting point. -### Standard options +Properties: -Here are the Standard options specific to ftp (FTP). +- Config: root_folder_id +- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID +- Type: string +- Required: false -#### --ftp-host +#### --drive-service-account-credentials -FTP host to connect to. +Service Account Credentials JSON blob. -E.g. "ftp.example.com". +Leave blank normally. +Needed only if you want use SA instead of interactive login. Properties: -- Config: host -- Env Var: RCLONE_FTP_HOST +- Config: service_account_credentials +- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS - Type: string -- Required: true +- Required: false -#### --ftp-user +#### --drive-team-drive -FTP username. +ID of the Shared Drive (Team Drive). Properties: -- Config: user -- Env Var: RCLONE_FTP_USER +- Config: team_drive +- Env Var: RCLONE_DRIVE_TEAM_DRIVE - Type: string -- Default: "$USER" +- Required: false -#### --ftp-port +#### --drive-auth-owner-only -FTP port number. +Only consider files owned by the authenticated user. Properties: -- Config: port -- Env Var: RCLONE_FTP_PORT -- Type: int -- Default: 21 +- Config: auth_owner_only +- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY +- Type: bool +- Default: false -#### --ftp-pass +#### --drive-use-trash -FTP password. +Send files to the trash instead of deleting permanently. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Defaults to true, namely sending files to the trash. +Use `--drive-use-trash=false` to delete files permanently instead. Properties: -- Config: pass -- Env Var: RCLONE_FTP_PASS -- Type: string -- Required: false +- Config: use_trash +- Env Var: RCLONE_DRIVE_USE_TRASH +- Type: bool +- Default: true -#### --ftp-tls +#### --drive-copy-shortcut-content -Use Implicit FTPS (FTP over TLS). +Server side copy contents of shortcuts instead of the shortcut. -When using implicit FTP over TLS the client connects using TLS -right from the start which breaks compatibility with -non-TLS-aware servers. This is usually served over port 990 rather -than port 21. Cannot be used in combination with explicit FTPS. +When doing server side copies, normally rclone will copy shortcuts as +shortcuts. + +If this flag is used then rclone will copy the contents of shortcuts +rather than shortcuts themselves when doing server side copies. Properties: -- Config: tls -- Env Var: RCLONE_FTP_TLS +- Config: copy_shortcut_content +- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT - Type: bool - Default: false -#### --ftp-explicit-tls +#### --drive-skip-gdocs -Use Explicit FTPS (FTP over TLS). +Skip google documents in all listings. -When using explicit FTP over TLS the client explicitly requests -security from the server in order to upgrade a plain text connection -to an encrypted one. Cannot be used in combination with implicit FTPS. +If given, gdocs practically become invisible to rclone. Properties: -- Config: explicit_tls -- Env Var: RCLONE_FTP_EXPLICIT_TLS +- Config: skip_gdocs +- Env Var: RCLONE_DRIVE_SKIP_GDOCS - Type: bool - Default: false -### Advanced options - -Here are the Advanced options specific to ftp (FTP). - -#### --ftp-concurrency - -Maximum number of FTP simultaneous connections, 0 for unlimited. - -Note that setting this is very likely to cause deadlocks so it should -be used with care. - -If you are doing a sync or copy then make sure concurrency is one more -than the sum of `--transfers` and `--checkers`. - -If you use `--check-first` then it just needs to be one more than the -maximum of `--checkers` and `--transfers`. +#### --drive-show-all-gdocs -So for `concurrency 3` you'd use `--checkers 2 --transfers 2 ---check-first` or `--checkers 1 --transfers 1`. +Show all Google Docs including non-exportable ones in listings. +If you try a server side copy on a Google Form without this flag, you +will get this error: + No export formats found for "application/vnd.google-apps.form" -Properties: +However adding this flag will allow the form to be server side copied. -- Config: concurrency -- Env Var: RCLONE_FTP_CONCURRENCY -- Type: int -- Default: 0 +Note that rclone doesn't add extensions to the Google Docs file names +in this mode. -#### --ftp-no-check-certificate +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. -Do not verify the TLS certificate of the server. Properties: -- Config: no_check_certificate -- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE +- Config: show_all_gdocs +- Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS - Type: bool - Default: false -#### --ftp-disable-epsv +#### --drive-skip-checksum-gphotos -Disable using EPSV even if server advertises support. +Skip checksums on Google photos and videos only. -Properties: +Use this if you get checksum errors when transferring Google photos or +videos. -- Config: disable_epsv -- Env Var: RCLONE_FTP_DISABLE_EPSV -- Type: bool -- Default: false +Setting this flag will cause Google photos and videos to return a +blank checksums. -#### --ftp-disable-mlsd +Google photos are identified by being in the "photos" space. -Disable using MLSD even if server advertises support. +Corrupted checksums are caused by Google modifying the image/video but +not updating the checksum. Properties: -- Config: disable_mlsd -- Env Var: RCLONE_FTP_DISABLE_MLSD +- Config: skip_checksum_gphotos +- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS - Type: bool - Default: false -#### --ftp-disable-utf8 +#### --drive-shared-with-me -Disable using UTF-8 even if server advertises support. +Only show files that are shared with me. + +Instructs rclone to operate on your "Shared with me" folder (where +Google Drive lets you access the files and folders others have shared +with you). + +This works both with the "list" (lsd, lsl, etc.) and the "copy" +commands (copy, sync, etc.), and with all other commands too. Properties: -- Config: disable_utf8 -- Env Var: RCLONE_FTP_DISABLE_UTF8 +- Config: shared_with_me +- Env Var: RCLONE_DRIVE_SHARED_WITH_ME - Type: bool - Default: false -#### --ftp-writing-mdtm +#### --drive-trashed-only -Use MDTM to set modification time (VsFtpd quirk) +Only show files that are in the trash. + +This will show trashed files in their original directory structure. Properties: -- Config: writing_mdtm -- Env Var: RCLONE_FTP_WRITING_MDTM +- Config: trashed_only +- Env Var: RCLONE_DRIVE_TRASHED_ONLY - Type: bool - Default: false -#### --ftp-force-list-hidden +#### --drive-starred-only -Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. +Only show files that are starred. Properties: -- Config: force_list_hidden -- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN +- Config: starred_only +- Env Var: RCLONE_DRIVE_STARRED_ONLY - Type: bool - Default: false -#### --ftp-idle-timeout +#### --drive-formats -Max time before closing idle connections. +Deprecated: See export_formats. -If no connections have been returned to the connection pool in the time -given, rclone will empty the connection pool. +Properties: -Set to 0 to keep connections indefinitely. +- Config: formats +- Env Var: RCLONE_DRIVE_FORMATS +- Type: string +- Required: false +#### --drive-export-formats + +Comma separated list of preferred formats for downloading Google docs. Properties: -- Config: idle_timeout -- Env Var: RCLONE_FTP_IDLE_TIMEOUT -- Type: Duration -- Default: 1m0s +- Config: export_formats +- Env Var: RCLONE_DRIVE_EXPORT_FORMATS +- Type: string +- Default: "docx,xlsx,pptx,svg" -#### --ftp-close-timeout +#### --drive-import-formats -Maximum time to wait for a response to close. +Comma separated list of preferred formats for uploading Google docs. Properties: -- Config: close_timeout -- Env Var: RCLONE_FTP_CLOSE_TIMEOUT -- Type: Duration -- Default: 1m0s +- Config: import_formats +- Env Var: RCLONE_DRIVE_IMPORT_FORMATS +- Type: string +- Required: false -#### --ftp-tls-cache-size +#### --drive-allow-import-name-change -Size of TLS session cache for all control and data connections. +Allow the filetype to change when uploading Google docs. -TLS cache allows to resume TLS sessions and reuse PSK between connections. -Increase if default size is not enough resulting in TLS resumption errors. -Enabled by default. Use 0 to disable. +E.g. file.doc to file.docx. This will confuse sync and reupload every time. Properties: -- Config: tls_cache_size -- Env Var: RCLONE_FTP_TLS_CACHE_SIZE -- Type: int -- Default: 32 +- Config: allow_import_name_change +- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE +- Type: bool +- Default: false -#### --ftp-disable-tls13 +#### --drive-use-created-date -Disable TLS 1.3 (workaround for FTP servers with buggy TLS) +Use file created date instead of modified date. -Properties: +Useful when downloading data and you want the creation date used in +place of the last modified date. -- Config: disable_tls13 -- Env Var: RCLONE_FTP_DISABLE_TLS13 -- Type: bool -- Default: false +**WARNING**: This flag may have some unexpected consequences. -#### --ftp-shut-timeout +When uploading to your drive all files will be overwritten unless they +haven't been modified since their creation. And the inverse will occur +while downloading. This side effect can be avoided by using the +"--checksum" flag. -Maximum time to wait for data connection closing status. +This feature was implemented to retain photos capture date as recorded +by google photos. You will first need to check the "Create a Google +Photos folder" option in your google drive settings. You can then copy +or move the photos locally and use the date the image was taken +(created) set as the modification date. Properties: -- Config: shut_timeout -- Env Var: RCLONE_FTP_SHUT_TIMEOUT -- Type: Duration -- Default: 1m0s +- Config: use_created_date +- Env Var: RCLONE_DRIVE_USE_CREATED_DATE +- Type: bool +- Default: false -#### --ftp-ask-password +#### --drive-use-shared-date -Allow asking for FTP password when needed. +Use date file was shared instead of modified date. -If this is set and no password is supplied then rclone will ask for a password +Note that, as with "--drive-use-created-date", this flag may have +unexpected consequences when uploading/downloading files. +If both this flag and "--drive-use-created-date" are set, the created +date is used. Properties: -- Config: ask_password -- Env Var: RCLONE_FTP_ASK_PASSWORD +- Config: use_shared_date +- Env Var: RCLONE_DRIVE_USE_SHARED_DATE - Type: bool - Default: false -#### --ftp-encoding +#### --drive-list-chunk -The encoding for the backend. +Size of listing chunk 100-1000, 0 to disable. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Properties: + +- Config: list_chunk +- Env Var: RCLONE_DRIVE_LIST_CHUNK +- Type: int +- Default: 1000 + +#### --drive-impersonate + +Impersonate this user when using a service account. Properties: -- Config: encoding -- Env Var: RCLONE_FTP_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,RightSpace,Dot -- Examples: - - "Asterisk,Ctl,Dot,Slash" - - ProFTPd can't handle '*' in file names - - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" - - PureFTPd can't handle '[]' or '*' in file names - - "Ctl,LeftPeriod,Slash" - - VsFTPd can't handle file names starting with dot +- Config: impersonate +- Env Var: RCLONE_DRIVE_IMPERSONATE +- Type: string +- Required: false +#### --drive-upload-cutoff +Cutoff for switching to chunked upload. -## Limitations +Properties: -FTP servers acting as rclone remotes must support `passive` mode. -The mode cannot be configured as `passive` is the only supported one. -Rclone's FTP implementation is not compatible with `active` mode -as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). -This will likely never be supported due to security concerns. +- Config: upload_cutoff +- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 8Mi -Rclone's FTP backend does not support any checksums but can compare -file sizes. +#### --drive-chunk-size -`rclone about` is not supported by the FTP backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Upload chunk size. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +Must a power of 2 >= 256k. -The implementation of : `--dump headers`, -`--dump bodies`, `--dump auth` for debugging isn't the same as -for rclone HTTP based backends - it has less fine grained control. +Making this larger will improve performance, but note that each chunk +is buffered in memory one per transfer. -`--timeout` isn't supported (but `--contimeout` is). +Reducing this will reduce memory usage but decrease performance. -`--bind` isn't supported. +Properties: -Rclone's FTP backend could support server-side move but does not -at present. +- Config: chunk_size +- Env Var: RCLONE_DRIVE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 8Mi -The `ftp_proxy` environment variable is not currently supported. +#### --drive-acknowledge-abuse -#### Modified time +Set to allow files which return cannotDownloadAbusiveFile to be downloaded. -File modification time (timestamps) is supported to 1 second resolution -for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. -The `VsFTPd` server has non-standard implementation of time related protocol -commands and needs a special configuration setting: `writing_mdtm = true`. +If downloading a file returns the error "This file has been identified +as malware or spam and cannot be downloaded" with the error code +"cannotDownloadAbusiveFile" then supply this flag to rclone to +indicate you acknowledge the risks of downloading the file and rclone +will download it anyway. -Support for precise file time with other FTP servers varies depending on what -protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` -extensions are present, rclone will use them together to provide precise time. -Otherwise the times you see on the FTP server through rclone are those of the -last file upload. +Note that if you are using service account it will need Manager +permission (not Content Manager) to for this flag to work. If the SA +does not have the right permission, Google will just ignore the flag. -You can use the following command to check whether rclone can use precise time -with your FTP server: `rclone backend features your_ftp_remote:` (the trailing -colon is important). Look for the number in the line tagged by `Precision` -designating the remote time precision expressed as nanoseconds. A value of -`1000000000` means that file time precision of 1 second is available. -A value of `3153600000000000000` (or another large number) means "unsupported". +Properties: -# Google Cloud Storage +- Config: acknowledge_abuse +- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE +- Type: bool +- Default: false -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +#### --drive-keep-revision-forever -## Configuration +Keep new head revision of each file forever. -The initial setup for google cloud storage involves getting a token from Google Cloud Storage -which you need to do in your browser. `rclone config` walks you -through it. +Properties: -Here is an example of how to make a remote called `remote`. First run: +- Config: keep_revision_forever +- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER +- Type: bool +- Default: false - rclone config +#### --drive-size-as-quota -This will guide you through an interactive setup process: +Show sizes as storage quota usage, not actual size. -``` -n) New remote -d) Delete remote -q) Quit config -e/n/d/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Google Cloud Storage (this is not Google Drive) - \ "google cloud storage" -[snip] -Storage> google cloud storage -Google Application Client Id - leave blank normally. -client_id> -Google Application Client Secret - leave blank normally. -client_secret> -Project number optional - needed only for list/create/delete buckets - see your developer console. -project_number> 12345678 -Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. -service_account_file> -Access Control List for new objects. -Choose a number from below, or type in your own value - 1 / Object owner gets OWNER access, and all Authenticated Users get READER access. - \ "authenticatedRead" - 2 / Object owner gets OWNER access, and project team owners get OWNER access. - \ "bucketOwnerFullControl" - 3 / Object owner gets OWNER access, and project team owners get READER access. - \ "bucketOwnerRead" - 4 / Object owner gets OWNER access [default if left blank]. - \ "private" - 5 / Object owner gets OWNER access, and project team members get access according to their roles. - \ "projectPrivate" - 6 / Object owner gets OWNER access, and all Users get READER access. - \ "publicRead" -object_acl> 4 -Access Control List for new buckets. -Choose a number from below, or type in your own value - 1 / Project team owners get OWNER access, and all Authenticated Users get READER access. - \ "authenticatedRead" - 2 / Project team owners get OWNER access [default if left blank]. - \ "private" - 3 / Project team members get access according to their roles. - \ "projectPrivate" - 4 / Project team owners get OWNER access, and all Users get READER access. - \ "publicRead" - 5 / Project team owners get OWNER access, and all Users get WRITER access. - \ "publicReadWrite" -bucket_acl> 2 -Location for the newly created buckets. -Choose a number from below, or type in your own value - 1 / Empty for default location (US). - \ "" - 2 / Multi-regional location for Asia. - \ "asia" - 3 / Multi-regional location for Europe. - \ "eu" - 4 / Multi-regional location for United States. - \ "us" - 5 / Taiwan. - \ "asia-east1" - 6 / Tokyo. - \ "asia-northeast1" - 7 / Singapore. - \ "asia-southeast1" - 8 / Sydney. - \ "australia-southeast1" - 9 / Belgium. - \ "europe-west1" -10 / London. - \ "europe-west2" -11 / Iowa. - \ "us-central1" -12 / South Carolina. - \ "us-east1" -13 / Northern Virginia. - \ "us-east4" -14 / Oregon. - \ "us-west1" -location> 12 -The storage class to use when storing objects in Google Cloud Storage. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Multi-regional storage class - \ "MULTI_REGIONAL" - 3 / Regional storage class - \ "REGIONAL" - 4 / Nearline storage class - \ "NEARLINE" - 5 / Coldline storage class - \ "COLDLINE" - 6 / Durable reduced availability storage class - \ "DURABLE_REDUCED_AVAILABILITY" -storage_class> 5 -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth -Log in and authorize rclone for access -Waiting for code... -Got code --------------------- -[remote] -type = google cloud storage -client_id = -client_secret = -token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} -project_number = 12345678 -object_acl = private -bucket_acl = private --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Show the size of a file as the storage quota used. This is the +current version plus any older versions that have been set to keep +forever. -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +**WARNING**: This flag may have some unexpected consequences. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and this -it may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +It is not recommended to set this flag in your config - the +recommended usage is using the flag form --drive-size-as-quota when +doing rclone ls/lsl/lsf/lsjson/etc only. + +If you do use this flag for syncing (not recommended) then you will +need to use --ignore size also. + +Properties: + +- Config: size_as_quota +- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA +- Type: bool +- Default: false -This remote is called `remote` and can now be used like this +#### --drive-v2-download-min-size -See all the buckets in your project +If Object's are greater, use drive v2 API to download. - rclone lsd remote: +Properties: -Make a new bucket +- Config: v2_download_min_size +- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE +- Type: SizeSuffix +- Default: off - rclone mkdir remote:bucket +#### --drive-pacer-min-sleep -List the contents of a bucket +Minimum time to sleep between API calls. - rclone ls remote:bucket +Properties: -Sync `/home/local/directory` to the remote bucket, deleting any excess -files in the bucket. +- Config: pacer_min_sleep +- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP +- Type: Duration +- Default: 100ms - rclone sync --interactive /home/local/directory remote:bucket +#### --drive-pacer-burst -### Service Account support +Number of API calls to allow without sleeping. -You can set up rclone with Google Cloud Storage in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful -when you want to synchronise files onto machines that don't have -actively logged-in users, for example build machines. +Properties: -To get credentials for Google Cloud Platform -[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), -please head to the -[Service Account](https://console.cloud.google.com/permissions/serviceaccounts) -section of the Google Developer Console. Service Accounts behave just -like normal `User` permissions in -[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), -so you can limit their access (e.g. make them read only). After -creating an account, a JSON file containing the Service Account's -credentials will be downloaded onto your machines. These credentials -are what rclone will use for authentication. +- Config: pacer_burst +- Env Var: RCLONE_DRIVE_PACER_BURST +- Type: int +- Default: 100 -To use a Service Account instead of OAuth2 token flow, enter the path -to your Service Account credentials at the `service_account_file` -prompt and rclone won't use the browser based authentication -flow. If you'd rather stuff the contents of the credentials file into -the rclone config file, you can set `service_account_credentials` with -the actual contents of the file instead, or set the equivalent -environment variable. +#### --drive-server-side-across-configs -### Anonymous Access +Deprecated: use --server-side-across-configs instead. -For downloads of objects that permit public access you can configure rclone -to use anonymous access by setting `anonymous` to `true`. -With unauthorized access you can't write or create files but only read or list -those buckets and objects that have public read access. +Allow server-side operations (e.g. copy) to work across different drive configs. -### Application Default Credentials +This can be useful if you wish to do a server-side copy between two +different Google drives. Note that this isn't enabled by default +because it isn't easy to tell if it will work between any two +configurations. -If no other source of credentials is provided, rclone will fall back -to -[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) -this is useful both when you already have configured authentication -for your developer account, or in production when running on a google -compute host. Note that if running in docker, you may need to run -additional commands on your google compute machine - -[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). +Properties: -Note that in the case application default credentials are used, there -is no need to explicitly configure a project number. +- Config: server_side_across_configs +- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS +- Type: bool +- Default: false -### --fast-list +#### --drive-disable-http2 -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +Disable drive using http2. -### Custom upload headers +There is currently an unsolved issue with the google drive backend and +HTTP/2. HTTP/2 is therefore disabled by default for the drive backend +but can be re-enabled here. When the issue is solved this flag will +be removed. -You can set custom upload headers with the `--header-upload` -flag. Google Cloud Storage supports the headers as described in the -[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) +See: https://github.com/rclone/rclone/issues/3631 -- Cache-Control -- Content-Disposition -- Content-Encoding -- Content-Language -- Content-Type -- X-Goog-Storage-Class -- X-Goog-Meta- -Eg `--header-upload "Content-Type text/potato"` -Note that the last of these is for setting custom metadata in the form -`--header-upload "x-goog-meta-key: value"` +Properties: -### Modification time +- Config: disable_http2 +- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 +- Type: bool +- Default: true -Google Cloud Storage stores md5sum natively. -Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time -with one-second precision as `goog-reserved-file-mtime` in file metadata. +#### --drive-stop-on-upload-limit -To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. -`mtime` uses RFC3339 format with one-nanosecond precision. -`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. -To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. +Make upload limit errors be fatal. -Note that rclone's default modify window is 1ns. -Files uploaded by gsutil only contain timestamps with one-second precision. -If you use rclone to sync files previously uploaded by gsutil, -rclone will attempt to update modification time for all these files. -To avoid these possibly unnecessary updates, use `--modify-window 1s`. +At the time of writing it is only possible to upload 750 GiB of data to +Google Drive a day (this is an undocumented limit). When this limit is +reached Google Drive produces a slightly different error message. When +this flag is set it causes these errors to be fatal. These will stop +the in-progress sync. -### Restricted filename characters +Note that this detection is relying on error message strings which +Google don't document so it may break in the future. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| LF | 0x0A | ␊ | -| CR | 0x0D | ␍ | -| / | 0x2F | / | +See: https://github.com/rclone/rclone/issues/3857 -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Properties: -### Standard options +- Config: stop_on_upload_limit +- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT +- Type: bool +- Default: false -Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). +#### --drive-stop-on-download-limit -#### --gcs-client-id +Make download limit errors be fatal. -OAuth Client Id. +At the time of writing it is only possible to download 10 TiB of data from +Google Drive a day (this is an undocumented limit). When this limit is +reached Google Drive produces a slightly different error message. When +this flag is set it causes these errors to be fatal. These will stop +the in-progress sync. + +Note that this detection is relying on error message strings which +Google don't document so it may break in the future. -Leave blank normally. Properties: -- Config: client_id -- Env Var: RCLONE_GCS_CLIENT_ID -- Type: string -- Required: false +- Config: stop_on_download_limit +- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT +- Type: bool +- Default: false -#### --gcs-client-secret +#### --drive-skip-shortcuts -OAuth Client Secret. +If set skip shortcut files. + +Normally rclone dereferences shortcut files making them appear as if +they are the original file (see [the shortcuts section](#shortcuts)). +If this flag is set then rclone will ignore shortcut files completely. -Leave blank normally. Properties: -- Config: client_secret -- Env Var: RCLONE_GCS_CLIENT_SECRET -- Type: string -- Required: false +- Config: skip_shortcuts +- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS +- Type: bool +- Default: false -#### --gcs-project-number +#### --drive-skip-dangling-shortcuts -Project number. +If set skip dangling shortcut files. + +If this is set then rclone will not show any dangling shortcuts in listings. -Optional - needed only for list/create/delete buckets - see your developer console. Properties: -- Config: project_number -- Env Var: RCLONE_GCS_PROJECT_NUMBER -- Type: string -- Required: false +- Config: skip_dangling_shortcuts +- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS +- Type: bool +- Default: false -#### --gcs-service-account-file +#### --drive-resource-key -Service Account Credentials JSON file path. +Resource key for accessing a link-shared file. -Leave blank normally. -Needed only if you want use SA instead of interactive login. +If you need to access files shared with a link like this -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. + https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing -Properties: +Then you will need to use the first part "XXX" as the "root_folder_id" +and the second part "YYY" as the "resource_key" otherwise you will get +404 not found errors when trying to access the directory. -- Config: service_account_file -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE -- Type: string -- Required: false +See: https://developers.google.com/drive/api/guides/resource-keys -#### --gcs-service-account-credentials +This resource key requirement only applies to a subset of old files. -Service Account Credentials JSON blob. +Note also that opening the folder once in the web interface (with the +user you've authenticated rclone with) seems to be enough so that the +resource key is not needed. -Leave blank normally. -Needed only if you want use SA instead of interactive login. Properties: -- Config: service_account_credentials -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS +- Config: resource_key +- Env Var: RCLONE_DRIVE_RESOURCE_KEY - Type: string - Required: false -#### --gcs-anonymous +#### --drive-fast-list-bug-fix -Access public buckets and objects without credentials. +Work around a bug in Google Drive listing. -Set to 'true' if you just want to download files and don't configure credentials. +Normally rclone will work around a bug in Google Drive when using +--fast-list (ListR) where the search "(A in parents) or (B in +parents)" returns nothing sometimes. See #3114, #4289 and +https://issuetracker.google.com/issues/149522397 -Properties: +Rclone detects this by finding no items in more than one directory +when listing and retries them as lists of individual directories. -- Config: anonymous -- Env Var: RCLONE_GCS_ANONYMOUS -- Type: bool -- Default: false +This means that if you have a lot of empty directories rclone will end +up listing them all individually and this can take many more API +calls. -#### --gcs-object-acl +This flag allows the work-around to be disabled. This is **not** +recommended in normal use - only if you have a particular case you are +having trouble with like many empty directories. -Access Control List for new objects. Properties: -- Config: object_acl -- Env Var: RCLONE_GCS_OBJECT_ACL -- Type: string -- Required: false -- Examples: - - "authenticatedRead" - - Object owner gets OWNER access. - - All Authenticated Users get READER access. - - "bucketOwnerFullControl" - - Object owner gets OWNER access. - - Project team owners get OWNER access. - - "bucketOwnerRead" - - Object owner gets OWNER access. - - Project team owners get READER access. - - "private" - - Object owner gets OWNER access. - - Default if left blank. - - "projectPrivate" - - Object owner gets OWNER access. - - Project team members get access according to their roles. - - "publicRead" - - Object owner gets OWNER access. - - All Users get READER access. +- Config: fast_list_bug_fix +- Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX +- Type: bool +- Default: true -#### --gcs-bucket-acl +#### --drive-metadata-owner + +Control whether owner should be read or written in metadata. + +Owner is a standard part of the file metadata so is easy to read. But it +isn't always desirable to set the owner from the metadata. + +Note that you can't set the owner on Shared Drives, and that setting +ownership will generate an email to the new owner (this can't be +disabled), and you can't transfer ownership to someone outside your +organization. -Access Control List for new buckets. Properties: -- Config: bucket_acl -- Env Var: RCLONE_GCS_BUCKET_ACL -- Type: string -- Required: false +- Config: metadata_owner +- Env Var: RCLONE_DRIVE_METADATA_OWNER +- Type: Bits +- Default: read - Examples: - - "authenticatedRead" - - Project team owners get OWNER access. - - All Authenticated Users get READER access. - - "private" - - Project team owners get OWNER access. - - Default if left blank. - - "projectPrivate" - - Project team members get access according to their roles. - - "publicRead" - - Project team owners get OWNER access. - - All Users get READER access. - - "publicReadWrite" - - Project team owners get OWNER access. - - All Users get WRITER access. + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -#### --gcs-bucket-policy-only +#### --drive-metadata-permissions -Access checks should use bucket-level IAM policies. +Control whether permissions should be read or written in metadata. -If you want to upload objects to a bucket with Bucket Policy Only set -then you will need to set this. +Reading permissions metadata from files can be done quickly, but it +isn't always desirable to set the permissions from the metadata. -When it is set, rclone: +Note that rclone drops any inherited permissions on Shared Drives and +any owner permission on My Drives as these are duplicated in the owner +metadata. -- ignores ACLs set on buckets -- ignores ACLs set on objects -- creates buckets with Bucket Policy Only set -Docs: https://cloud.google.com/storage/docs/bucket-policy-only +Properties: +- Config: metadata_permissions +- Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -Properties: +#### --drive-metadata-labels -- Config: bucket_policy_only -- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY -- Type: bool -- Default: false +Control whether labels should be read or written in metadata. -#### --gcs-location +Reading labels metadata from files takes an extra API transaction and +will slow down listings. It isn't always desirable to set the labels +from the metadata. + +The format of labels is documented in the drive API documentation at +https://developers.google.com/drive/api/reference/rest/v3/Label - +rclone just provides a JSON dump of this format. + +When setting labels, the label and fields must already exist - rclone +will not create them. This means that if you are transferring labels +from two different accounts you will have to create the labels in +advance and use the metadata mapper to translate the IDs between the +two accounts. -Location for the newly created buckets. Properties: -- Config: location -- Env Var: RCLONE_GCS_LOCATION -- Type: string -- Required: false +- Config: metadata_labels +- Env Var: RCLONE_DRIVE_METADATA_LABELS +- Type: Bits +- Default: off - Examples: - - "" - - Empty for default location (US) - - "asia" - - Multi-regional location for Asia - - "eu" - - Multi-regional location for Europe - - "us" - - Multi-regional location for United States - - "asia-east1" - - Taiwan - - "asia-east2" - - Hong Kong - - "asia-northeast1" - - Tokyo - - "asia-northeast2" - - Osaka - - "asia-northeast3" - - Seoul - - "asia-south1" - - Mumbai - - "asia-south2" - - Delhi - - "asia-southeast1" - - Singapore - - "asia-southeast2" - - Jakarta - - "australia-southeast1" - - Sydney - - "australia-southeast2" - - Melbourne - - "europe-north1" - - Finland - - "europe-west1" - - Belgium - - "europe-west2" - - London - - "europe-west3" - - Frankfurt - - "europe-west4" - - Netherlands - - "europe-west6" - - Zürich - - "europe-central2" - - Warsaw - - "us-central1" - - Iowa - - "us-east1" - - South Carolina - - "us-east4" - - Northern Virginia - - "us-west1" - - Oregon - - "us-west2" - - California - - "us-west3" - - Salt Lake City - - "us-west4" - - Las Vegas - - "northamerica-northeast1" - - Montréal - - "northamerica-northeast2" - - Toronto - - "southamerica-east1" - - São Paulo - - "southamerica-west1" - - Santiago - - "asia1" - - Dual region: asia-northeast1 and asia-northeast2. - - "eur4" - - Dual region: europe-north1 and europe-west4. - - "nam4" - - Dual region: us-central1 and us-east1. + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -#### --gcs-storage-class +#### --drive-encoding -The storage class to use when storing objects in Google Cloud Storage. +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: storage_class -- Env Var: RCLONE_GCS_STORAGE_CLASS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "MULTI_REGIONAL" - - Multi-regional storage class - - "REGIONAL" - - Regional storage class - - "NEARLINE" - - Nearline storage class - - "COLDLINE" - - Coldline storage class - - "ARCHIVE" - - Archive storage class - - "DURABLE_REDUCED_AVAILABILITY" - - Durable reduced availability storage class +- Config: encoding +- Env Var: RCLONE_DRIVE_ENCODING +- Type: Encoding +- Default: InvalidUtf8 -#### --gcs-env-auth +#### --drive-env-auth -Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). +Get IAM credentials from runtime (environment variables or instance meta data if no env vars). Only applies if service_account_file and service_account_credentials is blank. Properties: - Config: env_auth -- Env Var: RCLONE_GCS_ENV_AUTH +- Env Var: RCLONE_DRIVE_ENV_AUTH - Type: bool - Default: false - Examples: @@ -28584,430 +33916,457 @@ Properties: - "true" - Get GCP IAM credentials from the environment (env vars or IAM). -### Advanced options +### Metadata -Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). +User metadata is stored in the properties field of the drive object. -#### --gcs-token +Here are the possible system metadata items for the drive backend. -OAuth Access Token as a JSON blob. +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| content-type | The MIME type of the file. | string | text/plain | N | +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | +| description | A short description of the file. | string | Contract for signing | N | +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N | +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | +| starred | Whether the user has starred the file. | boolean | false | N | +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | +| writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N | -Properties: +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -- Config: token -- Env Var: RCLONE_GCS_TOKEN -- Type: string -- Required: false +## Backend commands -#### --gcs-auth-url +Here are the commands specific to the drive backend. -Auth server URL. +Run them with -Leave blank to use the provider defaults. + rclone backend COMMAND remote: -Properties: +The help below will explain what arguments each command takes. -- Config: auth_url -- Env Var: RCLONE_GCS_AUTH_URL -- Type: string -- Required: false +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -#### --gcs-token-url +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). + +### get + +Get command for fetching the drive config parameters + + rclone backend get remote: [options] [+] + +This is a get command which will be used to fetch the various drive config parameters + +Usage Examples: + + rclone backend get drive: [-o service_account_file] [-o chunk_size] + rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] + + +Options: + +- "chunk_size": show the current upload chunk size +- "service_account_file": show the current service account file + +### set + +Set command for updating the drive config parameters + + rclone backend set remote: [options] [+] + +This is a set command which will be used to update the various drive config parameters + +Usage Examples: + + rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + + +Options: + +- "chunk_size": update the current upload chunk size +- "service_account_file": update the current service account file + +### shortcut + +Create shortcuts from files or directories + + rclone backend shortcut remote: [options] [+] + +This command creates shortcuts from files or directories. + +Usage: + + rclone backend shortcut drive: source_item destination_shortcut + rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut + +In the first example this creates a shortcut from the "source_item" +which can be a file or a directory to the "destination_shortcut". The +"source_item" and the "destination_shortcut" should be relative paths +from "drive:" -Token server url. +In the second example this creates a shortcut from the "source_item" +relative to "drive:" to the "destination_shortcut" relative to +"drive2:". This may fail with a permission error if the user +authenticated with "drive2:" can't read files from "drive:". -Leave blank to use the provider defaults. -Properties: +Options: -- Config: token_url -- Env Var: RCLONE_GCS_TOKEN_URL -- Type: string -- Required: false +- "target": optional target remote for the shortcut destination -#### --gcs-no-check-bucket +### drives -If set, don't attempt to check the bucket exists or create it. +List the Shared Drives available to this account -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. + rclone backend drives remote: [options] [+] +This command lists the Shared Drives (Team Drives) available to this +account. -Properties: +Usage: -- Config: no_check_bucket -- Env Var: RCLONE_GCS_NO_CHECK_BUCKET -- Type: bool -- Default: false + rclone backend [-o config] drives drive: -#### --gcs-decompress +This will return a JSON list of objects like this -If set this will decompress gzip encoded objects. + [ + { + "id": "0ABCDEF-01234567890", + "kind": "drive#teamDrive", + "name": "My Drive" + }, + { + "id": "0ABCDEFabcdefghijkl", + "kind": "drive#teamDrive", + "name": "Test Drive" + } + ] -It is possible to upload objects to GCS with "Content-Encoding: gzip" -set. Normally rclone will download these files as compressed objects. +With the -o config parameter it will output the list in a format +suitable for adding to a config file to make aliases for all the +drives found and a combined drive. -If this flag is set then rclone will decompress these files with -"Content-Encoding: gzip" as they are received. This means that rclone -can't check the size and hash but the file contents will be decompressed. + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: -Properties: + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" -- Config: decompress -- Env Var: RCLONE_GCS_DECOMPRESS -- Type: bool -- Default: false +Adding this to the rclone config file will cause those team drives to +be accessible with the aliases shown. Any illegal characters will be +substituted with "_" and duplicate names will have numbers suffixed. +It will also add a remote called AllDrives which shows all the shared +drives combined into one directory tree. -#### --gcs-endpoint -Endpoint for the service. +### untrash -Leave blank normally. +Untrash files and directories -Properties: + rclone backend untrash remote: [options] [+] -- Config: endpoint -- Env Var: RCLONE_GCS_ENDPOINT -- Type: string -- Required: false +This command untrashes all the files and directories in the directory +passed in recursively. -#### --gcs-encoding +Usage: -The encoding for the backend. +This takes an optional directory to trash which make this easier to +use via the API. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + rclone backend untrash drive:directory + rclone backend --interactive untrash drive:directory subdir -Properties: +Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. -- Config: encoding -- Env Var: RCLONE_GCS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot +Result: + { + "Untrashed": 17, + "Errors": 0 + } -## Limitations +### copyid -`rclone about` is not supported by the Google Cloud Storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Copy files by ID -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + rclone backend copyid remote: [options] [+] -# Google Drive +This command copies files by ID -Paths are specified as `drive:path` +Usage: -Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. + rclone backend copyid drive: ID path + rclone backend copyid drive: ID1 path1 ID2 path2 -## Configuration +It copies the drive file with ID given to the path (an rclone path which +will be passed internally to rclone copyto). The ID and path pairs can be +repeated. -The initial setup for drive involves getting a token from Google drive -which you need to do in your browser. `rclone config` walks you -through it. +The path should end with a / to indicate copy the file as named to +this directory. If it doesn't end with a / then the last path +component will be used as the file name. -Here is an example of how to make a remote called `remote`. First run: +If the destination is a drive backend then server-side copying will be +attempted if possible. - rclone config +Use the --interactive/-i or --dry-run flag to see what would be copied before copying. -This will guide you through an interactive setup process: -``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Google Drive - \ "drive" -[snip] -Storage> drive -Google Application Client Id - leave blank normally. -client_id> -Google Application Client Secret - leave blank normally. -client_secret> -Scope that rclone should use when requesting access from drive. -Choose a number from below, or type in your own value - 1 / Full access all files, excluding Application Data Folder. - \ "drive" - 2 / Read-only access to file metadata and file contents. - \ "drive.readonly" - / Access to files created by rclone only. - 3 | These are visible in the drive website. - | File authorization is revoked when the user deauthorizes the app. - \ "drive.file" - / Allows read and write access to the Application Data folder. - 4 | This is not visible in the drive website. - \ "drive.appfolder" - / Allows read-only access to file metadata but - 5 | does not allow any access to read or download file content. - \ "drive.metadata.readonly" -scope> 1 -Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. -service_account_file> -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth -Log in and authorize rclone for access -Waiting for code... -Got code -Configure this as a Shared Drive (Team Drive)? -y) Yes -n) No -y/n> n --------------------- -[remote] -client_id = -client_secret = -scope = drive -root_folder_id = -service_account_file = -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +### exportformats -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +Dump the export formats for debug purposes -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and it -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. + rclone backend exportformats remote: [options] [+] -You can then use it like this, +### importformats -List directories in top level of your drive +Dump the import formats for debug purposes - rclone lsd remote: + rclone backend importformats remote: [options] [+] -List all the files in your drive - rclone ls remote: -To copy a local directory to a drive directory called backup +## Limitations - rclone copy /home/source remote:backup +Drive has quite a lot of rate limiting. This causes rclone to be +limited to transferring about 2 files per second only. Individual +files may be transferred much faster at 100s of MiB/s but lots of +small files can take a long time. -### Scopes +Server side copies are also subject to a separate rate limit. If you +see User rate limit exceeded errors, wait at least 24 hours and retry. +You can disable server-side copies with `--disable copy` to download +and upload the files if you prefer. -Rclone allows you to select which scope you would like for rclone to -use. This changes what type of token is granted to rclone. [The -scopes are defined -here](https://developers.google.com/drive/v3/web/about-auth). +### Limitations of Google Docs -The scope are +Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, +and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` +and `rclone serve`. When calculating directory totals, e.g. in +`rclone size` and `rclone ncdu`, they will be counted in as empty +files. -#### drive +This is because rclone can't find out the size of the Google docs +without downloading them. -This is the default scope and allows full access to all files, except -for the Application Data Folder (see below). +Google docs will transfer correctly with `rclone sync`, `rclone copy` +etc as rclone knows to ignore the size when doing the transfer. -Choose this one if you aren't sure. +However an unfortunate consequence of this is that you may not be able +to download Google docs using `rclone mount`. If it doesn't work you +will get a 0 sized file. If you try again the doc may gain its +correct size and be downloadable. Whether it will work on not depends +on the application accessing the mount and the OS you are running - +experiment to find out if it does work for you! -#### drive.readonly +### Duplicated files -This allows read only access to all files. Files may be listed and -downloaded but not uploaded, renamed or deleted. +Sometimes, for no reason I've been able to track down, drive will +duplicate a file that rclone uploads. Drive unlike all the other +remotes can have duplicated files. -#### drive.file +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -With this scope rclone can read/view/modify only those files and -folders it creates. +Use `rclone dedupe` to fix duplicated files. -So if you uploaded files to drive via the web interface (or any other -means) they will not be visible to rclone. +Note that this isn't just a problem with rclone, even Google Photos on +Android duplicates files on drive sometimes. -This can be useful if you are using rclone to backup data and you want -to be sure confidential data on your drive is not visible to rclone. +### Rclone appears to be re-copying files it shouldn't -Files created with this scope are visible in the web interface. +The most likely cause of this is the duplicated file issue above - run +`rclone dedupe` and check your logs for duplicate object or directory +messages. -#### drive.appfolder +This can also be caused by a delay/caching on google drive's end when +comparing directory listings. Specifically with team drives used in +combination with --fast-list. Files that were uploaded recently may +not appear on the directory list sent to rclone when using --fast-list. -This gives rclone its own private area to store files. Rclone will -not be able to see any other files on your drive and you won't be able -to see rclone's files from the web interface either. +Waiting a moderate period of time between attempts (estimated to be +approximately 1 hour) and/or not using --fast-list both seem to be +effective in preventing the problem. -#### drive.metadata.readonly +### SHA1 or SHA256 hashes may be missing -This allows read only access to file names only. It does not allow -rclone to download or upload data, or rename or delete files or -directories. +All files have MD5 hashes, but a small fraction of files uploaded may +not have SHA1 or SHA256 hashes especially if they were uploaded before 2018. -### Root folder ID +## Making your own client_id -This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory -(identified by its `Folder ID`) that rclone considers to be the root -of your drive. +When you use rclone with Google drive in its default configuration you +are using rclone's client_id. This is shared between all the rclone +users. There is a global rate limit on the number of queries per +second that each client_id can do set by Google. rclone already has a +high quota and I will continue to make sure it is high enough by +contacting Google. -Normally you will leave this blank and rclone will determine the -correct root to use itself. +It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. -However you can set this to restrict rclone to a specific folder -hierarchy or to access data within the "Computers" tab on the drive -web interface (where files from Google's Backup and Sync desktop -program go). +Here is how to create your own Google Drive client ID for rclone: -In order to do this you will have to find the `Folder ID` of the -directory you wish rclone to display. This will be the last segment -of the URL when you open the relevant folder in the drive web -interface. +1. Log into the [Google API +Console](https://console.developers.google.com/) with your Google +account. It doesn't matter what Google account you use. (It need not +be the same account as the Google Drive you want to access) -So if the folder you want rclone to use has a URL which looks like -`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` -in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as -the `root_folder_id` in the config. +2. Select a project or create a new project. -**NB** folders under the "Computers" tab seem to be read only (drive -gives a 500 error) when using rclone. +3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the +"Google Drive API". -There doesn't appear to be an API to discover the folder IDs of the -"Computers" tab - please contact us if you know otherwise! +4. Click "Credentials" in the left-side panel (not "Create +credentials", which opens the wizard). -Note also that rclone can't access any data under the "Backups" tab on -the google drive web interface yet. +5. If you already configured an "Oauth Consent Screen", then skip +to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button +(near the top right corner of the right panel), then select "External" +and click on "CREATE"; on the next screen, enter an "Application name" +("rclone" is OK); enter "User Support Email" (your own email is OK); +enter "Developer Contact Email" (your own email is OK); then click on +"Save" (all other data is optional). You will also have to add some scopes, +including `.../auth/docs` and `.../auth/drive` in order to be able to edit, +create and delete files with RClone. You may also want to include the +`../auth/drive.metadata.readonly` scope. After adding scopes, click +"Save and continue" to add test users. Be sure to add your own account to +the test users. Once you've added yourself as a test user and saved the +changes, click again on "Credentials" on the left panel to go back to +the "Credentials" screen. -### Service Account support + (PS: if you are a GSuite user, you could also select "Internal" instead +of "External" above, but this will restrict API use to Google Workspace +users in your organisation). -You can set up rclone with Google Drive in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful -when you want to synchronise files onto machines that don't have -actively logged-in users, for example build machines. +6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, +then select "OAuth client ID". -To use a Service Account instead of OAuth2 token flow, enter the path -to your Service Account credentials at the `service_account_file` -prompt during `rclone config` and rclone won't use the browser based -authentication flow. If you'd rather stuff the contents of the -credentials file into the rclone config file, you can set -`service_account_credentials` with the actual contents of the file -instead, or set the equivalent environment variable. +7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) -#### Use case - Google Apps/G-suite account and individual Drive +8. It will show you a client ID and client secret. Make a note of these. + + (If you selected "External" at Step 5 continue to Step 9. + If you chose "Internal" you don't need to publish and can skip straight to + Step 10 but your destination drive must be part of the same Google Workspace.) -Let's say that you are the administrator of a Google Apps (old) or -G-suite account. -The goal is to store data on an individual's Drive account, who IS -a member of the domain. -We'll call the domain **example.com**, and the user -**foo@example.com**. +9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. + You will also want to add yourself as a test user. -There's a few steps we need to go through to accomplish this: +10. Provide the noted client ID and client secret to rclone. -##### 1. Create a service account for example.com - - To create a service account and obtain its credentials, go to the -[Google Developer Console](https://console.developers.google.com). - - You must have a project - create one if you don't. - - Then go to "IAM & admin" -> "Service Accounts". - - Use the "Create Credentials" button. Fill in "Service account name" -with something that identifies your client. "Role" can be empty. - - Tick "Furnish a new private key" - select "Key type JSON". - - Tick "Enable G Suite Domain-wide Delegation". This option makes -"impersonation" possible, as documented here: -[Delegating domain-wide authority to the service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) - - These credentials are what rclone will use for authentication. -If you ever need to remove access, press the "Delete service -account key" button. +Be aware that, due to the "enhanced security" recently introduced by +Google, you are theoretically expected to "submit your app for verification" +and then wait a few weeks(!) for their response; in practice, you can go right +ahead and use the client ID and client secret with rclone, the only issue will +be a very scary confirmation screen shown when you connect via your browser +for rclone to be able to get its token-id (but as this only happens during +the remote configuration, it's not such a big deal). Keeping the application in +"Testing" will work as well, but the limitation is that any grants will expire +after a week, which can be annoying to refresh constantly. If, for whatever +reason, a short grant time is not a problem, then keeping the application in +testing mode would also be sufficient. -##### 2. Allowing API access to example.com Google Drive - - Go to example.com's admin console - - Go into "Security" (or use the search bar) - - Select "Show more" and then "Advanced settings" - - Select "Manage API client access" in the "Authentication" section - - In the "Client Name" field enter the service account's -"Client ID" - this can be found in the Developer Console under -"IAM & Admin" -> "Service Accounts", then "View Client ID" for -the newly created service account. -It is a ~21 character numerical string. - - In the next field, "One or More API Scopes", enter -`https://www.googleapis.com/auth/drive` -to grant access to Google Drive specifically. +(Thanks to @balazer on github for these instructions.) -##### 3. Configure rclone, assuming a new install +Sometimes, creation of an OAuth consent in Google API Console fails due to an error message +“The request failed because changes to one of the field of the resource is not supported”. +As a convenient workaround, the necessary Google Drive API key can be created on the +[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. +Just push the Enable the Drive API button to receive the Client ID and Secret. +Note that it will automatically create a new project in the API Console. -``` -rclone config +# Google Photos -n/s/q> n # New -name>gdrive # Gdrive is an example name -Storage> # Select the number shown for Google Drive -client_id> # Can be left blank -client_secret> # Can be left blank -scope> # Select your scope, 1 for example -root_folder_id> # Can be left blank -service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! -y/n> # Auto config, n +The rclone backend for [Google Photos](https://www.google.com/photos/about/) is +a specialized backend for transferring photos and videos to and from +Google Photos. -``` +**NB** The Google Photos API which rclone uses has quite a few +limitations, so please read the [limitations section](#limitations) +carefully to make sure it is suitable for your use. -##### 4. Verify that it's working - - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` - - The arguments do: - - `-v` - verbose logging - - `--drive-impersonate foo@example.com` - this is what does -the magic, pretending to be user foo. - - `lsf` - list files in a parsing friendly way - - `gdrive:backup` - use the remote called gdrive, work in -the folder named backup. +## Configuration -Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: - - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 - - use rclone without specifying the `--drive-impersonate` option, like this: - `rclone -v lsf gdrive:backup` +The initial setup for google cloud storage involves getting a token from Google Photos +which you need to do in your browser. `rclone config` walks you +through it. +Here is an example of how to make a remote called `remote`. First run: -### Shared drives (team drives) + rclone config -If you want to configure the remote to point to a Google Shared Drive -(previously known as Team Drives) then answer `y` to the question -`Configure this as a Shared Drive (Team Drive)?`. +This will guide you through an interactive setup process: -This will fetch the list of Shared Drives from google and allow you to -configure which one you want to use. You can also type in a Shared -Drive ID if you prefer. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / Google Photos + \ "google photos" +[snip] +Storage> google photos +** See help for google photos backend at: https://rclone.org/googlephotos/ ** -For example: +Google Application Client Id +Leave blank normally. +Enter a string value. Press Enter for the default (""). +client_id> +Google Application Client Secret +Leave blank normally. +Enter a string value. Press Enter for the default (""). +client_secret> +Set to make the Google Photos backend read only. -``` -Configure this as a Shared Drive (Team Drive)? +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. +Enter a boolean value (true or false). Press Enter for the default ("false"). +read_only> +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y -Fetching Shared Drive list... -Choose a number from below, or type in your own value - 1 / Rclone Test - \ "xxxxxxxxxxxxxxxxxxxx" - 2 / Rclone Test 2 - \ "yyyyyyyyyyyyyyyyyyyy" - 3 / Rclone Test 3 - \ "zzzzzzzzzzzzzzzzzzzz" -Enter a Shared Drive ID> 1 +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth +Log in and authorize rclone for access +Waiting for code... +Got code + +*** IMPORTANT: All media items uploaded to Google Photos with rclone +*** are stored in full resolution at original quality. These uploads +*** will count towards storage in your Google Account. + -------------------- [remote] -client_id = -client_secret = -token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null} -team_drive = xxxxxxxxxxxxxxxxxxxx +type = google photos +token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} -------------------- y) Yes this is OK e) Edit this remote @@ -29015,889 +34374,1030 @@ d) Delete this remote y/e/d> y ``` -### --fast-list +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and this +may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -It does this by combining multiple `list` calls into a single API request. +This remote is called `remote` and can now be used like this -This works by combining many `'%s' in parents` filters into one expression. -To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: -``` -trashed=false and 'a' in parents -trashed=false and 'b' in parents -trashed=false and 'c' in parents -``` -These can now be combined into a single request: -``` -trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) -``` +See all the albums in your photos -The implementation of `ListR` will put up to 50 `parents` filters into one request. -It will use the `--checkers` value to specify the number of requests to run in parallel. + rclone lsd remote:album -In tests, these batch requests were up to 20x faster than the regular method. -Running the following command against different sized folders gives: -``` -rclone lsjson -vv -R --checkers=6 gdrive:folder -``` +Make a new album -small folder (220 directories, 700 files): + rclone mkdir remote:album/newAlbum -- without `--fast-list`: 38s -- with `--fast-list`: 10s +List the contents of an album -large folder (10600 directories, 39000 files): + rclone ls remote:album/newAlbum -- without `--fast-list`: 22:05 min -- with `--fast-list`: 58s +Sync `/home/local/images` to the Google Photos, removing any excess +files in the album. -### Modified time + rclone sync --interactive /home/local/image remote:album/newAlbum -Google drive stores modification times accurate to 1 ms. +### Layout -### Restricted filename characters +As Google Photos is not a general purpose cloud storage system, the +backend is laid out to help you navigate it. -Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +The directories under `media` show different ways of categorizing the +media. Each file will appear multiple times. So if you want to make +a backup of your google photos you might choose to backup +`remote:media/by-month`. (**NB** `remote:media/by-day` is rather slow +at the moment so avoid for syncing.) -In contrast to other backends, `/` can also be used in names and `.` -or `..` are valid names. +Note that all your photos and videos will appear somewhere under +`media`, but they may not appear under `album` unless you've put them +into albums. -### Revisions +``` +/ +- upload + - file1.jpg + - file2.jpg + - ... +- media + - all + - file1.jpg + - file2.jpg + - ... + - by-year + - 2000 + - file1.jpg + - ... + - 2001 + - file2.jpg + - ... + - ... + - by-month + - 2000 + - 2000-01 + - file1.jpg + - ... + - 2000-02 + - file2.jpg + - ... + - ... + - by-day + - 2000 + - 2000-01-01 + - file1.jpg + - ... + - 2000-01-02 + - file2.jpg + - ... + - ... +- album + - album name + - album name/sub +- shared-album + - album name + - album name/sub +- feature + - favorites + - file1.jpg + - file2.jpg +``` -Google drive stores revisions of files. When you upload a change to -an existing file to google drive using rclone it will create a new -revision of that file. +There are two writable parts of the tree, the `upload` directory and +sub directories of the `album` directory. -Revisions follow the standard google policy which at time of writing -was +The `upload` directory is for uploading files you don't want to put +into albums. This will be empty to start with and will contain the +files you've uploaded for one rclone session only, becoming empty +again when you restart rclone. The use case for this would be if you +have a load of files you just want to once off dump into Google +Photos. For repeated syncing, uploading to `album` will work better. - * They are deleted after 30 days or 100 revisions (whatever comes first). - * They do not count towards a user storage quota. +Directories within the `album` directory are also writeable and you +may create new directories (albums) under `album`. If you copy files +with a directory hierarchy in there then rclone will create albums +with the `/` character in them. For example if you do -### Deleting files + rclone copy /path/to/images remote:album/images -By default rclone will send all files to the trash when deleting -files. If deleting them permanently is required then use the -`--drive-use-trash=false` flag, or set the equivalent environment -variable. +and the images directory contains -### Shortcuts +``` +images + - file1.jpg + dir + file2.jpg + dir2 + dir3 + file3.jpg +``` -In March 2020 Google introduced a new feature in Google Drive called -[drive shortcuts](https://support.google.com/drive/answer/9700156) -([API](https://developers.google.com/drive/api/v3/shortcuts)). These -will (by September 2020) [replace the ability for files or folders to -be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). +Then rclone will create the following albums with the following files in -Shortcuts are files that link to other files on Google Drive somewhat -like a symlink in unix, except they point to the underlying file data -(e.g. the inode in unix terms) so they don't break if the source is -renamed or moved about. +- images + - file1.jpg +- images/dir + - file2.jpg +- images/dir2/dir3 + - file3.jpg -Be default rclone treats these as follows. +This means that you can use the `album` path pretty much like a normal +filesystem and it is a good target for repeated syncing. -For shortcuts pointing to files: +The `shared-album` directory shows albums shared with you or by you. +This is similar to the Sharing tab in the Google Photos web interface. -- When listing a file shortcut appears as the destination file. -- When downloading the contents of the destination file is downloaded. -- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. -- When server-side moving (renaming) the shortcut is renamed, not the destination file. -- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). -- When deleting the shortcut is deleted not the linked file. -- When setting the modification time, the modification time of the linked file will be set. -For shortcuts pointing to folders: +### Standard options -- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) -- When downloading the contents of the linked folder and sub contents are downloaded -- When uploading to a shortcut folder the file will be placed in the linked folder -- When server-side moving (renaming) the shortcut is renamed, not the destination folder -- When server-side copying the contents of the linked folder is copied, not the shortcut. -- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. -- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. +Here are the Standard options specific to google photos (Google Photos). -The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. +#### --gphotos-client-id -Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag -or the corresponding `skip_shortcuts` configuration setting. +OAuth Client Id. -### Emptying trash +Leave blank normally. -If you wish to empty your trash you can use the `rclone cleanup remote:` -command which will permanently delete all your trashed files. This command -does not take any path arguments. +Properties: -Note that Google Drive takes some time (minutes to days) to empty the -trash even though the command returns within a few seconds. No output -is echoed, so there will be no confirmation even using -v or -vv. +- Config: client_id +- Env Var: RCLONE_GPHOTOS_CLIENT_ID +- Type: string +- Required: false -### Quota information +#### --gphotos-client-secret -To view your current quota you can use the `rclone about remote:` -command which will display your usage limit (quota), the usage in Google -Drive, the size of all files in the Trash and the space used by other -Google services such as Gmail. This command does not take any path -arguments. +OAuth Client Secret. -#### Import/Export of google documents +Leave blank normally. -Google documents can be exported from and uploaded to Google Drive. +Properties: -When rclone downloads a Google doc it chooses a format to download -depending upon the `--drive-export-formats` setting. -By default the export formats are `docx,xlsx,pptx,svg` which are a -sensible default for an editable document. +- Config: client_secret +- Env Var: RCLONE_GPHOTOS_CLIENT_SECRET +- Type: string +- Required: false -When choosing a format, rclone runs down the list provided in order -and chooses the first file format the doc can be exported as from the -list. If the file can't be exported to a format on the formats list, -then rclone will choose a format from the default list. +#### --gphotos-read-only -If you prefer an archive copy then you might use `--drive-export-formats -pdf`, or if you prefer openoffice/libreoffice formats you might use -`--drive-export-formats ods,odt,odp`. +Set to make the Google Photos backend read only. -Note that rclone adds the extension to the google doc, so if it is -called `My Spreadsheet` on google docs, it will be exported as `My -Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. -When importing files into Google Drive, rclone will convert all -files with an extension in `--drive-import-formats` to their -associated document type. -rclone will not convert any files by default, since the conversion -is lossy process. +Properties: -The conversion must result in a file with the same extension when -the `--drive-export-formats` rules are applied to the uploaded document. +- Config: read_only +- Env Var: RCLONE_GPHOTOS_READ_ONLY +- Type: bool +- Default: false -Here are some examples for allowed and prohibited conversions. +### Advanced options -| export-formats | import-formats | Upload Ext | Document Ext | Allowed | -| -------------- | -------------- | ---------- | ------------ | ------- | -| odt | odt | odt | odt | Yes | -| odt | docx,odt | odt | odt | Yes | -| | docx | docx | docx | Yes | -| | odt | odt | docx | No | -| odt,docx | docx,odt | docx | odt | No | -| docx,odt | docx,odt | docx | docx | Yes | -| docx,odt | docx,odt | odt | docx | No | +Here are the Advanced options specific to google photos (Google Photos). -This limitation can be disabled by specifying `--drive-allow-import-name-change`. -When using this flag, rclone can convert multiple files types resulting -in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, -all files having these extension would result in a document represented as a docx file. -This brings the additional risk of overwriting a document, if multiple files -have the same stem. Many rclone operations will not handle this name change -in any way. They assume an equal name when copying files and might copy the -file again or delete them when the name changes. +#### --gphotos-token -Here are the possible export extensions with their corresponding mime types. -Most of these can also be used for importing, but there more that are not -listed here. Some of these additional ones might only be available when -the operating system provides the correct MIME type entries. +OAuth Access Token as a JSON blob. -This list can be changed by Google Drive at any time and might not -represent the currently available conversions. +Properties: -| Extension | Mime Type | Description | -| --------- |-----------| ------------| -| bmp | image/bmp | Windows Bitmap format | -| csv | text/csv | Standard CSV format for Spreadsheets | -| doc | application/msword | Classic Word file | -| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | -| epub | application/epub+zip | E-book format | -| html | text/html | An HTML Document | -| jpg | image/jpeg | A JPEG Image File | -| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | -| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | -| ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | -| ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | -| odt | application/vnd.oasis.opendocument.text | Openoffice Document | -| pdf | application/pdf | Adobe PDF Format | -| pjpeg | image/pjpeg | Progressive JPEG Image | -| png | image/png | PNG Image Format| -| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | -| rtf | application/rtf | Rich Text Format | -| svg | image/svg+xml | Scalable Vector Graphics Format | -| tsv | text/tab-separated-values | Standard TSV format for spreadsheets | -| txt | text/plain | Plain Text | -| wmf | application/x-msmetafile | Windows Meta File | -| xls | application/vnd.ms-excel | Classic Excel file | -| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | -| zip | application/zip | A ZIP file of HTML, Images CSS | +- Config: token +- Env Var: RCLONE_GPHOTOS_TOKEN +- Type: string +- Required: false -Google documents can also be exported as link files. These files will -open a browser window for the Google Docs website of that document -when opened. The link file extension has to be specified as a -`--drive-export-formats` parameter. They will match all available -Google Documents. +#### --gphotos-auth-url -| Extension | Description | OS Support | -| --------- | ----------- | ---------- | -| desktop | freedesktop.org specified desktop entry | Linux | -| link.html | An HTML Document with a redirect | All | -| url | INI style link file | macOS, Windows | -| webloc | macOS specific XML format | macOS | +Auth server URL. +Leave blank to use the provider defaults. -### Standard options +Properties: -Here are the Standard options specific to drive (Google Drive). +- Config: auth_url +- Env Var: RCLONE_GPHOTOS_AUTH_URL +- Type: string +- Required: false -#### --drive-client-id +#### --gphotos-token-url -Google Application Client Id -Setting your own is recommended. -See https://rclone.org/drive/#making-your-own-client-id for how to create your own. -If you leave this blank, it will use an internal key which is low performance. +Token server url. + +Leave blank to use the provider defaults. Properties: -- Config: client_id -- Env Var: RCLONE_DRIVE_CLIENT_ID +- Config: token_url +- Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false -#### --drive-client-secret +#### --gphotos-read-size -OAuth Client Secret. +Set to read the size of media items. -Leave blank normally. +Normally rclone does not read the size of media items since this takes +another transaction. This isn't necessary for syncing. However +rclone mount needs to know the size of files in advance of reading +them, so setting this flag when using rclone mount is recommended if +you want to read the media. Properties: -- Config: client_secret -- Env Var: RCLONE_DRIVE_CLIENT_SECRET -- Type: string -- Required: false +- Config: read_size +- Env Var: RCLONE_GPHOTOS_READ_SIZE +- Type: bool +- Default: false -#### --drive-scope +#### --gphotos-start-year -Scope that rclone should use when requesting access from drive. +Year limits the photos to be downloaded to those which are uploaded after the given year. Properties: -- Config: scope -- Env Var: RCLONE_DRIVE_SCOPE -- Type: string -- Required: false -- Examples: - - "drive" - - Full access all files, excluding Application Data Folder. - - "drive.readonly" - - Read-only access to file metadata and file contents. - - "drive.file" - - Access to files created by rclone only. - - These are visible in the drive website. - - File authorization is revoked when the user deauthorizes the app. - - "drive.appfolder" - - Allows read and write access to the Application Data folder. - - This is not visible in the drive website. - - "drive.metadata.readonly" - - Allows read-only access to file metadata but - - does not allow any access to read or download file content. +- Config: start_year +- Env Var: RCLONE_GPHOTOS_START_YEAR +- Type: int +- Default: 2000 -#### --drive-service-account-file +#### --gphotos-include-archived -Service Account Credentials JSON file path. +Also view and download archived media. -Leave blank normally. -Needed only if you want use SA instead of interactive login. +By default, rclone does not request archived media. Thus, when syncing, +archived media is not visible in directory listings or transferred. -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. +Note that media in albums is always visible and synced, no matter +their archive status. + +With this flag, archived media are always visible in directory +listings and transferred. + +Without this flag, archived media will not be visible in directory +listings and won't be transferred. Properties: -- Config: service_account_file -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE -- Type: string -- Required: false +- Config: include_archived +- Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED +- Type: bool +- Default: false -#### --drive-alternate-export +#### --gphotos-encoding -Deprecated: No longer needed. +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: alternate_export -- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT -- Type: bool -- Default: false +- Config: encoding +- Env Var: RCLONE_GPHOTOS_ENCODING +- Type: Encoding +- Default: Slash,CrLf,InvalidUtf8,Dot -### Advanced options +#### --gphotos-batch-mode -Here are the Advanced options specific to drive (Google Drive). +Upload file batching sync|async|off. -#### --drive-token +This sets the batch mode used by rclone. + +This has 3 possible values + +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don't check completion + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. -OAuth Access Token as a JSON blob. Properties: -- Config: token -- Env Var: RCLONE_DRIVE_TOKEN +- Config: batch_mode +- Env Var: RCLONE_GPHOTOS_BATCH_MODE - Type: string -- Required: false +- Default: "sync" -#### --drive-auth-url +#### --gphotos-batch-size -Auth server URL. +Max number of files in upload batch. + +This sets the batch size of files to upload. It has to be less than 50. + +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. + +- batch_mode: async - default batch_size is 50 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. -Leave blank to use the provider defaults. Properties: -- Config: auth_url -- Env Var: RCLONE_DRIVE_AUTH_URL -- Type: string -- Required: false +- Config: batch_size +- Env Var: RCLONE_GPHOTOS_BATCH_SIZE +- Type: int +- Default: 0 + +#### --gphotos-batch-timeout + +Max time to allow an idle upload batch before uploading. + +If an upload batch is idle for more than this long then it will be +uploaded. + +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. + +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 1s +- batch_mode: off - not in use -#### --drive-token-url -Token server url. +Properties: -Leave blank to use the provider defaults. +- Config: batch_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT +- Type: Duration +- Default: 0s + +#### --gphotos-batch-commit-timeout + +Max time to wait for a batch to finish committing Properties: -- Config: token_url -- Env Var: RCLONE_DRIVE_TOKEN_URL -- Type: string -- Required: false +- Config: batch_commit_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s -#### --drive-root-folder-id -ID of the root folder. -Leave blank normally. -Fill in to access "Computers" folders (see docs), or for rclone to use -a non root folder as its starting point. +## Limitations +Only images and videos can be uploaded. If you attempt to upload non +videos or images or formats that Google Photos doesn't understand, +rclone will upload the file, then Google Photos will give an error +when it is put turned into a media item. -Properties: +Note that all media items uploaded to Google Photos through the API +are stored in full resolution at "original quality" and **will** count +towards your storage quota in your Google Account. The API does +**not** offer a way to upload in "high quality" mode.. -- Config: root_folder_id -- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID -- Type: string -- Required: false +`rclone about` is not supported by the Google Photos backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -#### --drive-service-account-credentials +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) +See [rclone about](https://rclone.org/commands/rclone_about/) -Service Account Credentials JSON blob. +### Downloading Images -Leave blank normally. -Needed only if you want use SA instead of interactive login. +When Images are downloaded this strips EXIF location (according to the +docs and my tests). This is a limitation of the Google Photos API and +is covered by [bug #112096115](https://issuetracker.google.com/issues/112096115). -Properties: +**The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort** -- Config: service_account_credentials -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS -- Type: string -- Required: false +### Downloading Videos -#### --drive-team-drive +When videos are downloaded they are downloaded in a really compressed +version of the video compared to downloading it via the Google Photos +web interface. This is covered by [bug #113672044](https://issuetracker.google.com/issues/113672044). -ID of the Shared Drive (Team Drive). +### Duplicates -Properties: +If a file name is duplicated in a directory then rclone will add the +file ID into its name. So two files called `file.jpg` would then +appear as `file {123456}.jpg` and `file {ABCDEF}.jpg` (the actual IDs +are a lot longer alas!). -- Config: team_drive -- Env Var: RCLONE_DRIVE_TEAM_DRIVE -- Type: string -- Required: false +If you upload the same image (with the same binary data) twice then +Google Photos will deduplicate it. However it will retain the +filename from the first upload which may confuse rclone. For example +if you uploaded an image to `upload` then uploaded the same image to +`album/my_album` the filename of the image in `album/my_album` will be +what it was uploaded with initially, not what you uploaded it with to +`album`. In practise this shouldn't cause too many problems. -#### --drive-auth-owner-only +### Modification times -Only consider files owned by the authenticated user. +The date shown of media in Google Photos is the creation date as +determined by the EXIF information, or the upload date if that is not +known. -Properties: +This is not changeable by rclone and is not the modification date of +the media on local disk. This means that rclone cannot use the dates +from Google Photos for syncing purposes. -- Config: auth_owner_only -- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY -- Type: bool -- Default: false +### Size -#### --drive-use-trash +The Google Photos API does not return the size of media. This means +that when syncing to Google Photos, rclone can only do a file +existence check. -Send files to the trash instead of deleting permanently. +It is possible to read the size of the media, but this needs an extra +HTTP HEAD request per media item so is **very slow** and uses up a lot of +transactions. This can be enabled with the `--gphotos-read-size` +option or the `read_size = true` config parameter. -Defaults to true, namely sending files to the trash. -Use `--drive-use-trash=false` to delete files permanently instead. +If you want to use the backend with `rclone mount` you may need to +enable this flag (depending on your OS and application using the +photos) otherwise you may not be able to read media off the mount. +You'll need to experiment to see if it works for you without the flag. -Properties: +### Albums -- Config: use_trash -- Env Var: RCLONE_DRIVE_USE_TRASH -- Type: bool -- Default: true +Rclone can only upload files to albums it created. This is a +[limitation of the Google Photos API](https://developers.google.com/photos/library/guides/manage-albums). -#### --drive-copy-shortcut-content +Rclone can remove files it uploaded from albums it created only. -Server side copy contents of shortcuts instead of the shortcut. +### Deleting files -When doing server side copies, normally rclone will copy shortcuts as -shortcuts. +Rclone can remove files from albums it created, but note that the +Google Photos API does not allow media to be deleted permanently so +this media will still remain. See [bug #109759781](https://issuetracker.google.com/issues/109759781). -If this flag is used then rclone will copy the contents of shortcuts -rather than shortcuts themselves when doing server side copies. +Rclone cannot delete files anywhere except under `album`. -Properties: +### Deleting albums -- Config: copy_shortcut_content -- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT -- Type: bool -- Default: false +The Google Photos API does not support deleting albums - see [bug #135714733](https://issuetracker.google.com/issues/135714733). -#### --drive-skip-gdocs +# Hasher -Skip google documents in all listings. +Hasher is a special overlay backend to create remotes which handle +checksums for other remotes. It's main functions include: +- Emulate hash types unimplemented by backends +- Cache checksums to help with slow hashing of large local or (S)FTP files +- Warm up checksum cache from external SUM files -If given, gdocs practically become invisible to rclone. +## Getting started -Properties: +To use Hasher, first set up the underlying remote following the configuration +instructions for that remote. You can also use a local pathname instead of +a remote. Check that your base remote is working. -- Config: skip_gdocs -- Env Var: RCLONE_DRIVE_SKIP_GDOCS -- Type: bool -- Default: false +Let's call the base remote `myRemote:path` here. Note that anything inside +`myRemote:path` will be handled by hasher and anything outside won't. +This means that if you are using a bucket based remote (S3, B2, Swift) +then you should put the bucket in the remote `s3:bucket`. -#### --drive-skip-checksum-gphotos +Now proceed to interactive or manual configuration. -Skip MD5 checksum on Google photos and videos only. +### Interactive configuration -Use this if you get checksum errors when transferring Google photos or -videos. +Run `rclone config`: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> Hasher1 +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Handle checksums for other remotes + \ "hasher" +[snip] +Storage> hasher +Remote to cache checksums for, like myremote:mypath. +Enter a string value. Press Enter for the default (""). +remote> myRemote:path +Comma separated list of supported checksum types. +Enter a string value. Press Enter for the default ("md5,sha1"). +hashsums> md5 +Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. +max_age> off +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[Hasher1] +type = hasher +remote = myRemote:path +hashsums = md5 +max_age = off +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Setting this flag will cause Google photos and videos to return a -blank MD5 checksum. +### Manual configuration -Google photos are identified by being in the "photos" space. +Run `rclone config path` to see the path of current active config file, +usually `YOURHOME/.config/rclone/rclone.conf`. +Open it in your favorite text editor, find section for the base remote +and create new section for hasher like in the following examples: -Corrupted checksums are caused by Google modifying the image/video but -not updating the checksum. +``` +[Hasher1] +type = hasher +remote = myRemote:path +hashes = md5 +max_age = off -Properties: +[Hasher2] +type = hasher +remote = /local/path +hashes = dropbox,sha1 +max_age = 24h +``` -- Config: skip_checksum_gphotos -- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS -- Type: bool -- Default: false +Hasher takes basically the following parameters: +- `remote` is required, +- `hashes` is a comma separated list of supported checksums + (by default `md5,sha1`), +- `max_age` - maximum time to keep a checksum value in the cache, + `0` will disable caching completely, + `off` will cache "forever" (that is until the files get changed). -#### --drive-shared-with-me +Make sure the `remote` has `:` (colon) in. If you specify the remote without +a colon then rclone will use a local directory of that name. So if you use +a remote of `/local/path` then rclone will handle hashes for that directory. +If you use `remote = name` literally then rclone will put files +**in a directory called `name` located under current directory**. -Only show files that are shared with me. +## Usage -Instructs rclone to operate on your "Shared with me" folder (where -Google Drive lets you access the files and folders others have shared -with you). +### Basic operations -This works both with the "list" (lsd, lsl, etc.) and the "copy" -commands (copy, sync, etc.), and with all other commands too. +Now you can use it as `Hasher2:subdir/file` instead of base remote. +Hasher will transparently update cache with new checksums when a file +is fully read or overwritten, like: +``` +rclone copy External:path/file Hasher:dest/path -Properties: +rclone cat Hasher:path/to/file > /dev/null +``` -- Config: shared_with_me -- Env Var: RCLONE_DRIVE_SHARED_WITH_ME -- Type: bool -- Default: false +The way to refresh **all** cached checksums (even unsupported by the base backend) +for a subtree is to **re-download** all files in the subtree. For example, +use `hashsum --download` using **any** supported hashsum on the command line +(we just care to re-read): +``` +rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null -#### --drive-trashed-only +rclone backend dump Hasher:path/to/subtree +``` -Only show files that are in the trash. +You can print or drop hashsum cache using custom backend commands: +``` +rclone backend dump Hasher:dir/subdir -This will show trashed files in their original directory structure. +rclone backend drop Hasher: +``` -Properties: +### Pre-Seed from a SUM File -- Config: trashed_only -- Env Var: RCLONE_DRIVE_TRASHED_ONLY -- Type: bool -- Default: false +Hasher supports two backend commands: generic SUM file `import` and faster +but less consistent `stickyimport`. -#### --drive-starred-only +``` +rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4] +``` -Only show files that are starred. +Instead of SHA1 it can be any hash supported by the remote. The last argument +can point to either a local or an `other-remote:path` text file in SUM format. +The command will parse the SUM file, then walk down the path given by the +first argument, snapshot current fingerprints and fill in the cache entries +correspondingly. +- Paths in the SUM file are treated as relative to `hasher:dir/subdir`. +- The command will **not** check that supplied values are correct. + You **must know** what you are doing. +- This is a one-time action. The SUM file will not get "attached" to the + remote. Cache entries can still be overwritten later, should the object's + fingerprint change. +- The tree walk can take long depending on the tree size. You can increase + `--checkers` to make it faster. Or use `stickyimport` if you don't care + about fingerprints and consistency. -Properties: +``` +rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1 +``` -- Config: starred_only -- Env Var: RCLONE_DRIVE_STARRED_ONLY -- Type: bool -- Default: false +`stickyimport` is similar to `import` but works much faster because it +does not need to stat existing files and skips initial tree walk. +Instead of binding cache entries to file fingerprints it creates _sticky_ +entries bound to the file name alone ignoring size, modification time etc. +Such hash entries can be replaced only by `purge`, `delete`, `backend drop` +or by full re-read/re-write of the files. -#### --drive-formats +## Configuration reference -Deprecated: See export_formats. -Properties: +### Standard options -- Config: formats -- Env Var: RCLONE_DRIVE_FORMATS -- Type: string -- Required: false +Here are the Standard options specific to hasher (Better checksums for other remotes). -#### --drive-export-formats +#### --hasher-remote -Comma separated list of preferred formats for downloading Google docs. +Remote to cache checksums for (e.g. myRemote:path). Properties: -- Config: export_formats -- Env Var: RCLONE_DRIVE_EXPORT_FORMATS +- Config: remote +- Env Var: RCLONE_HASHER_REMOTE - Type: string -- Default: "docx,xlsx,pptx,svg" +- Required: true -#### --drive-import-formats +#### --hasher-hashes -Comma separated list of preferred formats for uploading Google docs. +Comma separated list of supported checksum types. Properties: -- Config: import_formats -- Env Var: RCLONE_DRIVE_IMPORT_FORMATS -- Type: string -- Required: false - -#### --drive-allow-import-name-change +- Config: hashes +- Env Var: RCLONE_HASHER_HASHES +- Type: CommaSepList +- Default: md5,sha1 -Allow the filetype to change when uploading Google docs. +#### --hasher-max-age -E.g. file.doc to file.docx. This will confuse sync and reupload every time. +Maximum time to keep checksums in cache (0 = no cache, off = cache forever). Properties: -- Config: allow_import_name_change -- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE -- Type: bool -- Default: false +- Config: max_age +- Env Var: RCLONE_HASHER_MAX_AGE +- Type: Duration +- Default: off -#### --drive-use-created-date +### Advanced options -Use file created date instead of modified date. +Here are the Advanced options specific to hasher (Better checksums for other remotes). -Useful when downloading data and you want the creation date used in -place of the last modified date. +#### --hasher-auto-size -**WARNING**: This flag may have some unexpected consequences. +Auto-update checksum for files smaller than this size (disabled by default). -When uploading to your drive all files will be overwritten unless they -haven't been modified since their creation. And the inverse will occur -while downloading. This side effect can be avoided by using the -"--checksum" flag. +Properties: -This feature was implemented to retain photos capture date as recorded -by google photos. You will first need to check the "Create a Google -Photos folder" option in your google drive settings. You can then copy -or move the photos locally and use the date the image was taken -(created) set as the modification date. +- Config: auto_size +- Env Var: RCLONE_HASHER_AUTO_SIZE +- Type: SizeSuffix +- Default: 0 -Properties: +### Metadata -- Config: use_created_date -- Env Var: RCLONE_DRIVE_USE_CREATED_DATE -- Type: bool -- Default: false +Any metadata supported by the underlying remote is read and written. -#### --drive-use-shared-date +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -Use date file was shared instead of modified date. +## Backend commands -Note that, as with "--drive-use-created-date", this flag may have -unexpected consequences when uploading/downloading files. +Here are the commands specific to the hasher backend. -If both this flag and "--drive-use-created-date" are set, the created -date is used. +Run them with -Properties: + rclone backend COMMAND remote: -- Config: use_shared_date -- Env Var: RCLONE_DRIVE_USE_SHARED_DATE -- Type: bool -- Default: false +The help below will explain what arguments each command takes. -#### --drive-list-chunk +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -Size of listing chunk 100-1000, 0 to disable. +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -Properties: +### drop -- Config: list_chunk -- Env Var: RCLONE_DRIVE_LIST_CHUNK -- Type: int -- Default: 1000 +Drop cache -#### --drive-impersonate + rclone backend drop remote: [options] [+] -Impersonate this user when using a service account. +Completely drop checksum cache. +Usage Example: + rclone backend drop hasher: -Properties: -- Config: impersonate -- Env Var: RCLONE_DRIVE_IMPERSONATE -- Type: string -- Required: false +### dump -#### --drive-upload-cutoff +Dump the database -Cutoff for switching to chunked upload. + rclone backend dump remote: [options] [+] -Properties: +Dump cache records covered by the current remote -- Config: upload_cutoff -- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 8Mi +### fulldump -#### --drive-chunk-size +Full dump of the database -Upload chunk size. + rclone backend fulldump remote: [options] [+] -Must a power of 2 >= 256k. +Dump all cache records in the database -Making this larger will improve performance, but note that each chunk -is buffered in memory one per transfer. +### import -Reducing this will reduce memory usage but decrease performance. +Import a SUM file -Properties: + rclone backend import remote: [options] [+] -- Config: chunk_size -- Env Var: RCLONE_DRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 8Mi +Amend hash cache from a SUM file and bind checksums to files by size/time. +Usage Example: + rclone backend import hasher:subdir md5 /path/to/sum.md5 -#### --drive-acknowledge-abuse -Set to allow files which return cannotDownloadAbusiveFile to be downloaded. +### stickyimport -If downloading a file returns the error "This file has been identified -as malware or spam and cannot be downloaded" with the error code -"cannotDownloadAbusiveFile" then supply this flag to rclone to -indicate you acknowledge the risks of downloading the file and rclone -will download it anyway. +Perform fast import of a SUM file -Note that if you are using service account it will need Manager -permission (not Content Manager) to for this flag to work. If the SA -does not have the right permission, Google will just ignore the flag. + rclone backend stickyimport remote: [options] [+] -Properties: +Fill hash cache from a SUM file without verifying file fingerprints. +Usage Example: + rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 -- Config: acknowledge_abuse -- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE -- Type: bool -- Default: false -#### --drive-keep-revision-forever -Keep new head revision of each file forever. -Properties: +## Implementation details (advanced) -- Config: keep_revision_forever -- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER -- Type: bool -- Default: false +This section explains how various rclone operations work on a hasher remote. -#### --drive-size-as-quota +**Disclaimer. This section describes current implementation which can +change in future rclone versions!.** -Show sizes as storage quota usage, not actual size. +### Hashsum command + +The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: + +1. if requested hash is supported by lower level, just pass it. +2. if object size is below `auto_size` then download object and calculate + _requested_ hashes on the fly. +3. if unsupported and the size is big enough, build object `fingerprint` + (including size, modtime if supported, first-found _other_ hash if any). +4. if the strict match is found in cache for the requested remote, return + the stored hash. +5. if remote found but fingerprint mismatched, then purge the entry and + proceed to step 6. +6. if remote not found or had no requested hash type or after step 5: + download object, calculate all _supported_ hashes on the fly and store + in cache; return requested hash. -Show the size of a file as the storage quota used. This is the -current version plus any older versions that have been set to keep -forever. +### Other operations -**WARNING**: This flag may have some unexpected consequences. +- whenever a file is uploaded or downloaded **in full**, capture the stream + to calculate all supported hashes on the fly and update database +- server-side `move` will update keys of existing cache entries +- `deletefile` will remove a single cache entry +- `purge` will remove all cache entries under the purged path -It is not recommended to set this flag in your config - the -recommended usage is using the flag form --drive-size-as-quota when -doing rclone ls/lsl/lsf/lsjson/etc only. +Note that setting `max_age = 0` will disable checksum caching completely. -If you do use this flag for syncing (not recommended) then you will -need to use --ignore size also. +If you set `max_age = off`, checksums in cache will never age, unless you +fully rewrite or delete the file. -Properties: +### Cache storage -- Config: size_as_quota -- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA -- Type: bool -- Default: false +Cached checksums are stored as `bolt` database files under rclone cache +directory, usually `~/.cache/rclone/kv/`. Databases are maintained +one per _base_ backend, named like `BaseRemote~hasher.bolt`. +Checksums for multiple `alias`-es into a single base backend +will be stored in the single database. All local paths are treated as +aliases into the `local` backend (unless encrypted or chunked) and stored +in `~/.cache/rclone/kv/local~hasher.bolt`. +Databases can be shared between multiple rclone processes. -#### --drive-v2-download-min-size +# HDFS -If Object's are greater, use drive v2 API to download. +[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a +distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. -Properties: +Paths are specified as `remote:` or `remote:path/to/dir`. -- Config: v2_download_min_size -- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE -- Type: SizeSuffix -- Default: off +## Configuration -#### --drive-pacer-min-sleep +Here is an example of how to make a remote called `remote`. First run: -Minimum time to sleep between API calls. + rclone config -Properties: +This will guide you through an interactive setup process: -- Config: pacer_min_sleep -- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP -- Type: Duration -- Default: 100ms +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[skip] +XX / Hadoop distributed file system + \ "hdfs" +[skip] +Storage> hdfs +** See help for hdfs backend at: https://rclone.org/hdfs/ ** -#### --drive-pacer-burst +hadoop name node and port +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Connect to host namenode at port 8020 + \ "namenode:8020" +namenode> namenode.hadoop:8020 +hadoop user name +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Connect to hdfs as root + \ "root" +username> root +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[remote] +type = hdfs +namenode = namenode.hadoop:8020 +username = root +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -Number of API calls to allow without sleeping. +Name Type +==== ==== +hadoop hdfs -Properties: +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +``` -- Config: pacer_burst -- Env Var: RCLONE_DRIVE_PACER_BURST -- Type: int -- Default: 100 +This remote is called `remote` and can now be used like this -#### --drive-server-side-across-configs +See all the top level directories -Allow server-side operations (e.g. copy) to work across different drive configs. + rclone lsd remote: -This can be useful if you wish to do a server-side copy between two -different Google drives. Note that this isn't enabled by default -because it isn't easy to tell if it will work between any two -configurations. +List the contents of a directory -Properties: + rclone ls remote:directory -- Config: server_side_across_configs -- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false +Sync the remote `directory` to `/home/local/directory`, deleting any excess files. -#### --drive-disable-http2 + rclone sync --interactive remote:directory /home/local/directory -Disable drive using http2. +### Setting up your own HDFS instance for testing -There is currently an unsolved issue with the google drive backend and -HTTP/2. HTTP/2 is therefore disabled by default for the drive backend -but can be re-enabled here. When the issue is solved this flag will -be removed. +You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) +or use the docker image from the tests: -See: https://github.com/rclone/rclone/issues/3631 +If you want to build the docker image +``` +git clone https://github.com/rclone/rclone.git +cd rclone/fstest/testserver/images/test-hdfs +docker build --rm -t rclone/test-hdfs . +``` +Or you can just use the latest one pushed -Properties: +``` +docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs +``` -- Config: disable_http2 -- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 -- Type: bool -- Default: true +**NB** it need few seconds to startup. -#### --drive-stop-on-upload-limit +For this docker image the remote needs to be configured like this: -Make upload limit errors be fatal. +``` +[remote] +type = hdfs +namenode = 127.0.0.1:8020 +username = root +``` -At the time of writing it is only possible to upload 750 GiB of data to -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop -the in-progress sync. +You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data +uploaded will be lost.) -Note that this detection is relying on error message strings which -Google don't document so it may break in the future. +### Modification times -See: https://github.com/rclone/rclone/issues/3857 +Time accurate to 1 second is stored. +### Checksum -Properties: +No checksums are implemented. -- Config: stop_on_upload_limit -- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT -- Type: bool -- Default: false +### Usage information -#### --drive-stop-on-download-limit +You can use the `rclone about remote:` command which will display filesystem size and current usage. -Make download limit errors be fatal. +### Restricted filename characters -At the time of writing it is only possible to download 10 TiB of data from -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop -the in-progress sync. +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Note that this detection is relying on error message strings which -Google don't document so it may break in the future. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| : | 0x3A | : | +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). -Properties: -- Config: stop_on_download_limit -- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT -- Type: bool -- Default: false +### Standard options -#### --drive-skip-shortcuts +Here are the Standard options specific to hdfs (Hadoop distributed file system). -If set skip shortcut files. +#### --hdfs-namenode -Normally rclone dereferences shortcut files making them appear as if -they are the original file (see [the shortcuts section](#shortcuts)). -If this flag is set then rclone will ignore shortcut files completely. +Hadoop name nodes and ports. +E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020. Properties: -- Config: skip_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS -- Type: bool -- Default: false - -#### --drive-skip-dangling-shortcuts - -If set skip dangling shortcut files. +- Config: namenode +- Env Var: RCLONE_HDFS_NAMENODE +- Type: CommaSepList +- Default: -If this is set then rclone will not show any dangling shortcuts in listings. +#### --hdfs-username +Hadoop user name. Properties: -- Config: skip_dangling_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS -- Type: bool -- Default: false +- Config: username +- Env Var: RCLONE_HDFS_USERNAME +- Type: string +- Required: false +- Examples: + - "root" + - Connect to hdfs as root. -#### --drive-resource-key +### Advanced options -Resource key for accessing a link-shared file. +Here are the Advanced options specific to hdfs (Hadoop distributed file system). -If you need to access files shared with a link like this +#### --hdfs-service-principal-name - https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing +Kerberos service principal name for the namenode. -Then you will need to use the first part "XXX" as the "root_folder_id" -and the second part "YYY" as the "resource_key" otherwise you will get -404 not found errors when trying to access the directory. +Enables KERBEROS authentication. Specifies the Service Principal Name +(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" +for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. -See: https://developers.google.com/drive/api/guides/resource-keys +Properties: -This resource key requirement only applies to a subset of old files. +- Config: service_principal_name +- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME +- Type: string +- Required: false -Note also that opening the folder once in the web interface (with the -user you've authenticated rclone with) seems to be enough so that the -resource key is no needed. +#### --hdfs-data-transfer-protection + +Kerberos data transfer protection: authentication|integrity|privacy. +Specifies whether or not authentication, data signature integrity +checks, and wire encryption are required when communicating with +the datanodes. Possible values are 'authentication', 'integrity' +and 'privacy'. Used only with KERBEROS enabled. Properties: -- Config: resource_key -- Env Var: RCLONE_DRIVE_RESOURCE_KEY +- Config: data_transfer_protection +- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION - Type: string - Required: false +- Examples: + - "privacy" + - Ensure authentication, integrity and encryption enabled. -#### --drive-encoding +#### --hdfs-encoding The encoding for the backend. @@ -29906,1178 +35406,1016 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_DRIVE_ENCODING -- Type: MultiEncoder -- Default: InvalidUtf8 - -## Backend commands - -Here are the commands specific to the drive backend. - -Run them with +- Env Var: RCLONE_HDFS_ENCODING +- Type: Encoding +- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot - rclone backend COMMAND remote: -The help below will explain what arguments each command takes. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +## Limitations -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +- No server-side `Move` or `DirMove`. +- Checksums not implemented. -### get +# HiDrive -Get command for fetching the drive config parameters +Paths are specified as `remote:path` - rclone backend get remote: [options] [+] +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -This is a get command which will be used to fetch the various drive config parameters +The initial setup for hidrive involves getting a token from HiDrive +which you need to do in your browser. +`rclone config` walks you through it. -Usage Examples: +## Configuration - rclone backend get drive: [-o service_account_file] [-o chunk_size] - rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] +Here is an example of how to make a remote called `remote`. First run: + rclone config -Options: +This will guide you through an interactive setup process: -- "chunk_size": show the current upload chunk size -- "service_account_file": show the current service account file +``` +No remotes found - make a new one +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / HiDrive + \ "hidrive" +[snip] +Storage> hidrive +OAuth Client Id - Leave blank normally. +client_id> +OAuth Client Secret - Leave blank normally. +client_secret> +Access permissions that rclone should use when requesting access from HiDrive. +Leave blank normally. +scope_access> +Edit advanced config? +y/n> n +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx +Log in and authorize rclone for access +Waiting for code... +Got code +-------------------- +[remote] +type = hidrive +token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -### set +**You should be aware that OAuth-tokens can be used to access your account +and hence should not be shared with other persons.** +See the [below section](#keeping-your-tokens-safe) for more information. -Set command for updating the drive config parameters +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. - rclone backend set remote: [options] [+] +Note that rclone runs a webserver on your local machine to collect the +token as returned from HiDrive. This only runs from the moment it opens +your browser to the moment you get back the verification code. +The webserver runs on `http://127.0.0.1:53682/`. +If local port `53682` is protected by a firewall you may need to temporarily +unblock the firewall to complete authorization. -This is a set command which will be used to update the various drive config parameters +Once configured you can then use `rclone` like this, -Usage Examples: +List directories in top level of your HiDrive root folder - rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] - rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + rclone lsd remote: +List all the files in your HiDrive filesystem -Options: + rclone ls remote: -- "chunk_size": update the current upload chunk size -- "service_account_file": update the current service account file +To copy a local directory to a HiDrive directory called backup -### shortcut + rclone copy /home/source remote:backup -Create shortcuts from files or directories +### Keeping your tokens safe - rclone backend shortcut remote: [options] [+] +Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. +Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. +Therefore you should make sure no one else can access your configuration. -This command creates shortcuts from files or directories. +It is possible to encrypt rclone's configuration file. +You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). -Usage: +### Invalid refresh token - rclone backend shortcut drive: source_item destination_shortcut - rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut +As can be verified [here](https://developer.hidrive.com/basics-flows/), +each `refresh_token` (for Native Applications) is valid for 60 days. +If used to access HiDrivei, its validity will be automatically extended. -In the first example this creates a shortcut from the "source_item" -which can be a file or a directory to the "destination_shortcut". The -"source_item" and the "destination_shortcut" should be relative paths -from "drive:" +This means that if you -In the second example this creates a shortcut from the "source_item" -relative to "drive:" to the "destination_shortcut" relative to -"drive2:". This may fail with a permission error if the user -authenticated with "drive2:" can't read files from "drive:". + * Don't use the HiDrive remote for 60 days +then rclone will return an error which includes a text +that implies the refresh token is *invalid* or *expired*. -Options: +To fix this you will need to authorize rclone to access your HiDrive account again. -- "target": optional target remote for the shortcut destination +Using -### drives + rclone config reconnect remote: -List the Shared Drives available to this account +the process is very similar to the process of initial setup exemplified before. - rclone backend drives remote: [options] [+] +### Modification times and hashes -This command lists the Shared Drives (Team Drives) available to this -account. +HiDrive allows modification times to be set on objects accurate to 1 second. -Usage: +HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) +which is used to verify the integrity of file contents after successful transfers. - rclone backend [-o config] drives drive: +### Restricted filename characters -This will return a JSON list of objects like this +HiDrive cannot store files or folders that include +`/` (0x2F) or null-bytes (0x00) in their name. +Any other characters can be used in the names of files or folders. +Additionally, files or folders cannot be named either of the following: `.` or `..` - [ - { - "id": "0ABCDEF-01234567890", - "kind": "drive#teamDrive", - "name": "My Drive" - }, - { - "id": "0ABCDEFabcdefghijkl", - "kind": "drive#teamDrive", - "name": "Test Drive" - } - ] +Therefore rclone will automatically replace these characters, +if files or folders are stored or accessed with such names. -With the -o config parameter it will output the list in a format -suitable for adding to a config file to make aliases for all the -drives found and a combined drive. +You can read about how this filename encoding works in general +[here](overview/#restricted-filenames). - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: +Keep in mind that HiDrive only supports file or folder names +with a length of 255 characters or less. - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: +### Transfers - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" +HiDrive limits file sizes per single request to a maximum of 2 GiB. +To allow storage of larger files and allow for better upload performance, +the hidrive backend will use a chunked transfer for files larger than 96 MiB. +Rclone will upload multiple parts/chunks of the file at the same time. +Chunks in the process of being uploaded are buffered in memory, +so you may want to restrict this behaviour on systems with limited resources. -Adding this to the rclone config file will cause those team drives to -be accessible with the aliases shown. Any illegal characters will be -substituted with "_" and duplicate names will have numbers suffixed. -It will also add a remote called AllDrives which shows all the shared -drives combined into one directory tree. +You can customize this behaviour using the following options: +* `chunk_size`: size of file parts +* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer +* `upload_concurrency`: number of file-parts to upload at the same time -### untrash +See the below section about configuration options for more details. -Untrash files and directories +### Root folder - rclone backend untrash remote: [options] [+] +You can set the root folder for rclone. +This is the directory that rclone considers to be the root of your HiDrive. -This command untrashes all the files and directories in the directory -passed in recursively. +Usually, you will leave this blank, and rclone will use the root of the account. -Usage: +However, you can set this to restrict rclone to a specific folder hierarchy. -This takes an optional directory to trash which make this easier to -use via the API. +This works by prepending the contents of the `root_prefix` option +to any paths accessed by rclone. +For example, the following two ways to access the home directory are equivalent: - rclone backend untrash drive:directory - rclone backend --interactive untrash drive:directory subdir + rclone lsd --hidrive-root-prefix="/users/test/" remote:path -Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. + rclone lsd remote:/users/test/path -Result: +See the below section about configuration options for more details. - { - "Untrashed": 17, - "Errors": 0 - } +### Directory member count +By default, rclone will know the number of directory members contained in a directory. +For example, `rclone lsd` uses this information. -### copyid +The acquisition of this information will result in additional time costs for HiDrive's API. +When dealing with large directory structures, it may be desirable to circumvent this time cost, +especially when this information is not explicitly needed. +For this, the `disable_fetching_member_count` option can be used. -Copy files by ID +See the below section about configuration options for more details. - rclone backend copyid remote: [options] [+] -This command copies files by ID +### Standard options -Usage: +Here are the Standard options specific to hidrive (HiDrive). - rclone backend copyid drive: ID path - rclone backend copyid drive: ID1 path1 ID2 path2 +#### --hidrive-client-id -It copies the drive file with ID given to the path (an rclone path which -will be passed internally to rclone copyto). The ID and path pairs can be -repeated. +OAuth Client Id. -The path should end with a / to indicate copy the file as named to -this directory. If it doesn't end with a / then the last path -component will be used as the file name. +Leave blank normally. -If the destination is a drive backend then server-side copying will be -attempted if possible. +Properties: -Use the --interactive/-i or --dry-run flag to see what would be copied before copying. +- Config: client_id +- Env Var: RCLONE_HIDRIVE_CLIENT_ID +- Type: string +- Required: false +#### --hidrive-client-secret -### exportformats +OAuth Client Secret. -Dump the export formats for debug purposes +Leave blank normally. - rclone backend exportformats remote: [options] [+] +Properties: -### importformats +- Config: client_secret +- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET +- Type: string +- Required: false -Dump the import formats for debug purposes +#### --hidrive-scope-access - rclone backend importformats remote: [options] [+] +Access permissions that rclone should use when requesting access from HiDrive. +Properties: +- Config: scope_access +- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS +- Type: string +- Default: "rw" +- Examples: + - "rw" + - Read and write access to resources. + - "ro" + - Read-only access to resources. -## Limitations +### Advanced options -Drive has quite a lot of rate limiting. This causes rclone to be -limited to transferring about 2 files per second only. Individual -files may be transferred much faster at 100s of MiB/s but lots of -small files can take a long time. +Here are the Advanced options specific to hidrive (HiDrive). -Server side copies are also subject to a separate rate limit. If you -see User rate limit exceeded errors, wait at least 24 hours and retry. -You can disable server-side copies with `--disable copy` to download -and upload the files if you prefer. +#### --hidrive-token -### Limitations of Google Docs +OAuth Access Token as a JSON blob. -Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, -and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` -and `rclone serve`. When calculating directory totals, e.g. in -`rclone size` and `rclone ncdu`, they will be counted in as empty -files. +Properties: -This is because rclone can't find out the size of the Google docs -without downloading them. +- Config: token +- Env Var: RCLONE_HIDRIVE_TOKEN +- Type: string +- Required: false -Google docs will transfer correctly with `rclone sync`, `rclone copy` -etc as rclone knows to ignore the size when doing the transfer. +#### --hidrive-auth-url -However an unfortunate consequence of this is that you may not be able -to download Google docs using `rclone mount`. If it doesn't work you -will get a 0 sized file. If you try again the doc may gain its -correct size and be downloadable. Whether it will work on not depends -on the application accessing the mount and the OS you are running - -experiment to find out if it does work for you! +Auth server URL. -### Duplicated files +Leave blank to use the provider defaults. -Sometimes, for no reason I've been able to track down, drive will -duplicate a file that rclone uploads. Drive unlike all the other -remotes can have duplicated files. +Properties: -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +- Config: auth_url +- Env Var: RCLONE_HIDRIVE_AUTH_URL +- Type: string +- Required: false -Use `rclone dedupe` to fix duplicated files. +#### --hidrive-token-url -Note that this isn't just a problem with rclone, even Google Photos on -Android duplicates files on drive sometimes. +Token server url. -### Rclone appears to be re-copying files it shouldn't +Leave blank to use the provider defaults. -The most likely cause of this is the duplicated file issue above - run -`rclone dedupe` and check your logs for duplicate object or directory -messages. +Properties: -This can also be caused by a delay/caching on google drive's end when -comparing directory listings. Specifically with team drives used in -combination with --fast-list. Files that were uploaded recently may -not appear on the directory list sent to rclone when using --fast-list. +- Config: token_url +- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Type: string +- Required: false -Waiting a moderate period of time between attempts (estimated to be -approximately 1 hour) and/or not using --fast-list both seem to be -effective in preventing the problem. +#### --hidrive-scope-role -## Making your own client_id +User-level that rclone should use when requesting access from HiDrive. -When you use rclone with Google drive in its default configuration you -are using rclone's client_id. This is shared between all the rclone -users. There is a global rate limit on the number of queries per -second that each client_id can do set by Google. rclone already has a -high quota and I will continue to make sure it is high enough by -contacting Google. +Properties: -It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. +- Config: scope_role +- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE +- Type: string +- Default: "user" +- Examples: + - "user" + - User-level access to management permissions. + - This will be sufficient in most cases. + - "admin" + - Extensive access to management permissions. + - "owner" + - Full access to management permissions. -Here is how to create your own Google Drive client ID for rclone: +#### --hidrive-root-prefix -1. Log into the [Google API -Console](https://console.developers.google.com/) with your Google -account. It doesn't matter what Google account you use. (It need not -be the same account as the Google Drive you want to access) +The root/parent folder for all paths. -2. Select a project or create a new project. +Fill in to use the specified folder as the parent for all paths given to the remote. +This way rclone can use any folder as its starting point. -3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the -"Google Drive API". +Properties: -4. Click "Credentials" in the left-side panel (not "Create -credentials", which opens the wizard), then "Create credentials" +- Config: root_prefix +- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX +- Type: string +- Default: "/" +- Examples: + - "/" + - The topmost directory accessible by rclone. + - This will be equivalent with "root" if rclone uses a regular HiDrive user account. + - "root" + - The topmost directory of the HiDrive user account + - "" + - This specifies that there is no root-prefix for your paths. + - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". -5. If you already configured an "Oauth Consent Screen", then skip -to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button -(near the top right corner of the right panel), then select "External" -and click on "CREATE"; on the next screen, enter an "Application name" -("rclone" is OK); enter "User Support Email" (your own email is OK); -enter "Developer Contact Email" (your own email is OK); then click on -"Save" (all other data is optional). You will also have to add some scopes, -including `.../auth/docs` and `.../auth/drive` in order to be able to edit, -create and delete files with RClone. You may also want to include the -`../auth/drive.metadata.readonly` scope. After adding scopes, click -"Save and continue" to add test users. Be sure to add your own account to -the test users. Once you've added yourself as a test user and saved the -changes, click again on "Credentials" on the left panel to go back to -the "Credentials" screen. +#### --hidrive-endpoint - (PS: if you are a GSuite user, you could also select "Internal" instead -of "External" above, but this will restrict API use to Google Workspace -users in your organisation). +Endpoint for the service. -6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, -then select "OAuth client ID". +This is the URL that API-calls will be made to. -7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) +Properties: -8. It will show you a client ID and client secret. Make a note of these. - - (If you selected "External" at Step 5 continue to Step 9. - If you chose "Internal" you don't need to publish and can skip straight to - Step 10 but your destination drive must be part of the same Google Workspace.) +- Config: endpoint +- Env Var: RCLONE_HIDRIVE_ENDPOINT +- Type: string +- Default: "https://api.hidrive.strato.com/2.1" -9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. - You will also want to add yourself as a test user. +#### --hidrive-disable-fetching-member-count -10. Provide the noted client ID and client secret to rclone. +Do not fetch number of objects in directories unless it is absolutely necessary. -Be aware that, due to the "enhanced security" recently introduced by -Google, you are theoretically expected to "submit your app for verification" -and then wait a few weeks(!) for their response; in practice, you can go right -ahead and use the client ID and client secret with rclone, the only issue will -be a very scary confirmation screen shown when you connect via your browser -for rclone to be able to get its token-id (but as this only happens during -the remote configuration, it's not such a big deal). Keeping the application in -"Testing" will work as well, but the limitation is that any grants will expire -after a week, which can be annoying to refresh constantly. If, for whatever -reason, a short grant time is not a problem, then keeping the application in -testing mode would also be sufficient. +Requests may be faster if the number of objects in subdirectories is not fetched. -(Thanks to @balazer on github for these instructions.) +Properties: -Sometimes, creation of an OAuth consent in Google API Console fails due to an error message -“The request failed because changes to one of the field of the resource is not supported”. -As a convenient workaround, the necessary Google Drive API key can be created on the -[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. -Just push the Enable the Drive API button to receive the Client ID and Secret. -Note that it will automatically create a new project in the API Console. +- Config: disable_fetching_member_count +- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT +- Type: bool +- Default: false -# Google Photos +#### --hidrive-chunk-size -The rclone backend for [Google Photos](https://www.google.com/photos/about/) is -a specialized backend for transferring photos and videos to and from -Google Photos. +Chunksize for chunked uploads. -**NB** The Google Photos API which rclone uses has quite a few -limitations, so please read the [limitations section](#limitations) -carefully to make sure it is suitable for your use. +Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. -## Configuration +The upper limit for this is 2147483647 bytes (about 2.000Gi). +That is the maximum amount of bytes a single upload-operation will support. +Setting this above the upper limit or to a negative value will cause uploads to fail. -The initial setup for google cloud storage involves getting a token from Google Photos -which you need to do in your browser. `rclone config` walks you -through it. +Setting this to larger values may increase the upload speed at the cost of using more memory. +It can be set to smaller values smaller to save on memory. -Here is an example of how to make a remote called `remote`. First run: +Properties: - rclone config +- Config: chunk_size +- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 48Mi -This will guide you through an interactive setup process: +#### --hidrive-upload-cutoff -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Google Photos - \ "google photos" -[snip] -Storage> google photos -** See help for google photos backend at: https://rclone.org/googlephotos/ ** +Cutoff/Threshold for chunked uploads. -Google Application Client Id -Leave blank normally. -Enter a string value. Press Enter for the default (""). -client_id> -Google Application Client Secret -Leave blank normally. -Enter a string value. Press Enter for the default (""). -client_secret> -Set to make the Google Photos backend read only. +Any files larger than this will be uploaded in chunks of the configured chunksize. -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. -Enter a boolean value (true or false). Press Enter for the default ("false"). -read_only> -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth -Log in and authorize rclone for access -Waiting for code... -Got code +The upper limit for this is 2147483647 bytes (about 2.000Gi). +That is the maximum amount of bytes a single upload-operation will support. +Setting this above the upper limit will cause uploads to fail. -*** IMPORTANT: All media items uploaded to Google Photos with rclone -*** are stored in full resolution at original quality. These uploads -*** will count towards storage in your Google Account. +Properties: --------------------- -[remote] -type = google photos -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: upload_cutoff +- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 96Mi -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +#### --hidrive-upload-concurrency -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and this -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +Concurrency for chunked uploads. -This remote is called `remote` and can now be used like this +This is the upper limit for how many transfers for the same file are running concurrently. +Setting this above to a value smaller than 1 will cause uploads to deadlock. -See all the albums in your photos +If you are uploading small numbers of large files over high-speed links +and these uploads do not fully utilize your bandwidth, then increasing +this may help to speed up the transfers. - rclone lsd remote:album +Properties: -Make a new album +- Config: upload_concurrency +- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 - rclone mkdir remote:album/newAlbum +#### --hidrive-encoding -List the contents of an album +The encoding for the backend. - rclone ls remote:album/newAlbum +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Sync `/home/local/images` to the Google Photos, removing any excess -files in the album. +Properties: - rclone sync --interactive /home/local/image remote:album/newAlbum +- Config: encoding +- Env Var: RCLONE_HIDRIVE_ENCODING +- Type: Encoding +- Default: Slash,Dot -### Layout -As Google Photos is not a general purpose cloud storage system, the -backend is laid out to help you navigate it. -The directories under `media` show different ways of categorizing the -media. Each file will appear multiple times. So if you want to make -a backup of your google photos you might choose to backup -`remote:media/by-month`. (**NB** `remote:media/by-day` is rather slow -at the moment so avoid for syncing.) +## Limitations -Note that all your photos and videos will appear somewhere under -`media`, but they may not appear under `album` unless you've put them -into albums. +### Symbolic links -``` -/ -- upload - - file1.jpg - - file2.jpg - - ... -- media - - all - - file1.jpg - - file2.jpg - - ... - - by-year - - 2000 - - file1.jpg - - ... - - 2001 - - file2.jpg - - ... - - ... - - by-month - - 2000 - - 2000-01 - - file1.jpg - - ... - - 2000-02 - - file2.jpg - - ... - - ... - - by-day - - 2000 - - 2000-01-01 - - file1.jpg - - ... - - 2000-01-02 - - file2.jpg - - ... - - ... -- album - - album name - - album name/sub -- shared-album - - album name - - album name/sub -- feature - - favorites - - file1.jpg - - file2.jpg -``` +HiDrive is able to store symbolic links (*symlinks*) by design, +for example, when unpacked from a zip archive. -There are two writable parts of the tree, the `upload` directory and -sub directories of the `album` directory. +There exists no direct mechanism to manage native symlinks in remotes. +As such this implementation has chosen to ignore any native symlinks present in the remote. +rclone will not be able to access or show any symlinks stored in the hidrive-remote. +This means symlinks cannot be individually removed, copied, or moved, +except when removing, copying, or moving the parent folder. -The `upload` directory is for uploading files you don't want to put -into albums. This will be empty to start with and will contain the -files you've uploaded for one rclone session only, becoming empty -again when you restart rclone. The use case for this would be if you -have a load of files you just want to once off dump into Google -Photos. For repeated syncing, uploading to `album` will work better. +*This does not affect the `.rclonelink`-files +that rclone uses to encode and store symbolic links.* -Directories within the `album` directory are also writeable and you -may create new directories (albums) under `album`. If you copy files -with a directory hierarchy in there then rclone will create albums -with the `/` character in them. For example if you do +### Sparse files - rclone copy /path/to/images remote:album/images +It is possible to store sparse files in HiDrive. -and the images directory contains +Note that copying a sparse file will expand the holes +into null-byte (0x00) regions that will then consume disk space. +Likewise, when downloading a sparse file, +the resulting file will have null-byte regions in the place of file holes. -``` -images - - file1.jpg - dir - file2.jpg - dir2 - dir3 - file3.jpg -``` +# HTTP -Then rclone will create the following albums with the following files in +The HTTP remote is a read only remote for reading files of a +webserver. The webserver should provide file listings which rclone +will read and turn into a remote. This has been tested with common +webservers such as Apache/Nginx/Caddy and will likely work with file +listings from most web servers. (If it doesn't then please file an +issue, or send a pull request!) -- images - - file1.jpg -- images/dir - - file2.jpg -- images/dir2/dir3 - - file3.jpg +Paths are specified as `remote:` or `remote:path`. -This means that you can use the `album` path pretty much like a normal -filesystem and it is a good target for repeated syncing. +The `remote:` represents the configured [url](#http-url), and any path following +it will be resolved relative to this url, according to the URL standard. This +means with remote url `https://beta.rclone.org/branch` and path `fix`, the +resolved URL will be `https://beta.rclone.org/branch/fix`, while with path +`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute +path is resolved from the root of the domain. -The `shared-album` directory shows albums shared with you or by you. -This is similar to the Sharing tab in the Google Photos web interface. +If the path following the `remote:` ends with `/` it will be assumed to point +to a directory. If the path does not end with `/`, then a HEAD request is sent +and the response used to decide if it it is treated as a file or a directory +(run with `-vv` to see details). When [--http-no-head](#http-no-head) is +specified, a path without ending `/` is always assumed to be a file. If rclone +incorrectly assumes the path is a file, the solution is to specify the path with +ending `/`. When you know the path is a directory, ending it with `/` is always +better as it avoids the initial HEAD request. +To just download a single file it is easier to use +[copyurl](https://rclone.org/commands/rclone_copyurl/). -### Standard options +## Configuration -Here are the Standard options specific to google photos (Google Photos). +Here is an example of how to make a remote called `remote`. First +run: -#### --gphotos-client-id + rclone config -OAuth Client Id. +This will guide you through an interactive setup process: -Leave blank normally. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / HTTP + \ "http" +[snip] +Storage> http +URL of http host to connect to +Choose a number from below, or type in your own value + 1 / Connect to example.com + \ "https://example.com" +url> https://beta.rclone.org +Remote config +-------------------- +[remote] +url = https://beta.rclone.org +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -Properties: +Name Type +==== ==== +remote http -- Config: client_id -- Env Var: RCLONE_GPHOTOS_CLIENT_ID -- Type: string -- Required: false +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +``` -#### --gphotos-client-secret +This remote is called `remote` and can now be used like this -OAuth Client Secret. +See all the top level directories -Leave blank normally. + rclone lsd remote: -Properties: +List the contents of a directory -- Config: client_secret -- Env Var: RCLONE_GPHOTOS_CLIENT_SECRET -- Type: string -- Required: false + rclone ls remote:directory -#### --gphotos-read-only +Sync the remote `directory` to `/home/local/directory`, deleting any excess files. -Set to make the Google Photos backend read only. + rclone sync --interactive remote:directory /home/local/directory -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. +### Read only -Properties: +This remote is read only - you can't upload files to an HTTP server. -- Config: read_only -- Env Var: RCLONE_GPHOTOS_READ_ONLY -- Type: bool -- Default: false +### Modification times -### Advanced options +Most HTTP servers store time accurate to 1 second. -Here are the Advanced options specific to google photos (Google Photos). +### Checksum -#### --gphotos-token +No checksums are stored. -OAuth Access Token as a JSON blob. +### Usage without a config file -Properties: +Since the http remote only has one config parameter it is easy to use +without a config file: -- Config: token -- Env Var: RCLONE_GPHOTOS_TOKEN -- Type: string -- Required: false + rclone lsd --http-url https://beta.rclone.org :http: -#### --gphotos-auth-url +or: -Auth server URL. + rclone lsd :http,url='https://beta.rclone.org': -Leave blank to use the provider defaults. -Properties: +### Standard options -- Config: auth_url -- Env Var: RCLONE_GPHOTOS_AUTH_URL -- Type: string -- Required: false +Here are the Standard options specific to http (HTTP). -#### --gphotos-token-url +#### --http-url -Token server url. +URL of HTTP host to connect to. -Leave blank to use the provider defaults. +E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. Properties: -- Config: token_url -- Env Var: RCLONE_GPHOTOS_TOKEN_URL +- Config: url +- Env Var: RCLONE_HTTP_URL - Type: string -- Required: false +- Required: true -#### --gphotos-read-size +### Advanced options -Set to read the size of media items. +Here are the Advanced options specific to http (HTTP). -Normally rclone does not read the size of media items since this takes -another transaction. This isn't necessary for syncing. However -rclone mount needs to know the size of files in advance of reading -them, so setting this flag when using rclone mount is recommended if -you want to read the media. +#### --http-headers -Properties: +Set HTTP headers for all transactions. -- Config: read_size -- Env Var: RCLONE_GPHOTOS_READ_SIZE -- Type: bool -- Default: false +Use this to set additional HTTP headers for all transactions. -#### --gphotos-start-year +The input format is comma separated list of key,value pairs. Standard +[CSV encoding](https://godoc.org/encoding/csv) may be used. -Year limits the photos to be downloaded to those which are uploaded after the given year. +For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. -Properties: +You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. -- Config: start_year -- Env Var: RCLONE_GPHOTOS_START_YEAR -- Type: int -- Default: 2000 +Properties: -#### --gphotos-include-archived +- Config: headers +- Env Var: RCLONE_HTTP_HEADERS +- Type: CommaSepList +- Default: -Also view and download archived media. +#### --http-no-slash -By default, rclone does not request archived media. Thus, when syncing, -archived media is not visible in directory listings or transferred. +Set this if the site doesn't end directories with /. -Note that media in albums is always visible and synced, no matter -their archive status. +Use this if your target website does not use / on the end of +directories. -With this flag, archived media are always visible in directory -listings and transferred. +A / on the end of a path is how rclone normally tells the difference +between files and directories. If this flag is set, then rclone will +treat all files with Content-Type: text/html as directories and read +URLs from them rather than downloading them. -Without this flag, archived media will not be visible in directory -listings and won't be transferred. +Note that this may cause rclone to confuse genuine HTML files with +directories. Properties: -- Config: include_archived -- Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED +- Config: no_slash +- Env Var: RCLONE_HTTP_NO_SLASH - Type: bool - Default: false -#### --gphotos-encoding - -The encoding for the backend. - -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +#### --http-no-head -Properties: +Don't use HEAD requests. -- Config: encoding -- Env Var: RCLONE_GPHOTOS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot +HEAD requests are mainly used to find file sizes in dir listing. +If your site is being very slow to load then you can try this option. +Normally rclone does a HEAD request for each potential file in a +directory listing to: +- find its size +- check it really exists +- check to see if it is a directory +If you set this option, rclone will not do the HEAD request. This will mean +that directory listings are much quicker, but rclone won't have the times or +sizes of any files, and some files that don't exist may be in the listing. -## Limitations +Properties: -Only images and videos can be uploaded. If you attempt to upload non -videos or images or formats that Google Photos doesn't understand, -rclone will upload the file, then Google Photos will give an error -when it is put turned into a media item. +- Config: no_head +- Env Var: RCLONE_HTTP_NO_HEAD +- Type: bool +- Default: false -Note that all media items uploaded to Google Photos through the API -are stored in full resolution at "original quality" and **will** count -towards your storage quota in your Google Account. The API does -**not** offer a way to upload in "high quality" mode.. +## Backend commands -`rclone about` is not supported by the Google Photos backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Here are the commands specific to the http backend. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) -See [rclone about](https://rclone.org/commands/rclone_about/) +Run them with -### Downloading Images + rclone backend COMMAND remote: -When Images are downloaded this strips EXIF location (according to the -docs and my tests). This is a limitation of the Google Photos API and -is covered by [bug #112096115](https://issuetracker.google.com/issues/112096115). +The help below will explain what arguments each command takes. -**The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort** +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -### Downloading Videos +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -When videos are downloaded they are downloaded in a really compressed -version of the video compared to downloading it via the Google Photos -web interface. This is covered by [bug #113672044](https://issuetracker.google.com/issues/113672044). +### set -### Duplicates +Set command for updating the config parameters. -If a file name is duplicated in a directory then rclone will add the -file ID into its name. So two files called `file.jpg` would then -appear as `file {123456}.jpg` and `file {ABCDEF}.jpg` (the actual IDs -are a lot longer alas!). + rclone backend set remote: [options] [+] -If you upload the same image (with the same binary data) twice then -Google Photos will deduplicate it. However it will retain the -filename from the first upload which may confuse rclone. For example -if you uploaded an image to `upload` then uploaded the same image to -`album/my_album` the filename of the image in `album/my_album` will be -what it was uploaded with initially, not what you uploaded it with to -`album`. In practise this shouldn't cause too many problems. +This set command can be used to update the config parameters +for a running http backend. -### Modified time +Usage Examples: -The date shown of media in Google Photos is the creation date as -determined by the EXIF information, or the upload date if that is not -known. + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com -This is not changeable by rclone and is not the modification date of -the media on local disk. This means that rclone cannot use the dates -from Google Photos for syncing purposes. +The option keys are named as they are in the config file. -### Size +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. -The Google Photos API does not return the size of media. This means -that when syncing to Google Photos, rclone can only do a file -existence check. +It doesn't return anything. -It is possible to read the size of the media, but this needs an extra -HTTP HEAD request per media item so is **very slow** and uses up a lot of -transactions. This can be enabled with the `--gphotos-read-size` -option or the `read_size = true` config parameter. -If you want to use the backend with `rclone mount` you may need to -enable this flag (depending on your OS and application using the -photos) otherwise you may not be able to read media off the mount. -You'll need to experiment to see if it works for you without the flag. -### Albums -Rclone can only upload files to albums it created. This is a -[limitation of the Google Photos API](https://developers.google.com/photos/library/guides/manage-albums). +## Limitations -Rclone can remove files it uploaded from albums it created only. +`rclone about` is not supported by the HTTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -### Deleting files +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Rclone can remove files from albums it created, but note that the -Google Photos API does not allow media to be deleted permanently so -this media will still remain. See [bug #109759781](https://issuetracker.google.com/issues/109759781). +# ImageKit +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. -Rclone cannot delete files anywhere except under `album`. +#### About ImageKit +[ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. -### Deleting albums -The Google Photos API does not support deleting albums - see [bug #135714733](https://issuetracker.google.com/issues/135714733). +#### Accounts & Pricing -# Hasher +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). -Hasher is a special overlay backend to create remotes which handle -checksums for other remotes. It's main functions include: -- Emulate hash types unimplemented by backends -- Cache checksums to help with slow hashing of large local or (S)FTP files -- Warm up checksum cache from external SUM files +## Configuration -## Getting started +Here is an example of making an imagekit configuration. -To use Hasher, first set up the underlying remote following the configuration -instructions for that remote. You can also use a local pathname instead of -a remote. Check that your base remote is working. +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. -Let's call the base remote `myRemote:path` here. Note that anything inside -`myRemote:path` will be handled by hasher and anything outside won't. -This means that if you are using a bucket based remote (S3, B2, Swift) -then you should put the bucket in the remote `s3:bucket`. +You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. -Now proceed to interactive or manual configuration. +Now run +``` +rclone config +``` -### Interactive configuration +This will guide you through an interactive setup process: -Run `rclone config`: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n -name> Hasher1 + +Enter the name for the new remote. +name> imagekit-media-library + +Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value +Choose a number from below, or type in your own value. [snip] -XX / Handle checksums for other remotes - \ "hasher" +XX / ImageKit.io +\ (imagekit) [snip] -Storage> hasher -Remote to cache checksums for, like myremote:mypath. -Enter a string value. Press Enter for the default (""). -remote> myRemote:path -Comma separated list of supported checksum types. -Enter a string value. Press Enter for the default ("md5,sha1"). -hashsums> md5 -Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. -max_age> off -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config --------------------- -[Hasher1] -type = hasher -remote = myRemote:path -hashsums = md5 -max_age = off --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` - -### Manual configuration - -Run `rclone config path` to see the path of current active config file, -usually `YOURHOME/.config/rclone/rclone.conf`. -Open it in your favorite text editor, find section for the base remote -and create new section for hasher like in the following examples: - -``` -[Hasher1] -type = hasher -remote = myRemote:path -hashes = md5 -max_age = off - -[Hasher2] -type = hasher -remote = /local/path -hashes = dropbox,sha1 -max_age = 24h -``` - -Hasher takes basically the following parameters: -- `remote` is required, -- `hashes` is a comma separated list of supported checksums - (by default `md5,sha1`), -- `max_age` - maximum time to keep a checksum value in the cache, - `0` will disable caching completely, - `off` will cache "forever" (that is until the files get changed). +Storage> imagekit + +Option endpoint. +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +endpoint> https://ik.imagekit.io/imagekit_id -Make sure the `remote` has `:` (colon) in. If you specify the remote without -a colon then rclone will use a local directory of that name. So if you use -a remote of `/local/path` then rclone will handle hashes for that directory. -If you use `remote = name` literally then rclone will put files -**in a directory called `name` located under current directory**. +Option public_key. +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +public_key> public_**************************** -## Usage +Option private_key. +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +private_key> private_**************************** -### Basic operations +Edit advanced config? +y) Yes +n) No (default) +y/n> n -Now you can use it as `Hasher2:subdir/file` instead of base remote. -Hasher will transparently update cache with new checksums when a file -is fully read or overwritten, like: -``` -rclone copy External:path/file Hasher:dest/path +Configuration complete. +Options: +- type: imagekit +- endpoint: https://ik.imagekit.io/imagekit_id +- public_key: public_**************************** +- private_key: private_**************************** -rclone cat Hasher:path/to/file > /dev/null +Keep this "imagekit-media-library" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y ``` - -The way to refresh **all** cached checksums (even unsupported by the base backend) -for a subtree is to **re-download** all files in the subtree. For example, -use `hashsum --download` using **any** supported hashsum on the command line -(we just care to re-read): +List directories in the top level of your Media Library ``` -rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null - -rclone backend dump Hasher:path/to/subtree +rclone lsd imagekit-media-library: ``` - -You can print or drop hashsum cache using custom backend commands: +Make a new directory. ``` -rclone backend dump Hasher:dir/subdir - -rclone backend drop Hasher: +rclone mkdir imagekit-media-library:directory ``` - -### Pre-Seed from a SUM File - -Hasher supports two backend commands: generic SUM file `import` and faster -but less consistent `stickyimport`. - +List the contents of a directory. ``` -rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4] +rclone ls imagekit-media-library:directory ``` -Instead of SHA1 it can be any hash supported by the remote. The last argument -can point to either a local or an `other-remote:path` text file in SUM format. -The command will parse the SUM file, then walk down the path given by the -first argument, snapshot current fingerprints and fill in the cache entries -correspondingly. -- Paths in the SUM file are treated as relative to `hasher:dir/subdir`. -- The command will **not** check that supplied values are correct. - You **must know** what you are doing. -- This is a one-time action. The SUM file will not get "attached" to the - remote. Cache entries can still be overwritten later, should the object's - fingerprint change. -- The tree walk can take long depending on the tree size. You can increase - `--checkers` to make it faster. Or use `stickyimport` if you don't care - about fingerprints and consistency. +### Modified time and hashes -``` -rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1 -``` +ImageKit does not support modification times or hashes yet. -`stickyimport` is similar to `import` but works much faster because it -does not need to stat existing files and skips initial tree walk. -Instead of binding cache entries to file fingerprints it creates _sticky_ -entries bound to the file name alone ignoring size, modification time etc. -Such hash entries can be replaced only by `purge`, `delete`, `backend drop` -or by full re-read/re-write of the files. +### Checksums -## Configuration reference +No checksums are supported. ### Standard options -Here are the Standard options specific to hasher (Better checksums for other remotes). +Here are the Standard options specific to imagekit (ImageKit.io). -#### --hasher-remote +#### --imagekit-endpoint -Remote to cache checksums for (e.g. myRemote:path). +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) Properties: -- Config: remote -- Env Var: RCLONE_HASHER_REMOTE +- Config: endpoint +- Env Var: RCLONE_IMAGEKIT_ENDPOINT - Type: string - Required: true -#### --hasher-hashes +#### --imagekit-public-key -Comma separated list of supported checksum types. +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) Properties: -- Config: hashes -- Env Var: RCLONE_HASHER_HASHES -- Type: CommaSepList -- Default: md5,sha1 +- Config: public_key +- Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY +- Type: string +- Required: true -#### --hasher-max-age +#### --imagekit-private-key -Maximum time to keep checksums in cache (0 = no cache, off = cache forever). +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) Properties: -- Config: max_age -- Env Var: RCLONE_HASHER_MAX_AGE -- Type: Duration -- Default: off +- Config: private_key +- Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY +- Type: string +- Required: true ### Advanced options -Here are the Advanced options specific to hasher (Better checksums for other remotes). +Here are the Advanced options specific to imagekit (ImageKit.io). -#### --hasher-auto-size +#### --imagekit-only-signed -Auto-update checksum for files smaller than this size (disabled by default). +If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true. Properties: -- Config: auto_size -- Env Var: RCLONE_HASHER_AUTO_SIZE -- Type: SizeSuffix -- Default: 0 - -### Metadata - -Any metadata supported by the underlying remote is read and written. - -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - -## Backend commands - -Here are the commands specific to the hasher backend. +- Config: only_signed +- Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED +- Type: bool +- Default: false -Run them with +#### --imagekit-versions - rclone backend COMMAND remote: +Include old versions in directory listings. -The help below will explain what arguments each command takes. +Properties: -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +- Config: versions +- Env Var: RCLONE_IMAGEKIT_VERSIONS +- Type: bool +- Default: false -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +#### --imagekit-upload-tags -### drop +Tags to add to the uploaded files, e.g. "tag1,tag2". -Drop cache +Properties: - rclone backend drop remote: [options] [+] +- Config: upload_tags +- Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS +- Type: string +- Required: false -Completely drop checksum cache. -Usage Example: - rclone backend drop hasher: +#### --imagekit-encoding +The encoding for the backend. -### dump +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Dump the database +Properties: - rclone backend dump remote: [options] [+] +- Config: encoding +- Env Var: RCLONE_IMAGEKIT_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket -Dump cache records covered by the current remote +### Metadata -### fulldump +Any metadata supported by the underlying remote is read and written. -Full dump of the database +Here are the possible system metadata items for the imagekit backend. - rclone backend fulldump remote: [options] [+] +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | +| file-type | Type of the file | string | image | **Y** | +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | +| has-alpha | Whether the image has alpha channel or not | bool | | **Y** | +| height | Height of the image or video in pixels | int | | **Y** | +| is-private-file | Whether the file is private or not | bool | | **Y** | +| size | Size of the object in bytes | int64 | | **Y** | +| tags | Tags associated with the file | string | tag1,tag2 | **Y** | +| width | Width of the image or video in pixels | int | | **Y** | -Dump all cache records in the database +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -### import -Import a SUM file - rclone backend import remote: [options] [+] +# Internet Archive -Amend hash cache from a SUM file and bind checksums to files by size/time. -Usage Example: - rclone backend import hasher:subdir md5 /path/to/sum.md5 +The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) +Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. -### stickyimport +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. -Perform fast import of a SUM file +Unlike S3, listing up all items uploaded by you isn't supported. - rclone backend stickyimport remote: [options] [+] +Once you have made a remote, you can use it like this: -Fill hash cache from a SUM file without verifying file fingerprints. -Usage Example: - rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 +Make a new item + rclone mkdir remote:item +List the contents of a item + rclone ls remote:item -## Implementation details (advanced) +Sync `/home/local/directory` to the remote item, deleting any excess +files in the item. -This section explains how various rclone operations work on a hasher remote. + rclone sync --interactive /home/local/directory remote:item -**Disclaimer. This section describes current implementation which can -change in future rclone versions!.** +## Notes +Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. +The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. -### Hashsum command +You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. +By making it wait, rclone can do normal file comparison. +Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. -The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: +## About metadata +This backend supports setting, updating and reading metadata of each file. +The metadata will appear as file metadata on Internet Archive. +However, some fields are reserved by both Internet Archive and rclone. -1. if requested hash is supported by lower level, just pass it. -2. if object size is below `auto_size` then download object and calculate - _requested_ hashes on the fly. -3. if unsupported and the size is big enough, build object `fingerprint` - (including size, modtime if supported, first-found _other_ hash if any). -4. if the strict match is found in cache for the requested remote, return - the stored hash. -5. if remote found but fingerprint mismatched, then purge the entry and - proceed to step 6. -6. if remote not found or had no requested hash type or after step 5: - download object, calculate all _supported_ hashes on the fly and store - in cache; return requested hash. +The following are reserved by Internet Archive: +- `name` +- `source` +- `size` +- `md5` +- `crc32` +- `sha1` +- `format` +- `old_version` +- `viruscheck` +- `summation` -### Other operations +Trying to set values to these keys is ignored with a warning. +Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. -- whenever a file is uploaded or downloaded **in full**, capture the stream - to calculate all supported hashes on the fly and update database -- server-side `move` will update keys of existing cache entries -- `deletefile` will remove a single cache entry -- `purge` will remove all cache entries under the purged path +rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. -Note that setting `max_age = 0` will disable checksum caching completely. +If there are multiple values for a key, only the first one is returned. +This is a limitation of rclone, that supports one value per one key. +It can be triggered when you did a server-side copy. -If you set `max_age = off`, checksums in cache will never age, unless you -fully rewrite or delete the file. +Reading metadata will also provide custom (non-standard nor reserved) ones. -### Cache storage +## Filtering auto generated files -Cached checksums are stored as `bolt` database files under rclone cache -directory, usually `~/.cache/rclone/kv/`. Databases are maintained -one per _base_ backend, named like `BaseRemote~hasher.bolt`. -Checksums for multiple `alias`-es into a single base backend -will be stored in the single database. All local paths are treated as -aliases into the `local` backend (unless crypted or chunked) and stored -in `~/.cache/rclone/kv/local~hasher.bolt`. -Databases can be shared between multiple rclone processes. +The Internet Archive automatically creates metadata files after +upload. These can cause problems when doing an `rclone sync` as rclone +will try, and fail, to delete them. These metadata files are not +changeable, as they are created by the Internet Archive automatically. -# HDFS +These auto-created files can be excluded from the sync using [metadata +filtering](https://rclone.org/filtering/#metadata). -[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a -distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. + rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" -Paths are specified as `remote:` or `remote:path/to/dir`. +Which excludes from the sync any files which have the +`source=metadata` or `format=Metadata` flags which are added to +Internet Archive auto-created files. ## Configuration -Here is an example of how to make a remote called `remote`. First run: +Here is an example of making an internetarchive configuration. +Most applies to the other providers as well, any differences are described [below](#providers). - rclone config +First run -This will guide you through an interactive setup process: + rclone config + +This will guide you through an interactive setup process. ``` No remotes found, make a new one? @@ -31086,273 +36424,382 @@ s) Set configuration password q) Quit config n/s/q> n name> remote +Option Storage. Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[skip] -XX / Hadoop distributed file system - \ "hdfs" -[skip] -Storage> hdfs -** See help for hdfs backend at: https://rclone.org/hdfs/ ** - -hadoop name node and port -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Connect to host namenode at port 8020 - \ "namenode:8020" -namenode> namenode.hadoop:8020 -hadoop user name -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Connect to hdfs as root - \ "root" -username> root -Edit advanced config? (y/n) +Choose a number from below, or type in your own value. +XX / InternetArchive Items + \ (internetarchive) +Storage> internetarchive +Option access_key_id. +IAS3 Access Key. +Leave blank for anonymous access. +You can find one here: https://archive.org/account/s3.php +Enter a value. Press Enter to leave empty. +access_key_id> XXXX +Option secret_access_key. +IAS3 Secret Key (password). +Leave blank for anonymous access. +Enter a value. Press Enter to leave empty. +secret_access_key> XXXX +Edit advanced config? +y) Yes +n) No (default) +y/n> y +Option endpoint. +IAS3 Endpoint. +Leave blank for default value. +Enter a string value. Press Enter for the default (https://s3.us.archive.org). +endpoint> +Option front_endpoint. +Host of InternetArchive Frontend. +Leave blank for default value. +Enter a string value. Press Enter for the default (https://archive.org). +front_endpoint> +Option disable_checksum. +Don't store MD5 checksum with object metadata. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can ask the server to check the object against checksum. +This is great for data integrity checking but can cause long delays for +large files to start uploading. +Enter a boolean value (true or false). Press Enter for the default (true). +disable_checksum> true +Option encoding. +The encoding for the backend. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). +encoding> +Edit advanced config? y) Yes n) No (default) y/n> n -Remote config -------------------- [remote] -type = hdfs -namenode = namenode.hadoop:8020 -username = root +type = internetarchive +access_key_id = XXXX +secret_access_key = XXXX -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y -Current remotes: +``` -Name Type -==== ==== -hadoop hdfs -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q -``` +### Standard options -This remote is called `remote` and can now be used like this +Here are the Standard options specific to internetarchive (Internet Archive). -See all the top level directories +#### --internetarchive-access-key-id - rclone lsd remote: +IAS3 Access Key. -List the contents of a directory +Leave blank for anonymous access. +You can find one here: https://archive.org/account/s3.php - rclone ls remote:directory +Properties: -Sync the remote `directory` to `/home/local/directory`, deleting any excess files. +- Config: access_key_id +- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID +- Type: string +- Required: false - rclone sync --interactive remote:directory /home/local/directory +#### --internetarchive-secret-access-key -### Setting up your own HDFS instance for testing +IAS3 Secret Key (password). -You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) -or use the docker image from the tests: +Leave blank for anonymous access. -If you want to build the docker image +Properties: -``` -git clone https://github.com/rclone/rclone.git -cd rclone/fstest/testserver/images/test-hdfs -docker build --rm -t rclone/test-hdfs . -``` +- Config: secret_access_key +- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY +- Type: string +- Required: false -Or you can just use the latest one pushed +### Advanced options -``` -docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs -``` +Here are the Advanced options specific to internetarchive (Internet Archive). -**NB** it need few seconds to startup. +#### --internetarchive-endpoint -For this docker image the remote needs to be configured like this: +IAS3 Endpoint. -``` -[remote] -type = hdfs -namenode = 127.0.0.1:8020 -username = root -``` +Leave blank for default value. -You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data -uploaded will be lost.) +Properties: -### Modified time +- Config: endpoint +- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT +- Type: string +- Default: "https://s3.us.archive.org" -Time accurate to 1 second is stored. +#### --internetarchive-front-endpoint -### Checksum +Host of InternetArchive Frontend. -No checksums are implemented. +Leave blank for default value. -### Usage information +Properties: -You can use the `rclone about remote:` command which will display filesystem size and current usage. +- Config: front_endpoint +- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT +- Type: string +- Default: "https://archive.org" -### Restricted filename characters +#### --internetarchive-disable-checksum -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Don't ask the server to test against MD5 checksum calculated by rclone. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can ask the server to check the object against checksum. +This is great for data integrity checking but can cause long delays for +large files to start uploading. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| : | 0x3A | : | +Properties: -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). +- Config: disable_checksum +- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM +- Type: bool +- Default: true +#### --internetarchive-wait-archive -### Standard options +Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. +Only enable if you need to be guaranteed to be reflected after write operations. +0 to disable waiting. No errors to be thrown in case of timeout. -Here are the Standard options specific to hdfs (Hadoop distributed file system). +Properties: -#### --hdfs-namenode +- Config: wait_archive +- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE +- Type: Duration +- Default: 0s -Hadoop name node and port. +#### --internetarchive-encoding + +The encoding for the backend. -E.g. "namenode:8020" to connect to host namenode at port 8020. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: namenode -- Env Var: RCLONE_HDFS_NAMENODE -- Type: string -- Required: true +- Config: encoding +- Env Var: RCLONE_INTERNETARCHIVE_ENCODING +- Type: Encoding +- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot -#### --hdfs-username +### Metadata -Hadoop user name. +Metadata fields provided by Internet Archive. +If there are multiple values for a key, only the first one is returned. +This is a limitation of Rclone, that supports one value per one key. -Properties: +Owner is able to add custom keys. Metadata feature grabs all the keys including them. -- Config: username -- Env Var: RCLONE_HDFS_USERNAME -- Type: string -- Required: false -- Examples: - - "root" - - Connect to hdfs as root. +Here are the possible system metadata items for the internetarchive backend. -### Advanced options +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | +| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | +| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | +| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | +| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | +| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | +| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | +| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | +| size | File size in bytes | decimal number | 123456 | **Y** | +| source | The source of the file | string | original | **Y** | +| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | +| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | -Here are the Advanced options specific to hdfs (Hadoop distributed file system). +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -#### --hdfs-service-principal-name -Kerberos service principal name for the namenode. -Enables KERBEROS authentication. Specifies the Service Principal Name -(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" -for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. +# Jottacloud -Properties: +Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters +in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), +it also provides white-label solutions to different companies, such as: +* Telia + * Telia Cloud (cloud.telia.se) + * Telia Sky (sky.telia.no) +* Tele2 + * Tele2 Cloud (mittcloud.tele2.se) +* Onlime + * Onlime Cloud Storage (onlime.dk) +* Elkjøp (with subsidiaries): + * Elkjøp Cloud (cloud.elkjop.no) + * Elgiganten Sweden (cloud.elgiganten.se) + * Elgiganten Denmark (cloud.elgiganten.dk) + * Giganti Cloud (cloud.gigantti.fi) + * ELKO Cloud (cloud.elko.is) -- Config: service_principal_name -- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME -- Type: string -- Required: false +Most of the white-label versions are supported by this backend, although may require different +authentication setup - described below. -#### --hdfs-data-transfer-protection +Paths are specified as `remote:path` -Kerberos data transfer protection: authentication|integrity|privacy. +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Specifies whether or not authentication, data signature integrity -checks, and wire encryption is required when communicating the the -datanodes. Possible values are 'authentication', 'integrity' and -'privacy'. Used only with KERBEROS enabled. +## Authentication types -Properties: +Some of the whitelabel versions uses a different authentication method than the official service, +and you have to choose the correct one when setting up the remote. -- Config: data_transfer_protection -- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION -- Type: string -- Required: false -- Examples: - - "privacy" - - Ensure authentication, integrity and encryption enabled. +### Standard authentication -#### --hdfs-encoding +The standard authentication method used by the official service (jottacloud.com), as well as +some of the whitelabel services, requires you to generate a single-use personal login token +from the account security settings in the service's web interface. Log in to your account, +go to "Settings" and then "Security", or use the direct link presented to you by rclone when +configuring the remote: . Scroll down to the section +"Personal login token", and click the "Generate" button. Note that if you are using a +whitelabel service you probably can't use the direct link, you need to find the same page in +their dedicated web interface, and also it may be in a different location than described above. -The encoding for the backend. +To access your account from multiple instances of rclone, you need to configure each of them +with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one +location, and copy the configuration file to a second location where you also want to run +rclone and access the same remote. Then you need to replace the token for one of them, using +the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which +requires you to generate a new personal login token and supply as input. If you do not +do this, the token may easily end up being invalidated, resulting in both instances failing +with an error message something along the lines of: -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + oauth2: cannot fetch token: 400 Bad Request + Response: {"error":"invalid_grant","error_description":"Stale token"} -Properties: +When this happens, you need to replace the token as described above to be able to use your +remote again. -- Config: encoding -- Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder -- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot +All personal login tokens you have taken into use will be listed in the web interface under +"My logged in devices", and from the right side of that list you can click the "X" button to +revoke individual tokens. + +### Legacy authentication + +If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option +to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select +yes when the setup asks for legacy authentication and enter your username and password. +The rest of the setup is identical to the default setup. +### Telia Cloud authentication +Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and +additionally uses a separate authentication flow where the username is generated internally. To setup +rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is +identical to the default setup. -## Limitations +### Tele2 Cloud authentication -- No server-side `Move` or `DirMove`. -- Checksums not implemented. +As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and +Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate +authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, +choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. -# HiDrive +### Onlime Cloud Storage authentication -Paths are specified as `remote:path` +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but +have recently set up their own hosting, transferring their customers from Jottacloud servers to their +own ones. -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +This, of course, necessitates using their servers for authentication, but otherwise functionality and +architecture seems equivalent to Jottacloud. -The initial setup for hidrive involves getting a token from HiDrive -which you need to do in your browser. -`rclone config` walks you through it. +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest +of the setup is identical to the default setup. ## Configuration -Here is an example of how to make a remote called `remote`. First run: +Here is an example of how to make a remote called `remote` with the default setup. First run: - rclone config + rclone config This will guide you through an interactive setup process: ``` -No remotes found - make a new one +No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote +Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value +Choose a number from below, or type in your own value. [snip] -XX / HiDrive - \ "hidrive" +XX / Jottacloud + \ (jottacloud) [snip] -Storage> hidrive -OAuth Client Id - Leave blank normally. -client_id> -OAuth Client Secret - Leave blank normally. -client_secret> -Access permissions that rclone should use when requesting access from HiDrive. -Leave blank normally. -scope_access> +Storage> jottacloud Edit advanced config? +y) Yes +n) No (default) y/n> n -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. +Option config_type. +Select authentication type. +Choose a number from below, or type in an existing string value. +Press Enter for the default (standard). + / Standard authentication. + 1 | Use this if you're a normal Jottacloud user. + \ (standard) + / Legacy authentication. + 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users. + \ (legacy) + / Telia Cloud authentication. + 3 | Use this if you are using Telia Cloud. + \ (telia) + / Tele2 Cloud authentication. + 4 | Use this if you are using Tele2 Cloud. + \ (tele2) + / Onlime Cloud authentication. + 5 | Use this if you are using Onlime Cloud. + \ (onlime) +config_type> 1 +Personal login token. +Generate here: https://www.jottacloud.com/web/secure +Login Token> +Use a non-standard device/mountpoint? +Choosing no, the default, will let you access the storage used for the archive +section of the official Jottacloud client. If you instead want to access the +sync or the backup section, for example, you must choose yes. +y) Yes +n) No (default) y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx -Log in and authorize rclone for access -Waiting for code... -Got code +Option config_device. +The device to use. In standard setup the built-in Jotta device is used, +which contains predefined mountpoints for archive, sync etc. All other devices +are treated as backup devices by the official Jottacloud client. You may create +a new by entering a unique name. +Choose a number from below, or type in your own string value. +Press Enter for the default (DESKTOP-3H31129). + 1 > DESKTOP-3H31129 + 2 > Jotta +config_device> 2 +Option config_mountpoint. +The mountpoint to use for the built-in device Jotta. +The standard setup is to use the Archive mountpoint. Most other mountpoints +have very limited support in rclone and should generally be avoided. +Choose a number from below, or type in an existing string value. +Press Enter for the default (Archive). + 1 > Archive + 2 > Shared + 3 > Sync +config_mountpoint> 1 -------------------- [remote] -type = hidrive -token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} +type = jottacloud +configVersion = 1 +client_id = jottacli +client_secret = +tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token +token = {........} +username = 2940e57271a93d987d6f8a21 +device = Jotta +mountpoint = Archive -------------------- y) Yes this is OK (default) e) Edit this remote @@ -31360,141 +36807,124 @@ d) Delete this remote y/e/d> y ``` -**You should be aware that OAuth-tokens can be used to access your account -and hence should not be shared with other persons.** -See the [below section](#keeping-your-tokens-safe) for more information. - -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. - -Note that rclone runs a webserver on your local machine to collect the -token as returned from HiDrive. This only runs from the moment it opens -your browser to the moment you get back the verification code. -The webserver runs on `http://127.0.0.1:53682/`. -If local port `53682` is protected by a firewall you may need to temporarily -unblock the firewall to complete authorization. - Once configured you can then use `rclone` like this, -List directories in top level of your HiDrive root folder +List directories in top level of your Jottacloud rclone lsd remote: -List all the files in your HiDrive filesystem +List all the files in your Jottacloud rclone ls remote: -To copy a local directory to a HiDrive directory called backup +To copy a local directory to an Jottacloud directory called backup rclone copy /home/source remote:backup -### Keeping your tokens safe - -Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. -Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. -Therefore you should make sure no one else can access your configuration. - -It is possible to encrypt rclone's configuration file. -You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). +### Devices and Mountpoints -### Invalid refresh token +The official Jottacloud client registers a device for each computer you install +it on, and shows them in the backup section of the user interface. For each +folder you select for backup it will create a mountpoint within this device. +A built-in device called Jotta is special, and contains mountpoints Archive, +Sync and some others, used for corresponding features in official clients. -As can be verified [here](https://developer.hidrive.com/basics-flows/), -each `refresh_token` (for Native Applications) is valid for 60 days. -If used to access HiDrivei, its validity will be automatically extended. +With rclone you'll want to use the standard Jotta/Archive device/mountpoint in +most cases. However, you may for example want to access files from the sync or +backup functionality provided by the official clients, and rclone therefore +provides the option to select other devices and mountpoints during config. -This means that if you +You are allowed to create new devices and mountpoints. All devices except the +built-in Jotta device are treated as backup devices by official Jottacloud +clients, and the mountpoints on them are individual backup sets. - * Don't use the HiDrive remote for 60 days +With the built-in Jotta device, only existing, built-in, mountpoints can be +selected. In addition to the mentioned Archive and Sync, it may contain +several other mountpoints such as: Latest, Links, Shared and Trash. All of +these are special mountpoints with a different internal representation than +the "regular" mountpoints. Rclone will only to a very limited degree support +them. Generally you should avoid these, unless you know what you are doing. -then rclone will return an error which includes a text -that implies the refresh token is *invalid* or *expired*. +### --fast-list -To fix this you will need to authorize rclone to access your HiDrive account again. +This backend supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -Using +Note that the implementation in Jottacloud always uses only a single +API request to get the entire list, so for large folders this could +lead to long wait time before the first results are shown. - rclone config reconnect remote: +Note also that with rclone version 1.58 and newer, information about +[MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata) +are not available when using `--fast-list`. -the process is very similar to the process of initial setup exemplified before. +### Modification times and hashes -### Modified time and hashes +Jottacloud allows modification times to be set on objects accurate to 1 +second. These will be used to detect whether objects need syncing or +not. -HiDrive allows modification times to be set on objects accurate to 1 second. +Jottacloud supports MD5 type hashes, so you can use the `--checksum` +flag. -HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) -which is used to verify the integrity of file contents after successful transfers. +Note that Jottacloud requires the MD5 hash before upload so if the +source does not have an MD5 checksum then the file will be cached +temporarily on disk (in location given by +[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. +Small files will be cached in memory - see the +[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. +When uploading from local disk the source checksum is always available, +so this does not apply. Starting with rclone version 1.52 the same is +true for encrypted remotes (in older versions the crypt backend would not +calculate hashes for uploads from local disk, so the Jottacloud +backend had to do it as described above). ### Restricted filename characters -HiDrive cannot store files or folders that include -`/` (0x2F) or null-bytes (0x00) in their name. -Any other characters can be used in the names of files or folders. -Additionally, files or folders cannot be named either of the following: `.` or `..` - -Therefore rclone will automatically replace these characters, -if files or folders are stored or accessed with such names. - -You can read about how this filename encoding works in general -[here](overview/#restricted-filenames). - -Keep in mind that HiDrive only supports file or folder names -with a length of 255 characters or less. - -### Transfers - -HiDrive limits file sizes per single request to a maximum of 2 GiB. -To allow storage of larger files and allow for better upload performance, -the hidrive backend will use a chunked transfer for files larger than 96 MiB. -Rclone will upload multiple parts/chunks of the file at the same time. -Chunks in the process of being uploaded are buffered in memory, -so you may want to restrict this behaviour on systems with limited resources. - -You can customize this behaviour using the following options: - -* `chunk_size`: size of file parts -* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer -* `upload_concurrency`: number of file-parts to upload at the same time - -See the below section about configuration options for more details. - -### Root folder - -You can set the root folder for rclone. -This is the directory that rclone considers to be the root of your HiDrive. - -Usually, you will leave this blank, and rclone will use the root of the account. +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -However, you can set this to restrict rclone to a specific folder hierarchy. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \| | 0x7C | | | -This works by prepending the contents of the `root_prefix` option -to any paths accessed by rclone. -For example, the following two ways to access the home directory are equivalent: +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in XML strings. - rclone lsd --hidrive-root-prefix="/users/test/" remote:path +### Deleting files - rclone lsd remote:/users/test/path +By default, rclone will send all files to the trash when deleting files. They will be permanently +deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately +by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. +Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. -See the below section about configuration options for more details. +### Versions -### Directory member count +Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. +Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. -By default, rclone will know the number of directory members contained in a directory. -For example, `rclone lsd` uses this information. +Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading +a new version. If the upload the fails no version of the file will be available in the remote. -The acquisition of this information will result in additional time costs for HiDrive's API. -When dealing with large directory structures, it may be desirable to circumvent this time cost, -especially when this information is not explicitly needed. -For this, the `disable_fetching_member_count` option can be used. +### Quota information -See the below section about configuration options for more details. +To view your current quota you can use the `rclone about remote:` +command which will display your usage limit (unless it is unlimited) +and the current usage. ### Standard options -Here are the Standard options specific to hidrive (HiDrive). +Here are the Standard options specific to jottacloud (Jottacloud). -#### --hidrive-client-id +#### --jottacloud-client-id OAuth Client Id. @@ -31503,11 +36933,11 @@ Leave blank normally. Properties: - Config: client_id -- Env Var: RCLONE_HIDRIVE_CLIENT_ID +- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID - Type: string - Required: false -#### --hidrive-client-secret +#### --jottacloud-client-secret OAuth Client Secret. @@ -31516,42 +36946,26 @@ Leave blank normally. Properties: - Config: client_secret -- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET +- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET - Type: string - Required: false -#### --hidrive-scope-access - -Access permissions that rclone should use when requesting access from HiDrive. - -Properties: - -- Config: scope_access -- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS -- Type: string -- Default: "rw" -- Examples: - - "rw" - - Read and write access to resources. - - "ro" - - Read-only access to resources. - ### Advanced options -Here are the Advanced options specific to hidrive (HiDrive). +Here are the Advanced options specific to jottacloud (Jottacloud). -#### --hidrive-token +#### --jottacloud-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_HIDRIVE_TOKEN +- Env Var: RCLONE_JOTTACLOUD_TOKEN - Type: string - Required: false -#### --hidrive-auth-url +#### --jottacloud-auth-url Auth server URL. @@ -31560,11 +36974,11 @@ Leave blank to use the provider defaults. Properties: - Config: auth_url -- Env Var: RCLONE_HIDRIVE_AUTH_URL +- Env Var: RCLONE_JOTTACLOUD_AUTH_URL - Type: string - Required: false -#### --hidrive-token-url +#### --jottacloud-token-url Token server url. @@ -31573,134 +36987,310 @@ Leave blank to use the provider defaults. Properties: - Config: token_url -- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL - Type: string - Required: false -#### --hidrive-scope-role +#### --jottacloud-md5-memory-limit -User-level that rclone should use when requesting access from HiDrive. +Files bigger than this will be cached on disk to calculate the MD5 if required. Properties: -- Config: scope_role -- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE -- Type: string -- Default: "user" -- Examples: - - "user" - - User-level access to management permissions. - - This will be sufficient in most cases. - - "admin" - - Extensive access to management permissions. - - "owner" - - Full access to management permissions. +- Config: md5_memory_limit +- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT +- Type: SizeSuffix +- Default: 10Mi -#### --hidrive-root-prefix +#### --jottacloud-trashed-only -The root/parent folder for all paths. +Only show files that are in the trash. -Fill in to use the specified folder as the parent for all paths given to the remote. -This way rclone can use any folder as its starting point. +This will show trashed files in their original directory structure. Properties: -- Config: root_prefix -- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX -- Type: string -- Default: "/" -- Examples: - - "/" - - The topmost directory accessible by rclone. - - This will be equivalent with "root" if rclone uses a regular HiDrive user account. - - "root" - - The topmost directory of the HiDrive user account - - "" - - This specifies that there is no root-prefix for your paths. - - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". - -#### --hidrive-endpoint +- Config: trashed_only +- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY +- Type: bool +- Default: false -Endpoint for the service. +#### --jottacloud-hard-delete -This is the URL that API-calls will be made to. +Delete files permanently rather than putting them into the trash. Properties: -- Config: endpoint -- Env Var: RCLONE_HIDRIVE_ENDPOINT -- Type: string -- Default: "https://api.hidrive.strato.com/2.1" +- Config: hard_delete +- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE +- Type: bool +- Default: false -#### --hidrive-disable-fetching-member-count +#### --jottacloud-upload-resume-limit -Do not fetch number of objects in directories unless it is absolutely necessary. +Files bigger than this can be resumed if the upload fail's. -Requests may be faster if the number of objects in subdirectories is not fetched. +Properties: + +- Config: upload_resume_limit +- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT +- Type: SizeSuffix +- Default: 10Mi + +#### --jottacloud-no-versions + +Avoid server side versioning by deleting files and recreating files instead of overwriting them. Properties: -- Config: disable_fetching_member_count -- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT +- Config: no_versions +- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS - Type: bool - Default: false -#### --hidrive-chunk-size +#### --jottacloud-encoding -Chunksize for chunked uploads. +The encoding for the backend. -Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -The upper limit for this is 2147483647 bytes (about 2.000Gi). -That is the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit or to a negative value will cause uploads to fail. +Properties: + +- Config: encoding +- Env Var: RCLONE_JOTTACLOUD_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot + +### Metadata + +Jottacloud has limited support for metadata, currently an extended set of timestamps. + +Here are the possible system metadata items for the jottacloud backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| content-type | MIME type, also known as media type | string | text/plain | **Y** | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + +## Limitations + +Note that Jottacloud is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". + +There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical +looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. + +Jottacloud only supports filenames up to 255 characters in length. + +## Troubleshooting + +Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove +operations to previously deleted paths to fail. Emptying the trash should help in such cases. + +# Koofr + +Paths are specified as `remote:path` + +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + +## Configuration + +The initial setup for Koofr involves creating an application password for +rclone. You can do that by opening the Koofr +[web application](https://app.koofr.net/app/admin/preferences/password), +giving the password a nice name like `rclone` and clicking on generate. + +Here is an example of how to make a remote called `koofr`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> koofr +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +22 / Koofr, Digi Storage and other Koofr-compatible storage providers + \ (koofr) +[snip] +Storage> koofr +Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Koofr, https://app.koofr.net/ + \ (koofr) + 2 / Digi Storage, https://storage.rcs-rds.ro/ + \ (digistorage) + 3 / Any other Koofr API compatible storage service + \ (other) +provider> 1 +Option user. +Your user name. +Enter a value. +user> USERNAME +Option password. +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Edit advanced config? +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[koofr] +type = koofr +provider = koofr +user = USERNAME +password = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +You can choose to edit advanced config in order to enter your own service URL +if you use an on-premise or white label Koofr instance, or choose an alternative +mount instead of your primary storage. + +Once configured you can then use `rclone` like this, + +List directories in top level of your Koofr + + rclone lsd koofr: + +List all the files in your Koofr + + rclone ls koofr: + +To copy a local directory to an Koofr directory called backup + + rclone copy /home/source koofr:backup + +### Restricted filename characters + +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in XML strings. + + +### Standard options + +Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). + +#### --koofr-provider + +Choose your storage provider. + +Properties: + +- Config: provider +- Env Var: RCLONE_KOOFR_PROVIDER +- Type: string +- Required: false +- Examples: + - "koofr" + - Koofr, https://app.koofr.net/ + - "digistorage" + - Digi Storage, https://storage.rcs-rds.ro/ + - "other" + - Any other Koofr API compatible storage service + +#### --koofr-endpoint + +The Koofr API endpoint to use. + +Properties: + +- Config: endpoint +- Env Var: RCLONE_KOOFR_ENDPOINT +- Provider: other +- Type: string +- Required: true + +#### --koofr-user + +Your user name. + +Properties: + +- Config: user +- Env Var: RCLONE_KOOFR_USER +- Type: string +- Required: true + +#### --koofr-password + +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). -Setting this to larger values may increase the upload speed at the cost of using more memory. -It can be set to smaller values smaller to save on memory. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: chunk_size -- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi +- Config: password +- Env Var: RCLONE_KOOFR_PASSWORD +- Provider: koofr +- Type: string +- Required: true -#### --hidrive-upload-cutoff +### Advanced options -Cutoff/Threshold for chunked uploads. +Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). -Any files larger than this will be uploaded in chunks of the configured chunksize. +#### --koofr-mountid -The upper limit for this is 2147483647 bytes (about 2.000Gi). -That is the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit will cause uploads to fail. +Mount ID of the mount to use. -Properties: +If omitted, the primary mount is used. -- Config: upload_cutoff -- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 96Mi +Properties: -#### --hidrive-upload-concurrency +- Config: mountid +- Env Var: RCLONE_KOOFR_MOUNTID +- Type: string +- Required: false -Concurrency for chunked uploads. +#### --koofr-setmtime -This is the upper limit for how many transfers for the same file are running concurrently. -Setting this above to a value smaller than 1 will cause uploads to deadlock. +Does the backend support setting modification time. -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. +Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. Properties: -- Config: upload_concurrency -- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 +- Config: setmtime +- Env Var: RCLONE_KOOFR_SETMTIME +- Type: bool +- Default: true -#### --hidrive-encoding +#### --koofr-encoding The encoding for the backend. @@ -31709,71 +37299,96 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,Dot +- Env Var: RCLONE_KOOFR_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot ## Limitations -### Symbolic links - -HiDrive is able to store symbolic links (*symlinks*) by design, -for example, when unpacked from a zip archive. - -There exists no direct mechanism to manage native symlinks in remotes. -As such this implementation has chosen to ignore any native symlinks present in the remote. -rclone will not be able to access or show any symlinks stored in the hidrive-remote. -This means symlinks cannot be individually removed, copied, or moved, -except when removing, copying, or moving the parent folder. +Note that Koofr is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -*This does not affect the `.rclonelink`-files -that rclone uses to encode and store symbolic links.* +## Providers -### Sparse files +### Koofr -It is possible to store sparse files in HiDrive. +This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. -Note that copying a sparse file will expand the holes -into null-byte (0x00) regions that will then consume disk space. -Likewise, when downloading a sparse file, -the resulting file will have null-byte regions in the place of file holes. +### Digi Storage -# HTTP +[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that +provides a Koofr API. -The HTTP remote is a read only remote for reading files of a -webserver. The webserver should provide file listings which rclone -will read and turn into a remote. This has been tested with common -webservers such as Apache/Nginx/Caddy and will likely work with file -listings from most web servers. (If it doesn't then please file an -issue, or send a pull request!) +Here is an example of how to make a remote called `ds`. First run: -Paths are specified as `remote:` or `remote:path`. + rclone config -The `remote:` represents the configured [url](#http-url), and any path following -it will be resolved relative to this url, according to the URL standard. This -means with remote url `https://beta.rclone.org/branch` and path `fix`, the -resolved URL will be `https://beta.rclone.org/branch/fix`, while with path -`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute -path is resolved from the root of the domain. +This will guide you through an interactive setup process: -If the path following the `remote:` ends with `/` it will be assumed to point -to a directory. If the path does not end with `/`, then a HEAD request is sent -and the response used to decide if it it is treated as a file or a directory -(run with `-vv` to see details). When [--http-no-head](#http-no-head) is -specified, a path without ending `/` is always assumed to be a file. If rclone -incorrectly assumes the path is a file, the solution is to specify the path with -ending `/`. When you know the path is a directory, ending it with `/` is always -better as it avoids the initial HEAD request. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> ds +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +22 / Koofr, Digi Storage and other Koofr-compatible storage providers + \ (koofr) +[snip] +Storage> koofr +Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Koofr, https://app.koofr.net/ + \ (koofr) + 2 / Digi Storage, https://storage.rcs-rds.ro/ + \ (digistorage) + 3 / Any other Koofr API compatible storage service + \ (other) +provider> 2 +Option user. +Your user name. +Enter a value. +user> USERNAME +Option password. +Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +[ds] +type = koofr +provider = digistorage +user = USERNAME +password = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -To just download a single file it is easier to use -[copyurl](https://rclone.org/commands/rclone_copyurl/). +### Other -## Configuration +You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. -Here is an example of how to make a remote called `remote`. First -run: +Here is an example of how to make a remote called `other`. First run: rclone config @@ -31785,555 +37400,572 @@ n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote +name> other +Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value +Choose a number from below, or type in your own value. [snip] -XX / HTTP - \ "http" +22 / Koofr, Digi Storage and other Koofr-compatible storage providers + \ (koofr) [snip] -Storage> http -URL of http host to connect to -Choose a number from below, or type in your own value - 1 / Connect to example.com - \ "https://example.com" -url> https://beta.rclone.org -Remote config +Storage> koofr +Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Koofr, https://app.koofr.net/ + \ (koofr) + 2 / Digi Storage, https://storage.rcs-rds.ro/ + \ (digistorage) + 3 / Any other Koofr API compatible storage service + \ (other) +provider> 3 +Option endpoint. +The Koofr API endpoint to use. +Enter a value. +endpoint> https://koofr.other.org +Option user. +Your user name. +Enter a value. +user> USERNAME +Option password. +Your password for rclone (generate one at your service's settings page). +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Edit advanced config? +y) Yes +n) No (default) +y/n> n -------------------- -[remote] -url = https://beta.rclone.org +[other] +type = koofr +provider = other +endpoint = https://koofr.other.org +user = USERNAME +password = *** ENCRYPTED *** -------------------- -y) Yes this is OK +y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y -Current remotes: - -Name Type -==== ==== -remote http - -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q ``` -This remote is called `remote` and can now be used like this - -See all the top level directories - - rclone lsd remote: - -List the contents of a directory - - rclone ls remote:directory - -Sync the remote `directory` to `/home/local/directory`, deleting any excess files. +# Linkbox - rclone sync --interactive remote:directory /home/local/directory +Linkbox is [a private cloud drive](https://linkbox.to/). -### Read only +## Configuration -This remote is read only - you can't upload files to an HTTP server. +Here is an example of making a remote for Linkbox. -### Modified time +First run: -Most HTTP servers store time accurate to 1 second. + rclone config -### Checksum +This will guide you through an interactive setup process: -No checksums are stored. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n -### Usage without a config file +Enter name for new remote. +name> remote -Since the http remote only has one config parameter it is easy to use -without a config file: +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / Linkbox + \ (linkbox) +Storage> XX - rclone lsd --http-url https://beta.rclone.org :http: +Option token. +Token from https://www.linkbox.to/admin/account +Enter a value. +token> testFromCLToken -or: +Configuration complete. +Options: +- type: linkbox +- token: XXXXXXXXXXX +Keep this "linkbox" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y - rclone lsd :http,url='https://beta.rclone.org': +``` ### Standard options -Here are the Standard options specific to http (HTTP). - -#### --http-url +Here are the Standard options specific to linkbox (Linkbox). -URL of HTTP host to connect to. +#### --linkbox-token -E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. +Token from https://www.linkbox.to/admin/account Properties: -- Config: url -- Env Var: RCLONE_HTTP_URL +- Config: token +- Env Var: RCLONE_LINKBOX_TOKEN - Type: string - Required: true -### Advanced options -Here are the Advanced options specific to http (HTTP). -#### --http-headers +## Limitations -Set HTTP headers for all transactions. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Use this to set additional HTTP headers for all transactions. +# Mail.ru Cloud -The input format is comma separated list of key,value pairs. Standard -[CSV encoding](https://godoc.org/encoding/csv) may be used. +[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. -For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. +## Features highlights -You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. +- Paths may be as deep as required, e.g. `remote:directory/subdirectory` +- Files have a `last modified time` property, directories don't +- Deleted files are by default moved to the trash +- Files and directories can be shared via public links +- Partial uploads or streaming are not supported, file size must be known before upload +- Maximum file size is limited to 2G for a free account, unlimited for paid accounts +- Storage keeps hash for all files and performs transparent deduplication, + the hash algorithm is a modified SHA1 +- If a particular file is already present in storage, one can quickly submit file hash + instead of long file upload (this optimization is supported by rclone) -Properties: +## Configuration -- Config: headers -- Env Var: RCLONE_HTTP_HEADERS -- Type: CommaSepList -- Default: +Here is an example of making a mailru configuration. -#### --http-no-slash +First create a Mail.ru Cloud account and choose a tariff. -Set this if the site doesn't end directories with /. +You will need to log in and create an app password for rclone. Rclone +**will not work** with your normal username and password - it will +give an error like `oauth2: server response missing access_token`. -Use this if your target website does not use / on the end of -directories. +- Click on your user icon in the top right +- Go to Security / "Пароль и безопасность" +- Click password for apps / "Пароли для внешних приложений" +- Add the password - give it a name - eg "rclone" +- Copy the password and use this password below - your normal login password won't work. -A / on the end of a path is how rclone normally tells the difference -between files and directories. If this flag is set, then rclone will -treat all files with Content-Type: text/html as directories and read -URLs from them rather than downloading them. +Now run -Note that this may cause rclone to confuse genuine HTML files with -directories. + rclone config -Properties: +This will guide you through an interactive setup process: -- Config: no_slash -- Env Var: RCLONE_HTTP_NO_SLASH -- Type: bool -- Default: false +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / Mail.ru Cloud + \ "mailru" +[snip] +Storage> mailru +User name (usually email) +Enter a string value. Press Enter for the default (""). +user> username@mail.ru +Password -#### --http-no-head +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. +y) Yes type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Skip full upload if there is another file with same data hash. +This feature is called "speedup" or "put by hash". It is especially efficient +in case of generally available files like popular books, video or audio clips +[snip] +Enter a boolean value (true or false). Press Enter for the default ("true"). +Choose a number from below, or type in your own value + 1 / Enable + \ "true" + 2 / Disable + \ "false" +speedup_enable> 1 +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[remote] +type = mailru +user = username@mail.ru +pass = *** ENCRYPTED *** +speedup_enable = true +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Don't use HEAD requests. +Configuration of this backend does not require a local web browser. +You can use the configured backend as shown below: -HEAD requests are mainly used to find file sizes in dir listing. -If your site is being very slow to load then you can try this option. -Normally rclone does a HEAD request for each potential file in a -directory listing to: +See top level directories -- find its size -- check it really exists -- check to see if it is a directory + rclone lsd remote: -If you set this option, rclone will not do the HEAD request. This will mean -that directory listings are much quicker, but rclone won't have the times or -sizes of any files, and some files that don't exist may be in the listing. +Make a new directory -Properties: + rclone mkdir remote:directory -- Config: no_head -- Env Var: RCLONE_HTTP_NO_HEAD -- Type: bool -- Default: false +List the contents of a directory + rclone ls remote:directory +Sync `/home/local/directory` to the remote path, deleting any +excess files in the path. -## Limitations + rclone sync --interactive /home/local/directory remote:directory -`rclone about` is not supported by the HTTP backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +### Modification times and hashes -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +Files support a modification time attribute with up to 1 second precision. +Directories do not have a modification time, which is shown as "Jan 1 1970". -# Internet Archive +File hashes are supported, with a custom Mail.ru algorithm based on SHA1. +If file size is less than or equal to the SHA1 block size (20 bytes), +its hash is simply its data right-padded with zero bytes. +Hashes of a larger file is computed as a SHA1 of the file data +bytes concatenated with a decimal representation of the data length. -The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) +### Emptying Trash -Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. +Removing a file or directory actually moves it to the trash, which is not +visible to rclone but can be seen in a web browser. The trashed file +still occupies part of total quota. If you wish to empty your trash +and free some quota, you can use the `rclone cleanup remote:` command, +which will permanently delete all your trashed files. +This command does not take any path arguments. -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. +### Quota information -Unlike S3, listing up all items uploaded by you isn't supported. +To view your current quota you can use the `rclone about remote:` +command which will display your usage limit (quota) and the current usage. -Once you have made a remote, you can use it like this: +### Restricted filename characters -Make a new item +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: - rclone mkdir remote:item +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \ | 0x5C | \ | +| \| | 0x7C | | | -List the contents of a item +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. - rclone ls remote:item -Sync `/home/local/directory` to the remote item, deleting any excess -files in the item. +### Standard options - rclone sync --interactive /home/local/directory remote:item +Here are the Standard options specific to mailru (Mail.ru Cloud). -## Notes -Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. -The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. +#### --mailru-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_MAILRU_CLIENT_ID +- Type: string +- Required: false -You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. -By making it wait, rclone can do normal file comparison. -Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. +#### --mailru-client-secret -## About metadata -This backend supports setting, updating and reading metadata of each file. -The metadata will appear as file metadata on Internet Archive. -However, some fields are reserved by both Internet Archive and rclone. +OAuth Client Secret. -The following are reserved by Internet Archive: -- `name` -- `source` -- `size` -- `md5` -- `crc32` -- `sha1` -- `format` -- `old_version` -- `viruscheck` -- `summation` +Leave blank normally. -Trying to set values to these keys is ignored with a warning. -Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. +Properties: -rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. +- Config: client_secret +- Env Var: RCLONE_MAILRU_CLIENT_SECRET +- Type: string +- Required: false -If there are multiple values for a key, only the first one is returned. -This is a limitation of rclone, that supports one value per one key. -It can be triggered when you did a server-side copy. +#### --mailru-user -Reading metadata will also provide custom (non-standard nor reserved) ones. +User name (usually email). -## Filtering auto generated files +Properties: -The Internet Archive automatically creates metadata files after -upload. These can cause problems when doing an `rclone sync` as rclone -will try, and fail, to delete them. These metadata files are not -changeable, as they are created by the Internet Archive automatically. +- Config: user +- Env Var: RCLONE_MAILRU_USER +- Type: string +- Required: true -These auto-created files can be excluded from the sync using [metadata -filtering](https://rclone.org/filtering/#metadata). +#### --mailru-pass - rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" +Password. -Which excludes from the sync any files which have the -`source=metadata` or `format=Metadata` flags which are added to -Internet Archive auto-created files. +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. -## Configuration -Here is an example of making an internetarchive configuration. -Most applies to the other providers as well, any differences are described [below](#providers). +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -First run +Properties: - rclone config +- Config: pass +- Env Var: RCLONE_MAILRU_PASS +- Type: string +- Required: true -This will guide you through an interactive setup process. +#### --mailru-speedup-enable -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -XX / InternetArchive Items - \ (internetarchive) -Storage> internetarchive -Option access_key_id. -IAS3 Access Key. -Leave blank for anonymous access. -You can find one here: https://archive.org/account/s3.php -Enter a value. Press Enter to leave empty. -access_key_id> XXXX -Option secret_access_key. -IAS3 Secret Key (password). -Leave blank for anonymous access. -Enter a value. Press Enter to leave empty. -secret_access_key> XXXX -Edit advanced config? -y) Yes -n) No (default) -y/n> y -Option endpoint. -IAS3 Endpoint. -Leave blank for default value. -Enter a string value. Press Enter for the default (https://s3.us.archive.org). -endpoint> -Option front_endpoint. -Host of InternetArchive Frontend. -Leave blank for default value. -Enter a string value. Press Enter for the default (https://archive.org). -front_endpoint> -Option disable_checksum. -Don't store MD5 checksum with object metadata. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against checksum. -This is great for data integrity checking but can cause long delays for -large files to start uploading. -Enter a boolean value (true or false). Press Enter for the default (true). -disable_checksum> true -Option encoding. -The encoding for the backend. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). -encoding> -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -[remote] -type = internetarchive -access_key_id = XXXX -secret_access_key = XXXX --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Skip full upload if there is another file with same data hash. +This feature is called "speedup" or "put by hash". It is especially efficient +in case of generally available files like popular books, video or audio clips, +because files are searched by hash in all accounts of all mailru users. +It is meaningless and ineffective if source file is unique or encrypted. +Please note that rclone may need local memory and disk space to calculate +content hash in advance and decide whether full upload is required. +Also, if rclone does not know file size in advance (e.g. in case of +streaming or partial uploads), it will not even try this optimization. -### Standard options +Properties: -Here are the Standard options specific to internetarchive (Internet Archive). +- Config: speedup_enable +- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE +- Type: bool +- Default: true +- Examples: + - "true" + - Enable + - "false" + - Disable -#### --internetarchive-access-key-id +### Advanced options -IAS3 Access Key. +Here are the Advanced options specific to mailru (Mail.ru Cloud). -Leave blank for anonymous access. -You can find one here: https://archive.org/account/s3.php +#### --mailru-token + +OAuth Access Token as a JSON blob. Properties: -- Config: access_key_id -- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID +- Config: token +- Env Var: RCLONE_MAILRU_TOKEN - Type: string - Required: false -#### --internetarchive-secret-access-key +#### --mailru-auth-url -IAS3 Secret Key (password). +Auth server URL. -Leave blank for anonymous access. +Leave blank to use the provider defaults. Properties: -- Config: secret_access_key -- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY +- Config: auth_url +- Env Var: RCLONE_MAILRU_AUTH_URL - Type: string - Required: false -### Advanced options - -Here are the Advanced options specific to internetarchive (Internet Archive). - -#### --internetarchive-endpoint +#### --mailru-token-url -IAS3 Endpoint. +Token server url. -Leave blank for default value. +Leave blank to use the provider defaults. Properties: -- Config: endpoint -- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT +- Config: token_url +- Env Var: RCLONE_MAILRU_TOKEN_URL - Type: string -- Default: "https://s3.us.archive.org" +- Required: false -#### --internetarchive-front-endpoint +#### --mailru-speedup-file-patterns -Host of InternetArchive Frontend. +Comma separated list of file name patterns eligible for speedup (put by hash). -Leave blank for default value. +Patterns are case insensitive and can contain '*' or '?' meta characters. Properties: -- Config: front_endpoint -- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT +- Config: speedup_file_patterns +- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS - Type: string -- Default: "https://archive.org" +- Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" +- Examples: + - "" + - Empty list completely disables speedup (put by hash). + - "*" + - All files will be attempted for speedup. + - "*.mkv,*.avi,*.mp4,*.mp3" + - Only common audio/video files will be tried for put by hash. + - "*.zip,*.gz,*.rar,*.pdf" + - Only common archives or PDF books will be tried for speedup. -#### --internetarchive-disable-checksum +#### --mailru-speedup-max-disk -Don't ask the server to test against MD5 checksum calculated by rclone. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against checksum. -This is great for data integrity checking but can cause long delays for -large files to start uploading. +This option allows you to disable speedup (put by hash) for large files. + +Reason is that preliminary hashing can exhaust your RAM or disk space. Properties: -- Config: disable_checksum -- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM -- Type: bool -- Default: true +- Config: speedup_max_disk +- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK +- Type: SizeSuffix +- Default: 3Gi +- Examples: + - "0" + - Completely disable speedup (put by hash). + - "1G" + - Files larger than 1Gb will be uploaded directly. + - "3G" + - Choose this option if you have less than 3Gb free on local disk. -#### --internetarchive-wait-archive +#### --mailru-speedup-max-memory -Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. -Only enable if you need to be guaranteed to be reflected after write operations. -0 to disable waiting. No errors to be thrown in case of timeout. +Files larger than the size given below will always be hashed on disk. Properties: -- Config: wait_archive -- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE -- Type: Duration -- Default: 0s - -#### --internetarchive-encoding +- Config: speedup_max_memory +- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY +- Type: SizeSuffix +- Default: 32Mi +- Examples: + - "0" + - Preliminary hashing will always be done in a temporary disk location. + - "32M" + - Do not dedicate more than 32Mb RAM for preliminary hashing. + - "256M" + - You have at most 256Mb RAM free for hash calculations. -The encoding for the backend. +#### --mailru-check-hash -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +What should copy do if file checksum is mismatched or invalid. Properties: -- Config: encoding -- Env Var: RCLONE_INTERNETARCHIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot - -### Metadata - -Metadata fields provided by Internet Archive. -If there are multiple values for a key, only the first one is returned. -This is a limitation of Rclone, that supports one value per one key. +- Config: check_hash +- Env Var: RCLONE_MAILRU_CHECK_HASH +- Type: bool +- Default: true +- Examples: + - "true" + - Fail with error. + - "false" + - Ignore and continue. -Owner is able to add custom keys. Metadata feature grabs all the keys including them. +#### --mailru-user-agent -Here are the possible system metadata items for the internetarchive backend. +HTTP user agent used internally by client. -| Name | Help | Type | Example | Read Only | -|------|------|------|---------|-----------| -| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | -| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | -| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | -| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | -| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | -| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | -| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | -| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | -| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | -| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | -| size | File size in bytes | decimal number | 123456 | **Y** | -| source | The source of the file | string | original | **Y** | -| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | -| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | +Defaults to "rclone/VERSION" or "--user-agent" provided on command line. -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +Properties: +- Config: user_agent +- Env Var: RCLONE_MAILRU_USER_AGENT +- Type: string +- Required: false +#### --mailru-quirks -# Jottacloud +Comma separated list of internal maintenance flags. -Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters -in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), -it also provides white-label solutions to different companies, such as: -* Telia - * Telia Cloud (cloud.telia.se) - * Telia Sky (sky.telia.no) -* Tele2 - * Tele2 Cloud (mittcloud.tele2.se) -* Elkjøp (with subsidiaries): - * Elkjøp Cloud (cloud.elkjop.no) - * Elgiganten Sweden (cloud.elgiganten.se) - * Elgiganten Denmark (cloud.elgiganten.dk) - * Giganti Cloud (cloud.gigantti.fi) - * ELKO Cloud (cloud.elko.is) +This option must not be used by an ordinary user. It is intended only to +facilitate remote troubleshooting of backend issues. Strict meaning of +flags is not documented and not guaranteed to persist between releases. +Quirks will be removed when the backend grows stable. +Supported quirks: atomicmkdir binlist unknowndirs -Most of the white-label versions are supported by this backend, although may require different -authentication setup - described below. +Properties: -Paths are specified as `remote:path` +- Config: quirks +- Env Var: RCLONE_MAILRU_QUIRKS +- Type: string +- Required: false -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +#### --mailru-encoding -## Authentication types +The encoding for the backend. -Some of the whitelabel versions uses a different authentication method than the official service, -and you have to choose the correct one when setting up the remote. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -### Standard authentication +Properties: -The standard authentication method used by the official service (jottacloud.com), as well as -some of the whitelabel services, requires you to generate a single-use personal login token -from the account security settings in the service's web interface. Log in to your account, -go to "Settings" and then "Security", or use the direct link presented to you by rclone when -configuring the remote: . Scroll down to the section -"Personal login token", and click the "Generate" button. Note that if you are using a -whitelabel service you probably can't use the direct link, you need to find the same page in -their dedicated web interface, and also it may be in a different location than described above. +- Config: encoding +- Env Var: RCLONE_MAILRU_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot -To access your account from multiple instances of rclone, you need to configure each of them -with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one -location, and copy the configuration file to a second location where you also want to run -rclone and access the same remote. Then you need to replace the token for one of them, using -the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which -requires you to generate a new personal login token and supply as input. If you do not -do this, the token may easily end up being invalidated, resulting in both instances failing -with an error message something along the lines of: - oauth2: cannot fetch token: 400 Bad Request - Response: {"error":"invalid_grant","error_description":"Stale token"} -When this happens, you need to replace the token as described above to be able to use your -remote again. +## Limitations -All personal login tokens you have taken into use will be listed in the web interface under -"My logged in devices", and from the right side of that list you can click the "X" button to -revoke individual tokens. +File size limits depend on your account. A single file size is limited by 2G +for a free account and unlimited for paid tariffs. Please refer to the Mail.ru +site for the total uploaded size limits. -### Legacy authentication +Note that Mailru is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option -to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select -yes when the setup asks for legacy authentication and enter your username and password. -The rest of the setup is identical to the default setup. +# Mega -### Telia Cloud authentication +[Mega](https://mega.nz/) is a cloud storage and file hosting service +known for its security feature where all files are encrypted locally +before they are uploaded. This prevents anyone (including employees of +Mega) from accessing the files without knowledge of the key used for +encryption. -Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and -additionally uses a separate authentication flow where the username is generated internally. To setup -rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is -identical to the default setup. +This is an rclone backend for Mega which supports the file transfer +features of Mega using the same client side encryption. -### Tele2 Cloud authentication +Paths are specified as `remote:path` -As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and -Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate -authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, -choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. ## Configuration -Here is an example of how to make a remote called `remote` with the default setup. First run: +Here is an example of how to make a remote called `remote`. First run: - rclone config + rclone config This will guide you through an interactive setup process: @@ -32344,257 +37976,242 @@ s) Set configuration password q) Quit config n/s/q> n name> remote -Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value. +Choose a number from below, or type in your own value [snip] -XX / Jottacloud - \ (jottacloud) +XX / Mega + \ "mega" [snip] -Storage> jottacloud -Edit advanced config? -y) Yes -n) No (default) -y/n> n -Option config_type. -Select authentication type. -Choose a number from below, or type in an existing string value. -Press Enter for the default (standard). - / Standard authentication. - 1 | Use this if you're a normal Jottacloud user. - \ (standard) - / Legacy authentication. - 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users. - \ (legacy) - / Telia Cloud authentication. - 3 | Use this if you are using Telia Cloud. - \ (telia) - / Tele2 Cloud authentication. - 4 | Use this if you are using Tele2 Cloud. - \ (tele2) -config_type> 1 -Personal login token. -Generate here: https://www.jottacloud.com/web/secure -Login Token> -Use a non-standard device/mountpoint? -Choosing no, the default, will let you access the storage used for the archive -section of the official Jottacloud client. If you instead want to access the -sync or the backup section, for example, you must choose yes. -y) Yes -n) No (default) -y/n> y -Option config_device. -The device to use. In standard setup the built-in Jotta device is used, -which contains predefined mountpoints for archive, sync etc. All other devices -are treated as backup devices by the official Jottacloud client. You may create -a new by entering a unique name. -Choose a number from below, or type in your own string value. -Press Enter for the default (DESKTOP-3H31129). - 1 > DESKTOP-3H31129 - 2 > Jotta -config_device> 2 -Option config_mountpoint. -The mountpoint to use for the built-in device Jotta. -The standard setup is to use the Archive mountpoint. Most other mountpoints -have very limited support in rclone and should generally be avoided. -Choose a number from below, or type in an existing string value. -Press Enter for the default (Archive). - 1 > Archive - 2 > Shared - 3 > Sync -config_mountpoint> 1 +Storage> mega +User name +user> you@example.com +Password. +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank +y/g/n> y +Enter the password: +password: +Confirm the password: +password: +Remote config -------------------- [remote] -type = jottacloud -configVersion = 1 -client_id = jottacli -client_secret = -tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token -token = {........} -username = 2940e57271a93d987d6f8a21 -device = Jotta -mountpoint = Archive +type = mega +user = you@example.com +pass = *** ENCRYPTED *** -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -Once configured you can then use `rclone` like this, +**NOTE:** The encryption keys need to have been already generated after a regular login +via the browser, otherwise attempting to use the credentials in `rclone` will fail. + +Once configured you can then use `rclone` like this, + +List directories in top level of your Mega + + rclone lsd remote: + +List all the files in your Mega + + rclone ls remote: + +To copy a local directory to an Mega directory called backup + + rclone copy /home/source remote:backup + +### Modification times and hashes + +Mega does not support modification times or hashes yet. + +### Restricted filename characters + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | -List directories in top level of your Jottacloud +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. - rclone lsd remote: +### Duplicated files -List all the files in your Jottacloud +Mega can have two files with exactly the same name and path (unlike a +normal file system). - rclone ls remote: +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -To copy a local directory to an Jottacloud directory called backup +Use `rclone dedupe` to fix duplicated files. - rclone copy /home/source remote:backup +### Failure to log-in -### Devices and Mountpoints +#### Object not found -The official Jottacloud client registers a device for each computer you install -it on, and shows them in the backup section of the user interface. For each -folder you select for backup it will create a mountpoint within this device. -A built-in device called Jotta is special, and contains mountpoints Archive, -Sync and some others, used for corresponding features in official clients. +If you are connecting to your Mega remote for the first time, +to test access and synchronization, you may receive an error such as -With rclone you'll want to use the standard Jotta/Archive device/mountpoint in -most cases. However, you may for example want to access files from the sync or -backup functionality provided by the official clients, and rclone therefore -provides the option to select other devices and mountpoints during config. +``` +Failed to create file system for "my-mega-remote:": +couldn't login: Object (typically, node or user) not found +``` -You are allowed to create new devices and mountpoints. All devices except the -built-in Jotta device are treated as backup devices by official Jottacloud -clients, and the mountpoints on them are individual backup sets. +The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) +start with the **MEGAcmd** utility. Note that this refers to +the official C++ command from https://github.com/meganz/MEGAcmd +and not the go language built command from t3rm1n4l/megacmd +that is no longer maintained. -With the built-in Jotta device, only existing, built-in, mountpoints can be -selected. In addition to the mentioned Archive and Sync, it may contain -several other mountpoints such as: Latest, Links, Shared and Trash. All of -these are special mountpoints with a different internal representation than -the "regular" mountpoints. Rclone will only to a very limited degree support -them. Generally you should avoid these, unless you know what you are doing. +Follow the instructions for installing MEGAcmd and try accessing +your remote as they recommend. You can establish whether or not +you can log in using MEGAcmd, and obtain diagnostic information +to help you, and search or work with others in the forum. -### --fast-list +``` +MEGA CMD> login me@example.com +Password: +Fetching nodes ... +Loading transfers from local cache +Login complete as me@example.com +me@example.com:/$ +``` -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +Note that some have found issues with passwords containing special +characters. If you can not log on with rclone, but MEGAcmd logs on +just fine, then consider changing your password temporarily to +pure alphanumeric characters, in case that helps. -Note that the implementation in Jottacloud always uses only a single -API request to get the entire list, so for large folders this could -lead to long wait time before the first results are shown. -Note also that with rclone version 1.58 and newer information about -[MIME types](https://rclone.org/overview/#mime-type) are not available when using `--fast-list`. +#### Repeated commands blocks access -### Modified time and hashes +Mega remotes seem to get blocked (reject logins) under "heavy use". +We haven't worked out the exact blocking rules but it seems to be +related to fast paced, successive rclone commands. -Jottacloud allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. +For example, executing this command 90 times in a row `rclone link +remote:file` will cause the remote to become "blocked". This is not an +abnormal situation, for example if you wish to get the public links of +a directory with hundred of files... After more or less a week, the +remote will remote accept rclone logins normally again. -Jottacloud supports MD5 type hashes, so you can use the `--checksum` -flag. +You can mitigate this issue by mounting the remote it with `rclone +mount`. This will log-in when mounting and a log-out when unmounting +only. You can also run `rclone rcd` and then use `rclone rc` to run +the commands over the API to avoid logging in each time. -Note that Jottacloud requires the MD5 hash before upload so if the -source does not have an MD5 checksum then the file will be cached -temporarily on disk (in location given by -[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. -Small files will be cached in memory - see the -[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. -When uploading from local disk the source checksum is always available, -so this does not apply. Starting with rclone version 1.52 the same is -true for crypted remotes (in older versions the crypt backend would not -calculate hashes for uploads from local disk, so the Jottacloud -backend had to do it as described above). +Rclone does not currently close mega sessions (you can see them in the +web interface), however closing the sessions does not solve the issue. -### Restricted filename characters +If you space rclone commands by 3 seconds it will avoid blocking the +remote. We haven't identified the exact blocking rules, so perhaps one +could execute the command 80 times without waiting and avoid blocking +by waiting 3 seconds, then continuing... -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Note that this has been observed by trial and error and might not be +set in stone. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| " | 0x22 | " | -| * | 0x2A | * | -| : | 0x3A | : | -| < | 0x3C | < | -| > | 0x3E | > | -| ? | 0x3F | ? | -| \| | 0x7C | | | +Other tools seem not to produce this blocking effect, as they use a +different working approach (state-based, using sessionIDs instead of +log-in) which isn't compatible with the current stateless rclone +approach. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in XML strings. +Note that once blocked, the use of other tools (such as megacmd) is +not a sure workaround: following megacmd login times have been +observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 +min, 30min. Web access looks unaffected though. -### Deleting files +Investigation is continuing in relation to workarounds based on +timeouts, pacers, retrials and tpslimits - if you discover something +relevant, please post on the forum. -By default, rclone will send all files to the trash when deleting files. They will be permanently -deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately -by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. -Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. +So, if rclone was working nicely and suddenly you are unable to log-in +and you are sure the user and the password are correct, likely you +have got the remote blocked for a while. -### Versions -Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. -Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. +### Standard options -Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading -a new version. If the upload the fails no version of the file will be available in the remote. +Here are the Standard options specific to mega (Mega). -### Quota information +#### --mega-user -To view your current quota you can use the `rclone about remote:` -command which will display your usage limit (unless it is unlimited) -and the current usage. +User name. +Properties: -### Advanced options +- Config: user +- Env Var: RCLONE_MEGA_USER +- Type: string +- Required: true -Here are the Advanced options specific to jottacloud (Jottacloud). +#### --mega-pass -#### --jottacloud-md5-memory-limit +Password. -Files bigger than this will be cached on disk to calculate the MD5 if required. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: md5_memory_limit -- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT -- Type: SizeSuffix -- Default: 10Mi +- Config: pass +- Env Var: RCLONE_MEGA_PASS +- Type: string +- Required: true -#### --jottacloud-trashed-only +### Advanced options -Only show files that are in the trash. +Here are the Advanced options specific to mega (Mega). -This will show trashed files in their original directory structure. +#### --mega-debug + +Output more debug from Mega. + +If this flag is set (along with -vv) it will print further debugging +information from the mega backend. Properties: -- Config: trashed_only -- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY +- Config: debug +- Env Var: RCLONE_MEGA_DEBUG - Type: bool - Default: false -#### --jottacloud-hard-delete +#### --mega-hard-delete Delete files permanently rather than putting them into the trash. +Normally the mega backend will put all deletions into the trash rather +than permanently deleting them. If you specify this then rclone will +permanently delete objects instead. + Properties: - Config: hard_delete -- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE +- Env Var: RCLONE_MEGA_HARD_DELETE - Type: bool - Default: false -#### --jottacloud-upload-resume-limit - -Files bigger than this can be resumed if the upload fail's. - -Properties: - -- Config: upload_resume_limit -- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT -- Type: SizeSuffix -- Default: 10Mi +#### --mega-use-https -#### --jottacloud-no-versions +Use HTTPS for transfers. -Avoid server side versioning by deleting files and recreating files instead of overwriting them. +MEGA uses plain text HTTP connections by default. +Some ISPs throttle HTTP connections, this causes transfers to become very slow. +Enabling this will force MEGA to use HTTPS for all transfers. +HTTPS is normally not necessary since all data is already encrypted anyway. +Enabling it will increase CPU usage and add network overhead. Properties: -- Config: no_versions -- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS +- Config: use_https +- Env Var: RCLONE_MEGA_USE_HTTPS - Type: bool - Default: false -#### --jottacloud-encoding +#### --mega-encoding The encoding for the backend. @@ -32603,45 +38220,38 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_JOTTACLOUD_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot - +- Env Var: RCLONE_MEGA_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot -## Limitations -Note that Jottacloud is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +### Process `killed` -There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical -looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. +On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). -Jottacloud only supports filenames up to 255 characters in length. +## Limitations -## Troubleshooting +This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource +go library implementing the Mega API. There doesn't appear to be any +documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code +so there are likely quite a few errors still remaining in this library. -Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove -operations to previously deleted paths to fail. Emptying the trash should help in such cases. +Mega allows duplicate files which may confuse rclone. -# Koofr +# Memory -Paths are specified as `remote:path` +The memory backend is an in RAM backend. It does not persist its +data - use the local backend for that. -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +The memory backend behaves like a bucket-based remote (e.g. like +s3). Because it has no parameters you can just use it with the +`:memory:` remote name. ## Configuration -The initial setup for Koofr involves creating an application password for -rclone. You can do that by opening the Koofr -[web application](https://app.koofr.net/app/admin/preferences/password), -giving the password a nice name like `rclone` and clicking on generate. - -Here is an example of how to make a remote called `koofr`. First run: - - rclone config - -This will guide you through an interactive setup process: +You can configure it as a remote like this with `rclone config` too if +you want to: ``` No remotes found, make a new one? @@ -32649,51 +38259,22 @@ n) New remote s) Set configuration password q) Quit config n/s/q> n -name> koofr -Option Storage. +name> remote Type of storage to configure. -Choose a number from below, or type in your own value. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] -22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) +XX / Memory + \ "memory" [snip] -Storage> koofr -Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) -provider> 1 -Option user. -Your user name. -Enter a value. -user> USERNAME -Option password. -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). -Choose an alternative below. -y) Yes, type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Edit advanced config? -y) Yes -n) No (default) -y/n> n +Storage> memory +** See help for memory backend at: https://rclone.org/memory/ ** + Remote config + -------------------- -[koofr] -type = koofr -provider = koofr -user = USERNAME -password = *** ENCRYPTED *** +[remote] +type = memory -------------------- y) Yes this is OK (default) e) Edit this remote @@ -32701,358 +38282,313 @@ d) Delete this remote y/e/d> y ``` -You can choose to edit advanced config in order to enter your own service URL -if you use an on-premise or white label Koofr instance, or choose an alternative -mount instead of your primary storage. +Because the memory backend isn't persistent it is most useful for +testing or with an rclone server or rclone mount, e.g. -Once configured you can then use `rclone` like this, + rclone mount :memory: /mnt/tmp + rclone serve webdav :memory: + rclone serve sftp :memory: -List directories in top level of your Koofr +### Modification times and hashes - rclone lsd koofr: +The memory backend supports MD5 hashes and modification times accurate to 1 nS. -List all the files in your Koofr +### Restricted filename characters - rclone ls koofr: +The memory backend replaces the [default restricted characters +set](https://rclone.org/overview/#restricted-characters). -To copy a local directory to an Koofr directory called backup - rclone copy /home/source koofr:backup -### Restricted filename characters -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +# Akamai NetStorage -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \ | 0x5C | \ | +Paths are specified as `remote:` +You may put subdirectories in too, e.g. `remote:/path/to/dir`. +If you have a CP code you can use that as the folder after the domain such as \\/\\/\. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in XML strings. +For example, this is commonly configured with or without a CP code: +* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` +* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` -### Standard options +See all buckets + rclone lsd remote: +The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. -Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). +## Configuration -#### --koofr-provider +Here's an example of how to make a remote called `ns1`. -Choose your storage provider. +1. To begin the interactive configuration process, enter this command: -Properties: +``` +rclone config +``` -- Config: provider -- Env Var: RCLONE_KOOFR_PROVIDER -- Type: string -- Required: false -- Examples: - - "koofr" - - Koofr, https://app.koofr.net/ - - "digistorage" - - Digi Storage, https://storage.rcs-rds.ro/ - - "other" - - Any other Koofr API compatible storage service +2. Type `n` to create a new remote. -#### --koofr-endpoint +``` +n) New remote +d) Delete remote +q) Quit config +e/n/d/q> n +``` -The Koofr API endpoint to use. +3. For this example, enter `ns1` when you reach the name> prompt. -Properties: +``` +name> ns1 +``` -- Config: endpoint -- Env Var: RCLONE_KOOFR_ENDPOINT -- Provider: other -- Type: string -- Required: true +4. Enter `netstorage` as the type of storage to configure. -#### --koofr-user +``` +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +XX / NetStorage + \ "netstorage" +Storage> netstorage +``` -Your user name. +5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. -Properties: -- Config: user -- Env Var: RCLONE_KOOFR_USER -- Type: string -- Required: true +``` +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / HTTP protocol + \ "http" + 2 / HTTPS protocol + \ "https" +protocol> 1 +``` -#### --koofr-password +6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). +``` +Enter a string value. Press Enter for the default (""). +host> baseball-nsu.akamaihd.net/123456/content/ +``` -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +7. Set the netstorage account name +``` +Enter a string value. Press Enter for the default (""). +account> username +``` -Properties: +8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. +Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: koofr -- Type: string -- Required: true +``` +y) Yes type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +``` + +9. View the summary and confirm your remote configuration. + +``` +[ns1] +type = netstorage +protocol = http +host = baseball-nsu.akamaihd.net/123456/content/ +account = username +secret = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +This remote is called `ns1` and can now be used. + +## Example operations + +Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. + +### See contents of a directory in your project + + rclone lsd ns1:/974012/testing/ + +### Sync the contents local with remote + + rclone sync . ns1:/974012/testing/ + +### Upload local content to remote + rclone copy notes.txt ns1:/974012/testing/ + +### Delete content on remote + rclone delete ns1:/974012/testing/notes.txt + +### Move or copy content between CP codes. + +Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. + + rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ + +## Features + +### Symlink Support + +The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. + +This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. + +Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. + +**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. + +### Implicit vs. Explicit Directories + +With NetStorage, directories can exist in one of two forms: + +1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. +2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. + +Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. -#### --koofr-password +### `--fast-list` / ListR support -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). +NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. -Properties: +* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: digistorage -- Type: string -- Required: true +There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. -#### --koofr-password +**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. -Your password for rclone (generate one at your service's settings page). +### Purge -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. -Properties: +**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: other -- Type: string -- Required: true -### Advanced options +### Standard options -Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). +Here are the Standard options specific to netstorage (Akamai NetStorage). -#### --koofr-mountid +#### --netstorage-host -Mount ID of the mount to use. +Domain+path of NetStorage host to connect to. -If omitted, the primary mount is used. +Format should be `/` Properties: -- Config: mountid -- Env Var: RCLONE_KOOFR_MOUNTID +- Config: host +- Env Var: RCLONE_NETSTORAGE_HOST - Type: string -- Required: false - -#### --koofr-setmtime +- Required: true -Does the backend support setting modification time. +#### --netstorage-account -Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. +Set the NetStorage account name Properties: -- Config: setmtime -- Env Var: RCLONE_KOOFR_SETMTIME -- Type: bool -- Default: true - -#### --koofr-encoding +- Config: account +- Env Var: RCLONE_NETSTORAGE_ACCOUNT +- Type: string +- Required: true -The encoding for the backend. +#### --netstorage-secret -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Set the NetStorage account secret/G2O key for authentication. -Properties: +Please choose the 'y' option to set your own password then enter your secret. -- Config: encoding -- Env Var: RCLONE_KOOFR_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Properties: +- Config: secret +- Env Var: RCLONE_NETSTORAGE_SECRET +- Type: string +- Required: true -## Limitations +### Advanced options -Note that Koofr is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +Here are the Advanced options specific to netstorage (Akamai NetStorage). -## Providers +#### --netstorage-protocol -### Koofr +Select between HTTP or HTTPS protocol. -This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. +Most users should choose HTTPS, which is the default. +HTTP is provided primarily for debugging purposes. -### Digi Storage +Properties: -[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that -provides a Koofr API. +- Config: protocol +- Env Var: RCLONE_NETSTORAGE_PROTOCOL +- Type: string +- Default: "https" +- Examples: + - "http" + - HTTP protocol + - "https" + - HTTPS protocol -Here is an example of how to make a remote called `ds`. First run: +## Backend commands - rclone config +Here are the commands specific to the netstorage backend. -This will guide you through an interactive setup process: +Run them with -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> ds -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) -[snip] -Storage> koofr -Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) -provider> 2 -Option user. -Your user name. -Enter a value. -user> USERNAME -Option password. -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). -Choose an alternative below. -y) Yes, type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -[ds] -type = koofr -provider = digistorage -user = USERNAME -password = *** ENCRYPTED *** --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` + rclone backend COMMAND remote: -### Other +The help below will explain what arguments each command takes. -You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -Here is an example of how to make a remote called `other`. First run: +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). - rclone config +### du -This will guide you through an interactive setup process: +Return disk usage information for a specified directory -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> other -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) -[snip] -Storage> koofr -Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) -provider> 3 -Option endpoint. -The Koofr API endpoint to use. -Enter a value. -endpoint> https://koofr.other.org -Option user. -Your user name. -Enter a value. -user> USERNAME -Option password. -Your password for rclone (generate one at your service's settings page). -Choose an alternative below. -y) Yes, type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -[other] -type = koofr -provider = other -endpoint = https://koofr.other.org -user = USERNAME -password = *** ENCRYPTED *** --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` + rclone backend du remote: [options] [+] -# Mail.ru Cloud +The usage information returned, includes the targeted directory as well as all +files stored in any sub-directories that may exist. -[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. +### symlink -Currently it is recommended to disable 2FA on Mail.ru accounts intended for rclone until it gets eventually implemented. +You can create a symbolic link in ObjectStore with the symlink action. -## Features highlights + rclone backend symlink remote: [options] [+] -- Paths may be as deep as required, e.g. `remote:directory/subdirectory` -- Files have a `last modified time` property, directories don't -- Deleted files are by default moved to the trash -- Files and directories can be shared via public links -- Partial uploads or streaming are not supported, file size must be known before upload -- Maximum file size is limited to 2G for a free account, unlimited for paid accounts -- Storage keeps hash for all files and performs transparent deduplication, - the hash algorithm is a modified SHA1 -- If a particular file is already present in storage, one can quickly submit file hash - instead of long file upload (this optimization is supported by rclone) +The desired path location (including applicable sub-directories) ending in +the object that will be the target of the symlink (for example, /links/mylink). +Include the file extension for the object, if applicable. +`rclone backend symlink ` -## Configuration -Here is an example of making a mailru configuration. -First create a Mail.ru Cloud account and choose a tariff. +# Microsoft Azure Blob Storage -You will need to log in and create an app password for rclone. Rclone -**will not work** with your normal username and password - it will -give an error like `oauth2: server response missing access_token`. +Paths are specified as `remote:container` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. +`remote:container/path/to/dir`. -- Click on your user icon in the top right -- Go to Security / "Пароль и безопасность" -- Click password for apps / "Пароли для внешних приложений" -- Add the password - give it a name - eg "rclone" -- Copy the password and use this password below - your normal login password won't work. +## Configuration -Now run +Here is an example of making a Microsoft Azure Blob Storage +configuration. For a remote called `remote`. First run: - rclone config + rclone config This will guide you through an interactive setup process: @@ -33064,51 +38600,24 @@ q) Quit config n/s/q> n name> remote Type of storage to configure. -Type of storage to configure. -Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] -XX / Mail.ru Cloud - \ "mailru" -[snip] -Storage> mailru -User name (usually email) -Enter a string value. Press Enter for the default (""). -user> username@mail.ru -Password - -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Skip full upload if there is another file with same data hash. -This feature is called "speedup" or "put by hash". It is especially efficient -in case of generally available files like popular books, video or audio clips +XX / Microsoft Azure Blob Storage + \ "azureblob" [snip] -Enter a boolean value (true or false). Press Enter for the default ("true"). -Choose a number from below, or type in your own value - 1 / Enable - \ "true" - 2 / Disable - \ "false" -speedup_enable> 1 -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n +Storage> azureblob +Storage Account Name +account> account_name +Storage Account Key +key> base64encodedkey== +Endpoint for the service - leave blank normally. +endpoint> Remote config -------------------- [remote] -type = mailru -user = username@mail.ru -pass = *** ENCRYPTED *** -speedup_enable = true +account = account_name +key = base64encodedkey== +endpoint = -------------------- y) Yes this is OK e) Edit this remote @@ -33116,52 +38625,53 @@ d) Delete this remote y/e/d> y ``` -Configuration of this backend does not require a local web browser. -You can use the configured backend as shown below: - -See top level directories +See all containers rclone lsd remote: -Make a new directory +Make a new container - rclone mkdir remote:directory + rclone mkdir remote:container -List the contents of a directory +List the contents of a container - rclone ls remote:directory + rclone ls remote:container -Sync `/home/local/directory` to the remote path, deleting any -excess files in the path. +Sync `/home/local/directory` to the remote container, deleting any excess +files in the container. - rclone sync --interactive /home/local/directory remote:directory + rclone sync --interactive /home/local/directory remote:container -### Modified time +### --fast-list -Files support a modification time attribute with up to 1 second precision. -Directories do not have a modification time, which is shown as "Jan 1 1970". +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -### Hash checksums +### Modification times and hashes -Hash sums use a custom Mail.ru algorithm based on SHA1. -If file size is less than or equal to the SHA1 block size (20 bytes), -its hash is simply its data right-padded with zero bytes. -Hash sum of a larger file is computed as a SHA1 sum of the file data -bytes concatenated with a decimal representation of the data length. +The modification time is stored as metadata on the object with the +`mtime` key. It is stored using RFC3339 Format time with nanosecond +precision. The metadata is supplied during directory listings so +there is no performance overhead to using it. -### Emptying Trash +If you wish to use the Azure standard `LastModified` time stored on +the object as the modified time, then use the `--use-server-modtime` +flag. Note that rclone can't set `LastModified`, so using the +`--update` flag when syncing is recommended if using +`--use-server-modtime`. -Removing a file or directory actually moves it to the trash, which is not -visible to rclone but can be seen in a web browser. The trashed file -still occupies part of total quota. If you wish to empty your trash -and free some quota, you can use the `rclone cleanup remote:` command, -which will permanently delete all your trashed files. -This command does not take any path arguments. +MD5 hashes are stored with blobs. However blobs that were uploaded in +chunks only have an MD5 if the source remote was capable of MD5 +hashes, e.g. the local disk. -### Quota information +### Performance -To view your current quota you can use the `rclone about remote:` -command which will display your usage limit (quota) and the current usage. +When uploading large files, increasing the value of +`--azureblob-upload-concurrency` will increase performance at the cost +of using more memory. The default of 16 is set quite conservatively to +use less memory. It maybe be necessary raise it to 64 or higher to +fully utilize a 1 GBit/s link with a single file transfer. ### Restricted filename characters @@ -33170,847 +38680,781 @@ the following characters are also replaced: | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| " | 0x22 | " | -| * | 0x2A | * | -| : | 0x3A | : | -| < | 0x3C | < | -| > | 0x3E | > | -| ? | 0x3F | ? | -| \ | 0x5C | \ | -| \| | 0x7C | | | - -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. - - -### Standard options - -Here are the Standard options specific to mailru (Mail.ru Cloud). - -#### --mailru-user - -User name (usually email). - -Properties: +| / | 0x2F | / | +| \ | 0x5C | \ | -- Config: user -- Env Var: RCLONE_MAILRU_USER -- Type: string -- Required: true +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: -#### --mailru-pass +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| . | 0x2E | . | -Password. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. +### Authentication {#authentication} +There are a number of ways of supplying credentials for Azure Blob +Storage. Rclone tries them in the order of the sections below. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +#### Env Auth -Properties: +If the `env_auth` config parameter is `true` then rclone will pull +credentials from the environment or runtime. -- Config: pass -- Env Var: RCLONE_MAILRU_PASS -- Type: string -- Required: true +It tries these authentication methods in this order: -#### --mailru-speedup-enable +1. Environment Variables +2. Managed Service Identity Credentials +3. Azure CLI credentials (as used by the az tool) -Skip full upload if there is another file with same data hash. +These are described in the following sections -This feature is called "speedup" or "put by hash". It is especially efficient -in case of generally available files like popular books, video or audio clips, -because files are searched by hash in all accounts of all mailru users. -It is meaningless and ineffective if source file is unique or encrypted. -Please note that rclone may need local memory and disk space to calculate -content hash in advance and decide whether full upload is required. -Also, if rclone does not know file size in advance (e.g. in case of -streaming or partial uploads), it will not even try this optimization. +##### Env Auth: 1. Environment Variables -Properties: +If `env_auth` is set and environment variables are present rclone +authenticates a service principal with a secret or certificate, or a +user with a password, depending on which environment variable are set. +It reads configuration from these variables, in the following order: -- Config: speedup_enable -- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE -- Type: bool -- Default: true -- Examples: - - "true" - - Enable - - "false" - - Disable +1. Service principal with client secret + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets +2. Service principal with certificate + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. +3. User with username and password + - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations". + - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to + - `AZURE_USERNAME`: a username (usually an email address) + - `AZURE_PASSWORD`: the user's password +4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). -### Advanced options -Here are the Advanced options specific to mailru (Mail.ru Cloud). +##### Env Auth: 2. Managed Service Identity Credentials -#### --mailru-speedup-file-patterns +When using Managed Service Identity if the VM(SS) on which this +program is running has a system-assigned identity, it will be used by +default. If the resource has no system-assigned but exactly one +user-assigned identity, the user-assigned identity will be used by +default. -Comma separated list of file name patterns eligible for speedup (put by hash). +If the resource has multiple user-assigned identities you will need to +unset `env_auth` and set `use_msi` instead. See the [`use_msi` +section](#use_msi). -Patterns are case insensitive and can contain '*' or '?' meta characters. +##### Env Auth: 3. Azure CLI credentials (as used by the az tool) -Properties: +Credentials created with the `az` tool can be picked up using `env_auth`. -- Config: speedup_file_patterns -- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS -- Type: string -- Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" -- Examples: - - "" - - Empty list completely disables speedup (put by hash). - - "*" - - All files will be attempted for speedup. - - "*.mkv,*.avi,*.mp4,*.mp3" - - Only common audio/video files will be tried for put by hash. - - "*.zip,*.gz,*.rar,*.pdf" - - Only common archives or PDF books will be tried for speedup. +For example if you were to login with a service principal like this: -#### --mailru-speedup-max-disk + az login --service-principal -u XXX -p XXX --tenant XXX -This option allows you to disable speedup (put by hash) for large files. +Then you could access rclone resources like this: -Reason is that preliminary hashing can exhaust your RAM or disk space. + rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER -Properties: +Or -- Config: speedup_max_disk -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK -- Type: SizeSuffix -- Default: 3Gi -- Examples: - - "0" - - Completely disable speedup (put by hash). - - "1G" - - Files larger than 1Gb will be uploaded directly. - - "3G" - - Choose this option if you have less than 3Gb free on local disk. + rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER -#### --mailru-speedup-max-memory +Which is analogous to using the `az` tool: -Files larger than the size given below will always be hashed on disk. + az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login -Properties: +#### Account and Shared Key -- Config: speedup_max_memory -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY -- Type: SizeSuffix -- Default: 32Mi -- Examples: - - "0" - - Preliminary hashing will always be done in a temporary disk location. - - "32M" - - Do not dedicate more than 32Mb RAM for preliminary hashing. - - "256M" - - You have at most 256Mb RAM free for hash calculations. +This is the most straight forward and least flexible way. Just fill +in the `account` and `key` lines and leave the rest blank. -#### --mailru-check-hash +#### SAS URL -What should copy do if file checksum is mismatched or invalid. +This can be an account level SAS URL or container level SAS URL. -Properties: +To use it leave `account` and `key` blank and fill in `sas_url`. -- Config: check_hash -- Env Var: RCLONE_MAILRU_CHECK_HASH -- Type: bool -- Default: true -- Examples: - - "true" - - Fail with error. - - "false" - - Ignore and continue. +An account level SAS URL or container level SAS URL can be obtained +from the Azure portal or the Azure Storage Explorer. To get a +container level SAS URL right click on a container in the Azure Blob +explorer in the Azure portal. -#### --mailru-user-agent +If you use a container level SAS URL, rclone operations are permitted +only on a particular container, e.g. -HTTP user agent used internally by client. + rclone ls azureblob:container -Defaults to "rclone/VERSION" or "--user-agent" provided on command line. +You can also list the single container from the root. This will only +show the container specified by the SAS URL. -Properties: + $ rclone lsd azureblob: + container/ -- Config: user_agent -- Env Var: RCLONE_MAILRU_USER_AGENT -- Type: string -- Required: false +Note that you can't see or access any other containers - this will +fail -#### --mailru-quirks + rclone ls azureblob:othercontainer -Comma separated list of internal maintenance flags. +Container level SAS URLs are useful for temporarily allowing third +parties access to a single container or putting credentials into an +untrusted environment such as a CI build server. -This option must not be used by an ordinary user. It is intended only to -facilitate remote troubleshooting of backend issues. Strict meaning of -flags is not documented and not guaranteed to persist between releases. -Quirks will be removed when the backend grows stable. -Supported quirks: atomicmkdir binlist unknowndirs +#### Service principal with client secret -Properties: +If these variables are set, rclone will authenticate with a service principal with a client secret. -- Config: quirks -- Env Var: RCLONE_MAILRU_QUIRKS -- Type: string -- Required: false +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID. +- `client_id`: the service principal's client ID +- `client_secret`: one of the service principal's client secrets -#### --mailru-encoding +The credentials can also be placed in a file using the +`service_principal_file` configuration option. -The encoding for the backend. +#### Service principal with certificate -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +If these variables are set, rclone will authenticate with a service principal with certificate. -Properties: +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID. +- `client_id`: the service principal's client ID +- `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key. +- `client_certificate_password`: (optional) password for the certificate file. +- `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. -- Config: encoding -- Env Var: RCLONE_MAILRU_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot +**NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +#### User with username and password +If these variables are set, rclone will authenticate with username and password. -## Limitations +- `tenant`: (optional) tenant to authenticate in. Defaults to "organizations". +- `client_id`: client ID of the application the user will authenticate to +- `username`: a username (usually an email address) +- `password`: the user's password -File size limits depend on your account. A single file size is limited by 2G -for a free account and unlimited for paid tariffs. Please refer to the Mail.ru -site for the total uploaded size limits. +Microsoft doesn't recommend this kind of authentication, because it's +less secure than other authentication flows. This method is not +interactive, so it isn't compatible with any form of multi-factor +authentication, and the application must already have user or admin +consent. This credential can only authenticate work and school +accounts; it can't authenticate Microsoft accounts. -Note that Mailru is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +**NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -# Mega +#### Managed Service Identity Credentials {#use_msi} -[Mega](https://mega.nz/) is a cloud storage and file hosting service -known for its security feature where all files are encrypted locally -before they are uploaded. This prevents anyone (including employees of -Mega) from accessing the files without knowledge of the key used for -encryption. +If `use_msi` is set then managed service identity credentials are +used. This authentication only works when running in an Azure service. +`env_auth` needs to be unset to use this. -This is an rclone backend for Mega which supports the file transfer -features of Mega using the same client side encryption. +However if you have multiple user identities to choose from these must +be explicitly specified using exactly one of the `msi_object_id`, +`msi_client_id`, or `msi_mi_res_id` parameters. -Paths are specified as `remote:path` +If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is +set, this is is equivalent to using `env_auth`. -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -## Configuration +### Standard options -Here is an example of how to make a remote called `remote`. First run: +Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). - rclone config +#### --azureblob-account -This will guide you through an interactive setup process: +Azure Storage Account Name. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Mega - \ "mega" -[snip] -Storage> mega -User name -user> you@example.com -Password. -y) Yes type in my own password -g) Generate random password -n) No leave this optional password blank -y/g/n> y -Enter the password: -password: -Confirm the password: -password: -Remote config --------------------- -[remote] -type = mega -user = you@example.com -pass = *** ENCRYPTED *** --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Set this to the Azure Storage Account Name in use. -**NOTE:** The encryption keys need to have been already generated after a regular login -via the browser, otherwise attempting to use the credentials in `rclone` will fail. +Leave blank to use SAS URL or Emulator, otherwise it needs to be set. -Once configured you can then use `rclone` like this, +If this is blank and if env_auth is set it will be read from the +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. -List directories in top level of your Mega - rclone lsd remote: +Properties: -List all the files in your Mega +- Config: account +- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Type: string +- Required: false - rclone ls remote: +#### --azureblob-env-auth -To copy a local directory to an Mega directory called backup +Read credentials from runtime (environment variables, CLI or MSI). - rclone copy /home/source remote:backup +See the [authentication docs](/azureblob#authentication) for full info. -### Modified time and hashes +Properties: -Mega does not support modification times or hashes yet. +- Config: env_auth +- Env Var: RCLONE_AZUREBLOB_ENV_AUTH +- Type: bool +- Default: false -### Restricted filename characters +#### --azureblob-key -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | +Storage Account Shared Key. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Leave blank to use SAS URL or Emulator. -### Duplicated files +Properties: -Mega can have two files with exactly the same name and path (unlike a -normal file system). +- Config: key +- Env Var: RCLONE_AZUREBLOB_KEY +- Type: string +- Required: false -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +#### --azureblob-sas-url -Use `rclone dedupe` to fix duplicated files. +SAS URL for container level access only. -### Failure to log-in +Leave blank if using account/key or Emulator. -#### Object not found +Properties: -If you are connecting to your Mega remote for the first time, -to test access and synchronization, you may receive an error such as +- Config: sas_url +- Env Var: RCLONE_AZUREBLOB_SAS_URL +- Type: string +- Required: false -``` -Failed to create file system for "my-mega-remote:": -couldn't login: Object (typically, node or user) not found -``` +#### --azureblob-tenant -The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) -start with the **MEGAcmd** utility. Note that this refers to -the official C++ command from https://github.com/meganz/MEGAcmd -and not the go language built command from t3rm1n4l/megacmd -that is no longer maintained. +ID of the service principal's tenant. Also called its directory ID. -Follow the instructions for installing MEGAcmd and try accessing -your remote as they recommend. You can establish whether or not -you can log in using MEGAcmd, and obtain diagnostic information -to help you, and search or work with others in the forum. +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password -``` -MEGA CMD> login me@example.com -Password: -Fetching nodes ... -Loading transfers from local cache -Login complete as me@example.com -me@example.com:/$ -``` -Note that some have found issues with passwords containing special -characters. If you can not log on with rclone, but MEGAcmd logs on -just fine, then consider changing your password temporarily to -pure alphanumeric characters, in case that helps. +Properties: +- Config: tenant +- Env Var: RCLONE_AZUREBLOB_TENANT +- Type: string +- Required: false -#### Repeated commands blocks access +#### --azureblob-client-id -Mega remotes seem to get blocked (reject logins) under "heavy use". -We haven't worked out the exact blocking rules but it seems to be -related to fast paced, successive rclone commands. +The ID of the client in use. -For example, executing this command 90 times in a row `rclone link -remote:file` will cause the remote to become "blocked". This is not an -abnormal situation, for example if you wish to get the public links of -a directory with hundred of files... After more or less a week, the -remote will remote accept rclone logins normally again. +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password -You can mitigate this issue by mounting the remote it with `rclone -mount`. This will log-in when mounting and a log-out when unmounting -only. You can also run `rclone rcd` and then use `rclone rc` to run -the commands over the API to avoid logging in each time. -Rclone does not currently close mega sessions (you can see them in the -web interface), however closing the sessions does not solve the issue. +Properties: -If you space rclone commands by 3 seconds it will avoid blocking the -remote. We haven't identified the exact blocking rules, so perhaps one -could execute the command 80 times without waiting and avoid blocking -by waiting 3 seconds, then continuing... +- Config: client_id +- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Type: string +- Required: false -Note that this has been observed by trial and error and might not be -set in stone. +#### --azureblob-client-secret -Other tools seem not to produce this blocking effect, as they use a -different working approach (state-based, using sessionIDs instead of -log-in) which isn't compatible with the current stateless rclone -approach. +One of the service principal's client secrets -Note that once blocked, the use of other tools (such as megacmd) is -not a sure workaround: following megacmd login times have been -observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 -min, 30min. Web access looks unaffected though. +Set this if using +- Service principal with client secret -Investigation is continuing in relation to workarounds based on -timeouts, pacers, retrials and tpslimits - if you discover something -relevant, please post on the forum. -So, if rclone was working nicely and suddenly you are unable to log-in -and you are sure the user and the password are correct, likely you -have got the remote blocked for a while. +Properties: +- Config: client_secret +- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Type: string +- Required: false -### Standard options +#### --azureblob-client-certificate-path -Here are the Standard options specific to mega (Mega). +Path to a PEM or PKCS12 certificate file including the private key. -#### --mega-user +Set this if using +- Service principal with certificate -User name. Properties: -- Config: user -- Env Var: RCLONE_MEGA_USER +- Config: client_certificate_path +- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH - Type: string -- Required: true +- Required: false -#### --mega-pass +#### --azureblob-client-certificate-password + +Password for the certificate file (optional). + +Optionally set this if using +- Service principal with certificate + +And the certificate has a password. -Password. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: pass -- Env Var: RCLONE_MEGA_PASS +- Config: client_certificate_password +- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD - Type: string -- Required: true +- Required: false ### Advanced options -Here are the Advanced options specific to mega (Mega). +Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). -#### --mega-debug +#### --azureblob-client-send-certificate-chain -Output more debug from Mega. +Send the certificate chain when using certificate auth. + +Specifies whether an authentication request will include an x5c header +to support subject name / issuer based authentication. When set to +true, authentication requests include the x5c header. + +Optionally set this if using +- Service principal with certificate -If this flag is set (along with -vv) it will print further debugging -information from the mega backend. Properties: -- Config: debug -- Env Var: RCLONE_MEGA_DEBUG +- Config: client_send_certificate_chain +- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false -#### --mega-hard-delete +#### --azureblob-username -Delete files permanently rather than putting them into the trash. +User name (usually an email address) + +Set this if using +- User with username and password -Normally the mega backend will put all deletions into the trash rather -than permanently deleting them. If you specify this then rclone will -permanently delete objects instead. Properties: -- Config: hard_delete -- Env Var: RCLONE_MEGA_HARD_DELETE -- Type: bool -- Default: false +- Config: username +- Env Var: RCLONE_AZUREBLOB_USERNAME +- Type: string +- Required: false -#### --mega-use-https +#### --azureblob-password -Use HTTPS for transfers. +The user's password + +Set this if using +- User with username and password -MEGA uses plain text HTTP connections by default. -Some ISPs throttle HTTP connections, this causes transfers to become very slow. -Enabling this will force MEGA to use HTTPS for all transfers. -HTTPS is normally not necesary since all data is already encrypted anyway. -Enabling it will increase CPU usage and add network overhead. + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: use_https -- Env Var: RCLONE_MEGA_USE_HTTPS -- Type: bool -- Default: false +- Config: password +- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Type: string +- Required: false -#### --mega-encoding +#### --azureblob-service-principal-file -The encoding for the backend. +Path to file containing credentials for use with a service principal. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Leave blank normally. Needed only if you want to use a service principal instead of interactive login. -Properties: + $ az ad sp create-for-rbac --name "" \ + --role "Storage Blob Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json -- Config: encoding -- Env Var: RCLONE_MEGA_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. +It may be more convenient to put the credentials directly into the +rclone config file under the `client_id`, `tenant` and `client_secret` +keys instead of setting `service_principal_file`. -## Limitations +Properties: -This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource -go library implementing the Mega API. There doesn't appear to be any -documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code -so there are likely quite a few errors still remaining in this library. +- Config: service_principal_file +- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE +- Type: string +- Required: false -Mega allows duplicate files which may confuse rclone. +#### --azureblob-use-msi -# Memory +Use a managed service identity to authenticate (only works in Azure). -The memory backend is an in RAM backend. It does not persist its -data - use the local backend for that. +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) +to authenticate to Azure Storage instead of a SAS token or account key. -The memory backend behaves like a bucket-based remote (e.g. like -s3). Because it has no parameters you can just use it with the -`:memory:` remote name. +If the VM(SS) on which this program is running has a system-assigned identity, it will +be used by default. If the resource has no system-assigned but exactly one user-assigned identity, +the user-assigned identity will be used by default. If the resource has multiple user-assigned +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, +msi_client_id, or msi_mi_res_id parameters. -## Configuration +Properties: -You can configure it as a remote like this with `rclone config` too if -you want to: +- Config: use_msi +- Env Var: RCLONE_AZUREBLOB_USE_MSI +- Type: bool +- Default: false -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Memory - \ "memory" -[snip] -Storage> memory -** See help for memory backend at: https://rclone.org/memory/ ** +#### --azureblob-msi-object-id -Remote config +Object ID of the user-assigned MSI to use, if any. + +Leave blank if msi_client_id or msi_mi_res_id specified. + +Properties: + +- Config: msi_object_id +- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Type: string +- Required: false --------------------- -[remote] -type = memory --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +#### --azureblob-msi-client-id -Because the memory backend isn't persistent it is most useful for -testing or with an rclone server or rclone mount, e.g. +Object ID of the user-assigned MSI to use, if any. - rclone mount :memory: /mnt/tmp - rclone serve webdav :memory: - rclone serve sftp :memory: +Leave blank if msi_object_id or msi_mi_res_id specified. -### Modified time and hashes +Properties: -The memory backend supports MD5 hashes and modification times accurate to 1 nS. +- Config: msi_client_id +- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Type: string +- Required: false -### Restricted filename characters +#### --azureblob-msi-mi-res-id -The memory backend replaces the [default restricted characters -set](https://rclone.org/overview/#restricted-characters). +Azure resource ID of the user-assigned MSI to use, if any. +Leave blank if msi_client_id or msi_object_id specified. +Properties: +- Config: msi_mi_res_id +- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Type: string +- Required: false -# Akamai NetStorage +#### --azureblob-use-emulator -Paths are specified as `remote:` -You may put subdirectories in too, e.g. `remote:/path/to/dir`. -If you have a CP code you can use that as the folder after the domain such as \\/\\/\. +Uses local storage emulator if provided as 'true'. -For example, this is commonly configured with or without a CP code: -* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` -* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` +Leave blank if using real azure storage endpoint. +Properties: -See all buckets - rclone lsd remote: -The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. +- Config: use_emulator +- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR +- Type: bool +- Default: false -## Configuration +#### --azureblob-endpoint -Here's an example of how to make a remote called `ns1`. +Endpoint for the service. -1. To begin the interactive configuration process, enter this command: +Leave blank normally. -``` -rclone config -``` +Properties: -2. Type `n` to create a new remote. +- Config: endpoint +- Env Var: RCLONE_AZUREBLOB_ENDPOINT +- Type: string +- Required: false -``` -n) New remote -d) Delete remote -q) Quit config -e/n/d/q> n -``` +#### --azureblob-upload-cutoff -3. For this example, enter `ns1` when you reach the name> prompt. +Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). -``` -name> ns1 -``` +Properties: -4. Enter `netstorage` as the type of storage to configure. +- Config: upload_cutoff +- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF +- Type: string +- Required: false -``` -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -XX / NetStorage - \ "netstorage" -Storage> netstorage -``` +#### --azureblob-chunk-size -5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. +Upload chunk size. +Note that this is stored in memory and there may be up to +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +in memory. -``` -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / HTTP protocol - \ "http" - 2 / HTTPS protocol - \ "https" -protocol> 1 -``` +Properties: -6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` +- Config: chunk_size +- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Type: SizeSuffix +- Default: 4Mi -``` -Enter a string value. Press Enter for the default (""). -host> baseball-nsu.akamaihd.net/123456/content/ -``` +#### --azureblob-upload-concurrency -7. Set the netstorage account name -``` -Enter a string value. Press Enter for the default (""). -account> username -``` +Concurrency for multipart uploads. -8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. -Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. +This is the number of chunks of the same file that are uploaded +concurrently. -``` -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -``` +If you are uploading small numbers of large files over high-speed +links and these uploads do not fully utilize your bandwidth, then +increasing this may help to speed up the transfers. -9. View the summary and confirm your remote configuration. +In tests, upload speed increases almost linearly with upload +concurrency. For example to fill a gigabit pipe it may be necessary to +raise this to 64. Note that this will use more memory. -``` -[ns1] -type = netstorage -protocol = http -host = baseball-nsu.akamaihd.net/123456/content/ -account = username -secret = *** ENCRYPTED *** --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Note that chunks are stored in memory and there may be up to +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +in memory. -This remote is called `ns1` and can now be used. +Properties: -## Example operations +- Config: upload_concurrency +- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Type: int +- Default: 16 -Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. +#### --azureblob-list-chunk -### See contents of a directory in your project +Size of blob list. - rclone lsd ns1:/974012/testing/ +This sets the number of blobs requested in each listing chunk. Default +is the maximum, 5000. "List blobs" requests are permitted 2 minutes +per megabyte to complete. If an operation is taking longer than 2 +minutes per megabyte on average, it will time out ( +[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) +). This can be used to limit the number of blobs items to return, to +avoid the time out. -### Sync the contents local with remote +Properties: - rclone sync . ns1:/974012/testing/ +- Config: list_chunk +- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK +- Type: int +- Default: 5000 -### Upload local content to remote - rclone copy notes.txt ns1:/974012/testing/ +#### --azureblob-access-tier -### Delete content on remote - rclone delete ns1:/974012/testing/notes.txt +Access tier of blob: hot, cool, cold or archive. -### Move or copy content between CP codes. +Archived blobs can be restored by setting access tier to hot, cool or +cold. Leave blank if you intend to use default access tier, which is +set at account level -Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. +If there is no "access tier" specified, rclone doesn't apply any tier. +rclone performs "Set Tier" operation on blobs while uploading, if objects +are not modified, specifying "access tier" to new one will have no effect. +If blobs are in "archive tier" at remote, trying to perform data transfer +operations from remote will not be allowed. User should first restore by +tiering blob to "Hot", "Cool" or "Cold". - rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ +Properties: -## Features +- Config: access_tier +- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER +- Type: string +- Required: false -### Symlink Support +#### --azureblob-archive-tier-delete -The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. +Delete archive tier blobs before overwriting. -This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. +Archive tier blobs cannot be updated. So without this flag, if you +attempt to update an archive tier blob, then rclone will produce the +error: -Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. + can't update archive tier blob without --azureblob-archive-tier-delete -**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. +With this flag set then before rclone attempts to overwrite an archive +tier blob, it will delete the existing blob before uploading its +replacement. This has the potential for data loss if the upload fails +(unlike updating a normal blob) and also may cost more since deleting +archive tier blobs early may be chargable. -### Implicit vs. Explicit Directories -With NetStorage, directories can exist in one of two forms: +Properties: -1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. -2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. +- Config: archive_tier_delete +- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE +- Type: bool +- Default: false -Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. +#### --azureblob-disable-checksum -### `--fast-list` / ListR support +Don't store MD5 checksum with object metadata. -NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. -* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. +Properties: -* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. +- Config: disable_checksum +- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM +- Type: bool +- Default: false -There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. +#### --azureblob-memory-pool-flush-time -**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. +How often internal memory buffer pools will be flushed. (no longer used) -### Purge +Properties: -NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. +- Config: memory_pool_flush_time +- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s -**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. +#### --azureblob-memory-pool-use-mmap +Whether to use mmap buffers in internal memory pool. (no longer used) -### Standard options +Properties: -Here are the Standard options specific to netstorage (Akamai NetStorage). +- Config: memory_pool_use_mmap +- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false -#### --netstorage-host +#### --azureblob-encoding -Domain+path of NetStorage host to connect to. +The encoding for the backend. -Format should be `/` +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: host -- Env Var: RCLONE_NETSTORAGE_HOST -- Type: string -- Required: true +- Config: encoding +- Env Var: RCLONE_AZUREBLOB_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 -#### --netstorage-account +#### --azureblob-public-access -Set the NetStorage account name +Public access level of a container: blob or container. Properties: -- Config: account -- Env Var: RCLONE_NETSTORAGE_ACCOUNT +- Config: public_access +- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS - Type: string -- Required: true +- Required: false +- Examples: + - "" + - The container and its blobs can be accessed only with an authorized request. + - It's a default value. + - "blob" + - Blob data within this container can be read via anonymous request. + - "container" + - Allow full public read access for container and blob data. -#### --netstorage-secret +#### --azureblob-directory-markers -Set the NetStorage account secret/G2O key for authentication. +Upload an empty object with a trailing slash when a new directory is created -Please choose the 'y' option to set your own password then enter your secret. +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with "/", to persist the folder. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +This object also has the metadata "hdi_isfolder = true" to conform to +the Microsoft standard. + Properties: -- Config: secret -- Env Var: RCLONE_NETSTORAGE_SECRET -- Type: string -- Required: true - -### Advanced options +- Config: directory_markers +- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS +- Type: bool +- Default: false -Here are the Advanced options specific to netstorage (Akamai NetStorage). +#### --azureblob-no-check-container -#### --netstorage-protocol +If set, don't attempt to check the container exists or create it. -Select between HTTP or HTTPS protocol. +This can be useful when trying to minimise the number of transactions +rclone does if you know the container exists already. -Most users should choose HTTPS, which is the default. -HTTP is provided primarily for debugging purposes. Properties: -- Config: protocol -- Env Var: RCLONE_NETSTORAGE_PROTOCOL -- Type: string -- Default: "https" -- Examples: - - "http" - - HTTP protocol - - "https" - - HTTPS protocol +- Config: no_check_container +- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER +- Type: bool +- Default: false -## Backend commands +#### --azureblob-no-head-object -Here are the commands specific to the netstorage backend. +If set, do not do HEAD before GET when getting objects. -Run them with +Properties: - rclone backend COMMAND remote: +- Config: no_head_object +- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT +- Type: bool +- Default: false -The help below will explain what arguments each command takes. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +### Custom upload headers -### du +You can set custom upload headers with the `--header-upload` flag. -Return disk usage information for a specified directory +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type - rclone backend du remote: [options] [+] +Eg `--header-upload "Content-Type: text/potato"` -The usage information returned, includes the targeted directory as well as all -files stored in any sub-directories that may exist. +## Limitations -### symlink +MD5 sums are only uploaded with chunked files if the source has an MD5 +sum. This will always be the case for a local to azure copy. -You can create a symbolic link in ObjectStore with the symlink action. +`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. - rclone backend symlink remote: [options] [+] +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -The desired path location (including applicable sub-directories) ending in -the object that will be the target of the symlink (for example, /links/mylink). -Include the file extension for the object, if applicable. -`rclone backend symlink ` +## Azure Storage Emulator Support +You can run rclone with the storage emulator (usually _azurite_). + +To do this, just set up a new remote with `rclone config` following +the instructions in the introduction and set `use_emulator` in the +advanced settings as `true`. You do not need to provide a default +account name nor an account key. But you can override them in the +`account` and `key` options. (Prior to v1.61 they were hard coded to +_azurite_'s `devstoreaccount1`.) +Also, if you want to access a storage emulator instance running on a +different machine, you can override the `endpoint` parameter in the +advanced settings, setting it to +`http(s)://:/devstoreaccount1` +(e.g. `http://10.254.2.5:10000/devstoreaccount1`). -# Microsoft Azure Blob Storage +# Microsoft Azure Files Storage -Paths are specified as `remote:container` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. -`remote:container/path/to/dir`. +Paths are specified as `remote:` You may put subdirectories in too, +e.g. `remote:path/to/dir`. ## Configuration -Here is an example of making a Microsoft Azure Blob Storage +Here is an example of making a Microsoft Azure Files Storage configuration. For a remote called `remote`. First run: rclone config @@ -34027,69 +39471,90 @@ name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Microsoft Azure Blob Storage - \ "azureblob" +XX / Microsoft Azure Files Storage + \ "azurefiles" [snip] -Storage> azureblob -Storage Account Name + +Option account. +Azure Storage Account Name. +Set this to the Azure Storage Account Name in use. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. +If this is blank and if env_auth is set it will be read from the +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. +Enter a value. Press Enter to leave empty. account> account_name -Storage Account Key + +Option share_name. +Azure Files Share Name. +This is required and is the name of the share to access. +Enter a value. Press Enter to leave empty. +share_name> share_name + +Option env_auth. +Read credentials from runtime (environment variables, CLI or MSI). +See the [authentication docs](/azurefiles#authentication) for full info. +Enter a boolean value (true or false). Press Enter for the default (false). +env_auth> + +Option key. +Storage Account Shared Key. +Leave blank to use SAS URL or connection string. +Enter a value. Press Enter to leave empty. key> base64encodedkey== -Endpoint for the service - leave blank normally. -endpoint> -Remote config --------------------- -[remote] -account = account_name -key = base64encodedkey== -endpoint = --------------------- -y) Yes this is OK + +Option sas_url. +SAS URL. +Leave blank if using account/key or connection string. +Enter a value. Press Enter to leave empty. +sas_url> + +Option connection_string. +Azure Files Connection String. +Enter a value. Press Enter to leave empty. +connection_string> +[snip] + +Configuration complete. +Options: +- type: azurefiles +- account: account_name +- share_name: share_name +- key: base64encodedkey== +Keep this "remote" remote? +y) Yes this is OK (default) e) Edit this remote d) Delete this remote -y/e/d> y +y/e/d> ``` -See all containers - - rclone lsd remote: +Once configured you can use rclone. -Make a new container +See all files in the top level: - rclone mkdir remote:container + rclone lsf remote: -List the contents of a container +Make a new directory in the root: - rclone ls remote:container + rclone mkdir remote:dir -Sync `/home/local/directory` to the remote container, deleting any excess -files in the container. +Recursively List the contents: - rclone sync --interactive /home/local/directory remote:container + rclone ls remote: -### --fast-list +Sync `/home/local/directory` to the remote directory, deleting any +excess files in the directory. -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. + rclone sync --interactive /home/local/directory remote:dir ### Modified time -The modified time is stored as metadata on the object with the `mtime` -key. It is stored using RFC3339 Format time with nanosecond -precision. The metadata is supplied during directory listings so -there is no performance overhead to using it. - -If you wish to use the Azure standard `LastModified` time stored on -the object as the modified time, then use the `--use-server-modtime` -flag. Note that rclone can't set `LastModified`, so using the -`--update` flag when syncing is recommended if using -`--use-server-modtime`. +The modified time is stored as Azure standard `LastModified` time on +files ### Performance When uploading large files, increasing the value of -`--azureblob-upload-concurrency` will increase performance at the cost +`--azurefiles-upload-concurrency` will increase performance at the cost of using more memory. The default of 16 is set quite conservatively to use less memory. It maybe be necessary raise it to 64 or higher to fully utilize a 1 GBit/s link with a single file transfer. @@ -34101,8 +39566,14 @@ the following characters are also replaced: | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| / | 0x2F | / | -| \ | 0x5C | \ | +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \ | 0x5C | \ | +| \| | 0x7C | | | File names can also not end with the following characters. These only get replaced if they are the last character in the name: @@ -34116,13 +39587,12 @@ as they can't be used in JSON strings. ### Hashes -MD5 hashes are stored with blobs. However blobs that were uploaded in -chunks only have an MD5 if the source remote was capable of MD5 -hashes, e.g. the local disk. +MD5 hashes are stored with files. Not all files will have MD5 hashes +as these have to be uploaded with the file. ### Authentication {#authentication} -There are a number of ways of supplying credentials for Azure Blob +There are a number of ways of supplying credentials for Azure Files Storage. Rclone tries them in the order of the sections below. #### Env Auth @@ -34160,6 +39630,12 @@ It reads configuration from these variables, in the following order: - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to - `AZURE_USERNAME`: a username (usually an email address) - `AZURE_PASSWORD`: the user's password +4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). + ##### Env Auth: 2. Managed Service Identity Credentials @@ -34183,15 +39659,11 @@ For example if you were to login with a service principal like this: Then you could access rclone resources like this: - rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER + rclone lsf :azurefiles,env_auth,account=ACCOUNT: Or - rclone lsf --azureblob-env-auth --azureblob-acccount=ACCOUNT :azureblob:CONTAINER - -Which is analogous to using the `az` tool: - - az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: #### Account and Shared Key @@ -34200,34 +39672,11 @@ in the `account` and `key` lines and leave the rest blank. #### SAS URL -This can be an account level SAS URL or container level SAS URL. - -To use it leave `account` and `key` blank and fill in `sas_url`. - -An account level SAS URL or container level SAS URL can be obtained -from the Azure portal or the Azure Storage Explorer. To get a -container level SAS URL right click on a container in the Azure Blob -explorer in the Azure portal. - -If you use a container level SAS URL, rclone operations are permitted -only on a particular container, e.g. - - rclone ls azureblob:container - -You can also list the single container from the root. This will only -show the container specified by the SAS URL. - - $ rclone lsd azureblob: - container/ - -Note that you can't see or access any other containers - this will -fail +To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`. - rclone ls azureblob:othercontainer +#### Connection String -Container level SAS URLs are useful for temporarily allowing third -parties access to a single container or putting credentials into an -untrusted environment such as a CI build server. +To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`. #### Service principal with client secret @@ -34286,15 +39735,15 @@ set, this is is equivalent to using `env_auth`. ### Standard options -Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Standard options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-account +#### --azurefiles-account Azure Storage Account Name. Set this to the Azure Storage Account Name in use. -Leave blank to use SAS URL or Emulator, otherwise it needs to be set. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. @@ -34303,50 +39752,75 @@ environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. Properties: - Config: account -- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Env Var: RCLONE_AZUREFILES_ACCOUNT - Type: string - Required: false -#### --azureblob-env-auth +#### --azurefiles-share-name + +Azure Files Share Name. + +This is required and is the name of the share to access. + + +Properties: + +- Config: share_name +- Env Var: RCLONE_AZUREFILES_SHARE_NAME +- Type: string +- Required: false + +#### --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI). -See the [authentication docs](/azureblob#authentication) for full info. +See the [authentication docs](/azurefiles#authentication) for full info. Properties: - Config: env_auth -- Env Var: RCLONE_AZUREBLOB_ENV_AUTH +- Env Var: RCLONE_AZUREFILES_ENV_AUTH - Type: bool - Default: false -#### --azureblob-key +#### --azurefiles-key Storage Account Shared Key. -Leave blank to use SAS URL or Emulator. +Leave blank to use SAS URL or connection string. Properties: - Config: key -- Env Var: RCLONE_AZUREBLOB_KEY +- Env Var: RCLONE_AZUREFILES_KEY - Type: string - Required: false -#### --azureblob-sas-url +#### --azurefiles-sas-url -SAS URL for container level access only. +SAS URL. -Leave blank if using account/key or Emulator. +Leave blank if using account/key or connection string. Properties: - Config: sas_url -- Env Var: RCLONE_AZUREBLOB_SAS_URL +- Env Var: RCLONE_AZUREFILES_SAS_URL - Type: string - Required: false -#### --azureblob-tenant +#### --azurefiles-connection-string + +Azure Files Connection String. + +Properties: + +- Config: connection_string +- Env Var: RCLONE_AZUREFILES_CONNECTION_STRING +- Type: string +- Required: false + +#### --azurefiles-tenant ID of the service principal's tenant. Also called its directory ID. @@ -34359,11 +39833,11 @@ Set this if using Properties: - Config: tenant -- Env Var: RCLONE_AZUREBLOB_TENANT +- Env Var: RCLONE_AZUREFILES_TENANT - Type: string - Required: false -#### --azureblob-client-id +#### --azurefiles-client-id The ID of the client in use. @@ -34376,11 +39850,11 @@ Set this if using Properties: - Config: client_id -- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_CLIENT_ID - Type: string - Required: false -#### --azureblob-client-secret +#### --azurefiles-client-secret One of the service principal's client secrets @@ -34391,11 +39865,11 @@ Set this if using Properties: - Config: client_secret -- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Env Var: RCLONE_AZUREFILES_CLIENT_SECRET - Type: string - Required: false -#### --azureblob-client-certificate-path +#### --azurefiles-client-certificate-path Path to a PEM or PKCS12 certificate file including the private key. @@ -34406,11 +39880,11 @@ Set this if using Properties: - Config: client_certificate_path -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH - Type: string - Required: false -#### --azureblob-client-certificate-password +#### --azurefiles-client-certificate-password Password for the certificate file (optional). @@ -34425,15 +39899,15 @@ And the certificate has a password. Properties: - Config: client_certificate_password -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD - Type: string - Required: false ### Advanced options -Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Advanced options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-client-send-certificate-chain +#### --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth. @@ -34448,11 +39922,11 @@ Optionally set this if using Properties: - Config: client_send_certificate_chain -- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN +- Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false -#### --azureblob-username +#### --azurefiles-username User name (usually an email address) @@ -34463,11 +39937,11 @@ Set this if using Properties: - Config: username -- Env Var: RCLONE_AZUREBLOB_USERNAME +- Env Var: RCLONE_AZUREFILES_USERNAME - Type: string - Required: false -#### --azureblob-password +#### --azurefiles-password The user's password @@ -34480,22 +39954,24 @@ Set this if using Properties: - Config: password -- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Env Var: RCLONE_AZUREFILES_PASSWORD - Type: string - Required: false -#### --azureblob-service-principal-file +#### --azurefiles-service-principal-file Path to file containing credentials for use with a service principal. Leave blank normally. Needed only if you want to use a service principal instead of interactive login. $ az ad sp create-for-rbac --name "" \ - --role "Storage Blob Data Owner" \ + --role "Storage Files Data Owner" \ --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ > azure-principal.json -See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + +**NB** this section needs updating for Azure Files - pull requests appreciated! It may be more convenient to put the credentials directly into the rclone config file under the `client_id`, `tenant` and `client_secret` @@ -34505,11 +39981,11 @@ keys instead of setting `service_principal_file`. Properties: - Config: service_principal_file -- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE +- Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE - Type: string - Required: false -#### --azureblob-use-msi +#### --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure). @@ -34525,11 +40001,11 @@ msi_client_id, or msi_mi_res_id parameters. Properties: - Config: use_msi -- Env Var: RCLONE_AZUREBLOB_USE_MSI +- Env Var: RCLONE_AZUREFILES_USE_MSI - Type: bool - Default: false -#### --azureblob-msi-object-id +#### --azurefiles-msi-object-id Object ID of the user-assigned MSI to use, if any. @@ -34538,11 +40014,11 @@ Leave blank if msi_client_id or msi_mi_res_id specified. Properties: - Config: msi_object_id -- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID - Type: string - Required: false -#### --azureblob-msi-client-id +#### --azurefiles-msi-client-id Object ID of the user-assigned MSI to use, if any. @@ -34551,11 +40027,11 @@ Leave blank if msi_object_id or msi_mi_res_id specified. Properties: - Config: msi_client_id -- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID - Type: string - Required: false -#### --azureblob-msi-mi-res-id +#### --azurefiles-msi-mi-res-id Azure resource ID of the user-assigned MSI to use, if any. @@ -34564,24 +40040,11 @@ Leave blank if msi_client_id or msi_object_id specified. Properties: - Config: msi_mi_res_id -- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID - Type: string - Required: false -#### --azureblob-use-emulator - -Uses local storage emulator if provided as 'true'. - -Leave blank if using real azure storage endpoint. - -Properties: - -- Config: use_emulator -- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR -- Type: bool -- Default: false - -#### --azureblob-endpoint +#### --azurefiles-endpoint Endpoint for the service. @@ -34590,37 +40053,26 @@ Leave blank normally. Properties: - Config: endpoint -- Env Var: RCLONE_AZUREBLOB_ENDPOINT -- Type: string -- Required: false - -#### --azureblob-upload-cutoff - -Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). - -Properties: - -- Config: upload_cutoff -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF +- Env Var: RCLONE_AZUREFILES_ENDPOINT - Type: string - Required: false -#### --azureblob-chunk-size +#### --azurefiles-chunk-size Upload chunk size. Note that this is stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: chunk_size -- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Env Var: RCLONE_AZUREFILES_CHUNK_SIZE - Type: SizeSuffix - Default: 4Mi -#### --azureblob-upload-concurrency +#### --azurefiles-upload-concurrency Concurrency for multipart uploads. @@ -34631,128 +40083,41 @@ If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers. -In tests, upload speed increases almost linearly with upload -concurrency. For example to fill a gigabit pipe it may be necessary to -raise this to 64. Note that this will use more memory. - Note that chunks are stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: upload_concurrency -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY - Type: int - Default: 16 -#### --azureblob-list-chunk - -Size of blob list. - -This sets the number of blobs requested in each listing chunk. Default -is the maximum, 5000. "List blobs" requests are permitted 2 minutes -per megabyte to complete. If an operation is taking longer than 2 -minutes per megabyte on average, it will time out ( -[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) -). This can be used to limit the number of blobs items to return, to -avoid the time out. - -Properties: - -- Config: list_chunk -- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK -- Type: int -- Default: 5000 - -#### --azureblob-access-tier - -Access tier of blob: hot, cool or archive. - -Archived blobs can be restored by setting access tier to hot or -cool. Leave blank if you intend to use default access tier, which is -set at account level - -If there is no "access tier" specified, rclone doesn't apply any tier. -rclone performs "Set Tier" operation on blobs while uploading, if objects -are not modified, specifying "access tier" to new one will have no effect. -If blobs are in "archive tier" at remote, trying to perform data transfer -operations from remote will not be allowed. User should first restore by -tiering blob to "Hot" or "Cool". - -Properties: - -- Config: access_tier -- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER -- Type: string -- Required: false +#### --azurefiles-max-stream-size -#### --azureblob-archive-tier-delete +Max size for streamed files. -Delete archive tier blobs before overwriting. +Azure files needs to know in advance how big the file will be. When +rclone doesn't know it uses this value instead. -Archive tier blobs cannot be updated. So without this flag, if you -attempt to update an archive tier blob, then rclone will produce the -error: +This will be used when rclone is streaming data, the most common uses are: - can't update archive tier blob without --azureblob-archive-tier-delete +- Uploading files with `--vfs-cache-mode off` with `rclone mount` +- Using `rclone rcat` +- Copying files with unknown length -With this flag set then before rclone attempts to overwrite an archive -tier blob, it will delete the existing blob before uploading its -replacement. This has the potential for data loss if the upload fails -(unlike updating a normal blob) and also may cost more since deleting -archive tier blobs early may be chargable. +You will need this much free space in the share as the file will be this size temporarily. Properties: -- Config: archive_tier_delete -- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE -- Type: bool -- Default: false - -#### --azureblob-disable-checksum - -Don't store MD5 checksum with object metadata. - -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. - -Properties: - -- Config: disable_checksum -- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM -- Type: bool -- Default: false - -#### --azureblob-memory-pool-flush-time - -How often internal memory buffer pools will be flushed. - -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool. - -Properties: - -- Config: memory_pool_flush_time -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s - -#### --azureblob-memory-pool-use-mmap - -Whether to use mmap buffers in internal memory pool. - -Properties: - -- Config: memory_pool_use_mmap -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false +- Config: max_stream_size +- Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE +- Type: SizeSuffix +- Default: 10Gi -#### --azureblob-encoding +#### --azurefiles-encoding The encoding for the backend. @@ -34761,54 +40126,9 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 - -#### --azureblob-public-access - -Public access level of a container: blob or container. - -Properties: - -- Config: public_access -- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS -- Type: string -- Required: false -- Examples: - - "" - - The container and its blobs can be accessed only with an authorized request. - - It's a default value. - - "blob" - - Blob data within this container can be read via anonymous request. - - "container" - - Allow full public read access for container and blob data. - -#### --azureblob-no-check-container - -If set, don't attempt to check the container exists or create it. - -This can be useful when trying to minimise the number of transactions -rclone does if you know the container exists already. - - -Properties: - -- Config: no_check_container -- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER -- Type: bool -- Default: false - -#### --azureblob-no-head-object - -If set, do not do HEAD before GET when getting objects. - -Properties: - -- Config: no_head_object -- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT -- Type: bool -- Default: false +- Env Var: RCLONE_AZUREFILES_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot @@ -34829,30 +40149,6 @@ Eg `--header-upload "Content-Type: text/potato"` MD5 sums are only uploaded with chunked files if the source has an MD5 sum. This will always be the case for a local to azure copy. -`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - -## Azure Storage Emulator Support - -You can run rclone with the storage emulator (usually _azurite_). - -To do this, just set up a new remote with `rclone config` following -the instructions in the introduction and set `use_emulator` in the -advanced settings as `true`. You do not need to provide a default -account name nor an account key. But you can override them in the -`account` and `key` options. (Prior to v1.61 they were hard coded to -_azurite_'s `devstoreaccount1`.) - -Also, if you want to access a storage emulator instance running on a -different machine, you can override the `endpoint` parameter in the -advanced settings, setting it to -`http(s)://:/devstoreaccount1` -(e.g. `http://10.254.2.5:10000/devstoreaccount1`). - # Microsoft OneDrive Paths are specified as `remote:path` @@ -35011,7 +40307,7 @@ You may try to [verify you account](https://docs.microsoft.com/en-us/azure/activ Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). -### Modification time and hashes +### Modification times and hashes OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -35032,6 +40328,32 @@ your workflow. For all types of OneDrive you can use the `--checksum` flag. +### --fast-list + +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +This must be enabled with the `--onedrive-delta` flag (or `delta = +true` in the config file) as it can cause performance degradation. + +It does this by using the delta listing facilities of OneDrive which +returns all the files in the remote very efficiently. This is much +more efficient than listing directories recursively and is Microsoft's +recommended way of reading all the file information from a drive. + +This can be useful with `rclone mount` and [rclone rc vfs/refresh +recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with +information about all the files. + +The API used for the recursive listing (`ListR`) only supports listing +from the root of the drive. This will become increasingly inefficient +the further away you get from the root as rclone will have to discard +files outside of the directory you are using. + +Some commands (like `rclone lsf -R`) will use `ListR` by default - you +can turn this off with `--disable ListR` if you need to. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -35277,6 +40599,8 @@ Properties: #### --onedrive-server-side-across-configs +Deprecated: use --server-side-across-configs instead. + Allow server-side operations (e.g. copy) to work across different onedrive configs. This will only work if you are copying between two OneDrive *Personal* drives AND @@ -35380,7 +40704,7 @@ Properties: Specify the hash in use for the backend. This specifies the hash type in use. If set to "auto" it will use the -default hash which is is QuickXorHash. +default hash which is QuickXorHash. Before rclone 1.62 an SHA1 hash was used by default for Onedrive Personal. For 1.62 and later the default is to use a QuickXorHash for @@ -35417,6 +40741,67 @@ Properties: - "none" - None - don't use any hashes +#### --onedrive-av-override + +Allows download of files the server thinks has a virus. + +The onedrive/sharepoint server may check files uploaded with an Anti +Virus checker. If it detects any potential viruses or malware it will +block download of the file. + +In this case you will see a message like this + + server reports this file is infected with a virus - use --onedrive-av-override to download anyway: Infected (name of virus): 403 Forbidden: + +If you are 100% sure you want to download this file anyway then use +the --onedrive-av-override flag, or av_override = true in the config +file. + + +Properties: + +- Config: av_override +- Env Var: RCLONE_ONEDRIVE_AV_OVERRIDE +- Type: bool +- Default: false + +#### --onedrive-delta + +If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise `ListR` +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the `root/directory` in `onedrive:root/directory`) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone `rc vfs/refresh`. + + +Properties: + +- Config: delta +- Env Var: RCLONE_ONEDRIVE_DELTA +- Type: bool +- Default: false + #### --onedrive-encoding The encoding for the backend. @@ -35427,7 +40812,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -35721,12 +41106,14 @@ To copy a local directory to an OpenDrive directory called backup rclone copy /home/source remote:backup -### Modified time and MD5SUMs +### Modification times and hashes OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -35800,7 +41187,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size @@ -35838,13 +41225,17 @@ remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) # Oracle Object Storage -[Oracle Object Storage Overview](https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/objectstorageoverview.htm) - -[Oracle Object Storage FAQ](https://www.oracle.com/cloud/storage/object-storage/faq/) +- [Oracle Object Storage Overview](https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/objectstorageoverview.htm) +- [Oracle Object Storage FAQ](https://www.oracle.com/cloud/storage/object-storage/faq/) +- [Oracle Object Storage Limits](https://docs.oracle.com/en-us/iaas/Content/Resources/Assets/whitepapers/oci-object-storage-best-practices.pdf) Paths are specified as `remote:bucket` (or `remote:` for the `lsd` command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +Sample command to transfer local artifacts to remote:bucket in oracle object storage: + +`rclone -vvv --progress --stats-one-line --max-stats-groups 10 --log-format date,time,UTC,longfile --fast-list --buffer-size 256Mi --oos-no-check-bucket --oos-upload-cutoff 10Mi --multi-thread-cutoff 16Mi --multi-thread-streams 3000 --transfers 3000 --checkers 64 --retries 2 --oos-chunk-size 10Mi --oos-upload-concurrency 10000 --oos-attempt-resume-upload --oos-leave-parts-on-error sync ./artifacts remote:bucket -vv` + ## Configuration Here is an example of making an oracle object storage configuration. `rclone config` walks you @@ -35968,7 +41359,7 @@ List the contents of a bucket rclone ls remote:bucket rclone ls remote:bucket --max-depth 1 -### OCI Authentication Provider +## Authentication Providers OCI has various authentication methods. To learn more about authentication methods please refer [oci authentication methods](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm) @@ -35981,7 +41372,8 @@ Rclone supports the following OCI authentication provider. Resource Principal No authentication -#### Authentication provider choice: User Principal +### User Principal + Sample rclone config file for Authentication Provider User Principal: [oos] @@ -36001,7 +41393,8 @@ Considerations: - Overhead of managing users and keys. - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials. -#### Authentication provider choice: Instance Principal +### Instance Principal + An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. With this approach no credentials have to be stored and managed. @@ -36030,7 +41423,8 @@ Considerations: - Everyone who has access to this machine can execute the CLI commands. - It is applicable for oci compute instances only. It cannot be used on external instance or resources. -#### Authentication provider choice: Resource Principal +### Resource Principal + Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). To use resource principal ensure Rclone process is started with these environment variables set in its process. @@ -36049,7 +41443,8 @@ Sample rclone configuration file for Authentication Provider Resource Principal: region = us-ashburn-1 provider = resource_principal_auth -#### Authentication provider choice: No authentication +### No authentication + Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication: @@ -36060,10 +41455,9 @@ Sample rclone configuration file for No authentication: region = us-ashburn-1 provider = no_auth -## Options -### Modified time +### Modification times and hashes -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as `opc-meta-mtime` as floating point since the epoch, accurate to 1 ns. If the modification time needs to be updated rclone will attempt to perform a server @@ -36073,6 +41467,8 @@ In the case the object is larger than 5Gb, the object will be uploaded rather th Note that reading this from the object takes an additional `HEAD` request as the metadata isn't returned in object listings. +The MD5 hash algorithm is supported. + ### Multipart uploads rclone supports multipart uploads with OOS which means that it can @@ -36252,9 +41648,8 @@ Properties: Chunk size to use for uploading. When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads -using this chunk size. +size (e.g. from "rclone rcat" or uploaded with "rclone mount" they will be uploaded +as multipart uploads using this chunk size. Note that "upload_concurrency" chunks of this size are buffered in memory per transfer. @@ -36282,6 +41677,26 @@ Properties: - Type: SizeSuffix - Default: 5Mi +#### --oos-max-upload-parts + +Maximum number of parts in a multipart upload. + +This option defines the maximum number of multipart chunks to use +when doing a multipart upload. + +OCI has max parts limit of 10,000 chunks. + +Rclone will automatically increase the chunk size when uploading a +large file of a known size to stay below this number of chunks limit. + + +Properties: + +- Config: max_upload_parts +- Env Var: RCLONE_OOS_MAX_UPLOAD_PARTS +- Type: int +- Default: 10000 + #### --oos-upload-concurrency Concurrency for multipart uploads. @@ -36356,12 +41771,12 @@ Properties: - Config: encoding - Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error -If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. +If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery. It should be set to true for resuming uploads across different sessions. @@ -36376,6 +41791,24 @@ Properties: - Type: bool - Default: false +#### --oos-attempt-resume-upload + +If true attempt to resume previously started multipart upload for the object. +This will be helpful to speed up multipart transfers by resuming uploads from past session. + +WARNING: If chunk size differs in resumed session from past incomplete session, then the resumed multipart upload is +aborted and a new multipart upload is started with the new chunk size. + +The flag leave_parts_on_error must be true to resume and optimize to skip parts that were already uploaded successfully. + + +Properties: + +- Config: attempt_resume_upload +- Env Var: RCLONE_OOS_ATTEMPT_RESUME_UPLOAD +- Type: bool +- Default: false + #### --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it. @@ -36444,7 +41877,7 @@ Properties: #### --oos-sse-kms-key-id -if using using your own master key in vault, this header specifies the +if using your own master key in vault, this header specifies the OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed. @@ -36559,6 +41992,9 @@ Options: +## Tutorials +### [Mounting Buckets](https://rclone.org/oracleobjectstorage/tutorial_mount/) + # QingStor Paths are specified as `remote:bucket` (or `remote:` for the `lsd` @@ -36862,7 +42298,7 @@ Properties: - Config: encoding - Env Var: RCLONE_QINGSTOR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8 @@ -36876,6 +42312,250 @@ remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +# Quatrix + +Quatrix by Maytech is [Quatrix Secure Compliant File Sharing | Maytech](https://www.maytech.net/products/quatrix-business). + +Paths are specified as `remote:path` + +Paths may be as deep as required, e.g., `remote:directory/subdirectory`. + +The initial setup for Quatrix involves getting an API Key from Quatrix. You can get the API key in the user's profile at `https:///profile/api-keys` +or with the help of the API - https://docs.maytech.net/quatrix/quatrix-api/api-explorer#/API-Key/post_api_key_create. + +See complete Swagger documentation for Quatrix - https://docs.maytech.net/quatrix/quatrix-api/api-explorer + +## Configuration + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Quatrix by Maytech + \ "quatrix" +[snip] +Storage> quatrix +API key for accessing Quatrix account. +api_key> your_api_key +Host name of Quatrix account. +host> example.quatrix.it + +-------------------- +[remote] +api_key = your_api_key +host = example.quatrix.it +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +Once configured you can then use `rclone` like this, + +List directories in top level of your Quatrix + + rclone lsd remote: + +List all the files in your Quatrix + + rclone ls remote: + +To copy a local directory to an Quatrix directory called backup + + rclone copy /home/source remote:backup + +### API key validity + +API Key is created with no expiration date. It will be valid until you delete or deactivate it in your account. +After disabling, the API Key can be enabled back. If the API Key was deleted and a new key was created, you can +update it in rclone config. The same happens if the hostname was changed. + +``` +$ rclone config +Current remotes: + +Name Type +==== ==== +remote quatrix + +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> e +Choose a number from below, or type in an existing value + 1 > remote +remote> remote +-------------------- +[remote] +type = quatrix +host = some_host.quatrix.it +api_key = your_api_key +-------------------- +Edit remote +Option api_key. +API key for accessing Quatrix account +Enter a string value. Press Enter for the default (your_api_key) +api_key> +Option host. +Host name of Quatrix account +Enter a string value. Press Enter for the default (some_host.quatrix.it). + +-------------------- +[remote] +type = quatrix +host = some_host.quatrix.it +api_key = your_api_key +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +### Modification times and hashes + +Quatrix allows modification times to be set on objects accurate to 1 microsecond. +These will be used to detect whether objects need syncing or not. + +Quatrix does not support hashes, so you cannot use the `--checksum` flag. + +### Restricted filename characters + +File names in Quatrix are case sensitive and have limitations like the maximum length of a filename is 255, and the minimum length is 1. A file name cannot be equal to `.` or `..` nor contain `/` , `\` or non-printable ascii. + +### Transfers + +For files above 50 MiB rclone will use a chunked transfer. Rclone will upload up to `--transfers` chunks at the same time (shared among all multipart uploads). +Chunks are buffered in memory, and the minimal chunk size is 10_000_000 bytes by default, and it can be changed in the advanced configuration, so increasing `--transfers` will increase the memory use. +The chunk size has a maximum size limit, which is set to 100_000_000 bytes by default and can be changed in the advanced configuration. +The size of the uploaded chunk will dynamically change depending on the upload speed. +The total memory use equals the number of transfers multiplied by the minimal chunk size. +In case there's free memory allocated for the upload (which equals the difference of `maximal_summary_chunk_size` and `minimal_chunk_size` * `transfers`), +the chunk size may increase in case of high upload speed. As well as it can decrease in case of upload speed problems. +If no free memory is available, all chunks will equal `minimal_chunk_size`. + +### Deleting files + +Files you delete with rclone will end up in Trash and be stored there for 30 days. +Quatrix also provides an API to permanently delete files and an API to empty the Trash so that you can remove files permanently from your account. + + +### Standard options + +Here are the Standard options specific to quatrix (Quatrix by Maytech). + +#### --quatrix-api-key + +API key for accessing Quatrix account + +Properties: + +- Config: api_key +- Env Var: RCLONE_QUATRIX_API_KEY +- Type: string +- Required: true + +#### --quatrix-host + +Host name of Quatrix account + +Properties: + +- Config: host +- Env Var: RCLONE_QUATRIX_HOST +- Type: string +- Required: true + +### Advanced options + +Here are the Advanced options specific to quatrix (Quatrix by Maytech). + +#### --quatrix-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_QUATRIX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + +#### --quatrix-effective-upload-time + +Wanted upload time for one chunk + +Properties: + +- Config: effective_upload_time +- Env Var: RCLONE_QUATRIX_EFFECTIVE_UPLOAD_TIME +- Type: string +- Default: "4s" + +#### --quatrix-minimal-chunk-size + +The minimal size for one chunk + +Properties: + +- Config: minimal_chunk_size +- Env Var: RCLONE_QUATRIX_MINIMAL_CHUNK_SIZE +- Type: SizeSuffix +- Default: 9.537Mi + +#### --quatrix-maximal-summary-chunk-size + +The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' + +Properties: + +- Config: maximal_summary_chunk_size +- Env Var: RCLONE_QUATRIX_MAXIMAL_SUMMARY_CHUNK_SIZE +- Type: SizeSuffix +- Default: 95.367Mi + +#### --quatrix-hard-delete + +Delete files permanently rather than putting them into the trash. + +Properties: + +- Config: hard_delete +- Env Var: RCLONE_QUATRIX_HARD_DELETE +- Type: bool +- Default: false + + + +## Storage usage + +The storage usage in Quatrix is restricted to the account during the purchase. You can restrict any user with a smaller storage limit. +The account limit is applied if the user has no custom storage limit. Once you've reached the limit, the upload of files will fail. +This can be fixed by freeing up the space or increasing the quota. + +## Server-side operations + +Quatrix supports server-side operations (copy and move). In case of conflict, files are overwritten during server-side operation. + # Sia Sia ([sia.tech](https://sia.tech/)) is a decentralized cloud storage platform @@ -37062,7 +42742,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SIA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot @@ -37087,6 +42767,7 @@ Commercial implementations of that being: * [Memset Memstore](https://www.memset.com/cloud/storage/) * [OVH Object Storage](https://www.ovh.co.uk/public-cloud/storage/object-storage/) * [Oracle Cloud Storage](https://docs.oracle.com/en-us/iaas/integration/doc/configure-object-storage.html) + * [Blomp Cloud Storage](https://www.blomp.com/cloud-storage/) * [IBM Bluemix Cloud ObjectStorage Swift](https://console.bluemix.net/docs/infrastructure/objectstorage-swift/index.html) Paths are specified as `remote:container` (or `remote:` for the `lsd` @@ -37110,7 +42791,7 @@ name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) +XX / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH) \ "swift" [snip] Storage> swift @@ -37139,6 +42820,8 @@ Choose a number from below, or type in your own value \ "https://auth.storage.memset.com/v2.0" 6 / OVH \ "https://auth.cloud.ovh.net/v3" + 7 / Blomp Cloud Storage + \ "https://authenticate.ain.net" auth> User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID). user_id> @@ -37298,7 +42981,7 @@ sufficient to determine if it is "dirty". By using `--update` along with `--use-server-modtime`, you can avoid the extra API call and simply upload files whose local modtime is newer than the time it was last uploaded. -### Modified time +### Modification times and hashes The modified time is stored as metadata on the object as `X-Object-Meta-Mtime` as floating point since the epoch accurate to 1 @@ -37307,6 +42990,8 @@ ns. This is a de facto standard (used in the official python-swiftclient amongst others) for storing the modification time for an object. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -37320,7 +43005,7 @@ as they can't be used in JSON strings. ### Standard options -Here are the Standard options specific to swift (OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)). +Here are the Standard options specific to swift (OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)). #### --swift-env-auth @@ -37384,6 +43069,8 @@ Properties: - Memset Memstore UK v2 - "https://auth.cloud.ovh.net/v3" - OVH + - "https://authenticate.ain.net" + - Blomp Cloud Storage #### --swift-user-id @@ -37560,7 +43247,7 @@ Properties: ### Advanced options -Here are the Advanced options specific to swift (OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)). +Here are the Advanced options specific to swift (OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)). #### --swift-leave-parts-on-error @@ -37651,7 +43338,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SWIFT_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8 @@ -37779,7 +43466,7 @@ To copy a local directory to a pCloud directory called backup rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes pCloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -37918,7 +43605,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PCLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --pcloud-root-folder-id @@ -37983,6 +43670,314 @@ Properties: +# PikPak + +PikPak is [a private cloud drive](https://mypikpak.com/). + +Paths are specified as `remote:path`, and may be as deep as required, e.g. `remote:directory/subdirectory`. + +## Configuration + +Here is an example of making a remote for PikPak. + +First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter name for new remote. +name> remote + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / PikPak + \ (pikpak) +Storage> XX + +Option user. +Pikpak username. +Enter a value. +user> USERNAME + +Option pass. +Pikpak password. +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: + +Edit advanced config? +y) Yes +n) No (default) +y/n> + +Configuration complete. +Options: +- type: pikpak +- user: USERNAME +- pass: *** ENCRYPTED *** +- token: {"access_token":"eyJ...","token_type":"Bearer","refresh_token":"os...","expiry":"2023-01-26T18:54:32.170582647+09:00"} +Keep this "remote" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +### Modification times and hashes + +PikPak keeps modification times on objects, and updates them when uploading objects, +but it does not support changing only the modification time + +The MD5 hash algorithm is supported. + + +### Standard options + +Here are the Standard options specific to pikpak (PikPak). + +#### --pikpak-user + +Pikpak username. + +Properties: + +- Config: user +- Env Var: RCLONE_PIKPAK_USER +- Type: string +- Required: true + +#### --pikpak-pass + +Pikpak password. + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + +Properties: + +- Config: pass +- Env Var: RCLONE_PIKPAK_PASS +- Type: string +- Required: true + +### Advanced options + +Here are the Advanced options specific to pikpak (PikPak). + +#### --pikpak-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_PIKPAK_CLIENT_ID +- Type: string +- Required: false + +#### --pikpak-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_PIKPAK_CLIENT_SECRET +- Type: string +- Required: false + +#### --pikpak-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_PIKPAK_TOKEN +- Type: string +- Required: false + +#### --pikpak-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_PIKPAK_AUTH_URL +- Type: string +- Required: false + +#### --pikpak-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_PIKPAK_TOKEN_URL +- Type: string +- Required: false + +#### --pikpak-root-folder-id + +ID of the root folder. +Leave blank normally. + +Fill in for rclone to use a non root folder as its starting point. + + +Properties: + +- Config: root_folder_id +- Env Var: RCLONE_PIKPAK_ROOT_FOLDER_ID +- Type: string +- Required: false + +#### --pikpak-use-trash + +Send files to the trash instead of deleting permanently. + +Defaults to true, namely sending files to the trash. +Use `--pikpak-use-trash=false` to delete files permanently instead. + +Properties: + +- Config: use_trash +- Env Var: RCLONE_PIKPAK_USE_TRASH +- Type: bool +- Default: true + +#### --pikpak-trashed-only + +Only show files that are in the trash. + +This will show trashed files in their original directory structure. + +Properties: + +- Config: trashed_only +- Env Var: RCLONE_PIKPAK_TRASHED_ONLY +- Type: bool +- Default: false + +#### --pikpak-hash-memory-limit + +Files bigger than this will be cached on disk to calculate hash if required. + +Properties: + +- Config: hash_memory_limit +- Env Var: RCLONE_PIKPAK_HASH_MEMORY_LIMIT +- Type: SizeSuffix +- Default: 10Mi + +#### --pikpak-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_PIKPAK_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot + +## Backend commands + +Here are the commands specific to the pikpak backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). + +### addurl + +Add offline download task for url + + rclone backend addurl remote: [options] [+] + +This command adds offline download task for url. + +Usage: + + rclone backend addurl pikpak:dirpath url + +Downloads will be stored in 'dirpath'. If 'dirpath' is invalid, +download will fallback to default 'My Pack' folder. + + +### decompress + +Request decompress of a file/files in a folder + + rclone backend decompress remote: [options] [+] + +This command requests decompress of file/files in a folder. + +Usage: + + rclone backend decompress pikpak:dirpath {filename} -o password=password + rclone backend decompress pikpak:dirpath {filename} -o delete-src-file + +An optional argument 'filename' can be specified for a file located in +'pikpak:dirpath'. You may want to pass '-o password=password' for a +password-protected files. Also, pass '-o delete-src-file' to delete +source files after decompression finished. + +Result: + + { + "Decompressed": 17, + "SourceDeleted": 0, + "Errors": 0 + } + + + + +## Limitations + +### Hashes may be empty + +PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files. + +### Deleted files still visible with trashed-only + +Deleted files will still be visible with `--pikpak-trashed-only` even after the +trash emptied. This goes away after few days. + # premiumize.me Paths are specified as `remote:path` @@ -38063,7 +44058,7 @@ To copy a local directory to an premiumize.me directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes premiumize.me does not support modification times or hashes, therefore syncing will default to `--size-only` checking. Note that using @@ -38087,6 +44082,32 @@ as they can't be used in JSON strings. Here are the Standard options specific to premiumizeme (premiumize.me). +#### --premiumizeme-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_PREMIUMIZEME_CLIENT_ID +- Type: string +- Required: false + +#### --premiumizeme-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_PREMIUMIZEME_CLIENT_SECRET +- Type: string +- Required: false + #### --premiumizeme-api-key API Key. @@ -38105,6 +44126,43 @@ Properties: Here are the Advanced options specific to premiumizeme (premiumize.me). +#### --premiumizeme-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_PREMIUMIZEME_TOKEN +- Type: string +- Required: false + +#### --premiumizeme-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_PREMIUMIZEME_AUTH_URL +- Type: string +- Required: false + +#### --premiumizeme-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_PREMIUMIZEME_TOKEN_URL +- Type: string +- Required: false + #### --premiumizeme-encoding The encoding for the backend. @@ -38115,7 +44173,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PREMIUMIZEME_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -38131,6 +44189,359 @@ rclone maps these to and from an identical looking unicode equivalents premiumize.me only supports filenames up to 255 characters in length. +# Proton Drive + +[Proton Drive](https://proton.me/drive) is an end-to-end encrypted Swiss vault + for your files that protects your data. + +This is an rclone backend for Proton Drive which supports the file transfer +features of Proton Drive using the same client-side encryption. + +Due to the fact that Proton Drive doesn't publish its API documentation, this +backend is implemented with best efforts by reading the open-sourced client +source code and observing the Proton Drive traffic in the browser. + +**NB** This backend is currently in Beta. It is believed to be correct +and all the integration tests pass. However the Proton Drive protocol +has evolved over time there may be accounts it is not compatible +with. Please [post on the rclone forum](https://forum.rclone.org/) if +you find an incompatibility. + +Paths are specified as `remote:path` + +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + +## Configurations + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Proton Drive + \ "Proton Drive" +[snip] +Storage> protondrive +User name +user> you@protonmail.com +Password. +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank +y/g/n> y +Enter the password: +password: +Confirm the password: +password: +Option 2fa. +2FA code (if the account requires one) +Enter a value. Press Enter to leave empty. +2fa> 123456 +Remote config +-------------------- +[remote] +type = protondrive +user = you@protonmail.com +pass = *** ENCRYPTED *** +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +**NOTE:** The Proton Drive encryption keys need to have been already generated +after a regular login via the browser, otherwise attempting to use the +credentials in `rclone` will fail. + +Once configured you can then use `rclone` like this, + +List directories in top level of your Proton Drive + + rclone lsd remote: + +List all the files in your Proton Drive + + rclone ls remote: + +To copy a local directory to an Proton Drive directory called backup + + rclone copy /home/source remote:backup + +### Modification times and hashes + +Proton Drive Bridge does not support updating modification times yet. + +The SHA1 hash algorithm is supported. + +### Restricted filename characters + +Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and +right spaces will be removed ([code reference](https://github.com/ProtonMail/WebClients/blob/b4eba99d241af4fdae06ff7138bd651a40ef5d3c/applications/drive/src/app/store/_links/validation.ts#L51)) + +### Duplicated files + +Proton Drive can not have two files with exactly the same name and path. If the +conflict occurs, depending on the advanced config, the file might or might not +be overwritten. + +### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password) + +Please set your mailbox password in the advanced config section. + +### Caching + +The cache is currently built for the case when the rclone is the only instance +performing operations to the mount point. The event system, which is the proton +API system that provides visibility of what has changed on the drive, is yet +to be implemented, so updates from other clients won’t be reflected in the +cache. Thus, if there are concurrent clients accessing the same mount point, +then we might have a problem with caching the stale data. + + +### Standard options + +Here are the Standard options specific to protondrive (Proton Drive). + +#### --protondrive-username + +The username of your proton account + +Properties: + +- Config: username +- Env Var: RCLONE_PROTONDRIVE_USERNAME +- Type: string +- Required: true + +#### --protondrive-password + +The password of your proton account. + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + +Properties: + +- Config: password +- Env Var: RCLONE_PROTONDRIVE_PASSWORD +- Type: string +- Required: true + +#### --protondrive-2fa + +The 2FA code + +The value can also be provided with --protondrive-2fa=000000 + +The 2FA code of your proton drive account if the account is set up with +two-factor authentication + +Properties: + +- Config: 2fa +- Env Var: RCLONE_PROTONDRIVE_2FA +- Type: string +- Required: false + +### Advanced options + +Here are the Advanced options specific to protondrive (Proton Drive). + +#### --protondrive-mailbox-password + +The mailbox password of your two-password proton account. + +For more information regarding the mailbox password, please check the +following official knowledge base article: +https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password + + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + +Properties: + +- Config: mailbox_password +- Env Var: RCLONE_PROTONDRIVE_MAILBOX_PASSWORD +- Type: string +- Required: false + +#### --protondrive-client-uid + +Client uid key (internal use only) + +Properties: + +- Config: client_uid +- Env Var: RCLONE_PROTONDRIVE_CLIENT_UID +- Type: string +- Required: false + +#### --protondrive-client-access-token + +Client access token key (internal use only) + +Properties: + +- Config: client_access_token +- Env Var: RCLONE_PROTONDRIVE_CLIENT_ACCESS_TOKEN +- Type: string +- Required: false + +#### --protondrive-client-refresh-token + +Client refresh token key (internal use only) + +Properties: + +- Config: client_refresh_token +- Env Var: RCLONE_PROTONDRIVE_CLIENT_REFRESH_TOKEN +- Type: string +- Required: false + +#### --protondrive-client-salted-key-pass + +Client salted key pass key (internal use only) + +Properties: + +- Config: client_salted_key_pass +- Env Var: RCLONE_PROTONDRIVE_CLIENT_SALTED_KEY_PASS +- Type: string +- Required: false + +#### --protondrive-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_PROTONDRIVE_ENCODING +- Type: Encoding +- Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot + +#### --protondrive-original-file-size + +Return the file size before encryption + +The size of the encrypted file will be different from (bigger than) the +original file size. Unless there is a reason to return the file size +after encryption is performed, otherwise, set this option to true, as +features like Open() which will need to be supplied with original content +size, will fail to operate properly + +Properties: + +- Config: original_file_size +- Env Var: RCLONE_PROTONDRIVE_ORIGINAL_FILE_SIZE +- Type: bool +- Default: true + +#### --protondrive-app-version + +The app version string + +The app version string indicates the client that is currently performing +the API request. This information is required and will be sent with every +API request. + +Properties: + +- Config: app_version +- Env Var: RCLONE_PROTONDRIVE_APP_VERSION +- Type: string +- Default: "macos-drive@1.0.0-alpha.1+rclone" + +#### --protondrive-replace-existing-draft + +Create a new revision when filename conflict is detected + +When a file upload is cancelled or failed before completion, a draft will be +created and the subsequent upload of the same file to the same location will be +reported as a conflict. + +The value can also be set by --protondrive-replace-existing-draft=true + +If the option is set to true, the draft will be replaced and then the upload +operation will restart. If there are other clients also uploading at the same +file location at the same time, the behavior is currently unknown. Need to set +to true for integration tests. +If the option is set to false, an error "a draft exist - usually this means a +file is being uploaded at another client, or, there was a failed upload attempt" +will be returned, and no upload will happen. + +Properties: + +- Config: replace_existing_draft +- Env Var: RCLONE_PROTONDRIVE_REPLACE_EXISTING_DRAFT +- Type: bool +- Default: false + +#### --protondrive-enable-caching + +Caches the files and folders metadata to reduce API calls + +Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, +as the current implementation doesn't update or clear the cache when there are +external changes. + +The files and folders on ProtonDrive are represented as links with keyrings, +which can be cached to improve performance and be friendly to the API server. + +The cache is currently built for the case when the rclone is the only instance +performing operations to the mount point. The event system, which is the proton +API system that provides visibility of what has changed on the drive, is yet +to be implemented, so updates from other clients won’t be reflected in the +cache. Thus, if there are concurrent clients accessing the same mount point, +then we might have a problem with caching the stale data. + +Properties: + +- Config: enable_caching +- Env Var: RCLONE_PROTONDRIVE_ENABLE_CACHING +- Type: bool +- Default: true + + + +## Limitations + +This backend uses the +[Proton-API-Bridge](https://github.com/henrybear327/Proton-API-Bridge), which +is based on [go-proton-api](https://github.com/henrybear327/go-proton-api), a +fork of the [official repo](https://github.com/ProtonMail/go-proton-api). + +There is no official API documentation available from Proton Drive. But, thanks +to Proton open sourcing [proton-go-api](https://github.com/ProtonMail/go-proton-api) +and the web, iOS, and Android client codebases, we don't need to completely +reverse engineer the APIs by observing the web client traffic! + +[proton-go-api](https://github.com/ProtonMail/go-proton-api) provides the basic +building blocks of API calls and error handling, such as 429 exponential +back-off, but it is pretty much just a barebone interface to the Proton API. +For example, the encryption and decryption of the Proton Drive file are not +provided in this library. + +The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on +top of this quickly. This codebase handles the intricate tasks before and after +calling Proton APIs, particularly the complex encryption scheme, allowing +developers to implement features for other software on top of this codebase. +There are likely quite a few errors in this library, as there isn't official +documentation available. + # put.io Paths are specified as `remote:path` @@ -38242,10 +44653,77 @@ Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid as they can't be used in JSON strings. +### Standard options + +Here are the Standard options specific to putio (Put.io). + +#### --putio-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_PUTIO_CLIENT_ID +- Type: string +- Required: false + +#### --putio-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_PUTIO_CLIENT_SECRET +- Type: string +- Required: false + ### Advanced options Here are the Advanced options specific to putio (Put.io). +#### --putio-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_PUTIO_TOKEN +- Type: string +- Required: false + +#### --putio-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_PUTIO_AUTH_URL +- Type: string +- Required: false + +#### --putio-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_PUTIO_TOKEN_URL +- Type: string +- Required: false + #### --putio-encoding The encoding for the backend. @@ -38256,7 +44734,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PUTIO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -38270,6 +44748,359 @@ If you want to avoid ever hitting these limits, you may use the `--tpslimit` flag with a low number. Note that the imposed limits may be different for different operations, and may change over time. +# Proton Drive + +[Proton Drive](https://proton.me/drive) is an end-to-end encrypted Swiss vault + for your files that protects your data. + +This is an rclone backend for Proton Drive which supports the file transfer +features of Proton Drive using the same client-side encryption. + +Due to the fact that Proton Drive doesn't publish its API documentation, this +backend is implemented with best efforts by reading the open-sourced client +source code and observing the Proton Drive traffic in the browser. + +**NB** This backend is currently in Beta. It is believed to be correct +and all the integration tests pass. However the Proton Drive protocol +has evolved over time there may be accounts it is not compatible +with. Please [post on the rclone forum](https://forum.rclone.org/) if +you find an incompatibility. + +Paths are specified as `remote:path` + +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + +## Configurations + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Proton Drive + \ "Proton Drive" +[snip] +Storage> protondrive +User name +user> you@protonmail.com +Password. +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank +y/g/n> y +Enter the password: +password: +Confirm the password: +password: +Option 2fa. +2FA code (if the account requires one) +Enter a value. Press Enter to leave empty. +2fa> 123456 +Remote config +-------------------- +[remote] +type = protondrive +user = you@protonmail.com +pass = *** ENCRYPTED *** +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +**NOTE:** The Proton Drive encryption keys need to have been already generated +after a regular login via the browser, otherwise attempting to use the +credentials in `rclone` will fail. + +Once configured you can then use `rclone` like this, + +List directories in top level of your Proton Drive + + rclone lsd remote: + +List all the files in your Proton Drive + + rclone ls remote: + +To copy a local directory to an Proton Drive directory called backup + + rclone copy /home/source remote:backup + +### Modification times and hashes + +Proton Drive Bridge does not support updating modification times yet. + +The SHA1 hash algorithm is supported. + +### Restricted filename characters + +Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and +right spaces will be removed ([code reference](https://github.com/ProtonMail/WebClients/blob/b4eba99d241af4fdae06ff7138bd651a40ef5d3c/applications/drive/src/app/store/_links/validation.ts#L51)) + +### Duplicated files + +Proton Drive can not have two files with exactly the same name and path. If the +conflict occurs, depending on the advanced config, the file might or might not +be overwritten. + +### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password) + +Please set your mailbox password in the advanced config section. + +### Caching + +The cache is currently built for the case when the rclone is the only instance +performing operations to the mount point. The event system, which is the proton +API system that provides visibility of what has changed on the drive, is yet +to be implemented, so updates from other clients won’t be reflected in the +cache. Thus, if there are concurrent clients accessing the same mount point, +then we might have a problem with caching the stale data. + + +### Standard options + +Here are the Standard options specific to protondrive (Proton Drive). + +#### --protondrive-username + +The username of your proton account + +Properties: + +- Config: username +- Env Var: RCLONE_PROTONDRIVE_USERNAME +- Type: string +- Required: true + +#### --protondrive-password + +The password of your proton account. + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + +Properties: + +- Config: password +- Env Var: RCLONE_PROTONDRIVE_PASSWORD +- Type: string +- Required: true + +#### --protondrive-2fa + +The 2FA code + +The value can also be provided with --protondrive-2fa=000000 + +The 2FA code of your proton drive account if the account is set up with +two-factor authentication + +Properties: + +- Config: 2fa +- Env Var: RCLONE_PROTONDRIVE_2FA +- Type: string +- Required: false + +### Advanced options + +Here are the Advanced options specific to protondrive (Proton Drive). + +#### --protondrive-mailbox-password + +The mailbox password of your two-password proton account. + +For more information regarding the mailbox password, please check the +following official knowledge base article: +https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password + + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + +Properties: + +- Config: mailbox_password +- Env Var: RCLONE_PROTONDRIVE_MAILBOX_PASSWORD +- Type: string +- Required: false + +#### --protondrive-client-uid + +Client uid key (internal use only) + +Properties: + +- Config: client_uid +- Env Var: RCLONE_PROTONDRIVE_CLIENT_UID +- Type: string +- Required: false + +#### --protondrive-client-access-token + +Client access token key (internal use only) + +Properties: + +- Config: client_access_token +- Env Var: RCLONE_PROTONDRIVE_CLIENT_ACCESS_TOKEN +- Type: string +- Required: false + +#### --protondrive-client-refresh-token + +Client refresh token key (internal use only) + +Properties: + +- Config: client_refresh_token +- Env Var: RCLONE_PROTONDRIVE_CLIENT_REFRESH_TOKEN +- Type: string +- Required: false + +#### --protondrive-client-salted-key-pass + +Client salted key pass key (internal use only) + +Properties: + +- Config: client_salted_key_pass +- Env Var: RCLONE_PROTONDRIVE_CLIENT_SALTED_KEY_PASS +- Type: string +- Required: false + +#### --protondrive-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_PROTONDRIVE_ENCODING +- Type: Encoding +- Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot + +#### --protondrive-original-file-size + +Return the file size before encryption + +The size of the encrypted file will be different from (bigger than) the +original file size. Unless there is a reason to return the file size +after encryption is performed, otherwise, set this option to true, as +features like Open() which will need to be supplied with original content +size, will fail to operate properly + +Properties: + +- Config: original_file_size +- Env Var: RCLONE_PROTONDRIVE_ORIGINAL_FILE_SIZE +- Type: bool +- Default: true + +#### --protondrive-app-version + +The app version string + +The app version string indicates the client that is currently performing +the API request. This information is required and will be sent with every +API request. + +Properties: + +- Config: app_version +- Env Var: RCLONE_PROTONDRIVE_APP_VERSION +- Type: string +- Default: "macos-drive@1.0.0-alpha.1+rclone" + +#### --protondrive-replace-existing-draft + +Create a new revision when filename conflict is detected + +When a file upload is cancelled or failed before completion, a draft will be +created and the subsequent upload of the same file to the same location will be +reported as a conflict. + +The value can also be set by --protondrive-replace-existing-draft=true + +If the option is set to true, the draft will be replaced and then the upload +operation will restart. If there are other clients also uploading at the same +file location at the same time, the behavior is currently unknown. Need to set +to true for integration tests. +If the option is set to false, an error "a draft exist - usually this means a +file is being uploaded at another client, or, there was a failed upload attempt" +will be returned, and no upload will happen. + +Properties: + +- Config: replace_existing_draft +- Env Var: RCLONE_PROTONDRIVE_REPLACE_EXISTING_DRAFT +- Type: bool +- Default: false + +#### --protondrive-enable-caching + +Caches the files and folders metadata to reduce API calls + +Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, +as the current implementation doesn't update or clear the cache when there are +external changes. + +The files and folders on ProtonDrive are represented as links with keyrings, +which can be cached to improve performance and be friendly to the API server. + +The cache is currently built for the case when the rclone is the only instance +performing operations to the mount point. The event system, which is the proton +API system that provides visibility of what has changed on the drive, is yet +to be implemented, so updates from other clients won’t be reflected in the +cache. Thus, if there are concurrent clients accessing the same mount point, +then we might have a problem with caching the stale data. + +Properties: + +- Config: enable_caching +- Env Var: RCLONE_PROTONDRIVE_ENABLE_CACHING +- Type: bool +- Default: true + + + +## Limitations + +This backend uses the +[Proton-API-Bridge](https://github.com/henrybear327/Proton-API-Bridge), which +is based on [go-proton-api](https://github.com/henrybear327/go-proton-api), a +fork of the [official repo](https://github.com/ProtonMail/go-proton-api). + +There is no official API documentation available from Proton Drive. But, thanks +to Proton open sourcing [proton-go-api](https://github.com/ProtonMail/go-proton-api) +and the web, iOS, and Android client codebases, we don't need to completely +reverse engineer the APIs by observing the web client traffic! + +[proton-go-api](https://github.com/ProtonMail/go-proton-api) provides the basic +building blocks of API calls and error handling, such as 429 exponential +back-off, but it is pretty much just a barebone interface to the Proton API. +For example, the encryption and decryption of the Proton Drive file are not +provided in this library. + +The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on +top of this quickly. This codebase handles the intricate tasks before and after +calling Proton APIs, particularly the complex encryption scheme, allowing +developers to implement features for other software on top of this codebase. +There are likely quite a few errors in this library, as there isn't official +documentation available. + # Seafile This is a backend for the [Seafile](https://www.seafile.com/) storage service: @@ -38652,7 +45483,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SEAFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 @@ -39012,7 +45843,7 @@ commands is prohibited. Set the configuration option `disable_hashcheck` to `true` to disable checksumming entirely, or set `shell_type` to `none` to disable all functionality based on remote shell command execution. -### Modified time +### Modification times and hashes Modified times are stored on the server to 1 second precision. @@ -39209,6 +46040,42 @@ Properties: - Type: bool - Default: false +#### --sftp-ssh + +Path and arguments to external ssh binary. + +Normally rclone will use its internal ssh library to connect to the +SFTP server. However it does not implement all possible ssh options so +it may be desirable to use an external ssh binary. + +Rclone ignores all the internal config if you use this option and +expects you to configure the ssh binary with the user/host/port and +any other options you need. + +**Important** The ssh command must log in without asking for a +password so needs to be configured with keys or certificates. + +Rclone will run the command supplied either with the additional +arguments "-s sftp" to access the SFTP subsystem or with commands such +as "md5sum /path/to/file" appended to read checksums. + +Any arguments with spaces in should be surrounded by "double quotes". + +An example setting might be: + + ssh -o ServerAliveInterval=20 user@example.com + +Note that when using an external ssh binary rclone makes a new ssh +connection for every hash it calculates. + + +Properties: + +- Config: ssh +- Env Var: RCLONE_SFTP_SSH +- Type: SpaceSepList +- Default: + ### Advanced options Here are the Advanced options specific to sftp (SSH/SFTP). @@ -39261,6 +46128,18 @@ E.g. if shared folders can be found in directories representing volumes: E.g. if home directory can be found in a shared folder called "home": rclone sync /home/local/directory remote:/home/directory --sftp-path-override /volume1/homes/USER/directory + +To specify only the path to the SFTP remote's root, and allow rclone to add any relative subpaths automatically (including unwrapping/decrypting remotes as necessary), add the '@' character to the beginning of the path. + +E.g. the first example above could be rewritten as: + + rclone sync /home/local/directory remote:/directory --sftp-path-override @/volume2 + +Note that when using this method with Synology "home" folders, the full "/homes/USER" path should be specified instead of "/home". + +E.g. the second example above should be rewritten as: + + rclone sync /home/local/directory remote:/homes/USER/directory --sftp-path-override @/volume1 Properties: @@ -39356,6 +46235,15 @@ Specifies the path or command to run a sftp server on the remote host. The subsystem option is ignored when server_command is defined. +If adding server_command to the configuration file please note that +it should not be enclosed in quotes, since that will make rclone fail. + +A working example is: + + [remote_name] + type = sftp + server_command = sudo /usr/libexec/openssh/sftp-server + Properties: - Config: server_command @@ -39503,7 +46391,7 @@ Pass multiple variables space separated, eg VAR1=value VAR2=value -and pass variables with spaces in in quotes, eg +and pass variables with spaces in quotes, eg "VAR3=value with space" "VAR4=value with space" VAR5=nospacehere @@ -39574,6 +46462,70 @@ Properties: - Type: SpaceSepList - Default: +#### --sftp-host-key-algorithms + +Space separated list of host key algorithms, ordered by preference. + +At least one must match with server configuration. This can be checked for example using ssh -Q HostKeyAlgorithms. + +Note: This can affect the outcome of key negotiation with the server even if server host key validation is not enabled. + +Example: + + ssh-ed25519 ssh-rsa ssh-dss + + +Properties: + +- Config: host_key_algorithms +- Env Var: RCLONE_SFTP_HOST_KEY_ALGORITHMS +- Type: SpaceSepList +- Default: + +#### --sftp-socks-proxy + +Socks 5 proxy host. + +Supports the format user:pass@host:port, user@host:port, host:port. + +Example: + + myUser:myPass@localhost:9005 + + +Properties: + +- Config: socks_proxy +- Env Var: RCLONE_SFTP_SOCKS_PROXY +- Type: string +- Required: false + +#### --sftp-copy-is-hardlink + +Set to enable server side copies using hardlinks. + +The SFTP protocol does not define a copy command so normally server +side copies are not allowed with the sftp backend. + +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. These +will be implemented by doing a hardlink from the source to the +destination. + +Not all sftp servers support this. + +Note that hardlinking two files together will use no additional space +as the source and the destination will be the same file. + +This feature may be useful backups made with --copy-dest. + +Properties: + +- Config: copy_is_hardlink +- Env Var: RCLONE_SFTP_COPY_IS_HARDLINK +- Type: bool +- Default: false + ## Limitations @@ -39623,7 +46575,7 @@ command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. ## Notes The first path segment must be the name of the share, which you entered when you started to share on Windows. On smbd, it's the section title in `smb.conf` (usually in `/etc/samba/`) file. -You can find shares by quering the root if you're unsure (e.g. `rclone lsd remote:`). +You can find shares by querying the root if you're unsure (e.g. `rclone lsd remote:`). You can't access to the shared printers from rclone, obviously. @@ -39852,7 +46804,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SMB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -40371,7 +47323,7 @@ Paths may be as deep as required, e.g. `remote:directory/subdirectory`. create a folder, which rclone will create as a "Sync Folder" with SugarSync. -### Modified time and hashes +### Modification times and hashes SugarSync does not support modification times or hashes, therefore syncing will default to `--size-only` checking. Note that using @@ -40542,7 +47494,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SUGARSYNC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8,Dot @@ -40639,9 +47591,10 @@ To copy a local directory to an Uptobox directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes -Uptobox supports neither modified times nor checksums. +Uptobox supports neither modified times nor checksums. All timestamps +will read as that set by `--default-time`. ### Restricted filename characters @@ -40678,6 +47631,17 @@ Properties: Here are the Advanced options specific to uptobox (Uptobox). +#### --uptobox-private + +Set to make uploaded files private + +Properties: + +- Config: private +- Env Var: RCLONE_UPTOBOX_PRIVATE +- Type: bool +- Default: false + #### --uptobox-encoding The encoding for the backend. @@ -40688,7 +47652,7 @@ Properties: - Config: encoding - Env Var: RCLONE_UPTOBOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot @@ -40702,24 +47666,27 @@ been seen in the uptobox web interface. # Union -The `union` remote provides a unification similar to UnionFS using other remotes. - -Paths may be as deep as required or a local path, -e.g. `remote:directory/subdirectory` or `/directory/subdirectory`. +The `union` backend joins several remotes together to make a single unified view of them. During the initial setup with `rclone config` you will specify the upstream -remotes as a space separated list. The upstream remotes can either be a local paths or other remotes. +remotes as a space separated list. The upstream remotes can either be a local +paths or other remotes. + +The attributes `:ro`, `:nc` and `:writeback` can be attached to the end of the remote +to tag the remote as **read only**, **no create** or **writeback**, e.g. +`remote:directory/subdirectory:ro` or `remote:directory/subdirectory:nc`. -Attribute `:ro` and `:nc` can be attach to the end of path to tag the remote as **read only** or **no create**, -e.g. `remote:directory/subdirectory:ro` or `remote:directory/subdirectory:nc`. +- `:ro` means files will only be read from here and never written +- `:nc` means new files or directories won't be created here +- `:writeback` means files found in different remotes will be written back here. See the [writeback section](#writeback) for more info. Subfolders can be used in upstream remotes. Assume a union remote named `backup` with the remotes `mydrive:private/backup`. Invoking `rclone mkdir backup:desktop` is exactly the same as invoking `rclone mkdir mydrive:private/backup/desktop`. -There will be no special handling of paths containing `..` segments. -Invoking `rclone mkdir backup:../desktop` is exactly the same as invoking -`rclone mkdir mydrive:private/backup/../desktop`. +There is no special handling of paths containing `..` segments. Invoking `rclone +mkdir backup:../desktop` is exactly the same as invoking `rclone mkdir +mydrive:private/backup/../desktop`. ## Configuration @@ -40869,6 +47836,36 @@ The policies definition are inspired by [trapexit/mergerfs](https://github.com/t | rand (random) | Calls **all** and then randomizes. Returns only one upstream. | +### Writeback {#writeback} + +The tag `:writeback` on an upstream remote can be used to make a simple cache +system like this: + +``` +[union] +type = union +action_policy = all +create_policy = all +search_policy = ff +upstreams = /local:writeback remote:dir +``` + +When files are opened for read, if the file is in `remote:dir` but not `/local` +then rclone will copy the file entirely into `/local` before returning a +reference to the file in `/local`. The copy will be done with the equivalent of +`rclone copy` so will use `--multi-thread-streams` if configured. Any copies +will be logged with an INFO log. + +When files are written, they will be written to both `remote:dir` and `/local`. + +As many remotes as desired can be added to `upstreams` but there should only be +one `:writeback` tag. + +Rclone does not manage the `:writeback` remote in any way other than writing +files back to it. So if you need to expire old files or manage the size then you +will have to do this yourself. + + ### Standard options Here are the Standard options specific to union (Union merges the contents of several upstream fs). @@ -40997,17 +47994,21 @@ Choose a number from below, or type in your own value url> https://example.com/remote.php/webdav/ Name of the WebDAV site/service/software you are using Choose a number from below, or type in your own value - 1 / Nextcloud - \ "nextcloud" - 2 / Owncloud - \ "owncloud" - 3 / Sharepoint Online, authenticated by Microsoft account. - \ "sharepoint" - 4 / Sharepoint with NTLM authentication. Usually self-hosted or on-premises. - \ "sharepoint-ntlm" - 5 / Other site/service or software - \ "other" -vendor> 1 + 1 / Fastmail Files + \ (fastmail) + 2 / Nextcloud + \ (nextcloud) + 3 / Owncloud + \ (owncloud) + 4 / Sharepoint Online, authenticated by Microsoft account + \ (sharepoint) + 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises + \ (sharepoint-ntlm) + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \ (rclone) + 7 / Other site/service or software + \ (other) +vendor> 2 User name user> user Password. @@ -41051,13 +48052,13 @@ To copy a local directory to an WebDAV directory called backup rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes Plain WebDAV does not support modified times. However when used with -Owncloud or Nextcloud rclone will support modified times. +Fastmail Files, Owncloud or Nextcloud rclone will support modified times. Likewise plain WebDAV does not support hashes, however when used with -Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. +Fastmail Files, Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. Depending on the exact version of Owncloud or Nextcloud hashes may appear on all objects, or only on objects which had a hash uploaded with them. @@ -41091,6 +48092,8 @@ Properties: - Type: string - Required: false - Examples: + - "fastmail" + - Fastmail Files - "nextcloud" - Nextcloud - "owncloud" @@ -41099,6 +48102,8 @@ Properties: - Sharepoint Online, authenticated by Microsoft account - "sharepoint-ntlm" - Sharepoint with NTLM authentication, usually self-hosted or on-premises + - "rclone" + - rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol - "other" - Other site/service or software @@ -41190,12 +48195,50 @@ Properties: - Type: CommaSepList - Default: +#### --webdav-pacer-min-sleep + +Minimum time to sleep between API calls. + +Properties: + +- Config: pacer_min_sleep +- Env Var: RCLONE_WEBDAV_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms + +#### --webdav-nextcloud-chunk-size + +Nextcloud upload chunk size. + +We recommend configuring your NextCloud instance to increase the max chunk size to 1 GB for better upload performances. +See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#adjust-chunk-size-on-nextcloud-side + +Set to 0 to disable chunked uploading. + + +Properties: + +- Config: nextcloud_chunk_size +- Env Var: RCLONE_WEBDAV_NEXTCLOUD_CHUNK_SIZE +- Type: SizeSuffix +- Default: 10Mi + ## Provider notes See below for notes on specific providers. +## Fastmail Files + +Use `https://webdav.fastmail.com/` or a subdirectory as the URL, +and your Fastmail email `username@domain.tld` as the username. +Follow [this documentation](https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords) +to create an app password with access to `Files (WebDAV)` and use +this as the password. + +Fastmail supports modified times using the `X-OC-Mtime` header. + ### Owncloud Click on the settings cog in the bottom right of the page and this @@ -41291,6 +48334,14 @@ For Rclone calls copying files (especially Office files such as .docx, .xlsx, et --ignore-size --ignore-checksum --update ``` +## Rclone + +Use this option if you are hosting remotes over WebDAV provided by rclone. +Read [rclone serve webdav](commands/rclone_serve_webdav/) for more details. + +rclone serve supports modified times using the `X-OC-Mtime` header. + + ### dCache dCache is a storage system that supports many protocols and @@ -41451,14 +48502,12 @@ excess files in the path. Yandex paths may be as deep as required, e.g. `remote:directory/subdirectory`. -### Modified time +### Modification times and hashes Modified times are supported and are stored accurate to 1 ns in custom metadata called `rclone_modified` in RFC3339 with nanoseconds format. -### MD5 checksums - -MD5 checksums are natively supported by Yandex Disk. +The MD5 hash algorithm is natively supported by Yandex Disk. ### Emptying Trash @@ -41572,7 +48621,7 @@ Properties: - Config: encoding - Env Var: RCLONE_YANDEX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot @@ -41699,13 +48748,11 @@ excess files in the path. Zoho paths may be as deep as required, eg `remote:directory/subdirectory`. -### Modified time +### Modification times and hashes Modified times are currently not supported for Zoho Workdrive -### Checksums - -No checksums are supported. +No hash algorithms are supported. ### Usage information @@ -41828,7 +48875,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ZOHO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Del,Ctl,InvalidUtf8 @@ -41860,10 +48907,10 @@ For consistencies sake one can also configure a remote of type rclone remote paths, e.g. `remote:path/to/wherever`, but it is probably easier not to. -### Modified time ### +### Modification times -Rclone reads and writes the modified time using an accuracy determined by -the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second +Rclone reads and writes the modification times using an accuracy determined +by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X. ### Filenames ### @@ -42292,6 +49339,11 @@ time we: - Only checksum the size that stat gave - Don't update the stat info for the file +**NB** do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. Properties: @@ -42402,7 +49454,7 @@ Properties: - Config: encoding - Env Var: RCLONE_LOCAL_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot ### Metadata @@ -42464,6 +49516,498 @@ Options: # Changelog +## v1.65.0 - 2023-11-26 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.65.0) + +* New backends + * Azure Files (karan, moongdal, Nick Craig-Wood) + * ImageKit (Abhinav Dhiman) + * Linkbox (viktor, Nick Craig-Wood) +* New commands + * `serve s3`: Let rclone act as an S3 compatible server (Mikubill, Artur Neumann, Saw-jan, Nick Craig-Wood) + * `nfsmount`: mount command to provide mount mechanism on macOS without FUSE (Saleh Dindar) + * `serve nfs`: to serve a remote for use by `nfsmount` (Saleh Dindar) +* New Features + * install.sh: Clean up temp files in install script (Jacob Hands) + * build + * Update all dependencies (Nick Craig-Wood) + * Refactor version info and icon resource handling on windows (albertony) + * doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick Craig-Wood) + * Implement `--metadata-mapper` to transform metatadata with a user supplied program (Nick Craig-Wood) + * Add `ChunkWriterDoesntSeek` feature flag and set it for b2 (Nick Craig-Wood) + * lib/http: Export basic go string functions for use in `--template` (Gabriel Espinoza) + * makefile: Use POSIX compatible install arguments (Mina Galić) + * operations + * Use less memory when doing multithread uploads (Nick Craig-Wood) + * Implement `--partial-suffix` to control extension of temporary file names (Volodymyr) + * rc + * Add `operations/check` to the rc API (Nick Craig-Wood) + * Always report an error as JSON (Nick Craig-Wood) + * Set `Last-Modified` header for files served by `--rc-serve` (Nikita Shoshin) + * size: Dont show duplicate object count when less than 1k (albertony) +* Bug Fixes + * fshttp: Fix `--contimeout` being ignored (你知道未来吗) + * march: Fix excessive parallelism when using `--no-traverse` (Nick Craig-Wood) + * ncdu: Fix crash when re-entering changed directory after rescan (Nick Craig-Wood) + * operations + * Fix overwrite of destination when multi-thread transfer fails (Nick Craig-Wood) + * Fix invalid UTF-8 when truncating file names when not using `--inplace` (Nick Craig-Wood) + * serve dnla: Fix crash on graceful exit (wuxingzhong) +* Mount + * Disable mount for freebsd and alias cmount as mount on that platform (Nick Craig-Wood) +* VFS + * Add `--vfs-refresh` flag to read all the directories on start (Beyond Meat) + * Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh Dindar) + * Add go-billy dependency and make sure vfs.Handle implements billy.File (Saleh Dindar) + * Error out early if can't upload 0 length file (Nick Craig-Wood) +* Local + * Fix copying from Windows Volume Shadows (Nick Craig-Wood) +* Azure Blob + * Add support for cold tier (Ivan Yanitra) +* B2 + * Implement "rclone backend lifecycle" to read and set bucket lifecycles (Nick Craig-Wood) + * Implement `--b2-lifecycle` to control lifecycle when creating buckets (Nick Craig-Wood) + * Fix listing all buckets when not needed (Nick Craig-Wood) + * Fix multi-thread upload with copyto going to wrong name (Nick Craig-Wood) + * Fix server side chunked copy when file size was exactly `--b2-copy-cutoff` (Nick Craig-Wood) + * Fix streaming chunked files an exact multiple of chunk size (Nick Craig-Wood) +* Box + * Filter more EventIDs when polling (David Sze) + * Add more logging for polling (David Sze) + * Fix performance problem reading metadata for single files (Nick Craig-Wood) +* Drive + * Add read/write metadata support (Nick Craig-Wood) + * Add support for SHA-1 and SHA-256 checksums (rinsuki) + * Add `--drive-show-all-gdocs` to allow unexportable gdocs to be server side copied (Nick Craig-Wood) + * Add a note that `--drive-scope` accepts comma-separated list of scopes (Keigo Imai) + * Fix error updating created time metadata on existing object (Nick Craig-Wood) + * Fix integration tests by enabling metadata support from the context (Nick Craig-Wood) +* Dropbox + * Factor batcher into lib/batcher (Nick Craig-Wood) + * Fix missing encoding for rclone purge (Nick Craig-Wood) +* Google Cloud Storage + * Fix 400 Bad request errors when using multi-thread copy (Nick Craig-Wood) +* Googlephotos + * Implement batcher for uploads (Nick Craig-Wood) +* Hdfs + * Added support for list of namenodes in hdfs remote config (Tayo-pasedaRJ) +* HTTP + * Implement set backend command to update running backend (Nick Craig-Wood) + * Enable methods used with WebDAV (Alen Šiljak) +* Jottacloud + * Add support for reading and writing metadata (albertony) +* Onedrive + * Implement ListR method which gives `--fast-list` support (Nick Craig-Wood) + * This must be enabled with the `--onedrive-delta` flag +* Quatrix + * Add partial upload support (Oksana Zhykina) + * Overwrite files on conflict during server-side move (Oksana Zhykina) +* S3 + * Add Linode provider (Nick Craig-Wood) + * Add docs on how to add a new provider (Nick Craig-Wood) + * Fix no error being returned when creating a bucket we don't own (Nick Craig-Wood) + * Emit a debug message if anonymous credentials are in use (Nick Craig-Wood) + * Add `--s3-disable-multipart-uploads` flag (Nick Craig-Wood) + * Detect looping when using gcs and versions (Nick Craig-Wood) +* SFTP + * Implement `--sftp-copy-is-hardlink` to server side copy as hardlink (Nick Craig-Wood) +* Smb + * Fix incorrect `about` size by switching to `github.com/cloudsoda/go-smb2` fork (Nick Craig-Wood) + * Fix modtime of multithread uploads by setting PartialUploads (Nick Craig-Wood) +* WebDAV + * Added an rclone vendor to work with `rclone serve webdav` (Adithya Kumar) + +## v1.64.2 - 2023-10-19 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.1...v1.64.2) + +* Bug Fixes + * selfupdate: Fix "invalid hashsum signature" error (Nick Craig-Wood) + * build: Fix docker build running out of space (Nick Craig-Wood) + +## v1.64.1 - 2023-10-17 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.64.1) + +* Bug Fixes + * cmd: Make `--progress` output logs in the same format as without (Nick Craig-Wood) + * docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj Ghosh, Nick Craig-Wood) + * lsjson: Make sure we set the global metadata flag too (Nick Craig-Wood) + * operations + * Ensure concurrency is no greater than the number of chunks (Pat Patterson) + * Fix OpenOptions ignored in copy if operation was a multiThreadCopy (Vitor Gomes) + * Fix error message on delete to have file name (Nick Craig-Wood) + * serve sftp: Return not supported error for not supported commands (Nick Craig-Wood) + * build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid reset (Nick Craig-Wood) + * pacer: Fix b2 deadlock by defaulting max connections to unlimited (Nick Craig-Wood) +* Mount + * Fix automount not detecting drive is ready (Nick Craig-Wood) +* VFS + * Fix update dir modification time (Saleh Dindar) +* Azure Blob + * Fix "fatal error: concurrent map writes" (Nick Craig-Wood) +* B2 + * Fix multipart upload: corrupted on transfer: sizes differ XXX vs 0 (Nick Craig-Wood) + * Fix locking window when getting mutipart upload URL (Nick Craig-Wood) + * Fix server side copies greater than 4GB (Nick Craig-Wood) + * Fix chunked streaming uploads (Nick Craig-Wood) + * Reduce default `--b2-upload-concurrency` to 4 to reduce memory usage (Nick Craig-Wood) +* Onedrive + * Fix the configurator to allow `/teams/ID` in the config (Nick Craig-Wood) +* Oracleobjectstorage + * Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Nick Craig-Wood) +* S3 + * Fix slice bounds out of range error when listing (Nick Craig-Wood) + * Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Vitor Gomes) +* Storj + * Update storj.io/uplink to v1.12.0 (Kaloyan Raev) + +## v1.64.0 - 2023-09-11 + +[See commits](https://github.com/rclone/rclone/compare/v1.63.0...v1.64.0) + +* New backends + * [Proton Drive](https://rclone.org/protondrive/) (Chun-Hung Tseng) + * [Quatrix](https://rclone.org/quatrix/) (Oksana, Volodymyr Kit) + * New S3 providers + * [Synology C2](https://rclone.org/s3/#synology-c2) (BakaWang) + * [Leviia](https://rclone.org/s3/#leviia) (Benjamin) + * New Jottacloud providers + * [Onlime](https://rclone.org/jottacloud/) (Fjodor42) + * [Telia Sky](https://rclone.org/jottacloud/) (NoLooseEnds) +* Major changes + * Multi-thread transfers (Vitor Gomes, Nick Craig-Wood, Manoj Ghosh, Edwin Mackenzie-Owen) + * Multi-thread transfers are now available when transferring to: + * `local`, `s3`, `azureblob`, `b2`, `oracleobjectstorage` and `smb` + * This greatly improves transfer speed between two network sources. + * In memory buffering has been unified between all backends and should share memory better. + * See [--multi-thread docs](https://rclone.org/docs/#multi-thread-cutoff) for more info +* New commands + * `rclone config redacted` support mechanism for showing redacted config (Nick Craig-Wood) +* New Features + * accounting + * Show server side stats in own lines and not as bytes transferred (Nick Craig-Wood) + * bisync + * Add new `--ignore-listing-checksum` flag to distinguish from `--ignore-checksum` (nielash) + * Add experimental `--resilient` mode to allow recovery from self-correctable errors (nielash) + * Add support for `--create-empty-src-dirs` (nielash) + * Dry runs no longer commit filter changes (nielash) + * Enforce `--check-access` during `--resync` (nielash) + * Apply filters correctly during deletes (nielash) + * Equality check before renaming (leave identical files alone) (nielash) + * Fix `dryRun` rc parameter being ignored (nielash) + * build + * Update to `go1.21` and make `go1.19` the minimum required version (Anagh Kumar Baranwal, Nick Craig-Wood) + * Update dependencies (Nick Craig-Wood) + * Add snap installation (hideo aoyama) + * Change Winget Releaser job to `ubuntu-latest` (sitiom) + * cmd: Refactor and use sysdnotify in more commands (eNV25) + * config: Add `--multi-thread-chunk-size` flag (Vitor Gomes) + * doc updates (antoinetran, Benjamin, Bjørn Smith, Dean Attali, gabriel-suela, James Braza, Justin Hellings, kapitainsky, Mahad, Masamune3210, Nick Craig-Wood, Nihaal Sangha, Niklas Hambüchen, Raymond Berger, r-ricci, Sawada Tsunayoshi, Tiago Boeing, Vladislav Vorobev) + * fs + * Use atomic types everywhere (Roberto Ricci) + * When `--max-transfer` limit is reached exit with code (10) (kapitainsky) + * Add rclone completion powershell - basic implementation only (Nick Craig-Wood) + * http servers: Allow CORS to be set with `--allow-origin` flag (yuudi) + * lib/rest: Remove unnecessary `nil` check (Eng Zer Jun) + * ncdu: Add keybinding to rescan filesystem (eNV25) + * rc + * Add `executeId` to job listings (yuudi) + * Add `core/du` to measure local disk usage (Nick Craig-Wood) + * Add `operations/settier` to API (Drew Stinnett) + * rclone test info: Add `--check-base32768` flag to check can store all base32768 characters (Nick Craig-Wood) + * rmdirs: Remove directories concurrently controlled by `--checkers` (Nick Craig-Wood) +* Bug Fixes + * accounting: Don't stop calculating average transfer speed until the operation is complete (Jacob Hands) + * fs: Fix `transferTime` not being set in JSON logs (Jacob Hands) + * fshttp: Fix `--bind 0.0.0.0` allowing IPv6 and `--bind ::0` allowing IPv4 (Nick Craig-Wood) + * operations: Fix overlapping check on case insensitive file systems (Nick Craig-Wood) + * serve dlna: Fix MIME type if backend can't identify it (Nick Craig-Wood) + * serve ftp: Fix race condition when using the auth proxy (Nick Craig-Wood) + * serve sftp: Fix hash calculations with `--vfs-cache-mode full` (Nick Craig-Wood) + * serve webdav: Fix error: Expecting fs.Object or fs.Directory, got `nil` (Nick Craig-Wood) + * sync: Fix lockup with `--cutoff-mode=soft` and `--max-duration` (Nick Craig-Wood) +* Mount + * fix: Mount parsing for linux (Anagh Kumar Baranwal) +* VFS + * Add `--vfs-cache-min-free-space` to control minimum free space on the disk containing the cache (Nick Craig-Wood) + * Added cache cleaner for directories to reduce memory usage (Anagh Kumar Baranwal) + * Update parent directory modtimes on vfs actions (David Pedersen) + * Keep virtual directory status accurate and reduce deadlock potential (Anagh Kumar Baranwal) + * Make sure struct field is aligned for atomic access (Roberto Ricci) +* Local + * Rmdir return an error if the path is not a dir (zjx20) +* Azure Blob + * Implement `OpenChunkWriter` and multi-thread uploads (Nick Craig-Wood) + * Fix creation of directory markers (Nick Craig-Wood) + * Fix purging with directory markers (Nick Craig-Wood) +* B2 + * Implement `OpenChunkWriter` and multi-thread uploads (Nick Craig-Wood) + * Fix rclone link when object path contains special characters (Alishan Ladhani) +* Box + * Add polling support (David Sze) + * Add `--box-impersonate` to impersonate a user ID (Nick Craig-Wood) + * Fix unhelpful decoding of error messages into decimal numbers (Nick Craig-Wood) +* Chunker + * Update documentation to mention issue with small files (Ricardo D'O. Albanus) +* Compress + * Fix ChangeNotify (Nick Craig-Wood) +* Drive + * Add `--drive-fast-list-bug-fix` to control ListR bug workaround (Nick Craig-Wood) +* Fichier + * Implement `DirMove` (Nick Craig-Wood) + * Fix error code parsing (alexia) +* FTP + * Add socks_proxy support for SOCKS5 proxies (Zach) + * Fix 425 "TLS session of data connection not resumed" errors (Nick Craig-Wood) +* Hdfs + * Retry "replication in progress" errors when uploading (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) +* HTTP + * CORS should not be sent if not set (yuudi) + * Fix webdav OPTIONS response (yuudi) +* Opendrive + * Fix List on a just deleted and remade directory (Nick Craig-Wood) +* Oracleobjectstorage + * Use rclone's rate limiter in multipart transfers (Manoj Ghosh) + * Implement `OpenChunkWriter` and multi-thread uploads (Manoj Ghosh) +* S3 + * Refactor multipart upload to use `OpenChunkWriter` and `ChunkWriter` (Vitor Gomes) + * Factor generic multipart upload into `lib/multipart` (Nick Craig-Wood) + * Fix purging of root directory with `--s3-directory-markers` (Nick Craig-Wood) + * Add `rclone backend set` command to update the running config (Nick Craig-Wood) + * Add `rclone backend restore-status` command (Nick Craig-Wood) +* SFTP + * Stop uploads re-using the same ssh connection to improve performance (Nick Craig-Wood) + * Add `--sftp-ssh` to specify an external ssh binary to use (Nick Craig-Wood) + * Add socks_proxy support for SOCKS5 proxies (Zach) + * Support dynamic `--sftp-path-override` (nielash) + * Fix spurious warning when using `--sftp-ssh` (Nick Craig-Wood) +* Smb + * Implement multi-threaded writes for copies to smb (Edwin Mackenzie-Owen) +* Storj + * Performance improvement for large file uploads (Kaloyan Raev) +* Swift + * Fix HEADing 0-length objects when `--swift-no-large-objects` set (Julian Lepinski) +* Union + * Add `:writback` to act as a simple cache (Nick Craig-Wood) +* WebDAV + * Nextcloud: fix segment violation in low-level retry (Paul) +* Zoho + * Remove Range requests workarounds to fix integration tests (Nick Craig-Wood) + +## v1.63.1 - 2023-07-17 + +[See commits](https://github.com/rclone/rclone/compare/v1.63.0...v1.63.1) + +* Bug Fixes + * build: Fix macos builds for versions < 12 (Anagh Kumar Baranwal) + * dirtree: Fix performance with large directories of directories and `--fast-list` (Nick Craig-Wood) + * operations + * Fix deadlock when using `lsd`/`ls` with `--progress` (Nick Craig-Wood) + * Fix `.rclonelink` files not being converted back to symlinks (Nick Craig-Wood) + * doc fixes (Dean Attali, Mahad, Nick Craig-Wood, Sawada Tsunayoshi, Vladislav Vorobev) +* Local + * Fix partial directory read for corrupted filesystem (Nick Craig-Wood) +* Box + * Fix reconnect failing with HTTP 400 Bad Request (albertony) +* Smb + * Fix "Statfs failed: bucket or container name is needed" when mounting (Nick Craig-Wood) +* WebDAV + * Nextcloud: fix must use /dav/files/USER endpoint not /webdav error (Paul) + * Nextcloud chunking: add more guidance for the user to check the config (darix) + +## v1.63.0 - 2023-06-30 + +[See commits](https://github.com/rclone/rclone/compare/v1.62.0...v1.63.0) + +* New backends + * [Pikpak](https://rclone.org/pikpak/) (wiserain) + * New S3 providers + * [petabox.io](https://rclone.org/s3/#petabox) (Andrei Smirnov) + * [Google Cloud Storage](https://rclone.org/s3/#google-cloud-storage) (Anthony Pessy) + * New WebDAV providers + * [Fastmail](https://rclone.org/webdav/#fastmail-files) (Arnavion) +* Major changes + * Files will be copied to a temporary name ending in `.partial` when copying to `local`,`ftp`,`sftp` then renamed at the end of the transfer. (Janne Hellsten, Nick Craig-Wood) + * This helps with data integrity as we don't delete the existing file until the new one is complete. + * It can be disabled with the [--inplace](https://rclone.org/docs/#inplace) flag. + * This behaviour will also happen if the backend is wrapped, for example `sftp` wrapped with `crypt`. + * The [s3](https://rclone.org/s3/#s3-directory-markers), [azureblob](/azureblob/#azureblob-directory-markers) and [gcs](/googlecloudstorage/#gcs-directory-markers) backends now support directory markers so empty directories are supported (Jānis Bebrītis, Nick Craig-Wood) + * The [--default-time](https://rclone.org/docs/#default-time-time) flag now controls the unknown modification time of files/dirs (Nick Craig-Wood) + * If a file or directory does not have a modification time rclone can read then rclone will display this fixed time instead. + * For the old behaviour use `--default-time 0s` which will set this time to the time rclone started up. +* New Features + * build + * Modernise linters in use and fixup all affected code (albertony) + * Push docker beta to GHCR (GitHub container registry) (Richard Tweed) + * cat: Add `--separator` option to cat command (Loren Gordon) + * config + * Do not remove/overwrite other files during config file save (albertony) + * Do not overwrite config file symbolic link (albertony) + * Stop `config create` making invalid config files (Nick Craig-Wood) + * doc updates (Adam K, Aditya Basu, albertony, asdffdsazqqq, Damo, danielkrajnik, Dimitri Papadopoulos, dlitster, Drew Parsons, jumbi77, kapitainsky, mac-15, Mariusz Suchodolski, Nick Craig-Wood, NickIAm, Rintze Zelle, Stanislav Gromov, Tareq Sharafy, URenko, yuudi, Zach Kipp) + * fs + * Add `size` to JSON logs when moving or copying an object (Nick Craig-Wood) + * Allow boolean features to be enabled with `--disable !Feature` (Nick Craig-Wood) + * genautocomplete: Rename to `completion` with alias to the old name (Nick Craig-Wood) + * librclone: Added example on using `librclone` with Go (alankrit) + * lsjson: Make `--stat` more efficient (Nick Craig-Wood) + * operations + * Implement `--multi-thread-write-buffer-size` for speed improvements on downloads (Paulo Schreiner) + * Reopen downloads on error when using `check --download` and `cat` (Nick Craig-Wood) + * rc: `config/listremotes` includes remotes defined with environment variables (kapitainsky) + * selfupdate: Obey `--no-check-certificate` flag (Nick Craig-Wood) + * serve restic: Trigger systemd notify (Shyim) + * serve webdav: Implement owncloud checksum and modtime extensions (WeidiDeng) + * sync: `--suffix-keep-extension` preserve 2 part extensions like .tar.gz (Nick Craig-Wood) +* Bug Fixes + * accounting + * Fix Prometheus metrics to be the same as `core/stats` (Nick Craig-Wood) + * Bwlimit signal handler should always start (Sam Lai) + * bisync: Fix `maxDelete` parameter being ignored via the rc (Nick Craig-Wood) + * cmd/ncdu: Fix screen corruption when logging (eNV25) + * filter: Fix deadlock with errors on `--files-from` (douchen) + * fs + * Fix interaction between `--progress` and `--interactive` (Nick Craig-Wood) + * Fix infinite recursive call in pacer ModifyCalculator (fixes issue reported by the staticcheck linter) (albertony) + * lib/atexit: Ensure OnError only calls cancel function once (Nick Craig-Wood) + * lib/rest: Fix problems re-using HTTP connections (Nick Craig-Wood) + * rc + * Fix `operations/stat` with trailing `/` (Nick Craig-Wood) + * Fix missing `--rc` flags (Nick Craig-Wood) + * Fix output of Time values in `options/get` (Nick Craig-Wood) + * serve dlna: Fix potential data race (Nick Craig-Wood) + * version: Fix reported os/kernel version for windows (albertony) +* Mount + * Add `--mount-case-insensitive` to force the mount to be case insensitive (Nick Craig-Wood) + * Removed unnecessary byte slice allocation for reads (Anagh Kumar Baranwal) + * Clarify rclone mount error when installed via homebrew (Nick Craig-Wood) + * Added _netdev to the example mount so it gets treated as a remote-fs rather than local-fs (Anagh Kumar Baranwal) +* Mount2 + * Updated go-fuse version (Anagh Kumar Baranwal) + * Fixed statfs (Anagh Kumar Baranwal) + * Disable xattrs (Anagh Kumar Baranwal) +* VFS + * Add MkdirAll function to make a directory and all beneath (Nick Craig-Wood) + * Fix reload: failed to add virtual dir entry: file does not exist (Nick Craig-Wood) + * Fix writing to a read only directory creating spurious directory entries (WeidiDeng) + * Fix potential data race (Nick Craig-Wood) + * Fix backends being Shutdown too early when startup takes a long time (Nick Craig-Wood) +* Local + * Fix filtering of symlinks with `-l`/`--links` flag (Nick Craig-Wood) + * Fix /path/to/file.rclonelink when `-l`/`--links` is in use (Nick Craig-Wood) + * Fix crash with `--metadata` on Android (Nick Craig-Wood) +* Cache + * Fix backends shutting down when in use when used via the rc (Nick Craig-Wood) +* Crypt + * Add `--crypt-suffix` option to set a custom suffix for encrypted files (jladbrook) + * Add `--crypt-pass-bad-blocks` to allow corrupted file output (Nick Craig-Wood) + * Fix reading 0 length files (Nick Craig-Wood) + * Try not to return "unexpected EOF" error (Nick Craig-Wood) + * Reduce allocations (albertony) + * Recommend Dropbox for `base32768` encoding (Nick Craig-Wood) +* Azure Blob + * Empty directory markers (Nick Craig-Wood) + * Support azure workload identities (Tareq Sharafy) + * Fix azure blob uploads with multiple bits of metadata (Nick Craig-Wood) + * Fix azurite compatibility by sending nil tier if set to empty string (Roel Arents) +* Combine + * Implement missing methods (Nick Craig-Wood) + * Fix goroutine stack overflow on bad object (Nick Craig-Wood) +* Drive + * Add `--drive-env-auth` to get IAM credentials from runtime (Peter Brunner) + * Update drive service account guide (Juang, Yi-Lin) + * Fix change notify picking up files outside the root (Nick Craig-Wood) + * Fix trailing slash mis-identificaton of folder as file (Nick Craig-Wood) + * Fix incorrect remote after Update on object (Nick Craig-Wood) +* Dropbox + * Implement `--dropbox-pacer-min-sleep` flag (Nick Craig-Wood) + * Fix the dropbox batcher stalling (Misty) +* Fichier + * Add `--ficicher-cdn` option to use the CDN for download (Nick Craig-Wood) +* FTP + * Lower log message priority when `SetModTime` is not supported to debug (Tobias Gion) + * Fix "unsupported LIST line" errors on startup (Nick Craig-Wood) + * Fix "501 Not a valid pathname." errors when creating directories (Nick Craig-Wood) +* Google Cloud Storage + * Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) + * Added `--gcs-user-project` needed for requester pays (Christopher Merry) +* HTTP + * Add client certificate user auth middleware. This can auth `serve restic` from the username in the client cert. (Peter Fern) +* Jottacloud + * Fix vfs writeback stuck in a failed upload loop with file versioning disabled (albertony) +* Onedrive + * Add `--onedrive-av-override` flag to download files flagged as virus (Nick Craig-Wood) + * Fix quickxorhash on 32 bit architectures (Nick Craig-Wood) + * Report any list errors during `rclone cleanup` (albertony) +* Putio + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) + * Fix modification times not being preserved for server side copy and move (Nick Craig-Wood) + * Fix server side copy failures (400 errors) (Nick Craig-Wood) +* S3 + * Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) + * Update Scaleway storage classes (Brian Starkey) + * Fix `--s3-versions` on individual objects (Nick Craig-Wood) + * Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood) + * Fix missing "tier" metadata (Nick Craig-Wood) + * Fix V3sign: add missing subresource delete (cc) + * Fix Arvancloud Domain and region changes and alphabetise the provider (Ehsan Tadayon) + * Fix Qiniu KODO quirks virtualHostStyle is false (zzq) +* SFTP + * Add `--sftp-host-key-algorithms ` to allow specifying SSH host key algorithms (Joel) + * Fix using `--sftp-key-use-agent` and `--sftp-key-file` together needing private key file (Arnav Singh) + * Fix move to allow overwriting existing files (Nick Craig-Wood) + * Don't stat directories before listing them (Nick Craig-Wood) + * Don't check remote points to a file if it ends with / (Nick Craig-Wood) +* Sharefile + * Disable streamed transfers as they no longer work (Nick Craig-Wood) +* Smb + * Code cleanup to avoid overwriting ctx before first use (fixes issue reported by the staticcheck linter) (albertony) +* Storj + * Fix "uplink: too many requests" errors when uploading to the same file (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) +* Swift + * Ignore 404 error when deleting an object (Nick Craig-Wood) +* Union + * Implement missing methods (Nick Craig-Wood) + * Allow errors to be unwrapped for inspection (Nick Craig-Wood) +* Uptobox + * Add `--uptobox-private` flag to make all uploaded files private (Nick Craig-Wood) + * Fix improper regex (Aaron Gokaslan) + * Fix Update returning the wrong object (Nick Craig-Wood) + * Fix rmdir declaring that directories weren't empty (Nick Craig-Wood) +* WebDAV + * nextcloud: Add support for chunked uploads (Paul) + * Set modtime using propset for owncloud and nextcloud (WeidiDeng) + * Make pacer minSleep configurable with `--webdav-pacer-min-sleep` (ed) + * Fix server side copy/move not overwriting (WeidiDeng) + * Fix modtime on server side copy for owncloud and nextcloud (Nick Craig-Wood) +* Yandex + * Fix 400 Bad Request on transfer failure (Nick Craig-Wood) +* Zoho + * Fix downloads with `Range:` header returning the wrong data (Nick Craig-Wood) + +## v1.62.2 - 2023-03-16 + +[See commits](https://github.com/rclone/rclone/compare/v1.62.1...v1.62.2) + +* Bug Fixes + * docker volume plugin: Add missing fuse3 dependency (Nick Craig-Wood) + * docs: Fix size documentation (asdffdsazqqq) +* FTP + * Fix 426 errors on downloads with vsftpd (Lesmiscore) + +## v1.62.1 - 2023-03-15 + +[See commits](https://github.com/rclone/rclone/compare/v1.62.0...v1.62.1) + +* Bug Fixes + * docker: Add missing fuse3 dependency (cycneuramus) + * build: Update release docs to be more careful with the tag (Nick Craig-Wood) + * build: Set Github release to draft while uploading binaries (Nick Craig-Wood) + ## v1.62.0 - 2023-03-14 [See commits](https://github.com/rclone/rclone/compare/v1.61.0...v1.62.0) @@ -44460,8 +52004,8 @@ all the docs and Edward Barker for helping re-write the front page. * Use proper import path go.etcd.io/bbolt (Robert-André Mauchin) * Crypt * Calculate hashes for uploads from local disk (Nick Craig-Wood) - * This allows crypted Jottacloud uploads without using local disk - * This means crypted s3/b2 uploads will now have hashes + * This allows encrypted Jottacloud uploads without using local disk + * This means encrypted s3/b2 uploads will now have hashes * Added `rclone backend decode`/`encode` commands to replicate functionality of `cryptdecode` (Anagh Kumar Baranwal) * Get rid of the unused Cipher interface as it obfuscated the code (Nick Craig-Wood) * Azure Blob @@ -45671,7 +53215,7 @@ Point release to fix hubic and azureblob backends. * Fix panic when running without plex configs (Remus Bunduc) * Fix root folder caching (Remus Bunduc) * Crypt - * Check the crypted hash of files when uploading for extra data security + * Check the encrypted hash of files when uploading for extra data security * Dropbox * Make Dropbox for business folders accessible using an initial `/` in the path * Google Cloud Storage @@ -46026,7 +53570,7 @@ Point release to fix hubic and azureblob backends. * New commands * `rcat` - read from standard input and stream upload * `tree` - shows a nicely formatted recursive listing - * `cryptdecode` - decode crypted file names (thanks ishuah) + * `cryptdecode` - decode encrypted file names (thanks ishuah) * `config show` - print the config file * `config file` - print the config file location * New Features @@ -46052,7 +53596,7 @@ Point release to fix hubic and azureblob backends. * Revert to copy when moving file across file system boundaries * `--skip-links` to suppress symlink warnings (thanks Zhiming Wang) * Mount - * Re-use `rcat` internals to support uploads from all remotes + * Reuse `rcat` internals to support uploads from all remotes * Dropbox * Fix "entry doesn't belong in directory" error * Stop using deprecated API methods @@ -46330,7 +53874,7 @@ Point release to fix hubic and azureblob backends. * Fix `rclone move` command * Delete src files which already existed in dst * Fix deletion of src file when dst file older - * Fix `rclone check` on crypted file systems + * Fix `rclone check` on encrypted file systems * Make failed uploads not count as "Transferred" * Make sure high level retries show with `-q` * Use a vendor directory with godep for repeatable builds @@ -47109,9 +54653,29 @@ If you are using `systemd-resolved` (default on Arch Linux), ensure it is at version 233 or higher. Previous releases contain a bug which causes not all domains to be resolved properly. -Additionally with the `GODEBUG=netdns=` environment variable the Go -resolver decision can be influenced. This also allows to resolve certain -issues with DNS resolution. See the [name resolution section in the go docs](https://golang.org/pkg/net/#hdr-Name_Resolution). + +The Go resolver decision can be influenced with the `GODEBUG=netdns=...` +environment variable. This also allows to resolve certain issues with +DNS resolution. On Windows or MacOS systems, try forcing use of the +internal Go resolver by setting `GODEBUG=netdns=go` at runtime. On +other systems (Linux, \*BSD, etc) try forcing use of the system +name resolver by setting `GODEBUG=netdns=cgo` (and recompile rclone +from source with CGO enabled if necessary). See the +[name resolution section in the go docs](https://golang.org/pkg/net/#hdr-Name_Resolution). + +### Failed to start auth webserver on Windows ### +``` +Error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions. +... +yyyy/mm/dd hh:mm:ss Fatal error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions. +``` + +This is sometimes caused by the Host Network Service causing issues with opening the port on the host. + +A simple solution may be restarting the Host Network Service with eg. Powershell +``` +Restart-Service hns +``` ### The total size reported in the stats for a sync is wrong and keeps changing @@ -47191,7 +54755,7 @@ Authors Contributors ------------ -{{< rem `email addresses removed from here need to be addeed to +{{< rem `email addresses removed from here need to be added to bin/.ignore-emails to make sure update-authors.py doesn't immediately put them back in again.` >}} @@ -47704,7 +55268,7 @@ put them back in again.` >}} * HNGamingUK * Jonta <359397+Jonta@users.noreply.github.com> * YenForYang - * Joda Stößer + * SimJoSt / Joda Stößer * Logeshwaran * Rajat Goel * r0kk3rz @@ -47719,7 +55283,6 @@ put them back in again.` >}} * Chris Nelson * Felix Bünemann * Atílio Antônio - * Roberto Ricci * Carlo Mion * Chris Lu * Vitor Arruda @@ -47765,7 +55328,7 @@ put them back in again.` >}} * Leroy van Logchem * Zsolt Ero * Lesmiscore - * ehsantdy + * ehsantdy * SwazRGB <65694696+swazrgb@users.noreply.github.com> * Mateusz Puczyński * Michael C Tiernan - MIT-Research Computing Project @@ -47775,6 +55338,7 @@ put them back in again.` >}} * Christian Galo <36752715+cgalo5758@users.noreply.github.com> * Erik van Velzen * Derek Battams + * Paul * SimonLiu * Hugo Laloge * Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com> @@ -47873,33 +55437,154 @@ put them back in again.` >}} * Peter Brunner * Leandro Sacchet * dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> + * cycneuramus <56681631+cycneuramus@users.noreply.github.com> + * Arnavion + * Christopher Merry + * Thibault Coupin + * Richard Tweed + * Zach Kipp + * yuudi <26199752+yuudi@users.noreply.github.com> + * NickIAm + * Juang, Yi-Lin + * jumbi77 + * Aditya Basu + * ed + * Drew Parsons + * Joel + * wiserain + * Roel Arents + * Shyim + * Rintze Zelle <78232505+rzelle-lallemand@users.noreply.github.com> + * Damo + * WeidiDeng + * Brian Starkey + * jladbrook + * Loren Gordon + * dlitster + * Tobias Gion + * Jānis Bebrītis + * Adam K + * Andrei Smirnov + * Janne Hellsten + * cc <12904584+shvc@users.noreply.github.com> + * Tareq Sharafy + * kapitainsky + * douchen + * Sam Lai <70988+slai@users.noreply.github.com> + * URenko <18209292+URenko@users.noreply.github.com> + * Stanislav Gromov + * Paulo Schreiner + * Mariusz Suchodolski + * danielkrajnik + * Peter Fern + * zzq + * mac-15 + * Sawada Tsunayoshi <34431649+TsunayoshiSawada@users.noreply.github.com> + * Dean Attali + * Fjodor42 + * BakaWang + * Mahad <56235065+Mahad-lab@users.noreply.github.com> + * Vladislav Vorobev + * darix + * Benjamin <36415086+bbenjamin-sys@users.noreply.github.com> + * Chun-Hung Tseng + * Ricardo D'O. Albanus + * gabriel-suela + * Tiago Boeing + * Edwin Mackenzie-Owen + * Niklas Hambüchen + * yuudi + * Zach + * nielash <31582349+nielash@users.noreply.github.com> + * Julian Lepinski + * Raymond Berger + * Nihaal Sangha + * Masamune3210 <1053504+Masamune3210@users.noreply.github.com> + * James Braza + * antoinetran + * alexia + * nielash + * Vitor Gomes + * Jacob Hands + * hideo aoyama <100831251+boukendesho@users.noreply.github.com> + * Roberto Ricci + * Bjørn Smith + * Alishan Ladhani <8869764+aladh@users.noreply.github.com> + * zjx20 + * Oksana <142890647+oks-maytech@users.noreply.github.com> + * Volodymyr Kit + * David Pedersen + * Drew Stinnett + * Pat Patterson + * Herby Gillot + * Nikita Shoshin + * rinsuki <428rinsuki+git@gmail.com> + * Beyond Meat <51850644+beyondmeat@users.noreply.github.com> + * Saleh Dindar + * Volodymyr <142890760+vkit-maytech@users.noreply.github.com> + * Gabriel Espinoza <31670639+gspinoza@users.noreply.github.com> + * Keigo Imai + * Ivan Yanitra + * alfish2000 + * wuxingzhong + * Adithya Kumar + * Tayo-pasedaRJ <138471223+Tayo-pasedaRJ@users.noreply.github.com> + * Peter Kreuser + * Piyush + * fotile96 + * Luc Ritchie + * cynful + * wjielai + * Jack Deng + * Mikubill <31246794+Mikubill@users.noreply.github.com> + * Artur Neumann + * Saw-jan + * Oksana Zhykina + * karan + * viktor + * moongdal + * Mina Galić + * Alen Šiljak + * 你知道未来吗 + * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> + +# Contact the rclone project + +## Forum + +Forum for questions and general discussion: -# Contact the rclone project # +- https://forum.rclone.org -## Forum ## +## Business support -Forum for questions and general discussion: +For business support or sponsorship enquiries please see: - * https://forum.rclone.org +- https://rclone.com/ +- sponsorship@rclone.com -## GitHub repository ## +## GitHub repository The project's repository is located at: - * https://github.com/rclone/rclone +- https://github.com/rclone/rclone There you can file bug reports or contribute with pull requests. -## Twitter ## +## Twitter -You can also follow me on twitter for rclone announcements: +You can also follow Nick on twitter for rclone announcements: - * [@njcw](https://twitter.com/njcw) +- [@njcw](https://twitter.com/njcw) -## Email ## +## Email Or if all else fails or you want to ask something private or -confidential email [Nick Craig-Wood](mailto:nick@craig-wood.com). -Please don't email me requests for help - those are better directed to -the forum. Thanks! +confidential + +- info@rclone.com + +Please don't email requests for help to this address - those are +better directed to the forum unless you'd like to sign up for business +support. diff --git a/MANUAL.txt b/MANUAL.txt index 2a69150921fad..11a38590b18d9 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,6 +1,6 @@ rclone(1) User Manual Nick Craig-Wood -Mar 14, 2023 +Nov 26, 2023 Rclone syncs your files to cloud storage @@ -16,7 +16,7 @@ About rclone Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. -Over 40 cloud storage products support rclone including S3 object +Over 70 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols. @@ -107,6 +107,7 @@ S3, that work out of the box.) - Dreamhost - Dropbox - Enterprise File Fabric +- Fastmail Files - FTP - Google Cloud Storage - Google Drive @@ -121,26 +122,35 @@ S3, that work out of the box.) - IDrive e2 - IONOS Cloud - Koofr +- Leviia Object Storage - Liara Object Storage +- Linkbox +- Linode Object Storage - Mail.ru Cloud - Memset Memstore - Mega - Memory - Microsoft Azure Blob Storage +- Microsoft Azure Files Storage - Microsoft OneDrive - Minio - Nextcloud - OVH +- Blomp Cloud Storage - OpenDrive - OpenStack Swift - Oracle Cloud Storage Swift - Oracle Object Storage - ownCloud - pCloud +- Petabox +- PikPak - premiumize.me - put.io +- Proton Drive - QingStor - Qiniu Cloud Object Storage (Kodo) +- Quatrix by Maytech - Rackspace Cloud Files - rsync.net - Scaleway @@ -152,6 +162,7 @@ S3, that work out of the box.) - SMB / CIFS - StackPath - Storj +- Synology - SugarSync - Tencent Cloud Object Storage (COS) - Uptobox @@ -200,6 +211,9 @@ See the usage docs for how to use rclone, or run rclone -h. Already installed rclone can be easily updated to the latest version using the rclone selfupdate command. +See the release signing docs for how to verify signatures on the +release. + Script installation To install rclone on Linux/macOS/BSD systems, run: @@ -254,6 +268,19 @@ developers so it may be out of date. Its current version is as below. [Homebrew package] +Installation with MacPorts (#macos-macports) + +On macOS, rclone can also be installed via MacPorts: + + sudo port install rclone + +Note that this is a third party installer not controlled by the rclone +developers so it may be out of date. Its current version is as below. + +[MacPorts port] + +More information here. + Precompiled binary, using curl To avoid problems with macOS gatekeeper enforcing the binary to be @@ -325,8 +352,14 @@ Windows package manager (Winget) Winget comes pre-installed with the latest versions of Windows. If not, update the App Installer package from the Microsoft store. +To install rclone + winget install Rclone.Rclone +To uninstall rclone + + winget uninstall Rclone.Rclone --force + Chocolatey package manager Make sure you have Choco installed @@ -431,10 +464,16 @@ Here are some commands tested on an Ubuntu 18.04.3 host: # config on host at ~/.config/rclone/rclone.conf # data on host at ~/data + # add a remote interactively + docker run --rm -it \ + --volume ~/.config/rclone:/config/rclone \ + --user $(id -u):$(id -g) \ + rclone/rclone \ + config + # make sure the config is ok by listing the remotes docker run --rm \ --volume ~/.config/rclone:/config/rclone \ - --volume ~/data:/data:shared \ --user $(id -u):$(id -g) \ rclone/rclone \ listremotes @@ -452,10 +491,35 @@ Here are some commands tested on an Ubuntu 18.04.3 host: ls ~/data/mount kill %1 +Snap installation + +[Get it from the Snap Store] + +Make sure you have Snapd installed + + $ sudo snap install rclone + +Due to the strict confinement of Snap, rclone snap cannot access real +/home/$USER/.config/rclone directory, default config path is as below. + +- Default config directory: + - /home/$USER/snap/rclone/current/.config/rclone + +Note: Due to the strict confinement of Snap, rclone mount feature is not +supported. + +If mounting is wanted, either install a precompiled binary or enable the +relevant option when installing from source. + +Note that this is controlled by community maintainer not the rclone +developers so it may be out of date. Its current version is as below. + +[rclone] + Source installation -Make sure you have git and Go installed. Go version 1.17 or newer is -required, latest release is recommended. You can get it from your +Make sure you have git and Go installed. Go version 1.18 or newer is +required, the latest release is recommended. You can get it from your package manager, or download it from golang.org/dl. Then you can run the following: @@ -483,22 +547,51 @@ cgo on Windows as well, by using the MinGW port of GCC, e.g. by installing it in a MSYS2 distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible). -Additionally, on Windows, you must install the third party utility -WinFsp, with the "Developer" feature selected. If building with cgo, you -must also set environment variable CPATH pointing to the fuse include -directory within the WinFsp installation (normally +Additionally, to build with mount on Windows, you must install the third +party utility WinFsp, with the "Developer" feature selected. If building +with cgo, you must also set environment variable CPATH pointing to the +fuse include directory within the WinFsp installation (normally C:\Program Files (x86)\WinFsp\inc\fuse). -You may also add arguments -ldflags -s (with or without -tags cmount), -to omit symbol table and debug information, making the executable file -smaller, and -trimpath to remove references to local file system paths. -This is how the official rclone releases are built. +You may add arguments -ldflags -s to omit symbol table and debug +information, making the executable file smaller, and -trimpath to remove +references to local file system paths. The official rclone releases are +built with both of these. go build -trimpath -ldflags -s -tags cmount +If you want to customize the version string, as reported by the +rclone version command, you can set one of the variables fs.Version, +fs.VersionTag (to keep default suffix but customize the number), or +fs.VersionSuffix (to keep default number but customize the suffix). This +can be done from the build command, by adding to the -ldflags argument +value as shown below. + + go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount + +On Windows, the official executables also have the version information, +as well as a file icon, embedded as binary resources. To get that with +your own build you need to run the following command before the build +command. It generates a Windows resource system object file, with +extension .syso, e.g. resource_windows_amd64.syso, that will be +automatically picked up by future build commands. + + go run bin/resource_windows.go + +The above command will generate a resource file containing version +information based on the fs.Version variable in source at the time you +run the command, which means if the value of this variable changes you +need to re-run the command for it to be reflected in the version +information. Also, if you override this version variable in the build +command as described above, you need to do that also when generating the +resource file, or else it will still use the value from the source. + + go run bin/resource_windows.go -version v9.9.9-test + Instead of executing the go build command directly, you can run it via -the Makefile. It changes the version number suffix from "-DEV" to -"-beta" and appends commit details. It also copies the resulting rclone +the Makefile. The default target changes the version suffix from "-DEV" +to "-beta" followed by additional commit details, embeds version +information binary resources on Windows, and copies the resulting rclone executable into your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default). @@ -509,27 +602,18 @@ To include mount command on macOS and Windows with Makefile build: make GOTAGS=cmount There are other make targets that can be used for more advanced builds, -such as cross-compiling for all supported os/architectures, embedding -icon and version info resources into windows executable, and packaging -results into release artifacts. See Makefile and cross-compile.go for -details. +such as cross-compiling for all supported os/architectures, and +packaging results into release artifacts. See Makefile and +cross-compile.go for details. -Another alternative is to download the source, build and install rclone -in one operation, as a regular Go package. The source will be stored it -in the Go module cache, and the resulting executable will be in your -GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to -~/go/bin/rclone by default). - -With Go version 1.17 or newer: +Another alternative method for source installation is to download the +source, build and install rclone - all in one operation, as a regular Go +package. The source will be stored it in the Go module cache, and the +resulting executable will be in your GOPATH bin folder +($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default). go install github.com/rclone/rclone@latest -With Go versions older than 1.17 (do not use the -u flag, it causes Go -to try to update the dependencies that rclone uses and sometimes these -don't work with the current version): - - go get github.com/rclone/rclone - Ansible installation This can be done with Stefan Weichinger's ansible role. @@ -691,7 +775,7 @@ also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it is -easy to back up and re-use the configuration settings, without having go +easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter). @@ -760,18 +844,24 @@ See the following for detailed instructions for - Internet Archive - Jottacloud - Koofr +- Linkbox - Mail.ru Cloud - Mega - Memory - Microsoft Azure Blob Storage +- Microsoft Azure Files Storage - Microsoft OneDrive -- OpenStack Swift / Rackspace Cloudfiles / Memset Memstore +- OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / + Memset Memstore - OpenDrive - Oracle Object Storage - Pcloud +- PikPak - premiumize.me - put.io +- Proton Drive - QingStor +- Quatrix by Maytech - Seafile - SFTP - Sia @@ -836,6 +926,7 @@ SEE ALSO - rclone config delete - Delete an existing remote. - rclone config disconnect - Disconnects user from remote - rclone config dump - Dump the config file as JSON. +- rclone config edit - Enter an interactive configuration session. - rclone config file - Show path of configuration file in use. - rclone config password - Update password in an existing remote. - rclone config paths - Show paths used for configuration, cache, temp @@ -843,6 +934,8 @@ SEE ALSO - rclone config providers - List in JSON format all the providers and options. - rclone config reconnect - Re-authenticates user with remote. +- rclone config redacted - Print redacted (decrypted) config file, or + the redacted config for a single remote. - rclone config show - Print (decrypted) config file, or the config for a single remote. - rclone config touch - Ensure configuration file exists. @@ -917,6 +1010,84 @@ Options --create-empty-src-dirs Create empty source dirs on destination after copy -h, --help help for copy +Copy Options + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -971,6 +1142,100 @@ Options --create-empty-src-dirs Create empty source dirs on destination after sync -h, --help help for sync +Copy Options + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Sync Options + +Flags just used for rclone sync. + + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") + +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1017,6 +1282,84 @@ Options --delete-empty-src-dirs Delete empty source dirs after move -h, --help help for move +Copy Options + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1063,6 +1406,48 @@ Options -h, --help help for delete --rmdirs rmdirs removes empty directories but leaves root intact +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1089,6 +1474,14 @@ Options -h, --help help for purge +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -1105,6 +1498,14 @@ Options -h, --help help for mkdir +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -1129,6 +1530,14 @@ Options -h, --help help for rmdir +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -1146,7 +1555,7 @@ and hashes (MD5 or SHA1) and logs a report of files that don't match. It doesn't alter the source or destination. For the crypt remote there is a dedicated command, cryptcheck, that are -able to check the checksums of the crypted files. +able to check the checksums of the encrypted files. If you supply the --size-only flag, it will only compare the sizes not the hashes as well. Use this for a quick check. @@ -1185,6 +1594,9 @@ what happened to it. These are reminiscent of diff files. - ! path means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the --checkers=N option +for more information. + rclone check source:path dest:path [flags] Options @@ -1200,6 +1612,46 @@ Options --missing-on-src string Report all files missing from the source to this file --one-way Check one way only, source files must exist on remote +Check Options + +Flags used for rclone check. + + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1252,6 +1704,40 @@ Options -h, --help help for ls +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1315,6 +1801,40 @@ Options -h, --help help for lsd -R, --recursive Recurse into the listing +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1368,6 +1888,40 @@ Options -h, --help help for lsl +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1407,6 +1961,40 @@ Options -h, --help help for md5sum --output-file string Output hashsums to a file rather than the terminal +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1449,6 +2037,40 @@ Options -h, --help help for sha1sum --output-file string Output hashsums to a file rather than the terminal +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1472,7 +2094,7 @@ as JSON instead. Recurses by default, use --max-depth 1 to stop the recursion. Some backends do not always provide file sizes, see for example Google -Photos and Google Drive. Rclone will then show a notice in the log +Photos and Google Docs. Rclone will then show a notice in the log indicating how many such files were encountered, and count them in as empty files in the output of the size command. @@ -1483,6 +2105,40 @@ Options -h, --help help for size --json Format output as JSON +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1559,6 +2215,14 @@ Options -h, --help help for cleanup +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -1695,6 +2359,14 @@ Options --dedupe-mode string Dedupe mode interactive|skip|first|newest|oldest|largest|smallest|rename (default "interactive") -h, --help help for dedupe +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -1837,6 +2509,14 @@ Options --json Always output in JSON format -o, --option stringArray Option in the form name=value or name +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -1863,17 +2543,91 @@ See full bisync description for details. Options - --check-access Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort. - --check-filename string Filename for --check-access (default: RCLONE_TEST) - --check-sync string Controls comparison of final listings: true|false|only (default: true) (default "true") - --filters-file string Read filtering patterns from a file - --force Bypass --max-delete safety check and run the sync. Consider using with --verbose - -h, --help help for bisync - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first. - --workdir string Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync) + --check-access Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort. + --check-filename string Filename for --check-access (default: RCLONE_TEST) + --check-sync string Controls comparison of final listings: true|false|only (default: true) (default "true") + --create-empty-src-dirs Sync creation and deletion of empty directories. (Not compatible with --remove-empty-dirs) + --filters-file string Read filtering patterns from a file + --force Bypass --max-delete safety check and run the sync. Consider using with --verbose + -h, --help help for bisync + --ignore-listing-checksum Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks) + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --remove-empty-dirs Remove ALL empty directories at the final cleanup step. + --resilient Allow future runs to retry after certain less-serious errors, instead of requiring --resync. Use at your own risk! + -1, --resync Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first. + --workdir string Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync) + +Copy Options + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) See the global flags page for global options not listed here. @@ -1906,16 +2660,63 @@ the end and --offset and --count to print a section in the middle. Note that if offset is negative it will count from the end, so --offset -1 --count 1 is equivalent to --tail 1. +Use the --separator flag to print a separator value between files. Be +sure to shell-escape special characters. For example, to print a newline +between files, use: + +- bash: + + rclone --include "*.txt" --separator $'\n' cat remote:path/to/dir + +- powershell: + + rclone --include "*.txt" --separator "`n" cat remote:path/to/dir + rclone cat remote:path [flags] Options - --count int Only print N characters (default -1) - --discard Discard the output instead of printing - --head int Only print the first N characters - -h, --help help for cat - --offset int Start printing at offset N (or from end if -ve) - --tail int Only print the last N characters + --count int Only print N characters (default -1) + --discard Discard the output instead of printing + --head int Only print the first N characters + -h, --help help for cat + --offset int Start printing at offset N (or from end if -ve) + --separator string Separator to use between objects when printing multiple files + --tail int Only print the last N characters + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions See the global flags page for global options not listed here. @@ -1925,16 +2726,19 @@ SEE ALSO rclone checksum -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. Synopsis -Checks that hashsums of source files match the SUM file. It compares -hashes (MD5, SHA1, etc) and logs a report of files which don't match. It -doesn't alter the file system. +Checks that hashsums of destination files match the SUM file. It +compares hashes (MD5, SHA1, etc) and logs a report of files which don't +match. It doesn't alter the file system. + +The sumfile is treated as the source and the dst:path is treated as the +destination for the purposes of the output. -If you supply the --download flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for +If you supply the --download flag, it will download the data from the +remote and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. @@ -1966,7 +2770,10 @@ what happened to it. These are reminiscent of diff files. - ! path means there was an error reading or hashing the source or dest. - rclone checksum sumfile src:path [flags] +The default number of parallel checks is 8. See the --checkers=N option +for more information. + + rclone checksum sumfile dst:path [flags] Options @@ -1980,6 +2787,40 @@ Options --missing-on-src string Report all files missing from the source to this file --one-way Check one way only, source files must exist on remote +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -1988,13 +2829,12 @@ SEE ALSO rclone completion -Generate the autocompletion script for the specified shell +Output completion script for a given shell. Synopsis -Generate the autocompletion script for rclone for the specified shell. -See each sub-command's help for details on how to use the generated -script. +Generates a shell completion script for rclone. Run with --help to list +the supported shells. Options @@ -2005,88 +2845,83 @@ See the global flags page for global options not listed here. SEE ALSO - rclone - Show help for rclone commands, flags and backends. -- rclone completion bash - Generate the autocompletion script for bash -- rclone completion fish - Generate the autocompletion script for fish -- rclone completion powershell - Generate the autocompletion script - for powershell -- rclone completion zsh - Generate the autocompletion script for zsh +- rclone completion bash - Output bash completion script for rclone. +- rclone completion fish - Output fish completion script for rclone. +- rclone completion powershell - Output powershell completion script + for rclone. +- rclone completion zsh - Output zsh completion script for rclone. rclone completion bash -Generate the autocompletion script for bash +Output bash completion script for rclone. Synopsis -Generate the autocompletion script for the bash shell. - -This script depends on the 'bash-completion' package. If it is not -installed already, you can install it via your OS's package manager. - -To load completions in your current shell session: - - source <(rclone completion bash) +Generates a bash shell autocompletion script for rclone. -To load completions for every new session, execute once: +This writes to /etc/bash_completion.d/rclone by default so will probably +need to be run with sudo or as root, e.g. -Linux: + sudo rclone genautocomplete bash - rclone completion bash > /etc/bash_completion.d/rclone +Logout and login again to use the autocompletion scripts, or source them +directly -macOS: + . /etc/bash_completion - rclone completion bash > $(brew --prefix)/etc/bash_completion.d/rclone +If you supply a command line argument the script will be written there. -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. - rclone completion bash + rclone completion bash [output_file] [flags] Options - -h, --help help for bash - --no-descriptions disable completion descriptions + -h, --help help for bash See the global flags page for global options not listed here. SEE ALSO -- rclone completion - Generate the autocompletion script for the - specified shell +- rclone completion - Output completion script for a given shell. rclone completion fish -Generate the autocompletion script for fish +Output fish completion script for rclone. Synopsis -Generate the autocompletion script for the fish shell. +Generates a fish autocompletion script for rclone. -To load completions in your current shell session: +This writes to /etc/fish/completions/rclone.fish by default so will +probably need to be run with sudo or as root, e.g. + + sudo rclone genautocomplete fish - rclone completion fish | source +Logout and login again to use the autocompletion scripts, or source them +directly -To load completions for every new session, execute once: + . /etc/fish/completions/rclone.fish - rclone completion fish > ~/.config/fish/completions/rclone.fish +If you supply a command line argument the script will be written there. -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. - rclone completion fish [flags] + rclone completion fish [output_file] [flags] Options - -h, --help help for fish - --no-descriptions disable completion descriptions + -h, --help help for fish See the global flags page for global options not listed here. SEE ALSO -- rclone completion - Generate the autocompletion script for the - specified shell +- rclone completion - Output completion script for a given shell. rclone completion powershell -Generate the autocompletion script for powershell +Output powershell completion script for rclone. Synopsis @@ -2099,62 +2934,54 @@ To load completions in your current shell session: To load completions for every new session, add the output of the above command to your powershell profile. - rclone completion powershell [flags] +If output_file is "-" or missing, then the output will be written to +stdout. + + rclone completion powershell [output_file] [flags] Options - -h, --help help for powershell - --no-descriptions disable completion descriptions + -h, --help help for powershell See the global flags page for global options not listed here. SEE ALSO -- rclone completion - Generate the autocompletion script for the - specified shell +- rclone completion - Output completion script for a given shell. rclone completion zsh -Generate the autocompletion script for zsh +Output zsh completion script for rclone. Synopsis -Generate the autocompletion script for the zsh shell. - -If shell completion is not already enabled in your environment you will -need to enable it. You can execute the following once: - - echo "autoload -U compinit; compinit" >> ~/.zshrc - -To load completions in your current shell session: - - source <(rclone completion zsh); compdef _rclone rclone +Generates a zsh autocompletion script for rclone. -To load completions for every new session, execute once: +This writes to /usr/share/zsh/vendor-completions/_rclone by default so +will probably need to be run with sudo or as root, e.g. -Linux: + sudo rclone genautocomplete zsh - rclone completion zsh > "${fpath[1]}/_rclone" +Logout and login again to use the autocompletion scripts, or source them +directly -macOS: + autoload -U compinit && compinit - rclone completion zsh > $(brew --prefix)/share/zsh/site-functions/_rclone +If you supply a command line argument the script will be written there. -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. - rclone completion zsh [flags] + rclone completion zsh [output_file] [flags] Options - -h, --help help for zsh - --no-descriptions disable completion descriptions + -h, --help help for zsh See the global flags page for global options not listed here. SEE ALSO -- rclone completion - Generate the autocompletion script for the - specified shell +- rclone completion - Output completion script for a given shell. rclone config create @@ -2461,6 +3288,36 @@ SEE ALSO - rclone config - Enter an interactive configuration session. +rclone config redacted + +Print redacted (decrypted) config file, or the redacted config for a +single remote. + +Synopsis + +This prints a redacted copy of the config file, either the whole config +file or for a given remote. + +The config file will be redacted by replacing all passwords and other +sensitive info with XXX. + +This makes the config file suitable for posting online for support. + +It should be double checked before posting as the redaction may not be +perfect. + + rclone config redacted [] [flags] + +Options + + -h, --help help for redacted + +See the global flags page for global options not listed here. + +SEE ALSO + +- rclone config - Enter an interactive configuration session. + rclone config show Print (decrypted) config file, or the config for a single remote. @@ -2680,6 +3537,84 @@ Options -h, --help help for copyto +Copy Options + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -2719,6 +3654,14 @@ Options -p, --print-filename Print the resulting name from --auto-filename --stdout Write the output to stdout rather than a file +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -2727,13 +3670,13 @@ SEE ALSO rclone cryptcheck -Cryptcheck checks the integrity of a crypted remote. +Cryptcheck checks the integrity of an encrypted remote. Synopsis rclone cryptcheck checks a remote against a crypted remote. This is the equivalent of running rclone check, but able to check the checksums of -the crypted remote. +the encrypted remote. For it to work the underlying remote of the cryptedremote must support some kind of checksum. @@ -2780,6 +3723,9 @@ what happened to it. These are reminiscent of diff files. - ! path means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the --checkers=N option +for more information. + rclone cryptcheck remote:path cryptedremote:path [flags] Options @@ -2793,6 +3739,46 @@ Options --missing-on-src string Report all files missing from the source to this file --one-way Check one way only, source files must exist on remote +Check Options + +Flags used for rclone check. + + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -2849,6 +3835,14 @@ Options -h, --help help for deletefile +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -3036,10 +4030,6 @@ Run without a hash to see the list of all supported hashes, e.g. * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor Then @@ -3048,7 +4038,7 @@ Then Note that hash names are case insensitive and values are output in lower case. - rclone hashsum remote:path [flags] + rclone hashsum [ remote:path] [flags] Options @@ -3058,6 +4048,40 @@ Options -h, --help help for hashsum --output-file string Output hashsums to a file rather than the terminal +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -3108,7 +4132,8 @@ SEE ALSO rclone listremotes -List all the remotes in the config file. +List all the remotes in the config file and defined in environment +variables. Synopsis @@ -3266,6 +4291,40 @@ Options -R, --recursive Recurse into the listing -s, --separator string Separator for the items in the format (default ";") +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -3391,6 +4450,40 @@ Options -R, --recursive Recurse into the listing --stat Just return the info for the pointed to file +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -3661,10 +4754,28 @@ not suffer from the same limitations. Mounting on macOS -Mounting on macOS can be done either via macFUSE (also known as osxfuse) -or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel -extension (kext). FUSE-T is an alternative FUSE system which "mounts" -via an NFSv4 local server. +Mounting on macOS can be done either via built-in NFS server, macFUSE +(also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver +utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE +system which "mounts" via an NFSv4 local server. + +NFS mount + +This method spins up an NFS server using serve nfs command and mounts it +to the specified mountpoint. If you run this in background mode using +|--daemon|, you will need to send SIGTERM signal to the rclone process +using |kill| command to stop the mount. + +macFUSE Notes + +If installing macFUSE using dmg packages from the website, rclone will +locate the macFUSE libraries without any further intervention. If +however, macFUSE is installed using the macports package manager, the +following addition steps are required. + + sudo mkdir /usr/local/lib + cd /usr/local/lib + sudo ln -s /opt/local/lib/libfuse.2.dylib FUSE-T Limitations, Caveats, and Notes @@ -3702,7 +4813,8 @@ Without the use of --vfs-cache-mode this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without --vfs-cache-mode writes or --vfs-cache-mode full. See the VFS File -Caching section for more info. +Caching section for more info. When using NFS mount on macOS, if you +don't specify |--vfs-cache-mode| the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty directories will @@ -3797,19 +4909,18 @@ or create systemd mount units: # /etc/systemd/system/mnt-data.mount [Unit] - After=network-online.target + Description=Mount for /mnt/data [Mount] Type=rclone What=sftp1:subdir Where=/mnt/data - Options=rw,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone + Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone optionally accompanied by systemd automount unit # /etc/systemd/system/mnt-data.automount [Unit] - After=network-online.target - Before=remote-fs.target + Description=AutoMount for /mnt/data [Automount] Where=/mnt/data TimeoutIdleSec=600 @@ -3843,9 +4954,8 @@ Mount option syntax includes a few extra options treated specially: pgrep. - vv... will be transformed into appropriate --verbose=N - standard mount options like x-systemd.automount, _netdev, nosuid and - alike are intended only for Automountd and ignored by rclone. - -VFS - Virtual File System + alike are intended only for Automountd and ignored by rclone. ## + VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -3918,12 +5028,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -3939,10 +5050,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -4186,6 +5308,7 @@ Options --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for mount --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -4197,8 +5320,9 @@ Options --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -4208,12 +5332,40 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) --volname string Set the volume name (supported on Windows and OSX only) --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -4263,6 +5415,84 @@ Options -h, --help help for moveto +Copy Options + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -4303,6 +5533,7 @@ toggle the help on and off. The supported keys are: y copy current path to clipboard Y display current path ^L refresh screen (fix screen corruption) + r recalculate file sizes ? to toggle help on and off q/ESC/^c to quit @@ -4337,6 +5568,40 @@ Options -h, --help help for ncdu +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -4488,10 +5753,11 @@ streaming. size of the stream is different in length to the --size passed in then the transfer will likely fail. -Note that the upload can also not be retried because the data is not -kept around until the upload succeeds. If you need to transfer a lot of -data, you're better off caching locally and then rclone move it to the -destination. +Note that the upload cannot be retried because the data is not stored. +If the backend supports multipart uploading then individual chunks can +be retried. If you need to transfer a lot of data, you may be better off +caching it locally and then rclone move it to the destination which can +use retries. rclone rcat remote:path [flags] @@ -4500,6 +5766,14 @@ Options -h, --help help for rcat --size int File size hint to preallocate (default -1) +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -4524,12 +5798,12 @@ See the rc documentation for more info on the rc flags. Server options -Use --addr to specify which IP address and port the server should listen -on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By -default it only listens on localhost. You can use port :0 to let the OS -choose an available port. +Use --rc-addr to specify which IP address and port the server should +listen on, eg --rc-addr 1.2.3.4:8000 or --rc-addr :8080 to listen to all +IPs. By default it only listens on localhost. You can use port :0 to let +the OS choose an available port. -If you set --addr to listen on a public or LAN accessible IP address +If you set --rc-addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info. You can use a unix socket by setting the url to unix:///path/to/socket @@ -4537,41 +5811,41 @@ or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions. ---addr may be repeated to listen on multiple IPs/ports/sockets. +--rc-addr may be repeated to listen on multiple IPs/ports/sockets. ---server-read-timeout and --server-write-timeout can be used to control -the timeouts on the server. Note that this is the total time for a -transfer. +--rc-server-read-timeout and --rc-server-write-timeout can be used to +control the timeouts on the server. Note that this is the total time for +a transfer. ---max-header-bytes controls the maximum number of bytes the server will -accept in the HTTP header. +--rc-max-header-bytes controls the maximum number of bytes the server +will accept in the HTTP header. ---baseurl controls the URL prefix that rclone serves from. By default -rclone will serve from the root. If you used --baseurl "/rclone" then +--rc-baseurl controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used --rc-baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading -and trailing "/" on --baseurl, so --baseurl "rclone", ---baseurl "/rclone" and --baseurl "/rclone/" are all treated +and trailing "/" on --rc-baseurl, so --rc-baseurl "rclone", +--rc-baseurl "/rclone" and --rc-baseurl "/rclone/" are all treated identically. TLS (SSL) By default this will serve over http. If you want you can serve over -https. You will need to supply the --cert and --key flags. If you wish -to do client side certificate validation then you will need to supply ---client-ca also. +https. You will need to supply the --rc-cert and --rc-key flags. If you +wish to do client side certificate validation then you will need to +supply --rc-client-ca also. ---cert should be a either a PEM encoded certificate or a concatenation -of that with the CA certificate. --key should be the PEM encoded private -key and --client-ca should be the PEM encoded client certificate -authority certificate. +--rc-cert should be a either a PEM encoded certificate or a +concatenation of that with the CA certificate. --krc-ey should be the +PEM encoded private key and --rc-client-ca should be the PEM encoded +client certificate authority certificate. ---min-tls-version is minimum TLS version that is acceptable. Valid +--rc-min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). Template ---template allows a user to specify a custom markup template for HTTP +--rc-template allows a user to specify a custom markup template for HTTP and WebDAV serve functions. The server exports the following markup to be used within the template to server pages: @@ -4621,15 +5895,41 @@ be used within the template to server pages: -- .ModTime The UTC timestamp of an entry. ----------------------------------------------------------------------- +The server also makes the following functions available so that they can +be used within the template. These functions help extend the options for +dynamic rendering of HTML. They can be used to render HTML based on +specific conditions. + + ----------------------------------------------------------------------- + Function Description + ----------------------------------- ----------------------------------- + afterEpoch Returns the time since the epoch + for the given time. + + contains Checks whether a given substring is + present or not in a given string. + + hasPrefix Checks whether the given string + begins with the specified prefix. + + hasSuffix Checks whether the given string end + with the specified suffix. + ----------------------------------------------------------------------- + Authentication By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set -a single username and password with the --user and --pass flags. +a single username and password with the --rc-user and --rc-pass flags. -Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in -standard apache format and supports MD5, SHA1 and BCrypt for basic +If no static users are configured by either of the above methods, and +client certificates are required by the --client-ca flag passed to the +server, the client certificate common name will be considered as the +username. + +Use --rc-htpasswd /path/to/htpasswd to provide an htpasswd file. This is +in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. To create an htpasswd file: @@ -4640,9 +5940,9 @@ To create an htpasswd file: The password file can be updated while rclone is running. -Use --realm to set the authentication realm. +Use --rc-realm to set the authentication realm. -Use --salt to change the password hashing salt from the default. +Use --rc-salt to change the password hashing salt from the default. rclone rcd * [flags] @@ -4650,6 +5950,39 @@ Options -h, --help help for rcd +RC Options + +Flags to control the Remote Control API. + + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui + See the global flags page for global options not listed here. SEE ALSO @@ -4674,7 +6007,10 @@ This is useful for tidying up remotes that rclone has left a lot of empty directories in. For example the delete command will delete files but leave the directory structure (unless used with option --rmdirs). -To delete a path and any objects in it, use purge command. +This will delete --checkers directories concurrently so if you have +thousands of empty directories consider increasing this number. + +To delete a path and any objects in it, use the purge command. rclone rmdirs remote:path [flags] @@ -4683,6 +6019,14 @@ Options -h, --help help for rmdirs --leave-root Do not remove root directory if empty +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + See the global flags page for global options not listed here. SEE ALSO @@ -4697,7 +6041,8 @@ Synopsis This command downloads the latest release of rclone and replaces the currently running binary. The download is verified with a hashsum and -cryptographically signed signature. +cryptographically signed signature; see the release signing docs for +details. If used without flags (or with implied --stable flag), this command will install the latest stable release. However, some issues may be fixed (or @@ -4731,9 +6076,9 @@ correct for your OS) to update these too. This command with the default --package zip will update only the rclone executable so the local manual may become inaccurate after it. -The rclone mount command (https://rclone.org/commands/rclone_mount/) may -or may not support extended FUSE options depending on the build and OS. -selfupdate will refuse to update if the capability would be discarded. +The rclone mount command may or may not support extended FUSE options +depending on the build and OS. selfupdate will refuse to update if the +capability would be discarded. Note: Windows forbids deletion of a currently running executable so this command will rename the old executable to 'rclone.old.exe' upon success. @@ -4790,7 +6135,9 @@ SEE ALSO API. - rclone serve ftp - Serve remote:path over FTP. - rclone serve http - Serve the remote over HTTP. +- rclone serve nfs - Serve the remote as an NFS mount - rclone serve restic - Serve the remote for restic's REST API. +- rclone serve s3 - Serve remote:path over s3. - rclone serve sftp - Serve the remote over SFTP. - rclone serve webdav - Serve remote:path over WebDAV. @@ -4820,9 +6167,7 @@ Use --name to choose the friendly server name, which is by default "rclone (hostname)". Use --log-trace in conjunction with -vv to enable additional debug -logging of all UPNP traffic. - -VFS - Virtual File System +logging of all UPNP traffic. ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -4895,12 +6240,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -4916,10 +6262,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -5162,8 +6519,9 @@ Options --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -5173,10 +6531,38 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -5226,8 +6612,7 @@ directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. - -VFS - Virtual File System +## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -5300,12 +6685,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -5321,10 +6707,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -5570,6 +6967,7 @@ Options --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for docker --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -5584,8 +6982,9 @@ Options --socket-gid int GID for unix socket (default: current process GID) (default 1000) --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -5595,12 +6994,40 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) --volname string Set the volume name (supported on Windows and OSX only) --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -5632,9 +7059,7 @@ Authentication By default this will serve files without needing a login. You can set a single username and password with the --user and --pass -flags. - -VFS - Virtual File System +flags. ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -5707,12 +7132,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -5728,10 +7154,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -6048,8 +7485,9 @@ Options --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication (default "anonymous") - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -6059,10 +7497,38 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -6185,6 +7651,27 @@ be used within the template to server pages: -- .ModTime The UTC timestamp of an entry. ----------------------------------------------------------------------- +The server also makes the following functions available so that they can +be used within the template. These functions help extend the options for +dynamic rendering of HTML. They can be used to render HTML based on +specific conditions. + + ----------------------------------------------------------------------- + Function Description + ----------------------------------- ----------------------------------- + afterEpoch Returns the time since the epoch + for the given time. + + contains Checks whether a given substring is + present or not in a given string. + + hasPrefix Checks whether the given string + begins with the specified prefix. + + hasSuffix Checks whether the given string end + with the specified suffix. + ----------------------------------------------------------------------- + Authentication By default this will serve files without needing a login. @@ -6192,6 +7679,11 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags. +If no static users are configured by either of the above methods, and +client certificates are required by the --client-ca flag passed to the +server, the client certificate common name will be considered as the +username. + Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -6206,9 +7698,8 @@ The password file can be updated while rclone is running. Use --realm to set the authentication realm. -Use --salt to change the password hashing salt from the default. - -VFS - Virtual File System +Use --salt to change the password hashing salt from the default. ## VFS +- Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -6281,12 +7772,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -6302,10 +7794,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -6603,6 +8106,7 @@ that rclone supports. Options --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --auth-proxy string A program to use to create the backend from the auth --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) @@ -6630,8 +8134,9 @@ Options --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -6641,10 +8146,475 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +See the global flags page for global options not listed here. + +SEE ALSO + +- rclone serve - Serve a remote over a protocol. + +rclone serve nfs + +Serve the remote as an NFS mount + +Synopsis + +Create an NFS server that serves the given remote over the network. + +The primary purpose for this command is to enable mount command on +recent macOS versions where installing FUSE is very cumbersome. + +Since this is running on NFSv3, no authentication method is available. +Any client will be able to access the data. To limit access, you can use +serve NFS on loopback address and rely on secure tunnels (such as SSH). +For this reason, by default, a random TCP port is chosen and loopback +interface is used for the listening address; meaning that it is only +available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address +and port using --addr flag. + +Modifying files through NFS protocol requires VFS caching. Usually you +will need to specify --vfs-cache-mode in order to be able to write to +the mountpoint (full is recommended). If you don't specify VFS cache +mode, the mount will be read-only. + +To serve NFS over the network use following command: + + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full + +We specify a specific port that we can use in the mount command: + +To mount the server under Linux/macOS, use the following command: + + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint + +Where $PORT is the same port number we used in the serve nfs command. + +This feature is only available on Unix platforms. + +VFS - Virtual File System + +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk filing +system. + +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the VFS +layer has to deal with that. Because there is no one right way of doing +this there are various options explained below. + +The VFS layer also implements a directory cache - this caches info about +files and directories (but not the data) in memory. + +VFS Directory Cache + +Using the --dir-cache-time flag, you can control how long a directory +should be considered up to date and not refreshed from the backend. +Changes made through the VFS will appear immediately or invalidate the +cache. + + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) + +However, changes made directly on the cloud storage by the web interface +or a different copy of rclone will only be picked up once the directory +cache expires if the backend configured does not support polling for +changes. If the backend supports polling, changes will be picked up +within the polling interval. + +You can send a SIGHUP signal to rclone for it to flush all directory +caches, regardless of how old they are. Assuming only one rclone +instance is running, you can reset the cache like this: + + kill -SIGHUP $(pidof rclone) + +If you configure rclone with a remote control then you can use rclone rc +to flush the whole directory cache: + + rclone rc vfs/forget + +Or individual files or directories: + + rclone rc vfs/forget file=path/to/file dir=path/to/dir + +VFS File Buffering + +The --buffer-size flag determines the amount of memory, that will be +used to buffer data in advance. + +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. + +This flag is a upper limit for the used memory per open file. The buffer +will only use memory for data that is downloaded but not not yet read. +If the buffer is empty, only a small amount of memory will be used. + +The maximum memory used by rclone for buffering can be up to +--buffer-size * open files. + +VFS File Caching + +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. + +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. + +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + +If run with -vv rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with --cache-dir or setting the appropriate +environment variable. + +The cache has 4 different modes selected by --vfs-cache-mode. The higher +the cache mode the more compatible rclone becomes at the cost of using +disk space. + +Note that files are written back to the remote only when they are closed +and if they haven't been accessed for --vfs-write-back seconds. If +rclone is quit or dies with files that haven't been uploaded, these will +be uploaded next time rclone is run with the same flags. + +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . + +You should not run two copies of rclone using the same VFS cache with +the same or overlapping remotes if using --vfs-cache-mode > off. This +can potentially cause data corruption if you do. You can work around +this by giving each rclone its own cache hierarchy with --cache-dir. You +don't need to worry about this if the remotes in use don't overlap. + +--vfs-cache-mode off + +In this mode (the default) the cache will read directly from the remote +and write directly to the remote without caching anything on disk. + +This will mean some operations are not possible + +- Files can't be opened for both read AND write +- Files opened for write can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files open for read with O_TRUNC will be opened write only +- Files open for write only will behave as if O_TRUNC was supplied +- Open modes O_APPEND, O_TRUNC are ignored +- If an upload fails it can't be retried + +--vfs-cache-mode minimal + +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for write +will be a lot more compatible, but uses the minimal disk space. + +These operations are not possible + +- Files opened for write only can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files opened for write only will ignore O_APPEND, O_TRUNC +- If an upload fails it can't be retried + +--vfs-cache-mode writes + +In this mode files opened for read only are still read directly from the +remote, write only and read/write files are buffered to disk first. + +This mode should support all normal file system operations. + +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. + +--vfs-cache-mode full + +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. + +In this mode the files in the cache will be sparse files and rclone will +keep track of which bits of the files it has downloaded. + +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. + +This mode should support all normal file system operations and is +otherwise identical to --vfs-cache-mode writes. + +When reading a file rclone will read --buffer-size plus --vfs-read-ahead +bytes ahead. The --buffer-size is buffered in memory whereas the +--vfs-read-ahead is buffered on disk. + +When using this mode it is recommended that --buffer-size is not set too +large and --vfs-read-ahead is set large if required. + +IMPORTANT not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache directory +is on a filesystem which doesn't support sparse files and it will log an +ERROR message if one is detected. + +Fingerprinting + +Various parts of the VFS use fingerprinting to see if a local file copy +has changed relative to a remote file. Fingerprints are made from: + +- size +- modification time +- hash + +where available on an object. + +On some backends some of these attributes are slow to read (they take an +extra API call per object, or extra work per object). + +For example hash is slow with the local and sftp backends as they have +to read the entire file and hash it, and modtime is slow with the s3, +swift, ftp and qinqstor backends because they need to do an extra API +call to fetch it. + +If you use the --vfs-fast-fingerprint flag then rclone will not include +the slow operations in the fingerprint. This makes the fingerprinting +less accurate but much faster and will improve the opening time of +cached files. + +If you are running a vfs cache over local, s3 or swift backends then +using this flag is recommended. + +Note that if you change the value of this flag, the fingerprints of the +files in the cache may be invalidated and the files will need to be +downloaded again. + +VFS Chunked Reading + +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the chunk +specified. This can reduce the used download quota for some remotes by +requesting only chunks from the remote that are actually read, at the +cost of an increased number of requests. + +These flags control the chunking: + + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) + +Rclone will start reading a chunk of size --vfs-read-chunk-size, and +then double the size for each read. When --vfs-read-chunk-size-limit is +specified, and greater than --vfs-read-chunk-size, the chunk size for +each open file will get doubled only until the specified value is +reached. If the value is "off", which is the default, the limit is +disabled and the chunk size will grow indefinitely. + +With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the +following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, +300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, +the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, +1200M-1700M and so on. + +Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading. + +VFS Performance + +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the chunked reading feature. + +In particular S3 and Swift benefit hugely from the --no-modtime flag (or +use --use-server-modtime for a slightly different effect) as each read +of the modification time takes a transaction. + + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. + +Sometimes rclone is delivered reads or writes out of order. Rather than +seeking rclone will wait a short time for the in sequence read or write +to come in. These flags only come into effect when not using an on disk +cache file. + + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) + +When using VFS write caching (--vfs-cache-mode with value writes or +full), the global flag --transfers can be set to adjust the number of +parallel uploads of modified files from the cache (the related global +flag --checkers has no effect on the VFS). + + --transfers int Number of file transfers to run in parallel (default 4) + +VFS Case Sensitivity + +Linux file systems are case-sensitive: two files can differ only by +case, and the exact case must be used when opening a file. + +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case +used to create the file is preserved and available for programs to +query. It is not allowed for two files in the same directory to differ +only by case. + +Usually file systems on macOS are case-insensitive. It is possible to +make macOS file systems case-sensitive but that is not the default. + +The --vfs-case-insensitive VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the +remote as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. + +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers to an +existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the +same name is not found but a name differing only by case exists, rclone +will transparently fixup the name. This fixup happens only when an +existing file is requested. Case sensitivity of file names created anew +by rclone is controlled by the underlying remote. + +Note that case sensitivity of the operating system running rclone (the +target) may differ from case sensitivity of a file system presented by +rclone (the source). The flag controls whether "fixup" is performed to +satisfy the target. + +If the flag is not provided on the command line, then its default value +depends on the operating system where rclone runs: "true" on Windows and +macOS, "false" otherwise. If the flag is provided without a value, then +it is "true". + +VFS Disk Options + +This flag allows you to manually set the statistics about the filing +system. It can be useful when those statistics cannot be read correctly +automatically. + + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) + +Alternate report of used bytes + +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running df on the +filesystem, then pass the flag --vfs-used-is-size to rclone. With this +flag set, instead of relying on the backend to report this information, +rclone will scan the whole remote similar to rclone size and compute the +total used space itself. + +WARNING. Contrary to rclone size, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots +of API calls resulting in extra charges. Use it as a last resort and +only with caching. + + rclone serve nfs remote:path [flags] + +Options + + --addr string IPaddress:Port or :Port to bind server to + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for nfs + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -6790,6 +8760,11 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags. +If no static users are configured by either of the above methods, and +client certificates are required by the --client-ca flag passed to the +server, the client certificate common name will be considered as the +username. + Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -6811,6 +8786,7 @@ Use --salt to change the password hashing salt from the default. Options --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --append-only Disallow deletion of repository data --baseurl string Prefix for URLs - leave blank for root --cache-objects Cache listed objects (default true) @@ -6836,65 +8812,165 @@ SEE ALSO - rclone serve - Serve a remote over a protocol. -rclone serve sftp +rclone serve s3 -Serve the remote over SFTP. +Serve remote:path over s3. Synopsis -Run an SFTP server to serve a remote over SFTP. This can be used with an -SFTP client or you can make a remote of type sftp to use with it. +serve s3 implements a basic s3 server that serves a remote via s3. This +can be viewed with an s3 client, or you can make an s3 type remote to +read and write to it with rclone. -You can use the filter flags (e.g. --include, --exclude) to control what -is served. +serve s3 is considered Experimental so use with care. -The server will respond to a small number of shell commands, mainly -md5sum, sha1sum and df, which enable it to provide support for checksums -and the about feature when accessed from an sftp remote. +S3 server supports Signature Version 4 authentication. Just use +--auth-key accessKey,secretKey and set the Authorization header +correctly in the request. (See the AWS docs). -Note that this server uses standard 32 KiB packet payload size, which -means you must not configure the client to expect anything else, e.g. -with the chunk_size option on an sftp remote. +--auth-key can be repeated for multiple auth pairs. If --auth-key is not +provided then serve s3 will allow anonymous access. -The server will log errors. Use -v to see access logs. +Please note that some clients may require HTTPS endpoints. See the SSL +docs for more information. ---bwlimit will be respected for file transfers. Use --stats to control -the stats printing. +This command uses the VFS directory cache. All the functionality will +work with --vfs-cache-mode off. Using --vfs-cache-mode full (or writes) +can be used to cache objects locally to improve performance. -You must provide some means of authentication, either with ---user/--pass, an authorized keys file (specify location with ---authorized-keys - the default is the same as ssh), an --auth-proxy, or -set the --no-auth flag for no authentication when logging in. +Use --force-path-style=false if you want to use the bucket name as a +part of the hostname (such as mybucket.local) -If you don't supply a host --key then rclone will generate rsa, ecdsa -and ed25519 variants, and cache them for later use in rclone's cache -directory (see rclone help flags cache-dir) in the "serve-sftp" -directory. +Use --etag-hash if you want to change the hash uses for the ETag. Note +that using anything other than MD5 (the default) is likely to cause +problems for S3 clients which rely on the Etag being the MD5. -By default the server binds to localhost:2022 - if you want it to be -reachable externally then supply --addr :2022 for example. +Quickstart -Note that the default of --vfs-cache-mode off is fine for the rclone -sftp backend, but it may not be with other SFTP clients. +For a simple set up, to serve remote:path over s3, run the server like +this: -If --stdio is specified, rclone will serve SFTP over stdio, which can be -used with sshd via ~/.ssh/authorized_keys, for example: + rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path - restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... +This will be compatible with an rclone remote which is defined like +this: -On the client you need to set --transfers 1 when using --stdio. -Otherwise multiple instances of the rclone server are started by OpenSSH -which can lead to "corrupted on transfer" errors. This is the case -because the client chooses indiscriminately which server to send -commands to while the servers all have different views of the state of -the filing system. + [serves3] + type = s3 + provider = Rclone + endpoint = http://127.0.0.1:8080/ + access_key_id = ACCESS_KEY_ID + secret_access_key = SECRET_ACCESS_KEY + use_multipart_uploads = false -The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from -beeing used. Omitting "restrict" and using --sftp-path-override to -enable checksumming is possible but less secure and you could use the -SFTP server provided by OpenSSH in this case. +Note that setting disable_multipart_uploads = true is to work around a +bug which will be fixed in due course. -VFS - Virtual File System +Bugs + +When uploading multipart files serve s3 holds all the parts in memory +(see #7453). This is a limitaton of the library rclone uses for serving +S3 and will hopefully be fixed at some point. + +Multipart server side copies do not work (see #7454). These take a very +long time and eventually fail. The default threshold for multipart +server side copies is 5G which is the maximum it can be, so files above +this side will fail to be server side copied. + +For a current list of serve s3 bugs see the serve s3 bug category on +GitHub. + +Limitations + +serve s3 will treat all directories in the root as buckets and ignore +all files in the root. You can use CreateBucket to create folders under +the root, but you can't create empty folders under other folders not in +the root. + +When using PutObject or DeleteObject, rclone will automatically create +or clean up empty folders. If you don't want to clean up empty folders +automatically, use --no-cleanup. + +When using ListObjects, rclone will use / when the delimiter is empty. +This reduces backend requests with no effect on most operations, but if +the delimiter is something other than / and empty, rclone will do a full +recursive search of the backend, which can take some time. + +Versioning is not currently supported. + +Metadata will only be saved in memory other than the rclone mtime +metadata which will be set as the modification time of the file. + +Supported operations + +serve s3 currently supports the following operations. + +- Bucket + - ListBuckets + - CreateBucket + - DeleteBucket +- Object + - HeadObject + - ListObjects + - GetObject + - PutObject + - DeleteObject + - DeleteObjects + - CreateMultipartUpload + - CompleteMultipartUpload + - AbortMultipartUpload + - CopyObject + - UploadPart + +Other operations will return error Unimplemented. + +Server options + +Use --addr to specify which IP address and port the server should listen +on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By +default it only listens on localhost. You can use port :0 to let the OS +choose an available port. + +If you set --addr to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. + +You can use a unix socket by setting the url to unix:///path/to/socket +or just by using an absolute path name. Note that unix sockets bypass +the authentication - this is expected to be done with file system +permissions. + +--addr may be repeated to listen on multiple IPs/ports/sockets. + +--server-read-timeout and --server-write-timeout can be used to control +the timeouts on the server. Note that this is the total time for a +transfer. + +--max-header-bytes controls the maximum number of bytes the server will +accept in the HTTP header. + +--baseurl controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used --baseurl "/rclone" then +rclone would serve from a URL starting with "/rclone/". This is useful +if you wish to proxy rclone serve. Rclone automatically inserts leading +and trailing "/" on --baseurl, so --baseurl "rclone", +--baseurl "/rclone" and --baseurl "/rclone/" are all treated +identically. + +TLS (SSL) + +By default this will serve over http. If you want you can serve over +https. You will need to supply the --cert and --key flags. If you wish +to do client side certificate validation then you will need to supply +--client-ca also. + +--cert should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. --key should be the PEM encoded private +key and --client-ca should be the PEM encoded client certificate +authority certificate. + +--min-tls-version is minimum TLS version that is acceptable. Valid +values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). +## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -6967,12 +9043,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -6988,10 +9065,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -7213,22 +9301,491 @@ result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -Auth Proxy + rclone serve s3 remote:path [flags] -If you supply the parameter --auth-proxy /path/to/program then rclone -will use that program to generate backends on the fly which then are -used to authenticate incoming requests. This uses a simple JSON based -protocol with input on STDIN and output on STDOUT. +Options -PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, -if --auth-proxy is set the authorized keys option will be ignored. + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-key stringArray Set key pair for v4 authorization: access_key_id,secret_access_key + --baseurl string Prefix for URLs - leave blank for root + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --etag-hash string Which hash to use for the ETag, or auto or blank for off (default "MD5") + --file-perms FileMode File permissions (default 0666) + --force-path-style If true use path style access if false use virtual hosted style (default true) (default true) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for s3 + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --no-checksum Don't compare checksums on up/download + --no-cleanup Not to cleanup empty folder after object is deleted + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) -There is an example program bin/test_proxy.py in the rclone source code. +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -The program's job is to take a user and pass on the input and turn those -into the config for a backend on STDOUT in JSON format. This config will -have any default parameters for the backend added, but it won't use -configuration from environment variables or command line options - it is +See the global flags page for global options not listed here. + +SEE ALSO + +- rclone serve - Serve a remote over a protocol. + +rclone serve sftp + +Serve the remote over SFTP. + +Synopsis + +Run an SFTP server to serve a remote over SFTP. This can be used with an +SFTP client or you can make a remote of type sftp to use with it. + +You can use the filter flags (e.g. --include, --exclude) to control what +is served. + +The server will respond to a small number of shell commands, mainly +md5sum, sha1sum and df, which enable it to provide support for checksums +and the about feature when accessed from an sftp remote. + +Note that this server uses standard 32 KiB packet payload size, which +means you must not configure the client to expect anything else, e.g. +with the chunk_size option on an sftp remote. + +The server will log errors. Use -v to see access logs. + +--bwlimit will be respected for file transfers. Use --stats to control +the stats printing. + +You must provide some means of authentication, either with +--user/--pass, an authorized keys file (specify location with +--authorized-keys - the default is the same as ssh), an --auth-proxy, or +set the --no-auth flag for no authentication when logging in. + +If you don't supply a host --key then rclone will generate rsa, ecdsa +and ed25519 variants, and cache them for later use in rclone's cache +directory (see rclone help flags cache-dir) in the "serve-sftp" +directory. + +By default the server binds to localhost:2022 - if you want it to be +reachable externally then supply --addr :2022 for example. + +Note that the default of --vfs-cache-mode off is fine for the rclone +sftp backend, but it may not be with other SFTP clients. + +If --stdio is specified, rclone will serve SFTP over stdio, which can be +used with sshd via ~/.ssh/authorized_keys, for example: + + restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... + +On the client you need to set --transfers 1 when using --stdio. +Otherwise multiple instances of the rclone server are started by OpenSSH +which can lead to "corrupted on transfer" errors. This is the case +because the client chooses indiscriminately which server to send +commands to while the servers all have different views of the state of +the filing system. + +The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from +being used. Omitting "restrict" and using --sftp-path-override to enable +checksumming is possible but less secure and you could use the SFTP +server provided by OpenSSH in this case. + +VFS - Virtual File System + +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk filing +system. + +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the VFS +layer has to deal with that. Because there is no one right way of doing +this there are various options explained below. + +The VFS layer also implements a directory cache - this caches info about +files and directories (but not the data) in memory. + +VFS Directory Cache + +Using the --dir-cache-time flag, you can control how long a directory +should be considered up to date and not refreshed from the backend. +Changes made through the VFS will appear immediately or invalidate the +cache. + + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) + +However, changes made directly on the cloud storage by the web interface +or a different copy of rclone will only be picked up once the directory +cache expires if the backend configured does not support polling for +changes. If the backend supports polling, changes will be picked up +within the polling interval. + +You can send a SIGHUP signal to rclone for it to flush all directory +caches, regardless of how old they are. Assuming only one rclone +instance is running, you can reset the cache like this: + + kill -SIGHUP $(pidof rclone) + +If you configure rclone with a remote control then you can use rclone rc +to flush the whole directory cache: + + rclone rc vfs/forget + +Or individual files or directories: + + rclone rc vfs/forget file=path/to/file dir=path/to/dir + +VFS File Buffering + +The --buffer-size flag determines the amount of memory, that will be +used to buffer data in advance. + +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. + +This flag is a upper limit for the used memory per open file. The buffer +will only use memory for data that is downloaded but not not yet read. +If the buffer is empty, only a small amount of memory will be used. + +The maximum memory used by rclone for buffering can be up to +--buffer-size * open files. + +VFS File Caching + +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. + +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. + +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + +If run with -vv rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with --cache-dir or setting the appropriate +environment variable. + +The cache has 4 different modes selected by --vfs-cache-mode. The higher +the cache mode the more compatible rclone becomes at the cost of using +disk space. + +Note that files are written back to the remote only when they are closed +and if they haven't been accessed for --vfs-write-back seconds. If +rclone is quit or dies with files that haven't been uploaded, these will +be uploaded next time rclone is run with the same flags. + +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . + +You should not run two copies of rclone using the same VFS cache with +the same or overlapping remotes if using --vfs-cache-mode > off. This +can potentially cause data corruption if you do. You can work around +this by giving each rclone its own cache hierarchy with --cache-dir. You +don't need to worry about this if the remotes in use don't overlap. + +--vfs-cache-mode off + +In this mode (the default) the cache will read directly from the remote +and write directly to the remote without caching anything on disk. + +This will mean some operations are not possible + +- Files can't be opened for both read AND write +- Files opened for write can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files open for read with O_TRUNC will be opened write only +- Files open for write only will behave as if O_TRUNC was supplied +- Open modes O_APPEND, O_TRUNC are ignored +- If an upload fails it can't be retried + +--vfs-cache-mode minimal + +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for write +will be a lot more compatible, but uses the minimal disk space. + +These operations are not possible + +- Files opened for write only can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files opened for write only will ignore O_APPEND, O_TRUNC +- If an upload fails it can't be retried + +--vfs-cache-mode writes + +In this mode files opened for read only are still read directly from the +remote, write only and read/write files are buffered to disk first. + +This mode should support all normal file system operations. + +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. + +--vfs-cache-mode full + +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. + +In this mode the files in the cache will be sparse files and rclone will +keep track of which bits of the files it has downloaded. + +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. + +This mode should support all normal file system operations and is +otherwise identical to --vfs-cache-mode writes. + +When reading a file rclone will read --buffer-size plus --vfs-read-ahead +bytes ahead. The --buffer-size is buffered in memory whereas the +--vfs-read-ahead is buffered on disk. + +When using this mode it is recommended that --buffer-size is not set too +large and --vfs-read-ahead is set large if required. + +IMPORTANT not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache directory +is on a filesystem which doesn't support sparse files and it will log an +ERROR message if one is detected. + +Fingerprinting + +Various parts of the VFS use fingerprinting to see if a local file copy +has changed relative to a remote file. Fingerprints are made from: + +- size +- modification time +- hash + +where available on an object. + +On some backends some of these attributes are slow to read (they take an +extra API call per object, or extra work per object). + +For example hash is slow with the local and sftp backends as they have +to read the entire file and hash it, and modtime is slow with the s3, +swift, ftp and qinqstor backends because they need to do an extra API +call to fetch it. + +If you use the --vfs-fast-fingerprint flag then rclone will not include +the slow operations in the fingerprint. This makes the fingerprinting +less accurate but much faster and will improve the opening time of +cached files. + +If you are running a vfs cache over local, s3 or swift backends then +using this flag is recommended. + +Note that if you change the value of this flag, the fingerprints of the +files in the cache may be invalidated and the files will need to be +downloaded again. + +VFS Chunked Reading + +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the chunk +specified. This can reduce the used download quota for some remotes by +requesting only chunks from the remote that are actually read, at the +cost of an increased number of requests. + +These flags control the chunking: + + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) + +Rclone will start reading a chunk of size --vfs-read-chunk-size, and +then double the size for each read. When --vfs-read-chunk-size-limit is +specified, and greater than --vfs-read-chunk-size, the chunk size for +each open file will get doubled only until the specified value is +reached. If the value is "off", which is the default, the limit is +disabled and the chunk size will grow indefinitely. + +With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the +following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, +300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, +the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, +1200M-1700M and so on. + +Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading. + +VFS Performance + +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the chunked reading feature. + +In particular S3 and Swift benefit hugely from the --no-modtime flag (or +use --use-server-modtime for a slightly different effect) as each read +of the modification time takes a transaction. + + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. + +Sometimes rclone is delivered reads or writes out of order. Rather than +seeking rclone will wait a short time for the in sequence read or write +to come in. These flags only come into effect when not using an on disk +cache file. + + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) + +When using VFS write caching (--vfs-cache-mode with value writes or +full), the global flag --transfers can be set to adjust the number of +parallel uploads of modified files from the cache (the related global +flag --checkers has no effect on the VFS). + + --transfers int Number of file transfers to run in parallel (default 4) + +VFS Case Sensitivity + +Linux file systems are case-sensitive: two files can differ only by +case, and the exact case must be used when opening a file. + +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case +used to create the file is preserved and available for programs to +query. It is not allowed for two files in the same directory to differ +only by case. + +Usually file systems on macOS are case-insensitive. It is possible to +make macOS file systems case-sensitive but that is not the default. + +The --vfs-case-insensitive VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the +remote as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. + +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers to an +existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the +same name is not found but a name differing only by case exists, rclone +will transparently fixup the name. This fixup happens only when an +existing file is requested. Case sensitivity of file names created anew +by rclone is controlled by the underlying remote. + +Note that case sensitivity of the operating system running rclone (the +target) may differ from case sensitivity of a file system presented by +rclone (the source). The flag controls whether "fixup" is performed to +satisfy the target. + +If the flag is not provided on the command line, then its default value +depends on the operating system where rclone runs: "true" on Windows and +macOS, "false" otherwise. If the flag is provided without a value, then +it is "true". + +VFS Disk Options + +This flag allows you to manually set the statistics about the filing +system. It can be useful when those statistics cannot be read correctly +automatically. + + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) + +Alternate report of used bytes + +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running df on the +filesystem, then pass the flag --vfs-used-is-size to rclone. With this +flag set, instead of relying on the backend to report this information, +rclone will scan the whole remote similar to rclone size and compute the +total used space itself. + +WARNING. Contrary to rclone size, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots +of API calls resulting in extra charges. Use it as a last resort and +only with caching. + +Auth Proxy + +If you supply the parameter --auth-proxy /path/to/program then rclone +will use that program to generate backends on the fly which then are +used to authenticate incoming requests. This uses a simple JSON based +protocol with input on STDIN and output on STDOUT. + +PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, +if --auth-proxy is set the authorized keys option will be ignored. + +There is an example program bin/test_proxy.py in the rclone source code. + +The program's job is to take a user and pass on the input and turn those +into the config for a backend on STDOUT in JSON format. This config will +have any default parameters for the backend added, but it won't use +configuration from environment variables or command line options - it is the job of the proxy program to make a complete config. This config generated must have this extra parameter - _root - root to @@ -7308,8 +9865,9 @@ Options --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -7319,10 +9877,38 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -7475,6 +10061,27 @@ be used within the template to server pages: -- .ModTime The UTC timestamp of an entry. ----------------------------------------------------------------------- +The server also makes the following functions available so that they can +be used within the template. These functions help extend the options for +dynamic rendering of HTML. They can be used to render HTML based on +specific conditions. + + ----------------------------------------------------------------------- + Function Description + ----------------------------------- ----------------------------------- + afterEpoch Returns the time since the epoch + for the given time. + + contains Checks whether a given substring is + present or not in a given string. + + hasPrefix Checks whether the given string + begins with the specified prefix. + + hasSuffix Checks whether the given string end + with the specified suffix. + ----------------------------------------------------------------------- + Authentication By default this will serve files without needing a login. @@ -7482,6 +10089,11 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags. +If no static users are configured by either of the above methods, and +client certificates are required by the --client-ca flag passed to the +server, the client certificate common name will be considered as the +username. + Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -7496,9 +10108,8 @@ The password file can be updated while rclone is running. Use --realm to set the authentication realm. -Use --salt to change the password hashing salt from the default. - -VFS - Virtual File System +Use --salt to change the password hashing salt from the default. ## VFS +- Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -7571,12 +10182,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -7592,10 +10204,21 @@ and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using --vfs-cache-max-size note that the cache may exceed this size -for two reasons. Firstly because it is only checked every ---vfs-cache-poll-interval. Secondly because open files cannot be evicted -from the cache. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. + +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This @@ -7893,6 +10516,7 @@ that rclone supports. Options --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --auth-proxy string A program to use to create the backend from the auth --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) @@ -7922,8 +10546,9 @@ Options --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -7933,10 +10558,38 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + See the global flags page for global options not listed here. SEE ALSO @@ -7992,7 +10645,7 @@ Synopsis Rclone test is used to run test commands. -Select which test comand you want with the subcommand, eg +Select which test command you want with the subcommand, eg rclone test memory remote: @@ -8080,6 +10733,7 @@ NB this can create undeletable files and other hazards - use with care Options --all Run all tests + --check-base32768 Check can store all possible base32768 characters --check-control Check control characters --check-length Check max filename length --check-normalization Check UTF-8 Normalization @@ -8197,6 +10851,48 @@ Options -R, --recursive Recursively touch all files -t, --timestamp string Use specified time instead of the current time of day +Important Options + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -8259,6 +10955,40 @@ Options -U, --unsorted Leave files unsorted --version Sort files alphanumerically by version +Filter Options + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing Options + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + See the global flags page for global options not listed here. SEE ALSO @@ -8471,6 +11201,11 @@ them. This is mostly a problem on Windows, where the console traditionally uses a non-Unicode character set - defined by the so-called "code page". +Do not use single character names on Windows as it creates ambiguity +with Windows drives' names, e.g.: remote called C is indistinguishable +from C drive. Rclone will always assume that single letter name refers +to a drive. + Quoting and the shell When you are typing commands to your computer you are using something @@ -8581,6 +11316,10 @@ Note that arbitrary metadata may be added to objects using the --metadata-set key=value flag when the object is first uploaded. This flag can be repeated as many times as necessary. +The --metadata-mapper flag can be used to pass the name of a program in +which can transform metadata when it is being copied from source to +destination. + Types of metadata Metadata is divided into two type. System metadata and User metadata. @@ -8673,6 +11412,9 @@ backend may implement. btime Time of file creation 2006-01-02T15:04:05.999999999Z07:00 (birth): RFC 3339 + utime Time of file upload: 2006-01-02T15:04:05.999999999Z07:00 + RFC 3339 + cache-control Cache-Control header no-cache content-disposition Content-Disposition inline @@ -8775,6 +11517,9 @@ address (1.2.3.4), an IPv6 address (1234::789A) or host name. If the host name doesn't resolve or resolves to more than one IP address it will give an error. +You can use --bind 0.0.0.0 to force rclone to use IPv4 addresses and +--bind ::0 to force rclone to use IPv6 addresses. + --bwlimit=BANDWIDTH_SPEC This option controls the bandwidth limit. For example @@ -8974,7 +11719,7 @@ are incorrect as it would normally. --color WHEN -Specifiy when colors (and other ANSI codes) should be added to the +Specify when colors (and other ANSI codes) should be added to the output. AUTO (default) only allows ANSI codes when the output is a terminal @@ -9084,6 +11829,22 @@ You may also choose to encrypt the file. When token-based authentication are used, the configuration file must be writable, because rclone needs to update the tokens inside it. +To reduce risk of corrupting an existing configuration file, rclone will +not write directly to it when saving changes. Instead it will first +write to a new, temporary, file. If a configuration file already +existed, it will (on Unix systems) try to mirror its permissions to the +new file. Then it will rename the existing file to a temporary name as +backup. Next, rclone will rename the new file to the correct name, +before finally cleaning up by deleting the backup file. + +If the configuration file path used by rclone is a symbolic link, then +this will be evaluated and rclone will write to the resolved path, +instead of overwriting the symbolic link. Temporary files used in the +process (described above) will be written to the same parent directory +as that of the resolved configuration file, but if this directory is +also a symbolic link it will not be resolved and the temporary files +will be written to the location of the directory symbolic link. + --contimeout=TIME Set the connection timeout. This should be in go time format which looks @@ -9113,6 +11874,18 @@ oldest, rename. The default is interactive. See the dedupe command for more information as to what these options mean. +--default-time TIME + +If a file or directory does have a modification time rclone can read +then rclone will display this fixed time instead. + +The default is 2000-01-01 00:00:00 UTC. This can be configured in any of +the ways shown in the time or duration options. + +For example --default-time 2020-06-01 to set the default time to the 1st +of June 2020 or --default-time 0s to set the default time to the time +rclone started up. + --disable FEATURE,FEATURE,... This disables a comma separated list of optional features. For example @@ -9126,9 +11899,23 @@ To see a list of which features can be disabled use: --disable help +The features a remote has can be seen in JSON format with: + + rclone backend features remote: + See the overview features and optional features to get an idea of which feature does what. +Note that some features can be set to true if they are true/false +feature flag features by prefixing them with !. For example the +CaseInsensitive feature can be forced to false with +--disable CaseInsensitive and forced to true with +--disable '!CaseInsensitive'. In general it isn't a good idea doing this +but it may be useful in extremis. + +(Note that ! is a shell command which you will need to escape with +single quotes or a backslash on unix like platforms.) + This flag can be useful for debugging and in exceptional circumstances (e.g. Google Drive limiting the total volume of Server Side Copies to 100 GiB/day). @@ -9348,6 +12135,49 @@ This can be useful as an additional layer of protection for immutable or append-only data sets (notably backup archives), where modification implies corruption and should not be propagated. +--inplace + +The --inplace flag changes the behaviour of rclone when uploading files +to some backends (backends with the PartialUploads feature flag set) +such as: + +- local +- ftp +- sftp + +Without --inplace (the default) rclone will first upload to a temporary +file with an extension like this, where XXXXXX represents a random +string and .partial is --partial-suffix value (.partial by default). + + original-file-name.XXXXXX.partial + +(rclone will make sure the final name is no longer than 100 characters +by truncating the original-file-name part if necessary). + +When the upload is complete, rclone will rename the .partial file to the +correct name, overwriting any existing file at that point. If the upload +fails then the .partial file will be deleted. + +This prevents other users of the backend from seeing partially uploaded +files in their new names and prevents overwriting the old file until the +new one is completely uploaded. + +If the --inplace flag is supplied, rclone will upload directly to the +final name without creating a .partial file. + +This means that an incomplete file will be visible in the directory +listings while the upload is in progress and any existing files will be +overwritten as soon as the upload starts. If the transfer fails then the +file will be deleted. This can cause data loss of the existing file if +the transfer fails. + +Note that on the local file system if you don't use --inplace hard links +(Unix only) will be broken. And if you do use --inplace you won't be +able to update in use executables. + +Note also that versions of rclone prior to v1.63.0 behave as if the +--inplace flag is always supplied. + -i, --interactive This flag can be used to tell rclone that you wish a manual confirmation @@ -9497,48 +12327,154 @@ happen. --max-duration=TIME -Rclone will stop scheduling new transfers when it has run for the -duration specified. - -Defaults to off. +Rclone will stop transferring when it has run for the duration +specified. Defaults to off. -When the limit is reached any existing transfers will complete. +When the limit is reached all transfers will stop immediately. Use +--cutoff-mode to modify this behaviour. -Rclone won't exit with an error if the transfer limit is reached. +Rclone will exit with exit code 10 if the duration limit is reached. --max-transfer=SIZE Rclone will stop transferring when it has reached the size specified. Defaults to off. -When the limit is reached all transfers will stop immediately. +When the limit is reached all transfers will stop immediately. Use +--cutoff-mode to modify this behaviour. Rclone will exit with exit code 8 if the transfer limit is reached. +--cutoff-mode=hard|soft|cautious + +This modifies the behavior of --max-transfer and --max-duration Defaults +to --cutoff-mode=hard. + +Specifying --cutoff-mode=hard will stop transferring immediately when +Rclone reaches the limit. + +Specifying --cutoff-mode=soft will stop starting new transfers when +Rclone reaches the limit. + +Specifying --cutoff-mode=cautious will try to prevent Rclone from +reaching the limit. Only applicable for --max-transfer + -M, --metadata Setting this flag enables rclone to copy the metadata from the source to the destination. For local backends this is ownership, permissions, -xattr etc. See the #metadata for more info. +xattr etc. See the metadata section for more info. + +--metadata-mapper SpaceSepList + +If you supply the parameter --metadata-mapper /path/to/program then +rclone will use that program to map metadata from source object to +destination object. + +The argument to this flag should be a command with an optional space +separated list of arguments. If one of the arguments has a space in then +enclose it in ", if you want a literal " in an argument then enclose the +argument in " and double the ". See CSV encoding for more info. + + --metadata-mapper "python bin/test_metadata_mapper.py" + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"' + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"' + +This uses a simple JSON based protocol with input on STDIN and output on +STDOUT. This will be called for every file and directory copied and may +be called concurrently. + +The program's job is to take a metadata blob on the input and turn it +into a metadata blob on the output suitable for the destination backend. + +Input to the program (via STDIN) might look like this. This provides +some context for the Metadata which may be important. + +- SrcFs is the config string for the remote that the object is + currently on. +- SrcFsType is the name of the source backend. +- DstFs is the config string for the remote that the object is being + copied to +- DstFsType is the name of the destination backend. +- Remote is the path of the file relative to the root. +- Size, MimeType, ModTime are attributes of the file. +- IsDir is true if this is a directory (not yet implemented). +- ID is the source ID of the file if known. +- Metadata is the backend specific metadata as described in the + backend docs. ---metadata-set key=value + { + "SrcFs": "gdrive:", + "SrcFsType": "drive", + "DstFs": "newdrive:user", + "DstFsType": "onedrive", + "Remote": "test.txt", + "Size": 6, + "MimeType": "text/plain; charset=utf-8", + "ModTime": "2022-10-11T17:53:10.286745272+01:00", + "IsDir": false, + "ID": "xyz", + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain1.com", + "permissions": "...", + "description": "my nice file", + "starred": "false" + } + } -Add metadata key = value when uploading. This can be repeated as many -times as required. See the #metadata for more info. +The program should then modify the input as desired and send it to +STDOUT. The returned Metadata field will be used in its entirety for the +destination object. Any other fields will be ignored. Note in this +example we translate user names and permissions and add something to the +description: ---cutoff-mode=hard|soft|cautious + { + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain2.com", + "permissions": "...", + "description": "my nice file [migrated from domain1]", + "starred": "false" + } + } -This modifies the behavior of --max-transfer Defaults to ---cutoff-mode=hard. +Metadata can be removed here too. -Specifying --cutoff-mode=hard will stop transferring immediately when -Rclone reaches the limit. +An example python program might look something like this to implement +the above transformations. -Specifying --cutoff-mode=soft will stop starting new transfers when -Rclone reaches the limit. + import sys, json -Specifying --cutoff-mode=cautious will try to prevent Rclone from -reaching the limit. + i = json.load(sys.stdin) + metadata = i["Metadata"] + # Add tag to description + if "description" in metadata: + metadata["description"] += " [migrated from domain1]" + else: + metadata["description"] = "[migrated from domain1]" + # Modify owner + if "owner" in metadata: + metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com") + o = { "Metadata": metadata } + json.dump(o, sys.stdout, indent="\t") + +You can find this example (slightly expanded) in the rclone source code +at bin/test_metadata_mapper.py. + +If you want to see the input to the metadata mapper and the output +returned from it in the log you can use -vv --dump mapper. + +See the metadata section for more info. + +--metadata-set key=value + +Add metadata key = value when uploading. This can be repeated as many +times as required. See the metadata section for more info. --modify-window=TIME @@ -9552,55 +12488,80 @@ reading and writing to an OS X filing system this will be 1s by default. This command line flag allows you to override that computed default. +--multi-thread-write-buffer-size=SIZE + +When transferring with multiple threads, rclone will buffer SIZE bytes +in memory before writing to disk for each thread. + +This can improve performance if the underlying filesystem does not deal +well with a lot of small writes in different positions of the file, so +if you see transfers being limited by disk write speed, you might want +to experiment with different values. Specially for magnetic drives and +remote file systems a higher value can be useful. + +Nevertheless, the default of 128k should be fine for almost all use +cases, so before changing it ensure that network is not really your +bottleneck. + +As a final hint, size is not the only factor: block size (or similar +concept) can have an impact. In one case, we observed that exact +multiples of 16k performed much better than other values. + +--multi-thread-chunk-size=SizeSuffix + +Normally the chunk size for multi thread transfers is set by the +backend. However some backends such as local and smb (which implement +OpenWriterAt but not OpenChunkWriter) don't have a natural chunk size. + +In this case the value of this option is used (default 64Mi). + --multi-thread-cutoff=SIZE -When downloading files to the local backend above this size, rclone will -use multiple threads to download the file (default 250M). +When transferring files above SIZE to capable backends, rclone will use +multiple threads to transfer the file (default 256M). -Rclone preallocates the file (using fallocate(FALLOC_FL_KEEP_SIZE) on -unix or NTSetInformationFile on Windows both of which takes no time) -then each thread writes directly into the file at the correct place. -This means that rclone won't create fragmented or sparse files and there -won't be any assembly time at the end of the transfer. +Capable backends are marked in the overview as MultithreadUpload. (They +need to implement either the OpenWriterAt or OpenChunkedWriter internal +interfaces). These include include, local, s3, azureblob, b2, +oracleobjectstorage and smb at the time of writing. -The number of threads used to download is controlled by +On the local disk, rclone preallocates the file (using +fallocate(FALLOC_FL_KEEP_SIZE) on unix or NTSetInformationFile on +Windows both of which takes no time) then each thread writes directly +into the file at the correct place. This means that rclone won't create +fragmented or sparse files and there won't be any assembly time at the +end of the transfer. + +The number of threads used to transfer is controlled by --multi-thread-streams. Use -vv if you wish to see info about the threads. This will work with the sync/copy/move commands and friends -copyto/moveto. Multi thread downloads will be used with rclone mount and +copyto/moveto. Multi thread transfers will be used with rclone mount and rclone serve if --vfs-cache-mode is set to writes or above. -NB that this only works for a local destination but will work with any -source. +NB that this only works with supported backends as the destination but +will work with any backend as the source. -NB that multi thread copies are disabled for local to local copies as +NB that multi-thread copies are disabled for local to local copies as they are faster without unless --multi-thread-streams is set explicitly. -NB on Windows using multi-thread downloads will cause the resulting -files to be sparse. Use --local-no-sparse to disable sparse files (which -may cause long delays at the start of downloads) or disable multi-thread -downloads with --multi-thread-streams 0 +NB on Windows using multi-thread transfers to the local disk will cause +the resulting files to be sparse. Use --local-no-sparse to disable +sparse files (which may cause long delays at the start of transfers) or +disable multi-thread transfers with --multi-thread-streams 0 --multi-thread-streams=N -When using multi thread downloads (see above --multi-thread-cutoff) this -sets the maximum number of streams to use. Set to 0 to disable multi -thread downloads (Default 4). - -Exactly how many streams rclone uses for the download depends on the -size of the file. To calculate the number of download streams Rclone -divides the size of the file by the --multi-thread-cutoff and rounds up, -up to the maximum set with --multi-thread-streams. +When using multi thread transfers (see above --multi-thread-cutoff) this +sets the number of streams to use. Set to 0 to disable multi thread +transfers (Default 4). -So if --multi-thread-cutoff 250M and --multi-thread-streams 4 are in -effect (the defaults): - -- 0..250 MiB files will be downloaded with 1 stream -- 250..500 MiB files will be downloaded with 2 streams -- 500..750 MiB files will be downloaded with 3 streams -- 750+ MiB files will be downloaded with 4 streams +If the backend has a --backend-upload-concurrency setting (eg +--s3-upload-concurrency) then this setting will be used as the number of +transfers instead if it is larger than the value of +--multi-thread-streams or --multi-thread-streams isn't set. --no-check-dest @@ -9730,6 +12691,15 @@ If you want perfect ordering then you will need to specify --check-first which will find all the files which need transferring first before transferring any. +--partial-suffix + +When --inplace is not used, it causes rclone to use the --partial-suffix +as suffix for temporary files. + +Suffix length limit is 16 characters. + +The default is .partial. + --password-command SpaceSepList This flag supplies a program which should supply the config password @@ -9743,9 +12713,9 @@ and double the ". See CSV encoding for more info. Eg - --password-command echo hello - --password-command echo "hello with space" - --password-command echo "hello with ""quotes"" and space" + --password-command "echo hello" + --password-command 'echo "hello with space"' + --password-command 'echo "hello with ""quotes"" and space"' See the Configuration Encryption for more info. @@ -9949,6 +12919,12 @@ would be backed up to file.txt-2019-01-01 and with the flag it would be backed up to file-2019-01-01.txt. This can be helpful to make sure the suffixed files can still be opened. +If a file has two (or more) extensions and the second (or subsequent) +extension is recognised as a valid mime type, then the suffix will go +before that extension. So file.tar.gz would be backed up to +file-2019-01-01.tar.gz whereas file.badextension.gz would be backed up +to file.badextension-2019-01-01.gz. + --syslog On capable OSes (not Windows or Plan9) send all log output to syslog. @@ -10104,35 +13080,55 @@ not deleting files as there were IO errors. --fast-list When doing anything which involves a directory listing (e.g. sync, copy, -ls - in fact nearly every command), rclone normally lists a directory -and processes it before using more directory lists to process any -subdirectories. This can be parallelised and works very quickly using -the least amount of memory. - -However, some remotes have a way of listing all files beneath a -directory in one (or a small number) of transactions. These tend to be -the bucket-based remotes (e.g. S3, B2, GCS, Swift). - -If you use the --fast-list flag then rclone will use this method for -listing directories. This will have the following consequences for the -listing: - -- It will use fewer transactions (important if you pay for them) -- It will use more memory. Rclone has to load the whole listing into - memory. -- It may be faster because it uses fewer transactions -- It may be slower because it can't be parallelized - -rclone should always give identical results with and without ---fast-list. - -If you pay for transactions and can fit your entire sync listing into -memory then --fast-list is recommended. If you have a very big sync to -do then don't use --fast-list otherwise you will run out of memory. - -If you use --fast-list on a remote which doesn't support it, then rclone +ls - in fact nearly every command), rclone has different strategies to +choose from. + +The basic strategy is to list one directory and processes it before +using more directory lists to process any subdirectories. This is a +mandatory backend feature, called List, which means it is supported by +all backends. This strategy uses small amount of memory, and because it +can be parallelised it is fast for operations involving processing of +the list results. + +Some backends provide the support for an alternative strategy, where all +files beneath a directory can be listed in one (or a small number) of +transactions. Rclone supports this alternative strategy through an +optional backend feature called ListR. You can see in the storage system +overview documentation's optional features section which backends it is +enabled for (these tend to be the bucket-based ones, e.g. S3, B2, GCS, +Swift). This strategy requires fewer transactions for highly recursive +operations, which is important on backends where this is charged or +heavily rate limited. It may be faster (due to fewer transactions) or +slower (because it can't be parallelized) depending on different +parameters, and may require more memory if rclone has to keep the whole +listing in memory. + +Which listing strategy rclone picks for a given operation is +complicated, but in general it tries to choose the best possible. It +will prefer ListR in situations where it doesn't need to store the +listed files in memory, e.g. for unlimited recursive ls command +variants. In other situations it will prefer List, e.g. for sync and +copy, where it needs to keep the listed files in memory, and is +performing operations on them where parallelization may be a huge +advantage. + +Rclone is not able to take all relevant parameters into account for +deciding the best strategy, and therefore allows you to influence the +choice in two ways: You can stop rclone from using ListR by disabling +the feature, using the --disable option (--disable ListR), or you can +allow rclone to use ListR where it would normally choose not to do so +due to higher memory usage, using the --fast-list option. Rclone should +always produce identical results either way. Using --disable ListR or +--fast-list on a remote which doesn't support ListR does nothing, rclone will just ignore it. +A rule of thumb is that if you pay for transactions and can fit your +entire sync listing into memory, then --fast-list is recommended. If you +have a very big sync to do, then don't use --fast-list, otherwise you +will run out of memory. Run some tests and compare before you decide, +and if in doubt then just leave the default, let rclone decide, i.e. not +use --fast-list. + --timeout=TIME This sets the IO idle timeout. If a transfer has started but then @@ -10454,6 +13450,12 @@ to standard output. This dumps a list of the open files at the end of the command. It uses the lsof command to do that so you'll need that installed to use it. +--dump mapper + +This shows the JSON blobs being sent to the program supplied with +--metadata-mapper and received from it. It can be useful for debugging +the metadata mapper interface. + --memprofile=FILE Write memory profile to file. This can be analysed with go tool pprof. @@ -10559,6 +13561,7 @@ List of exit codes suspended) (Fatal errors) - 8 - Transfer exceeded - limit set by --max-transfer reached - 9 - Operation successful, but no files transferred +- 10 - Duration exceeded - limit set by --max-duration reached Environment Variables @@ -10597,7 +13600,9 @@ for each backend. To find the name of the environment variable, you need to set, take RCLONE_CONFIG_ + name of remote + _ + name of config file option and -make it all uppercase. +make it all uppercase. Note one implication here is the remote's name +must be convertible into a valid environment variable name, so it can +only contain letters, digits, or the _ (underscore) character. For example, to configure an S3 remote named mys3: without a config file (using unix ways of setting environment variables): @@ -10811,8 +13816,8 @@ E.g. rclone copy "remote:dir*.jpg" /path/to/dir does not have a filter effect. rclone copy remote:dir /path/to/dir --include "*.jpg" does. Important Avoid mixing any two of --include..., --exclude... or ---filter... flags in an rclone command. The results may not be what you -expect. Instead use a --filter... flag. +--filter... flags in an rclone command. The results might not be what +you expect. Instead use a --filter... flag. Patterns for matching path/file names @@ -10871,7 +13876,7 @@ beginning of the path/file. - doesn't match "afile.jpg" - doesn't match "directory/file.jpg" -The top level of the remote may not be the top level of the drive. +The top level of the remote might not be the top level of the drive. E.g. for a Microsoft Windows local directory structure @@ -10950,7 +13955,7 @@ Which will match a directory called start with a file called end.jpg in it as the .* will match / characters. Note that you can use -vv --dump filters to show the filter patterns in -regexp format - rclone implements the glob patters by transforming them +regexp format - rclone implements the glob patterns by transforming them into regular expressions. Filter pattern examples @@ -11151,7 +14156,7 @@ all files on remote: excluding those in root directory dir and sub directories. E.g. on Microsoft Windows rclone ls remote: --exclude "*\[{JP,KR,HK}\]*" -lists the files in remote: with [JP] or [KR] or [HK] in their name. +lists the files in remote: without [JP] or [KR] or [HK] in their name. Quotes prevent the shell from interpreting the \ characters.\ characters escape the [ and ] so an rclone filter treats them literally rather than as a character-range. The { and } define an rclone pattern list. For @@ -11983,7 +14988,7 @@ you would pass this parameter in your JSON blob. If using rclone rc this could be passed as - rclone rc operations/sync ... _config='{"CheckSum": true}' + rclone rc sync/sync ... _config='{"CheckSum": true}' Any config parameters you don't set will inherit the global defaults which were set with command line flags or environment variables. @@ -12249,7 +15254,7 @@ See the config dump command for more information on the above. Authentication is required for this call. -config/listremotes: Lists the remotes in the config file. +config/listremotes: Lists the remotes in the config file and defined in environment variables. Returns - remotes - array of remote names @@ -12392,6 +15397,26 @@ Returns: Authentication is required for this call. +core/du: Returns disk usage of a locally attached disk. + +This returns the disk usage for the local directory passed in as dir. + +If the directory is not passed in, it defaults to the directory pointed +to by --cache-dir. + +- dir - string (optional) + +Returns: + + { + "dir": "/", + "info": { + "Available": 361769115648, + "Free": 361785892864, + "Total": 982141468672 + } + } + core/gc: Runs a garbage collection. This tells the go runtime to do a garbage collection run. It isn't @@ -12469,6 +15494,10 @@ Returns the following values: "lastError": last error string, "renames" : number of files renamed, "retryError": boolean showing whether there has been at least one non-NoRetryError, + "serverSideCopies": number of server side copies done, + "serverSideCopyBytes": number bytes server side copied, + "serverSideMoves": number of server side moves done, + "serverSideMoveBytes": number bytes server side moved, "speed": average speed in bytes per second since start of the group, "totalBytes": total number of bytes in the group, "totalChecks": total number of checks in the group, @@ -12680,7 +15709,8 @@ Parameters: None. Results: -- jobids - array of integer job ids. +- executeId - string id of rclone executing (change after restart) +- jobids - array of integer job ids (starting at 1 on each restart) job/status: Reads the status of the job ID @@ -12820,6 +15850,66 @@ See the about command for more information on the above. Authentication is required for this call. +operations/check: check the source and destination are the same + +Checks the files in the source and destination match. It compares sizes +and hashes and logs a report of files that don't match. It doesn't alter +the source or destination. + +This takes the following parameters: + +- srcFs - a remote name string e.g. "drive:" for the source, "/" for + local filesystem +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" + for local filesystem +- download - check by downloading rather than with hash +- checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with + hashes of given type +- checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with + hashes of given type +- checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file + with hashes of given type +- oneWay - check one way only, source files must exist on remote +- combined - make a combined report of changes (default false) +- missingOnSrc - report all files missing from the source (default + true) +- missingOnDst - report all files missing from the destination + (default true) +- match - report all matching files (default false) +- differ - report all non-matching files (default true) +- error - report all files with errors (hashing or reading) (default + true) + +If you supply the download flag, it will download the data from both +remotes and check them against each other on the fly. This can be useful +for remotes that don't support hashes or if you really want to check all +the data. + +If you supply the size-only global flag, it will only compare the sizes +not the hashes as well. Use this for a quick check. + +If you supply the checkFileHash option with a valid hash name, the +checkFileFs:checkFileRemote must point to a text file in the SUM format. +This treats the checksum file as the source and dstFs as the +destination. Note that srcFs is not used and should not be supplied in +this case. + +Returns: + +- success - true if no error, false otherwise +- status - textual summary of check, OK or text string +- hashType - hash used in check, may be missing +- combined - array of strings of combined report of changes +- missingOnSrc - array of strings of all files missing from the source +- missingOnDst - array of strings of all files missing from the + destination +- match - array of strings of all matching files +- differ - array of strings of all non-matching files +- error - array of strings of all files with errors (hashing or + reading) + +Authentication is required for this call. + operations/cleanup: Remove trashed files in the remote or path This takes the following parameters: @@ -12834,9 +15924,11 @@ operations/copyfile: Copy a file from source remote to destination remote This takes the following parameters: -- srcFs - a remote name string e.g. "drive:" for the source +- srcFs - a remote name string e.g. "drive:" for the source, "/" for + local filesystem - srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" + for local filesystem - dstRemote - a path within that remote e.g. "file2.txt" for the destination @@ -13033,9 +16125,11 @@ operations/movefile: Move a file from source remote to destination remote This takes the following parameters: -- srcFs - a remote name string e.g. "drive:" for the source +- srcFs - a remote name string e.g. "drive:" for the source, "/" for + local filesystem - srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" + for local filesystem - dstRemote - a path within that remote e.g. "file2.txt" for the destination @@ -13093,6 +16187,27 @@ See the rmdirs command for more information on the above. Authentication is required for this call. +operations/settier: Changes storage tier or class on all files in the path + +This takes the following parameters: + +- fs - a remote name string e.g. "drive:" + +See the settier command for more information on the above. + +Authentication is required for this call. + +operations/settierfile: Changes storage tier or class on the single file pointed to + +This takes the following parameters: + +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" + +See the settierfile command for more information on the above. + +Authentication is required for this call. + operations/size: Count the number of bytes and files in remote This takes the following parameters: @@ -13336,12 +16451,17 @@ This takes the following parameters - checkFilename - file name for checkAccess (default: RCLONE_TEST) - maxDelete - abort sync if percentage of deleted files is above this threshold (default: 50) -- force - maxDelete safety check and run the sync +- force - Bypass maxDelete safety check and run the sync - checkSync - true by default, false disables comparison of final listings, only will skip sync, only compare listings from the last run +- createEmptySrcDirs - Sync creation and deletion of empty + directories. (Not compatible with --remove-empty-dirs) - removeEmptyDirs - remove empty directories at the final cleanup step - filtersFile - read filtering patterns from a file +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious + errors, instead of requiring resync. Use at your own risk! - workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync) - noCleanup - retain working files @@ -13705,52 +16825,55 @@ Features Here is an overview of the major features of each cloud storage system. - Name Hash ModTime Case Insensitive Duplicate Files MIME Type Metadata - ------------------------------ ------------------ --------- ------------------ ----------------- ----------- ---------- - 1Fichier Whirlpool - No Yes R - - Akamai Netstorage MD5, SHA256 R/W No No R - - Amazon Drive MD5 - Yes No R - - Amazon S3 (or S3 compatible) MD5 R/W No No R/W RWU - Backblaze B2 SHA1 R/W No No R/W - - Box SHA1 R/W Yes No - - - Citrix ShareFile MD5 R/W Yes No - - - Dropbox DBHASH ¹ R Yes No - - - Enterprise File Fabric - R/W Yes No R/W - - FTP - R/W ¹⁰ No No - - - Google Cloud Storage MD5 R/W No No R/W - - Google Drive MD5 R/W No Yes R/W - - Google Photos - - No Yes R - - HDFS - R/W No No - - - HiDrive HiDrive ¹² R/W No No - - - HTTP - R No No R - - Internet Archive MD5, SHA1, CRC32 R/W ¹¹ No No - RWU - Jottacloud MD5 R/W Yes No R - - Koofr MD5 - Yes No - - - Mail.ru Cloud Mailru ⁶ R/W Yes No - - - Mega - - No Yes - - - Memory MD5 R/W No No - - - Microsoft Azure Blob Storage MD5 R/W No No R/W - - Microsoft OneDrive QuickXorHash ⁵ R/W Yes No R - - OpenDrive MD5 R/W Yes Partial ⁸ - - - OpenStack Swift MD5 R/W No No R/W - - Oracle Object Storage MD5 R/W No No R/W - - pCloud MD5, SHA1 ⁷ R No No W - - premiumize.me - - Yes No R - - put.io CRC-32 R/W No Yes R - - QingStor MD5 - ⁹ No No R/W - - Seafile - - No No - - - SFTP MD5, SHA1 ² R/W Depends No - - - Sia - - No No - - - SMB - - Yes No - - - SugarSync - - No No - - - Storj - R No No - - - Uptobox - - No Yes - - - WebDAV MD5, SHA1 ³ R ⁴ Depends No - - - Yandex Disk MD5 R/W No No R - - Zoho WorkDrive - - No No - - - The local filesystem All R/W Depends No - RWU - -Notes + Name Hash ModTime Case Insensitive Duplicate Files MIME Type Metadata + ------------------------------- ------------------- --------- ------------------ ----------------- ----------- ---------- + 1Fichier Whirlpool - No Yes R - + Akamai Netstorage MD5, SHA256 R/W No No R - + Amazon Drive MD5 - Yes No R - + Amazon S3 (or S3 compatible) MD5 R/W No No R/W RWU + Backblaze B2 SHA1 R/W No No R/W - + Box SHA1 R/W Yes No - - + Citrix ShareFile MD5 R/W Yes No - - + Dropbox DBHASH ¹ R Yes No - - + Enterprise File Fabric - R/W Yes No R/W - + FTP - R/W ¹⁰ No No - - + Google Cloud Storage MD5 R/W No No R/W - + Google Drive MD5, SHA1, SHA256 R/W No Yes R/W - + Google Photos - - No Yes R - + HDFS - R/W No No - - + HiDrive HiDrive ¹² R/W No No - - + HTTP - R No No R - + Internet Archive MD5, SHA1, CRC32 R/W ¹¹ No No - RWU + Jottacloud MD5 R/W Yes No R RW + Koofr MD5 - Yes No - - + Linkbox - R No No - - + Mail.ru Cloud Mailru ⁶ R/W Yes No - - + Mega - - No Yes - - + Memory MD5 R/W No No - - + Microsoft Azure Blob Storage MD5 R/W No No R/W - + Microsoft Azure Files Storage MD5 R/W Yes No R/W - + Microsoft OneDrive QuickXorHash ⁵ R/W Yes No R - + OpenDrive MD5 R/W Yes Partial ⁸ - - + OpenStack Swift MD5 R/W No No R/W - + Oracle Object Storage MD5 R/W No No R/W - + pCloud MD5, SHA1 ⁷ R No No W - + PikPak MD5 R No No R - + premiumize.me - - Yes No R - + put.io CRC-32 R/W No Yes R - + Proton Drive SHA1 R/W No No R - + QingStor MD5 - ⁹ No No R/W - + Quatrix by Maytech - R/W No No - - + Seafile - - No No - - + SFTP MD5, SHA1 ² R/W Depends No - - + Sia - - No No - - + SMB - R/W Yes No - - + SugarSync - - No No - - + Storj - R No No - - + Uptobox - - No Yes - - + WebDAV MD5, SHA1 ³ R ⁴ Depends No - - + Yandex Disk MD5 R/W No No R - + Zoho WorkDrive - - No No - - + The local filesystem All R/W Depends No - RWU ¹ Dropbox supports its own custom hash. This is an SHA256 sum of all the 4 MiB block SHA256s. @@ -13758,9 +16881,11 @@ Notes ² SFTP supports checksums if the same login has shell access and md5sum or sha1sum as well as echo are in the remote's PATH. -³ WebDAV supports hashes when used with Owncloud and Nextcloud only. +³ WebDAV supports hashes when used with Fastmail Files, Owncloud and +Nextcloud only. -⁴ WebDAV supports modtimes when used with Owncloud and Nextcloud only. +⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and +Nextcloud only. ⁵ QuickXorHash is Microsoft's own hash. @@ -14186,64 +17311,131 @@ Optional Features All rclone remotes support a base command set. Other features depend upon backend-specific capabilities. - Name Purge Copy Move DirMove CleanUp ListR StreamUpload LinkSharing About EmptyDir - ------------------------------ ------- ------ ------ --------- --------- ------- -------------- ------------- ------- ---------- - 1Fichier No Yes Yes No No No No Yes No Yes - Akamai Netstorage Yes No No No No Yes Yes No No Yes - Amazon Drive Yes No Yes Yes No No No No No Yes - Amazon S3 (or S3 compatible) No Yes No No Yes Yes Yes Yes No No - Backblaze B2 No Yes No No Yes Yes Yes Yes No No - Box Yes Yes Yes Yes Yes ‡‡ No Yes Yes Yes Yes - Citrix ShareFile Yes Yes Yes Yes No No Yes No No Yes - Dropbox Yes Yes Yes Yes No No Yes Yes Yes Yes - Enterprise File Fabric Yes Yes Yes Yes Yes No No No No Yes - FTP No No Yes Yes No No Yes No No Yes - Google Cloud Storage Yes Yes No No No Yes Yes No No No - Google Drive Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes - Google Photos No No No No No No No No No No - HDFS Yes No Yes Yes No No Yes No Yes Yes - HiDrive Yes Yes Yes Yes No No Yes No No Yes - HTTP No No No No No No No No No Yes - Internet Archive No Yes No No Yes Yes No Yes Yes No - Jottacloud Yes Yes Yes Yes Yes Yes No Yes Yes Yes - Koofr Yes Yes Yes Yes No No Yes Yes Yes Yes - Mail.ru Cloud Yes Yes Yes Yes Yes No No Yes Yes Yes - Mega Yes No Yes Yes Yes No No Yes Yes Yes - Memory No Yes No No No Yes Yes No No No - Microsoft Azure Blob Storage Yes Yes No No No Yes Yes No No No - Microsoft OneDrive Yes Yes Yes Yes Yes No No Yes Yes Yes - OpenDrive Yes Yes Yes Yes No No No No No Yes - OpenStack Swift Yes † Yes No No No Yes Yes No Yes No - Oracle Object Storage No Yes No No Yes Yes Yes No No No - pCloud Yes Yes Yes Yes Yes No No Yes Yes Yes - premiumize.me Yes No Yes Yes No No No Yes Yes Yes - put.io Yes No Yes Yes Yes No Yes No Yes Yes - QingStor No Yes No No Yes Yes No No No No - Seafile Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes - SFTP No No Yes Yes No No Yes No Yes Yes - Sia No No No No No No Yes No No Yes - SMB No No Yes Yes No No Yes No No Yes - SugarSync Yes Yes Yes Yes No No Yes Yes No Yes - Storj Yes ☨ Yes Yes No No Yes Yes Yes No No - Uptobox No Yes Yes Yes No No No No No No - WebDAV Yes Yes Yes Yes No No Yes ‡ No Yes Yes - Yandex Disk Yes Yes Yes Yes Yes No Yes Yes Yes Yes - Zoho WorkDrive Yes Yes Yes Yes No No No No Yes Yes - The local filesystem Yes No Yes Yes No No Yes No Yes Yes + ------------------------------------------------------------------------------------------------------------------------------------- + Name Purge Copy Move DirMove CleanUp ListR StreamUpload MultithreadUpload LinkSharing About EmptyDir + --------------- ------- ------ ------ --------- --------- ------- -------------- ------------------- ------------- ------- ---------- + 1Fichier No Yes Yes No No No No No Yes No Yes -Purge + Akamai Yes No No No No Yes Yes No No No Yes + Netstorage -This deletes a directory quicker than just deleting all the files in the -directory. + Amazon Drive Yes No Yes Yes No No No No No No Yes + + Amazon S3 (or No Yes No No Yes Yes Yes Yes Yes No No + S3 compatible) + + Backblaze B2 No Yes No No Yes Yes Yes Yes Yes No No + + Box Yes Yes Yes Yes Yes No Yes No Yes Yes Yes + + Citrix Yes Yes Yes Yes No No No No No No Yes + ShareFile + + Dropbox Yes Yes Yes Yes No No Yes No Yes Yes Yes + + Enterprise File Yes Yes Yes Yes Yes No No No No No Yes + Fabric + + FTP No No Yes Yes No No Yes No No No Yes + + Google Cloud Yes Yes No No No Yes Yes No No No No + Storage + + Google Drive Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes + + Google Photos No No No No No No No No No No No + + HDFS Yes No Yes Yes No No Yes No No Yes Yes + + HiDrive Yes Yes Yes Yes No No Yes No No No Yes + + HTTP No No No No No No No No No No Yes + + Internet No Yes No No Yes Yes No No Yes Yes No + Archive + + Jottacloud Yes Yes Yes Yes Yes Yes No No Yes Yes Yes + + Koofr Yes Yes Yes Yes No No Yes No Yes Yes Yes + + Mail.ru Cloud Yes Yes Yes Yes Yes No No No Yes Yes Yes -† Note Swift implements this in order to delete directory markers but -they don't actually have a quicker way of deleting files other than + Mega Yes No Yes Yes Yes No No No Yes Yes Yes + + Memory No Yes No No No Yes Yes No No No No + + Microsoft Azure Yes Yes No No No Yes Yes Yes No No No + Blob Storage + + Microsoft Azure No Yes Yes Yes No No Yes Yes No Yes Yes + Files Storage + + Microsoft Yes Yes Yes Yes Yes Yes ⁵ No No Yes Yes Yes + OneDrive + + OpenDrive Yes Yes Yes Yes No No No No No No Yes + + OpenStack Swift Yes ¹ Yes No No No Yes Yes No No Yes No + + Oracle Object No Yes No No Yes Yes Yes Yes No No No + Storage + + pCloud Yes Yes Yes Yes Yes No No No Yes Yes Yes + + PikPak Yes Yes Yes Yes Yes No No No Yes Yes Yes + + premiumize.me Yes No Yes Yes No No No No Yes Yes Yes + + put.io Yes No Yes Yes Yes No Yes No No Yes Yes + + Proton Drive Yes No Yes Yes Yes No No No No Yes Yes + + QingStor No Yes No No Yes Yes No No No No No + + Quatrix by Yes Yes Yes Yes No No No No No Yes Yes + Maytech + + Seafile Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes + + SFTP No Yes ⁴ Yes Yes No No Yes No No Yes Yes + + Sia No No No No No No Yes No No No Yes + + SMB No No Yes Yes No No Yes Yes No No Yes + + SugarSync Yes Yes Yes Yes No No Yes No Yes No Yes + + Storj Yes ² Yes Yes No No Yes Yes No Yes No No + + Uptobox No Yes Yes Yes No No No No No No No + + WebDAV Yes Yes Yes Yes No No Yes ³ No No Yes Yes + + Yandex Disk Yes Yes Yes Yes Yes No Yes No Yes Yes Yes + + Zoho WorkDrive Yes Yes Yes Yes No No No No No Yes Yes + + The local Yes No Yes Yes No No Yes Yes No Yes Yes + filesystem + ------------------------------------------------------------------------------------------------------------------------------------- + +¹ Note Swift implements this in order to delete directory markers but it +doesn't actually have a quicker way of deleting files other than deleting them individually. -☨ Storj implements this efficiently only for entire buckets. If purging +² Storj implements this efficiently only for entire buckets. If purging a directory inside a bucket, files are deleted individually. -‡ StreamUpload is not supported with Nextcloud +³ StreamUpload is not supported with Nextcloud + +⁴ Use the --sftp-copy-is-hardlink flag to enable. + +⁵ Use the --onedrive-delta flag to enable. + +Purge + +This deletes a directory quicker than just deleting all the files in the +directory. Copy @@ -14292,6 +17484,12 @@ Some remotes allow files to be uploaded without knowing the file size in advance. This allows certain operations to work without spooling the file to local disk first, e.g. rclone rcat. +MultithreadUpload + +Some remotes allow transfers to the remote to be sent as chunks in +parallel. If this is supported then rclone will use multi-thread copying +to transfer files much faster. + LinkSharing Sets the necessary permissions on a file or folder and prints a link @@ -14319,726 +17517,918 @@ Object/Bucket-based remotes do not support this. Global Flags This describes the global flags available to every rclone command split -into two groups, non backend and backend flags. - -Non Backend Flags - -These flags are available for every command. - - --ask-password Allow prompt for password for encrypted configuration (default true) - --auto-confirm If enabled, do not request console confirmation - --backup-dir string Make backups into hierarchy based in DIR - --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name - --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) - --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --ca-cert stringArray CA certificate used to verify servers - --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") - --check-first Do all the checks before starting transfers - --checkers int Number of checkers to run in parallel (default 8) - -c, --checksum Skip based on checksum (if available) & size, not mod-time & size - --client-cert string Client SSL certificate (PEM) for mutual TLS auth - --client-key string Client SSL private key (PEM) for mutual TLS auth - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") - --compare-dest stringArray Include additional comma separated server-side paths during comparison - --config string Config file (default "$HOME/.config/rclone/rclone.conf") - --contimeout Duration Connect timeout (default 1m0s) - --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cpuprofile string Write cpu profile to file - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") - --delete-after When synchronizing, delete files on destination after transferring (default) - --delete-before When synchronizing, delete files on destination before transferring - --delete-during When synchronizing, delete files during transfer - --delete-excluded Delete files on dest excluded from sync - --disable string Disable a comma separated list of features (use --disable help to see a list) - --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. - --disable-http2 Disable HTTP/2 in the global transport - -n, --dry-run Do a trial run with no permanent changes - --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles - --dump-bodies Dump HTTP headers and bodies - may contain sensitive info - --dump-headers Dump HTTP headers - may contain sensitive info - --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) - --fast-list Use recursive list if available; uses more memory but fewer transactions - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) - --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) - --header stringArray Set HTTP header for all transactions - --header-download stringArray Set HTTP header for download transactions - --header-upload stringArray Set HTTP header for upload transactions - --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi - --ignore-case Ignore case in filters (case insensitive) - --ignore-case-sync Ignore case when synchronizing - --ignore-checksum Skip post copy check of checksums - --ignore-errors Delete even if there are I/O errors - --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum - -I, --ignore-times Don't skip files that match size and time - transfer all files - --immutable Do not modify files, fail if existing files have been modified - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - -i, --interactive Enable interactive mode - --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) - --log-file string Log everything to this file - --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") - --log-systemd Activate systemd integration for the logger - --low-level-retries int Number of low level retries to do (default 10) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) - --max-delete int When synchronizing, limit the number of deletes (default -1) - --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-duration Duration Maximum duration rclone will transfer data for (default 0s) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) - --max-transfer SizeSuffix Maximum size of data to transfer (default off) - --memprofile string Write memory profile to file - -M, --metadata If set, preserve metadata when copying objects - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --metadata-set stringArray Add metadata key=value when uploading - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) - --modify-window Duration Max time diff to be considered the same (default 1ns) - --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 250Mi) - --multi-thread-streams int Max number of streams to use for multi-thread downloads (default 4) - --no-check-certificate Do not verify the server SSL certificate (insecure) - --no-check-dest Don't check the destination, copy regardless - --no-console Hide console window (supported on Windows only) - --no-gzip-encoding Don't set Accept-Encoding: gzip - --no-traverse Don't traverse destination file system on copy - --no-unicode-normalization Don't normalize unicode characters in filenames - --no-update-modtime Don't update destination mod-time if files identical - --order-by string Instructions on how to order the transfers, e.g. 'size,descending' - --password-command SpaceSepList Command for supplying password for encrypted configuration - -P, --progress Show progress during transfer - --progress-terminal-title Show progress on the terminal title (requires -P/--progress) - -q, --quiet Print as little stuff as possible - --rc Enable the remote control server - --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) - --rc-allow-origin string Set the allowed origin for CORS - --rc-baseurl string Prefix for URLs - leave blank for root - --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) - --rc-client-ca string Client certificate authority to verify clients with - --rc-enable-metrics Enable prometheus metrics on /metrics - --rc-files string Path to local files to serve on the HTTP server - --rc-htpasswd string A htpasswd file - if not provided no authentication is done - --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) - --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) - --rc-key string TLS PEM Private key - --rc-max-header-bytes int Maximum size of request header (default 4096) - --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --rc-no-auth Don't require auth for certain methods - --rc-pass string Password for authentication - --rc-realm string Realm for authentication - --rc-salt string Password hashing salt (default "dlPL2MqE") - --rc-serve Enable the serving of remote objects - --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --rc-template string User-specified template - --rc-user string User name for authentication - --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") - --rc-web-gui Launch WebGUI on localhost - --rc-web-gui-force-update Force update to latest version of web gui - --rc-web-gui-no-open-browser Don't open the browser automatically - --rc-web-gui-update Check and update to latest version of web gui - --refresh-times Refresh the modtime of remote files - --retries int Retry operations this many times if they fail (default 3) - --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) - --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum - --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) - --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") - --stats-one-line Make the stats fit on one line - --stats-one-line-date Enable --stats-one-line and add current date/time prefix - --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format - --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") - --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) - --suffix string Suffix to add to changed files - --suffix-keep-extension Preserve the extension when using --suffix - --syslog Use Syslog for logging - --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") - --temp-dir string Directory rclone will use for temporary files (default "/tmp") - --timeout Duration IO idle timeout (default 5m0s) - --tpslimit float Limit HTTP transactions per second to this - --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) - --track-renames When synchronizing, track file renames and do a server-side move if possible - --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") - --transfers int Number of file transfers to run in parallel (default 4) - -u, --update Skip files that are newer on the destination - --use-cookies Enable session cookiejar - --use-json-log Use json log format - --use-mmap Use mmap allocator (see docs) - --use-server-modtime Use server modified time instead of object metadata - --user-agent string Set the user-agent to a specified string (default "rclone/v1.62.0") - -v, --verbose count Print lots more stuff (repeat for more) - -Backend Flags - -These flags are available for every command. They control the backends -and may be set in the config file. - - --acd-auth-url string Auth server URL - --acd-client-id string OAuth Client Id - --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) - --acd-token string OAuth Access Token as a JSON blob - --acd-token-url string Token server url - --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) - --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive - --azureblob-account string Azure Storage Account Name - --azureblob-archive-tier-delete Delete archive tier blobs before overwriting - --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) - --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) - --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key - --azureblob-client-id string The ID of the client in use - --azureblob-client-secret string One of the service principal's client secrets - --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth - --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) - --azureblob-endpoint string Endpoint for the service - --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) - --azureblob-key string Storage Account Shared Key - --azureblob-list-chunk int Size of blob list (default 5000) - --azureblob-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --azureblob-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any - --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any - --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any - --azureblob-no-check-container If set, don't attempt to check the container exists or create it - --azureblob-no-head-object If set, do not do HEAD before GET when getting objects - --azureblob-password string The user's password (obscured) - --azureblob-public-access string Public access level of a container: blob or container - --azureblob-sas-url string SAS URL for container level access only - --azureblob-service-principal-file string Path to file containing credentials for use with a service principal - --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID - --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) - --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) - --azureblob-use-emulator Uses local storage emulator if provided as 'true' - --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) - --azureblob-username string User name (usually an email address) - --b2-account string Account ID or Application Key ID - --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) - --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) - --b2-disable-checksum Disable checksums for large (> upload cutoff) files - --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) - --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --b2-endpoint string Endpoint for the service - --b2-hard-delete Permanently delete files on remote removal, otherwise hide files - --b2-key string Application Key - --b2-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --b2-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --b2-version-at Time Show file versions as they were at the specified time (default off) - --b2-versions Include old versions in directory listings - --box-access-token string Box App Primary Access Token - --box-auth-url string Auth server URL - --box-box-config-file string Box App config.json location - --box-box-sub-type string (default "user") - --box-client-id string OAuth Client Id - --box-client-secret string OAuth Client Secret - --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) - --box-list-chunk int Size of listing chunk 1-1000 (default 1000) - --box-owned-by string Only show items owned by the login (email address) passed in - --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point - --box-token string OAuth Access Token as a JSON blob - --box-token-url string Token server url - --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) - --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) - --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming - --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") - --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) - --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) - --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") - --cache-db-purge Clear all the cached data for this remote on start - --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) - --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) - --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server - --cache-plex-password string The password of the Plex user (obscured) - --cache-plex-url string The URL of the Plex server - --cache-plex-username string The username of the Plex user - --cache-read-retries int How many times to retry a read from a cache storage (default 10) - --cache-remote string Remote to cache - --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) - --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded - --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) - --cache-workers int How many workers should run in parallel to download chunks (default 4) - --cache-writes Cache file data on writes through the FS - --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) - --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks - --chunker-hash-type string Choose how chunker handles hash sums (default "md5") - --chunker-remote string Remote to chunk/unchunk - --combine-upstreams SpaceSepList Upstreams for combining - --compress-level int GZIP compression level (-2 to 9) (default -1) - --compress-mode string Compression mode (default "gzip") - --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) - --compress-remote string Remote to compress - -L, --copy-links Follow symlinks and copy the pointed to item - --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) - --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") - --crypt-filename-encryption string How to encrypt the filenames (default "standard") - --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted - --crypt-password string Password or pass phrase for encryption (obscured) - --crypt-password2 string Password or pass phrase for salt (obscured) - --crypt-remote string Remote to encrypt/decrypt - --crypt-server-side-across-configs Allow server-side operations (e.g. copy) to work across different crypt configs - --crypt-show-mapping For all files listed show how the names encrypt - --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded - --drive-allow-import-name-change Allow the filetype to change when uploading Google docs - --drive-auth-owner-only Only consider files owned by the authenticated user - --drive-auth-url string Auth server URL - --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) - --drive-client-id string Google Application Client Id - --drive-client-secret string OAuth Client Secret - --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut - --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) - --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") - --drive-formats string Deprecated: See export_formats - --drive-impersonate string Impersonate this user when using a service account - --drive-import-formats string Comma separated list of preferred formats for uploading Google docs - --drive-keep-revision-forever Keep new head revision of each file forever - --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) - --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) - --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) - --drive-resource-key string Resource key for accessing a link-shared file - --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive - --drive-server-side-across-configs Allow server-side operations (e.g. copy) to work across different drive configs - --drive-service-account-credentials string Service Account Credentials JSON blob - --drive-service-account-file string Service Account Credentials JSON file path - --drive-shared-with-me Only show files that are shared with me - --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only - --drive-skip-dangling-shortcuts If set skip dangling shortcut files - --drive-skip-gdocs Skip google documents in all listings - --drive-skip-shortcuts If set skip shortcut files - --drive-starred-only Only show files that are starred - --drive-stop-on-download-limit Make download limit errors be fatal - --drive-stop-on-upload-limit Make upload limit errors be fatal - --drive-team-drive string ID of the Shared Drive (Team Drive) - --drive-token string OAuth Access Token as a JSON blob - --drive-token-url string Token server url - --drive-trashed-only Only show files that are in the trash - --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) - --drive-use-created-date Use file created date instead of modified date - --drive-use-shared-date Use date file was shared instead of modified date - --drive-use-trash Send files to the trash instead of deleting permanently (default true) - --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) - --dropbox-auth-url string Auth server URL - --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) - --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") - --dropbox-batch-size int Max number of files in upload batch - --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) - --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) - --dropbox-client-id string OAuth Client Id - --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) - --dropbox-impersonate string Impersonate this user when using a business account - --dropbox-shared-files Instructs rclone to work on individual shared files - --dropbox-shared-folders Instructs rclone to work on shared folders - --dropbox-token string OAuth Access Token as a JSON blob - --dropbox-token-url string Token server url - --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) - --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) - --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) - --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --filefabric-permanent-token string Permanent Authentication Token - --filefabric-root-folder-id string ID of the root folder - --filefabric-token string Session Token - --filefabric-token-expiry string Token expiry time - --filefabric-url string URL of the Enterprise File Fabric to connect to - --filefabric-version string Version read from the file fabric - --ftp-ask-password Allow asking for FTP password when needed - --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) - --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited - --ftp-disable-epsv Disable using EPSV even if server advertises support - --ftp-disable-mlsd Disable using MLSD even if server advertises support - --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) - --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) - --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD - --ftp-host string FTP host to connect to - --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --ftp-no-check-certificate Do not verify the TLS certificate of the server - --ftp-pass string FTP password (obscured) - --ftp-port int FTP port number (default 21) - --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) - --ftp-tls Use Implicit FTPS (FTP over TLS) - --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) - --ftp-user string FTP username (default "$USER") - --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) - --gcs-anonymous Access public buckets and objects without credentials - --gcs-auth-url string Auth server URL - --gcs-bucket-acl string Access Control List for new buckets - --gcs-bucket-policy-only Access checks should use bucket-level IAM policies - --gcs-client-id string OAuth Client Id - --gcs-client-secret string OAuth Client Secret - --gcs-decompress If set this will decompress gzip encoded objects - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gcs-endpoint string Endpoint for the service - --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) - --gcs-location string Location for the newly created buckets - --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it - --gcs-object-acl string Access Control List for new objects - --gcs-project-number string Project number - --gcs-service-account-file string Service Account Credentials JSON file path - --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage - --gcs-token string OAuth Access Token as a JSON blob - --gcs-token-url string Token server url - --gphotos-auth-url string Auth server URL - --gphotos-client-id string OAuth Client Id - --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gphotos-include-archived Also view and download archived media - --gphotos-read-only Set to make the Google Photos backend read only - --gphotos-read-size Set to read the size of media items - --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) - --gphotos-token string OAuth Access Token as a JSON blob - --gphotos-token-url string Token server url - --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) - --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) - --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) - --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) - --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port - --hdfs-service-principal-name string Kerberos service principal name for the namenode - --hdfs-username string Hadoop user name - --hidrive-auth-url string Auth server URL - --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) - --hidrive-client-id string OAuth Client Id - --hidrive-client-secret string OAuth Client Secret - --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") - --hidrive-root-prefix string The root/parent folder for all paths (default "/") - --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") - --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") - --hidrive-token string OAuth Access Token as a JSON blob - --hidrive-token-url string Token server url - --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) - --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) - --http-headers CommaSepList Set HTTP headers for all transactions - --http-no-head Don't use HEAD requests - --http-no-slash Set this if the site doesn't end directories with / - --http-url string URL of HTTP host to connect to - --internetarchive-access-key-id string IAS3 Access Key - --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) - --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") - --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") - --internetarchive-secret-access-key string IAS3 Secret Key (password) - --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) - --jottacloud-hard-delete Delete files permanently rather than putting them into the trash - --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) - --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them - --jottacloud-trashed-only Only show files that are in the trash - --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --koofr-endpoint string The Koofr API endpoint to use - --koofr-mountid string Mount ID of the mount to use - --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) - --koofr-provider string Choose your storage provider - --koofr-setmtime Does the backend support setting modification time (default true) - --koofr-user string Your user name - -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension - --local-case-insensitive Force the filesystem to report itself as case insensitive - --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --local-no-check-updated Don't check to see if the files change during upload - --local-no-preallocate Disable preallocation of disk space for transferred files - --local-no-set-modtime Disable setting modtime - --local-no-sparse Disable sparse files for multi-thread downloads - --local-nounc Disable UNC (long path names) conversion on Windows - --local-unicode-normalization Apply unicode NFC normalization to paths and filenames - --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) - --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --mailru-pass string Password (obscured) - --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) - --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") - --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) - --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) - --mailru-user string User name (usually email) - --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --mega-hard-delete Delete files permanently rather than putting them into the trash - --mega-pass string Password (obscured) - --mega-use-https Use HTTPS for transfers - --mega-user string User name - --netstorage-account string Set the NetStorage account name - --netstorage-host string Domain+path of NetStorage host to connect to - --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") - --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) - -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) - --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) - --onedrive-auth-url string Auth server URL - --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) - --onedrive-client-id string OAuth Client Id - --onedrive-client-secret string OAuth Client Secret - --onedrive-drive-id string The ID of the drive to use - --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) - --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings - --onedrive-hash-type string Specify the hash in use for the backend (default "auto") - --onedrive-link-password string Set the password for links created by the link command - --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") - --onedrive-link-type string Set the type of the links created by the link command (default "view") - --onedrive-list-chunk int Size of listing chunk (default 1000) - --onedrive-no-versions Remove all versions on modifying operations - --onedrive-region string Choose national cloud region for OneDrive (default "global") - --onedrive-root-folder-id string ID of the root folder - --onedrive-server-side-across-configs Allow server-side operations (e.g. copy) to work across different onedrive configs - --onedrive-token string OAuth Access Token as a JSON blob - --onedrive-token-url string Token server url - --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --oos-compartment string Object storage compartment OCID - --oos-config-file string Path to OCI config file (default "~/.oci/config") - --oos-config-profile string Profile name inside the oci config file (default "Default") - --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --oos-copy-timeout Duration Timeout for copy (default 1m0s) - --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --oos-endpoint string Endpoint for Object storage API - --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --oos-namespace string Object storage namespace - --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it - --oos-provider string Choose your Auth Provider (default "env_auth") - --oos-region string Object storage Region - --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm - --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to - --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated - --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption - --oos-sse-kms-key-id string if using using your own master key in vault, this header specifies the - --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") - --oos-upload-concurrency int Concurrency for multipart uploads (default 10) - --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) - --opendrive-password string Password (obscured) - --opendrive-username string Username - --pcloud-auth-url string Auth server URL - --pcloud-client-id string OAuth Client Id - --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") - --pcloud-password string Your pcloud password (obscured) - --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") - --pcloud-token string OAuth Access Token as a JSON blob - --pcloud-token-url string Token server url - --pcloud-username string Your pcloud username - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --qingstor-access-key-id string QingStor Access Key ID - --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) - --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) - --qingstor-endpoint string Enter an endpoint URL to connection QingStor API - --qingstor-env-auth Get QingStor credentials from runtime - --qingstor-secret-access-key string QingStor Secret Access Key (password) - --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) - --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --qingstor-zone string Zone to connect to - --s3-access-key-id string AWS Access Key ID - --s3-acl string Canned ACL used when creating buckets and storing or copying objects - --s3-bucket-acl string Canned ACL used when creating buckets - --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --s3-decompress If set this will decompress gzip encoded objects - --s3-disable-checksum Don't store MD5 checksum with object metadata - --s3-disable-http2 Disable usage of http2 for S3 backends - --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --s3-endpoint string Endpoint for S3 API - --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) - --s3-force-path-style If true use path style access if false use virtual hosted style (default true) - --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) - --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) - --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto - --s3-location-constraint string Location constraint - must be set to match the Region - --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --s3-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --s3-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) - --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it - --s3-no-head If set, don't HEAD uploaded objects to check integrity - --s3-no-head-object If set, do not do HEAD before GET when getting objects - --s3-no-system-metadata Suppress setting and reading of system metadata - --s3-profile string Profile to use in the shared credentials file - --s3-provider string Choose your S3 provider - --s3-region string Region to connect to - --s3-requester-pays Enables requester pays option when interacting with S3 bucket - --s3-secret-access-key string AWS Secret Access Key (password) - --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 - --s3-session-token string An AWS session token - --s3-shared-credentials-file string Path to the shared credentials file - --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 - --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data - --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data - --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) - --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key - --s3-storage-class string The storage class to use when storing new objects in S3 - --s3-sts-endpoint string Endpoint for STS - --s3-upload-concurrency int Concurrency for multipart uploads (default 4) - --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint - --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) - --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads - --s3-v2-auth If true use v2 authentication - --s3-version-at Time Show file versions as they were at the specified time (default off) - --s3-versions Include old versions in directory listings - --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) - --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) - --seafile-library string Name of the library - --seafile-library-key string Library password (for encrypted libraries only) (obscured) - --seafile-pass string Password (obscured) - --seafile-url string URL of seafile host to connect to - --seafile-user string User name (usually email address) - --sftp-ask-password Allow asking for SFTP password when needed - --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) - --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference - --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) - --sftp-disable-concurrent-reads If set don't use concurrent reads - --sftp-disable-concurrent-writes If set don't use concurrent writes - --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available - --sftp-host string SSH host to connect to - --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference - --sftp-key-file string Path to PEM-encoded private key file - --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) - --sftp-key-pem string Raw PEM-encoded private key - --sftp-key-use-agent When set forces the usage of the ssh-agent - --sftp-known-hosts-file string Optional path to known_hosts file - --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference - --sftp-md5sum-command string The command used to read md5 hashes - --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) - --sftp-path-override string Override path used by SSH shell commands - --sftp-port int SSH port number (default 22) - --sftp-pubkey-file string Optional path to public key file - --sftp-server-command string Specifies the path or command to run a sftp server on the remote host - --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands - --sftp-set-modtime Set the modified time on the remote if set (default true) - --sftp-sha1sum-command string The command used to read sha1 hashes - --sftp-shell-type string The type of SSH shell on remote server, if any - --sftp-skip-links Set to skip any symlinks and any other non regular files - --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") - --sftp-use-fstat If set use fstat instead of stat - --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods - --sftp-user string SSH username (default "$USER") - --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) - --sharefile-endpoint string Endpoint for API calls - --sharefile-root-folder-id string ID of the root folder - --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) - --sia-api-password string Sia Daemon API Password (obscured) - --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) - --sia-user-agent string Siad User Agent (default "Sia-Agent") - --skip-links Don't warn about skipped symlinks - --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) - --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) - --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) - --smb-host string SMB server hostname to connect to - --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --smb-pass string SMB password (obscured) - --smb-port int SMB port number (default 445) - --smb-spn string Service principal name - --smb-user string SMB username (default "$USER") - --storj-access-grant string Access grant - --storj-api-key string API key - --storj-passphrase string Encryption passphrase - --storj-provider string Choose an authentication method (default "existing") - --storj-satellite-address string Satellite address (default "us1.storj.io") - --sugarsync-access-key-id string Sugarsync Access Key ID - --sugarsync-app-id string Sugarsync App ID - --sugarsync-authorization string Sugarsync authorization - --sugarsync-authorization-expiry string Sugarsync authorization expiry - --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) - --sugarsync-hard-delete Permanently delete files if true - --sugarsync-private-access-key string Sugarsync Private Access Key - --sugarsync-refresh-token string Sugarsync refresh token - --sugarsync-root-id string Sugarsync root id - --sugarsync-user string Sugarsync user - --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) - --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) - --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) - --swift-auth string Authentication URL for server (OS_AUTH_URL) - --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) - --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) - --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) - --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) - --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") - --swift-env-auth Get swift credentials from environment variables in standard OpenStack form - --swift-key string API key or password (OS_PASSWORD) - --swift-leave-parts-on-error If true avoid calling abort upload on a failure - --swift-no-chunk Don't chunk files during streaming upload - --swift-no-large-objects Disable support for static and dynamic large objects - --swift-region string Region name - optional (OS_REGION_NAME) - --swift-storage-policy string The storage policy to use when creating a new container - --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) - --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) - --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) - --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) - --swift-user string User name to log in (OS_USERNAME) - --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) - --union-action-policy string Policy to choose upstream on ACTION category (default "epall") - --union-cache-time int Cache time of usage and free space (in seconds) (default 120) - --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") - --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) - --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") - --union-upstreams string List of space separated upstreams - --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) - --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) - --webdav-bearer-token-command string Command to run to get a bearer token - --webdav-encoding string The encoding for the backend - --webdav-headers CommaSepList Set HTTP headers for all transactions - --webdav-pass string Password (obscured) - --webdav-url string URL of http host to connect to - --webdav-user string User name - --webdav-vendor string Name of the WebDAV site/service/software you are using - --yandex-auth-url string Auth server URL - --yandex-client-id string OAuth Client Id - --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --yandex-hard-delete Delete files permanently rather than putting them into the trash - --yandex-token string OAuth Access Token as a JSON blob - --yandex-token-url string Token server url - --zoho-auth-url string Auth server URL - --zoho-client-id string OAuth Client Id - --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) - --zoho-region string Zoho region to connect to - --zoho-token string OAuth Access Token as a JSON blob - --zoho-token-url string Token server url +into groups. + +Copy + +Flags for anything which can Copy a file. + + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination + +Sync + +Flags just used for rclone sync. + + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") + +Important + +Important flags useful for most commands. + + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) + +Check + +Flags used for rclone check. + + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + +Networking + +General networking and HTTP stuff. + + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --contimeout Duration Connect timeout (default 1m0s) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-gzip-encoding Don't set Accept-Encoding: gzip + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --use-cookies Enable session cookiejar + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") + +Performance + +Flags helpful for increasing performance. + + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --checkers int Number of checkers to run in parallel (default 8) + --transfers int Number of file transfers to run in parallel (default 4) + +Config + +General configuration of rclone. + + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --config string Config file (default "$HOME/.config/rclone/rclone.conf") + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --disable string Disable a comma separated list of features (use --disable help to see a list) + -n, --dry-run Do a trial run with no permanent changes + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + -i, --interactive Enable interactive mode + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --low-level-retries int Number of low level retries to do (default 10) + --no-console Hide console window (supported on Windows only) + --no-unicode-normalization Don't normalize unicode characters in filenames + --password-command SpaceSepList Command for supplying password for encrypted configuration + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --temp-dir string Directory rclone will use for temporary files (default "/tmp") + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata + +Debugging + +Flags for developers. + + --cpuprofile string Write cpu profile to file + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --memprofile string Write memory profile to file + +Filter + +Flags for filtering directory listings. + + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + +Listing + +Flags for listing directories. + + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions + +Logging + +Logging and statistics. + + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default "date,time") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + -q, --quiet Print as little stuff as possible + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") + --use-json-log Use json log format + -v, --verbose count Print lots more stuff (repeat for more) + +Metadata + +Flags to control metadata. + + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading + +RC + +Flags to control the Remote Control API. + + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui + +Backend + +Backend only flags. These can be set in the config file also. + + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal's client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don't store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don't attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user's password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as 'true' + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default "user") + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default "md5") + --chunker-remote string Remote to chunk/unchunk + --combine-upstreams SpaceSepList Upstreams for combining + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default "gzip") + --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + -L, --copy-links Follow symlinks and copy the pointed to item + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") + --crypt-filename-encryption string How to encrypt the filenames (default "standard") + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default "$USER") + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) + --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports + --hdfs-service-principal-name string Kerberos service principal name for the namenode + --hdfs-username string Hadoop user name + --hidrive-auth-url string Auth server URL + --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) + --hidrive-client-id string OAuth Client Id + --hidrive-client-secret string OAuth Client Secret + --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) + --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") + --hidrive-root-prefix string The root/parent folder for all paths (default "/") + --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") + --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") + --hidrive-token string OAuth Access Token as a JSON blob + --hidrive-token-url string Token server url + --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) + --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) + --http-headers CommaSepList Set HTTP headers for all transactions + --http-no-head Don't use HEAD requests + --http-no-slash Set this if the site doesn't end directories with / + --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings + --internetarchive-access-key-id string IAS3 Access Key + --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") + --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") + --internetarchive-secret-access-key string IAS3 Secret Key (password) + --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) + --jottacloud-auth-url string Auth server URL + --jottacloud-client-id string OAuth Client Id + --jottacloud-client-secret string OAuth Client Secret + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-hard-delete Delete files permanently rather than putting them into the trash + --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) + --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them + --jottacloud-token string OAuth Access Token as a JSON blob + --jottacloud-token-url string Token server url + --jottacloud-trashed-only Only show files that are in the trash + --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-endpoint string The Koofr API endpoint to use + --koofr-mountid string Mount ID of the mount to use + --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) + --koofr-provider string Choose your storage provider + --koofr-setmtime Does the backend support setting modification time (default true) + --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account + -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension + --local-case-insensitive Force the filesystem to report itself as case insensitive + --local-case-sensitive Force the filesystem to report itself as case sensitive + --local-encoding Encoding The encoding for the backend (default Slash,Dot) + --local-no-check-updated Don't check to see if the files change during upload + --local-no-preallocate Disable preallocation of disk space for transferred files + --local-no-set-modtime Disable setting modtime + --local-no-sparse Disable sparse files for multi-thread downloads + --local-nounc Disable UNC (long path names) conversion on Windows + --local-unicode-normalization Apply unicode NFC normalization to paths and filenames + --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) + --mailru-auth-url string Auth server URL + --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) + --mailru-client-id string OAuth Client Id + --mailru-client-secret string OAuth Client Secret + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-pass string Password (obscured) + --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) + --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") + --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) + --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) + --mailru-token string OAuth Access Token as a JSON blob + --mailru-token-url string Token server url + --mailru-user string User name (usually email) + --mega-debug Output more debug from Mega + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-hard-delete Delete files permanently rather than putting them into the trash + --mega-pass string Password (obscured) + --mega-use-https Use HTTPS for transfers + --mega-user string User name + --netstorage-account string Set the NetStorage account name + --netstorage-host string Domain+path of NetStorage host to connect to + --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") + --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) + -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) + --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) + --onedrive-auth-url string Auth server URL + --onedrive-av-override Allows download of files the server thinks has a virus + --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) + --onedrive-client-id string OAuth Client Id + --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings + --onedrive-drive-id string The ID of the drive to use + --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings + --onedrive-hash-type string Specify the hash in use for the backend (default "auto") + --onedrive-link-password string Set the password for links created by the link command + --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") + --onedrive-link-type string Set the type of the links created by the link command (default "view") + --onedrive-list-chunk int Size of listing chunk (default 1000) + --onedrive-no-versions Remove all versions on modifying operations + --onedrive-region string Choose national cloud region for OneDrive (default "global") + --onedrive-root-folder-id string ID of the root folder + --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --onedrive-token string OAuth Access Token as a JSON blob + --onedrive-token-url string Token server url + --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object + --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --oos-compartment string Object storage compartment OCID + --oos-config-file string Path to OCI config file (default "~/.oci/config") + --oos-config-profile string Profile name inside the oci config file (default "Default") + --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --oos-copy-timeout Duration Timeout for copy (default 1m0s) + --oos-disable-checksum Don't store MD5 checksum with object metadata + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-endpoint string Endpoint for Object storage API + --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery + --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --oos-namespace string Object storage namespace + --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it + --oos-provider string Choose your Auth Provider (default "env_auth") + --oos-region string Object storage Region + --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm + --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the + --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") + --oos-upload-concurrency int Concurrency for multipart uploads (default 10) + --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-password string Password (obscured) + --opendrive-username string Username + --pcloud-auth-url string Auth server URL + --pcloud-client-id string OAuth Client Id + --pcloud-client-secret string OAuth Client Secret + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") + --pcloud-password string Your pcloud password (obscured) + --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") + --pcloud-token string OAuth Access Token as a JSON blob + --pcloud-token-url string Token server url + --pcloud-username string Your pcloud username + --pikpak-auth-url string Auth server URL + --pikpak-client-id string OAuth Client Id + --pikpak-client-secret string OAuth Client Secret + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) + --pikpak-pass string Pikpak password (obscured) + --pikpak-root-folder-id string ID of the root folder + --pikpak-token string OAuth Access Token as a JSON blob + --pikpak-token-url string Token server url + --pikpak-trashed-only Only show files that are in the trash + --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) + --pikpak-user string Pikpak username + --premiumizeme-auth-url string Auth server URL + --premiumizeme-client-id string OAuth Client Id + --premiumizeme-client-secret string OAuth Client Secret + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-token string OAuth Access Token as a JSON blob + --premiumizeme-token-url string Token server url + --protondrive-2fa string The 2FA code + --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") + --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) + --protondrive-original-file-size Return the file size before encryption (default true) + --protondrive-password string The password of your proton account (obscured) + --protondrive-replace-existing-draft Create a new revision when filename conflict is detected + --protondrive-username string The username of your proton account + --putio-auth-url string Auth server URL + --putio-client-id string OAuth Client Id + --putio-client-secret string OAuth Client Secret + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-token string OAuth Access Token as a JSON blob + --putio-token-url string Token server url + --qingstor-access-key-id string QingStor Access Key ID + --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) + --qingstor-connection-retries int Number of connection retries (default 3) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-endpoint string Enter an endpoint URL to connection QingStor API + --qingstor-env-auth Get QingStor credentials from runtime + --qingstor-secret-access-key string QingStor Secret Access Key (password) + --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) + --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --qingstor-zone string Zone to connect to + --quatrix-api-key string API key for accessing Quatrix account + --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-hard-delete Delete files permanently rather than putting them into the trash + --quatrix-host string Host name of Quatrix account + --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) + --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) + --s3-access-key-id string AWS Access Key ID + --s3-acl string Canned ACL used when creating buckets and storing or copying objects + --s3-bucket-acl string Canned ACL used when creating buckets + --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --s3-decompress If set this will decompress gzip encoded objects + --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created + --s3-disable-checksum Don't store MD5 checksum with object metadata + --s3-disable-http2 Disable usage of http2 for S3 backends + --s3-download-url string Custom endpoint for downloads + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-endpoint string Endpoint for S3 API + --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) + --s3-force-path-style If true use path style access if false use virtual hosted style (default true) + --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery + --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) + --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) + --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto + --s3-location-constraint string Location constraint - must be set to match the Region + --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) + --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it + --s3-no-head If set, don't HEAD uploaded objects to check integrity + --s3-no-head-object If set, do not do HEAD before GET when getting objects + --s3-no-system-metadata Suppress setting and reading of system metadata + --s3-profile string Profile to use in the shared credentials file + --s3-provider string Choose your S3 provider + --s3-region string Region to connect to + --s3-requester-pays Enables requester pays option when interacting with S3 bucket + --s3-secret-access-key string AWS Secret Access Key (password) + --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 + --s3-session-token string An AWS session token + --s3-shared-credentials-file string Path to the shared credentials file + --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 + --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data + --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data + --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) + --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key + --s3-storage-class string The storage class to use when storing new objects in S3 + --s3-sts-endpoint string Endpoint for STS + --s3-upload-concurrency int Concurrency for multipart uploads (default 4) + --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint + --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) + --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) + --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads + --s3-v2-auth If true use v2 authentication + --s3-version-at Time Show file versions as they were at the specified time (default off) + --s3-versions Include old versions in directory listings + --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) + --seafile-create-library Should rclone create a library if it doesn't exist + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-library string Name of the library + --seafile-library-key string Library password (for encrypted libraries only) (obscured) + --seafile-pass string Password (obscured) + --seafile-url string URL of seafile host to connect to + --seafile-user string User name (usually email address) + --sftp-ask-password Allow asking for SFTP password when needed + --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) + --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference + --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks + --sftp-disable-concurrent-reads If set don't use concurrent reads + --sftp-disable-concurrent-writes If set don't use concurrent writes + --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available + --sftp-host string SSH host to connect to + --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference + --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference + --sftp-key-file string Path to PEM-encoded private key file + --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) + --sftp-key-pem string Raw PEM-encoded private key + --sftp-key-use-agent When set forces the usage of the ssh-agent + --sftp-known-hosts-file string Optional path to known_hosts file + --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference + --sftp-md5sum-command string The command used to read md5 hashes + --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) + --sftp-path-override string Override path used by SSH shell commands + --sftp-port int SSH port number (default 22) + --sftp-pubkey-file string Optional path to public key file + --sftp-server-command string Specifies the path or command to run a sftp server on the remote host + --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands + --sftp-set-modtime Set the modified time on the remote if set (default true) + --sftp-sha1sum-command string The command used to read sha1 hashes + --sftp-shell-type string The type of SSH shell on remote server, if any + --sftp-skip-links Set to skip any symlinks and any other non regular files + --sftp-socks-proxy string Socks 5 proxy host + --sftp-ssh SpaceSepList Path and arguments to external ssh binary + --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") + --sftp-use-fstat If set use fstat instead of stat + --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods + --sftp-user string SSH username (default "$USER") + --sharefile-auth-url string Auth server URL + --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) + --sharefile-client-id string OAuth Client Id + --sharefile-client-secret string OAuth Client Secret + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-endpoint string Endpoint for API calls + --sharefile-root-folder-id string ID of the root folder + --sharefile-token string OAuth Access Token as a JSON blob + --sharefile-token-url string Token server url + --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) + --sia-api-password string Sia Daemon API Password (obscured) + --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-user-agent string Siad User Agent (default "Sia-Agent") + --skip-links Don't warn about skipped symlinks + --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) + --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) + --smb-host string SMB server hostname to connect to + --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --smb-pass string SMB password (obscured) + --smb-port int SMB port number (default 445) + --smb-spn string Service principal name + --smb-user string SMB username (default "$USER") + --storj-access-grant string Access grant + --storj-api-key string API key + --storj-passphrase string Encryption passphrase + --storj-provider string Choose an authentication method (default "existing") + --storj-satellite-address string Satellite address (default "us1.storj.io") + --sugarsync-access-key-id string Sugarsync Access Key ID + --sugarsync-app-id string Sugarsync App ID + --sugarsync-authorization string Sugarsync authorization + --sugarsync-authorization-expiry string Sugarsync authorization expiry + --sugarsync-deleted-id string Sugarsync deleted folder id + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-hard-delete Permanently delete files if true + --sugarsync-private-access-key string Sugarsync Private Access Key + --sugarsync-refresh-token string Sugarsync refresh token + --sugarsync-root-id string Sugarsync root id + --sugarsync-user string Sugarsync user + --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) + --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) + --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) + --swift-auth string Authentication URL for server (OS_AUTH_URL) + --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) + --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) + --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) + --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) + --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") + --swift-env-auth Get swift credentials from environment variables in standard OpenStack form + --swift-key string API key or password (OS_PASSWORD) + --swift-leave-parts-on-error If true avoid calling abort upload on a failure + --swift-no-chunk Don't chunk files during streaming upload + --swift-no-large-objects Disable support for static and dynamic large objects + --swift-region string Region name - optional (OS_REGION_NAME) + --swift-storage-policy string The storage policy to use when creating a new container + --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) + --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) + --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) + --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) + --swift-user string User name to log in (OS_USERNAME) + --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) + --union-action-policy string Policy to choose upstream on ACTION category (default "epall") + --union-cache-time int Cache time of usage and free space (in seconds) (default 120) + --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") + --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) + --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") + --union-upstreams string List of space separated upstreams + --uptobox-access-token string Your access token + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-private Set to make uploaded files private + --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) + --webdav-bearer-token-command string Command to run to get a bearer token + --webdav-encoding string The encoding for the backend + --webdav-headers CommaSepList Set HTTP headers for all transactions + --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) + --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --webdav-pass string Password (obscured) + --webdav-url string URL of http host to connect to + --webdav-user string User name + --webdav-vendor string Name of the WebDAV site/service/software you are using + --yandex-auth-url string Auth server URL + --yandex-client-id string OAuth Client Id + --yandex-client-secret string OAuth Client Secret + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-hard-delete Delete files permanently rather than putting them into the trash + --yandex-token string OAuth Access Token as a JSON blob + --yandex-token-url string Token server url + --zoho-auth-url string Auth server URL + --zoho-client-id string OAuth Client Id + --zoho-client-secret string OAuth Client Secret + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-region string Zoho region to connect to + --zoho-token string OAuth Access Token as a JSON blob + --zoho-token-url string Token server url Docker Volume Plugin @@ -15626,10 +19016,16 @@ Command line syntax If exceeded, the bisync run will abort. (default: 50%) --force Bypass `--max-delete` safety check and run the sync. Consider using with `--verbose` + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) --remove-empty-dirs Remove empty directories at the final cleanup step. -1, --resync Performs the resync run. Warning: Path1 files may overwrite Path2 versions. Consider using `--verbose` or `--dry-run` first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! --localtime Use local time in listings (default: UTC) --no-cleanup Retain working files (useful for troubleshooting and testing). --workdir PATH Use custom working directory (useful for testing). @@ -15654,8 +19050,8 @@ with optional subdirectory paths. Cloud references are distinguished by having a : in the argument (see Windows support below). Path1 and Path2 are treated equally, in that neither has priority for -file changes, and access efficiency does not change whether a remote is -on Path1 or Path2. +file changes (except during --resync), and access efficiency does not +change whether a remote is on Path1 or Path2. The listings in bisync working directory (default: ~/.cache/rclone/bisync) are named based on the Path1 and Path2 arguments @@ -15663,9 +19059,10 @@ so that separate syncs to individual directories within the tree may be set up, e.g.: path_to_local_tree..dropbox_subdir.lst. Any empty directories after the sync on both the Path1 and Path2 -filesystems are not deleted by default. If the --remove-empty-dirs flag -is specified, then both paths will have any empty directories purged as -the last step in the process. +filesystems are not deleted by default, unless --create-empty-src-dirs +is specified. If the --remove-empty-dirs flag is specified, then both +paths will have ALL empty directories purged as the last step in the +process. Command-line flags @@ -15673,16 +19070,27 @@ Command-line flags This will effectively make both Path1 and Path2 filesystems contain a matching superset of all files. Path2 files that do not exist in Path1 -will be copied to Path1, and the process will then sync the Path1 tree +will be copied to Path1, and the process will then copy the Path1 tree to Path2. -The base directories on the both Path1 and Path2 filesystems must exist -or bisync will fail. This is required for safety - that bisync can -verify that both paths are valid. +The --resync sequence is roughly equivalent to: + + rclone copy Path2 Path1 --ignore-existing + rclone copy Path1 Path2 + +Or, if using --create-empty-src-dirs: + + rclone copy Path2 Path1 --ignore-existing + rclone copy Path1 Path2 --create-empty-src-dirs + rclone copy Path2 Path1 --create-empty-src-dirs -When using --resync, a newer version of a file either on Path1 or Path2 -filesystem, will overwrite the file on the other path (only the last -version will be kept). Carefully evaluate deltas using --dry-run. +The base directories on both Path1 and Path2 filesystems must exist or +bisync will fail. This is required for safety - that bisync can verify +that both paths are valid. + +When using --resync, a newer version of a file on the Path2 filesystem +will be overwritten by the Path1 filesystem version. (Note that this is +NOT entirely symmetrical.) Carefully evaluate deltas using --dry-run. For a resync run, one of the paths may be empty (no files in the path tree). The resync run should result in files on both paths, else a @@ -15699,17 +19107,31 @@ deleting everything in the other path. Access check files are an additional safety measure against data loss. bisync will ensure it can find matching RCLONE_TEST files in the same places in the Path1 and Path2 filesystems. RCLONE_TEST files are not -generated automatically. For --check-accessto succeed, you must first -either: A) Place one or more RCLONE_TEST files in the Path1 or Path2 -filesystem and then do either a run without --check-access or a --resync -to set matching files on both filesystems, or B) Set --check-filename to -a filename already in use in various locations throughout your sync'd -fileset. Time stamps and file contents are not important, just the names -and locations. If you have symbolic links in your sync tree it is -recommended to place RCLONE_TEST files in the linked-to directory tree -to protect against bisync assuming a bunch of deleted files if the -linked-to tree should not be accessible. See also the --check-filename -flag. +generated automatically. For --check-access to succeed, you must first +either: A) Place one or more RCLONE_TEST files in both systems, or B) +Set --check-filename to a filename already in use in various locations +throughout your sync'd fileset. Recommended methods for A) include: * +rclone touch Path1/RCLONE_TEST (create a new file) * +rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST (copy an existing +file) * +rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST" +(copy multiple files at once, recursively) * create the files manually +(outside of rclone) * run bisync once without --check-access to set +matching files on both filesystems will also work, but is not preferred, +due to potential for user error (you are temporarily disabling the +safety feature). + +Note that --check-access is still enforced on --resync, so +bisync --resync --check-access will not work as a method of initially +setting the files (this is to ensure that bisync can't inadvertently +circumvent its own safety switch.) + +Time stamps and file contents for RCLONE_TEST files are not important, +just the names and locations. If you have symbolic links in your sync +tree it is recommended to place RCLONE_TEST files in the linked-to +directory tree to protect against bisync assuming a bunch of deleted +files if the linked-to tree should not be accessible. See also the +--check-filename flag. --check-filename @@ -15730,7 +19152,7 @@ to bisync as a bunch of deleted files and a bunch of new files. This safety check is intended to block bisync from deleting all of the files on both filesystems due to a temporary network access issue, or if the user had inadvertently deleted the files on one side or the other. To -force the sync either set a different delete percentage limit, e.g. +force the sync, either set a different delete percentage limit, e.g. --max-delete 75 (allows up to 75% deletion), or use --force to bypass the check. @@ -15744,19 +19166,19 @@ sub-trees from the sync. See the bisync filters section and generic for non-allowed files for synching with Dropbox. If you make changes to your filters file then bisync requires a run with ---resync. This is a safety feature, which avoids existing files on the +--resync. This is a safety feature, which prevents existing files on the Path1 and/or Path2 side from seeming to disappear from view (since they are excluded in the new listings), which would fool bisync into seeing them as deleted (as compared to the prior run listings), and then bisync would proceed to delete them for real. -To block this from happening bisync calculates an MD5 hash of the +To block this from happening, bisync calculates an MD5 hash of the filters file and stores the hash in a .md5 file in the same place as -your filters file. On the next runs with --filters-file set, bisync +your filters file. On the next run with --filters-file set, bisync re-calculates the MD5 hash of the current filters file and compares it -to the hash stored in .md5 file. If they don't match the run aborts with -a critical error and thus forces you to do a --resync, likely avoiding a -disaster. +to the hash stored in the .md5 file. If they don't match, the run aborts +with a critical error and thus forces you to do a --resync, likely +avoiding a disaster. --check-sync @@ -15776,6 +19198,68 @@ significantly reduce the sync run times for very large numbers of files. The check may be run manually with --check-sync=only. It runs only the integrity check and terminates without actually synching. +See also: Concurrent modifications + +--ignore-listing-checksum + +By default, bisync will retrieve (or generate) checksums (for backends +that support them) when creating the listings for both paths, and store +the checksums in the listing files. --ignore-listing-checksum will +disable this behavior, which may speed things up considerably, +especially on backends (such as local) where hashes must be computed on +the fly instead of retrieved. Please note the following: + +- While checksums are (by default) generated and stored in the listing + files, they are NOT currently used for determining diffs (deltas). + It is anticipated that full checksum support will be added in a + future version. +- --ignore-listing-checksum is NOT the same as --ignore-checksum, and + you may wish to use one or the other, or both. In a nutshell: + --ignore-listing-checksum controls whether checksums are considered + when scanning for diffs, while --ignore-checksum controls whether + checksums are considered during the copy/sync operations that + follow, if there ARE diffs. +- Unless --ignore-listing-checksum is passed, bisync currently + computes hashes for one path even when there's no common hash with + the other path (for example, a crypt remote.) +- If both paths support checksums and have a common hash, AND + --ignore-listing-checksum was not specified when creating the + listings, --check-sync=only can be used to compare Path1 vs. Path2 + checksums (as of the time the previous listings were created.) + However, --check-sync=only will NOT include checksums if the + previous listings were generated on a run using + --ignore-listing-checksum. For a more robust integrity check of the + current state, consider using check (or cryptcheck, if at least one + path is a crypt remote.) + +--resilient + +Caution: this is an experimental feature. Use at your own risk! + +By default, most errors or interruptions will cause bisync to abort and +require --resync to recover. This is a safety feature, to prevent bisync +from running again until a user checks things out. However, in some +cases, bisync can go too far and enforce a lockout when one isn't +actually necessary, like for certain less-serious errors that might +resolve themselves on the next run. When --resilient is specified, +bisync tries its best to recover and self-correct, and only requires +--resync as a last resort when a human's involvement is absolutely +necessary. The intended use case is for running bisync as a background +process (such as via scheduled cron). + +When using --resilient mode, bisync will still report the error and +abort, however it will not lock out future runs -- allowing the +possibility of retrying at the next normally scheduled time, without +requiring a --resync first. Examples of such retryable errors include +access test failures, missing listing files, and filter change +detections. These safety features will still prevent the current run +from proceeding -- the difference is that if conditions have improved by +the time of the next run, that next run will be allowed to proceed. +Certain more serious errors will still enforce a --resync lockout, even +in --resilient mode, to prevent data loss. + +Behavior of --resilient may change in a future version. + Operation Runtime flow details @@ -15836,10 +19320,17 @@ Unusual sync checks ---------------------------------------------------------------------------- Type Description Result Implementation ----------------- --------------------- ------------------- ---------------- + Path1 new/changed File is new/changed No change None + AND Path2 on Path1 AND + new/changed AND new/changed on Path2 + Path1 == Path2 AND Path1 version is + currently identical + to Path2 + Path1 new AND File is new on Path1 Files renamed to rclone copy - Path2 new AND new on Path2 _Path1 and _Path2 _Path2 file to - Path1, - rclone copy + Path2 new AND new on Path2 (and _Path1 and _Path2 _Path2 file to + Path1 version is NOT Path1, + identical to Path2) rclone copy _Path1 file to Path2 @@ -15847,8 +19338,9 @@ Unusual sync checks Path1 changed Path2 AND also _Path1 and _Path2 _Path2 file to changed Path1, (newer/older/size) on rclone copy - Path1 _Path1 file to - Path2 + Path1 (and Path1 _Path1 file to + version is NOT Path2 + identical to Path2) Path2 newer AND File is newer on Path2 version rclone copy Path1 deleted Path2 AND also survives Path2 to Path1 @@ -15865,9 +19357,20 @@ Unusual sync checks Path2 ---------------------------------------------------------------------------- +As of rclone v1.64, bisync is now better at detecting false positive +sync conflicts, which would previously have resulted in unnecessary +renames and duplicates. Now, when bisync comes to a file that it wants +to rename (because it is new/changed on both sides), it first checks +whether the Path1 and Path2 versions are currently identical (using the +same underlying function as check.) If bisync concludes that the files +are identical, it will skip them and move on. Otherwise, it will create +renamed ..Path1 and ..Path2 duplicates, as before. This behavior also +improves the experience of renaming directories, as a --resync is no +longer required, so long as the same change has been made on both sides. + All files changed check -if all prior existing files on either of the filesystems have changed +If all prior existing files on either of the filesystems have changed (e.g. timestamps have changed due to changing the system's timezone) then bisync will abort without making any changes. Any new files are not considered for this check. You could use --force to force the sync @@ -15876,7 +19379,7 @@ considered for this check. You could use --force to force the sync the situation carefully and perhaps use --dry-run before you commit to the changes. -Modification time +Modification times Bisync relies on file timestamps to identify changed files and will refuse to operate if backend lacks the modification time support. @@ -15904,7 +19407,7 @@ It is recommended to use --resync --dry-run --verbose initially and carefully review what changes will be made before running the --resync without --dry-run. -Most of these events come up due to a error status from an internal +Most of these events come up due to an error status from an internal call. On such a critical error the {...}.path1.lst and {...}.path2.lst listing files are renamed to extension .lst-err, which blocks any future bisync runs (since the normal .lst files are not found). Bisync keeps @@ -15914,6 +19417,8 @@ at ${HOME}/.cache/rclone/bisync/ on Linux. Some errors are considered temporary and re-running the bisync is not blocked. The critical return blocks further bisync runs. +See also: --resilient + Lock file When bisync is running, a lock file is created in the bisync working @@ -15948,10 +19453,9 @@ It has not been fully tested with other services yet. If it works, or sorta works, please let us know and we'll update the list. Run the test suite to check for proper operation as described below. -First release of rclone bisync requires that underlying backend -supported the modification time feature and will refuse to run -otherwise. This limitation will be lifted in a future rclone bisync -release. +First release of rclone bisync requires that underlying backend supports +the modification time feature and will refuse to run otherwise. This +limitation will be lifted in a future rclone bisync release. Concurrent modifications @@ -15963,36 +19467,104 @@ be solved in a future release, there is no workaround at the moment. Files that change during a bisync run may result in data loss. This has been seen in a highly dynamic environment, where the filesystem is -getting hammered by running processes during the sync. The solution is -to sync at quiet times or filter out unnecessary directories and files. +getting hammered by running processes during the sync. The currently +recommended solution is to sync at quiet times or filter out unnecessary +directories and files. -Empty directories +As an alternative approach, consider using --check-sync=false (and +possibly --resilient) to make bisync more forgiving of filesystems that +change during the sync. Be advised that this may cause bisync to miss +events that occur during a bisync run, so it is a good idea to +supplement this with a periodic independent integrity check, and +corrective sync if diffs are found. For example, a possible sequence +could look like this: + +1. Normally scheduled bisync run: + + rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient + +2. Periodic independent integrity check (perhaps scheduled nightly or + weekly): + + rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt + +3. If diffs are found, you have some choices to correct them. If one + side is more up-to-date and you want to make the other side match + it, you could run: + + rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v + +(or switch Path1 and Path2 to make Path2 the source-of-truth) -New empty directories on one path are not propagated to the other side. -This is because bisync (and rclone) natively works on files not -directories. The following sequence is a workaround but will not -propagate the delete of an empty directory to the other side: +Or, if neither side is totally up-to-date, you could run a --resync to +bring them back into agreement (but remember that this could cause +deleted files to re-appear.) - rclone bisync PATH1 PATH2 - rclone copy PATH1 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs - rclone copy PATH2 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs +*Note also that rclone check does not currently include empty +directories, so if you want to know if any empty directories are out of +sync, consider alternatively running the above rclone sync command with +--dry-run added. + +Empty directories + +By default, new/deleted empty directories on one path are not propagated +to the other side. This is because bisync (and rclone) natively works on +files, not directories. However, this can be changed with the +--create-empty-src-dirs flag, which works in much the same way as in +sync and copy. When used, empty directories created or deleted on one +side will also be created or deleted on the other side. The following +should be noted: * --create-empty-src-dirs is not compatible with +--remove-empty-dirs. Use only one or the other (or neither). * It is not +recommended to switch back and forth between --create-empty-src-dirs and +the default (no --create-empty-src-dirs) without running --resync. This +is because it may appear as though all directories (not just the empty +ones) were created/deleted, when actually you've just toggled between +making them visible/invisible to bisync. It looks scarier than it is, +but it's still probably best to stick to one or the other, and use +--resync when you need to switch. Renamed directories -Renaming a folder on the Path1 side results is deleting all files on the +Renaming a folder on the Path1 side results in deleting all files on the Path2 side and then copying all files again from Path1 to Path2. Bisync sees this as all files in the old directory name as deleted and all -files in the new directory name as new. Similarly, renaming a directory -on both sides to the same name will result in creating ..path1 and -..path2 files on both sides. Currently the most effective and efficient -method of renaming a directory is to rename it on both sides, then do a ---resync. +files in the new directory name as new. Currently, the most effective +and efficient method of renaming a directory is to rename it to the same +name on both sides. (As of rclone v1.64, a --resync is no longer +required after doing so, as bisync will automatically detect that Path1 +and Path2 are in agreement.) + +--fast-list used by default + +Unlike most other rclone commands, bisync uses --fast-list by default, +for backends that support it. In many cases this is desirable, however, +there are some scenarios in which bisync could be faster without +--fast-list, and there is also a known issue concerning Google Drive +users with many empty directories. For now, the recommended way to avoid +using --fast-list is to add --disable ListR to all bisync commands. The +default behavior may change in a future version. + +Overridden Configs + +When rclone detects an overridden config, it adds a suffix like {ABCDE} +on the fly to the internal name of the remote. Bisync follows suit by +including this suffix in its listing filenames. However, this suffix +does not necessarily persist from run to run, especially if different +flags are provided. So if next time the suffix assigned is {FGHIJ}, +bisync will get confused, because it's looking for a listing file with +{FGHIJ}, when the file it wants has {ABCDE}. As a result, it throws +Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +and refuses to run again until the user runs a --resync (unless using +--resilient). The best workaround at the moment is to set any +backend-specific flags in the config file instead of specifying them +with command flags. (You can still override them as needed for other +rclone commands.) Case sensitivity Synching with case-insensitive filesystems, such as Windows or Box, can result in file name conflicts. This will be fixed in a future release. -The near term workaround is to make sure that files on both sides don't +The near-term workaround is to make sure that files on both sides don't have spelling case differences (Smile.jpg vs. smile.jpg). Windows support @@ -16057,7 +19629,7 @@ Filters file writing guidelines faster. - Specific files may also be excluded, as with the Dropbox exclusions example below. -2. Decide if its easier (or cleaner) to: +2. Decide if it's easier (or cleaner) to: - Include select directories and therefore exclude everything else -- or -- - Exclude select directories and therefore include everything else @@ -16078,7 +19650,7 @@ Filters file writing guidelines -/Desktop/tempfiles/, or `- /testdir/. Again, a**` on the end is not necessary. - Do not add a `- **` in the file. Without this line, everything - will be included that has not be explicitly excluded. + will be included that has not been explicitly excluded. - Disregard step 3. A few rules for the syntax of a filter file expanding on filtering @@ -16163,7 +19735,7 @@ Example filters file for Dropbox # NOTICE: If you make changes to this file you MUST do a --resync run. # Run with --dry-run to see what changes will be made. - # Dropbox wont sync some files so filter them away here. + # Dropbox won't sync some files so filter them away here. # See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing - .dropbox.attr - ~*.tmp @@ -16220,7 +19792,7 @@ The --dry-run messages may indicate that it would try to delete some files. For example, if a file is new on Path2 and does not exist on Path1 then it would normally be copied to Path1, but with --dry-run enabled those copies don't happen, which leads to the attempted delete -on the Path2, blocked again by --dry-run: ... Not deleting as --dry-run. +on Path2, blocked again by --dry-run: ... Not deleting as --dry-run. This whole confusing situation is an artifact of the --dry-run flag. Scrutinize the proposed deletes carefully, and if the files would have @@ -16229,15 +19801,15 @@ disregarded. Retries -Rclone has built in retries. If you run with --verbose you'll see error +Rclone has built-in retries. If you run with --verbose you'll see error and retry messages such as shown below. This is usually not a bug. If at -the end of the run you see Bisync successful and not +the end of the run, you see Bisync successful and not Bisync critical error or Bisync aborted then the run was successful, and you can ignore the error messages. -The following run shows an intermittent fail. Lines 5 and _6- are low -level messages. Line 6 is a bubbled-up warning message, conveying the -error. Rclone normally retries failing commands, so there may be +The following run shows an intermittent fail. Lines 5 and _6- are +low-level messages. Line 6 is a bubbled-up warning message, conveying +the error. Rclone normally retries failing commands, so there may be numerous such messages in the log. Since there are no final error/warning messages on line 7, rclone has @@ -16309,8 +19881,7 @@ and an OwnCloud server, with output logged to a runlog file: # Command */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log -See crontab syntax). for the details of crontab time interval -expressions. +See crontab syntax for the details of crontab time interval expressions. If you run rclone bisync as a cron job, redirect stdout/stderr to a file. The 2nd example runs a sync to Dropbox every hour and logs all @@ -16495,9 +20066,9 @@ Notes about testing check file mismatches in the test tree. - Some Dropbox tests can fail, notably printing the following message: src and dst identical but can't set mod time without deleting and re-uploading - This is expected and happens due a way Dropbox handles modification - times. You should use the -refresh-times test flag to make up for - this. + This is expected and happens due to the way Dropbox handles + modification times. You should use the -refresh-times test flag to + make up for this. - If Dropbox tests hit request limit for you and print error message too_many_requests/...: Too many requests or write operations. then follow the Dropbox App ID instructions. @@ -16555,7 +20126,7 @@ Supported test commands and re-creating the parent would change its ID. - delete-file Delete a single file. - delete-glob Delete a group of files located one - level deep in the given directory with names maching a given glob + level deep in the given directory with names matching a given glob pattern. - touch-glob YYYY-MM-DD Change modification time on a group of files. @@ -16653,11 +20224,173 @@ rclone bisync is similar in nature to a range of other projects: Bisync adopts the differential synchronization technique, which is based on keeping history of changes performed by both synchronizing sides. See -the Dual Shadow Method section in the Neil Fraser's article. +the Dual Shadow Method section in Neil Fraser's article. Also note a number of academic publications by Benjamin Pierce about Unison and synchronization in general. +Changelog + +v1.64 + +- Fixed an issue causing dry runs to inadvertently commit filter + changes +- Fixed an issue causing --resync to erroneously delete empty folders + and duplicate files unique to Path2 +- --check-access is now enforced during --resync, preventing data loss + in certain user error scenarios +- Fixed an issue causing bisync to consider more files than necessary + due to overbroad filters during delete operations +- Improved detection of false positive change conflicts (identical + files are now left alone instead of renamed) +- Added support for --create-empty-src-dirs +- Added experimental --resilient mode to allow recovery from + self-correctable errors +- Added new --ignore-listing-checksum flag to distinguish from + --ignore-checksum +- Performance improvements for large remotes +- Documentation and testing improvements + +Release signing + +The hashes of the binary artefacts of the rclone release are signed with +a public PGP/GPG key. This can be verified manually as described below. + +The same mechanism is also used by rclone selfupdate to verify that the +release has not been tampered with before the new update is installed. +This checks the SHA256 hash and the signature with a public key compiled +into the rclone binary. + +Release signing key + +You may obtain the release signing key from: + +- From KEYS on this website - this file contains all past signing keys + also. +- The git repository hosted on GitHub - + https://github.com/rclone/rclone/blob/master/docs/content/KEYS +- gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com +- gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com +- https://www.craig-wood.com/nick/pub/pgp-key.txt + +After importing the key, verify that the fingerprint of one of the keys +matches: FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA as this key is used +for signing. + +We recommend that you cross-check the fingerprint shown above through +the domains listed below. By cross-checking the integrity of the +fingerprint across multiple domains you can be confident that you +obtained the correct key. + +- The source for this page on GitHub. +- Through DNS dig key.rclone.org txt + +If you find anything that doesn't not match, please contact the +developers at once. + +How to verify the release + +In the release directory you will see the release files and some files +called MD5SUMS, SHA1SUMS and SHA256SUMS. + + $ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: + MD5SUMS + SHA1SUMS + SHA256SUMS + rclone-v1.63.1-freebsd-386.zip + rclone-v1.63.1-freebsd-amd64.zip + ... + rclone-v1.63.1-windows-arm64.zip + rclone-v1.63.1.tar.gz + version.txt + +The MD5SUMS, SHA1SUMS and SHA256SUMS contain hashes of the binary files +in the release directory along with a signature. + +For example: + + $ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS + -----BEGIN PGP SIGNED MESSAGE----- + Hash: SHA1 + + f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip + 7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip + ... + 66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip + bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip + -----BEGIN PGP SIGNATURE----- + + iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU + +pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= + =8qrL + -----END PGP SIGNATURE----- + +Download the files + +The first step is to download the binary and SUMs file and verify that +the SUMs you have downloaded match. Here we download +rclone-v1.63.1-windows-amd64.zip - choose the binary (or binaries) +appropriate to your architecture. We've also chosen the SHA256SUMS as +these are the most secure. You could verify the other types of hash also +for extra security. rclone selfupdate verifies just the SHA256SUMS. + + $ mkdir /tmp/check + $ cd /tmp/check + $ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . + $ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . + +Verify the signatures + +First verify the signatures on the SHA256 file. + +Import the key. See above for ways to verify this key is correct. + + $ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA + gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood " imported + gpg: Total number processed: 1 + gpg: imported: 1 + +Then check the signature: + + $ gpg --verify SHA256SUMS + gpg: Signature made Mon 17 Jul 2023 15:03:17 BST + gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA + gpg: Good signature from "Nick Craig-Wood " [ultimate] + +Verify the signature was good and is using the fingerprint shown above. + +Repeat for MD5SUMS and SHA1SUMS if desired. + +Verify the hashes + +Now that we know the signatures on the hashes are OK we can verify the +binaries match the hashes, completing the verification. + + $ sha256sum -c SHA256SUMS 2>&1 | grep OK + rclone-v1.63.1-windows-amd64.zip: OK + +Or do the check with rclone + + $ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... + = rclone-v1.63.1-windows-amd64.zip + 2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found + 2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files + +Verify signatures and hashes together + +You can verify the signatures and hashes in one command line like this: + + $ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing + gpg: Signature made Mon 17 Jul 2023 15:03:17 BST + gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA + gpg: Good signature from "Nick Craig-Wood " [ultimate] + gpg: aka "Nick Craig-Wood " [unknown] + rclone-v1.63.1-windows-amd64.zip: OK + 1Fichier This is a backend for the 1fichier cloud storage service. Note that a @@ -16727,7 +20460,7 @@ To copy a local directory to a 1Fichier directory called backup rclone copy /home/source remote:backup -Modified time and hashes +Modification times and hashes 1Fichier does not support modification times. It supports the Whirlpool hash algorithm. @@ -16824,6 +20557,17 @@ Properties: - Type: string - Required: false +--fichier-cdn + +Set if you wish to use CDN download links. + +Properties: + +- Config: cdn +- Env Var: RCLONE_FICHIER_CDN +- Type: bool +- Default: false + --fichier-encoding The encoding for the backend. @@ -16834,7 +20578,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FICHIER_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot @@ -17070,13 +20814,13 @@ To copy a local directory to an Amazon Drive directory called backup rclone copy /home/source remote:backup -Modified time and MD5SUMs +Modification times and hashes Amazon Drive doesn't allow modification times to be changed via the API so these won't be accurate or used for syncing. -It does store MD5SUMs so for a more accurate sync, you can use the ---checksum flag. +It does support the MD5 hash algorithm, so for a more accurate sync, you +can use the --checksum flag. Restricted filename characters @@ -17248,7 +20992,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ACD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot Limitations @@ -17293,19 +21037,25 @@ The S3 backend can be used with a number of different providers: - Arvan Cloud Object Storage (AOS) - DigitalOcean Spaces - Dreamhost +- GCS - Huawei OBS - IBM COS S3 - IDrive e2 - IONOS Cloud +- Leviia Object Storage - Liara Object Storage +- Linode Object Storage - Minio +- Petabox - Qiniu Cloud Object Storage (Kodo) - RackCorp Object Storage +- Rclone Serve S3 - Scaleway - Seagate Lyve Cloud - SeaweedFS - StackPath - Storj +- Synology C2 Object Storage - Tencent Cloud Object Storage (COS) - Wasabi @@ -17539,7 +21289,9 @@ This will guide you through an interactive setup process. d) Delete this remote y/e/d> -Modified time +Modification times and hashes + +Modification times The modified time is stored as metadata on the object as X-Amz-Meta-Mtime as floating point since the epoch, accurate to 1 ns. @@ -17553,6 +21305,30 @@ uploaded rather than copied. Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings. +Hashes + +For small objects which weren't uploaded as multipart uploads (objects +sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the +ETag: header as an MD5 checksum. + +However for objects which were uploaded as multipart uploads or with +server side encryption (SSE-AWS or SSE-C) the ETag header is no longer +the MD5 sum of the data, so rclone adds an additional piece of metadata +X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same +format as is required for Content-MD5). You can use base64 -d and +hexdump to check this value manually: + + echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump + +or you can use rclone check to verify the hashes are OK. + +For large objects, calculating this hash can take some time so the +addition of this hash can be disabled with --s3-disable-checksum. This +will mean that these objects do not have an MD5 checksum. + +Note that reading this from the object takes an additional HEAD request +as the metadata isn't returned in object listings. + Reducing costs Avoiding HEAD requests to read the modification time @@ -17642,25 +21418,6 @@ details. Setting this flag increases the chance for undetected upload failures. -Hashes - -For small objects which weren't uploaded as multipart uploads (objects -sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the -ETag: header as an MD5 checksum. - -However for objects which were uploaded as multipart uploads or with -server side encryption (SSE-AWS or SSE-C) the ETag header is no longer -the MD5 sum of the data, so rclone adds an additional piece of metadata -X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same -format as is required for Content-MD5). - -For large objects, calculating this hash can take some time so the -addition of this hash can be disabled with --s3-disable-checksum. This -will mean that these objects do not have an MD5 checksum. - -Note that reading this from the object takes an additional HEAD request -as the metadata isn't returned in object listings. - Versions When bucket versioning is enabled (this can be done with rclone with the @@ -17719,6 +21476,19 @@ Clean up all the old versions and show that they've gone. $ rclone -q --s3-versions ls s3:cleanup-test 9 one.txt +Versions naming caveat + +When using --s3-versions flag rclone is relying on the file name to work +out whether the objects are versions or not. Versions' names are created +by inserting timestamp between file name and its extension. + + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt + +If there are real files present with the same names as versions, then +behaviour of --s3-versions can be unpredictable. + Cleanup If you run rclone cleanup s3:bucket then it will remove all pending @@ -17905,18 +21675,19 @@ According to AWS's documentation on S3 Object Lock: If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header. -As mentioned in the Hashes section, small files that are not uploaded as -multipart, use a different tag, causing the upload to fail. A simple -solution is to set the --s3-upload-cutoff 0 and force all the files to -be uploaded as multipart. +As mentioned in the Modification times and hashes section, small files +that are not uploaded as multipart, use a different tag, causing the +upload to fail. A simple solution is to set the --s3-upload-cutoff 0 and +force all the files to be uploaded as multipart. Standard options Here are the Standard options specific to s3 (Amazon S3 Compliant -Storage Providers including AWS, Alibaba, Ceph, China Mobile, -Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, -IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, -Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi). +Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, +Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, +IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, +RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, +TencentCOS, Wasabi, Qiniu and others). --s3-provider @@ -17933,18 +21704,20 @@ Properties: - Amazon Web Services (AWS) S3 - "Alibaba" - Alibaba Cloud Object Storage System (OSS) formerly Aliyun + - "ArvanCloud" + - Arvan Cloud Object Storage (AOS) - "Ceph" - Ceph Object Storage - "ChinaMobile" - China Mobile Ecloud Elastic Object Storage (EOS) - "Cloudflare" - Cloudflare R2 Storage - - "ArvanCloud" - - Arvan Cloud Object Storage (AOS) - "DigitalOcean" - DigitalOcean Spaces - "Dreamhost" - Dreamhost DreamObjects + - "GCS" + - Google Cloud Storage - "HuaweiOBS" - Huawei Object Storage Service - "IBMCOS" @@ -17955,14 +21728,22 @@ Properties: - IONOS Cloud - "LyveCloud" - Seagate Lyve Cloud + - "Leviia" + - Leviia Object Storage - "Liara" - Liara Object Storage + - "Linode" + - Linode Object Storage - "Minio" - Minio Object Storage - "Netease" - Netease Object Storage (NOS) + - "Petabox" + - Petabox Object Storage - "RackCorp" - RackCorp Object Storage + - "Rclone" + - Rclone S3 Server - "Scaleway" - Scaleway Object Storage - "SeaweedFS" @@ -17971,6 +21752,8 @@ Properties: - StackPath Object Storage - "Storj" - Storj (S3 Compatible Gateway) + - "Synology" + - Synology C2 Object Storage - "TencentCOS" - Tencent Cloud Object Storage (COS) - "Wasabi" @@ -18114,213 +21897,6 @@ Properties: - AWS GovCloud (US) Region. - Needs location constraint us-gov-west-1. ---s3-region - -region - the location where your bucket will be created and your data -stored. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN (All locations) Region - - "au" - - Australia (All states) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region - ---s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "nl-ams" - - Amsterdam, The Netherlands - - "fr-par" - - Paris, France - - "pl-waw" - - Warsaw, Poland - ---s3-region - -Region to connect to. - the location where your bucket will be created -and your data stored. Need bo be same with your endpoint. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "af-south-1" - - AF-Johannesburg - - "ap-southeast-2" - - AP-Bangkok - - "ap-southeast-3" - - AP-Singapore - - "cn-east-3" - - CN East-Shanghai1 - - "cn-east-2" - - CN East-Shanghai2 - - "cn-north-1" - - CN North-Beijing1 - - "cn-north-4" - - CN North-Beijing4 - - "cn-south-1" - - CN South-Guangzhou - - "ap-southeast-1" - - CN-Hong Kong - - "sa-argentina-1" - - LA-Buenos Aires1 - - "sa-peru-1" - - LA-Lima1 - - "na-mexico-1" - - LA-Mexico City1 - - "sa-chile-1" - - LA-Santiago2 - - "sa-brazil-1" - - LA-Sao Paulo1 - - "ru-northwest-2" - - RU-Moscow2 - ---s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Cloudflare -- Type: string -- Required: false -- Examples: - - "auto" - - R2 buckets are automatically distributed across Cloudflare's - data centers for low latency. - ---s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - The default endpoint - a good choice if you are unsure. - - East China Region 1. - - Needs location constraint cn-east-1. - - "cn-east-2" - - East China Region 2. - - Needs location constraint cn-east-2. - - "cn-north-1" - - North China Region 1. - - Needs location constraint cn-north-1. - - "cn-south-1" - - South China Region 1. - - Needs location constraint cn-south-1. - - "us-north-1" - - North America Region. - - Needs location constraint us-north-1. - - "ap-southeast-1" - - Southeast Asia Region 1. - - Needs location constraint ap-southeast-1. - - "ap-northeast-1" - - Northeast Asia Region 1. - - Needs location constraint ap-northeast-1. - ---s3-region - -Region where your bucket will be created and your data stored. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "de" - - Frankfurt, Germany - - "eu-central-2" - - Berlin, Germany - - "eu-south-2" - - Logrono, Spain - ---s3-region - -Region to connect to. - -Leave blank if you are using an S3 clone and you don't have a region. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: - !AWS,Alibaba,ChinaMobile,Cloudflare,IONOS,ArvanCloud,Liara,Qiniu,RackCorp,Scaleway,Storj,TencentCOS,HuaweiOBS,IDrive -- Type: string -- Required: false -- Examples: - - "" - - Use this if unsure. - - Will use v4 signatures and an empty region. - - "other-v2-signature" - - Use this only if v4 signatures don't work. - - E.g. pre Jewel/v10 CEPH. - --s3-endpoint Endpoint for S3 API. @@ -18335,630 +21911,6 @@ Properties: - Type: string - Required: false ---s3-endpoint - -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "eos-wuxi-1.cmecloud.cn" - - The default endpoint - a good choice if you are unsure. - - East China (Suzhou) - - "eos-jinan-1.cmecloud.cn" - - East China (Jinan) - - "eos-ningbo-1.cmecloud.cn" - - East China (Hangzhou) - - "eos-shanghai-1.cmecloud.cn" - - East China (Shanghai-1) - - "eos-zhengzhou-1.cmecloud.cn" - - Central China (Zhengzhou) - - "eos-hunan-1.cmecloud.cn" - - Central China (Changsha-1) - - "eos-zhuzhou-1.cmecloud.cn" - - Central China (Changsha-2) - - "eos-guangzhou-1.cmecloud.cn" - - South China (Guangzhou-2) - - "eos-dongguan-1.cmecloud.cn" - - South China (Guangzhou-3) - - "eos-beijing-1.cmecloud.cn" - - North China (Beijing-1) - - "eos-beijing-2.cmecloud.cn" - - North China (Beijing-2) - - "eos-beijing-4.cmecloud.cn" - - North China (Beijing-3) - - "eos-huhehaote-1.cmecloud.cn" - - North China (Huhehaote) - - "eos-chengdu-1.cmecloud.cn" - - Southwest China (Chengdu) - - "eos-chongqing-1.cmecloud.cn" - - Southwest China (Chongqing) - - "eos-guiyang-1.cmecloud.cn" - - Southwest China (Guiyang) - - "eos-xian-1.cmecloud.cn" - - Nouthwest China (Xian) - - "eos-yunnan.cmecloud.cn" - - Yunnan China (Kunming) - - "eos-yunnan-2.cmecloud.cn" - - Yunnan China (Kunming-2) - - "eos-tianjin-1.cmecloud.cn" - - Tianjin China (Tianjin) - - "eos-jilin-1.cmecloud.cn" - - Jilin China (Changchun) - - "eos-hubei-1.cmecloud.cn" - - Hubei China (Xiangyan) - - "eos-jiangxi-1.cmecloud.cn" - - Jiangxi China (Nanchang) - - "eos-gansu-1.cmecloud.cn" - - Gansu China (Lanzhou) - - "eos-shanxi-1.cmecloud.cn" - - Shanxi China (Taiyuan) - - "eos-liaoning-1.cmecloud.cn" - - Liaoning China (Shenyang) - - "eos-hebei-1.cmecloud.cn" - - Hebei China (Shijiazhuang) - - "eos-fujian-1.cmecloud.cn" - - Fujian China (Xiamen) - - "eos-guangxi-1.cmecloud.cn" - - Guangxi China (Nanning) - - "eos-anhui-1.cmecloud.cn" - - Anhui China (Huainan) - ---s3-endpoint - -Endpoint for Arvan Cloud Object Storage (AOS) API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "s3.ir-thr-at1.arvanstorage.com" - - The default endpoint - a good choice if you are unsure. - - Tehran Iran (Asiatech) - - "s3.ir-tbz-sh1.arvanstorage.com" - - Tabriz Iran (Shahriar) - ---s3-endpoint - -Endpoint for IBM COS S3 API. - -Specify if using an IBM COS On Premise. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "s3.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Endpoint - - "s3.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Endpoint - - "s3.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Endpoint - - "s3.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Endpoint - - "s3.private.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Private Endpoint - - "s3.private.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Private Endpoint - - "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Private Endpoint - - "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Private Endpoint - - "s3.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Endpoint - - "s3.private.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Private Endpoint - - "s3.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Endpoint - - "s3.private.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Private Endpoint - - "s3.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Endpoint - - "s3.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Endpoint - - "s3.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Endpoint - - "s3.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Endpoint - - "s3.private.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Private Endpoint - - "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Private Endpoint - - "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Private Endpoint - - "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Private Endpoint - - "s3.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Endpoint - - "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Private Endpoint - - "s3.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Endpoint - - "s3.private.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Private Endpoint - - "s3.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Endpoint - - "s3.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Endpoint - - "s3.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Endpoint - - "s3.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Endpoint - - "s3.private.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Private Endpoint - - "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Private Endpoint - - "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Private Endpoint - - "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Private Endpoint - - "s3.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Endpoint - - "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Private Endpoint - - "s3.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Endpoint - - "s3.private.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Private Endpoint - - "s3.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Endpoint - - "s3.private.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Private Endpoint - - "s3.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Endpoint - - "s3.private.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Private Endpoint - - "s3.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Endpoint - - "s3.private.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Private Endpoint - - "s3.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Endpoint - - "s3.private.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Private Endpoint - - "s3.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Endpoint - - "s3.private.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Private Endpoint - - "s3.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Endpoint - - "s3.private.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Private Endpoint - - "s3.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Endpoint - - "s3.private.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Private Endpoint - - "s3.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Endpoint - - "s3.private.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Private Endpoint - - "s3.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Endpoint - - "s3.private.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Private Endpoint - - "s3.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Endpoint - - "s3.private.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Private Endpoint - - "s3.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Endpoint - - "s3.private.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Private Endpoint - - "s3.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Endpoint - - "s3.private.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Private Endpoint - - "s3.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Endpoint - - "s3.private.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Private Endpoint - ---s3-endpoint - -Endpoint for IONOS S3 Object Storage. - -Specify the endpoint from the same region. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "s3-eu-central-1.ionoscloud.com" - - Frankfurt, Germany - - "s3-eu-central-2.ionoscloud.com" - - Berlin, Germany - - "s3-eu-south-2.ionoscloud.com" - - Logrono, Spain - ---s3-endpoint - -Endpoint for Liara Object Storage API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "storage.iran.liara.space" - - The default endpoint - - Iran - ---s3-endpoint - -Endpoint for OSS API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "oss-accelerate.aliyuncs.com" - - Global Accelerate - - "oss-accelerate-overseas.aliyuncs.com" - - Global Accelerate (outside mainland China) - - "oss-cn-hangzhou.aliyuncs.com" - - East China 1 (Hangzhou) - - "oss-cn-shanghai.aliyuncs.com" - - East China 2 (Shanghai) - - "oss-cn-qingdao.aliyuncs.com" - - North China 1 (Qingdao) - - "oss-cn-beijing.aliyuncs.com" - - North China 2 (Beijing) - - "oss-cn-zhangjiakou.aliyuncs.com" - - North China 3 (Zhangjiakou) - - "oss-cn-huhehaote.aliyuncs.com" - - North China 5 (Hohhot) - - "oss-cn-wulanchabu.aliyuncs.com" - - North China 6 (Ulanqab) - - "oss-cn-shenzhen.aliyuncs.com" - - South China 1 (Shenzhen) - - "oss-cn-heyuan.aliyuncs.com" - - South China 2 (Heyuan) - - "oss-cn-guangzhou.aliyuncs.com" - - South China 3 (Guangzhou) - - "oss-cn-chengdu.aliyuncs.com" - - West China 1 (Chengdu) - - "oss-cn-hongkong.aliyuncs.com" - - Hong Kong (Hong Kong) - - "oss-us-west-1.aliyuncs.com" - - US West 1 (Silicon Valley) - - "oss-us-east-1.aliyuncs.com" - - US East 1 (Virginia) - - "oss-ap-southeast-1.aliyuncs.com" - - Southeast Asia Southeast 1 (Singapore) - - "oss-ap-southeast-2.aliyuncs.com" - - Asia Pacific Southeast 2 (Sydney) - - "oss-ap-southeast-3.aliyuncs.com" - - Southeast Asia Southeast 3 (Kuala Lumpur) - - "oss-ap-southeast-5.aliyuncs.com" - - Asia Pacific Southeast 5 (Jakarta) - - "oss-ap-northeast-1.aliyuncs.com" - - Asia Pacific Northeast 1 (Japan) - - "oss-ap-south-1.aliyuncs.com" - - Asia Pacific South 1 (Mumbai) - - "oss-eu-central-1.aliyuncs.com" - - Central Europe 1 (Frankfurt) - - "oss-eu-west-1.aliyuncs.com" - - West Europe (London) - - "oss-me-east-1.aliyuncs.com" - - Middle East 1 (Dubai) - ---s3-endpoint - -Endpoint for OBS API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "obs.af-south-1.myhuaweicloud.com" - - AF-Johannesburg - - "obs.ap-southeast-2.myhuaweicloud.com" - - AP-Bangkok - - "obs.ap-southeast-3.myhuaweicloud.com" - - AP-Singapore - - "obs.cn-east-3.myhuaweicloud.com" - - CN East-Shanghai1 - - "obs.cn-east-2.myhuaweicloud.com" - - CN East-Shanghai2 - - "obs.cn-north-1.myhuaweicloud.com" - - CN North-Beijing1 - - "obs.cn-north-4.myhuaweicloud.com" - - CN North-Beijing4 - - "obs.cn-south-1.myhuaweicloud.com" - - CN South-Guangzhou - - "obs.ap-southeast-1.myhuaweicloud.com" - - CN-Hong Kong - - "obs.sa-argentina-1.myhuaweicloud.com" - - LA-Buenos Aires1 - - "obs.sa-peru-1.myhuaweicloud.com" - - LA-Lima1 - - "obs.na-mexico-1.myhuaweicloud.com" - - LA-Mexico City1 - - "obs.sa-chile-1.myhuaweicloud.com" - - LA-Santiago2 - - "obs.sa-brazil-1.myhuaweicloud.com" - - LA-Sao Paulo1 - - "obs.ru-northwest-2.myhuaweicloud.com" - - RU-Moscow2 - ---s3-endpoint - -Endpoint for Scaleway Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "s3.nl-ams.scw.cloud" - - Amsterdam Endpoint - - "s3.fr-par.scw.cloud" - - Paris Endpoint - - "s3.pl-waw.scw.cloud" - - Warsaw Endpoint - ---s3-endpoint - -Endpoint for StackPath Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: StackPath -- Type: string -- Required: false -- Examples: - - "s3.us-east-2.stackpathstorage.com" - - US East Endpoint - - "s3.us-west-1.stackpathstorage.com" - - US West Endpoint - - "s3.eu-central-1.stackpathstorage.com" - - EU Endpoint - ---s3-endpoint - -Endpoint for Storj Gateway. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Storj -- Type: string -- Required: false -- Examples: - - "gateway.storjshare.io" - - Global Hosted Gateway - ---s3-endpoint - -Endpoint for Tencent COS API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "cos.ap-beijing.myqcloud.com" - - Beijing Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-shanghai.myqcloud.com" - - Shanghai Region - - "cos.ap-guangzhou.myqcloud.com" - - Guangzhou Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-chengdu.myqcloud.com" - - Chengdu Region - - "cos.ap-chongqing.myqcloud.com" - - Chongqing Region - - "cos.ap-hongkong.myqcloud.com" - - Hong Kong (China) Region - - "cos.ap-singapore.myqcloud.com" - - Singapore Region - - "cos.ap-mumbai.myqcloud.com" - - Mumbai Region - - "cos.ap-seoul.myqcloud.com" - - Seoul Region - - "cos.ap-bangkok.myqcloud.com" - - Bangkok Region - - "cos.ap-tokyo.myqcloud.com" - - Tokyo Region - - "cos.na-siliconvalley.myqcloud.com" - - Silicon Valley Region - - "cos.na-ashburn.myqcloud.com" - - Virginia Region - - "cos.na-toronto.myqcloud.com" - - Toronto Region - - "cos.eu-frankfurt.myqcloud.com" - - Frankfurt Region - - "cos.eu-moscow.myqcloud.com" - - Moscow Region - - "cos.accelerate.myqcloud.com" - - Use Tencent COS Accelerate Endpoint - ---s3-endpoint - -Endpoint for RackCorp Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "s3.rackcorp.com" - - Global (AnyCast) Endpoint - - "au.s3.rackcorp.com" - - Australia (Anycast) Endpoint - - "au-nsw.s3.rackcorp.com" - - Sydney (Australia) Endpoint - - "au-qld.s3.rackcorp.com" - - Brisbane (Australia) Endpoint - - "au-vic.s3.rackcorp.com" - - Melbourne (Australia) Endpoint - - "au-wa.s3.rackcorp.com" - - Perth (Australia) Endpoint - - "ph.s3.rackcorp.com" - - Manila (Philippines) Endpoint - - "th.s3.rackcorp.com" - - Bangkok (Thailand) Endpoint - - "hk.s3.rackcorp.com" - - HK (Hong Kong) Endpoint - - "mn.s3.rackcorp.com" - - Ulaanbaatar (Mongolia) Endpoint - - "kg.s3.rackcorp.com" - - Bishkek (Kyrgyzstan) Endpoint - - "id.s3.rackcorp.com" - - Jakarta (Indonesia) Endpoint - - "jp.s3.rackcorp.com" - - Tokyo (Japan) Endpoint - - "sg.s3.rackcorp.com" - - SG (Singapore) Endpoint - - "de.s3.rackcorp.com" - - Frankfurt (Germany) Endpoint - - "us.s3.rackcorp.com" - - USA (AnyCast) Endpoint - - "us-east-1.s3.rackcorp.com" - - New York (USA) Endpoint - - "us-west-1.s3.rackcorp.com" - - Freemont (USA) Endpoint - - "nz.s3.rackcorp.com" - - Auckland (New Zealand) Endpoint - ---s3-endpoint - -Endpoint for Qiniu Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "s3-cn-east-1.qiniucs.com" - - East China Endpoint 1 - - "s3-cn-east-2.qiniucs.com" - - East China Endpoint 2 - - "s3-cn-north-1.qiniucs.com" - - North China Endpoint 1 - - "s3-cn-south-1.qiniucs.com" - - South China Endpoint 1 - - "s3-us-north-1.qiniucs.com" - - North America Endpoint 1 - - "s3-ap-southeast-1.qiniucs.com" - - Southeast Asia Endpoint 1 - - "s3-ap-northeast-1.qiniucs.com" - - Northeast Asia Endpoint 1 - ---s3-endpoint - -Endpoint for S3 API. - -Required when using an S3 clone. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: - !AWS,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,Liara,ArvanCloud,Scaleway,StackPath,Storj,RackCorp,Qiniu -- Type: string -- Required: false -- Examples: - - "objects-us-east-1.dream.io" - - Dream Objects endpoint - - "syd1.digitaloceanspaces.com" - - DigitalOcean Spaces Sydney 1 - - "sfo3.digitaloceanspaces.com" - - DigitalOcean Spaces San Francisco 3 - - "fra1.digitaloceanspaces.com" - - DigitalOcean Spaces Frankfurt 1 - - "nyc3.digitaloceanspaces.com" - - DigitalOcean Spaces New York 3 - - "ams3.digitaloceanspaces.com" - - DigitalOcean Spaces Amsterdam 3 - - "sgp1.digitaloceanspaces.com" - - DigitalOcean Spaces Singapore 1 - - "localhost:8333" - - SeaweedFS S3 localhost - - "s3.us-east-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US East 1 (Virginia) - - "s3.us-west-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US West 1 (California) - - "s3.ap-southeast-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud AP Southeast 1 (Singapore) - - "s3.wasabisys.com" - - Wasabi US East 1 (N. Virginia) - - "s3.us-east-2.wasabisys.com" - - Wasabi US East 2 (N. Virginia) - - "s3.us-central-1.wasabisys.com" - - Wasabi US Central 1 (Texas) - - "s3.us-west-1.wasabisys.com" - - Wasabi US West 1 (Oregon) - - "s3.ca-central-1.wasabisys.com" - - Wasabi CA Central 1 (Toronto) - - "s3.eu-central-1.wasabisys.com" - - Wasabi EU Central 1 (Amsterdam) - - "s3.eu-central-2.wasabisys.com" - - Wasabi EU Central 2 (Frankfurt) - - "s3.eu-west-1.wasabisys.com" - - Wasabi EU West 1 (London) - - "s3.eu-west-2.wasabisys.com" - - Wasabi EU West 2 (Paris) - - "s3.ap-northeast-1.wasabisys.com" - - Wasabi AP Northeast 1 (Tokyo) endpoint - - "s3.ap-northeast-2.wasabisys.com" - - Wasabi AP Northeast 2 (Osaka) endpoint - - "s3.ap-southeast-1.wasabisys.com" - - Wasabi AP Southeast 1 (Singapore) - - "s3.ap-southeast-2.wasabisys.com" - - Wasabi AP Southeast 2 (Sydney) - - "storage.iran.liara.space" - - Liara Iran endpoint - - "s3.ir-thr-at1.arvanstorage.com" - - ArvanCloud Tehran Iran (Asiatech) endpoint - --s3-location-constraint Location constraint - must be set to match the Region. @@ -19024,275 +21976,6 @@ Properties: - "us-gov-west-1" - AWS GovCloud (US) Region ---s3-location-constraint - -Location constraint - must match endpoint. - -Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "wuxi1" - - East China (Suzhou) - - "jinan1" - - East China (Jinan) - - "ningbo1" - - East China (Hangzhou) - - "shanghai1" - - East China (Shanghai-1) - - "zhengzhou1" - - Central China (Zhengzhou) - - "hunan1" - - Central China (Changsha-1) - - "zhuzhou1" - - Central China (Changsha-2) - - "guangzhou1" - - South China (Guangzhou-2) - - "dongguan1" - - South China (Guangzhou-3) - - "beijing1" - - North China (Beijing-1) - - "beijing2" - - North China (Beijing-2) - - "beijing4" - - North China (Beijing-3) - - "huhehaote1" - - North China (Huhehaote) - - "chengdu1" - - Southwest China (Chengdu) - - "chongqing1" - - Southwest China (Chongqing) - - "guiyang1" - - Southwest China (Guiyang) - - "xian1" - - Nouthwest China (Xian) - - "yunnan" - - Yunnan China (Kunming) - - "yunnan2" - - Yunnan China (Kunming-2) - - "tianjin1" - - Tianjin China (Tianjin) - - "jilin1" - - Jilin China (Changchun) - - "hubei1" - - Hubei China (Xiangyan) - - "jiangxi1" - - Jiangxi China (Nanchang) - - "gansu1" - - Gansu China (Lanzhou) - - "shanxi1" - - Shanxi China (Taiyuan) - - "liaoning1" - - Liaoning China (Shenyang) - - "hebei1" - - Hebei China (Shijiazhuang) - - "fujian1" - - Fujian China (Xiamen) - - "guangxi1" - - Guangxi China (Nanning) - - "anhui1" - - Anhui China (Huainan) - ---s3-location-constraint - -Location constraint - must match endpoint. - -Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "ir-thr-at1" - - Tehran Iran (Asiatech) - - "ir-tbz-sh1" - - Tabriz Iran (Shahriar) - ---s3-location-constraint - -Location constraint - must match endpoint when using IBM Cloud Public. - -For on-prem COS, do not make a selection from this list, hit enter. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "us-standard" - - US Cross Region Standard - - "us-vault" - - US Cross Region Vault - - "us-cold" - - US Cross Region Cold - - "us-flex" - - US Cross Region Flex - - "us-east-standard" - - US East Region Standard - - "us-east-vault" - - US East Region Vault - - "us-east-cold" - - US East Region Cold - - "us-east-flex" - - US East Region Flex - - "us-south-standard" - - US South Region Standard - - "us-south-vault" - - US South Region Vault - - "us-south-cold" - - US South Region Cold - - "us-south-flex" - - US South Region Flex - - "eu-standard" - - EU Cross Region Standard - - "eu-vault" - - EU Cross Region Vault - - "eu-cold" - - EU Cross Region Cold - - "eu-flex" - - EU Cross Region Flex - - "eu-gb-standard" - - Great Britain Standard - - "eu-gb-vault" - - Great Britain Vault - - "eu-gb-cold" - - Great Britain Cold - - "eu-gb-flex" - - Great Britain Flex - - "ap-standard" - - APAC Standard - - "ap-vault" - - APAC Vault - - "ap-cold" - - APAC Cold - - "ap-flex" - - APAC Flex - - "mel01-standard" - - Melbourne Standard - - "mel01-vault" - - Melbourne Vault - - "mel01-cold" - - Melbourne Cold - - "mel01-flex" - - Melbourne Flex - - "tor01-standard" - - Toronto Standard - - "tor01-vault" - - Toronto Vault - - "tor01-cold" - - Toronto Cold - - "tor01-flex" - - Toronto Flex - ---s3-location-constraint - -Location constraint - the location where your bucket will be located and -your data stored. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN Region - - "au" - - Australia (All locations) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region - ---s3-location-constraint - -Location constraint - must be set to match the Region. - -Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - East China Region 1 - - "cn-east-2" - - East China Region 2 - - "cn-north-1" - - North China Region 1 - - "cn-south-1" - - South China Region 1 - - "us-north-1" - - North America Region 1 - - "ap-southeast-1" - - Southeast Asia Region 1 - - "ap-northeast-1" - - Northeast Asia Region 1 - ---s3-location-constraint - -Location constraint - must be set to match the Region. - -Leave blank if not sure. Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: - !AWS,Alibaba,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Liara,ArvanCloud,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS -- Type: string -- Required: false - --s3-acl Canned ACL used when creating buckets and storing or copying objects. @@ -19313,7 +21996,7 @@ Properties: - Config: acl - Env Var: RCLONE_S3_ACL -- Provider: !Storj,Cloudflare +- Provider: !Storj,Synology,Cloudflare - Type: string - Required: false - Examples: @@ -19433,149 +22116,14 @@ Properties: - "GLACIER_IR" - Glacier Instant Retrieval storage class ---s3-storage-class - -The storage class to use when storing new objects in OSS. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode - ---s3-storage-class - -The storage class to use when storing new objects in ChinaMobile. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode - ---s3-storage-class - -The storage class to use when storing new objects in Liara - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - ---s3-storage-class - -The storage class to use when storing new objects in ArvanCloud. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - ---s3-storage-class - -The storage class to use when storing new objects in Tencent COS. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "ARCHIVE" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode - ---s3-storage-class - -The storage class to use when storing new objects in S3. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "" - - Default. - - "STANDARD" - - The Standard class for any upload. - - Suitable for on-demand content like streaming or CDN. - - "GLACIER" - - Archived storage. - - Prices are lower, but it needs to be restored first to be - accessed. - ---s3-storage-class - -The storage class to use when storing new objects in Qiniu. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - - "LINE" - - Infrequent access storage mode - - "GLACIER" - - Archive storage mode - - "DEEP_ARCHIVE" - - Deep archive storage mode - Advanced options Here are the Advanced options specific to s3 (Amazon S3 Compliant -Storage Providers including AWS, Alibaba, Ceph, China Mobile, -Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, -IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, -Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi). +Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, +Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, +IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, +RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, +TencentCOS, Wasabi, Qiniu and others). --s3-bucket-acl @@ -20065,16 +22613,12 @@ Properties: - Config: encoding - Env Var: RCLONE_S3_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot --s3-memory-pool-flush-time -How often internal memory buffer pools will be flushed. - -Uploads which requires additional buffers (f.e multipart) will use -memory pool for allocations. This option controls how often unused -buffers will be removed from the pool. +How often internal memory buffer pools will be flushed. (no longer used) Properties: @@ -20085,7 +22629,7 @@ Properties: --s3-memory-pool-use-mmap -Whether to use mmap buffers in internal memory pool. +Whether to use mmap buffers in internal memory pool. (no longer used) Properties: @@ -20126,6 +22670,21 @@ Properties: - Type: string - Required: false +--s3-directory-markers + +Upload an empty object with a trailing slash when a new directory is +created + +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with "/", to persist the folder. + +Properties: + +- Config: directory_markers +- Env Var: RCLONE_S3_DIRECTORY_MARKERS +- Type: bool +- Default: false + --s3-use-multipart-etag Whether to use ETag in multipart uploads for verification @@ -20238,6 +22797,29 @@ Properties: - Type: Tristate - Default: unset +--s3-use-accept-encoding-gzip + +Whether to send Accept-Encoding: gzip header. + +By default, rclone will append Accept-Encoding: gzip to the request to +download compressed objects whenever possible. + +However some providers such as Google Cloud Storage may alter the HTTP +headers, breaking the signature of the request. + +A symptom of this would be receiving errors like + + SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. + +In this case, you might want to try disabling this option. + +Properties: + +- Config: use_accept_encoding_gzip +- Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP +- Type: Tristate +- Default: unset + --s3-no-system-metadata Suppress setting and reading of system metadata @@ -20263,6 +22845,55 @@ Properties: - Type: string - Required: false +--s3-use-already-exists + +Set if rclone should report BucketAlreadyExists errors on bucket +creation. + +At some point during the evolution of the s3 protocol, AWS started +returning an AlreadyOwnedByYou error when attempting to create a bucket +that the user already owned, rather than a BucketAlreadyExists error. + +Unfortunately exactly what has been implemented by s3 clones is a little +inconsistent, some return AlreadyOwnedByYou, some return +BucketAlreadyExists and some return no error at all. + +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless --s3-no-check-bucket is +used). + +If rclone knows the provider can return AlreadyOwnedByYou or returns no +error then it can report BucketAlreadyExists errors when the user +attempts to create a bucket not owned by them. Otherwise rclone ignores +the BucketAlreadyExists error which can lead to confusion. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + +Properties: + +- Config: use_already_exists +- Env Var: RCLONE_S3_USE_ALREADY_EXISTS +- Type: Tristate +- Default: unset + +--s3-use-multipart-uploads + +Set if rclone should use multipart uploads. + +You can change this if you want to disable the use of multipart uploads. +This shouldn't be necessary in normal operation. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + +Properties: + +- Config: use_multipart_uploads +- Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS +- Type: Tristate +- Default: unset + Metadata User metadata is stored as x-amz-meta- keys. S3 metadata keys are case @@ -20326,18 +22957,18 @@ normal storage. Usage Examples: - rclone backend restore s3:bucket/path/to/object [-o priority=PRIORITY] [-o lifetime=DAYS] - rclone backend restore s3:bucket/path/to/directory [-o priority=PRIORITY] [-o lifetime=DAYS] - rclone backend restore s3:bucket [-o priority=PRIORITY] [-o lifetime=DAYS] + rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags - rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard + rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 All the objects shown will be marked for restore, then - rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard + rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 It returns a list of status dictionaries with Remote and Status keys. The Status will be OK if it was successful or an error message if not. @@ -20345,11 +22976,11 @@ The Status will be OK if it was successful or an error message if not. [ { "Status": "OK", - "Path": "test.txt" + "Remote": "test.txt" }, { "Status": "OK", - "Path": "test/file4.txt" + "Remote": "test/file4.txt" } ] @@ -20359,6 +22990,52 @@ Options: - "lifetime": Lifetime of the active copy in days - "priority": Priority of restore: Standard|Expedited|Bulk +restore-status + +Show the restore status for objects being restored from GLACIER to +normal storage + + rclone backend restore-status remote: [options] [+] + +This command can be used to show the status for objects being restored +from GLACIER to normal storage. + +Usage Examples: + + rclone backend restore-status s3:bucket/path/to/object + rclone backend restore-status s3:bucket/path/to/directory + rclone backend restore-status -o all s3:bucket/path/to/directory + +This command does not obey the filters. + +It returns a list of status dictionaries. + + [ + { + "Remote": "file.txt", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": true, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "GLACIER" + }, + { + "Remote": "test.pdf", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": false, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "DEEP_ARCHIVE" + } + ] + +Options: + +- "all": if set then show all objects, not just ones with restore + status + list-multipart-uploads List the unfinished multipart uploads @@ -20448,6 +23125,29 @@ It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning has been enabled the status can't be set back to "Unversioned". +set + +Set command for updating the config parameters. + + rclone backend set remote: [options] [+] + +This set command can be used to update the config parameters for a +running s3 backend. + +Usage Examples: + + rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X + +The option keys are named as they are in the config file. + +This rebuilds the connection to the s3 backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn't return anything. + Anonymous access to public buckets If you want to use rclone to access a public bucket, configure with a @@ -20582,7 +23282,7 @@ of a bucket publicly. Type of storage to configure. Choose a number from below, or type in your own value. ... - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) ... Storage> s3 @@ -20672,6 +23372,28 @@ in your config: server_side_encryption = storage_class = +Google Cloud Storage + +GoogleCloudStorage is an S3-interoperable object storage service from +Google Cloud Platform. + +To connect to Google Cloud Storage you will need an access key and +secret key. These can be retrieved by creating an HMAC key. + + [gs] + type = s3 + provider = GCS + access_key_id = your_access_key + secret_access_key = your_secret_key + endpoint = https://storage.googleapis.com + +Note that --s3-versions does not work with GCS when it needs to do +directory paging. Rclone will return the error: + + s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker + +This is Google bug #312292516. + DigitalOcean Spaces Spaces is an S3-interoperable object storage service from cloud provider @@ -20751,7 +23473,7 @@ Or you can also configure via the interactive command line: Type of storage to configure. Choose a number from below, or type in your own value. [snip] - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) [snip] Storage> 5 @@ -21042,7 +23764,7 @@ This will guide you through an interactive setup process. Type of storage to configure. Choose a number from below, or type in your own value. [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) [snip] Storage> s3 @@ -21148,7 +23870,7 @@ Type s3 to choose the connection type: Type of storage to configure. Choose a number from below, or type in your own value. [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) [snip] Storage> s3 @@ -21382,7 +24104,7 @@ To configure access to Qiniu Kodo, follow the steps below: \ (alias) 4 / Amazon Drive \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi \ (s3) [snip] Storage> s3 @@ -21566,6 +24288,29 @@ Your config should end up looking a bit like this: endpoint = s3.rackcorp.com location_constraint = au-nsw +Rclone Serve S3 + +Rclone can serve any remote over the S3 protocol. For details see the +rclone serve s3 documentation. + +For example, to serve remote:path over s3, run the server like this: + + rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path + +This will be compatible with an rclone remote which is defined like +this: + + [serves3] + type = s3 + provider = Rclone + endpoint = http://127.0.0.1:8080/ + access_key_id = ACCESS_KEY_ID + secret_access_key = SECRET_ACCESS_KEY + use_multipart_uploads = false + +Note that setting disable_multipart_uploads = true is to work around a +bug which will be fixed in due course. + Scaleway Scaleway The Object Storage platform allows you to store anything from @@ -22230,6 +24975,119 @@ This will guide you through an interactive setup process. d) Delete this remote y/e/d> y +Leviia Cloud Object Storage + +Leviia Object Storage, backup and secure your data in a 100% French +cloud, independent of GAFAM.. + +To configure access to Leviia, follow the steps below: + +1. Run rclone config and select n for a new remote. + + rclone config + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + +2. Give the name of the configuration. For example, name it 'leviia'. + + name> leviia + +3. Select s3 storage. + + Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) + [snip] + Storage> s3 + +4. Select Leviia provider. + + Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + [snip] + 15 / Leviia Object Storage + \ (Leviia) + [snip] + provider> Leviia + +5. Enter your SecretId and SecretKey of Leviia. + + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" + env_auth> 1 + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + access_key_id> ZnIx.xxxxxxxxxxxxxxx + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + secret_access_key> xxxxxxxxxxx + +6. Select endpoint for Leviia. + + / The default endpoint + 1 | Leviia. + \ (s3.leviia.com) + [snip] + endpoint> 1 + +7. Choose acl. + + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + [snip] + acl> 1 + Edit advanced config? (y/n) + y) Yes + n) No (default) + y/n> n + Remote config + -------------------- + [leviia] + - type: s3 + - provider: Leviia + - access_key_id: ZnIx.xxxxxxx + - secret_access_key: xxxxxxxx + - endpoint: s3.leviia.com + - acl: private + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + Current remotes: + + Name Type + ==== ==== + leviia s3 + Liara Here is an example of making a Liara Object Storage configuration. First @@ -22327,6 +25185,135 @@ This will leave the config file looking like this. server_side_encryption = storage_class = +Linode + +Here is an example of making a Linode Object Storage configuration. +First run: + + rclone config + +This will guide you through an interactive setup process. + + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + + Enter name for new remote. + name> linode + + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others + \ (s3) + [snip] + Storage> s3 + + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / Linode Object Storage + \ (Linode) + [snip] + provider> Linode + + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Choose a number from below, or type in your own boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> + + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> ACCESS_KEY + + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> SECRET_ACCESS_KEY + + Option endpoint. + Endpoint for Linode Object Storage API. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Atlanta, GA (USA), us-southeast-1 + \ (us-southeast-1.linodeobjects.com) + 2 / Chicago, IL (USA), us-ord-1 + \ (us-ord-1.linodeobjects.com) + 3 / Frankfurt (Germany), eu-central-1 + \ (eu-central-1.linodeobjects.com) + 4 / Milan (Italy), it-mil-1 + \ (it-mil-1.linodeobjects.com) + 5 / Newark, NJ (USA), us-east-1 + \ (us-east-1.linodeobjects.com) + 6 / Paris (France), fr-par-1 + \ (fr-par-1.linodeobjects.com) + 7 / Seattle, WA (USA), us-sea-1 + \ (us-sea-1.linodeobjects.com) + 8 / Singapore ap-south-1 + \ (ap-south-1.linodeobjects.com) + 9 / Stockholm (Sweden), se-sto-1 + \ (se-sto-1.linodeobjects.com) + 10 / Washington, DC, (USA), us-iad-1 + \ (us-iad-1.linodeobjects.com) + endpoint> 3 + + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + If the acl is an empty string then no X-Amz-Acl: header is added and + the default (private) will be used. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + [snip] + acl> + + Edit advanced config? + y) Yes + n) No (default) + y/n> n + + Configuration complete. + Options: + - type: s3 + - provider: Linode + - access_key_id: ACCESS_KEY + - secret_access_key: SECRET_ACCESS_KEY + - endpoint: eu-central-1.linodeobjects.com + Keep this "linode" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + +This will leave the config file looking like this. + + [linode] + type = s3 + provider = Linode + access_key_id = ACCESS_KEY + secret_access_key = SECRET_ACCESS_KEY + endpoint = eu-central-1.linodeobjects.com + ArvanCloud ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional @@ -22561,6 +25548,159 @@ For Netease NOS configure as per the configurator rclone config setting the provider Netease. This will automatically set force_path_style = false which is necessary for it to run properly. +Petabox + +Here is an example of making a Petabox configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + + No remotes found, make a new one? + n) New remote + s) Set configuration password + n/s> n + + Enter name for new remote. + name> My Petabox Storage + + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + XX / Amazon S3 Compliant Storage Providers including AWS, ... + \ "s3" + [snip] + Storage> s3 + + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / Petabox Object Storage + \ (Petabox) + [snip] + provider> Petabox + + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Choose a number from below, or type in your own boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> 1 + + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> YOUR_ACCESS_KEY_ID + + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> YOUR_SECRET_ACCESS_KEY + + Option region. + Region where your bucket will be created and your data stored. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / US East (N. Virginia) + \ (us-east-1) + 2 / Europe (Frankfurt) + \ (eu-central-1) + 3 / Asia Pacific (Singapore) + \ (ap-southeast-1) + 4 / Middle East (Bahrain) + \ (me-south-1) + 5 / South America (São Paulo) + \ (sa-east-1) + region> 1 + + Option endpoint. + Endpoint for Petabox S3 Object Storage. + Specify the endpoint from the same region. + Choose a number from below, or type in your own value. + 1 / US East (N. Virginia) + \ (s3.petabox.io) + 2 / US East (N. Virginia) + \ (s3.us-east-1.petabox.io) + 3 / Europe (Frankfurt) + \ (s3.eu-central-1.petabox.io) + 4 / Asia Pacific (Singapore) + \ (s3.ap-southeast-1.petabox.io) + 5 / Middle East (Bahrain) + \ (s3.me-south-1.petabox.io) + 6 / South America (São Paulo) + \ (s3.sa-east-1.petabox.io) + endpoint> 1 + + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + If the acl is an empty string then no X-Amz-Acl: header is added and + the default (private) will be used. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) + acl> 1 + + Edit advanced config? + y) Yes + n) No (default) + y/n> No + + Configuration complete. + Options: + - type: s3 + - provider: Petabox + - access_key_id: YOUR_ACCESS_KEY_ID + - secret_access_key: YOUR_SECRET_ACCESS_KEY + - region: us-east-1 + - endpoint: s3.petabox.io + Keep this "My Petabox Storage" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + +This will leave the config file looking like this. + + [My Petabox Storage] + type = s3 + provider = Petabox + access_key_id = YOUR_ACCESS_KEY_ID + secret_access_key = YOUR_SECRET_ACCESS_KEY + region = us-east-1 + endpoint = s3.petabox.io + Storj Storj is a decentralized cloud storage which can be used through its @@ -22669,15647 +25809,17359 @@ mfs (most free space) as a member of an rclone union remote. See List of backends that do not support rclone about and rclone about -Backblaze B2 +Synology C2 Object Storage -B2 is Backblaze's cloud storage system. +Synology C2 Object Storage provides a secure, S3-compatible, and +cost-effective cloud storage solution without API request, download +fees, and deletion penalty. -Paths are specified as remote:bucket (or remote: for the lsd command.) -You may put subdirectories in too, e.g. remote:bucket/path/to/dir. - -Configuration +The S3 compatible gateway is configured using rclone config with a type +of s3 and with a provider name of Synology. Here is an example run of +the configurator. -Here is an example of making a b2 configuration. First run +First run: rclone config -This will guide you through an interactive setup process. To -authenticate you will either need your Account ID (a short hex number) -and Master Application Key (a long hex number) OR an Application Key, -which is the recommended method. See below for further details on -generating and using an Application Key. +This will guide you through an interactive setup process. No remotes found, make a new one? n) New remote + s) Set configuration password q) Quit config - n/q> n - name> remote + + n/s/q> n + + Enter name for new remote.1 + name> syno + Type of storage to configure. + Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value - [snip] - XX / Backblaze B2 - \ "b2" - [snip] - Storage> b2 - Account ID or Application Key ID - account> 123456789abc - Application Key - key> 0123456789abcdef0123456789abcdef0123456789 - Endpoint for the service - leave blank normally. - endpoint> - Remote config - -------------------- - [remote] - account = 123456789abc - key = 0123456789abcdef0123456789abcdef0123456789 - endpoint = - -------------------- - y) Yes this is OK + + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ "s3" + + Storage> s3 + + Choose your S3 provider. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 24 / Synology C2 Object Storage + \ (Synology) + + provider> Synology + + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" + + env_auth> 1 + + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + + access_key_id> accesskeyid + + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + + secret_access_key> secretaccesskey + + Region where your data stored. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Europe Region 1 + \ (eu-001) + 2 / Europe Region 2 + \ (eu-002) + 3 / US Region 1 + \ (us-001) + 4 / US Region 2 + \ (us-002) + 5 / Asia (Taiwan) + \ (tw-001) + + region > 1 + + Option endpoint. + Endpoint for Synology C2 Object Storage API. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / EU Endpoint 1 + \ (eu-001.s3.synologyc2.net) + 2 / US Endpoint 1 + \ (us-001.s3.synologyc2.net) + 3 / TW Endpoint 1 + \ (tw-001.s3.synologyc2.net) + + endpoint> 1 + + Option location_constraint. + Location constraint - must be set to match the Region. + Leave blank if not sure. Used when creating buckets only. + Enter a value. Press Enter to leave empty. + location_constraint> + + Edit advanced config? (y/n) + y) Yes + n) No + y/n> y + + Option no_check_bucket. + If set, don't attempt to check the bucket exists or create it. + This can be useful when trying to minimise the number of transactions + rclone does if you know the bucket exists already. + It can also be needed if the user you are using does not have bucket + creation permissions. Before v1.52.0 this would have passed silently + due to a bug. + Enter a boolean value (true or false). Press Enter for the default (true). + + no_check_bucket> true + + Configuration complete. + Options: + - type: s3 + - provider: Synology + - region: eu-001 + - endpoint: eu-001.s3.synologyc2.net + - no_check_bucket: true + Keep this "syno" remote? + y) Yes this is OK (default) e) Edit this remote d) Delete this remote + y/e/d> y -This remote is called remote and can now be used like this + # Backblaze B2 -See all buckets + B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). - rclone lsd remote: + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -Create a new bucket + ## Configuration - rclone mkdir remote:bucket + Here is an example of making a b2 configuration. First run -List the contents of a bucket + rclone config - rclone ls remote:bucket + This will guide you through an interactive setup process. To authenticate + you will either need your Account ID (a short hex number) and Master + Application Key (a long hex number) OR an Application Key, which is the + recommended method. See below for further details on generating and using + an Application Key. -Sync /home/local/directory to the remote bucket, deleting any excess -files in the bucket. +No remotes found, make a new one? n) New remote q) Quit config n/q> n +name> remote Type of storage to configure. Choose a number from below, +or type in your own value [snip] XX / Backblaze B2  "b2" [snip] Storage> +b2 Account ID or Application Key ID account> 123456789abc Application +Key key> 0123456789abcdef0123456789abcdef0123456789 Endpoint for the +service - leave blank normally. endpoint> Remote config +-------------------- [remote] account = 123456789abc key = +0123456789abcdef0123456789abcdef0123456789 endpoint = +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y - rclone sync --interactive /home/local/directory remote:bucket -Application Keys + This remote is called `remote` and can now be used like this -B2 supports multiple Application Keys for different access permission to -B2 Buckets. + See all buckets -You can use these with rclone too; you will need to use rclone version -1.43 or later. + rclone lsd remote: -Follow Backblaze's docs to create an Application Key with the required -permission and add the applicationKeyId as the account and the -Application Key itself as the key. + Create a new bucket -Note that you must put the applicationKeyId as the account – you can't -use the master Account ID. If you try then B2 will return 401 errors. + rclone mkdir remote:bucket ---fast-list + List the contents of a bucket -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. + rclone ls remote:bucket -Modified time + Sync `/home/local/directory` to the remote bucket, deleting any + excess files in the bucket. -The modified time is stored as metadata on the object as -X-Bz-Info-src_last_modified_millis as milliseconds since 1970-01-01 in -the Backblaze standard. Other tools should be able to use this as a -modified time. + rclone sync --interactive /home/local/directory remote:bucket -Modified times are used in syncing and are fully supported. Note that if -a modification time needs to be updated on an object then it will create -a new version of the object. + ### Application Keys -Restricted filename characters + B2 supports multiple [Application Keys for different access permission + to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). -In addition to the default restricted characters set the following -characters are also replaced: + You can use these with rclone too; you will need to use rclone version 1.43 + or later. - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ + Follow Backblaze's docs to create an Application Key with the required + permission and add the `applicationKeyId` as the `account` and the + `Application Key` itself as the `key`. -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Note that you must put the _applicationKeyId_ as the `account` – you + can't use the master Account ID. If you try then B2 will return 401 + errors. -Note that in 2020-05 Backblaze started allowing  characters in file -names. Rclone hasn't changed its encoding as this could cause syncs to -re-transfer files. If you want rclone not to replace  then see the ---b2-encoding flag below and remove the BackSlash from the string. This -can be set in the config. + ### --fast-list -SHA1 checksums + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. -The SHA1 checksums of the files are checked on upload and download and -will be used in the syncing process. + ### Modification times -Large files (bigger than the limit in --b2-upload-cutoff) which are -uploaded in chunks will store their SHA1 on the object as -X-Bz-Info-large_file_sha1 as recommended by Backblaze. + The modification time is stored as metadata on the object as + `X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 + in the Backblaze standard. Other tools should be able to use this as + a modified time. -For a large file to be uploaded with an SHA1 checksum, the source needs -to support SHA1 checksums. The local disk supports SHA1 checksums so -large file transfers from local disk will have an SHA1. See the overview -for exactly which remotes support SHA1. + Modified times are used in syncing and are fully supported. Note that + if a modification time needs to be updated on an object then it will + create a new version of the object. -Sources which don't support SHA1, in particular crypt will upload large -files without SHA1 checksums. This may be fixed in the future (see -#1767). + ### Restricted filename characters -Files sizes below --b2-upload-cutoff will always have an SHA1 regardless -of the source. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -Transfers + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | -Backblaze recommends that you do lots of transfers simultaneously for -maximum speed. In tests from my SSD equipped laptop the optimum setting -is about --transfers 32 though higher numbers may be used for a slight -speed improvement. The optimum number for you may vary depending on your -hardware, how big the files are, how much you want to load your -computer, etc. The default of --transfers 4 is definitely too low for -Backblaze B2 though. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Note that uploading big files (bigger than 200 MiB by default) will use -a 96 MiB RAM buffer by default. There can be at most --transfers of -these in use at any moment, so this sets the upper limit on the memory -used. + Note that in 2020-05 Backblaze started allowing \ characters in file + names. Rclone hasn't changed its encoding as this could cause syncs to + re-transfer files. If you want rclone not to replace \ then see the + `--b2-encoding` flag below and remove the `BackSlash` from the + string. This can be set in the config. -Versions + ### SHA1 checksums -When rclone uploads a new version of a file it creates a new version of -it. Likewise when you delete a file, the old version will be marked -hidden and still be available. Conversely, you may opt in to a "hard -delete" of files with the --b2-hard-delete flag which would permanently -remove the file instead of hiding it. + The SHA1 checksums of the files are checked on upload and download and + will be used in the syncing process. -Old versions of files, where available, are visible using the ---b2-versions flag. + Large files (bigger than the limit in `--b2-upload-cutoff`) which are + uploaded in chunks will store their SHA1 on the object as + `X-Bz-Info-large_file_sha1` as recommended by Backblaze. -It is also possible to view a bucket as it was at a certain point in -time, using the --b2-version-at flag. This will show the file versions -as they were at that time, showing files that have been deleted -afterwards, and hiding files that were created since. + For a large file to be uploaded with an SHA1 checksum, the source + needs to support SHA1 checksums. The local disk supports SHA1 + checksums so large file transfers from local disk will have an SHA1. + See [the overview](https://rclone.org/overview/#features) for exactly which remotes + support SHA1. -If you wish to remove all the old versions then you can use the -rclone cleanup remote:bucket command which will delete all the old -versions of files, leaving the current ones intact. You can also supply -a path and only old versions under that path will be deleted, e.g. -rclone cleanup remote:bucket/path/to/stuff. + Sources which don't support SHA1, in particular `crypt` will upload + large files without SHA1 checksums. This may be fixed in the future + (see [#1767](https://github.com/rclone/rclone/issues/1767)). -Note that cleanup will remove partially uploaded files from the bucket -if they are more than a day old. + Files sizes below `--b2-upload-cutoff` will always have an SHA1 + regardless of the source. -When you purge a bucket, the current and the old versions will be -deleted then the bucket will be deleted. + ### Transfers -However delete will cause the current versions of the files to become -hidden old versions. + Backblaze recommends that you do lots of transfers simultaneously for + maximum speed. In tests from my SSD equipped laptop the optimum + setting is about `--transfers 32` though higher numbers may be used + for a slight speed improvement. The optimum number for you may vary + depending on your hardware, how big the files are, how much you want + to load your computer, etc. The default of `--transfers 4` is + definitely too low for Backblaze B2 though. -Here is a session showing the listing and retrieval of an old version -followed by a cleanup of the old versions. + Note that uploading big files (bigger than 200 MiB by default) will use + a 96 MiB RAM buffer by default. There can be at most `--transfers` of + these in use at any moment, so this sets the upper limit on the memory + used. -Show current version and all the versions with --b2-versions flag. + ### Versions - $ rclone -q ls b2:cleanup-test - 9 one.txt + When rclone uploads a new version of a file it creates a [new version + of it](https://www.backblaze.com/b2/docs/file_versions.html). + Likewise when you delete a file, the old version will be marked hidden + and still be available. Conversely, you may opt in to a "hard delete" + of files with the `--b2-hard-delete` flag which would permanently remove + the file instead of hiding it. - $ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt + Old versions of files, where available, are visible using the + `--b2-versions` flag. -Retrieve an old version + It is also possible to view a bucket as it was at a certain point in time, + using the `--b2-version-at` flag. This will show the file versions as they + were at that time, showing files that have been deleted afterwards, and + hiding files that were created since. - $ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp + If you wish to remove all the old versions then you can use the + `rclone cleanup remote:bucket` command which will delete all the old + versions of files, leaving the current ones intact. You can also + supply a path and only old versions under that path will be deleted, + e.g. `rclone cleanup remote:bucket/path/to/stuff`. - $ ls -l /tmp/one-v2016-07-04-141003-000.txt - -rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt + Note that `cleanup` will remove partially uploaded files from the bucket + if they are more than a day old. -Clean up all the old versions and show that they've gone. + When you `purge` a bucket, the current and the old versions will be + deleted then the bucket will be deleted. - $ rclone -q cleanup b2:cleanup-test + However `delete` will cause the current versions of the files to + become hidden old versions. - $ rclone -q ls b2:cleanup-test - 9 one.txt + Here is a session showing the listing and retrieval of an old + version followed by a `cleanup` of the old versions. - $ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt + Show current version and all the versions with `--b2-versions` flag. -Data usage +$ rclone -q ls b2:cleanup-test 9 one.txt -It is useful to know how many requests are sent to the server in -different scenarios. +$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 +one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 +one-v2016-07-02-155621-000.txt -All copy commands send the following 4 requests: - /b2api/v1/b2_authorize_account - /b2api/v1/b2_create_bucket - /b2api/v1/b2_list_buckets - /b2api/v1/b2_list_file_names + Retrieve an old version -The b2_list_file_names request will be sent once for every 1k files in -the remote path, providing the checksum and modification time of the -listed files. As of version 1.33 issue #818 causes extra requests to be -sent when using B2 with Crypt. When a copy operation does not require -any files to be uploaded, no more requests will be sent. +$ rclone -q --b2-versions copy +b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp -Uploading files that do not require chunking, will send 2 requests per -file upload: +$ ls -l /tmp/one-v2016-07-04-141003-000.txt -rw-rw-r-- 1 ncw ncw 16 Jul +2 17:46 /tmp/one-v2016-07-04-141003-000.txt - /b2api/v1/b2_get_upload_url - /b2api/v1/b2_upload_file/ -Uploading files requiring chunking, will send 2 requests (one each to -start and finish the upload) and another 2 requests for each chunk: + Clean up all the old versions and show that they've gone. - /b2api/v1/b2_start_large_file - /b2api/v1/b2_get_upload_part_url - /b2api/v1/b2_upload_part/ - /b2api/v1/b2_finish_large_file +$ rclone -q cleanup b2:cleanup-test -Versions +$ rclone -q ls b2:cleanup-test 9 one.txt -Versions can be viewed with the --b2-versions flag. When it is set -rclone will show and act on older versions of files. For example +$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt -Listing without --b2-versions - $ rclone -q ls b2:cleanup-test - 9 one.txt + #### Versions naming caveat -And with + When using `--b2-versions` flag rclone is relying on the file name + to work out whether the objects are versions or not. Versions' names + are created by inserting timestamp between file name and its extension. - $ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt -Showing that the current version is unchanged but older versions can be -seen. These have the UTC date that they were uploaded to the server to -the nearest millisecond appended to them. + If there are real files present with the same names as versions, then + behaviour of `--b2-versions` can be unpredictable. -Note that when using --b2-versions no file write operations are -permitted, so you can't upload files or delete them. + ### Data usage -B2 and rclone link + It is useful to know how many requests are sent to the server in different scenarios. -Rclone supports generating file share links for private B2 buckets. They -can either be for a file for example: + All copy commands send the following 4 requests: - ./rclone link B2:bucket/path/to/file.txt - https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx +/b2api/v1/b2_authorize_account /b2api/v1/b2_create_bucket +/b2api/v1/b2_list_buckets /b2api/v1/b2_list_file_names -or if run on a directory you will get: - ./rclone link B2:bucket/path - https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx + The `b2_list_file_names` request will be sent once for every 1k files + in the remote path, providing the checksum and modification time of + the listed files. As of version 1.33 issue + [#818](https://github.com/rclone/rclone/issues/818) causes extra requests + to be sent when using B2 with Crypt. When a copy operation does not + require any files to be uploaded, no more requests will be sent. -you can then use the authorization token (the part of the url from the -?Authorization= on) on any file path under that directory. For example: + Uploading files that do not require chunking, will send 2 requests per + file upload: - https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx - https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx - https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx +/b2api/v1/b2_get_upload_url /b2api/v1/b2_upload_file/ -Standard options -Here are the Standard options specific to b2 (Backblaze B2). + Uploading files requiring chunking, will send 2 requests (one each to + start and finish the upload) and another 2 requests for each chunk: ---b2-account +/b2api/v1/b2_start_large_file /b2api/v1/b2_get_upload_part_url +/b2api/v1/b2_upload_part/ /b2api/v1/b2_finish_large_file -Account ID or Application Key ID. -Properties: + #### Versions -- Config: account -- Env Var: RCLONE_B2_ACCOUNT -- Type: string -- Required: true + Versions can be viewed with the `--b2-versions` flag. When it is set + rclone will show and act on older versions of files. For example ---b2-key + Listing without `--b2-versions` -Application Key. +$ rclone -q ls b2:cleanup-test 9 one.txt -Properties: -- Config: key -- Env Var: RCLONE_B2_KEY -- Type: string -- Required: true + And with ---b2-hard-delete +$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 +one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 +one-v2016-07-02-155621-000.txt -Permanently delete files on remote removal, otherwise hide files. -Properties: + Showing that the current version is unchanged but older versions can + be seen. These have the UTC date that they were uploaded to the + server to the nearest millisecond appended to them. -- Config: hard_delete -- Env Var: RCLONE_B2_HARD_DELETE -- Type: bool -- Default: false + Note that when using `--b2-versions` no file write operations are + permitted, so you can't upload files or delete them. -Advanced options + ### B2 and rclone link -Here are the Advanced options specific to b2 (Backblaze B2). + Rclone supports generating file share links for private B2 buckets. + They can either be for a file for example: ---b2-endpoint +./rclone link B2:bucket/path/to/file.txt +https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx -Endpoint for the service. -Leave blank normally. + or if run on a directory you will get: -Properties: +./rclone link B2:bucket/path +https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx -- Config: endpoint -- Env Var: RCLONE_B2_ENDPOINT -- Type: string -- Required: false ---b2-test-mode + you can then use the authorization token (the part of the url from the + `?Authorization=` on) on any file path under that directory. For example: -A flag string for X-Bz-Test-Mode header for debugging. +https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx -This is for debugging purposes only. Setting it to one of the strings -below will cause b2 to return specific errors: -- "fail_some_uploads" -- "expire_some_account_authorization_tokens" -- "force_cap_exceeded" -These will be set in the "X-Bz-Test-Mode" header which is documented in -the b2 integrations checklist. + ### Standard options -Properties: + Here are the Standard options specific to b2 (Backblaze B2). -- Config: test_mode -- Env Var: RCLONE_B2_TEST_MODE -- Type: string -- Required: false + #### --b2-account ---b2-versions + Account ID or Application Key ID. -Include old versions in directory listings. + Properties: -Note that when using this no file write operations are permitted, so you -can't upload files or delete them. + - Config: account + - Env Var: RCLONE_B2_ACCOUNT + - Type: string + - Required: true -Properties: + #### --b2-key -- Config: versions -- Env Var: RCLONE_B2_VERSIONS -- Type: bool -- Default: false + Application Key. ---b2-version-at + Properties: -Show file versions as they were at the specified time. + - Config: key + - Env Var: RCLONE_B2_KEY + - Type: string + - Required: true -Note that when using this no file write operations are permitted, so you -can't upload files or delete them. + #### --b2-hard-delete -Properties: + Permanently delete files on remote removal, otherwise hide files. -- Config: version_at -- Env Var: RCLONE_B2_VERSION_AT -- Type: Time -- Default: off + Properties: ---b2-upload-cutoff + - Config: hard_delete + - Env Var: RCLONE_B2_HARD_DELETE + - Type: bool + - Default: false -Cutoff for switching to chunked upload. + ### Advanced options -Files above this size will be uploaded in chunks of "--b2-chunk-size". + Here are the Advanced options specific to b2 (Backblaze B2). -This value should be set no larger than 4.657 GiB (== 5 GB). + #### --b2-endpoint -Properties: + Endpoint for the service. -- Config: upload_cutoff -- Env Var: RCLONE_B2_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi + Leave blank normally. ---b2-copy-cutoff + Properties: -Cutoff for switching to multipart copy. + - Config: endpoint + - Env Var: RCLONE_B2_ENDPOINT + - Type: string + - Required: false -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. + #### --b2-test-mode -The minimum is 0 and the maximum is 4.6 GiB. + A flag string for X-Bz-Test-Mode header for debugging. -Properties: + This is for debugging purposes only. Setting it to one of the strings + below will cause b2 to return specific errors: -- Config: copy_cutoff -- Env Var: RCLONE_B2_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4Gi + * "fail_some_uploads" + * "expire_some_account_authorization_tokens" + * "force_cap_exceeded" ---b2-chunk-size + These will be set in the "X-Bz-Test-Mode" header which is documented + in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). -Upload chunk size. + Properties: -When uploading large files, chunk the file into this size. + - Config: test_mode + - Env Var: RCLONE_B2_TEST_MODE + - Type: string + - Required: false -Must fit in memory. These chunks are buffered in memory and there might -a maximum of "--transfers" chunks in progress at once. + #### --b2-versions -5,000,000 Bytes is the minimum size. + Include old versions in directory listings. -Properties: + Note that when using this no file write operations are permitted, + so you can't upload files or delete them. -- Config: chunk_size -- Env Var: RCLONE_B2_CHUNK_SIZE -- Type: SizeSuffix -- Default: 96Mi + Properties: ---b2-disable-checksum + - Config: versions + - Env Var: RCLONE_B2_VERSIONS + - Type: bool + - Default: false -Disable checksums for large (> upload cutoff) files. + #### --b2-version-at -Normally rclone will calculate the SHA1 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files to -start uploading. + Show file versions as they were at the specified time. -Properties: + Note that when using this no file write operations are permitted, + so you can't upload files or delete them. -- Config: disable_checksum -- Env Var: RCLONE_B2_DISABLE_CHECKSUM -- Type: bool -- Default: false + Properties: ---b2-download-url + - Config: version_at + - Env Var: RCLONE_B2_VERSION_AT + - Type: Time + - Default: off -Custom endpoint for downloads. + #### --b2-upload-cutoff -This is usually set to a Cloudflare CDN URL as Backblaze offers free -egress for data downloaded through the Cloudflare network. Rclone works -with private buckets by sending an "Authorization" header. If the custom -endpoint rewrites the requests for authentication, e.g., in Cloudflare -Workers, this header needs to be handled properly. Leave blank if you -want to use the endpoint provided by Backblaze. + Cutoff for switching to chunked upload. -The URL provided here SHOULD have the protocol and SHOULD NOT have a -trailing slash or specify the /file/bucket subpath as rclone will -request files with "{download_url}/file/{bucket_name}/{path}". + Files above this size will be uploaded in chunks of "--b2-chunk-size". -Example: > https://mysubdomain.mydomain.tld (No trailing "/", "file" or -"bucket") + This value should be set no larger than 4.657 GiB (== 5 GB). -Properties: + Properties: -- Config: download_url -- Env Var: RCLONE_B2_DOWNLOAD_URL -- Type: string -- Required: false + - Config: upload_cutoff + - Env Var: RCLONE_B2_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 200Mi ---b2-download-auth-duration + #### --b2-copy-cutoff -Time before the authorization token will expire in s or suffix -ms|s|m|h|d. + Cutoff for switching to multipart copy. -The duration before the download authorization token will expire. The -minimum value is 1 second. The maximum value is one week. + Any files larger than this that need to be server-side copied will be + copied in chunks of this size. -Properties: + The minimum is 0 and the maximum is 4.6 GiB. -- Config: download_auth_duration -- Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION -- Type: Duration -- Default: 1w + Properties: ---b2-memory-pool-flush-time + - Config: copy_cutoff + - Env Var: RCLONE_B2_COPY_CUTOFF + - Type: SizeSuffix + - Default: 4Gi -How often internal memory buffer pools will be flushed. Uploads which -requires additional buffers (f.e multipart) will use memory pool for -allocations. This option controls how often unused buffers will be -removed from the pool. + #### --b2-chunk-size -Properties: + Upload chunk size. -- Config: memory_pool_flush_time -- Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s + When uploading large files, chunk the file into this size. ---b2-memory-pool-use-mmap + Must fit in memory. These chunks are buffered in memory and there + might a maximum of "--transfers" chunks in progress at once. -Whether to use mmap buffers in internal memory pool. + 5,000,000 Bytes is the minimum size. -Properties: + Properties: -- Config: memory_pool_use_mmap -- Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false + - Config: chunk_size + - Env Var: RCLONE_B2_CHUNK_SIZE + - Type: SizeSuffix + - Default: 96Mi ---b2-encoding + #### --b2-upload-concurrency -The encoding for the backend. + Concurrency for multipart uploads. -See the encoding section in the overview for more info. + This is the number of chunks of the same file that are uploaded + concurrently. -Properties: + Note that chunks are stored in memory and there may be up to + "--transfers" * "--b2-upload-concurrency" chunks stored at once + in memory. -- Config: encoding -- Env Var: RCLONE_B2_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + Properties: -Limitations + - Config: upload_concurrency + - Env Var: RCLONE_B2_UPLOAD_CONCURRENCY + - Type: int + - Default: 4 -rclone about is not supported by the B2 backend. Backends without this -capability cannot determine free space for an rclone mount or use policy -mfs (most free space) as a member of an rclone union remote. + #### --b2-disable-checksum -See List of backends that do not support rclone about and rclone about + Disable checksums for large (> upload cutoff) files. -Box + Normally rclone will calculate the SHA1 checksum of the input before + uploading it so it can add it to metadata on the object. This is great + for data integrity checking but can cause long delays for large files + to start uploading. -Paths are specified as remote:path + Properties: -Paths may be as deep as required, e.g. remote:directory/subdirectory. + - Config: disable_checksum + - Env Var: RCLONE_B2_DISABLE_CHECKSUM + - Type: bool + - Default: false -The initial setup for Box involves getting a token from Box which you -can do either in your browser, or with a config.json downloaded from Box -to use JWT authentication. rclone config walks you through it. + #### --b2-download-url -Configuration + Custom endpoint for downloads. -Here is an example of how to make a remote called remote. First run: + This is usually set to a Cloudflare CDN URL as Backblaze offers + free egress for data downloaded through the Cloudflare network. + Rclone works with private buckets by sending an "Authorization" header. + If the custom endpoint rewrites the requests for authentication, + e.g., in Cloudflare Workers, this header needs to be handled properly. + Leave blank if you want to use the endpoint provided by Backblaze. - rclone config + The URL provided here SHOULD have the protocol and SHOULD NOT have + a trailing slash or specify the /file/bucket subpath as rclone will + request files with "{download_url}/file/{bucket_name}/{path}". -This will guide you through an interactive setup process: + Example: + > https://mysubdomain.mydomain.tld + (No trailing "/", "file" or "bucket") - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Box - \ "box" - [snip] - Storage> box - Box App Client Id - leave blank normally. - client_id> - Box App Client Secret - leave blank normally. - client_secret> - Box App config.json location - Leave blank normally. - Enter a string value. Press Enter for the default (""). - box_config_file> - Box App Primary Access Token - Leave blank normally. - Enter a string value. Press Enter for the default (""). - access_token> + Properties: - Enter a string value. Press Enter for the default ("user"). - Choose a number from below, or type in your own value - 1 / Rclone should act on behalf of a user - \ "user" - 2 / Rclone should act on behalf of a service account - \ "enterprise" - box_sub_type> - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - client_id = - client_secret = - token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + - Config: download_url + - Env Var: RCLONE_B2_DOWNLOAD_URL + - Type: string + - Required: false -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + #### --b2-download-auth-duration -Note that rclone runs a webserver on your local machine to collect the -token as returned from Box. This only runs from the moment it opens your -browser to the moment you get back the verification code. This is on -http://127.0.0.1:53682/ and this it may require you to unblock it -temporarily if you are running a host firewall. + Time before the authorization token will expire in s or suffix ms|s|m|h|d. -Once configured you can then use rclone like this, + The duration before the download authorization token will expire. + The minimum value is 1 second. The maximum value is one week. -List directories in top level of your Box + Properties: - rclone lsd remote: + - Config: download_auth_duration + - Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION + - Type: Duration + - Default: 1w -List all the files in your Box + #### --b2-memory-pool-flush-time - rclone ls remote: + How often internal memory buffer pools will be flushed. (no longer used) -To copy a local directory to an Box directory called backup + Properties: - rclone copy /home/source remote:backup + - Config: memory_pool_flush_time + - Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME + - Type: Duration + - Default: 1m0s -Using rclone with an Enterprise account with SSO + #### --b2-memory-pool-use-mmap -If you have an "Enterprise" account type with Box with single sign on -(SSO), you need to create a password to use Box with rclone. This can be -done at your Enterprise Box account by going to Settings, "Account" Tab, -and then set the password in the "Authentication" field. + Whether to use mmap buffers in internal memory pool. (no longer used) -Once you have done this, you can setup your Enterprise Box account using -the same procedure detailed above in the, using the password you have -just set. + Properties: -Invalid refresh token + - Config: memory_pool_use_mmap + - Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP + - Type: bool + - Default: false -According to the box docs: + #### --b2-lifecycle - Each refresh_token is valid for one use in 60 days. + Set the number of days deleted files should be kept when creating a bucket. -This means that if you + On bucket creation, this parameter is used to create a lifecycle rule + for the entire bucket. -- Don't use the box remote for 60 days -- Copy the config file with a box refresh token in and use it in two - places -- Get an error on a token refresh + If lifecycle is 0 (the default) it does not create a lifecycle rule so + the default B2 behaviour applies. This is to create versions of files + on delete and overwrite and to keep them indefinitely. -then rclone will return an error which includes the text -Invalid refresh token. + If lifecycle is >0 then it creates a single rule setting the number of + days before a file that is deleted or overwritten is deleted + permanently. This is known as daysFromHidingToDeleting in the b2 docs. -To fix this you will need to use oauth2 again to update the refresh -token. You can use the methods in the remote setup docs, bearing in mind -that if you use the copy the config file method, you should not use that -remote on the computer you did the authentication on. + The minimum value for this parameter is 1 day. -Here is how to do it. + You can also enable hard_delete in the config also which will mean + deletions won't cause versions but overwrites will still cause + versions to be made. - $ rclone config - Current remotes: + See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. - Name Type - ==== ==== - remote box - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> e - Choose a number from below, or type in an existing value - 1 > remote - remote> remote - -------------------- - [remote] - type = box - token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} - -------------------- - Edit remote - Value "client_id" = "" - Edit? (y/n)> - y) Yes - n) No - y/n> n - Value "client_secret" = "" - Edit? (y/n)> - y) Yes - n) No - y/n> n - Remote config - Already have a token - refresh? - y) Yes - n) No - y/n> y - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - type = box - token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Properties: -Modified time and hashes + - Config: lifecycle + - Env Var: RCLONE_B2_LIFECYCLE + - Type: int + - Default: 0 -Box allows modification times to be set on objects accurate to 1 second. -These will be used to detect whether objects need syncing or not. + #### --b2-encoding -Box supports SHA1 type hashes, so you can use the --checksum flag. + The encoding for the backend. -Restricted filename characters + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -In addition to the default restricted characters set the following -characters are also replaced: + Properties: - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ + - Config: encoding + - Env Var: RCLONE_B2_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot -File names can also not end with the following characters. These only -get replaced if they are the last character in the name: + ## Backend commands - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ + Here are the commands specific to the b2 backend. -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Run them with -Transfers + rclone backend COMMAND remote: -For files above 50 MiB rclone will use a chunked transfer. Rclone will -upload up to --transfers chunks at the same time (shared among all the -multipart uploads). Chunks are buffered in memory and are normally 8 MiB -so increasing --transfers will increase memory use. + The help below will explain what arguments each command takes. -Deleting files + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -Depending on the enterprise settings for your user, the item will either -be actually deleted from Box or moved to the trash. + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -Emptying the trash is supported via the rclone however cleanup command -however this deletes every trashed file and folder individually so it -may take a very long time. Emptying the trash via the WebUI does not -have this limitation so it is advised to empty the trash via the WebUI. + ### lifecycle -Root folder ID + Read or set the lifecycle for a bucket -You can set the root_folder_id for rclone. This is the directory -(identified by its Folder ID) that rclone considers to be the root of -your Box drive. + rclone backend lifecycle remote: [options] [+] -Normally you will leave this blank and rclone will determine the correct -root to use itself. + This command can be used to read or set the lifecycle for a bucket. -However you can set this to restrict rclone to a specific folder -hierarchy. + Usage Examples: -In order to do this you will have to find the Folder ID of the directory -you wish rclone to display. This will be the last segment of the URL -when you open the relevant folder in the Box web interface. + To show the current lifecycle rules: -So if the folder you want rclone to use has a URL which looks like -https://app.box.com/folder/11xxxxxxxxx8 in the browser, then you use -11xxxxxxxxx8 as the root_folder_id in the config. + rclone backend lifecycle b2:bucket -Standard options + This will dump something like this showing the lifecycle rules. -Here are the Standard options specific to box (Box). + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] ---box-client-id + If there are no lifecycle rules (the default) then it will just return []. -OAuth Client Id. + To reset the current lifecycle rules: -Leave blank normally. + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 -Properties: + This will run and then print the new lifecycle rules as above. -- Config: client_id -- Env Var: RCLONE_BOX_CLIENT_ID -- Type: string -- Required: false + Rclone only lets you set lifecycles for the whole bucket with the + fileNamePrefix = "". ---box-client-secret + You can't disable versioning with B2. The best you can do is to set + the daysFromHidingToDeleting to 1 day. You can enable hard_delete in + the config also which will mean deletions won't cause versions but + overwrites will still cause versions to be made. -OAuth Client Secret. + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 -Leave blank normally. + See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules -Properties: -- Config: client_secret -- Env Var: RCLONE_BOX_CLIENT_SECRET -- Type: string -- Required: false + Options: ---box-box-config-file + - "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off. + - "daysFromUploadingToHiding": This many days after uploading a file is hidden -Box App config.json location -Leave blank normally. -Leading ~ will be expanded in the file name as will environment -variables such as ${RCLONE_CONFIG_DIR}. + ## Limitations -Properties: + `rclone about` is not supported by the B2 backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. -- Config: box_config_file -- Env Var: RCLONE_BOX_BOX_CONFIG_FILE -- Type: string -- Required: false + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) ---box-access-token + # Box -Box App Primary Access Token + Paths are specified as `remote:path` -Leave blank normally. + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Properties: + The initial setup for Box involves getting a token from Box which you + can do either in your browser, or with a config.json downloaded from Box + to use JWT authentication. `rclone config` walks you through it. -- Config: access_token -- Env Var: RCLONE_BOX_ACCESS_TOKEN -- Type: string -- Required: false + ## Configuration ---box-box-sub-type + Here is an example of how to make a remote called `remote`. First run: -Properties: + rclone config -- Config: box_sub_type -- Env Var: RCLONE_BOX_BOX_SUB_TYPE -- Type: string -- Default: "user" -- Examples: - - "user" - - Rclone should act on behalf of a user. - - "enterprise" - - Rclone should act on behalf of a service account. + This will guide you through an interactive setup process: -Advanced options +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Box  "box" [snip] Storage> box Box App Client Id - leave blank +normally. client_id> Box App Client Secret - leave blank normally. +client_secret> Box App config.json location Leave blank normally. Enter +a string value. Press Enter for the default (""). box_config_file> Box +App Primary Access Token Leave blank normally. Enter a string value. +Press Enter for the default (""). access_token> -Here are the Advanced options specific to box (Box). +Enter a string value. Press Enter for the default ("user"). Choose a +number from below, or type in your own value 1 / Rclone should act on +behalf of a user  "user" 2 / Rclone should act on behalf of a service +account  "enterprise" box_sub_type> Remote config Use web browser to +automatically authenticate rclone with remote? * Say Y if the machine +running rclone has a web browser you can use * Say N if running rclone +on a (remote) machine without web browser access If not sure try Y. If Y +failed, try N. y) Yes n) No y/n> y If your browser doesn't open +automatically go to the following link: http://127.0.0.1:53682/auth Log +in and authorize rclone for access Waiting for code... Got code +-------------------- [remote] client_id = client_secret = token = +{"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y ---box-token -OAuth Access Token as a JSON blob. + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -Properties: + Note that rclone runs a webserver on your local machine to collect the + token as returned from Box. This only runs from the moment it opens + your browser to the moment you get back the verification code. This + is on `http://127.0.0.1:53682/` and this it may require you to unblock + it temporarily if you are running a host firewall. -- Config: token -- Env Var: RCLONE_BOX_TOKEN -- Type: string -- Required: false + Once configured you can then use `rclone` like this, ---box-auth-url + List directories in top level of your Box -Auth server URL. + rclone lsd remote: -Leave blank to use the provider defaults. + List all the files in your Box -Properties: + rclone ls remote: -- Config: auth_url -- Env Var: RCLONE_BOX_AUTH_URL -- Type: string -- Required: false + To copy a local directory to an Box directory called backup ---box-token-url + rclone copy /home/source remote:backup -Token server url. + ### Using rclone with an Enterprise account with SSO -Leave blank to use the provider defaults. + If you have an "Enterprise" account type with Box with single sign on + (SSO), you need to create a password to use Box with rclone. This can + be done at your Enterprise Box account by going to Settings, "Account" + Tab, and then set the password in the "Authentication" field. -Properties: + Once you have done this, you can setup your Enterprise Box account + using the same procedure detailed above in the, using the password you + have just set. -- Config: token_url -- Env Var: RCLONE_BOX_TOKEN_URL -- Type: string -- Required: false + ### Invalid refresh token ---box-root-folder-id + According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): -Fill in for rclone to use a non root folder as its starting point. + > Each refresh_token is valid for one use in 60 days. -Properties: + This means that if you -- Config: root_folder_id -- Env Var: RCLONE_BOX_ROOT_FOLDER_ID -- Type: string -- Default: "0" + * Don't use the box remote for 60 days + * Copy the config file with a box refresh token in and use it in two places + * Get an error on a token refresh ---box-upload-cutoff + then rclone will return an error which includes the text `Invalid + refresh token`. -Cutoff for switching to multipart upload (>= 50 MiB). + To fix this you will need to use oauth2 again to update the refresh + token. You can use the methods in [the remote setup + docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the + config file method, you should not use that remote on the computer you + did the authentication on. -Properties: + Here is how to do it. -- Config: upload_cutoff -- Env Var: RCLONE_BOX_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 50Mi +$ rclone config Current remotes: ---box-commit-retries +Name Type ==== ==== remote box -Max number of times to try committing a multipart file. +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in + an existing value 1 > remote remote> remote -------------------- + [remote] type = box token = + {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} + -------------------- Edit remote Value "client_id" = "" Edit? (y/n)> +l) Yes +m) No y/n> n Value "client_secret" = "" Edit? (y/n)> +n) Yes +o) No y/n> n Remote config Already have a token - refresh? +p) Yes +q) No y/n> y Use web browser to automatically authenticate rclone with + remote? -Properties: +- Say Y if the machine running rclone has a web browser you can use +- Say N if running rclone on a (remote) machine without web browser + access If not sure try Y. If Y failed, try N. -- Config: commit_retries -- Env Var: RCLONE_BOX_COMMIT_RETRIES -- Type: int -- Default: 100 +y) Yes +z) No y/n> y If your browser doesn't open automatically go to the + following link: http://127.0.0.1:53682/auth Log in and authorize + rclone for access Waiting for code... Got code -------------------- + [remote] type = box token = + {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} + -------------------- +a) Yes this is OK +b) Edit this remote +c) Delete this remote y/e/d> y ---box-list-chunk -Size of listing chunk 1-1000. + ### Modification times and hashes -Properties: + Box allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. -- Config: list_chunk -- Env Var: RCLONE_BOX_LIST_CHUNK -- Type: int -- Default: 1000 + Box supports SHA1 type hashes, so you can use the `--checksum` + flag. ---box-owned-by + ### Restricted filename characters -Only show items owned by the login (email address) passed in. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -Properties: + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | -- Config: owned_by -- Env Var: RCLONE_BOX_OWNED_BY -- Type: string -- Required: false + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: ---box-encoding + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | -The encoding for the backend. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -See the encoding section in the overview for more info. + ### Transfers -Properties: + For files above 50 MiB rclone will use a chunked transfer. Rclone will + upload up to `--transfers` chunks at the same time (shared among all + the multipart uploads). Chunks are buffered in memory and are + normally 8 MiB so increasing `--transfers` will increase memory use. -- Config: encoding -- Env Var: RCLONE_BOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot + ### Deleting files -Limitations + Depending on the enterprise settings for your user, the item will + either be actually deleted from Box or moved to the trash. -Note that Box is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + Emptying the trash is supported via the rclone however cleanup command + however this deletes every trashed file and folder individually so it + may take a very long time. + Emptying the trash via the WebUI does not have this limitation + so it is advised to empty the trash via the WebUI. -Box file names can't have the \ character in. rclone maps this to and -from an identical looking unicode equivalent \ (U+FF3C Fullwidth -Reverse Solidus). + ### Root folder ID -Box only supports filenames up to 255 characters in length. + You can set the `root_folder_id` for rclone. This is the directory + (identified by its `Folder ID`) that rclone considers to be the root + of your Box drive. -Box has API rate limits that sometimes reduce the speed of rclone. + Normally you will leave this blank and rclone will determine the + correct root to use itself. -rclone about is not supported by the Box backend. Backends without this -capability cannot determine free space for an rclone mount or use policy -mfs (most free space) as a member of an rclone union remote. + However you can set this to restrict rclone to a specific folder + hierarchy. -See List of backends that do not support rclone about and rclone about + In order to do this you will have to find the `Folder ID` of the + directory you wish rclone to display. This will be the last segment + of the URL when you open the relevant folder in the Box web + interface. -Cache + So if the folder you want rclone to use has a URL which looks like + `https://app.box.com/folder/11xxxxxxxxx8` + in the browser, then you use `11xxxxxxxxx8` as + the `root_folder_id` in the config. -The cache remote wraps another existing remote and stores file structure -and its data for long running tasks like rclone mount. -Status + ### Standard options -The cache backend code is working but it currently doesn't have a -maintainer so there are outstanding bugs which aren't getting fixed. + Here are the Standard options specific to box (Box). -The cache backend is due to be phased out in favour of the VFS caching -layer eventually which is more tightly integrated into rclone. + #### --box-client-id -Until this happens we recommend only using the cache backend if you find -you can't work without it. There are many docs online describing the use -of the cache backend to minimize API hits and by-and-large these are out -of date and the cache backend isn't needed in those scenarios any more. + OAuth Client Id. -Configuration + Leave blank normally. -To get started you just need to have an existing remote which can be -configured with cache. + Properties: -Here is an example of how to make a remote called test-cache. First run: + - Config: client_id + - Env Var: RCLONE_BOX_CLIENT_ID + - Type: string + - Required: false - rclone config + #### --box-client-secret -This will guide you through an interactive setup process: + OAuth Client Secret. - No remotes found, make a new one? - n) New remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - n/r/c/s/q> n - name> test-cache - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Cache a remote - \ "cache" - [snip] - Storage> cache - Remote to cache. - Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", - "myremote:bucket" or maybe "myremote:" (not recommended). - remote> local:/test - Optional: The URL of the Plex server - plex_url> http://127.0.0.1:32400 - Optional: The username of the Plex user - plex_username> dummyusername - Optional: The password of the Plex user - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank - y/g/n> y - Enter the password: - password: - Confirm the password: - password: - The size of a chunk. Lower value good for slow connections but can affect seamless reading. - Default: 5M - Choose a number from below, or type in your own value - 1 / 1 MiB - \ "1M" - 2 / 5 MiB - \ "5M" - 3 / 10 MiB - \ "10M" - chunk_size> 2 - How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. - Accepted units are: "s", "m", "h". - Default: 5m - Choose a number from below, or type in your own value - 1 / 1 hour - \ "1h" - 2 / 24 hours - \ "24h" - 3 / 24 hours - \ "48h" - info_age> 2 - The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. - Default: 10G - Choose a number from below, or type in your own value - 1 / 500 MiB - \ "500M" - 2 / 1 GiB - \ "1G" - 3 / 10 GiB - \ "10G" - chunk_total_size> 3 - Remote config - -------------------- - [test-cache] - remote = local:/test - plex_url = http://127.0.0.1:32400 - plex_username = dummyusername - plex_password = *** ENCRYPTED *** - chunk_size = 5M - info_age = 48h - chunk_total_size = 10G + Leave blank normally. -You can then use it like this, + Properties: -List directories in top level of your drive + - Config: client_secret + - Env Var: RCLONE_BOX_CLIENT_SECRET + - Type: string + - Required: false - rclone lsd test-cache: + #### --box-box-config-file -List all the files in your drive + Box App config.json location - rclone ls test-cache: + Leave blank normally. -To start a cached mount + Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. - rclone mount --allow-other test-cache: /var/tmp/test-cache + Properties: -Write Features + - Config: box_config_file + - Env Var: RCLONE_BOX_BOX_CONFIG_FILE + - Type: string + - Required: false -Offline uploading + #### --box-access-token -In an effort to make writing through cache more reliable, the backend -now supports this feature which can be activated by specifying a -cache-tmp-upload-path. + Box App Primary Access Token -A files goes through these states when using this feature: + Leave blank normally. -1. An upload is started (usually by copying a file on the cache remote) -2. When the copy to the temporary location is complete the file is part - of the cached remote and looks and behaves like any other file - (reading included) -3. After cache-tmp-wait-time passes and the file is next in line, - rclone move is used to move the file to the cloud provider -4. Reading the file still works during the upload but most - modifications on it will be prohibited -5. Once the move is complete the file is unlocked for modifications as - it becomes as any other regular file -6. If the file is being read through cache when it's actually deleted - from the temporary path then cache will simply swap the source to - the cloud provider without interrupting the reading (small blip can - happen though) + Properties: -Files are uploaded in sequence and only one file is uploaded at a time. -Uploads will be stored in a queue and be processed based on the order -they were added. The queue and the temporary storage is persistent -across restarts but can be cleared on startup with the --cache-db-purge -flag. + - Config: access_token + - Env Var: RCLONE_BOX_ACCESS_TOKEN + - Type: string + - Required: false -Write Support + #### --box-box-sub-type -Writes are supported through cache. One caveat is that a mounted cache -remote does not add any retry or fallback mechanism to the upload -operation. This will depend on the implementation of the wrapped remote. -Consider using Offline uploading for reliable writes. -One special case is covered with cache-writes which will cache the file -data at the same time as the upload when it is enabled making it -available from the cache store immediately once the upload is finished. -Read Features + Properties: -Multiple connections + - Config: box_sub_type + - Env Var: RCLONE_BOX_BOX_SUB_TYPE + - Type: string + - Default: "user" + - Examples: + - "user" + - Rclone should act on behalf of a user. + - "enterprise" + - Rclone should act on behalf of a service account. -To counter the high latency between a local PC where rclone is running -and cloud providers, the cache remote can split multiple requests to the -cloud provider for smaller file chunks and combines them together -locally where they can be available almost immediately before the reader -usually needs them. + ### Advanced options -This is similar to buffering when media files are played online. Rclone -will stay around the current marker but always try its best to stay -ahead and prepare the data before. + Here are the Advanced options specific to box (Box). -Plex Integration + #### --box-token -There is a direct integration with Plex which allows cache to detect -during reading if the file is in playback or not. This helps cache to -adapt how it queries the cloud provider depending on what is needed for. + OAuth Access Token as a JSON blob. -Scans will have a minimum amount of workers (1) while in a confirmed -playback cache will deploy the configured number of workers. + Properties: -This integration opens the doorway to additional performance -improvements which will be explored in the near future. + - Config: token + - Env Var: RCLONE_BOX_TOKEN + - Type: string + - Required: false -Note: If Plex options are not configured, cache will function with its -configured options without adapting any of its settings. + #### --box-auth-url -How to enable? Run rclone config and add all the Plex options (endpoint, -username and password) in your remote and it will be automatically -enabled. + Auth server URL. -Affected settings: - cache-workers: Configured value during confirmed -playback or 1 all the other times + Leave blank to use the provider defaults. -Certificate Validation + Properties: -When the Plex server is configured to only accept secure connections, it -is possible to use .plex.direct URLs to ensure certificate validation -succeeds. These URLs are used by Plex internally to connect to the Plex -server securely. + - Config: auth_url + - Env Var: RCLONE_BOX_AUTH_URL + - Type: string + - Required: false -The format for these URLs is the following: + #### --box-token-url -https://ip-with-dots-replaced.server-hash.plex.direct:32400/ + Token server url. -The ip-with-dots-replaced part can be any IPv4 address, where the dots -have been replaced with dashes, e.g. 127.0.0.1 becomes 127-0-0-1. + Leave blank to use the provider defaults. -To get the server-hash part, the easiest way is to visit + Properties: -https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token + - Config: token_url + - Env Var: RCLONE_BOX_TOKEN_URL + - Type: string + - Required: false -This page will list all the available Plex servers for your account with -at least one .plex.direct link for each. Copy one URL and replace the IP -address with the desired address. This can be used as the plex_url -value. + #### --box-root-folder-id -Known issues + Fill in for rclone to use a non root folder as its starting point. -Mount and --dir-cache-time + Properties: ---dir-cache-time controls the first layer of directory caching which -works at the mount layer. Being an independent caching mechanism from -the cache backend, it will manage its own entries based on the -configured time. + - Config: root_folder_id + - Env Var: RCLONE_BOX_ROOT_FOLDER_ID + - Type: string + - Default: "0" -To avoid getting in a scenario where dir cache has obsolete data and -cache would have the correct one, try to set --dir-cache-time to a lower -time than --cache-info-age. Default values are already configured in -this way. + #### --box-upload-cutoff -Windows support - Experimental + Cutoff for switching to multipart upload (>= 50 MiB). -There are a couple of issues with Windows mount functionality that still -require some investigations. It should be considered as experimental -thus far as fixes come in for this OS. + Properties: -Most of the issues seem to be related to the difference between -filesystems on Linux flavors and Windows as cache is heavily dependent -on them. + - Config: upload_cutoff + - Env Var: RCLONE_BOX_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 50Mi -Any reports or feedback on how cache behaves on this OS is greatly -appreciated. + #### --box-commit-retries -- https://github.com/rclone/rclone/issues/1935 -- https://github.com/rclone/rclone/issues/1907 -- https://github.com/rclone/rclone/issues/1834 + Max number of times to try committing a multipart file. -Risk of throttling + Properties: -Future iterations of the cache backend will make use of the pooling -functionality of the cloud provider to synchronize and at the same time -make writing through it more tolerant to failures. + - Config: commit_retries + - Env Var: RCLONE_BOX_COMMIT_RETRIES + - Type: int + - Default: 100 -There are a couple of enhancements in track to add these but in the -meantime there is a valid concern that the expiring cache listings can -lead to cloud provider throttles or bans due to repeated queries on it -for very large mounts. + #### --box-list-chunk -Some recommendations: - don't use a very small interval for entry -information (--cache-info-age) - while writes aren't yet optimised, you -can still write through cache which gives you the advantage of adding -the file in the cache at the same time if configured to do so. + Size of listing chunk 1-1000. -Future enhancements: + Properties: -- https://github.com/rclone/rclone/issues/1937 -- https://github.com/rclone/rclone/issues/1936 + - Config: list_chunk + - Env Var: RCLONE_BOX_LIST_CHUNK + - Type: int + - Default: 1000 -cache and crypt + #### --box-owned-by -One common scenario is to keep your data encrypted in the cloud provider -using the crypt remote. crypt uses a similar technique to wrap around an -existing remote and handles this translation in a seamless way. + Only show items owned by the login (email address) passed in. -There is an issue with wrapping the remotes in this order: cloud remote --> crypt -> cache + Properties: -During testing, I experienced a lot of bans with the remotes in this -order. I suspect it might be related to how crypt opens files on the -cloud provider which makes it think we're downloading the full file -instead of small chunks. Organizing the remotes in this order yields -better results: cloud remote -> cache -> crypt + - Config: owned_by + - Env Var: RCLONE_BOX_OWNED_BY + - Type: string + - Required: false -absolute remote paths + #### --box-impersonate -cache can not differentiate between relative and absolute paths for the -wrapped remote. Any path given in the remote config setting and on the -command line will be passed to the wrapped remote as is, but for storing -the chunks on disk the path will be made relative by removing any -leading / character. + Impersonate this user ID when using a service account. -This behavior is irrelevant for most backend types, but there are -backends where a leading / changes the effective directory, e.g. in the -sftp backend paths starting with a / are relative to the root of the SSH -server and paths without are relative to the user home directory. As a -result sftp:bin and sftp:/bin will share the same cache folder, even if -they represent a different directory on the SSH server. + Setting this flag allows rclone, when using a JWT service account, to + act on behalf of another user by setting the as-user header. -Cache and Remote Control (--rc) + The user ID is the Box identifier for a user. User IDs can found for + any user via the GET /users endpoint, which is only available to + admins, or by calling the GET /users/me endpoint with an authenticated + user session. -Cache supports the new --rc mode in rclone and can be remote controlled -through the following end points: By default, the listener is disabled -if you do not add the flag. + See: https://developer.box.com/guides/authentication/jwt/as-user/ -rc cache/expire -Purge a remote from the cache backend. Supports either a directory or a -file. It supports both encrypted and unencrypted file names if cache is -wrapped by crypt. + Properties: -Params: - remote = path to remote (required) - withData = true/false to -delete cached data (chunks) as well (optional, false by default) + - Config: impersonate + - Env Var: RCLONE_BOX_IMPERSONATE + - Type: string + - Required: false -Standard options + #### --box-encoding -Here are the Standard options specific to cache (Cache a remote). + The encoding for the backend. ---cache-remote + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Remote to cache. + Properties: -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). + - Config: encoding + - Env Var: RCLONE_BOX_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot -Properties: -- Config: remote -- Env Var: RCLONE_CACHE_REMOTE -- Type: string -- Required: true ---cache-plex-url + ## Limitations -The URL of the Plex server. + Note that Box is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". -Properties: + Box file names can't have the `\` character in. rclone maps this to + and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth + Reverse Solidus). -- Config: plex_url -- Env Var: RCLONE_CACHE_PLEX_URL -- Type: string -- Required: false + Box only supports filenames up to 255 characters in length. ---cache-plex-username + Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. -The username of the Plex user. + `rclone about` is not supported by the Box backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. -Properties: + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -- Config: plex_username -- Env Var: RCLONE_CACHE_PLEX_USERNAME -- Type: string -- Required: false + ## Get your own Box App ID ---cache-plex-password + Here is how to create your own Box App ID for rclone: -The password of the Plex user. + 1. Go to the [Box Developer Console](https://app.box.com/developers/console) + and login, then click `My Apps` on the sidebar. Click `Create New App` + and select `Custom App`. -NB Input to this must be obscured - see rclone obscure. + 2. In the first screen on the box that pops up, you can pretty much enter + whatever you want. The `App Name` can be whatever. For `Purpose` choose + automation to avoid having to fill out anything else. Click `Next`. -Properties: + 3. In the second screen of the creation screen, select + `User Authentication (OAuth 2.0)`. Then click `Create App`. -- Config: plex_password -- Env Var: RCLONE_CACHE_PLEX_PASSWORD -- Type: string -- Required: false + 4. You should now be on the `Configuration` tab of your new app. If not, + click on it at the top of the webpage. Copy down `Client ID` + and `Client Secret`, you'll need those for rclone. ---cache-chunk-size + 5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` -The size of a chunk (partial file data). + 6. For `Application Scopes`, select `Read all files and folders stored in Box` + and `Write all files and folders stored in box` (assuming you want to do both). + Leave others unchecked. Click `Save Changes` at the top right. -Use lower numbers for slower connections. If the chunk size is changed, -any downloaded chunks will be invalid and cache-chunk-path will need to -be cleared or unexpected EOF errors will occur. + # Cache -Properties: + The `cache` remote wraps another existing remote and stores file structure + and its data for long running tasks like `rclone mount`. -- Config: chunk_size -- Env Var: RCLONE_CACHE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi -- Examples: - - "1M" - - 1 MiB - - "5M" - - 5 MiB - - "10M" - - 10 MiB + ## Status ---cache-info-age + The cache backend code is working but it currently doesn't + have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. -How long to cache file structure information (directory listings, file -size, times, etc.). If all write operations are done through the cache -then you can safely make this value very large as the cache store will -also be updated in real time. + The cache backend is due to be phased out in favour of the VFS caching + layer eventually which is more tightly integrated into rclone. -Properties: + Until this happens we recommend only using the cache backend if you + find you can't work without it. There are many docs online describing + the use of the cache backend to minimize API hits and by-and-large + these are out of date and the cache backend isn't needed in those + scenarios any more. -- Config: info_age -- Env Var: RCLONE_CACHE_INFO_AGE -- Type: Duration -- Default: 6h0m0s -- Examples: - - "1h" - - 1 hour - - "24h" - - 24 hours - - "48h" - - 48 hours + ## Configuration ---cache-chunk-total-size + To get started you just need to have an existing remote which can be configured + with `cache`. -The total size that the chunks can take up on the local disk. + Here is an example of how to make a remote called `test-cache`. First run: -If the cache exceeds this value then it will start to delete the oldest -chunks until it goes under this value. + rclone config -Properties: + This will guide you through an interactive setup process: -- Config: chunk_total_size -- Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE -- Type: SizeSuffix -- Default: 10Gi -- Examples: - - "500M" - - 500 MiB - - "1G" - - 1 GiB - - "10G" - - 10 GiB +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +test-cache Type of storage to configure. Choose a number from below, or +type in your own value [snip] XX / Cache a remote  "cache" [snip] +Storage> cache Remote to cache. Normally should contain a ':' and a +path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe +"myremote:" (not recommended). remote> local:/test Optional: The URL of +the Plex server plex_url> http://127.0.0.1:32400 Optional: The username +of the Plex user plex_username> dummyusername Optional: The password of +the Plex user y) Yes type in my own password g) Generate random password +n) No leave this optional password blank y/g/n> y Enter the password: +password: Confirm the password: password: The size of a chunk. Lower +value good for slow connections but can affect seamless reading. +Default: 5M Choose a number from below, or type in your own value 1 / 1 +MiB  "1M" 2 / 5 MiB  "5M" 3 / 10 MiB  "10M" chunk_size> 2 How much time +should object info (file size, file hashes, etc.) be stored in cache. +Use a very high value if you don't plan on changing the source FS from +outside the cache. Accepted units are: "s", "m", "h". Default: 5m Choose +a number from below, or type in your own value 1 / 1 hour  "1h" 2 / 24 +hours  "24h" 3 / 24 hours  "48h" info_age> 2 The maximum size of stored +chunks. When the storage grows beyond this size, the oldest chunks will +be deleted. Default: 10G Choose a number from below, or type in your own +value 1 / 500 MiB  "500M" 2 / 1 GiB  "1G" 3 / 10 GiB  "10G" +chunk_total_size> 3 Remote config -------------------- [test-cache] +remote = local:/test plex_url = http://127.0.0.1:32400 plex_username = +dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age += 48h chunk_total_size = 10G -Advanced options -Here are the Advanced options specific to cache (Cache a remote). + You can then use it like this, ---cache-plex-token + List directories in top level of your drive -The plex token for authentication - auto set normally. + rclone lsd test-cache: -Properties: + List all the files in your drive -- Config: plex_token -- Env Var: RCLONE_CACHE_PLEX_TOKEN -- Type: string -- Required: false + rclone ls test-cache: ---cache-plex-insecure + To start a cached mount -Skip all certificate verification when connecting to the Plex server. + rclone mount --allow-other test-cache: /var/tmp/test-cache -Properties: + ### Write Features ### -- Config: plex_insecure -- Env Var: RCLONE_CACHE_PLEX_INSECURE -- Type: string -- Required: false + ### Offline uploading ### ---cache-db-path + In an effort to make writing through cache more reliable, the backend + now supports this feature which can be activated by specifying a + `cache-tmp-upload-path`. -Directory to store file structure metadata DB. + A files goes through these states when using this feature: -The remote name is used as the DB file name. + 1. An upload is started (usually by copying a file on the cache remote) + 2. When the copy to the temporary location is complete the file is part + of the cached remote and looks and behaves like any other file (reading included) + 3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` + is used to move the file to the cloud provider + 4. Reading the file still works during the upload but most modifications on it will be prohibited + 5. Once the move is complete the file is unlocked for modifications as it + becomes as any other regular file + 6. If the file is being read through `cache` when it's actually + deleted from the temporary path then `cache` will simply swap the source + to the cloud provider without interrupting the reading (small blip can happen though) -Properties: + Files are uploaded in sequence and only one file is uploaded at a time. + Uploads will be stored in a queue and be processed based on the order they were added. + The queue and the temporary storage is persistent across restarts but + can be cleared on startup with the `--cache-db-purge` flag. -- Config: db_path -- Env Var: RCLONE_CACHE_DB_PATH -- Type: string -- Default: "$HOME/.cache/rclone/cache-backend" + ### Write Support ### ---cache-chunk-path + Writes are supported through `cache`. + One caveat is that a mounted cache remote does not add any retry or fallback + mechanism to the upload operation. This will depend on the implementation + of the wrapped remote. Consider using `Offline uploading` for reliable writes. -Directory to cache chunk files. + One special case is covered with `cache-writes` which will cache the file + data at the same time as the upload when it is enabled making it available + from the cache store immediately once the upload is finished. -Path to where partial file data (chunks) are stored locally. The remote -name is appended to the final path. + ### Read Features ### -This config follows the "--cache-db-path". If you specify a custom -location for "--cache-db-path" and don't specify one for -"--cache-chunk-path" then "--cache-chunk-path" will use the same path as -"--cache-db-path". + #### Multiple connections #### -Properties: + To counter the high latency between a local PC where rclone is running + and cloud providers, the cache remote can split multiple requests to the + cloud provider for smaller file chunks and combines them together locally + where they can be available almost immediately before the reader usually + needs them. -- Config: chunk_path -- Env Var: RCLONE_CACHE_CHUNK_PATH -- Type: string -- Default: "$HOME/.cache/rclone/cache-backend" + This is similar to buffering when media files are played online. Rclone + will stay around the current marker but always try its best to stay ahead + and prepare the data before. ---cache-db-purge + #### Plex Integration #### -Clear all the cached data for this remote on start. + There is a direct integration with Plex which allows cache to detect during reading + if the file is in playback or not. This helps cache to adapt how it queries + the cloud provider depending on what is needed for. -Properties: + Scans will have a minimum amount of workers (1) while in a confirmed playback cache + will deploy the configured number of workers. -- Config: db_purge -- Env Var: RCLONE_CACHE_DB_PURGE -- Type: bool -- Default: false + This integration opens the doorway to additional performance improvements + which will be explored in the near future. ---cache-chunk-clean-interval + **Note:** If Plex options are not configured, `cache` will function with its + configured options without adapting any of its settings. -How often should the cache perform cleanups of the chunk storage. + How to enable? Run `rclone config` and add all the Plex options (endpoint, username + and password) in your remote and it will be automatically enabled. -The default value should be ok for most people. If you find that the -cache goes over "cache-chunk-total-size" too often then try to lower -this value to force it to perform cleanups more often. + Affected settings: + - `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times -Properties: + ##### Certificate Validation ##### -- Config: chunk_clean_interval -- Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL -- Type: Duration -- Default: 1m0s + When the Plex server is configured to only accept secure connections, it is + possible to use `.plex.direct` URLs to ensure certificate validation succeeds. + These URLs are used by Plex internally to connect to the Plex server securely. ---cache-read-retries + The format for these URLs is the following: -How many times to retry a read from a cache storage. + `https://ip-with-dots-replaced.server-hash.plex.direct:32400/` -Since reading from a cache stream is independent from downloading file -data, readers can get to a point where there's no more data in the -cache. Most of the times this can indicate a connectivity issue if cache -isn't able to provide file data anymore. + The `ip-with-dots-replaced` part can be any IPv4 address, where the dots + have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. -For really slow connections, increase this to a point where the stream -is able to provide data but your experience will be very stuttering. + To get the `server-hash` part, the easiest way is to visit -Properties: + https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token -- Config: read_retries -- Env Var: RCLONE_CACHE_READ_RETRIES -- Type: int -- Default: 10 + This page will list all the available Plex servers for your account + with at least one `.plex.direct` link for each. Copy one URL and replace + the IP address with the desired address. This can be used as the + `plex_url` value. ---cache-workers + ### Known issues ### -How many workers should run in parallel to download chunks. + #### Mount and --dir-cache-time #### -Higher values will mean more parallel processing (better CPU needed) and -more concurrent requests on the cloud provider. This impacts several -aspects like the cloud provider API limits, more stress on the hardware -that rclone runs on but it also means that streams will be more fluid -and data will be available much more faster to readers. + --dir-cache-time controls the first layer of directory caching which works at the mount layer. + Being an independent caching mechanism from the `cache` backend, it will manage its own entries + based on the configured time. -Note: If the optional Plex integration is enabled then this setting will -adapt to the type of reading performed and the value specified here will -be used as a maximum number of workers to use. + To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct + one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are + already configured in this way. -Properties: + #### Windows support - Experimental #### -- Config: workers -- Env Var: RCLONE_CACHE_WORKERS -- Type: int -- Default: 4 + There are a couple of issues with Windows `mount` functionality that still require some investigations. + It should be considered as experimental thus far as fixes come in for this OS. ---cache-chunk-no-memory + Most of the issues seem to be related to the difference between filesystems + on Linux flavors and Windows as cache is heavily dependent on them. -Disable the in-memory cache for storing chunks during streaming. + Any reports or feedback on how cache behaves on this OS is greatly appreciated. + + - https://github.com/rclone/rclone/issues/1935 + - https://github.com/rclone/rclone/issues/1907 + - https://github.com/rclone/rclone/issues/1834 -By default, cache will keep file data during streaming in RAM as well to -provide it to readers as fast as possible. + #### Risk of throttling #### -This transient data is evicted as soon as it is read and the number of -chunks stored doesn't exceed the number of workers. However, depending -on other settings like "cache-chunk-size" and "cache-workers" this -footprint can increase if there are parallel streams too (multiple files -being read at the same time). + Future iterations of the cache backend will make use of the pooling functionality + of the cloud provider to synchronize and at the same time make writing through it + more tolerant to failures. -If the hardware permits it, use this feature to provide an overall -better performance during streaming but it can also be disabled if RAM -is not available on the local machine. + There are a couple of enhancements in track to add these but in the meantime + there is a valid concern that the expiring cache listings can lead to cloud provider + throttles or bans due to repeated queries on it for very large mounts. -Properties: + Some recommendations: + - don't use a very small interval for entry information (`--cache-info-age`) + - while writes aren't yet optimised, you can still write through `cache` which gives you the advantage + of adding the file in the cache at the same time if configured to do so. -- Config: chunk_no_memory -- Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY -- Type: bool -- Default: false + Future enhancements: ---cache-rps + - https://github.com/rclone/rclone/issues/1937 + - https://github.com/rclone/rclone/issues/1936 -Limits the number of requests per second to the source FS (-1 to -disable). + #### cache and crypt #### -This setting places a hard limit on the number of requests per second -that cache will be doing to the cloud provider remote and try to respect -that value by setting waits between reads. + One common scenario is to keep your data encrypted in the cloud provider + using the `crypt` remote. `crypt` uses a similar technique to wrap around + an existing remote and handles this translation in a seamless way. -If you find that you're getting banned or limited on the cloud provider -through cache and know that a smaller number of requests per second will -allow you to work with it then you can use this setting for that. + There is an issue with wrapping the remotes in this order: + **cloud remote** -> **crypt** -> **cache** -A good balance of all the other settings should make this setting -useless but it is available to set for more special cases. + During testing, I experienced a lot of bans with the remotes in this order. + I suspect it might be related to how crypt opens files on the cloud provider + which makes it think we're downloading the full file instead of small chunks. + Organizing the remotes in this order yields better results: + **cloud remote** -> **cache** -> **crypt** -NOTE: This will limit the number of requests during streams but other -API calls to the cloud provider like directory listings will still pass. + #### absolute remote paths #### -Properties: + `cache` can not differentiate between relative and absolute paths for the wrapped remote. + Any path given in the `remote` config setting and on the command line will be passed to + the wrapped remote as is, but for storing the chunks on disk the path will be made + relative by removing any leading `/` character. -- Config: rps -- Env Var: RCLONE_CACHE_RPS -- Type: int -- Default: -1 + This behavior is irrelevant for most backend types, but there are backends where a leading `/` + changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are + relative to the root of the SSH server and paths without are relative to the user home directory. + As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent + a different directory on the SSH server. ---cache-writes + ### Cache and Remote Control (--rc) ### + Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: + By default, the listener is disabled if you do not add the flag. -Cache file data on writes through the FS. + ### rc cache/expire + Purge a remote from the cache backend. Supports either a directory or a file. + It supports both encrypted and unencrypted file names if cache is wrapped by crypt. -If you need to read files immediately after you upload them through -cache you can enable this flag to have their data stored in the cache -store at the same time during upload. + Params: + - **remote** = path to remote **(required)** + - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ -Properties: -- Config: writes -- Env Var: RCLONE_CACHE_WRITES -- Type: bool -- Default: false + ### Standard options ---cache-tmp-upload-path + Here are the Standard options specific to cache (Cache a remote). -Directory to keep temporary files until they are uploaded. + #### --cache-remote -This is the path where cache will use as a temporary storage for new -files that need to be uploaded to the cloud provider. + Remote to cache. -Specifying a value will enable this feature. Without it, it is -completely disabled and files will be uploaded directly to the cloud -provider + Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", + "myremote:bucket" or maybe "myremote:" (not recommended). -Properties: + Properties: -- Config: tmp_upload_path -- Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH -- Type: string -- Required: false + - Config: remote + - Env Var: RCLONE_CACHE_REMOTE + - Type: string + - Required: true ---cache-tmp-wait-time + #### --cache-plex-url -How long should files be stored in local cache before being uploaded. + The URL of the Plex server. -This is the duration that a file must wait in the temporary location -cache-tmp-upload-path before it is selected for upload. + Properties: -Note that only one file is uploaded at a time and it can take longer to -start the upload if a queue formed for this purpose. + - Config: plex_url + - Env Var: RCLONE_CACHE_PLEX_URL + - Type: string + - Required: false -Properties: + #### --cache-plex-username -- Config: tmp_wait_time -- Env Var: RCLONE_CACHE_TMP_WAIT_TIME -- Type: Duration -- Default: 15s + The username of the Plex user. ---cache-db-wait-time + Properties: -How long to wait for the DB to be available - 0 is unlimited. + - Config: plex_username + - Env Var: RCLONE_CACHE_PLEX_USERNAME + - Type: string + - Required: false -Only one process can have the DB open at any one time, so rclone waits -for this duration for the DB to become available before it gives an -error. + #### --cache-plex-password -If you set it to 0 then it will wait forever. + The password of the Plex user. -Properties: + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -- Config: db_wait_time -- Env Var: RCLONE_CACHE_DB_WAIT_TIME -- Type: Duration -- Default: 1s + Properties: -Backend commands + - Config: plex_password + - Env Var: RCLONE_CACHE_PLEX_PASSWORD + - Type: string + - Required: false -Here are the commands specific to the cache backend. + #### --cache-chunk-size -Run them with + The size of a chunk (partial file data). - rclone backend COMMAND remote: + Use lower numbers for slower connections. If the chunk size is + changed, any downloaded chunks will be invalid and cache-chunk-path + will need to be cleared or unexpected EOF errors will occur. -The help below will explain what arguments each command takes. + Properties: -See the backend command for more info on how to pass options and -arguments. + - Config: chunk_size + - Env Var: RCLONE_CACHE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 5Mi + - Examples: + - "1M" + - 1 MiB + - "5M" + - 5 MiB + - "10M" + - 10 MiB -These can be run on a running backend using the rc command -backend/command. + #### --cache-info-age -stats + How long to cache file structure information (directory listings, file size, times, etc.). + If all write operations are done through the cache then you can safely make + this value very large as the cache store will also be updated in real time. -Print stats on the cache backend in JSON format. + Properties: - rclone backend stats remote: [options] [+] + - Config: info_age + - Env Var: RCLONE_CACHE_INFO_AGE + - Type: Duration + - Default: 6h0m0s + - Examples: + - "1h" + - 1 hour + - "24h" + - 24 hours + - "48h" + - 48 hours -Chunker + #### --cache-chunk-total-size -The chunker overlay transparently splits large files into smaller chunks -during upload to wrapped remote and transparently assembles them back -when the file is downloaded. This allows to effectively overcome size -limits imposed by storage providers. + The total size that the chunks can take up on the local disk. -Configuration + If the cache exceeds this value then it will start to delete the + oldest chunks until it goes under this value. -To use it, first set up the underlying remote following the -configuration instructions for that remote. You can also use a local -pathname instead of a remote. + Properties: -First check your chosen remote is working - we'll call it remote:path -here. Note that anything inside remote:path will be chunked and anything -outside won't. This means that if you are using a bucket-based remote -(e.g. S3, B2, swift) then you should probably put the bucket in the -remote s3:bucket. + - Config: chunk_total_size + - Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE + - Type: SizeSuffix + - Default: 10Gi + - Examples: + - "500M" + - 500 MiB + - "1G" + - 1 GiB + - "10G" + - 10 GiB -Now configure chunker using rclone config. We will call this one overlay -to separate it from the remote itself. + ### Advanced options - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> overlay - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Transparently chunk/split large files - \ "chunker" - [snip] - Storage> chunker - Remote to chunk/unchunk. - Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", - "myremote:bucket" or maybe "myremote:" (not recommended). - Enter a string value. Press Enter for the default (""). - remote> remote:path - Files larger than chunk size will be split in chunks. - Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). - chunk_size> 100M - Choose how chunker handles hash sums. All modes but "none" require metadata. - Enter a string value. Press Enter for the default ("md5"). - Choose a number from below, or type in your own value - 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise - \ "none" - 2 / MD5 for composite files - \ "md5" - 3 / SHA1 for composite files - \ "sha1" - 4 / MD5 for all files - \ "md5all" - 5 / SHA1 for all files - \ "sha1all" - 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported - \ "md5quick" - 7 / Similar to "md5quick" but prefers SHA1 over MD5 - \ "sha1quick" - hash_type> md5 - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - -------------------- - [overlay] - type = chunker - remote = remote:bucket - chunk_size = 100M - hash_type = md5 - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Here are the Advanced options specific to cache (Cache a remote). -Specifying the remote - -In normal use, make sure the remote has a : in. If you specify the -remote without a : then rclone will use a local directory of that name. -So if you use a remote of /path/to/secret/files then rclone will chunk -stuff in that directory. If you use a remote of name then rclone will -put files in a directory called name in the current directory. - -Chunking - -When rclone starts a file upload, chunker checks the file size. If it -doesn't exceed the configured chunk size, chunker will just pass the -file to the wrapped remote. If a file is large, chunker will -transparently cut data in pieces with temporary names and stream them -one by one, on the fly. Each data chunk will contain the specified -number of bytes, except for the last one which may have less data. If -file size is unknown in advance (this is called a streaming upload), -chunker will internally create a temporary copy, record its size and -repeat the above process. - -When upload completes, temporary chunk files are finally renamed. This -scheme guarantees that operations can be run in parallel and look from -outside as atomic. A similar method with hidden temporary chunks is used -for other operations (copy/move/rename, etc.). If an operation fails, -hidden chunks are normally destroyed, and the target composite file -stays intact. - -When a composite file download is requested, chunker transparently -assembles it by concatenating data chunks in order. As the split is -trivial one could even manually concatenate data chunks together to -obtain the original content. - -When the list rclone command scans a directory on wrapped remote, the -potential chunk files are accounted for, grouped and assembled into -composite directory entries. Any temporary chunks are hidden. - -List and other commands can sometimes come across composite files with -missing or invalid chunks, e.g. shadowed by like-named directory or -another file. This usually means that wrapped file system has been -directly tampered with or damaged. If chunker detects a missing chunk it -will by default print warning, skip the whole incomplete group of chunks -but proceed with current command. You can set the --chunker-fail-hard -flag to have commands abort with error message in such cases. - -Chunk names - -The default chunk name format is *.rclone_chunk.###, hence by default -chunk names are BIG_FILE_NAME.rclone_chunk.001, -BIG_FILE_NAME.rclone_chunk.002 etc. You can configure another name -format using the name_format configuration file option. The format uses -asterisk * as a placeholder for the base file name and one or more -consecutive hash characters # as a placeholder for sequential chunk -number. There must be one and only one asterisk. The number of -consecutive hash characters defines the minimum length of a string -representing a chunk number. If decimal chunk number has less digits -than the number of hashes, it is left-padded by zeros. If the decimal -string is longer, it is left intact. By default numbering starts from 1 -but there is another option that allows user to start from 0, e.g. for -compatibility with legacy software. - -For example, if name format is big_*-##.part and original file name is -data.txt and numbering starts from 0, then the first chunk will be named -big_data.txt-00.part, the 99th chunk will be big_data.txt-98.part and -the 302nd chunk will become big_data.txt-301.part. - -Note that list assembles composite directory entries only when chunk -names match the configured format and treats non-conforming file names -as normal non-chunked files. - -When using norename transactions, chunk names will additionally have a -unique file version suffix. For example, -BIG_FILE_NAME.rclone_chunk.001_bp562k. + #### --cache-plex-token -Metadata + The plex token for authentication - auto set normally. -Besides data chunks chunker will by default create metadata object for a -composite file. The object is named after the original file. Chunker -allows user to disable metadata completely (the none format). Note that -metadata is normally not created for files smaller than the configured -chunk size. This may change in future rclone releases. - -Simple JSON metadata format - -This is the default format. It supports hash sums and chunk validation -for composite files. Meta objects carry the following fields: - -- ver - version of format, currently 1 -- size - total size of composite file -- nchunks - number of data chunks in file -- md5 - MD5 hashsum of composite file (if present) -- sha1 - SHA1 hashsum (if present) -- txn - identifies current version of the file - -There is no field for composite file name as it's simply equal to the -name of meta object on the wrapped remote. Please refer to respective -sections for details on hashsums and modified time handling. - -No metadata - -You can disable meta objects by setting the meta format option to none. -In this mode chunker will scan directory for all files that follow -configured chunk name format, group them by detecting chunks with the -same base name and show group names as virtual composite files. This -method is more prone to missing chunk errors (especially missing last -chunk) than format with metadata enabled. - -Hashsums - -Chunker supports hashsums only when a compatible metadata is present. -Hence, if you choose metadata format of none, chunker will report -hashsum as UNSUPPORTED. - -Please note that by default metadata is stored only for composite files. -If a file is smaller than configured chunk size, chunker will -transparently redirect hash requests to wrapped remote, so support -depends on that. You will see the empty string as a hashsum of requested -type for small files if the wrapped remote doesn't support it. - -Many storage backends support MD5 and SHA1 hash types, so does chunker. -With chunker you can choose one or another but not both. MD5 is set by -default as the most supported type. Since chunker keeps hashes for -composite files and falls back to the wrapped remote hash for -non-chunked ones, we advise you to choose the same hash type as -supported by wrapped remote so that your file listings look coherent. - -If your storage backend does not support MD5 or SHA1 but you need -consistent file hashing, configure chunker with md5all or sha1all. These -two modes guarantee given hash for all files. If wrapped remote doesn't -support it, chunker will then add metadata to all files, even small. -However, this can double the amount of small files in storage and incur -additional service charges. You can even use chunker to force md5/sha1 -support in any other remote at expense of sidecar meta objects by -setting e.g. chunk_type=sha1all to force hashsums and chunk_size=1P to -effectively disable chunking. - -Normally, when a file is copied to chunker controlled remote, chunker -will ask the file source for compatible file hash and revert to -on-the-fly calculation if none is found. This involves some CPU overhead -but provides a guarantee that given hashsum is available. Also, chunker -will reject a server-side copy or move operation if source and -destination hashsum types are different resulting in the extra network -bandwidth, too. In some rare cases this may be undesired, so chunker -provides two optional choices: sha1quick and md5quick. If the source -does not support primary hash type and the quick mode is enabled, -chunker will try to fall back to the secondary type. This will save CPU -and bandwidth but can result in empty hashsums at destination. Beware of -consequences: the sync command will revert (sometimes silently) to -time/size comparison if compatible hashsums between source and target -are not found. - -Modified time - -Chunker stores modification times using the wrapped remote so support -depends on that. For a small non-chunked file the chunker overlay simply -manipulates modification time of the wrapped remote file. For a -composite file with metadata chunker will get and set modification time -of the metadata object on the wrapped remote. If file is chunked but -metadata format is none then chunker will use modification time of the -first data chunk. - -Migrations - -The idiomatic way to migrate to a different chunk size, hash type, -transaction style or chunk naming scheme is to: - -- Collect all your chunked files under a directory and have your - chunker remote point to it. -- Create another directory (most probably on the same cloud storage) - and configure a new remote with desired metadata format, hash type, - chunk naming etc. -- Now run rclone sync --interactive oldchunks: newchunks: and all your - data will be transparently converted in transfer. This may take some - time, yet chunker will try server-side copy if possible. -- After checking data integrity you may remove configuration section - of the old remote. - -If rclone gets killed during a long operation on a big composite file, -hidden temporary chunks may stay in the directory. They will not be -shown by the list command but will eat up your account quota. Please -note that the deletefile command deletes only active chunks of a file. -As a workaround, you can use remote of the wrapped file system to see -them. An easy way to get rid of hidden garbage is to copy littered -directory somewhere using the chunker remote and purge the original -directory. The copy command will copy only active chunks while the purge -will remove everything including garbage. - -Caveats and Limitations - -Chunker requires wrapped remote to support server-side move (or copy + -delete) operations, otherwise it will explicitly refuse to start. This -is because it internally renames temporary chunk files to their final -names when an operation completes successfully. - -Chunker encodes chunk number in file name, so with default name_format -setting it adds 17 characters. Also chunker adds 7 characters of -temporary suffix during operations. Many file systems limit base file -name without path by 255 characters. Using rclone's crypt remote as a -base file system limits file name by 143 characters. Thus, maximum name -length is 231 for most files and 119 for chunker-over-crypt. A user in -need can change name format to e.g. *.rcc## and save 10 characters -(provided at most 99 chunks per file). - -Note that a move implemented using the copy-and-delete method may incur -double charging with some cloud storage providers. - -Chunker will not automatically rename existing chunks when you run -rclone config on a live remote and change the chunk name format. Beware -that in result of this some files which have been treated as chunks -before the change can pop up in directory listings as normal files and -vice versa. The same warning holds for the chunk size. If you -desperately need to change critical chunking settings, you should run -data migration as described above. - -If wrapped remote is case insensitive, the chunker overlay will inherit -that property (so you can't have a file called "Hello.doc" and -"hello.doc" in the same directory). - -Chunker included in rclone releases up to v1.54 can sometimes fail to -detect metadata produced by recent versions of rclone. We recommend -users to keep rclone up-to-date to avoid data corruption. - -Changing transactions is dangerous and requires explicit migration. + Properties: -Standard options + - Config: plex_token + - Env Var: RCLONE_CACHE_PLEX_TOKEN + - Type: string + - Required: false -Here are the Standard options specific to chunker (Transparently -chunk/split large files). + #### --cache-plex-insecure ---chunker-remote + Skip all certificate verification when connecting to the Plex server. -Remote to chunk/unchunk. + Properties: -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). + - Config: plex_insecure + - Env Var: RCLONE_CACHE_PLEX_INSECURE + - Type: string + - Required: false -Properties: + #### --cache-db-path -- Config: remote -- Env Var: RCLONE_CHUNKER_REMOTE -- Type: string -- Required: true + Directory to store file structure metadata DB. ---chunker-chunk-size + The remote name is used as the DB file name. -Files larger than chunk size will be split in chunks. + Properties: -Properties: + - Config: db_path + - Env Var: RCLONE_CACHE_DB_PATH + - Type: string + - Default: "$HOME/.cache/rclone/cache-backend" -- Config: chunk_size -- Env Var: RCLONE_CHUNKER_CHUNK_SIZE -- Type: SizeSuffix -- Default: 2Gi + #### --cache-chunk-path ---chunker-hash-type + Directory to cache chunk files. -Choose how chunker handles hash sums. + Path to where partial file data (chunks) are stored locally. The remote + name is appended to the final path. -All modes but "none" require metadata. + This config follows the "--cache-db-path". If you specify a custom + location for "--cache-db-path" and don't specify one for "--cache-chunk-path" + then "--cache-chunk-path" will use the same path as "--cache-db-path". -Properties: + Properties: -- Config: hash_type -- Env Var: RCLONE_CHUNKER_HASH_TYPE -- Type: string -- Default: "md5" -- Examples: - - "none" - - Pass any hash supported by wrapped remote for non-chunked - files. - - Return nothing otherwise. - - "md5" - - MD5 for composite files. - - "sha1" - - SHA1 for composite files. - - "md5all" - - MD5 for all files. - - "sha1all" - - SHA1 for all files. - - "md5quick" - - Copying a file to chunker will request MD5 from the source. - - Falling back to SHA1 if unsupported. - - "sha1quick" - - Similar to "md5quick" but prefers SHA1 over MD5. + - Config: chunk_path + - Env Var: RCLONE_CACHE_CHUNK_PATH + - Type: string + - Default: "$HOME/.cache/rclone/cache-backend" -Advanced options + #### --cache-db-purge -Here are the Advanced options specific to chunker (Transparently -chunk/split large files). + Clear all the cached data for this remote on start. ---chunker-name-format + Properties: -String format of chunk file names. + - Config: db_purge + - Env Var: RCLONE_CACHE_DB_PURGE + - Type: bool + - Default: false -The two placeholders are: base file name (*) and chunk number (#...). -There must be one and only one asterisk and one or more consecutive hash -characters. If chunk number has less digits than the number of hashes, -it is left-padded by zeros. If there are more digits in the number, they -are left as is. Possible chunk files are ignored if their name does not -match given format. + #### --cache-chunk-clean-interval -Properties: + How often should the cache perform cleanups of the chunk storage. -- Config: name_format -- Env Var: RCLONE_CHUNKER_NAME_FORMAT -- Type: string -- Default: "*.rclone_chunk.###" + The default value should be ok for most people. If you find that the + cache goes over "cache-chunk-total-size" too often then try to lower + this value to force it to perform cleanups more often. ---chunker-start-from + Properties: -Minimum valid chunk number. Usually 0 or 1. + - Config: chunk_clean_interval + - Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL + - Type: Duration + - Default: 1m0s -By default chunk numbers start from 1. + #### --cache-read-retries -Properties: + How many times to retry a read from a cache storage. -- Config: start_from -- Env Var: RCLONE_CHUNKER_START_FROM -- Type: int -- Default: 1 + Since reading from a cache stream is independent from downloading file + data, readers can get to a point where there's no more data in the + cache. Most of the times this can indicate a connectivity issue if + cache isn't able to provide file data anymore. ---chunker-meta-format + For really slow connections, increase this to a point where the stream is + able to provide data but your experience will be very stuttering. -Format of the metadata object or "none". + Properties: -By default "simplejson". Metadata is a small JSON file named after the -composite file. + - Config: read_retries + - Env Var: RCLONE_CACHE_READ_RETRIES + - Type: int + - Default: 10 -Properties: + #### --cache-workers -- Config: meta_format -- Env Var: RCLONE_CHUNKER_META_FORMAT -- Type: string -- Default: "simplejson" -- Examples: - - "none" - - Do not use metadata files at all. - - Requires hash type "none". - - "simplejson" - - Simple JSON supports hash sums and chunk validation. - - - - It has the following fields: ver, size, nchunks, md5, sha1. + How many workers should run in parallel to download chunks. ---chunker-fail-hard + Higher values will mean more parallel processing (better CPU needed) + and more concurrent requests on the cloud provider. This impacts + several aspects like the cloud provider API limits, more stress on the + hardware that rclone runs on but it also means that streams will be + more fluid and data will be available much more faster to readers. -Choose how chunker should handle files with missing or invalid chunks. + **Note**: If the optional Plex integration is enabled then this + setting will adapt to the type of reading performed and the value + specified here will be used as a maximum number of workers to use. -Properties: + Properties: -- Config: fail_hard -- Env Var: RCLONE_CHUNKER_FAIL_HARD -- Type: bool -- Default: false -- Examples: - - "true" - - Report errors and abort current command. - - "false" - - Warn user, skip incomplete file and proceed. + - Config: workers + - Env Var: RCLONE_CACHE_WORKERS + - Type: int + - Default: 4 ---chunker-transactions + #### --cache-chunk-no-memory -Choose how chunker should handle temporary files during transactions. + Disable the in-memory cache for storing chunks during streaming. -Properties: + By default, cache will keep file data during streaming in RAM as well + to provide it to readers as fast as possible. -- Config: transactions -- Env Var: RCLONE_CHUNKER_TRANSACTIONS -- Type: string -- Default: "rename" -- Examples: - - "rename" - - Rename temporary files after a successful transaction. - - "norename" - - Leave temporary file names and write transaction ID to - metadata file. - - Metadata is required for no rename transactions (meta format - cannot be "none"). - - If you are using norename transactions you should be careful - not to downgrade Rclone - - as older versions of Rclone don't support this transaction - style and will misinterpret - - files manipulated by norename transactions. - - This method is EXPERIMENTAL, don't use on production - systems. - - "auto" - - Rename or norename will be used depending on capabilities of - the backend. - - If meta format is set to "none", rename transactions will - always be used. - - This method is EXPERIMENTAL, don't use on production - systems. - -Citrix ShareFile - -Citrix ShareFile is a secure file sharing and transfer service aimed as -business. + This transient data is evicted as soon as it is read and the number of + chunks stored doesn't exceed the number of workers. However, depending + on other settings like "cache-chunk-size" and "cache-workers" this footprint + can increase if there are parallel streams too (multiple files being read + at the same time). -Configuration + If the hardware permits it, use this feature to provide an overall better + performance during streaming but it can also be disabled if RAM is not + available on the local machine. -The initial setup for Citrix ShareFile involves getting a token from -Citrix ShareFile which you can in your browser. rclone config walks you -through it. + Properties: -Here is an example of how to make a remote called remote. First run: + - Config: chunk_no_memory + - Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY + - Type: bool + - Default: false - rclone config + #### --cache-rps -This will guide you through an interactive setup process: + Limits the number of requests per second to the source FS (-1 to disable). - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - XX / Citrix Sharefile - \ "sharefile" - Storage> sharefile - ** See help for sharefile backend at: https://rclone.org/sharefile/ ** + This setting places a hard limit on the number of requests per second + that cache will be doing to the cloud provider remote and try to + respect that value by setting waits between reads. - ID of the root folder + If you find that you're getting banned or limited on the cloud + provider through cache and know that a smaller number of requests per + second will allow you to work with it then you can use this setting + for that. - Leave blank to access "Personal Folders". You can use one of the - standard values here or any folder ID (long hex number ID). - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Access the Personal Folders. (Default) - \ "" - 2 / Access the Favorites folder. - \ "favorites" - 3 / Access all the shared folders. - \ "allshared" - 4 / Access all the individual connectors. - \ "connectors" - 5 / Access the home, favorites, and shared folders as well as the connectors. - \ "top" - root_folder_id> - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXX - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - type = sharefile - endpoint = https://XXX.sharefile.com - token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + A good balance of all the other settings should make this setting + useless but it is available to set for more special cases. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + **NOTE**: This will limit the number of requests during streams but + other API calls to the cloud provider like directory listings will + still pass. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Citrix ShareFile. This only runs from the moment -it opens your browser to the moment you get back the verification code. -This is on http://127.0.0.1:53682/ and this it may require you to -unblock it temporarily if you are running a host firewall. + Properties: -Once configured you can then use rclone like this, + - Config: rps + - Env Var: RCLONE_CACHE_RPS + - Type: int + - Default: -1 -List directories in top level of your ShareFile + #### --cache-writes - rclone lsd remote: + Cache file data on writes through the FS. -List all the files in your ShareFile + If you need to read files immediately after you upload them through + cache you can enable this flag to have their data stored in the + cache store at the same time during upload. - rclone ls remote: + Properties: -To copy a local directory to an ShareFile directory called backup + - Config: writes + - Env Var: RCLONE_CACHE_WRITES + - Type: bool + - Default: false - rclone copy /home/source remote:backup + #### --cache-tmp-upload-path -Paths may be as deep as required, e.g. remote:directory/subdirectory. + Directory to keep temporary files until they are uploaded. -Modified time and hashes + This is the path where cache will use as a temporary storage for new + files that need to be uploaded to the cloud provider. -ShareFile allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. + Specifying a value will enable this feature. Without it, it is + completely disabled and files will be uploaded directly to the cloud + provider -ShareFile supports MD5 type hashes, so you can use the --checksum flag. + Properties: -Transfers + - Config: tmp_upload_path + - Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH + - Type: string + - Required: false -For files above 128 MiB rclone will use a chunked transfer. Rclone will -upload up to --transfers chunks at the same time (shared among all the -multipart uploads). Chunks are buffered in memory and are normally 64 -MiB so increasing --transfers will increase memory use. + #### --cache-tmp-wait-time -Restricted filename characters + How long should files be stored in local cache before being uploaded. -In addition to the default restricted characters set the following -characters are also replaced: + This is the duration that a file must wait in the temporary location + _cache-tmp-upload-path_ before it is selected for upload. - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ - * 0x2A * - < 0x3C < - > 0x3E > - ? 0x3F ? - : 0x3A : - | 0x7C | - " 0x22 " + Note that only one file is uploaded at a time and it can take longer + to start the upload if a queue formed for this purpose. -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: + Properties: - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ - . 0x2E . + - Config: tmp_wait_time + - Env Var: RCLONE_CACHE_TMP_WAIT_TIME + - Type: Duration + - Default: 15s -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + #### --cache-db-wait-time -Standard options + How long to wait for the DB to be available - 0 is unlimited. -Here are the Standard options specific to sharefile (Citrix Sharefile). + Only one process can have the DB open at any one time, so rclone waits + for this duration for the DB to become available before it gives an + error. ---sharefile-root-folder-id + If you set it to 0 then it will wait forever. -ID of the root folder. + Properties: -Leave blank to access "Personal Folders". You can use one of the -standard values here or any folder ID (long hex number ID). + - Config: db_wait_time + - Env Var: RCLONE_CACHE_DB_WAIT_TIME + - Type: Duration + - Default: 1s -Properties: + ## Backend commands -- Config: root_folder_id -- Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID -- Type: string -- Required: false -- Examples: - - "" - - Access the Personal Folders (default). - - "favorites" - - Access the Favorites folder. - - "allshared" - - Access all the shared folders. - - "connectors" - - Access all the individual connectors. - - "top" - - Access the home, favorites, and shared folders as well as - the connectors. + Here are the commands specific to the cache backend. -Advanced options + Run them with -Here are the Advanced options specific to sharefile (Citrix Sharefile). + rclone backend COMMAND remote: ---sharefile-upload-cutoff + The help below will explain what arguments each command takes. -Cutoff for switching to multipart upload. + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -Properties: + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -- Config: upload_cutoff -- Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 128Mi + ### stats ---sharefile-chunk-size + Print stats on the cache backend in JSON format. -Upload chunk size. + rclone backend stats remote: [options] [+] -Must a power of 2 >= 256k. -Making this larger will improve performance, but note that each chunk is -buffered in memory one per transfer. -Reducing this will reduce memory usage but decrease performance. + # Chunker -Properties: + The `chunker` overlay transparently splits large files into smaller chunks + during upload to wrapped remote and transparently assembles them back + when the file is downloaded. This allows to effectively overcome size limits + imposed by storage providers. -- Config: chunk_size -- Env Var: RCLONE_SHAREFILE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 64Mi + ## Configuration ---sharefile-endpoint + To use it, first set up the underlying remote following the configuration + instructions for that remote. You can also use a local pathname instead of + a remote. -Endpoint for API calls. + First check your chosen remote is working - we'll call it `remote:path` here. + Note that anything inside `remote:path` will be chunked and anything outside + won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) + then you should probably put the bucket in the remote `s3:bucket`. -This is usually auto discovered as part of the oauth process, but can be -set manually to something like: https://XXX.sharefile.com + Now configure `chunker` using `rclone config`. We will call this one `overlay` + to separate it from the `remote` itself. -Properties: +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> overlay Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Transparently chunk/split large files  "chunker" [snip] Storage> +chunker Remote to chunk/unchunk. Normally should contain a ':' and a +path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe +"myremote:" (not recommended). Enter a string value. Press Enter for the +default (""). remote> remote:path Files larger than chunk size will be +split in chunks. Enter a size with suffix K,M,G,T. Press Enter for the +default ("2G"). chunk_size> 100M Choose how chunker handles hash sums. +All modes but "none" require metadata. Enter a string value. Press Enter +for the default ("md5"). Choose a number from below, or type in your own +value 1 / Pass any hash supported by wrapped remote for non-chunked +files, return nothing otherwise  "none" 2 / MD5 for composite files + "md5" 3 / SHA1 for composite files  "sha1" 4 / MD5 for all files + "md5all" 5 / SHA1 for all files  "sha1all" 6 / Copying a file to +chunker will request MD5 from the source falling back to SHA1 if +unsupported  "md5quick" 7 / Similar to "md5quick" but prefers SHA1 over +MD5  "sha1quick" hash_type> md5 Edit advanced config? (y/n) y) Yes n) No +y/n> n Remote config -------------------- [overlay] type = chunker +remote = remote:bucket chunk_size = 100M hash_type = md5 +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y -- Config: endpoint -- Env Var: RCLONE_SHAREFILE_ENDPOINT -- Type: string -- Required: false ---sharefile-encoding + ### Specifying the remote -The encoding for the backend. + In normal use, make sure the remote has a `:` in. If you specify the remote + without a `:` then rclone will use a local directory of that name. + So if you use a remote of `/path/to/secret/files` then rclone will + chunk stuff in that directory. If you use a remote of `name` then rclone + will put files in a directory called `name` in the current directory. -See the encoding section in the overview for more info. -Properties: + ### Chunking -- Config: encoding -- Env Var: RCLONE_SHAREFILE_ENCODING -- Type: MultiEncoder -- Default: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot + When rclone starts a file upload, chunker checks the file size. If it + doesn't exceed the configured chunk size, chunker will just pass the file + to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut + data in pieces with temporary names and stream them one by one, on the fly. + Each data chunk will contain the specified number of bytes, except for the + last one which may have less data. If file size is unknown in advance + (this is called a streaming upload), chunker will internally create + a temporary copy, record its size and repeat the above process. -Limitations + When upload completes, temporary chunk files are finally renamed. + This scheme guarantees that operations can be run in parallel and look + from outside as atomic. + A similar method with hidden temporary chunks is used for other operations + (copy/move/rename, etc.). If an operation fails, hidden chunks are normally + destroyed, and the target composite file stays intact. + + When a composite file download is requested, chunker transparently + assembles it by concatenating data chunks in order. As the split is trivial + one could even manually concatenate data chunks together to obtain the + original content. + + When the `list` rclone command scans a directory on wrapped remote, + the potential chunk files are accounted for, grouped and assembled into + composite directory entries. Any temporary chunks are hidden. + + List and other commands can sometimes come across composite files with + missing or invalid chunks, e.g. shadowed by like-named directory or + another file. This usually means that wrapped file system has been directly + tampered with or damaged. If chunker detects a missing chunk it will + by default print warning, skip the whole incomplete group of chunks but + proceed with current command. + You can set the `--chunker-fail-hard` flag to have commands abort with + error message in such cases. + + **Caveat**: As it is now, chunker will always create a temporary file in the + backend and then rename it, even if the file is below the chunk threshold. + This will result in unnecessary API calls and can severely restrict throughput + when handling transfers primarily composed of small files on some backends (e.g. Box). + A workaround to this issue is to use chunker only for files above the chunk threshold + via `--min-size` and then perform a separate call without chunker on the remaining + files. + + + #### Chunk names + + The default chunk name format is `*.rclone_chunk.###`, hence by default + chunk names are `BIG_FILE_NAME.rclone_chunk.001`, + `BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format + using the `name_format` configuration file option. The format uses asterisk + `*` as a placeholder for the base file name and one or more consecutive + hash characters `#` as a placeholder for sequential chunk number. + There must be one and only one asterisk. The number of consecutive hash + characters defines the minimum length of a string representing a chunk number. + If decimal chunk number has less digits than the number of hashes, it is + left-padded by zeros. If the decimal string is longer, it is left intact. + By default numbering starts from 1 but there is another option that allows + user to start from 0, e.g. for compatibility with legacy software. + + For example, if name format is `big_*-##.part` and original file name is + `data.txt` and numbering starts from 0, then the first chunk will be named + `big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` + and the 302nd chunk will become `big_data.txt-301.part`. + + Note that `list` assembles composite directory entries only when chunk names + match the configured format and treats non-conforming file names as normal + non-chunked files. + + When using `norename` transactions, chunk names will additionally have a unique + file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. + + + ### Metadata + + Besides data chunks chunker will by default create metadata object for + a composite file. The object is named after the original file. + Chunker allows user to disable metadata completely (the `none` format). + Note that metadata is normally not created for files smaller than the + configured chunk size. This may change in future rclone releases. + + #### Simple JSON metadata format + + This is the default format. It supports hash sums and chunk validation + for composite files. Meta objects carry the following fields: + + - `ver` - version of format, currently `1` + - `size` - total size of composite file + - `nchunks` - number of data chunks in file + - `md5` - MD5 hashsum of composite file (if present) + - `sha1` - SHA1 hashsum (if present) + - `txn` - identifies current version of the file + + There is no field for composite file name as it's simply equal to the name + of meta object on the wrapped remote. Please refer to respective sections + for details on hashsums and modified time handling. + + #### No metadata + + You can disable meta objects by setting the meta format option to `none`. + In this mode chunker will scan directory for all files that follow + configured chunk name format, group them by detecting chunks with the same + base name and show group names as virtual composite files. + This method is more prone to missing chunk errors (especially missing + last chunk) than format with metadata enabled. + + + ### Hashsums + + Chunker supports hashsums only when a compatible metadata is present. + Hence, if you choose metadata format of `none`, chunker will report hashsum + as `UNSUPPORTED`. + + Please note that by default metadata is stored only for composite files. + If a file is smaller than configured chunk size, chunker will transparently + redirect hash requests to wrapped remote, so support depends on that. + You will see the empty string as a hashsum of requested type for small + files if the wrapped remote doesn't support it. + + Many storage backends support MD5 and SHA1 hash types, so does chunker. + With chunker you can choose one or another but not both. + MD5 is set by default as the most supported type. + Since chunker keeps hashes for composite files and falls back to the + wrapped remote hash for non-chunked ones, we advise you to choose the same + hash type as supported by wrapped remote so that your file listings + look coherent. + + If your storage backend does not support MD5 or SHA1 but you need consistent + file hashing, configure chunker with `md5all` or `sha1all`. These two modes + guarantee given hash for all files. If wrapped remote doesn't support it, + chunker will then add metadata to all files, even small. However, this can + double the amount of small files in storage and incur additional service charges. + You can even use chunker to force md5/sha1 support in any other remote + at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` + to force hashsums and `chunk_size=1P` to effectively disable chunking. + + Normally, when a file is copied to chunker controlled remote, chunker + will ask the file source for compatible file hash and revert to on-the-fly + calculation if none is found. This involves some CPU overhead but provides + a guarantee that given hashsum is available. Also, chunker will reject + a server-side copy or move operation if source and destination hashsum + types are different resulting in the extra network bandwidth, too. + In some rare cases this may be undesired, so chunker provides two optional + choices: `sha1quick` and `md5quick`. If the source does not support primary + hash type and the quick mode is enabled, chunker will try to fall back to + the secondary type. This will save CPU and bandwidth but can result in empty + hashsums at destination. Beware of consequences: the `sync` command will + revert (sometimes silently) to time/size comparison if compatible hashsums + between source and target are not found. + + + ### Modification times + + Chunker stores modification times using the wrapped remote so support + depends on that. For a small non-chunked file the chunker overlay simply + manipulates modification time of the wrapped remote file. + For a composite file with metadata chunker will get and set + modification time of the metadata object on the wrapped remote. + If file is chunked but metadata format is `none` then chunker will + use modification time of the first data chunk. + + + ### Migrations + + The idiomatic way to migrate to a different chunk size, hash type, transaction + style or chunk naming scheme is to: + + - Collect all your chunked files under a directory and have your + chunker remote point to it. + - Create another directory (most probably on the same cloud storage) + and configure a new remote with desired metadata format, + hash type, chunk naming etc. + - Now run `rclone sync --interactive oldchunks: newchunks:` and all your data + will be transparently converted in transfer. + This may take some time, yet chunker will try server-side + copy if possible. + - After checking data integrity you may remove configuration section + of the old remote. + + If rclone gets killed during a long operation on a big composite file, + hidden temporary chunks may stay in the directory. They will not be + shown by the `list` command but will eat up your account quota. + Please note that the `deletefile` command deletes only active + chunks of a file. As a workaround, you can use remote of the wrapped + file system to see them. + An easy way to get rid of hidden garbage is to copy littered directory + somewhere using the chunker remote and purge the original directory. + The `copy` command will copy only active chunks while the `purge` will + remove everything including garbage. + + + ### Caveats and Limitations + + Chunker requires wrapped remote to support server-side `move` (or `copy` + + `delete`) operations, otherwise it will explicitly refuse to start. + This is because it internally renames temporary chunk files to their final + names when an operation completes successfully. + + Chunker encodes chunk number in file name, so with default `name_format` + setting it adds 17 characters. Also chunker adds 7 characters of temporary + suffix during operations. Many file systems limit base file name without path + by 255 characters. Using rclone's crypt remote as a base file system limits + file name by 143 characters. Thus, maximum name length is 231 for most files + and 119 for chunker-over-crypt. A user in need can change name format to + e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). + + Note that a move implemented using the copy-and-delete method may incur + double charging with some cloud storage providers. + + Chunker will not automatically rename existing chunks when you run + `rclone config` on a live remote and change the chunk name format. + Beware that in result of this some files which have been treated as chunks + before the change can pop up in directory listings as normal files + and vice versa. The same warning holds for the chunk size. + If you desperately need to change critical chunking settings, you should + run data migration as described above. + + If wrapped remote is case insensitive, the chunker overlay will inherit + that property (so you can't have a file called "Hello.doc" and "hello.doc" + in the same directory). + + Chunker included in rclone releases up to `v1.54` can sometimes fail to + detect metadata produced by recent versions of rclone. We recommend users + to keep rclone up-to-date to avoid data corruption. + + Changing `transactions` is dangerous and requires explicit migration. + + + ### Standard options + + Here are the Standard options specific to chunker (Transparently chunk/split large files). + + #### --chunker-remote -Note that ShareFile is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + Remote to chunk/unchunk. -ShareFile only supports filenames up to 256 characters in length. + Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", + "myremote:bucket" or maybe "myremote:" (not recommended). -rclone about is not supported by the Citrix ShareFile backend. Backends -without this capability cannot determine free space for an rclone mount -or use policy mfs (most free space) as a member of an rclone union -remote. + Properties: -See List of backends that do not support rclone about and rclone about + - Config: remote + - Env Var: RCLONE_CHUNKER_REMOTE + - Type: string + - Required: true -Crypt - -Rclone crypt remotes encrypt and decrypt other remotes. - -A remote of type crypt does not access a storage system directly, but -instead wraps another remote, which in turn accesses the storage system. -This is similar to how alias, union, chunker and a few others work. It -makes the usage very flexible, as you can add a layer, in this case an -encryption layer, on top of any other backend, even in multiple layers. -Rclone's functionality can be used as with any other remote, for example -you can mount a crypt remote. - -Accessing a storage system through a crypt remote realizes client-side -encryption, which makes it safe to keep your data in a location you do -not trust will not get compromised. When working against the crypt -remote, rclone will automatically encrypt (before uploading) and decrypt -(after downloading) on your local system as needed on the fly, leaving -the data encrypted at rest in the wrapped remote. If you access the -storage system using an application other than rclone, or access the -wrapped remote directly using rclone, there will not be any -encryption/decryption: Downloading existing content will just give you -the encrypted (scrambled) format, and anything you upload will not -become encrypted. - -The encryption is a secret-key encryption (also called symmetric key -encryption) algorithm, where a password (or pass phrase) is used to -generate real encryption key. The password can be supplied by user, or -you may chose to let rclone generate one. It will be stored in the -configuration file, in a lightly obscured form. If you are in an -environment where you are not able to keep your configuration secured, -you should add configuration encryption as protection. As long as you -have this configuration file, you will be able to decrypt your data. -Without the configuration file, as long as you remember the password (or -keep it in a safe place), you can re-create the configuration and gain -access to the existing data. You may also configure a corresponding -remote in a different installation to access the same data. See below -for guidance to changing password. - -Encryption uses cryptographic salt, to permute the encryption key so -that the same string may be encrypted in different ways. When -configuring the crypt remote it is optional to enter a salt, or to let -rclone generate a unique salt. If omitted, rclone uses a built-in unique -string. Normally in cryptography, the salt is stored together with the -encrypted content, and do not have to be memorized by the user. This is -not the case in rclone, because rclone does not store any additional -information on the remotes. Use of custom salt is effectively a second -password that must be memorized. - -File content encryption is performed using NaCl SecretBox, based on -XSalsa20 cipher and Poly1305 for integrity. Names (file- and directory -names) are also encrypted by default, but this has some implications and -is therefore possible to be turned off. + #### --chunker-chunk-size -Configuration + Files larger than chunk size will be split in chunks. -Here is an example of how to make a remote called secret. + Properties: -To use crypt, first set up the underlying remote. Follow the -rclone config instructions for the specific backend. + - Config: chunk_size + - Env Var: RCLONE_CHUNKER_CHUNK_SIZE + - Type: SizeSuffix + - Default: 2Gi -Before configuring the crypt remote, check the underlying remote is -working. In this example the underlying remote is called remote. We will -configure a path path within this remote to contain the encrypted -content. Anything inside remote:path will be encrypted and anything -outside will not. + #### --chunker-hash-type -Configure crypt using rclone config. In this example the crypt remote is -called secret, to differentiate it from the underlying remote. + Choose how chunker handles hash sums. -When you are done you can use the crypt remote named secret just as you -would with any other remote, e.g. rclone copy D:\docs secret:\docs, and -rclone will encrypt and decrypt as needed on the fly. If you access the -wrapped remote remote:path directly you will bypass the encryption, and -anything you read will be in encrypted form, and anything you write will -be unencrypted. To avoid issues it is best to configure a dedicated path -for encrypted content, and access it exclusively through a crypt remote. + All modes but "none" require metadata. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> secret - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Encrypt/Decrypt a remote - \ "crypt" - [snip] - Storage> crypt - ** See help for crypt backend at: https://rclone.org/crypt/ ** + Properties: - Remote to encrypt/decrypt. - Normally should contain a ':' and a path, eg "myremote:path/to/dir", - "myremote:bucket" or maybe "myremote:" (not recommended). - Enter a string value. Press Enter for the default (""). - remote> remote:path - How to encrypt the filenames. - Enter a string value. Press Enter for the default ("standard"). - Choose a number from below, or type in your own value. - / Encrypt the filenames. - 1 | See the docs for the details. - \ "standard" - 2 / Very simple filename obfuscation. - \ "obfuscate" - / Don't encrypt the file names. - 3 | Adds a ".bin" extension only. - \ "off" - filename_encryption> - Option to either encrypt directory names or leave them intact. + - Config: hash_type + - Env Var: RCLONE_CHUNKER_HASH_TYPE + - Type: string + - Default: "md5" + - Examples: + - "none" + - Pass any hash supported by wrapped remote for non-chunked files. + - Return nothing otherwise. + - "md5" + - MD5 for composite files. + - "sha1" + - SHA1 for composite files. + - "md5all" + - MD5 for all files. + - "sha1all" + - SHA1 for all files. + - "md5quick" + - Copying a file to chunker will request MD5 from the source. + - Falling back to SHA1 if unsupported. + - "sha1quick" + - Similar to "md5quick" but prefers SHA1 over MD5. - NB If filename_encryption is "off" then this option will do nothing. - Enter a boolean value (true or false). Press Enter for the default ("true"). - Choose a number from below, or type in your own value - 1 / Encrypt directory names. - \ "true" - 2 / Don't encrypt directory names, leave them intact. - \ "false" - directory_name_encryption> - Password or pass phrase for encryption. - y) Yes type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - Password or pass phrase for salt. Optional but recommended. - Should be different to the previous password. - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank (default) - y/g/n> g - Password strength in bits. - 64 is just about memorable - 128 is secure - 1024 is the maximum - Bits> 128 - Your password is: JAsJvRcgR-_veXNfy_sGmQ - Use this password? Please note that an obscured version of this - password (and not the password itself) will be stored under your - configuration file, so keep this generated password in a safe place. - y) Yes (default) - n) No - y/n> - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> - Remote config - -------------------- - [secret] - type = crypt - remote = remote:path - password = *** ENCRYPTED *** - password2 = *** ENCRYPTED *** - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> + ### Advanced options -Important The crypt password stored in rclone.conf is lightly obscured. -That only protects it from cursory inspection. It is not secure unless -configuration encryption of rclone.conf is specified. + Here are the Advanced options specific to chunker (Transparently chunk/split large files). -A long passphrase is recommended, or rclone config can generate a random -one. + #### --chunker-name-format -The obscured password is created using AES-CTR with a static key. The -salt is stored verbatim at the beginning of the obscured password. This -static key is shared between all versions of rclone. - -If you reconfigure rclone with the same passwords/passphrases elsewhere -it will be compatible, but the obscured version will be different due to -the different salt. - -Rclone does not encrypt - -- file length - this can be calculated within 16 bytes -- modification time - used for syncing - -Specifying the remote - -When configuring the remote to encrypt/decrypt, you may specify any -string that rclone accepts as a source/destination of other commands. - -The primary use case is to specify the path into an already configured -remote (e.g. remote:path/to/dir or remote:bucket), such that data in a -remote untrusted location can be stored encrypted. - -You may also specify a local filesystem path, such as /path/to/dir on -Linux, C:\path\to\dir on Windows. By creating a crypt remote pointing to -such a local filesystem path, you can use rclone as a utility for pure -local file encryption, for example to keep encrypted files on a -removable USB drive. - -Note: A string which do not contain a : will by rclone be treated as a -relative path in the local filesystem. For example, if you enter the -name remote without the trailing :, it will be treated as a subdirectory -of the current directory with name "remote". - -If a path remote:path/to/dir is specified, rclone stores encrypted files -in path/to/dir on the remote. With file name encryption, files saved to -secret:subdir/subfile are stored in the unencrypted path path/to/dir but -the subdir/subpath element is encrypted. - -The path you specify does not have to exist, rclone will create it when -needed. - -If you intend to use the wrapped remote both directly for keeping -unencrypted content, as well as through a crypt remote for encrypted -content, it is recommended to point the crypt remote to a separate -directory within the wrapped remote. If you use a bucket-based storage -system (e.g. Swift, S3, Google Compute Storage, B2) it is generally -advisable to wrap the crypt remote around a specific bucket (s3:bucket). -If wrapping around the entire root of the storage (s3:), and use the -optional file name encryption, rclone will encrypt the bucket name. - -Changing password - -Should the password, or the configuration file containing a lightly -obscured form of the password, be compromised, you need to re-encrypt -your data with a new password. Since rclone uses secret-key encryption, -where the encryption key is generated directly from the password kept on -the client, it is not possible to change the password/key of already -encrypted content. Just changing the password configured for an existing -crypt remote means you will no longer able to decrypt any of the -previously encrypted content. The only possibility is to re-upload -everything via a crypt remote configured with your new password. - -Depending on the size of your data, your bandwidth, storage quota etc, -there are different approaches you can take: - If you have everything in -a different location, for example on your local system, you could remove -all of the prior encrypted files, change the password for your -configured crypt remote (or delete and re-create the crypt -configuration), and then re-upload everything from the alternative -location. - If you have enough space on the storage system you can -create a new crypt remote pointing to a separate directory on the same -backend, and then use rclone to copy everything from the original crypt -remote to the new, effectively decrypting everything on the fly using -the old password and re-encrypting using the new password. When done, -delete the original crypt remote directory and finally the rclone crypt -configuration with the old password. All data will be streamed from the -storage system and back, so you will get half the bandwidth and be -charged twice if you have upload and download quota on the storage -system. + String format of chunk file names. -Note: A security problem related to the random password generator was -fixed in rclone version 1.53.3 (released 2020-11-19). Passwords -generated by rclone config in version 1.49.0 (released 2019-08-26) to -1.53.2 (released 2020-10-26) are not considered secure and should be -changed. If you made up your own password, or used rclone version older -than 1.49.0 or newer than 1.53.2 to generate it, you are not affected by -this issue. See issue #4783 for more details, and a tool you can use to -check if you are affected. + The two placeholders are: base file name (*) and chunk number (#...). + There must be one and only one asterisk and one or more consecutive hash characters. + If chunk number has less digits than the number of hashes, it is left-padded by zeros. + If there are more digits in the number, they are left as is. + Possible chunk files are ignored if their name does not match given format. -Example + Properties: -Create the following file structure using "standard" file name -encryption. + - Config: name_format + - Env Var: RCLONE_CHUNKER_NAME_FORMAT + - Type: string + - Default: "*.rclone_chunk.###" - plaintext/ - ├── file0.txt - ├── file1.txt - └── subdir - ├── file2.txt - ├── file3.txt - └── subsubdir - └── file4.txt - -Copy these to the remote, and list them - - $ rclone -q copy plaintext secret: - $ rclone -q ls secret: - 7 file1.txt - 6 file0.txt - 8 subdir/file2.txt - 10 subdir/subsubdir/file4.txt - 9 subdir/file3.txt - -The crypt remote looks like - - $ rclone -q ls remote:path - 55 hagjclgavj2mbiqm6u6cnjjqcg - 54 v05749mltvv1tf4onltun46gls - 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo - 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc - 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps - -The directory structure is preserved - - $ rclone -q ls secret:subdir - 8 file2.txt - 9 file3.txt - 10 subsubdir/file4.txt - -Without file name encryption .bin extensions are added to underlying -names. This prevents the cloud provider attempting to interpret file -content. + #### --chunker-start-from - $ rclone -q ls remote:path - 54 file0.txt.bin - 57 subdir/file3.txt.bin - 56 subdir/file2.txt.bin - 58 subdir/subsubdir/file4.txt.bin - 55 file1.txt.bin + Minimum valid chunk number. Usually 0 or 1. -File name encryption modes + By default chunk numbers start from 1. -Off + Properties: -- doesn't hide file names or directory structure -- allows for longer file names (~246 characters) -- can use sub paths and copy single files + - Config: start_from + - Env Var: RCLONE_CHUNKER_START_FROM + - Type: int + - Default: 1 -Standard + #### --chunker-meta-format -- file names encrypted -- file names can't be as long (~143 characters) -- can use sub paths and copy single files -- directory structure visible -- identical files names will have identical uploaded names -- can use shortcuts to shorten the directory recursion + Format of the metadata object or "none". -Obfuscation + By default "simplejson". + Metadata is a small JSON file named after the composite file. -This is a simple "rotate" of the filename, with each file having a rot -distance based on the filename. Rclone stores the distance at the -beginning of the filename. A file called "hello" may become "53.jgnnq". + Properties: -Obfuscation is not a strong encryption of filenames, but hinders -automated scanning tools picking up on filename patterns. It is an -intermediate between "off" and "standard" which allows for longer path -segment names. + - Config: meta_format + - Env Var: RCLONE_CHUNKER_META_FORMAT + - Type: string + - Default: "simplejson" + - Examples: + - "none" + - Do not use metadata files at all. + - Requires hash type "none". + - "simplejson" + - Simple JSON supports hash sums and chunk validation. + - + - It has the following fields: ver, size, nchunks, md5, sha1. -There is a possibility with some unicode based filenames that the -obfuscation is weak and may map lower case characters to upper case -equivalents. + #### --chunker-fail-hard -Obfuscation cannot be relied upon for strong protection. + Choose how chunker should handle files with missing or invalid chunks. -- file names very lightly obfuscated -- file names can be longer than standard encryption -- can use sub paths and copy single files -- directory structure visible -- identical files names will have identical uploaded names + Properties: -Cloud storage systems have limits on file name length and total path -length which rclone is more likely to breach using "Standard" file name -encryption. Where file names are less than 156 characters in length -issues should not be encountered, irrespective of cloud storage -provider. + - Config: fail_hard + - Env Var: RCLONE_CHUNKER_FAIL_HARD + - Type: bool + - Default: false + - Examples: + - "true" + - Report errors and abort current command. + - "false" + - Warn user, skip incomplete file and proceed. -An experimental advanced option filename_encoding is now provided to -address this problem to a certain degree. For cloud storage systems with -case sensitive file names (e.g. Google Drive), base64 can be used to -reduce file name length. For cloud storage systems using UTF-16 to store -file names internally (e.g. OneDrive), base32768 can be used to -drastically reduce file name length. + #### --chunker-transactions -An alternative, future rclone file name encryption mode may tolerate -backend provider path length limits. + Choose how chunker should handle temporary files during transactions. -Directory name encryption + Properties: -Crypt offers the option of encrypting dir names or leaving them intact. -There are two options: + - Config: transactions + - Env Var: RCLONE_CHUNKER_TRANSACTIONS + - Type: string + - Default: "rename" + - Examples: + - "rename" + - Rename temporary files after a successful transaction. + - "norename" + - Leave temporary file names and write transaction ID to metadata file. + - Metadata is required for no rename transactions (meta format cannot be "none"). + - If you are using norename transactions you should be careful not to downgrade Rclone + - as older versions of Rclone don't support this transaction style and will misinterpret + - files manipulated by norename transactions. + - This method is EXPERIMENTAL, don't use on production systems. + - "auto" + - Rename or norename will be used depending on capabilities of the backend. + - If meta format is set to "none", rename transactions will always be used. + - This method is EXPERIMENTAL, don't use on production systems. -True -Encrypts the whole file path including directory names Example: -1/12/123.txt is encrypted to -p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0 -False + # Citrix ShareFile -Only encrypts file names, skips directory names Example: 1/12/123.txt is -encrypted to 1/12/qgm4avr35m5loi1th53ato71v0 + [Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. -Modified time and hashes + ## Configuration -Crypt stores modification times using the underlying remote so support -depends on that. + The initial setup for Citrix ShareFile involves getting a token from + Citrix ShareFile which you can in your browser. `rclone config` walks you + through it. -Hashes are not stored for crypt. However the data integrity is protected -by an extremely strong crypto authenticator. + Here is an example of how to make a remote called `remote`. First run: -Use the rclone cryptcheck command to check the integrity of a crypted -remote instead of rclone check which can't check the checksums properly. + rclone config -Standard options + This will guide you through an interactive setup process: -Here are the Standard options specific to crypt (Encrypt/Decrypt a -remote). +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value XX / Citrix +Sharefile  "sharefile" Storage> sharefile ** See help for sharefile +backend at: https://rclone.org/sharefile/ ** ---crypt-remote +ID of the root folder -Remote to encrypt/decrypt. +Leave blank to access "Personal Folders". You can use one of the +standard values here or any folder ID (long hex number ID). Enter a +string value. Press Enter for the default (""). Choose a number from +below, or type in your own value 1 / Access the Personal Folders. +(Default)  "" 2 / Access the Favorites folder.  "favorites" 3 / Access +all the shared folders.  "allshared" 4 / Access all the individual +connectors.  "connectors" 5 / Access the home, favorites, and shared +folders as well as the connectors.  "top" root_folder_id> Edit advanced +config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to +automatically authenticate rclone with remote? * Say Y if the machine +running rclone has a web browser you can use * Say N if running rclone +on a (remote) machine without web browser access If not sure try Y. If Y +failed, try N. y) Yes n) No y/n> y If your browser doesn't open +automatically go to the following link: +http://127.0.0.1:53682/auth?state=XXX Log in and authorize rclone for +access Waiting for code... Got code -------------------- [remote] type = +sharefile endpoint = https://XXX.sharefile.com token = +{"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). -Properties: + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -- Config: remote -- Env Var: RCLONE_CRYPT_REMOTE -- Type: string -- Required: true + Note that rclone runs a webserver on your local machine to collect the + token as returned from Citrix ShareFile. This only runs from the moment it opens + your browser to the moment you get back the verification code. This + is on `http://127.0.0.1:53682/` and this it may require you to unblock + it temporarily if you are running a host firewall. ---crypt-filename-encryption + Once configured you can then use `rclone` like this, -How to encrypt the filenames. + List directories in top level of your ShareFile -Properties: + rclone lsd remote: -- Config: filename_encryption -- Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION -- Type: string -- Default: "standard" -- Examples: - - "standard" - - Encrypt the filenames. - - See the docs for the details. - - "obfuscate" - - Very simple filename obfuscation. - - "off" - - Don't encrypt the file names. - - Adds a ".bin" extension only. + List all the files in your ShareFile ---crypt-directory-name-encryption + rclone ls remote: -Option to either encrypt directory names or leave them intact. + To copy a local directory to an ShareFile directory called backup -NB If filename_encryption is "off" then this option will do nothing. + rclone copy /home/source remote:backup -Properties: + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -- Config: directory_name_encryption -- Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION -- Type: bool -- Default: true -- Examples: - - "true" - - Encrypt directory names. - - "false" - - Don't encrypt directory names, leave them intact. + ### Modification times and hashes ---crypt-password + ShareFile allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. -Password or pass phrase for encryption. + ShareFile supports MD5 type hashes, so you can use the `--checksum` + flag. -NB Input to this must be obscured - see rclone obscure. + ### Transfers -Properties: + For files above 128 MiB rclone will use a chunked transfer. Rclone will + upload up to `--transfers` chunks at the same time (shared among all + the multipart uploads). Chunks are buffered in memory and are + normally 64 MiB so increasing `--transfers` will increase memory use. -- Config: password -- Env Var: RCLONE_CRYPT_PASSWORD -- Type: string -- Required: true + ### Restricted filename characters ---crypt-password2 + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -Password or pass phrase for salt. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \\ | 0x5C | \ | + | * | 0x2A | * | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | : | 0x3A | : | + | \| | 0x7C | | | + | " | 0x22 | " | -Optional but recommended. Should be different to the previous password. + File names can also not start or end with the following characters. + These only get replaced if they are the first or last character in the + name: -NB Input to this must be obscured - see rclone obscure. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | + | . | 0x2E | . | -Properties: + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -- Config: password2 -- Env Var: RCLONE_CRYPT_PASSWORD2 -- Type: string -- Required: false -Advanced options + ### Standard options -Here are the Advanced options specific to crypt (Encrypt/Decrypt a -remote). + Here are the Standard options specific to sharefile (Citrix Sharefile). ---crypt-server-side-across-configs + #### --sharefile-client-id -Allow server-side operations (e.g. copy) to work across different crypt -configs. + OAuth Client Id. -Normally this option is not what you want, but if you have two crypts -pointing to the same backend you can use it. + Leave blank normally. -This can be used, for example, to change file name encryption type -without re-uploading all the data. Just make two crypt backends pointing -to two different directories with the single changed parameter and use -rclone move to move the files between the crypt remotes. + Properties: -Properties: + - Config: client_id + - Env Var: RCLONE_SHAREFILE_CLIENT_ID + - Type: string + - Required: false -- Config: server_side_across_configs -- Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false + #### --sharefile-client-secret ---crypt-show-mapping + OAuth Client Secret. -For all files listed show how the names encrypt. + Leave blank normally. -If this flag is set then for each file that the remote is asked to list, -it will log (at level INFO) a line stating the decrypted file name and -the encrypted file name. + Properties: -This is so you can work out which encrypted names are which decrypted -names just in case you need to do something with the encrypted file -names, or for debugging purposes. + - Config: client_secret + - Env Var: RCLONE_SHAREFILE_CLIENT_SECRET + - Type: string + - Required: false -Properties: + #### --sharefile-root-folder-id -- Config: show_mapping -- Env Var: RCLONE_CRYPT_SHOW_MAPPING -- Type: bool -- Default: false + ID of the root folder. ---crypt-no-data-encryption + Leave blank to access "Personal Folders". You can use one of the + standard values here or any folder ID (long hex number ID). -Option to either encrypt file data or leave it unencrypted. + Properties: -Properties: + - Config: root_folder_id + - Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID + - Type: string + - Required: false + - Examples: + - "" + - Access the Personal Folders (default). + - "favorites" + - Access the Favorites folder. + - "allshared" + - Access all the shared folders. + - "connectors" + - Access all the individual connectors. + - "top" + - Access the home, favorites, and shared folders as well as the connectors. -- Config: no_data_encryption -- Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION -- Type: bool -- Default: false -- Examples: - - "true" - - Don't encrypt file data, leave it unencrypted. - - "false" - - Encrypt file data. + ### Advanced options ---crypt-filename-encoding + Here are the Advanced options specific to sharefile (Citrix Sharefile). -How to encode the encrypted filename to text string. + #### --sharefile-token -This option could help with shortening the encrypted filename. The -suitable option would depend on the way your remote count the filename -length and if it's case sensitive. + OAuth Access Token as a JSON blob. -Properties: + Properties: -- Config: filename_encoding -- Env Var: RCLONE_CRYPT_FILENAME_ENCODING -- Type: string -- Default: "base32" -- Examples: - - "base32" - - Encode using base32. Suitable for all remote. - - "base64" - - Encode using base64. Suitable for case sensitive remote. - - "base32768" - - Encode using base32768. Suitable if your remote counts - UTF-16 or - - Unicode codepoint instead of UTF-8 byte length. (Eg. - Onedrive) + - Config: token + - Env Var: RCLONE_SHAREFILE_TOKEN + - Type: string + - Required: false -Metadata + #### --sharefile-auth-url -Any metadata supported by the underlying remote is read and written. + Auth server URL. -See the metadata docs for more info. + Leave blank to use the provider defaults. -Backend commands + Properties: -Here are the commands specific to the crypt backend. + - Config: auth_url + - Env Var: RCLONE_SHAREFILE_AUTH_URL + - Type: string + - Required: false -Run them with + #### --sharefile-token-url - rclone backend COMMAND remote: + Token server url. -The help below will explain what arguments each command takes. + Leave blank to use the provider defaults. -See the backend command for more info on how to pass options and -arguments. + Properties: -These can be run on a running backend using the rc command -backend/command. + - Config: token_url + - Env Var: RCLONE_SHAREFILE_TOKEN_URL + - Type: string + - Required: false -encode + #### --sharefile-upload-cutoff -Encode the given filename(s) + Cutoff for switching to multipart upload. - rclone backend encode remote: [options] [+] + Properties: -This encodes the filenames given as arguments returning a list of -strings of the encoded results. + - Config: upload_cutoff + - Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 128Mi -Usage Example: + #### --sharefile-chunk-size - rclone backend encode crypt: file1 [file2...] - rclone rc backend/command command=encode fs=crypt: file1 [file2...] + Upload chunk size. -decode + Must a power of 2 >= 256k. -Decode the given filename(s) + Making this larger will improve performance, but note that each chunk + is buffered in memory one per transfer. - rclone backend decode remote: [options] [+] + Reducing this will reduce memory usage but decrease performance. -This decodes the filenames given as arguments returning a list of -strings of the decoded results. It will return an error if any of the -inputs are invalid. + Properties: -Usage Example: + - Config: chunk_size + - Env Var: RCLONE_SHAREFILE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 64Mi - rclone backend decode crypt: encryptedfile1 [encryptedfile2...] - rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] + #### --sharefile-endpoint -Backing up a crypted remote + Endpoint for API calls. -If you wish to backup a crypted remote, it is recommended that you use -rclone sync on the encrypted files, and make sure the passwords are the -same in the new encrypted remote. + This is usually auto discovered as part of the oauth process, but can + be set manually to something like: https://XXX.sharefile.com -This will have the following advantages -- rclone sync will check the checksums while copying -- you can use rclone check between the encrypted remotes -- you don't decrypt and encrypt unnecessarily + Properties: -For example, let's say you have your original remote at remote: with the -encrypted version at eremote: with path remote:crypt. You would then set -up the new remote remote2: and then the encrypted version eremote2: with -path remote2:crypt using the same passwords as eremote:. + - Config: endpoint + - Env Var: RCLONE_SHAREFILE_ENDPOINT + - Type: string + - Required: false -To sync the two remotes you would do + #### --sharefile-encoding - rclone sync --interactive remote:crypt remote2:crypt + The encoding for the backend. -And to check the integrity you would do + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - rclone check remote:crypt remote2:crypt + Properties: + + - Config: encoding + - Env Var: RCLONE_SHAREFILE_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot + + + ## Limitations + + Note that ShareFile is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". + + ShareFile only supports filenames up to 256 characters in length. + + `rclone about` is not supported by the Citrix ShareFile backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. + + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + + # Crypt + + Rclone `crypt` remotes encrypt and decrypt other remotes. + + A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) + directly, but instead wraps another remote, which in turn accesses + the storage system. This is similar to how [alias](https://rclone.org/alias/), + [union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) + and a few others work. It makes the usage very flexible, as you can + add a layer, in this case an encryption layer, on top of any other + backend, even in multiple layers. Rclone's functionality + can be used as with any other remote, for example you can + [mount](https://rclone.org/commands/rclone_mount/) a crypt remote. + + Accessing a storage system through a crypt remote realizes client-side + encryption, which makes it safe to keep your data in a location you do + not trust will not get compromised. + When working against the `crypt` remote, rclone will automatically + encrypt (before uploading) and decrypt (after downloading) on your local + system as needed on the fly, leaving the data encrypted at rest in the + wrapped remote. If you access the storage system using an application + other than rclone, or access the wrapped remote directly using rclone, + there will not be any encryption/decryption: Downloading existing content + will just give you the encrypted (scrambled) format, and anything you + upload will *not* become encrypted. + + The encryption is a secret-key encryption (also called symmetric key encryption) + algorithm, where a password (or pass phrase) is used to generate real encryption key. + The password can be supplied by user, or you may chose to let rclone + generate one. It will be stored in the configuration file, in a lightly obscured form. + If you are in an environment where you are not able to keep your configuration + secured, you should add + [configuration encryption](https://rclone.org/docs/#configuration-encryption) + as protection. As long as you have this configuration file, you will be able to + decrypt your data. Without the configuration file, as long as you remember + the password (or keep it in a safe place), you can re-create the configuration + and gain access to the existing data. You may also configure a corresponding + remote in a different installation to access the same data. + See below for guidance to [changing password](#changing-password). + + Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), + to permute the encryption key so that the same string may be encrypted in + different ways. When configuring the crypt remote it is optional to enter a salt, + or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. + Normally in cryptography, the salt is stored together with the encrypted content, + and do not have to be memorized by the user. This is not the case in rclone, + because rclone does not store any additional information on the remotes. Use of + custom salt is effectively a second password that must be memorized. + + [File content](#file-encryption) encryption is performed using + [NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), + based on XSalsa20 cipher and Poly1305 for integrity. + [Names](#name-encryption) (file- and directory names) are also encrypted + by default, but this has some implications and is therefore + possible to be turned off. + + ## Configuration + + Here is an example of how to make a remote called `secret`. + + To use `crypt`, first set up the underlying remote. Follow the + `rclone config` instructions for the specific backend. + + Before configuring the crypt remote, check the underlying remote is + working. In this example the underlying remote is called `remote`. + We will configure a path `path` within this remote to contain the + encrypted content. Anything inside `remote:path` will be encrypted + and anything outside will not. + + Configure `crypt` using `rclone config`. In this example the `crypt` + remote is called `secret`, to differentiate it from the underlying + `remote`. + + When you are done you can use the crypt remote named `secret` just + as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, + and rclone will encrypt and decrypt as needed on the fly. + If you access the wrapped remote `remote:path` directly you will bypass + the encryption, and anything you read will be in encrypted form, and + anything you write will be unencrypted. To avoid issues it is best to + configure a dedicated path for encrypted content, and access it + exclusively through a crypt remote. + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> secret Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +Encrypt/Decrypt a remote  "crypt" [snip] Storage> crypt ** See help for +crypt backend at: https://rclone.org/crypt/ ** + +Remote to encrypt/decrypt. Normally should contain a ':' and a path, eg +"myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not +recommended). Enter a string value. Press Enter for the default (""). +remote> remote:path How to encrypt the filenames. Enter a string value. +Press Enter for the default ("standard"). Choose a number from below, or +type in your own value. / Encrypt the filenames. 1 | See the docs for +the details.  "standard" 2 / Very simple filename obfuscation. + "obfuscate" / Don't encrypt the file names. 3 | Adds a ".bin" extension +only.  "off" filename_encryption> Option to either encrypt directory +names or leave them intact. -File formats +NB If filename_encryption is "off" then this option will do nothing. +Enter a boolean value (true or false). Press Enter for the default +("true"). Choose a number from below, or type in your own value 1 / +Encrypt directory names.  "true" 2 / Don't encrypt directory names, +leave them intact.  "false" directory_name_encryption> Password or pass +phrase for encryption. y) Yes type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Password or pass phrase for salt. Optional but recommended. +Should be different to the previous password. y) Yes type in my own +password g) Generate random password n) No leave this optional password +blank (default) y/g/n> g Password strength in bits. 64 is just about +memorable 128 is secure 1024 is the maximum Bits> 128 Your password is: +JAsJvRcgR-_veXNfy_sGmQ Use this password? Please note that an obscured +version of this password (and not the password itself) will be stored +under your configuration file, so keep this generated password in a safe +place. y) Yes (default) n) No y/n> Edit advanced config? (y/n) y) Yes n) +No (default) y/n> Remote config -------------------- [secret] type = +crypt remote = remote:path password = *** ENCRYPTED password2 = +ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit +this remote d) Delete this remote y/e/d> + + + **Important** The crypt password stored in `rclone.conf` is lightly + obscured. That only protects it from cursory inspection. It is not + secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. + + A long passphrase is recommended, or `rclone config` can generate a + random one. + + The obscured password is created using AES-CTR with a static key. The + salt is stored verbatim at the beginning of the obscured password. This + static key is shared between all versions of rclone. + + If you reconfigure rclone with the same passwords/passphrases + elsewhere it will be compatible, but the obscured version will be different + due to the different salt. + + Rclone does not encrypt + + * file length - this can be calculated within 16 bytes + * modification time - used for syncing + + ### Specifying the remote + + When configuring the remote to encrypt/decrypt, you may specify any + string that rclone accepts as a source/destination of other commands. + + The primary use case is to specify the path into an already configured + remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that + data in a remote untrusted location can be stored encrypted. + + You may also specify a local filesystem path, such as + `/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating + a crypt remote pointing to such a local filesystem path, you can + use rclone as a utility for pure local file encryption, for example + to keep encrypted files on a removable USB drive. + + **Note**: A string which do not contain a `:` will by rclone be treated + as a relative path in the local filesystem. For example, if you enter + the name `remote` without the trailing `:`, it will be treated as + a subdirectory of the current directory with name "remote". + + If a path `remote:path/to/dir` is specified, rclone stores encrypted + files in `path/to/dir` on the remote. With file name encryption, files + saved to `secret:subdir/subfile` are stored in the unencrypted path + `path/to/dir` but the `subdir/subpath` element is encrypted. + + The path you specify does not have to exist, rclone will create + it when needed. + + If you intend to use the wrapped remote both directly for keeping + unencrypted content, as well as through a crypt remote for encrypted + content, it is recommended to point the crypt remote to a separate + directory within the wrapped remote. If you use a bucket-based storage + system (e.g. Swift, S3, Google Compute Storage, B2) it is generally + advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). + If wrapping around the entire root of the storage (`s3:`), and use the + optional file name encryption, rclone will encrypt the bucket name. + + ### Changing password + + Should the password, or the configuration file containing a lightly obscured + form of the password, be compromised, you need to re-encrypt your data with + a new password. Since rclone uses secret-key encryption, where the encryption + key is generated directly from the password kept on the client, it is not + possible to change the password/key of already encrypted content. Just changing + the password configured for an existing crypt remote means you will no longer + able to decrypt any of the previously encrypted content. The only possibility + is to re-upload everything via a crypt remote configured with your new password. + + Depending on the size of your data, your bandwidth, storage quota etc, there are + different approaches you can take: + - If you have everything in a different location, for example on your local system, + you could remove all of the prior encrypted files, change the password for your + configured crypt remote (or delete and re-create the crypt configuration), + and then re-upload everything from the alternative location. + - If you have enough space on the storage system you can create a new crypt + remote pointing to a separate directory on the same backend, and then use + rclone to copy everything from the original crypt remote to the new, + effectively decrypting everything on the fly using the old password and + re-encrypting using the new password. When done, delete the original crypt + remote directory and finally the rclone crypt configuration with the old password. + All data will be streamed from the storage system and back, so you will + get half the bandwidth and be charged twice if you have upload and download quota + on the storage system. + + **Note**: A security problem related to the random password generator + was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated + by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 + (released 2020-10-26) are not considered secure and should be changed. + If you made up your own password, or used rclone version older than 1.49.0 or + newer than 1.53.2 to generate it, you are *not* affected by this issue. + See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more + details, and a tool you can use to check if you are affected. -File encryption + ### Example -Files are encrypted 1:1 source file to destination object. The file has -a header and is divided into chunks. + Create the following file structure using "standard" file name + encryption. -Header +plaintext/ ├── file0.txt ├── file1.txt └── subdir ├── file2.txt ├── +file3.txt └── subsubdir └── file4.txt -- 8 bytes magic string RCLONE\x00\x00 -- 24 bytes Nonce (IV) -The initial nonce is generated from the operating systems crypto strong -random number generator. The nonce is incremented for each chunk read -making sure each nonce is unique for each block written. The chance of a -nonce being re-used is minuscule. If you wrote an exabyte of data (10¹⁸ -bytes) you would have a probability of approximately 2×10⁻³² of re-using -a nonce. + Copy these to the remote, and list them -Chunk +$ rclone -q copy plaintext secret: $ rclone -q ls secret: 7 file1.txt 6 +file0.txt 8 subdir/file2.txt 10 subdir/subsubdir/file4.txt 9 +subdir/file3.txt -Each chunk will contain 64 KiB of data, except for the last one which -may have less data. The data chunk is in standard NaCl SecretBox format. -SecretBox uses XSalsa20 and Poly1305 to encrypt and authenticate -messages. -Each chunk contains: + The crypt remote looks like -- 16 Bytes of Poly1305 authenticator -- 1 - 65536 bytes XSalsa20 encrypted data +$ rclone -q ls remote:path 55 hagjclgavj2mbiqm6u6cnjjqcg 54 +v05749mltvv1tf4onltun46gls 57 +86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo 58 +86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc +56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps -64k chunk size was chosen as the best performing chunk size (the -authenticator takes too much time below this and the performance drops -off due to cache effects above this). Note that these chunks are -buffered in memory so they can't be too big. -This uses a 32 byte (256 bit key) key derived from the user password. + The directory structure is preserved -Examples +$ rclone -q ls secret:subdir 8 file2.txt 9 file3.txt 10 +subsubdir/file4.txt -1 byte file will encrypt to -- 32 bytes header -- 17 bytes data chunk + Without file name encryption `.bin` extensions are added to underlying + names. This prevents the cloud provider attempting to interpret file + content. -49 bytes total +$ rclone -q ls remote:path 54 file0.txt.bin 57 subdir/file3.txt.bin 56 +subdir/file2.txt.bin 58 subdir/subsubdir/file4.txt.bin 55 file1.txt.bin -1 MiB (1048576 bytes) file will encrypt to -- 32 bytes header -- 16 chunks of 65568 bytes + ### File name encryption modes -1049120 bytes total (a 0.05% overhead). This is the overhead for big -files. + Off -Name encryption + * doesn't hide file names or directory structure + * allows for longer file names (~246 characters) + * can use sub paths and copy single files -File names are encrypted segment by segment - the path is broken up into -/ separated strings and these are encrypted individually. + Standard -File segments are padded using PKCS#7 to a multiple of 16 bytes before -encryption. + * file names encrypted + * file names can't be as long (~143 characters) + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names + * can use shortcuts to shorten the directory recursion -They are then encrypted with EME using AES with 256 bit key. EME -(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 -paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. + Obfuscation -This makes for deterministic encryption which is what we want - the same -filename must encrypt to the same thing otherwise we can't find it on -the cloud storage system. + This is a simple "rotate" of the filename, with each file having a rot + distance based on the filename. Rclone stores the distance at the + beginning of the filename. A file called "hello" may become "53.jgnnq". -This means that + Obfuscation is not a strong encryption of filenames, but hinders + automated scanning tools picking up on filename patterns. It is an + intermediate between "off" and "standard" which allows for longer path + segment names. -- filenames with the same name will encrypt the same -- filenames which start the same won't have a common prefix + There is a possibility with some unicode based filenames that the + obfuscation is weak and may map lower case characters to upper case + equivalents. -This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of -which are derived from the user password. + Obfuscation cannot be relied upon for strong protection. -After encryption they are written out using a modified version of -standard base32 encoding as described in RFC4648. The standard encoding -is modified in two ways: + * file names very lightly obfuscated + * file names can be longer than standard encryption + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names -- it becomes lower case (no-one likes upper case filenames!) -- we strip the padding character = + Cloud storage systems have limits on file name length and + total path length which rclone is more likely to breach using + "Standard" file name encryption. Where file names are less than 156 + characters in length issues should not be encountered, irrespective of + cloud storage provider. -base32 is used rather than the more efficient base64 so rclone can be -used on case insensitive remotes (e.g. Windows, Amazon Drive). + An experimental advanced option `filename_encoding` is now provided to + address this problem to a certain degree. + For cloud storage systems with case sensitive file names (e.g. Google Drive), + `base64` can be used to reduce file name length. + For cloud storage systems using UTF-16 to store file names internally + (e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce + file name length. -Key derivation + An alternative, future rclone file name encryption mode may tolerate + backend provider path length limits. -Rclone uses scrypt with parameters N=16384, r=8, p=1 with an optional -user supplied salt (password2) to derive the 32+32+16 = 80 bytes of key -material required. If the user doesn't supply a salt then rclone uses an -internal one. + ### Directory name encryption -scrypt makes it impractical to mount a dictionary attack on rclone -encrypted data. For full protection against this you should always use a -salt. + Crypt offers the option of encrypting dir names or leaving them intact. + There are two options: -SEE ALSO + True -- rclone cryptdecode - Show forward/reverse mapping of encrypted - filenames + Encrypts the whole file path including directory names + Example: + `1/12/123.txt` is encrypted to + `p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` -Compress + False -Warning + Only encrypts file names, skips directory names + Example: + `1/12/123.txt` is encrypted to + `1/12/qgm4avr35m5loi1th53ato71v0` -This remote is currently experimental. Things may break and data may be -lost. Anything you do with this remote is at your own risk. Please -understand the risks associated with using experimental code and don't -use this remote in critical applications. -The Compress remote adds compression to another remote. It is best used -with remotes containing many large compressible files. + ### Modification times and hashes -Configuration + Crypt stores modification times using the underlying remote so support + depends on that. -To use this remote, all you need to do is specify another remote and a -compression mode to use: + Hashes are not stored for crypt. However the data integrity is + protected by an extremely strong crypto authenticator. - Current remotes: + Use the `rclone cryptcheck` command to check the + integrity of an encrypted remote instead of `rclone check` which can't + check the checksums properly. - Name Type - ==== ==== - remote_to_press sometype - e) Edit existing remote - $ rclone config - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> n - name> compress - ... - 8 / Compress a remote - \ "compress" - ... - Storage> compress - ** See help for compress backend at: https://rclone.org/compress/ ** + ### Standard options - Remote to compress. - Enter a string value. Press Enter for the default (""). - remote> remote_to_press:subdir - Compression mode. - Enter a string value. Press Enter for the default ("gzip"). - Choose a number from below, or type in your own value - 1 / Gzip compression balanced for speed and compression strength. - \ "gzip" - compression_mode> gzip - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [compress] - type = compress - remote = remote_to_press:subdir - compression_mode = gzip - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). -Compression Modes + #### --crypt-remote -Currently only gzip compression is supported. It provides a decent -balance between speed and size and is well supported by other -applications. Compression strength can further be configured via an -advanced setting where 0 is no compression and 9 is strongest -compression. + Remote to encrypt/decrypt. -File types + Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", + "myremote:bucket" or maybe "myremote:" (not recommended). -If you open a remote wrapped by compress, you will see that there are -many files with an extension corresponding to the compression algorithm -you chose. These files are standard files that can be opened by various -archive programs, but they have some hidden metadata that allows them to -be used by rclone. While you may download and decompress these files at -will, do not manually delete or rename files. Files without correct -metadata files will not be recognized by rclone. + Properties: -File names + - Config: remote + - Env Var: RCLONE_CRYPT_REMOTE + - Type: string + - Required: true -The compressed files will be named *.###########.gz where * is the base -file and the # part is base64 encoded size of the uncompressed file. The -file names should not be changed by anything other than the rclone -compression backend. + #### --crypt-filename-encryption -Standard options + How to encrypt the filenames. -Here are the Standard options specific to compress (Compress a remote). + Properties: ---compress-remote + - Config: filename_encryption + - Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION + - Type: string + - Default: "standard" + - Examples: + - "standard" + - Encrypt the filenames. + - See the docs for the details. + - "obfuscate" + - Very simple filename obfuscation. + - "off" + - Don't encrypt the file names. + - Adds a ".bin", or "suffix" extension only. -Remote to compress. + #### --crypt-directory-name-encryption -Properties: + Option to either encrypt directory names or leave them intact. -- Config: remote -- Env Var: RCLONE_COMPRESS_REMOTE -- Type: string -- Required: true + NB If filename_encryption is "off" then this option will do nothing. ---compress-mode + Properties: -Compression mode. + - Config: directory_name_encryption + - Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION + - Type: bool + - Default: true + - Examples: + - "true" + - Encrypt directory names. + - "false" + - Don't encrypt directory names, leave them intact. -Properties: + #### --crypt-password -- Config: mode -- Env Var: RCLONE_COMPRESS_MODE -- Type: string -- Default: "gzip" -- Examples: - - "gzip" - - Standard gzip compression with fastest parameters. + Password or pass phrase for encryption. -Advanced options + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Here are the Advanced options specific to compress (Compress a remote). + Properties: ---compress-level + - Config: password + - Env Var: RCLONE_CRYPT_PASSWORD + - Type: string + - Required: true -GZIP compression level (-2 to 9). + #### --crypt-password2 -Generally -1 (default, equivalent to 5) is recommended. Levels 1 to 9 -increase compression at the cost of speed. Going past 6 generally offers -very little return. + Password or pass phrase for salt. -Level -2 uses Huffman encoding only. Only use if you know what you are -doing. Level 0 turns off compression. + Optional but recommended. + Should be different to the previous password. -Properties: + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -- Config: level -- Env Var: RCLONE_COMPRESS_LEVEL -- Type: int -- Default: -1 + Properties: ---compress-ram-cache-limit + - Config: password2 + - Env Var: RCLONE_CRYPT_PASSWORD2 + - Type: string + - Required: false -Some remotes don't allow the upload of files with unknown size. In this -case the compressed file will need to be cached to determine it's size. + ### Advanced options -Files smaller than this limit will be cached in RAM, files larger than -this limit will be cached on disk. + Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). -Properties: + #### --crypt-server-side-across-configs -- Config: ram_cache_limit -- Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT -- Type: SizeSuffix -- Default: 20Mi + Deprecated: use --server-side-across-configs instead. -Metadata + Allow server-side operations (e.g. copy) to work across different crypt configs. -Any metadata supported by the underlying remote is read and written. + Normally this option is not what you want, but if you have two crypts + pointing to the same backend you can use it. -See the metadata docs for more info. + This can be used, for example, to change file name encryption type + without re-uploading all the data. Just make two crypt backends + pointing to two different directories with the single changed + parameter and use rclone move to move the files between the crypt + remotes. -Combine + Properties: -The combine backend joins remotes together into a single directory tree. + - Config: server_side_across_configs + - Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS + - Type: bool + - Default: false -For example you might have a remote for images on one provider: + #### --crypt-show-mapping - $ rclone tree s3:imagesbucket - / - ├── image1.jpg - └── image2.jpg + For all files listed show how the names encrypt. -And a remote for files on another: + If this flag is set then for each file that the remote is asked to + list, it will log (at level INFO) a line stating the decrypted file + name and the encrypted file name. - $ rclone tree drive:important/files - / - ├── file1.txt - └── file2.txt + This is so you can work out which encrypted names are which decrypted + names just in case you need to do something with the encrypted file + names, or for debugging purposes. -The combine backend can join these together into a synthetic directory -structure like this: + Properties: - $ rclone tree combined: - / - ├── files - │ ├── file1.txt - │ └── file2.txt - └── images - ├── image1.jpg - └── image2.jpg + - Config: show_mapping + - Env Var: RCLONE_CRYPT_SHOW_MAPPING + - Type: bool + - Default: false -You'd do this by specifying an upstreams parameter in the config like -this + #### --crypt-no-data-encryption - upstreams = images=s3:imagesbucket files=drive:important/files + Option to either encrypt file data or leave it unencrypted. -During the initial setup with rclone config you will specify the -upstreams remotes as a space separated list. The upstream remotes can -either be a local paths or other remotes. + Properties: -Configuration + - Config: no_data_encryption + - Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION + - Type: bool + - Default: false + - Examples: + - "true" + - Don't encrypt file data, leave it unencrypted. + - "false" + - Encrypt file data. -Here is an example of how to make a combine called remote for the -example above. First run: + #### --crypt-pass-bad-blocks - rclone config + If set this will pass bad blocks through as all 0. -This will guide you through an interactive setup process: + This should not be set in normal operation, it should only be set if + trying to recover an encrypted file with errors and it is desired to + recover as much of the file as possible. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - ... - XX / Combine several remotes into one - \ (combine) - ... - Storage> combine - Option upstreams. - Upstreams for combining - These should be in the form - dir=remote:path dir2=remote2:path - Where before the = is specified the root directory and after is the remote to - put there. - Embedded spaces can be added using quotes - "dir=remote:path with space" "dir2=remote2:path with space" - Enter a fs.SpaceSepList value. - upstreams> images=s3:imagesbucket files=drive:important/files - -------------------- - [remote] - type = combine - upstreams = images=s3:imagesbucket files=drive:important/files - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + Properties: -Configuring for Google Drive Shared Drives + - Config: pass_bad_blocks + - Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS + - Type: bool + - Default: false -Rclone has a convenience feature for making a combine backend for all -the shared drives you have access to. + #### --crypt-filename-encoding -Assuming your main (non shared drive) Google drive remote is called -drive: you would run + How to encode the encrypted filename to text string. - rclone backend -o config drives drive: + This option could help with shortening the encrypted filename. The + suitable option would depend on the way your remote count the filename + length and if it's case sensitive. -This would produce something like this: + Properties: - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: + - Config: filename_encoding + - Env Var: RCLONE_CRYPT_FILENAME_ENCODING + - Type: string + - Default: "base32" + - Examples: + - "base32" + - Encode using base32. Suitable for all remote. + - "base64" + - Encode using base64. Suitable for case sensitive remote. + - "base32768" + - Encode using base32768. Suitable if your remote counts UTF-16 or + - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: + #### --crypt-suffix - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" + If this is set it will override the default suffix of ".bin". -If you then add that config to your config file (find it with -rclone config file) then you can access all the shared drives in one -place with the AllDrives: remote. + Setting suffix to "none" will result in an empty suffix. This may be useful + when the path length is critical. -See the Google Drive docs for full info. + Properties: -Standard options + - Config: suffix + - Env Var: RCLONE_CRYPT_SUFFIX + - Type: string + - Default: ".bin" -Here are the Standard options specific to combine (Combine several -remotes into one). + ### Metadata ---combine-upstreams + Any metadata supported by the underlying remote is read and written. -Upstreams for combining + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -These should be in the form + ## Backend commands - dir=remote:path dir2=remote2:path + Here are the commands specific to the crypt backend. -Where before the = is specified the root directory and after is the -remote to put there. + Run them with -Embedded spaces can be added using quotes + rclone backend COMMAND remote: - "dir=remote:path with space" "dir2=remote2:path with space" + The help below will explain what arguments each command takes. -Properties: + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -- Config: upstreams -- Env Var: RCLONE_COMBINE_UPSTREAMS -- Type: SpaceSepList -- Default: + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -Metadata + ### encode -Any metadata supported by the underlying remote is read and written. + Encode the given filename(s) -See the metadata docs for more info. + rclone backend encode remote: [options] [+] -Dropbox + This encodes the filenames given as arguments returning a list of + strings of the encoded results. -Paths are specified as remote:path + Usage Example: -Dropbox paths may be as deep as required, e.g. -remote:directory/subdirectory. + rclone backend encode crypt: file1 [file2...] + rclone rc backend/command command=encode fs=crypt: file1 [file2...] -Configuration -The initial setup for dropbox involves getting a token from Dropbox -which you need to do in your browser. rclone config walks you through -it. + ### decode -Here is an example of how to make a remote called remote. First run: + Decode the given filename(s) - rclone config + rclone backend decode remote: [options] [+] -This will guide you through an interactive setup process: + This decodes the filenames given as arguments returning a list of + strings of the decoded results. It will return an error if any of the + inputs are invalid. - n) New remote - d) Delete remote - q) Quit config - e/n/d/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Dropbox - \ "dropbox" - [snip] - Storage> dropbox - Dropbox App Key - leave blank normally. - app_key> - Dropbox App Secret - leave blank normally. - app_secret> - Remote config - Please visit: - https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code - Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX - -------------------- - [remote] - app_key = - app_secret = - token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Usage Example: -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + rclone backend decode crypt: encryptedfile1 [encryptedfile2...] + rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] -Note that rclone runs a webserver on your local machine to collect the -token as returned from Dropbox. This only runs from the moment it opens -your browser to the moment you get back the verification code. This is -on http://127.0.0.1:53682/ and it may require you to unblock it -temporarily if you are running a host firewall, or use manual mode. -You can then use it like this, -List directories in top level of your dropbox - rclone lsd remote: + ## Backing up an encrypted remote -List all the files in your dropbox + If you wish to backup an encrypted remote, it is recommended that you use + `rclone sync` on the encrypted files, and make sure the passwords are + the same in the new encrypted remote. - rclone ls remote: + This will have the following advantages -To copy a local directory to a dropbox directory called backup + * `rclone sync` will check the checksums while copying + * you can use `rclone check` between the encrypted remotes + * you don't decrypt and encrypt unnecessarily - rclone copy /home/source remote:backup + For example, let's say you have your original remote at `remote:` with + the encrypted version at `eremote:` with path `remote:crypt`. You + would then set up the new remote `remote2:` and then the encrypted + version `eremote2:` with path `remote2:crypt` using the same passwords + as `eremote:`. -Dropbox for business + To sync the two remotes you would do -Rclone supports Dropbox for business and Team Folders. + rclone sync --interactive remote:crypt remote2:crypt -When using Dropbox for business remote: and remote:path/to/file will -refer to your personal folder. + And to check the integrity you would do -If you wish to see Team Folders you must use a leading / in the path, so -rclone lsd remote:/ will refer to the root and show you all Team Folders -and your User Folder. + rclone check remote:crypt remote2:crypt -You can then use team folders like this remote:/TeamFolder and -remote:/TeamFolder/path/to/file. + ## File formats -A leading / for a Dropbox personal account will do nothing, but it will -take an extra HTTP transaction so it should be avoided. + ### File encryption -Modified time and Hashes + Files are encrypted 1:1 source file to destination object. The file + has a header and is divided into chunks. -Dropbox supports modified times, but the only way to set a modification -time is to re-upload the file. + #### Header -This means that if you uploaded your data with an older version of -rclone which didn't support the v2 API and modified times, rclone will -decide to upload all your old data to fix the modification times. If you -don't want this to happen use --size-only or --checksum flag to stop it. + * 8 bytes magic string `RCLONE\x00\x00` + * 24 bytes Nonce (IV) -Dropbox supports its own hash type which is checked for all transfers. + The initial nonce is generated from the operating systems crypto + strong random number generator. The nonce is incremented for each + chunk read making sure each nonce is unique for each block written. + The chance of a nonce being reused is minuscule. If you wrote an + exabyte of data (10¹⁸ bytes) you would have a probability of + approximately 2×10⁻³² of re-using a nonce. -Restricted filename characters + #### Chunk - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - / 0x2F / - DEL 0x7F ␡ - \ 0x5C \ + Each chunk will contain 64 KiB of data, except for the last one which + may have less data. The data chunk is in standard NaCl SecretBox + format. SecretBox uses XSalsa20 and Poly1305 to encrypt and + authenticate messages. -File names can also not end with the following characters. These only -get replaced if they are the last character in the name: + Each chunk contains: - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ + * 16 Bytes of Poly1305 authenticator + * 1 - 65536 bytes XSalsa20 encrypted data -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + 64k chunk size was chosen as the best performing chunk size (the + authenticator takes too much time below this and the performance drops + off due to cache effects above this). Note that these chunks are + buffered in memory so they can't be too big. -Batch mode uploads + This uses a 32 byte (256 bit key) key derived from the user password. -Using batch mode uploads is very important for performance when using -the Dropbox API. See the dropbox performance guide for more info. + #### Examples -There are 3 modes rclone can use for uploads. + 1 byte file will encrypt to ---dropbox-batch-mode off + * 32 bytes header + * 17 bytes data chunk -In this mode rclone will not use upload batching. This was the default -before rclone v1.55. It has the disadvantage that it is very likely to -encounter too_many_requests errors like this + 49 bytes total - NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. + 1 MiB (1048576 bytes) file will encrypt to -When rclone receives these it has to wait for 15s or sometimes 300s -before continuing which really slows down transfers. + * 32 bytes header + * 16 chunks of 65568 bytes -This will happen especially if --transfers is large, so this mode isn't -recommended except for compatibility or investigating problems. + 1049120 bytes total (a 0.05% overhead). This is the overhead for big + files. ---dropbox-batch-mode sync + ### Name encryption -In this mode rclone will batch up uploads to the size specified by ---dropbox-batch-size and commit them together. + File names are encrypted segment by segment - the path is broken up + into `/` separated strings and these are encrypted individually. -Using this mode means you can use a much higher --transfers parameter -(32 or 64 works fine) without receiving too_many_requests errors. + File segments are padded using PKCS#7 to a multiple of 16 bytes + before encryption. -This mode ensures full data integrity. + They are then encrypted with EME using AES with 256 bit key. EME + (ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 + paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. + This makes for deterministic encryption which is what we want - the + same filename must encrypt to the same thing otherwise we can't find + it on the cloud storage system. ---dropbox-batch-mode async + This means that -In this mode rclone will batch up uploads to the size specified by ---dropbox-batch-size and commit them together. + * filenames with the same name will encrypt the same + * filenames which start the same won't have a common prefix -However it will not wait for the status of the batch to be returned to -the caller. This means rclone can use a much bigger batch size (much -bigger than --transfers), at the cost of not being able to check the -status of the upload. + This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of + which are derived from the user password. -This provides the maximum possible upload speed especially with lots of -small files, however rclone can't check the file got uploaded properly -using this mode. + After encryption they are written out using a modified version of + standard `base32` encoding as described in RFC4648. The standard + encoding is modified in two ways: -If you are using this mode then using "rclone check" after the transfer -completes is recommended. Or you could do an initial transfer with ---dropbox-batch-mode async then do a final transfer with ---dropbox-batch-mode sync (the default). + * it becomes lower case (no-one likes upper case filenames!) + * we strip the padding character `=` -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. + `base32` is used rather than the more efficient `base64` so rclone can be + used on case insensitive remotes (e.g. Windows, Amazon Drive). -Standard options + ### Key derivation -Here are the Standard options specific to dropbox (Dropbox). + Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an + optional user supplied salt (password2) to derive the 32+32+16 = 80 + bytes of key material required. If the user doesn't supply a salt + then rclone uses an internal one. ---dropbox-client-id + `scrypt` makes it impractical to mount a dictionary attack on rclone + encrypted data. For full protection against this you should always use + a salt. -OAuth Client Id. + ## SEE ALSO -Leave blank normally. + * [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames -Properties: + # Compress -- Config: client_id -- Env Var: RCLONE_DROPBOX_CLIENT_ID -- Type: string -- Required: false + ## Warning ---dropbox-client-secret + This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is + at your own risk. Please understand the risks associated with using experimental code and don't use this remote in + critical applications. -OAuth Client Secret. + The `Compress` remote adds compression to another remote. It is best used with remotes containing + many large compressible files. -Leave blank normally. + ## Configuration -Properties: + To use this remote, all you need to do is specify another remote and a compression mode to use: -- Config: client_secret -- Env Var: RCLONE_DROPBOX_CLIENT_SECRET -- Type: string -- Required: false +Current remotes: -Advanced options +Name Type ==== ==== remote_to_press sometype -Here are the Advanced options specific to dropbox (Dropbox). +e) Edit existing remote $ rclone config +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> n name> compress ... 8 / Compress a + remote  "compress" ... Storage> compress ** See help for compress + backend at: https://rclone.org/compress/ ** ---dropbox-token +Remote to compress. Enter a string value. Press Enter for the default +(""). remote> remote_to_press:subdir Compression mode. Enter a string +value. Press Enter for the default ("gzip"). Choose a number from below, +or type in your own value 1 / Gzip compression balanced for speed and +compression strength.  "gzip" compression_mode> gzip Edit advanced +config? (y/n) y) Yes n) No (default) y/n> n Remote config +-------------------- [compress] type = compress remote = +remote_to_press:subdir compression_mode = gzip -------------------- y) +Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> y -OAuth Access Token as a JSON blob. -Properties: + ### Compression Modes -- Config: token -- Env Var: RCLONE_DROPBOX_TOKEN -- Type: string -- Required: false + Currently only gzip compression is supported. It provides a decent balance between speed and size and is well + supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no + compression and 9 is strongest compression. ---dropbox-auth-url + ### File types -Auth server URL. + If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to + the compression algorithm you chose. These files are standard files that can be opened by various archive programs, + but they have some hidden metadata that allows them to be used by rclone. + While you may download and decompress these files at will, do **not** manually delete or rename files. Files without + correct metadata files will not be recognized by rclone. -Leave blank to use the provider defaults. + ### File names -Properties: + The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded + size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. -- Config: auth_url -- Env Var: RCLONE_DROPBOX_AUTH_URL -- Type: string -- Required: false ---dropbox-token-url + ### Standard options -Token server url. + Here are the Standard options specific to compress (Compress a remote). -Leave blank to use the provider defaults. + #### --compress-remote -Properties: + Remote to compress. -- Config: token_url -- Env Var: RCLONE_DROPBOX_TOKEN_URL -- Type: string -- Required: false + Properties: ---dropbox-chunk-size + - Config: remote + - Env Var: RCLONE_COMPRESS_REMOTE + - Type: string + - Required: true -Upload chunk size (< 150Mi). + #### --compress-mode -Any files larger than this will be uploaded in chunks of this size. + Compression mode. -Note that chunks are buffered in memory (one at a time) so rclone can -deal with retries. Setting this larger will increase the speed slightly -(at most 10% for 128 MiB in tests) at the cost of using more memory. It -can be set smaller if you are tight on memory. + Properties: -Properties: + - Config: mode + - Env Var: RCLONE_COMPRESS_MODE + - Type: string + - Default: "gzip" + - Examples: + - "gzip" + - Standard gzip compression with fastest parameters. -- Config: chunk_size -- Env Var: RCLONE_DROPBOX_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi + ### Advanced options ---dropbox-impersonate + Here are the Advanced options specific to compress (Compress a remote). -Impersonate this user when using a business account. + #### --compress-level -Note that if you want to use impersonate, you should make sure this flag -is set when running "rclone config" as this will cause rclone to request -the "members.read" scope which it won't normally. This is needed to -lookup a members email address into the internal ID that dropbox uses in -the API. + GZIP compression level (-2 to 9). -Using the "members.read" scope will require a Dropbox Team Admin to -approve during the OAuth flow. + Generally -1 (default, equivalent to 5) is recommended. + Levels 1 to 9 increase compression at the cost of speed. Going past 6 + generally offers very little return. -You will have to use your own App (setting your own client_id and -client_secret) to use this option as currently rclone's default set of -permissions doesn't include "members.read". This can be added once v1.55 -or later is in use everywhere. + Level -2 uses Huffman encoding only. Only use if you know what you + are doing. + Level 0 turns off compression. -Properties: + Properties: -- Config: impersonate -- Env Var: RCLONE_DROPBOX_IMPERSONATE -- Type: string -- Required: false + - Config: level + - Env Var: RCLONE_COMPRESS_LEVEL + - Type: int + - Default: -1 ---dropbox-shared-files + #### --compress-ram-cache-limit -Instructs rclone to work on individual shared files. + Some remotes don't allow the upload of files with unknown size. + In this case the compressed file will need to be cached to determine + it's size. -In this mode rclone's features are extremely limited - only list (ls, -lsl, etc.) operations and read operations (e.g. downloading) are -supported in this mode. All other operations will be disabled. + Files smaller than this limit will be cached in RAM, files larger than + this limit will be cached on disk. -Properties: + Properties: -- Config: shared_files -- Env Var: RCLONE_DROPBOX_SHARED_FILES -- Type: bool -- Default: false + - Config: ram_cache_limit + - Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT + - Type: SizeSuffix + - Default: 20Mi ---dropbox-shared-folders + ### Metadata -Instructs rclone to work on shared folders. + Any metadata supported by the underlying remote is read and written. -When this flag is used with no path only the List operation is supported -and all available shared folders will be listed. If you specify a path -the first part will be interpreted as the name of shared folder. Rclone -will then try to mount this shared to the root namespace. On success -shared folder rclone proceeds normally. The shared folder is now pretty -much a normal folder and all normal operations are supported. + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -Note that we don't unmount the shared folder afterwards so the ---dropbox-shared-folders can be omitted after the first use of a -particular shared folder. -Properties: -- Config: shared_folders -- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS -- Type: bool -- Default: false + # Combine ---dropbox-batch-mode + The `combine` backend joins remotes together into a single directory + tree. -Upload file batching sync|async|off. + For example you might have a remote for images on one provider: -This sets the batch mode used by rclone. +$ rclone tree s3:imagesbucket / ├── image1.jpg └── image2.jpg -For full info see the main docs -This has 3 possible values + And a remote for files on another: -- off - no batching -- sync - batch uploads and check completion (default) -- async - batch upload and don't check completion +$ rclone tree drive:important/files / ├── file1.txt └── file2.txt -Rclone will close any outstanding batches when it exits which may make a -delay on quit. -Properties: + The `combine` backend can join these together into a synthetic + directory structure like this: -- Config: batch_mode -- Env Var: RCLONE_DROPBOX_BATCH_MODE -- Type: string -- Default: "sync" +$ rclone tree combined: / ├── files │ ├── file1.txt │ └── file2.txt └── +images ├── image1.jpg └── image2.jpg ---dropbox-batch-size -Max number of files in upload batch. + You'd do this by specifying an `upstreams` parameter in the config + like this -This sets the batch size of files to upload. It has to be less than -1000. + upstreams = images=s3:imagesbucket files=drive:important/files -By default this is 0 which means rclone which calculate the batch size -depending on the setting of batch_mode. + During the initial setup with `rclone config` you will specify the + upstreams remotes as a space separated list. The upstream remotes can + either be a local paths or other remotes. -- batch_mode: async - default batch_size is 100 -- batch_mode: sync - default batch_size is the same as --transfers -- batch_mode: off - not in use + ## Configuration -Rclone will close any outstanding batches when it exits which may make a -delay on quit. + Here is an example of how to make a combine called `remote` for the + example above. First run: -Setting this is a great idea if you are uploading lots of small files as -it will make them a lot quicker. You can use --transfers 32 to maximise -throughput. + rclone config -Properties: + This will guide you through an interactive setup process: -- Config: batch_size -- Env Var: RCLONE_DROPBOX_BATCH_SIZE -- Type: int -- Default: 0 +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. ... XX / Combine several remotes into one  (combine) ... Storage> +combine Option upstreams. Upstreams for combining These should be in the +form dir=remote:path dir2=remote2:path Where before the = is specified +the root directory and after is the remote to put there. Embedded spaces +can be added using quotes "dir=remote:path with space" +"dir2=remote2:path with space" Enter a fs.SpaceSepList value. upstreams> +images=s3:imagesbucket files=drive:important/files -------------------- +[remote] type = combine upstreams = images=s3:imagesbucket +files=drive:important/files -------------------- y) Yes this is OK +(default) e) Edit this remote d) Delete this remote y/e/d> y ---dropbox-batch-timeout -Max time to allow an idle upload batch before uploading. + ### Configuring for Google Drive Shared Drives -If an upload batch is idle for more than this long then it will be -uploaded. + Rclone has a convenience feature for making a combine backend for all + the shared drives you have access to. -The default for this is 0 which means rclone will choose a sensible -default based on the batch_mode in use. + Assuming your main (non shared drive) Google drive remote is called + `drive:` you would run -- batch_mode: async - default batch_timeout is 500ms -- batch_mode: sync - default batch_timeout is 10s -- batch_mode: off - not in use + rclone backend -o config drives drive: -Properties: + This would produce something like this: -- Config: batch_timeout -- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT -- Type: Duration -- Default: 0s + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: ---dropbox-batch-commit-timeout + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: -Max time to wait for a batch to finish committing + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" -Properties: + If you then add that config to your config file (find it with `rclone + config file`) then you can access all the shared drives in one place + with the `AllDrives:` remote. -- Config: batch_commit_timeout -- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT -- Type: Duration -- Default: 10m0s + See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. ---dropbox-encoding -The encoding for the backend. + ### Standard options -See the encoding section in the overview for more info. + Here are the Standard options specific to combine (Combine several remotes into one). -Properties: + #### --combine-upstreams -- Config: encoding -- Env Var: RCLONE_DROPBOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot + Upstreams for combining -Limitations + These should be in the form -Note that Dropbox is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + dir=remote:path dir2=remote2:path -There are some file names such as thumbs.db which Dropbox can't store. -There is a full list of them in the "Ignored Files" section of this -document. Rclone will issue an error message -File name disallowed - not uploading if it attempts to upload one of -those file names, but the sync won't fail. + Where before the = is specified the root directory and after is the remote to + put there. -Some errors may occur if you try to sync copyright-protected files -because Dropbox has its own copyright detector that prevents this sort -of file being downloaded. This will return the error -ERROR : /path/to/your/file: Failed to copy: failed to open source object: path/restricted_content/. + Embedded spaces can be added using quotes -If you have more than 10,000 files in a directory then -rclone purge dropbox:dir will return the error -Failed to purge: There are too many files involved in this operation. As -a work-around do an rclone delete dropbox:dir followed by an -rclone rmdir dropbox:dir. + "dir=remote:path with space" "dir2=remote2:path with space" -When using rclone link you'll need to set --expire if using a -non-personal account otherwise the visibility may not be correct. (Note -that --expire isn't supported on personal accounts). See the forum -discussion and the dropbox SDK issue. -Get your own Dropbox App ID -When you use rclone with Dropbox in its default configuration you are -using rclone's App ID. This is shared between all the rclone users. + Properties: -Here is how to create your own Dropbox App ID for rclone: + - Config: upstreams + - Env Var: RCLONE_COMBINE_UPSTREAMS + - Type: SpaceSepList + - Default: -1. Log into the Dropbox App console with your Dropbox Account (It need - not to be the same account as the Dropbox you want to access) + ### Metadata -2. Choose an API => Usually this should be Dropbox API + Any metadata supported by the underlying remote is read and written. -3. Choose the type of access you want to use => Full Dropbox or - App Folder + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -4. Name your App. The app name is global, so you can't use rclone for - example -5. Click the button Create App -6. Switch to the Permissions tab. Enable at least the following - permissions: account_info.read, files.metadata.write, - files.content.write, files.content.read, sharing.write. The - files.metadata.read and sharing.read checkboxes will be marked too. - Click Submit + # Dropbox -7. Switch to the Settings tab. Fill OAuth2 - Redirect URIs as - http://localhost:53682/ + Paths are specified as `remote:path` -8. Find the App key and App secret values on the Settings tab. Use - these values in rclone config to add a new remote or edit an - existing remote. The App key setting corresponds to client_id in - rclone config, the App secret corresponds to client_secret + Dropbox paths may be as deep as required, e.g. + `remote:directory/subdirectory`. -Enterprise File Fabric + ## Configuration -This backend supports Storage Made Easy's Enterprise File Fabric™ which -provides a software solution to integrate and unify File and Object -Storage accessible through a global file system. + The initial setup for dropbox involves getting a token from Dropbox + which you need to do in your browser. `rclone config` walks you + through it. -Configuration + Here is an example of how to make a remote called `remote`. First run: -The initial setup for the Enterprise File Fabric backend involves -getting a token from the Enterprise File Fabric which you need to do in -your browser. rclone config walks you through it. + rclone config -Here is an example of how to make a remote called remote. First run: + This will guide you through an interactive setup process: - rclone config +n) New remote +o) Delete remote +p) Quit config e/n/d/q> n name> remote Type of storage to configure. + Choose a number from below, or type in your own value [snip] XX / + Dropbox  "dropbox" [snip] Storage> dropbox Dropbox App Key - leave + blank normally. app_key> Dropbox App Secret - leave blank normally. + app_secret> Remote config Please visit: + https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code + Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX + -------------------- [remote] app_key = app_secret = token = + XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX + -------------------- +q) Yes this is OK +r) Edit this remote +s) Delete this remote y/e/d> y -This will guide you through an interactive setup process: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Enterprise File Fabric - \ "filefabric" - [snip] - Storage> filefabric - ** See help for filefabric backend at: https://rclone.org/filefabric/ ** + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. - URL of the Enterprise File Fabric to connect to - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Storage Made Easy US - \ "https://storagemadeeasy.com" - 2 / Storage Made Easy EU - \ "https://eu.storagemadeeasy.com" - 3 / Connect to your Enterprise File Fabric - \ "https://yourfabric.smestorage.com" - url> https://yourfabric.smestorage.com/ - ID of the root folder - Leave blank normally. + Note that rclone runs a webserver on your local machine to collect the + token as returned from Dropbox. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and it + may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. - Fill in to make rclone start with directory of a given ID. + You can then use it like this, - Enter a string value. Press Enter for the default (""). - root_folder_id> - Permanent Authentication Token + List directories in top level of your dropbox - A Permanent Authentication Token can be created in the Enterprise File - Fabric, on the users Dashboard under Security, there is an entry - you'll see called "My Authentication Tokens". Click the Manage button - to create one. + rclone lsd remote: - These tokens are normally valid for several years. + List all the files in your dropbox - For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens + rclone ls remote: - Enter a string value. Press Enter for the default (""). - permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [remote] - type = filefabric - url = https://yourfabric.smestorage.com/ - permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + To copy a local directory to a dropbox directory called backup -Once configured you can then use rclone like this, + rclone copy /home/source remote:backup -List directories in top level of your Enterprise File Fabric + ### Dropbox for business - rclone lsd remote: + Rclone supports Dropbox for business and Team Folders. -List all the files in your Enterprise File Fabric + When using Dropbox for business `remote:` and `remote:path/to/file` + will refer to your personal folder. - rclone ls remote: + If you wish to see Team Folders you must use a leading `/` in the + path, so `rclone lsd remote:/` will refer to the root and show you all + Team Folders and your User Folder. -To copy a local directory to an Enterprise File Fabric directory called -backup + You can then use team folders like this `remote:/TeamFolder` and + `remote:/TeamFolder/path/to/file`. - rclone copy /home/source remote:backup + A leading `/` for a Dropbox personal account will do nothing, but it + will take an extra HTTP transaction so it should be avoided. -Modified time and hashes + ### Modification times and hashes -The Enterprise File Fabric allows modification times to be set on files -accurate to 1 second. These will be used to detect whether objects need -syncing or not. + Dropbox supports modified times, but the only way to set a + modification time is to re-upload the file. -The Enterprise File Fabric does not support any data hashes at this -time. + This means that if you uploaded your data with an older version of + rclone which didn't support the v2 API and modified times, rclone will + decide to upload all your old data to fix the modification times. If + you don't want this to happen use `--size-only` or `--checksum` flag + to stop it. -Restricted filename characters + Dropbox supports [its own hash + type](https://www.dropbox.com/developers/reference/content-hash) which + is checked for all transfers. -The default restricted characters set will be replaced. + ### Restricted filename characters -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | / | 0x2F | / | + | DEL | 0x7F | ␡ | + | \ | 0x5C | \ | -Empty files + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: -Empty files aren't supported by the Enterprise File Fabric. Rclone will -therefore upload an empty file as a single space with a mime type of -application/vnd.rclone.empty.file and files with that mime type are -treated as empty. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | -Root folder ID + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -You can set the root_folder_id for rclone. This is the directory -(identified by its Folder ID) that rclone considers to be the root of -your Enterprise File Fabric. + ### Batch mode uploads {#batch-mode} -Normally you will leave this blank and rclone will determine the correct -root to use itself. + Using batch mode uploads is very important for performance when using + the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) + for more info. -However you can set this to restrict rclone to a specific folder -hierarchy. + There are 3 modes rclone can use for uploads. -In order to do this you will have to find the Folder ID of the directory -you wish rclone to display. These aren't displayed in the web interface, -but you can use rclone lsf to find them, for example + #### --dropbox-batch-mode off - $ rclone lsf --dirs-only -Fip --csv filefabric: - 120673758,Burnt PDFs/ - 120673759,My Quick Uploads/ - 120673755,My Syncs/ - 120673756,My backups/ - 120673757,My contacts/ - 120673761,S3 Storage/ + In this mode rclone will not use upload batching. This was the default + before rclone v1.55. It has the disadvantage that it is very likely to + encounter `too_many_requests` errors like this -The ID for "S3 Storage" would be 120673761. + NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. -Standard options + When rclone receives these it has to wait for 15s or sometimes 300s + before continuing which really slows down transfers. -Here are the Standard options specific to filefabric (Enterprise File -Fabric). + This will happen especially if `--transfers` is large, so this mode + isn't recommended except for compatibility or investigating problems. ---filefabric-url + #### --dropbox-batch-mode sync -URL of the Enterprise File Fabric to connect to. + In this mode rclone will batch up uploads to the size specified by + `--dropbox-batch-size` and commit them together. -Properties: + Using this mode means you can use a much higher `--transfers` + parameter (32 or 64 works fine) without receiving `too_many_requests` + errors. -- Config: url -- Env Var: RCLONE_FILEFABRIC_URL -- Type: string -- Required: true -- Examples: - - "https://storagemadeeasy.com" - - Storage Made Easy US - - "https://eu.storagemadeeasy.com" - - Storage Made Easy EU - - "https://yourfabric.smestorage.com" - - Connect to your Enterprise File Fabric + This mode ensures full data integrity. ---filefabric-root-folder-id + Note that there may be a pause when quitting rclone while rclone + finishes up the last batch using this mode. -ID of the root folder. + #### --dropbox-batch-mode async -Leave blank normally. + In this mode rclone will batch up uploads to the size specified by + `--dropbox-batch-size` and commit them together. -Fill in to make rclone start with directory of a given ID. + However it will not wait for the status of the batch to be returned to + the caller. This means rclone can use a much bigger batch size (much + bigger than `--transfers`), at the cost of not being able to check the + status of the upload. -Properties: + This provides the maximum possible upload speed especially with lots + of small files, however rclone can't check the file got uploaded + properly using this mode. -- Config: root_folder_id -- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID -- Type: string -- Required: false + If you are using this mode then using "rclone check" after the + transfer completes is recommended. Or you could do an initial transfer + with `--dropbox-batch-mode async` then do a final transfer with + `--dropbox-batch-mode sync` (the default). ---filefabric-permanent-token + Note that there may be a pause when quitting rclone while rclone + finishes up the last batch using this mode. -Permanent Authentication Token. -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry you'll -see called "My Authentication Tokens". Click the Manage button to create -one. -These tokens are normally valid for several years. + ### Standard options -For more info see: -https://docs.storagemadeeasy.com/organisationcloud/api-tokens + Here are the Standard options specific to dropbox (Dropbox). -Properties: + #### --dropbox-client-id -- Config: permanent_token -- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN -- Type: string -- Required: false + OAuth Client Id. -Advanced options + Leave blank normally. -Here are the Advanced options specific to filefabric (Enterprise File -Fabric). + Properties: ---filefabric-token + - Config: client_id + - Env Var: RCLONE_DROPBOX_CLIENT_ID + - Type: string + - Required: false -Session Token. + #### --dropbox-client-secret -This is a session token which rclone caches in the config file. It is -usually valid for 1 hour. + OAuth Client Secret. -Don't set this value - rclone will set it automatically. + Leave blank normally. -Properties: + Properties: -- Config: token -- Env Var: RCLONE_FILEFABRIC_TOKEN -- Type: string -- Required: false + - Config: client_secret + - Env Var: RCLONE_DROPBOX_CLIENT_SECRET + - Type: string + - Required: false ---filefabric-token-expiry + ### Advanced options -Token expiry time. + Here are the Advanced options specific to dropbox (Dropbox). -Don't set this value - rclone will set it automatically. + #### --dropbox-token -Properties: + OAuth Access Token as a JSON blob. -- Config: token_expiry -- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY -- Type: string -- Required: false + Properties: ---filefabric-version + - Config: token + - Env Var: RCLONE_DROPBOX_TOKEN + - Type: string + - Required: false -Version read from the file fabric. + #### --dropbox-auth-url -Don't set this value - rclone will set it automatically. + Auth server URL. -Properties: + Leave blank to use the provider defaults. -- Config: version -- Env Var: RCLONE_FILEFABRIC_VERSION -- Type: string -- Required: false + Properties: ---filefabric-encoding + - Config: auth_url + - Env Var: RCLONE_DROPBOX_AUTH_URL + - Type: string + - Required: false -The encoding for the backend. + #### --dropbox-token-url -See the encoding section in the overview for more info. + Token server url. -Properties: + Leave blank to use the provider defaults. -- Config: encoding -- Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,InvalidUtf8,Dot + Properties: -FTP + - Config: token_url + - Env Var: RCLONE_DROPBOX_TOKEN_URL + - Type: string + - Required: false -FTP is the File Transfer Protocol. Rclone FTP support is provided using -the github.com/jlaffaye/ftp package. + #### --dropbox-chunk-size -Limitations of Rclone's FTP backend + Upload chunk size (< 150Mi). -Paths are specified as remote:path. If the path does not begin with a / -it is relative to the home directory of the user. An empty path remote: -refers to the user's home directory. + Any files larger than this will be uploaded in chunks of this size. -Configuration + Note that chunks are buffered in memory (one at a time) so rclone can + deal with retries. Setting this larger will increase the speed + slightly (at most 10% for 128 MiB in tests) at the cost of using more + memory. It can be set smaller if you are tight on memory. -To create an FTP configuration named remote, run + Properties: - rclone config + - Config: chunk_size + - Env Var: RCLONE_DROPBOX_CHUNK_SIZE + - Type: SizeSuffix + - Default: 48Mi -Rclone config guides you through an interactive setup process. A minimal -rclone FTP remote definition only requires host, username and password. -For an anonymous FTP server, see below. + #### --dropbox-impersonate - No remotes found, make a new one? - n) New remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - n/r/c/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / FTP - \ "ftp" - [snip] - Storage> ftp - ** See help for ftp backend at: https://rclone.org/ftp/ ** + Impersonate this user when using a business account. - FTP host to connect to - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Connect to ftp.example.com - \ "ftp.example.com" - host> ftp.example.com - FTP username - Enter a string value. Press Enter for the default ("$USER"). - user> - FTP port number - Enter a signed integer. Press Enter for the default (21). - port> - FTP password - y) Yes type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - Use FTP over TLS (Implicit) - Enter a boolean value (true or false). Press Enter for the default ("false"). - tls> - Use FTP over TLS (Explicit) - Enter a boolean value (true or false). Press Enter for the default ("false"). - explicit_tls> - Remote config - -------------------- - [remote] - type = ftp - host = ftp.example.com - pass = *** ENCRYPTED *** - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Note that if you want to use impersonate, you should make sure this + flag is set when running "rclone config" as this will cause rclone to + request the "members.read" scope which it won't normally. This is + needed to lookup a members email address into the internal ID that + dropbox uses in the API. -To see all directories in the home directory of remote + Using the "members.read" scope will require a Dropbox Team Admin + to approve during the OAuth flow. - rclone lsd remote: + You will have to use your own App (setting your own client_id and + client_secret) to use this option as currently rclone's default set of + permissions doesn't include "members.read". This can be added once + v1.55 or later is in use everywhere. -Make a new directory - rclone mkdir remote:path/to/directory + Properties: -List the contents of a directory + - Config: impersonate + - Env Var: RCLONE_DROPBOX_IMPERSONATE + - Type: string + - Required: false - rclone ls remote:path/to/directory + #### --dropbox-shared-files -Sync /home/local/directory to the remote directory, deleting any excess -files in the directory. + Instructs rclone to work on individual shared files. - rclone sync --interactive /home/local/directory remote:directory + In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) + operations and read operations (e.g. downloading) are supported in this mode. + All other operations will be disabled. -Anonymous FTP + Properties: -When connecting to a FTP server that allows anonymous login, you can use -the special "anonymous" username. Traditionally, this user account -accepts any string as a password, although it is common to use either -the password "anonymous" or "guest". Some servers require the use of a -valid e-mail address as password. + - Config: shared_files + - Env Var: RCLONE_DROPBOX_SHARED_FILES + - Type: bool + - Default: false -Using on-the-fly or connection string remotes makes it easy to access -such servers, without requiring any configuration in advance. The -following are examples of that: + #### --dropbox-shared-folders - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): + Instructs rclone to work on shared folders. + + When this flag is used with no path only the List operation is supported and + all available shared folders will be listed. If you specify a path the first part + will be interpreted as the name of shared folder. Rclone will then try to mount this + shared to the root namespace. On success shared folder rclone proceeds normally. + The shared folder is now pretty much a normal folder and all normal operations + are supported. -The above examples work in Linux shells and in PowerShell, but not -Windows Command Prompt. They execute the rclone obscure command to -create a password string in the format required by the pass option. The -following examples are exactly the same, except use an already obscured -string representation of the same password "dummy", and therefore works -even in Windows Command Prompt: + Note that we don't unmount the shared folder afterwards so the + --dropbox-shared-folders can be omitted after the first use of a particular + shared folder. - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: + Properties: -Implicit TLS + - Config: shared_folders + - Env Var: RCLONE_DROPBOX_SHARED_FOLDERS + - Type: bool + - Default: false -Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to be -enabled in the FTP backend config for the remote, or with --ftp-tls. The -default FTPS port is 990, not 21 and can be set with --ftp-port. + #### --dropbox-pacer-min-sleep -Restricted filename characters + Minimum time to sleep between API calls. -In addition to the default restricted characters set the following -characters are also replaced: + Properties: -File names cannot end with the following characters. Replacement is -limited to the last character in a file name: + - Config: pacer_min_sleep + - Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP + - Type: Duration + - Default: 10ms - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ + #### --dropbox-encoding -Not all FTP servers can have all characters in file names, for example: + The encoding for the backend. - FTP Server Forbidden characters - ------------ ---------------------- - proftpd * - pureftpd \ [ ] + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -This backend's interactive configuration wizard provides a selection of -sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, -VsFTPd. Just hit a selection number when prompted. + Properties: -Standard options + - Config: encoding + - Env Var: RCLONE_DROPBOX_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot -Here are the Standard options specific to ftp (FTP). + #### --dropbox-batch-mode ---ftp-host + Upload file batching sync|async|off. -FTP host to connect to. + This sets the batch mode used by rclone. -E.g. "ftp.example.com". + For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) -Properties: + This has 3 possible values -- Config: host -- Env Var: RCLONE_FTP_HOST -- Type: string -- Required: true + - off - no batching + - sync - batch uploads and check completion (default) + - async - batch upload and don't check completion ---ftp-user + Rclone will close any outstanding batches when it exits which may make + a delay on quit. -FTP username. -Properties: + Properties: -- Config: user -- Env Var: RCLONE_FTP_USER -- Type: string -- Default: "$USER" + - Config: batch_mode + - Env Var: RCLONE_DROPBOX_BATCH_MODE + - Type: string + - Default: "sync" ---ftp-port + #### --dropbox-batch-size -FTP port number. + Max number of files in upload batch. -Properties: + This sets the batch size of files to upload. It has to be less than 1000. -- Config: port -- Env Var: RCLONE_FTP_PORT -- Type: int -- Default: 21 + By default this is 0 which means rclone which calculate the batch size + depending on the setting of batch_mode. ---ftp-pass + - batch_mode: async - default batch_size is 100 + - batch_mode: sync - default batch_size is the same as --transfers + - batch_mode: off - not in use -FTP password. + Rclone will close any outstanding batches when it exits which may make + a delay on quit. -NB Input to this must be obscured - see rclone obscure. + Setting this is a great idea if you are uploading lots of small files + as it will make them a lot quicker. You can use --transfers 32 to + maximise throughput. -Properties: -- Config: pass -- Env Var: RCLONE_FTP_PASS -- Type: string -- Required: false + Properties: ---ftp-tls + - Config: batch_size + - Env Var: RCLONE_DROPBOX_BATCH_SIZE + - Type: int + - Default: 0 -Use Implicit FTPS (FTP over TLS). + #### --dropbox-batch-timeout -When using implicit FTP over TLS the client connects using TLS right -from the start which breaks compatibility with non-TLS-aware servers. -This is usually served over port 990 rather than port 21. Cannot be used -in combination with explicit FTPS. + Max time to allow an idle upload batch before uploading. -Properties: + If an upload batch is idle for more than this long then it will be + uploaded. -- Config: tls -- Env Var: RCLONE_FTP_TLS -- Type: bool -- Default: false + The default for this is 0 which means rclone will choose a sensible + default based on the batch_mode in use. ---ftp-explicit-tls + - batch_mode: async - default batch_timeout is 10s + - batch_mode: sync - default batch_timeout is 500ms + - batch_mode: off - not in use -Use Explicit FTPS (FTP over TLS). -When using explicit FTP over TLS the client explicitly requests security -from the server in order to upgrade a plain text connection to an -encrypted one. Cannot be used in combination with implicit FTPS. + Properties: -Properties: + - Config: batch_timeout + - Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT + - Type: Duration + - Default: 0s -- Config: explicit_tls -- Env Var: RCLONE_FTP_EXPLICIT_TLS -- Type: bool -- Default: false + #### --dropbox-batch-commit-timeout -Advanced options + Max time to wait for a batch to finish committing -Here are the Advanced options specific to ftp (FTP). + Properties: ---ftp-concurrency + - Config: batch_commit_timeout + - Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT + - Type: Duration + - Default: 10m0s -Maximum number of FTP simultaneous connections, 0 for unlimited. -Note that setting this is very likely to cause deadlocks so it should be -used with care. -If you are doing a sync or copy then make sure concurrency is one more -than the sum of --transfers and --checkers. + ## Limitations -If you use --check-first then it just needs to be one more than the -maximum of --checkers and --transfers. + Note that Dropbox is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". -So for concurrency 3 you'd use --checkers 2 --transfers 2 --check-first -or --checkers 1 --transfers 1. + There are some file names such as `thumbs.db` which Dropbox can't + store. There is a full list of them in the ["Ignored Files" section + of this document](https://www.dropbox.com/en/help/145). Rclone will + issue an error message `File name disallowed - not uploading` if it + attempts to upload one of those file names, but the sync won't fail. -Properties: + Some errors may occur if you try to sync copyright-protected files + because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that + prevents this sort of file being downloaded. This will return the error `ERROR : + /path/to/your/file: Failed to copy: failed to open source object: + path/restricted_content/.` -- Config: concurrency -- Env Var: RCLONE_FTP_CONCURRENCY -- Type: int -- Default: 0 + If you have more than 10,000 files in a directory then `rclone purge + dropbox:dir` will return the error `Failed to purge: There are too + many files involved in this operation`. As a work-around do an + `rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. ---ftp-no-check-certificate + When using `rclone link` you'll need to set `--expire` if using a + non-personal account otherwise the visibility may not be correct. + (Note that `--expire` isn't supported on personal accounts). See the + [forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the + [dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). -Do not verify the TLS certificate of the server. + ## Get your own Dropbox App ID -Properties: + When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. -- Config: no_check_certificate -- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE -- Type: bool -- Default: false + Here is how to create your own Dropbox App ID for rclone: ---ftp-disable-epsv + 1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not + to be the same account as the Dropbox you want to access) -Disable using EPSV even if server advertises support. + 2. Choose an API => Usually this should be `Dropbox API` -Properties: + 3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). -- Config: disable_epsv -- Env Var: RCLONE_FTP_DISABLE_EPSV -- Type: bool -- Default: false + 4. Name your App. The app name is global, so you can't use `rclone` for example ---ftp-disable-mlsd + 5. Click the button `Create App` -Disable using MLSD even if server advertises support. + 6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` -Properties: + 7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` -- Config: disable_mlsd -- Env Var: RCLONE_FTP_DISABLE_MLSD -- Type: bool -- Default: false + 8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` ---ftp-disable-utf8 + # Enterprise File Fabric -Disable using UTF-8 even if server advertises support. + This backend supports [Storage Made Easy's Enterprise File + Fabric™](https://storagemadeeasy.com/about/) which provides a software + solution to integrate and unify File and Object Storage accessible + through a global file system. -Properties: + ## Configuration -- Config: disable_utf8 -- Env Var: RCLONE_FTP_DISABLE_UTF8 -- Type: bool -- Default: false + The initial setup for the Enterprise File Fabric backend involves + getting a token from the Enterprise File Fabric which you need to + do in your browser. `rclone config` walks you through it. ---ftp-writing-mdtm + Here is an example of how to make a remote called `remote`. First run: -Use MDTM to set modification time (VsFtpd quirk) + rclone config -Properties: + This will guide you through an interactive setup process: -- Config: writing_mdtm -- Env Var: RCLONE_FTP_WRITING_MDTM -- Type: bool -- Default: false +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +Enterprise File Fabric  "filefabric" [snip] Storage> filefabric ** See +help for filefabric backend at: https://rclone.org/filefabric/ ** ---ftp-force-list-hidden +URL of the Enterprise File Fabric to connect to Enter a string value. +Press Enter for the default (""). Choose a number from below, or type in +your own value 1 / Storage Made Easy US  "https://storagemadeeasy.com" 2 +/ Storage Made Easy EU  "https://eu.storagemadeeasy.com" 3 / Connect to +your Enterprise File Fabric  "https://yourfabric.smestorage.com" url> +https://yourfabric.smestorage.com/ ID of the root folder Leave blank +normally. -Use LIST -a to force listing of hidden files and folders. This will -disable the use of MLSD. +Fill in to make rclone start with directory of a given ID. -Properties: +Enter a string value. Press Enter for the default (""). root_folder_id> +Permanent Authentication Token -- Config: force_list_hidden -- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN -- Type: bool -- Default: false +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry you'll +see called "My Authentication Tokens". Click the Manage button to create +one. ---ftp-idle-timeout +These tokens are normally valid for several years. -Max time before closing idle connections. +For more info see: +https://docs.storagemadeeasy.com/organisationcloud/api-tokens -If no connections have been returned to the connection pool in the time -given, rclone will empty the connection pool. +Enter a string value. Press Enter for the default (""). permanent_token> +xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) +No (default) y/n> n Remote config -------------------- [remote] type = +filefabric url = https://yourfabric.smestorage.com/ permanent_token = +xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK +(default) e) Edit this remote d) Delete this remote y/e/d> y -Set to 0 to keep connections indefinitely. -Properties: + Once configured you can then use `rclone` like this, -- Config: idle_timeout -- Env Var: RCLONE_FTP_IDLE_TIMEOUT -- Type: Duration -- Default: 1m0s + List directories in top level of your Enterprise File Fabric ---ftp-close-timeout + rclone lsd remote: -Maximum time to wait for a response to close. + List all the files in your Enterprise File Fabric -Properties: + rclone ls remote: -- Config: close_timeout -- Env Var: RCLONE_FTP_CLOSE_TIMEOUT -- Type: Duration -- Default: 1m0s + To copy a local directory to an Enterprise File Fabric directory called backup ---ftp-tls-cache-size + rclone copy /home/source remote:backup -Size of TLS session cache for all control and data connections. + ### Modification times and hashes -TLS cache allows to resume TLS sessions and reuse PSK between -connections. Increase if default size is not enough resulting in TLS -resumption errors. Enabled by default. Use 0 to disable. + The Enterprise File Fabric allows modification times to be set on + files accurate to 1 second. These will be used to detect whether + objects need syncing or not. -Properties: + The Enterprise File Fabric does not support any data hashes at this time. -- Config: tls_cache_size -- Env Var: RCLONE_FTP_TLS_CACHE_SIZE -- Type: int -- Default: 32 + ### Restricted filename characters ---ftp-disable-tls13 + The [default restricted characters set](https://rclone.org/overview/#restricted-characters) + will be replaced. -Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Properties: + ### Empty files -- Config: disable_tls13 -- Env Var: RCLONE_FTP_DISABLE_TLS13 -- Type: bool -- Default: false + Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore + upload an empty file as a single space with a mime type of + `application/vnd.rclone.empty.file` and files with that mime type are + treated as empty. ---ftp-shut-timeout + ### Root folder ID ### -Maximum time to wait for data connection closing status. + You can set the `root_folder_id` for rclone. This is the directory + (identified by its `Folder ID`) that rclone considers to be the root + of your Enterprise File Fabric. -Properties: + Normally you will leave this blank and rclone will determine the + correct root to use itself. -- Config: shut_timeout -- Env Var: RCLONE_FTP_SHUT_TIMEOUT -- Type: Duration -- Default: 1m0s + However you can set this to restrict rclone to a specific folder + hierarchy. ---ftp-ask-password + In order to do this you will have to find the `Folder ID` of the + directory you wish rclone to display. These aren't displayed in the + web interface, but you can use `rclone lsf` to find them, for example -Allow asking for FTP password when needed. +$ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ +120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ +120673757,My contacts/ 120673761,S3 Storage/ -If this is set and no password is supplied then rclone will ask for a -password -Properties: + The ID for "S3 Storage" would be `120673761`. -- Config: ask_password -- Env Var: RCLONE_FTP_ASK_PASSWORD -- Type: bool -- Default: false ---ftp-encoding + ### Standard options -The encoding for the backend. + Here are the Standard options specific to filefabric (Enterprise File Fabric). -See the encoding section in the overview for more info. + #### --filefabric-url -Properties: + URL of the Enterprise File Fabric to connect to. -- Config: encoding -- Env Var: RCLONE_FTP_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,RightSpace,Dot -- Examples: - - "Asterisk,Ctl,Dot,Slash" - - ProFTPd can't handle '*' in file names - - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" - - PureFTPd can't handle '[]' or '*' in file names - - "Ctl,LeftPeriod,Slash" - - VsFTPd can't handle file names starting with dot + Properties: -Limitations + - Config: url + - Env Var: RCLONE_FILEFABRIC_URL + - Type: string + - Required: true + - Examples: + - "https://storagemadeeasy.com" + - Storage Made Easy US + - "https://eu.storagemadeeasy.com" + - Storage Made Easy EU + - "https://yourfabric.smestorage.com" + - Connect to your Enterprise File Fabric -FTP servers acting as rclone remotes must support passive mode. The mode -cannot be configured as passive is the only supported one. Rclone's FTP -implementation is not compatible with active mode as the library it uses -doesn't support it. This will likely never be supported due to security -concerns. + #### --filefabric-root-folder-id -Rclone's FTP backend does not support any checksums but can compare file -sizes. + ID of the root folder. -rclone about is not supported by the FTP backend. Backends without this -capability cannot determine free space for an rclone mount or use policy -mfs (most free space) as a member of an rclone union remote. + Leave blank normally. -See List of backends that do not support rclone about and rclone about + Fill in to make rclone start with directory of a given ID. -The implementation of : --dump headers, --dump bodies, --dump auth for -debugging isn't the same as for rclone HTTP based backends - it has less -fine grained control. ---timeout isn't supported (but --contimeout is). + Properties: ---bind isn't supported. + - Config: root_folder_id + - Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID + - Type: string + - Required: false -Rclone's FTP backend could support server-side move but does not at -present. + #### --filefabric-permanent-token -The ftp_proxy environment variable is not currently supported. + Permanent Authentication Token. -Modified time + A Permanent Authentication Token can be created in the Enterprise File + Fabric, on the users Dashboard under Security, there is an entry + you'll see called "My Authentication Tokens". Click the Manage button + to create one. -File modification time (timestamps) is supported to 1 second resolution -for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP -server. The VsFTPd server has non-standard implementation of time -related protocol commands and needs a special configuration setting: -writing_mdtm = true. + These tokens are normally valid for several years. -Support for precise file time with other FTP servers varies depending on -what protocol extensions they advertise. If all the MLSD, MDTM and MFTM -extensions are present, rclone will use them together to provide precise -time. Otherwise the times you see on the FTP server through rclone are -those of the last file upload. + For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens -You can use the following command to check whether rclone can use -precise time with your FTP server: -rclone backend features your_ftp_remote: (the trailing colon is -important). Look for the number in the line tagged by Precision -designating the remote time precision expressed as nanoseconds. A value -of 1000000000 means that file time precision of 1 second is available. A -value of 3153600000000000000 (or another large number) means -"unsupported". -Google Cloud Storage + Properties: -Paths are specified as remote:bucket (or remote: for the lsd command.) -You may put subdirectories in too, e.g. remote:bucket/path/to/dir. + - Config: permanent_token + - Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN + - Type: string + - Required: false -Configuration + ### Advanced options -The initial setup for google cloud storage involves getting a token from -Google Cloud Storage which you need to do in your browser. rclone config -walks you through it. + Here are the Advanced options specific to filefabric (Enterprise File Fabric). -Here is an example of how to make a remote called remote. First run: + #### --filefabric-token - rclone config + Session Token. -This will guide you through an interactive setup process: + This is a session token which rclone caches in the config file. It is + usually valid for 1 hour. - n) New remote - d) Delete remote - q) Quit config - e/n/d/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Google Cloud Storage (this is not Google Drive) - \ "google cloud storage" - [snip] - Storage> google cloud storage - Google Application Client Id - leave blank normally. - client_id> - Google Application Client Secret - leave blank normally. - client_secret> - Project number optional - needed only for list/create/delete buckets - see your developer console. - project_number> 12345678 - Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. - service_account_file> - Access Control List for new objects. - Choose a number from below, or type in your own value - 1 / Object owner gets OWNER access, and all Authenticated Users get READER access. - \ "authenticatedRead" - 2 / Object owner gets OWNER access, and project team owners get OWNER access. - \ "bucketOwnerFullControl" - 3 / Object owner gets OWNER access, and project team owners get READER access. - \ "bucketOwnerRead" - 4 / Object owner gets OWNER access [default if left blank]. - \ "private" - 5 / Object owner gets OWNER access, and project team members get access according to their roles. - \ "projectPrivate" - 6 / Object owner gets OWNER access, and all Users get READER access. - \ "publicRead" - object_acl> 4 - Access Control List for new buckets. - Choose a number from below, or type in your own value - 1 / Project team owners get OWNER access, and all Authenticated Users get READER access. - \ "authenticatedRead" - 2 / Project team owners get OWNER access [default if left blank]. - \ "private" - 3 / Project team members get access according to their roles. - \ "projectPrivate" - 4 / Project team owners get OWNER access, and all Users get READER access. - \ "publicRead" - 5 / Project team owners get OWNER access, and all Users get WRITER access. - \ "publicReadWrite" - bucket_acl> 2 - Location for the newly created buckets. - Choose a number from below, or type in your own value - 1 / Empty for default location (US). - \ "" - 2 / Multi-regional location for Asia. - \ "asia" - 3 / Multi-regional location for Europe. - \ "eu" - 4 / Multi-regional location for United States. - \ "us" - 5 / Taiwan. - \ "asia-east1" - 6 / Tokyo. - \ "asia-northeast1" - 7 / Singapore. - \ "asia-southeast1" - 8 / Sydney. - \ "australia-southeast1" - 9 / Belgium. - \ "europe-west1" - 10 / London. - \ "europe-west2" - 11 / Iowa. - \ "us-central1" - 12 / South Carolina. - \ "us-east1" - 13 / Northern Virginia. - \ "us-east4" - 14 / Oregon. - \ "us-west1" - location> 12 - The storage class to use when storing objects in Google Cloud Storage. - Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Multi-regional storage class - \ "MULTI_REGIONAL" - 3 / Regional storage class - \ "REGIONAL" - 4 / Nearline storage class - \ "NEARLINE" - 5 / Coldline storage class - \ "COLDLINE" - 6 / Durable reduced availability storage class - \ "DURABLE_REDUCED_AVAILABILITY" - storage_class> 5 - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - type = google cloud storage - client_id = - client_secret = - token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} - project_number = 12345678 - object_acl = private - bucket_acl = private - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Don't set this value - rclone will set it automatically. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only runs from the moment it opens your browser to -the moment you get back the verification code. This is on -http://127.0.0.1:53682/ and this it may require you to unblock it -temporarily if you are running a host firewall, or use manual mode. + Properties: -This remote is called remote and can now be used like this + - Config: token + - Env Var: RCLONE_FILEFABRIC_TOKEN + - Type: string + - Required: false -See all the buckets in your project + #### --filefabric-token-expiry - rclone lsd remote: + Token expiry time. -Make a new bucket + Don't set this value - rclone will set it automatically. - rclone mkdir remote:bucket -List the contents of a bucket + Properties: - rclone ls remote:bucket + - Config: token_expiry + - Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY + - Type: string + - Required: false -Sync /home/local/directory to the remote bucket, deleting any excess -files in the bucket. + #### --filefabric-version - rclone sync --interactive /home/local/directory remote:bucket + Version read from the file fabric. -Service Account support + Don't set this value - rclone will set it automatically. -You can set up rclone with Google Cloud Storage in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful when -you want to synchronise files onto machines that don't have actively -logged-in users, for example build machines. -To get credentials for Google Cloud Platform IAM Service Accounts, -please head to the Service Account section of the Google Developer -Console. Service Accounts behave just like normal User permissions in -Google Cloud Storage ACLs, so you can limit their access (e.g. make them -read only). After creating an account, a JSON file containing the -Service Account's credentials will be downloaded onto your machines. -These credentials are what rclone will use for authentication. + Properties: -To use a Service Account instead of OAuth2 token flow, enter the path to -your Service Account credentials at the service_account_file prompt and -rclone won't use the browser based authentication flow. If you'd rather -stuff the contents of the credentials file into the rclone config file, -you can set service_account_credentials with the actual contents of the -file instead, or set the equivalent environment variable. + - Config: version + - Env Var: RCLONE_FILEFABRIC_VERSION + - Type: string + - Required: false -Anonymous Access + #### --filefabric-encoding -For downloads of objects that permit public access you can configure -rclone to use anonymous access by setting anonymous to true. With -unauthorized access you can't write or create files but only read or -list those buckets and objects that have public read access. + The encoding for the backend. -Application Default Credentials + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -If no other source of credentials is provided, rclone will fall back to -Application Default Credentials this is useful both when you already -have configured authentication for your developer account, or in -production when running on a google compute host. Note that if running -in docker, you may need to run additional commands on your google -compute machine - see this page. + Properties: -Note that in the case application default credentials are used, there is -no need to explicitly configure a project number. + - Config: encoding + - Env Var: RCLONE_FILEFABRIC_ENCODING + - Type: Encoding + - Default: Slash,Del,Ctl,InvalidUtf8,Dot ---fast-list -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. -Custom upload headers + # FTP -You can set custom upload headers with the --header-upload flag. Google -Cloud Storage supports the headers as described in the working with -metadata documentation + FTP is the File Transfer Protocol. Rclone FTP support is provided using the + [github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) + package. -- Cache-Control -- Content-Disposition -- Content-Encoding -- Content-Language -- Content-Type -- X-Goog-Storage-Class -- X-Goog-Meta- + [Limitations of Rclone's FTP backend](#limitations) -Eg --header-upload "Content-Type text/potato" + Paths are specified as `remote:path`. If the path does not begin with + a `/` it is relative to the home directory of the user. An empty path + `remote:` refers to the user's home directory. -Note that the last of these is for setting custom metadata in the form ---header-upload "x-goog-meta-key: value" + ## Configuration -Modification time + To create an FTP configuration named `remote`, run -Google Cloud Storage stores md5sum natively. Google's gsutil tool stores -modification time with one-second precision as goog-reserved-file-mtime -in file metadata. + rclone config -To ensure compatibility with gsutil, rclone stores modification time in -2 separate metadata entries. mtime uses RFC3339 format with -one-nanosecond precision. goog-reserved-file-mtime uses Unix timestamp -format with one-second precision. To get modification time from object -metadata, rclone reads the metadata in the following order: mtime, -goog-reserved-file-mtime, object updated time. + Rclone config guides you through an interactive setup process. A minimal + rclone FTP remote definition only requires host, username and password. + For an anonymous FTP server, see [below](#anonymous-ftp). -Note that rclone's default modify window is 1ns. Files uploaded by -gsutil only contain timestamps with one-second precision. If you use -rclone to sync files previously uploaded by gsutil, rclone will attempt -to update modification time for all these files. To avoid these possibly -unnecessary updates, use --modify-window 1s. +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +remote Type of storage to configure. Enter a string value. Press Enter +for the default (""). Choose a number from below, or type in your own +value [snip] XX / FTP  "ftp" [snip] Storage> ftp ** See help for ftp +backend at: https://rclone.org/ftp/ ** -Restricted filename characters +FTP host to connect to Enter a string value. Press Enter for the default +(""). Choose a number from below, or type in your own value 1 / Connect +to ftp.example.com  "ftp.example.com" host> ftp.example.com FTP username +Enter a string value. Press Enter for the default ("$USER"). user> FTP +port number Enter a signed integer. Press Enter for the default (21). +port> FTP password y) Yes type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Use FTP over TLS (Implicit) Enter a boolean value (true or +false). Press Enter for the default ("false"). tls> Use FTP over TLS +(Explicit) Enter a boolean value (true or false). Press Enter for the +default ("false"). explicit_tls> Remote config -------------------- +[remote] type = ftp host = ftp.example.com pass = *** ENCRYPTED *** +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - LF 0x0A ␊ - CR 0x0D ␍ - / 0x2F / -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + To see all directories in the home directory of `remote` -Standard options + rclone lsd remote: -Here are the Standard options specific to google cloud storage (Google -Cloud Storage (this is not Google Drive)). + Make a new directory ---gcs-client-id + rclone mkdir remote:path/to/directory -OAuth Client Id. + List the contents of a directory -Leave blank normally. + rclone ls remote:path/to/directory -Properties: + Sync `/home/local/directory` to the remote directory, deleting any + excess files in the directory. -- Config: client_id -- Env Var: RCLONE_GCS_CLIENT_ID -- Type: string -- Required: false + rclone sync --interactive /home/local/directory remote:directory ---gcs-client-secret + ### Anonymous FTP -OAuth Client Secret. + When connecting to a FTP server that allows anonymous login, you can use the + special "anonymous" username. Traditionally, this user account accepts any + string as a password, although it is common to use either the password + "anonymous" or "guest". Some servers require the use of a valid e-mail + address as password. -Leave blank normally. + Using [on-the-fly](#backend-path-to-dir) or + [connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access + such servers, without requiring any configuration in advance. The following + are examples of that: -Properties: + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): -- Config: client_secret -- Env Var: RCLONE_GCS_CLIENT_SECRET -- Type: string -- Required: false + The above examples work in Linux shells and in PowerShell, but not Windows + Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) + command to create a password string in the format required by the + [pass](#ftp-pass) option. The following examples are exactly the same, except use + an already obscured string representation of the same password "dummy", and + therefore works even in Windows Command Prompt: ---gcs-project-number + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: -Project number. + ### Implicit TLS -Optional - needed only for list/create/delete buckets - see your -developer console. + Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to + be enabled in the FTP backend config for the remote, or with + [`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and + can be set with [`--ftp-port`](#ftp-port). -Properties: + ### Restricted filename characters -- Config: project_number -- Env Var: RCLONE_GCS_PROJECT_NUMBER -- Type: string -- Required: false + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: ---gcs-service-account-file + File names cannot end with the following characters. Replacement is + limited to the last character in a file name: -Service Account Credentials JSON file path. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | -Leave blank normally. Needed only if you want use SA instead of -interactive login. + Not all FTP servers can have all characters in file names, for example: -Leading ~ will be expanded in the file name as will environment -variables such as ${RCLONE_CONFIG_DIR}. + | FTP Server| Forbidden characters | + | --------- |:--------------------:| + | proftpd | `*` | + | pureftpd | `\ [ ]` | -Properties: + This backend's interactive configuration wizard provides a selection of + sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. + Just hit a selection number when prompted. -- Config: service_account_file -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE -- Type: string -- Required: false ---gcs-service-account-credentials + ### Standard options -Service Account Credentials JSON blob. + Here are the Standard options specific to ftp (FTP). -Leave blank normally. Needed only if you want use SA instead of -interactive login. + #### --ftp-host -Properties: + FTP host to connect to. -- Config: service_account_credentials -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS -- Type: string -- Required: false + E.g. "ftp.example.com". ---gcs-anonymous + Properties: -Access public buckets and objects without credentials. + - Config: host + - Env Var: RCLONE_FTP_HOST + - Type: string + - Required: true -Set to 'true' if you just want to download files and don't configure -credentials. + #### --ftp-user -Properties: + FTP username. -- Config: anonymous -- Env Var: RCLONE_GCS_ANONYMOUS -- Type: bool -- Default: false + Properties: ---gcs-object-acl + - Config: user + - Env Var: RCLONE_FTP_USER + - Type: string + - Default: "$USER" -Access Control List for new objects. + #### --ftp-port -Properties: + FTP port number. -- Config: object_acl -- Env Var: RCLONE_GCS_OBJECT_ACL -- Type: string -- Required: false -- Examples: - - "authenticatedRead" - - Object owner gets OWNER access. - - All Authenticated Users get READER access. - - "bucketOwnerFullControl" - - Object owner gets OWNER access. - - Project team owners get OWNER access. - - "bucketOwnerRead" - - Object owner gets OWNER access. - - Project team owners get READER access. - - "private" - - Object owner gets OWNER access. - - Default if left blank. - - "projectPrivate" - - Object owner gets OWNER access. - - Project team members get access according to their roles. - - "publicRead" - - Object owner gets OWNER access. - - All Users get READER access. + Properties: ---gcs-bucket-acl + - Config: port + - Env Var: RCLONE_FTP_PORT + - Type: int + - Default: 21 -Access Control List for new buckets. + #### --ftp-pass -Properties: + FTP password. -- Config: bucket_acl -- Env Var: RCLONE_GCS_BUCKET_ACL -- Type: string -- Required: false -- Examples: - - "authenticatedRead" - - Project team owners get OWNER access. - - All Authenticated Users get READER access. - - "private" - - Project team owners get OWNER access. - - Default if left blank. - - "projectPrivate" - - Project team members get access according to their roles. - - "publicRead" - - Project team owners get OWNER access. - - All Users get READER access. - - "publicReadWrite" - - Project team owners get OWNER access. - - All Users get WRITER access. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). ---gcs-bucket-policy-only + Properties: -Access checks should use bucket-level IAM policies. + - Config: pass + - Env Var: RCLONE_FTP_PASS + - Type: string + - Required: false -If you want to upload objects to a bucket with Bucket Policy Only set -then you will need to set this. + #### --ftp-tls -When it is set, rclone: + Use Implicit FTPS (FTP over TLS). -- ignores ACLs set on buckets -- ignores ACLs set on objects -- creates buckets with Bucket Policy Only set + When using implicit FTP over TLS the client connects using TLS + right from the start which breaks compatibility with + non-TLS-aware servers. This is usually served over port 990 rather + than port 21. Cannot be used in combination with explicit FTPS. -Docs: https://cloud.google.com/storage/docs/bucket-policy-only + Properties: -Properties: + - Config: tls + - Env Var: RCLONE_FTP_TLS + - Type: bool + - Default: false -- Config: bucket_policy_only -- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY -- Type: bool -- Default: false + #### --ftp-explicit-tls ---gcs-location + Use Explicit FTPS (FTP over TLS). -Location for the newly created buckets. + When using explicit FTP over TLS the client explicitly requests + security from the server in order to upgrade a plain text connection + to an encrypted one. Cannot be used in combination with implicit FTPS. -Properties: + Properties: -- Config: location -- Env Var: RCLONE_GCS_LOCATION -- Type: string -- Required: false -- Examples: - - "" - - Empty for default location (US) - - "asia" - - Multi-regional location for Asia - - "eu" - - Multi-regional location for Europe - - "us" - - Multi-regional location for United States - - "asia-east1" - - Taiwan - - "asia-east2" - - Hong Kong - - "asia-northeast1" - - Tokyo - - "asia-northeast2" - - Osaka - - "asia-northeast3" - - Seoul - - "asia-south1" - - Mumbai - - "asia-south2" - - Delhi - - "asia-southeast1" - - Singapore - - "asia-southeast2" - - Jakarta - - "australia-southeast1" - - Sydney - - "australia-southeast2" - - Melbourne - - "europe-north1" - - Finland - - "europe-west1" - - Belgium - - "europe-west2" - - London - - "europe-west3" - - Frankfurt - - "europe-west4" - - Netherlands - - "europe-west6" - - Zürich - - "europe-central2" - - Warsaw - - "us-central1" - - Iowa - - "us-east1" - - South Carolina - - "us-east4" - - Northern Virginia - - "us-west1" - - Oregon - - "us-west2" - - California - - "us-west3" - - Salt Lake City - - "us-west4" - - Las Vegas - - "northamerica-northeast1" - - Montréal - - "northamerica-northeast2" - - Toronto - - "southamerica-east1" - - São Paulo - - "southamerica-west1" - - Santiago - - "asia1" - - Dual region: asia-northeast1 and asia-northeast2. - - "eur4" - - Dual region: europe-north1 and europe-west4. - - "nam4" - - Dual region: us-central1 and us-east1. - ---gcs-storage-class - -The storage class to use when storing objects in Google Cloud Storage. + - Config: explicit_tls + - Env Var: RCLONE_FTP_EXPLICIT_TLS + - Type: bool + - Default: false -Properties: + ### Advanced options -- Config: storage_class -- Env Var: RCLONE_GCS_STORAGE_CLASS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "MULTI_REGIONAL" - - Multi-regional storage class - - "REGIONAL" - - Regional storage class - - "NEARLINE" - - Nearline storage class - - "COLDLINE" - - Coldline storage class - - "ARCHIVE" - - Archive storage class - - "DURABLE_REDUCED_AVAILABILITY" - - Durable reduced availability storage class - ---gcs-env-auth - -Get GCP IAM credentials from runtime (environment variables or instance -meta data if no env vars). - -Only applies if service_account_file and service_account_credentials is -blank. + Here are the Advanced options specific to ftp (FTP). -Properties: + #### --ftp-concurrency -- Config: env_auth -- Env Var: RCLONE_GCS_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter credentials in the next step. - - "true" - - Get GCP IAM credentials from the environment (env vars or - IAM). + Maximum number of FTP simultaneous connections, 0 for unlimited. -Advanced options + Note that setting this is very likely to cause deadlocks so it should + be used with care. -Here are the Advanced options specific to google cloud storage (Google -Cloud Storage (this is not Google Drive)). + If you are doing a sync or copy then make sure concurrency is one more + than the sum of `--transfers` and `--checkers`. ---gcs-token + If you use `--check-first` then it just needs to be one more than the + maximum of `--checkers` and `--transfers`. -OAuth Access Token as a JSON blob. + So for `concurrency 3` you'd use `--checkers 2 --transfers 2 + --check-first` or `--checkers 1 --transfers 1`. -Properties: -- Config: token -- Env Var: RCLONE_GCS_TOKEN -- Type: string -- Required: false ---gcs-auth-url + Properties: -Auth server URL. + - Config: concurrency + - Env Var: RCLONE_FTP_CONCURRENCY + - Type: int + - Default: 0 -Leave blank to use the provider defaults. + #### --ftp-no-check-certificate -Properties: + Do not verify the TLS certificate of the server. -- Config: auth_url -- Env Var: RCLONE_GCS_AUTH_URL -- Type: string -- Required: false + Properties: ---gcs-token-url + - Config: no_check_certificate + - Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE + - Type: bool + - Default: false -Token server url. + #### --ftp-disable-epsv -Leave blank to use the provider defaults. + Disable using EPSV even if server advertises support. -Properties: + Properties: -- Config: token_url -- Env Var: RCLONE_GCS_TOKEN_URL -- Type: string -- Required: false + - Config: disable_epsv + - Env Var: RCLONE_FTP_DISABLE_EPSV + - Type: bool + - Default: false ---gcs-no-check-bucket + #### --ftp-disable-mlsd -If set, don't attempt to check the bucket exists or create it. + Disable using MLSD even if server advertises support. -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. + Properties: -Properties: + - Config: disable_mlsd + - Env Var: RCLONE_FTP_DISABLE_MLSD + - Type: bool + - Default: false -- Config: no_check_bucket -- Env Var: RCLONE_GCS_NO_CHECK_BUCKET -- Type: bool -- Default: false + #### --ftp-disable-utf8 ---gcs-decompress + Disable using UTF-8 even if server advertises support. -If set this will decompress gzip encoded objects. + Properties: -It is possible to upload objects to GCS with "Content-Encoding: gzip" -set. Normally rclone will download these files as compressed objects. + - Config: disable_utf8 + - Env Var: RCLONE_FTP_DISABLE_UTF8 + - Type: bool + - Default: false -If this flag is set then rclone will decompress these files with -"Content-Encoding: gzip" as they are received. This means that rclone -can't check the size and hash but the file contents will be -decompressed. + #### --ftp-writing-mdtm -Properties: + Use MDTM to set modification time (VsFtpd quirk) -- Config: decompress -- Env Var: RCLONE_GCS_DECOMPRESS -- Type: bool -- Default: false + Properties: ---gcs-endpoint + - Config: writing_mdtm + - Env Var: RCLONE_FTP_WRITING_MDTM + - Type: bool + - Default: false -Endpoint for the service. + #### --ftp-force-list-hidden -Leave blank normally. + Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. -Properties: + Properties: -- Config: endpoint -- Env Var: RCLONE_GCS_ENDPOINT -- Type: string -- Required: false + - Config: force_list_hidden + - Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN + - Type: bool + - Default: false ---gcs-encoding + #### --ftp-idle-timeout -The encoding for the backend. + Max time before closing idle connections. -See the encoding section in the overview for more info. + If no connections have been returned to the connection pool in the time + given, rclone will empty the connection pool. -Properties: + Set to 0 to keep connections indefinitely. -- Config: encoding -- Env Var: RCLONE_GCS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot -Limitations + Properties: -rclone about is not supported by the Google Cloud Storage backend. -Backends without this capability cannot determine free space for an -rclone mount or use policy mfs (most free space) as a member of an -rclone union remote. + - Config: idle_timeout + - Env Var: RCLONE_FTP_IDLE_TIMEOUT + - Type: Duration + - Default: 1m0s -See List of backends that do not support rclone about and rclone about + #### --ftp-close-timeout -Google Drive + Maximum time to wait for a response to close. -Paths are specified as drive:path + Properties: -Drive paths may be as deep as required, e.g. -drive:directory/subdirectory. + - Config: close_timeout + - Env Var: RCLONE_FTP_CLOSE_TIMEOUT + - Type: Duration + - Default: 1m0s -Configuration + #### --ftp-tls-cache-size -The initial setup for drive involves getting a token from Google drive -which you need to do in your browser. rclone config walks you through -it. + Size of TLS session cache for all control and data connections. -Here is an example of how to make a remote called remote. First run: + TLS cache allows to resume TLS sessions and reuse PSK between connections. + Increase if default size is not enough resulting in TLS resumption errors. + Enabled by default. Use 0 to disable. - rclone config + Properties: -This will guide you through an interactive setup process: + - Config: tls_cache_size + - Env Var: RCLONE_FTP_TLS_CACHE_SIZE + - Type: int + - Default: 32 - No remotes found, make a new one? - n) New remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - n/r/c/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Google Drive - \ "drive" - [snip] - Storage> drive - Google Application Client Id - leave blank normally. - client_id> - Google Application Client Secret - leave blank normally. - client_secret> - Scope that rclone should use when requesting access from drive. - Choose a number from below, or type in your own value - 1 / Full access all files, excluding Application Data Folder. - \ "drive" - 2 / Read-only access to file metadata and file contents. - \ "drive.readonly" - / Access to files created by rclone only. - 3 | These are visible in the drive website. - | File authorization is revoked when the user deauthorizes the app. - \ "drive.file" - / Allows read and write access to the Application Data folder. - 4 | This is not visible in the drive website. - \ "drive.appfolder" - / Allows read-only access to file metadata but - 5 | does not allow any access to read or download file content. - \ "drive.metadata.readonly" - scope> 1 - Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. - service_account_file> - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - Configure this as a Shared Drive (Team Drive)? - y) Yes - n) No - y/n> n - -------------------- - [remote] - client_id = - client_secret = - scope = drive - root_folder_id = - service_account_file = - token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + #### --ftp-disable-tls13 -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + Disable TLS 1.3 (workaround for FTP servers with buggy TLS) -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only runs from the moment it opens your browser to -the moment you get back the verification code. This is on -http://127.0.0.1:53682/ and it may require you to unblock it temporarily -if you are running a host firewall, or use manual mode. + Properties: -You can then use it like this, + - Config: disable_tls13 + - Env Var: RCLONE_FTP_DISABLE_TLS13 + - Type: bool + - Default: false -List directories in top level of your drive + #### --ftp-shut-timeout - rclone lsd remote: + Maximum time to wait for data connection closing status. -List all the files in your drive + Properties: - rclone ls remote: + - Config: shut_timeout + - Env Var: RCLONE_FTP_SHUT_TIMEOUT + - Type: Duration + - Default: 1m0s -To copy a local directory to a drive directory called backup + #### --ftp-ask-password - rclone copy /home/source remote:backup + Allow asking for FTP password when needed. -Scopes + If this is set and no password is supplied then rclone will ask for a password -Rclone allows you to select which scope you would like for rclone to -use. This changes what type of token is granted to rclone. The scopes -are defined here. -The scope are + Properties: -drive + - Config: ask_password + - Env Var: RCLONE_FTP_ASK_PASSWORD + - Type: bool + - Default: false -This is the default scope and allows full access to all files, except -for the Application Data Folder (see below). + #### --ftp-socks-proxy -Choose this one if you aren't sure. + Socks 5 proxy host. + + Supports the format user:pass@host:port, user@host:port, host:port. + + Example: + + myUser:myPass@localhost:9005 + -drive.readonly + Properties: -This allows read only access to all files. Files may be listed and -downloaded but not uploaded, renamed or deleted. + - Config: socks_proxy + - Env Var: RCLONE_FTP_SOCKS_PROXY + - Type: string + - Required: false -drive.file + #### --ftp-encoding -With this scope rclone can read/view/modify only those files and folders -it creates. + The encoding for the backend. -So if you uploaded files to drive via the web interface (or any other -means) they will not be visible to rclone. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -This can be useful if you are using rclone to backup data and you want -to be sure confidential data on your drive is not visible to rclone. + Properties: -Files created with this scope are visible in the web interface. + - Config: encoding + - Env Var: RCLONE_FTP_ENCODING + - Type: Encoding + - Default: Slash,Del,Ctl,RightSpace,Dot + - Examples: + - "Asterisk,Ctl,Dot,Slash" + - ProFTPd can't handle '*' in file names + - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" + - PureFTPd can't handle '[]' or '*' in file names + - "Ctl,LeftPeriod,Slash" + - VsFTPd can't handle file names starting with dot + + + + ## Limitations + + FTP servers acting as rclone remotes must support `passive` mode. + The mode cannot be configured as `passive` is the only supported one. + Rclone's FTP implementation is not compatible with `active` mode + as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). + This will likely never be supported due to security concerns. + + Rclone's FTP backend does not support any checksums but can compare + file sizes. + + `rclone about` is not supported by the FTP backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. + + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + + The implementation of : `--dump headers`, + `--dump bodies`, `--dump auth` for debugging isn't the same as + for rclone HTTP based backends - it has less fine grained control. + + `--timeout` isn't supported (but `--contimeout` is). + + `--bind` isn't supported. + + Rclone's FTP backend could support server-side move but does not + at present. + + The `ftp_proxy` environment variable is not currently supported. + + ### Modification times + + File modification time (timestamps) is supported to 1 second resolution + for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. + The `VsFTPd` server has non-standard implementation of time related protocol + commands and needs a special configuration setting: `writing_mdtm = true`. + + Support for precise file time with other FTP servers varies depending on what + protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` + extensions are present, rclone will use them together to provide precise time. + Otherwise the times you see on the FTP server through rclone are those of the + last file upload. + + You can use the following command to check whether rclone can use precise time + with your FTP server: `rclone backend features your_ftp_remote:` (the trailing + colon is important). Look for the number in the line tagged by `Precision` + designating the remote time precision expressed as nanoseconds. A value of + `1000000000` means that file time precision of 1 second is available. + A value of `3153600000000000000` (or another large number) means "unsupported". + + # Google Cloud Storage + + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. + + ## Configuration + + The initial setup for google cloud storage involves getting a token from Google Cloud Storage + which you need to do in your browser. `rclone config` walks you + through it. + + Here is an example of how to make a remote called `remote`. First run: + + rclone config + + This will guide you through an interactive setup process: + +n) New remote +o) Delete remote +p) Quit config e/n/d/q> n name> remote Type of storage to configure. + Choose a number from below, or type in your own value [snip] XX / + Google Cloud Storage (this is not Google Drive)  "google cloud + storage" [snip] Storage> google cloud storage Google Application + Client Id - leave blank normally. client_id> Google Application + Client Secret - leave blank normally. client_secret> Project number + optional - needed only for list/create/delete buckets - see your + developer console. project_number> 12345678 Service Account + Credentials JSON file path - needed only if you want use SA instead + of interactive login. service_account_file> Access Control List for + new objects. Choose a number from below, or type in your own value 1 + / Object owner gets OWNER access, and all Authenticated Users get + READER access.  "authenticatedRead" 2 / Object owner gets OWNER + access, and project team owners get OWNER access. +  "bucketOwnerFullControl" 3 / Object owner gets OWNER access, and + project team owners get READER access.  "bucketOwnerRead" 4 / Object + owner gets OWNER access [default if left blank].  "private" 5 / + Object owner gets OWNER access, and project team members get access + according to their roles.  "projectPrivate" 6 / Object owner gets + OWNER access, and all Users get READER access.  "publicRead" + object_acl> 4 Access Control List for new buckets. Choose a number + from below, or type in your own value 1 / Project team owners get + OWNER access, and all Authenticated Users get READER access. +  "authenticatedRead" 2 / Project team owners get OWNER access + [default if left blank].  "private" 3 / Project team members get + access according to their roles.  "projectPrivate" 4 / Project team + owners get OWNER access, and all Users get READER access. +  "publicRead" 5 / Project team owners get OWNER access, and all + Users get WRITER access.  "publicReadWrite" bucket_acl> 2 Location + for the newly created buckets. Choose a number from below, or type + in your own value 1 / Empty for default location (US).  "" 2 / + Multi-regional location for Asia.  "asia" 3 / Multi-regional + location for Europe.  "eu" 4 / Multi-regional location for United + States.  "us" 5 / Taiwan.  "asia-east1" 6 / Tokyo. +  "asia-northeast1" 7 / Singapore.  "asia-southeast1" 8 / Sydney. +  "australia-southeast1" 9 / Belgium.  "europe-west1" 10 / London. +  "europe-west2" 11 / Iowa.  "us-central1" 12 / South Carolina. +  "us-east1" 13 / Northern Virginia.  "us-east4" 14 / Oregon. +  "us-west1" location> 12 The storage class to use when storing + objects in Google Cloud Storage. Choose a number from below, or type + in your own value 1 / Default  "" 2 / Multi-regional storage class +  "MULTI_REGIONAL" 3 / Regional storage class  "REGIONAL" 4 / + Nearline storage class  "NEARLINE" 5 / Coldline storage class +  "COLDLINE" 6 / Durable reduced availability storage class +  "DURABLE_REDUCED_AVAILABILITY" storage_class> 5 Remote config Use + web browser to automatically authenticate rclone with remote? + +- Say Y if the machine running rclone has a web browser you can use +- Say N if running rclone on a (remote) machine without web browser + access If not sure try Y. If Y failed, try N. + +y) Yes +z) No y/n> y If your browser doesn't open automatically go to the + following link: http://127.0.0.1:53682/auth Log in and authorize + rclone for access Waiting for code... Got code -------------------- + [remote] type = google cloud storage client_id = client_secret = + token = + {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} + project_number = 12345678 object_acl = private bucket_acl = private + -------------------- +a) Yes this is OK +b) Edit this remote +c) Delete this remote y/e/d> y -drive.appfolder -This gives rclone its own private area to store files. Rclone will not -be able to see any other files on your drive and you won't be able to -see rclone's files from the web interface either. + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -drive.metadata.readonly + Note that rclone runs a webserver on your local machine to collect the + token as returned from Google if using web browser to automatically + authenticate. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and this + it may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. -This allows read only access to file names only. It does not allow -rclone to download or upload data, or rename or delete files or -directories. + This remote is called `remote` and can now be used like this -Root folder ID - -This option has been moved to the advanced section. You can set the -root_folder_id for rclone. This is the directory (identified by its -Folder ID) that rclone considers to be the root of your drive. - -Normally you will leave this blank and rclone will determine the correct -root to use itself. - -However you can set this to restrict rclone to a specific folder -hierarchy or to access data within the "Computers" tab on the drive web -interface (where files from Google's Backup and Sync desktop program -go). - -In order to do this you will have to find the Folder ID of the directory -you wish rclone to display. This will be the last segment of the URL -when you open the relevant folder in the drive web interface. - -So if the folder you want rclone to use has a URL which looks like -https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh -in the browser, then you use 1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh as the -root_folder_id in the config. - -NB folders under the "Computers" tab seem to be read only (drive gives a -500 error) when using rclone. - -There doesn't appear to be an API to discover the folder IDs of the -"Computers" tab - please contact us if you know otherwise! - -Note also that rclone can't access any data under the "Backups" tab on -the google drive web interface yet. - -Service Account support - -You can set up rclone with Google Drive in an unattended mode, i.e. not -tied to a specific end-user Google account. This is useful when you want -to synchronise files onto machines that don't have actively logged-in -users, for example build machines. - -To use a Service Account instead of OAuth2 token flow, enter the path to -your Service Account credentials at the service_account_file prompt -during rclone config and rclone won't use the browser based -authentication flow. If you'd rather stuff the contents of the -credentials file into the rclone config file, you can set -service_account_credentials with the actual contents of the file -instead, or set the equivalent environment variable. - -Use case - Google Apps/G-suite account and individual Drive - -Let's say that you are the administrator of a Google Apps (old) or -G-suite account. The goal is to store data on an individual's Drive -account, who IS a member of the domain. We'll call the domain -example.com, and the user foo@example.com. - -There's a few steps we need to go through to accomplish this: - -1. Create a service account for example.com - -- To create a service account and obtain its credentials, go to the - Google Developer Console. -- You must have a project - create one if you don't. -- Then go to "IAM & admin" -> "Service Accounts". -- Use the "Create Credentials" button. Fill in "Service account name" - with something that identifies your client. "Role" can be empty. -- Tick "Furnish a new private key" - select "Key type JSON". -- Tick "Enable G Suite Domain-wide Delegation". This option makes - "impersonation" possible, as documented here: Delegating domain-wide - authority to the service account -- These credentials are what rclone will use for authentication. If - you ever need to remove access, press the "Delete service account - key" button. - -2. Allowing API access to example.com Google Drive - -- Go to example.com's admin console -- Go into "Security" (or use the search bar) -- Select "Show more" and then "Advanced settings" -- Select "Manage API client access" in the "Authentication" section -- In the "Client Name" field enter the service account's "Client ID" - - this can be found in the Developer Console under "IAM & Admin" -> - "Service Accounts", then "View Client ID" for the newly created - service account. It is a ~21 character numerical string. -- In the next field, "One or More API Scopes", enter - https://www.googleapis.com/auth/drive to grant access to Google - Drive specifically. - -3. Configure rclone, assuming a new install + See all the buckets in your project - rclone config + rclone lsd remote: - n/s/q> n # New - name>gdrive # Gdrive is an example name - Storage> # Select the number shown for Google Drive - client_id> # Can be left blank - client_secret> # Can be left blank - scope> # Select your scope, 1 for example - root_folder_id> # Can be left blank - service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! - y/n> # Auto config, n - -4. Verify that it's working - -- rclone -v --drive-impersonate foo@example.com lsf gdrive:backup -- The arguments do: - - -v - verbose logging - - --drive-impersonate foo@example.com - this is what does the - magic, pretending to be user foo. - - lsf - list files in a parsing friendly way - - gdrive:backup - use the remote called gdrive, work in the folder - named backup. - -Note: in case you configured a specific root folder on gdrive and rclone -is unable to access the contents of that folder when using ---drive-impersonate, do this instead: - in the gdrive web interface, -share your root folder with the user/email of the new Service Account -you created/selected at step #1 - use rclone without specifying the ---drive-impersonate option, like this: rclone -v lsf gdrive:backup - -Shared drives (team drives) - -If you want to configure the remote to point to a Google Shared Drive -(previously known as Team Drives) then answer y to the question -Configure this as a Shared Drive (Team Drive)?. - -This will fetch the list of Shared Drives from google and allow you to -configure which one you want to use. You can also type in a Shared Drive -ID if you prefer. + Make a new bucket -For example: + rclone mkdir remote:bucket - Configure this as a Shared Drive (Team Drive)? - y) Yes - n) No - y/n> y - Fetching Shared Drive list... - Choose a number from below, or type in your own value - 1 / Rclone Test - \ "xxxxxxxxxxxxxxxxxxxx" - 2 / Rclone Test 2 - \ "yyyyyyyyyyyyyyyyyyyy" - 3 / Rclone Test 3 - \ "zzzzzzzzzzzzzzzzzzzz" - Enter a Shared Drive ID> 1 - -------------------- - [remote] - client_id = - client_secret = - token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null} - team_drive = xxxxxxxxxxxxxxxxxxxx - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + List the contents of a bucket ---fast-list + rclone ls remote:bucket -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. + Sync `/home/local/directory` to the remote bucket, deleting any excess + files in the bucket. -It does this by combining multiple list calls into a single API request. + rclone sync --interactive /home/local/directory remote:bucket -This works by combining many '%s' in parents filters into one -expression. To list the contents of directories a, b and c, the -following requests will be send by the regular List function: + ### Service Account support - trashed=false and 'a' in parents - trashed=false and 'b' in parents - trashed=false and 'c' in parents + You can set up rclone with Google Cloud Storage in an unattended mode, + i.e. not tied to a specific end-user Google account. This is useful + when you want to synchronise files onto machines that don't have + actively logged-in users, for example build machines. -These can now be combined into a single request: + To get credentials for Google Cloud Platform + [IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), + please head to the + [Service Account](https://console.cloud.google.com/permissions/serviceaccounts) + section of the Google Developer Console. Service Accounts behave just + like normal `User` permissions in + [Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), + so you can limit their access (e.g. make them read only). After + creating an account, a JSON file containing the Service Account's + credentials will be downloaded onto your machines. These credentials + are what rclone will use for authentication. - trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) + To use a Service Account instead of OAuth2 token flow, enter the path + to your Service Account credentials at the `service_account_file` + prompt and rclone won't use the browser based authentication + flow. If you'd rather stuff the contents of the credentials file into + the rclone config file, you can set `service_account_credentials` with + the actual contents of the file instead, or set the equivalent + environment variable. -The implementation of ListR will put up to 50 parents filters into one -request. It will use the --checkers value to specify the number of -requests to run in parallel. + ### Anonymous Access -In tests, these batch requests were up to 20x faster than the regular -method. Running the following command against different sized folders -gives: + For downloads of objects that permit public access you can configure rclone + to use anonymous access by setting `anonymous` to `true`. + With unauthorized access you can't write or create files but only read or list + those buckets and objects that have public read access. - rclone lsjson -vv -R --checkers=6 gdrive:folder + ### Application Default Credentials -small folder (220 directories, 700 files): + If no other source of credentials is provided, rclone will fall back + to + [Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) + this is useful both when you already have configured authentication + for your developer account, or in production when running on a google + compute host. Note that if running in docker, you may need to run + additional commands on your google compute machine - + [see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). -- without --fast-list: 38s -- with --fast-list: 10s + Note that in the case application default credentials are used, there + is no need to explicitly configure a project number. -large folder (10600 directories, 39000 files): + ### --fast-list -- without --fast-list: 22:05 min -- with --fast-list: 58s + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. -Modified time + ### Custom upload headers -Google drive stores modification times accurate to 1 ms. + You can set custom upload headers with the `--header-upload` + flag. Google Cloud Storage supports the headers as described in the + [working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) -Restricted filename characters + - Cache-Control + - Content-Disposition + - Content-Encoding + - Content-Language + - Content-Type + - X-Goog-Storage-Class + - X-Goog-Meta- -Only Invalid UTF-8 bytes will be replaced, as they can't be used in JSON -strings. + Eg `--header-upload "Content-Type text/potato"` -In contrast to other backends, / can also be used in names and . or .. -are valid names. + Note that the last of these is for setting custom metadata in the form + `--header-upload "x-goog-meta-key: value"` -Revisions + ### Modification times -Google drive stores revisions of files. When you upload a change to an -existing file to google drive using rclone it will create a new revision -of that file. + Google Cloud Storage stores md5sum natively. + Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time + with one-second precision as `goog-reserved-file-mtime` in file metadata. -Revisions follow the standard google policy which at time of writing was + To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. + `mtime` uses RFC3339 format with one-nanosecond precision. + `goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. + To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. -- They are deleted after 30 days or 100 revisions (whatever comes - first). -- They do not count towards a user storage quota. + Note that rclone's default modify window is 1ns. + Files uploaded by gsutil only contain timestamps with one-second precision. + If you use rclone to sync files previously uploaded by gsutil, + rclone will attempt to update modification time for all these files. + To avoid these possibly unnecessary updates, use `--modify-window 1s`. -Deleting files + ### Restricted filename characters -By default rclone will send all files to the trash when deleting files. -If deleting them permanently is required then use the ---drive-use-trash=false flag, or set the equivalent environment -variable. - -Shortcuts - -In March 2020 Google introduced a new feature in Google Drive called -drive shortcuts (API). These will (by September 2020) replace the -ability for files or folders to be in multiple folders at once. - -Shortcuts are files that link to other files on Google Drive somewhat -like a symlink in unix, except they point to the underlying file data -(e.g. the inode in unix terms) so they don't break if the source is -renamed or moved about. - -Be default rclone treats these as follows. - -For shortcuts pointing to files: - -- When listing a file shortcut appears as the destination file. -- When downloading the contents of the destination file is downloaded. -- When updating shortcut file with a non shortcut file, the shortcut - is removed then a new file is uploaded in place of the shortcut. -- When server-side moving (renaming) the shortcut is renamed, not the - destination file. -- When server-side copying the shortcut is copied, not the contents of - the shortcut. (unless --drive-copy-shortcut-content is in use in - which case the contents of the shortcut gets copied). -- When deleting the shortcut is deleted not the linked file. -- When setting the modification time, the modification time of the - linked file will be set. - -For shortcuts pointing to folders: - -- When listing the shortcut appears as a folder and that folder will - contain the contents of the linked folder appear (including any sub - folders) -- When downloading the contents of the linked folder and sub contents - are downloaded -- When uploading to a shortcut folder the file will be placed in the - linked folder -- When server-side moving (renaming) the shortcut is renamed, not the - destination folder -- When server-side copying the contents of the linked folder is - copied, not the shortcut. -- When deleting with rclone rmdir or rclone purge the shortcut is - deleted not the linked folder. -- NB When deleting with rclone remove or rclone mount the contents of - the linked folder will be deleted. - -The rclone backend command can be used to create shortcuts. - -Shortcuts can be completely ignored with the --drive-skip-shortcuts flag -or the corresponding skip_shortcuts configuration setting. - -Emptying trash + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | LF | 0x0A | ␊ | + | CR | 0x0D | ␍ | + | / | 0x2F | / | -If you wish to empty your trash you can use the rclone cleanup remote: -command which will permanently delete all your trashed files. This -command does not take any path arguments. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Note that Google Drive takes some time (minutes to days) to empty the -trash even though the command returns within a few seconds. No output is -echoed, so there will be no confirmation even using -v or -vv. -Quota information + ### Standard options -To view your current quota you can use the rclone about remote: command -which will display your usage limit (quota), the usage in Google Drive, -the size of all files in the Trash and the space used by other Google -services such as Gmail. This command does not take any path arguments. + Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -Import/Export of google documents + #### --gcs-client-id -Google documents can be exported from and uploaded to Google Drive. + OAuth Client Id. -When rclone downloads a Google doc it chooses a format to download -depending upon the --drive-export-formats setting. By default the export -formats are docx,xlsx,pptx,svg which are a sensible default for an -editable document. + Leave blank normally. -When choosing a format, rclone runs down the list provided in order and -chooses the first file format the doc can be exported as from the list. -If the file can't be exported to a format on the formats list, then -rclone will choose a format from the default list. + Properties: -If you prefer an archive copy then you might use ---drive-export-formats pdf, or if you prefer openoffice/libreoffice -formats you might use --drive-export-formats ods,odt,odp. + - Config: client_id + - Env Var: RCLONE_GCS_CLIENT_ID + - Type: string + - Required: false -Note that rclone adds the extension to the google doc, so if it is -called My Spreadsheet on google docs, it will be exported as -My Spreadsheet.xlsx or My Spreadsheet.pdf etc. + #### --gcs-client-secret -When importing files into Google Drive, rclone will convert all files -with an extension in --drive-import-formats to their associated document -type. rclone will not convert any files by default, since the conversion -is lossy process. + OAuth Client Secret. -The conversion must result in a file with the same extension when the ---drive-export-formats rules are applied to the uploaded document. + Leave blank normally. -Here are some examples for allowed and prohibited conversions. + Properties: - export-formats import-formats Upload Ext Document Ext Allowed - ---------------- ---------------- ------------ -------------- --------- - odt odt odt odt Yes - odt docx,odt odt odt Yes - docx docx docx Yes - odt odt docx No - odt,docx docx,odt docx odt No - docx,odt docx,odt docx docx Yes - docx,odt docx,odt odt docx No + - Config: client_secret + - Env Var: RCLONE_GCS_CLIENT_SECRET + - Type: string + - Required: false -This limitation can be disabled by specifying ---drive-allow-import-name-change. When using this flag, rclone can -convert multiple files types resulting in the same document type at -once, e.g. with --drive-import-formats docx,odt,txt, all files having -these extension would result in a document represented as a docx file. -This brings the additional risk of overwriting a document, if multiple -files have the same stem. Many rclone operations will not handle this -name change in any way. They assume an equal name when copying files and -might copy the file again or delete them when the name changes. + #### --gcs-project-number -Here are the possible export extensions with their corresponding mime -types. Most of these can also be used for importing, but there more that -are not listed here. Some of these additional ones might only be -available when the operating system provides the correct MIME type -entries. + Project number. -This list can be changed by Google Drive at any time and might not -represent the currently available conversions. + Optional - needed only for list/create/delete buckets - see your developer console. - -------------------------------------------------------------------------------------------------------------------------- - Extension Mime Type Description - ------------------- --------------------------------------------------------------------------- -------------------------- - bmp image/bmp Windows Bitmap format + Properties: - csv text/csv Standard CSV format for - Spreadsheets + - Config: project_number + - Env Var: RCLONE_GCS_PROJECT_NUMBER + - Type: string + - Required: false - doc application/msword Classic Word file + #### --gcs-user-project - docx application/vnd.openxmlformats-officedocument.wordprocessingml.document Microsoft Office Document + User project. - epub application/epub+zip E-book format + Optional - needed only for requester pays. - html text/html An HTML Document + Properties: - jpg image/jpeg A JPEG Image File + - Config: user_project + - Env Var: RCLONE_GCS_USER_PROJECT + - Type: string + - Required: false - json application/vnd.google-apps.script+json JSON Text Format for - Google Apps scripts + #### --gcs-service-account-file - odp application/vnd.oasis.opendocument.presentation Openoffice Presentation + Service Account Credentials JSON file path. - ods application/vnd.oasis.opendocument.spreadsheet Openoffice Spreadsheet + Leave blank normally. + Needed only if you want use SA instead of interactive login. - ods application/x-vnd.oasis.opendocument.spreadsheet Openoffice Spreadsheet + Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. - odt application/vnd.oasis.opendocument.text Openoffice Document + Properties: - pdf application/pdf Adobe PDF Format + - Config: service_account_file + - Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE + - Type: string + - Required: false - pjpeg image/pjpeg Progressive JPEG Image + #### --gcs-service-account-credentials - png image/png PNG Image Format + Service Account Credentials JSON blob. - pptx application/vnd.openxmlformats-officedocument.presentationml.presentation Microsoft Office - Powerpoint + Leave blank normally. + Needed only if you want use SA instead of interactive login. - rtf application/rtf Rich Text Format + Properties: - svg image/svg+xml Scalable Vector Graphics - Format + - Config: service_account_credentials + - Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS + - Type: string + - Required: false - tsv text/tab-separated-values Standard TSV format for - spreadsheets + #### --gcs-anonymous - txt text/plain Plain Text + Access public buckets and objects without credentials. - wmf application/x-msmetafile Windows Meta File + Set to 'true' if you just want to download files and don't configure credentials. - xls application/vnd.ms-excel Classic Excel file + Properties: - xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Microsoft Office - Spreadsheet + - Config: anonymous + - Env Var: RCLONE_GCS_ANONYMOUS + - Type: bool + - Default: false - zip application/zip A ZIP file of HTML, Images - CSS - -------------------------------------------------------------------------------------------------------------------------- + #### --gcs-object-acl -Google documents can also be exported as link files. These files will -open a browser window for the Google Docs website of that document when -opened. The link file extension has to be specified as a ---drive-export-formats parameter. They will match all available Google -Documents. + Access Control List for new objects. - Extension Description OS Support - ----------- ----------------------------------------- ---------------- - desktop freedesktop.org specified desktop entry Linux - link.html An HTML Document with a redirect All - url INI style link file macOS, Windows - webloc macOS specific XML format macOS + Properties: + + - Config: object_acl + - Env Var: RCLONE_GCS_OBJECT_ACL + - Type: string + - Required: false + - Examples: + - "authenticatedRead" + - Object owner gets OWNER access. + - All Authenticated Users get READER access. + - "bucketOwnerFullControl" + - Object owner gets OWNER access. + - Project team owners get OWNER access. + - "bucketOwnerRead" + - Object owner gets OWNER access. + - Project team owners get READER access. + - "private" + - Object owner gets OWNER access. + - Default if left blank. + - "projectPrivate" + - Object owner gets OWNER access. + - Project team members get access according to their roles. + - "publicRead" + - Object owner gets OWNER access. + - All Users get READER access. + + #### --gcs-bucket-acl -Standard options + Access Control List for new buckets. -Here are the Standard options specific to drive (Google Drive). + Properties: ---drive-client-id + - Config: bucket_acl + - Env Var: RCLONE_GCS_BUCKET_ACL + - Type: string + - Required: false + - Examples: + - "authenticatedRead" + - Project team owners get OWNER access. + - All Authenticated Users get READER access. + - "private" + - Project team owners get OWNER access. + - Default if left blank. + - "projectPrivate" + - Project team members get access according to their roles. + - "publicRead" + - Project team owners get OWNER access. + - All Users get READER access. + - "publicReadWrite" + - Project team owners get OWNER access. + - All Users get WRITER access. -Google Application Client Id Setting your own is recommended. See -https://rclone.org/drive/#making-your-own-client-id for how to create -your own. If you leave this blank, it will use an internal key which is -low performance. + #### --gcs-bucket-policy-only -Properties: + Access checks should use bucket-level IAM policies. -- Config: client_id -- Env Var: RCLONE_DRIVE_CLIENT_ID -- Type: string -- Required: false + If you want to upload objects to a bucket with Bucket Policy Only set + then you will need to set this. ---drive-client-secret + When it is set, rclone: -OAuth Client Secret. + - ignores ACLs set on buckets + - ignores ACLs set on objects + - creates buckets with Bucket Policy Only set -Leave blank normally. + Docs: https://cloud.google.com/storage/docs/bucket-policy-only -Properties: -- Config: client_secret -- Env Var: RCLONE_DRIVE_CLIENT_SECRET -- Type: string -- Required: false + Properties: ---drive-scope + - Config: bucket_policy_only + - Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY + - Type: bool + - Default: false -Scope that rclone should use when requesting access from drive. + #### --gcs-location -Properties: + Location for the newly created buckets. -- Config: scope -- Env Var: RCLONE_DRIVE_SCOPE -- Type: string -- Required: false -- Examples: - - "drive" - - Full access all files, excluding Application Data Folder. - - "drive.readonly" - - Read-only access to file metadata and file contents. - - "drive.file" - - Access to files created by rclone only. - - These are visible in the drive website. - - File authorization is revoked when the user deauthorizes the - app. - - "drive.appfolder" - - Allows read and write access to the Application Data folder. - - This is not visible in the drive website. - - "drive.metadata.readonly" - - Allows read-only access to file metadata but - - does not allow any access to read or download file content. - ---drive-service-account-file - -Service Account Credentials JSON file path. - -Leave blank normally. Needed only if you want use SA instead of -interactive login. + Properties: + + - Config: location + - Env Var: RCLONE_GCS_LOCATION + - Type: string + - Required: false + - Examples: + - "" + - Empty for default location (US) + - "asia" + - Multi-regional location for Asia + - "eu" + - Multi-regional location for Europe + - "us" + - Multi-regional location for United States + - "asia-east1" + - Taiwan + - "asia-east2" + - Hong Kong + - "asia-northeast1" + - Tokyo + - "asia-northeast2" + - Osaka + - "asia-northeast3" + - Seoul + - "asia-south1" + - Mumbai + - "asia-south2" + - Delhi + - "asia-southeast1" + - Singapore + - "asia-southeast2" + - Jakarta + - "australia-southeast1" + - Sydney + - "australia-southeast2" + - Melbourne + - "europe-north1" + - Finland + - "europe-west1" + - Belgium + - "europe-west2" + - London + - "europe-west3" + - Frankfurt + - "europe-west4" + - Netherlands + - "europe-west6" + - Zürich + - "europe-central2" + - Warsaw + - "us-central1" + - Iowa + - "us-east1" + - South Carolina + - "us-east4" + - Northern Virginia + - "us-west1" + - Oregon + - "us-west2" + - California + - "us-west3" + - Salt Lake City + - "us-west4" + - Las Vegas + - "northamerica-northeast1" + - Montréal + - "northamerica-northeast2" + - Toronto + - "southamerica-east1" + - São Paulo + - "southamerica-west1" + - Santiago + - "asia1" + - Dual region: asia-northeast1 and asia-northeast2. + - "eur4" + - Dual region: europe-north1 and europe-west4. + - "nam4" + - Dual region: us-central1 and us-east1. + + #### --gcs-storage-class -Leading ~ will be expanded in the file name as will environment -variables such as ${RCLONE_CONFIG_DIR}. + The storage class to use when storing objects in Google Cloud Storage. -Properties: + Properties: -- Config: service_account_file -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE -- Type: string -- Required: false + - Config: storage_class + - Env Var: RCLONE_GCS_STORAGE_CLASS + - Type: string + - Required: false + - Examples: + - "" + - Default + - "MULTI_REGIONAL" + - Multi-regional storage class + - "REGIONAL" + - Regional storage class + - "NEARLINE" + - Nearline storage class + - "COLDLINE" + - Coldline storage class + - "ARCHIVE" + - Archive storage class + - "DURABLE_REDUCED_AVAILABILITY" + - Durable reduced availability storage class ---drive-alternate-export + #### --gcs-env-auth -Deprecated: No longer needed. + Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). -Properties: + Only applies if service_account_file and service_account_credentials is blank. -- Config: alternate_export -- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT -- Type: bool -- Default: false + Properties: -Advanced options + - Config: env_auth + - Env Var: RCLONE_GCS_ENV_AUTH + - Type: bool + - Default: false + - Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). -Here are the Advanced options specific to drive (Google Drive). + ### Advanced options ---drive-token + Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -OAuth Access Token as a JSON blob. + #### --gcs-token -Properties: + OAuth Access Token as a JSON blob. -- Config: token -- Env Var: RCLONE_DRIVE_TOKEN -- Type: string -- Required: false + Properties: ---drive-auth-url + - Config: token + - Env Var: RCLONE_GCS_TOKEN + - Type: string + - Required: false -Auth server URL. + #### --gcs-auth-url -Leave blank to use the provider defaults. + Auth server URL. -Properties: + Leave blank to use the provider defaults. -- Config: auth_url -- Env Var: RCLONE_DRIVE_AUTH_URL -- Type: string -- Required: false + Properties: ---drive-token-url + - Config: auth_url + - Env Var: RCLONE_GCS_AUTH_URL + - Type: string + - Required: false -Token server url. + #### --gcs-token-url -Leave blank to use the provider defaults. + Token server url. -Properties: + Leave blank to use the provider defaults. -- Config: token_url -- Env Var: RCLONE_DRIVE_TOKEN_URL -- Type: string -- Required: false + Properties: ---drive-root-folder-id + - Config: token_url + - Env Var: RCLONE_GCS_TOKEN_URL + - Type: string + - Required: false -ID of the root folder. Leave blank normally. + #### --gcs-directory-markers -Fill in to access "Computers" folders (see docs), or for rclone to use a -non root folder as its starting point. + Upload an empty object with a trailing slash when a new directory is created -Properties: + Empty folders are unsupported for bucket based remotes, this option creates an empty + object ending with "/", to persist the folder. -- Config: root_folder_id -- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID -- Type: string -- Required: false ---drive-service-account-credentials + Properties: -Service Account Credentials JSON blob. + - Config: directory_markers + - Env Var: RCLONE_GCS_DIRECTORY_MARKERS + - Type: bool + - Default: false -Leave blank normally. Needed only if you want use SA instead of -interactive login. + #### --gcs-no-check-bucket -Properties: + If set, don't attempt to check the bucket exists or create it. -- Config: service_account_credentials -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS -- Type: string -- Required: false + This can be useful when trying to minimise the number of transactions + rclone does if you know the bucket exists already. ---drive-team-drive -ID of the Shared Drive (Team Drive). + Properties: -Properties: + - Config: no_check_bucket + - Env Var: RCLONE_GCS_NO_CHECK_BUCKET + - Type: bool + - Default: false -- Config: team_drive -- Env Var: RCLONE_DRIVE_TEAM_DRIVE -- Type: string -- Required: false + #### --gcs-decompress ---drive-auth-owner-only + If set this will decompress gzip encoded objects. -Only consider files owned by the authenticated user. + It is possible to upload objects to GCS with "Content-Encoding: gzip" + set. Normally rclone will download these files as compressed objects. -Properties: + If this flag is set then rclone will decompress these files with + "Content-Encoding: gzip" as they are received. This means that rclone + can't check the size and hash but the file contents will be decompressed. -- Config: auth_owner_only -- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY -- Type: bool -- Default: false ---drive-use-trash + Properties: -Send files to the trash instead of deleting permanently. + - Config: decompress + - Env Var: RCLONE_GCS_DECOMPRESS + - Type: bool + - Default: false -Defaults to true, namely sending files to the trash. Use ---drive-use-trash=false to delete files permanently instead. + #### --gcs-endpoint -Properties: + Endpoint for the service. -- Config: use_trash -- Env Var: RCLONE_DRIVE_USE_TRASH -- Type: bool -- Default: true + Leave blank normally. ---drive-copy-shortcut-content + Properties: -Server side copy contents of shortcuts instead of the shortcut. + - Config: endpoint + - Env Var: RCLONE_GCS_ENDPOINT + - Type: string + - Required: false -When doing server side copies, normally rclone will copy shortcuts as -shortcuts. + #### --gcs-encoding -If this flag is used then rclone will copy the contents of shortcuts -rather than shortcuts themselves when doing server side copies. + The encoding for the backend. -Properties: + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -- Config: copy_shortcut_content -- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT -- Type: bool -- Default: false + Properties: ---drive-skip-gdocs + - Config: encoding + - Env Var: RCLONE_GCS_ENCODING + - Type: Encoding + - Default: Slash,CrLf,InvalidUtf8,Dot -Skip google documents in all listings. -If given, gdocs practically become invisible to rclone. -Properties: + ## Limitations -- Config: skip_gdocs -- Env Var: RCLONE_DRIVE_SKIP_GDOCS -- Type: bool -- Default: false + `rclone about` is not supported by the Google Cloud Storage backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. ---drive-skip-checksum-gphotos + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Skip MD5 checksum on Google photos and videos only. + # Google Drive -Use this if you get checksum errors when transferring Google photos or -videos. + Paths are specified as `drive:path` -Setting this flag will cause Google photos and videos to return a blank -MD5 checksum. + Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. -Google photos are identified by being in the "photos" space. + ## Configuration -Corrupted checksums are caused by Google modifying the image/video but -not updating the checksum. + The initial setup for drive involves getting a token from Google drive + which you need to do in your browser. `rclone config` walks you + through it. -Properties: + Here is an example of how to make a remote called `remote`. First run: -- Config: skip_checksum_gphotos -- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS -- Type: bool -- Default: false + rclone config ---drive-shared-with-me + This will guide you through an interactive setup process: -Only show files that are shared with me. +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +remote Type of storage to configure. Choose a number from below, or type +in your own value [snip] XX / Google Drive  "drive" [snip] Storage> +drive Google Application Client Id - leave blank normally. client_id> +Google Application Client Secret - leave blank normally. client_secret> +Scope that rclone should use when requesting access from drive. Choose a +number from below, or type in your own value 1 / Full access all files, +excluding Application Data Folder.  "drive" 2 / Read-only access to file +metadata and file contents.  "drive.readonly" / Access to files created +by rclone only. 3 | These are visible in the drive website. | File +authorization is revoked when the user deauthorizes the app. + "drive.file" / Allows read and write access to the Application Data +folder. 4 | This is not visible in the drive website.  "drive.appfolder" +/ Allows read-only access to file metadata but 5 | does not allow any +access to read or download file content.  "drive.metadata.readonly" +scope> 1 Service Account Credentials JSON file path - needed only if you +want use SA instead of interactive login. service_account_file> Remote +config Use web browser to automatically authenticate rclone with remote? +* Say Y if the machine running rclone has a web browser you can use * +Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your +browser doesn't open automatically go to the following link: +http://127.0.0.1:53682/auth Log in and authorize rclone for access +Waiting for code... Got code Configure this as a Shared Drive (Team +Drive)? y) Yes n) No y/n> n -------------------- [remote] client_id = +client_secret = scope = drive root_folder_id = service_account_file = +token = +{"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y -Instructs rclone to operate on your "Shared with me" folder (where -Google Drive lets you access the files and folders others have shared -with you). -This works both with the "list" (lsd, lsl, etc.) and the "copy" commands -(copy, sync, etc.), and with all other commands too. + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -Properties: + Note that rclone runs a webserver on your local machine to collect the + token as returned from Google if using web browser to automatically + authenticate. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and it + may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. -- Config: shared_with_me -- Env Var: RCLONE_DRIVE_SHARED_WITH_ME -- Type: bool -- Default: false + You can then use it like this, ---drive-trashed-only + List directories in top level of your drive -Only show files that are in the trash. + rclone lsd remote: -This will show trashed files in their original directory structure. + List all the files in your drive -Properties: + rclone ls remote: -- Config: trashed_only -- Env Var: RCLONE_DRIVE_TRASHED_ONLY -- Type: bool -- Default: false + To copy a local directory to a drive directory called backup ---drive-starred-only + rclone copy /home/source remote:backup -Only show files that are starred. + ### Scopes -Properties: + Rclone allows you to select which scope you would like for rclone to + use. This changes what type of token is granted to rclone. [The + scopes are defined + here](https://developers.google.com/drive/v3/web/about-auth). -- Config: starred_only -- Env Var: RCLONE_DRIVE_STARRED_ONLY -- Type: bool -- Default: false + A comma-separated list is allowed e.g. `drive.readonly,drive.file`. ---drive-formats + The scope are -Deprecated: See export_formats. + #### drive -Properties: + This is the default scope and allows full access to all files, except + for the Application Data Folder (see below). -- Config: formats -- Env Var: RCLONE_DRIVE_FORMATS -- Type: string -- Required: false + Choose this one if you aren't sure. ---drive-export-formats + #### drive.readonly -Comma separated list of preferred formats for downloading Google docs. + This allows read only access to all files. Files may be listed and + downloaded but not uploaded, renamed or deleted. -Properties: + #### drive.file -- Config: export_formats -- Env Var: RCLONE_DRIVE_EXPORT_FORMATS -- Type: string -- Default: "docx,xlsx,pptx,svg" + With this scope rclone can read/view/modify only those files and + folders it creates. ---drive-import-formats + So if you uploaded files to drive via the web interface (or any other + means) they will not be visible to rclone. -Comma separated list of preferred formats for uploading Google docs. + This can be useful if you are using rclone to backup data and you want + to be sure confidential data on your drive is not visible to rclone. -Properties: + Files created with this scope are visible in the web interface. -- Config: import_formats -- Env Var: RCLONE_DRIVE_IMPORT_FORMATS -- Type: string -- Required: false + #### drive.appfolder ---drive-allow-import-name-change + This gives rclone its own private area to store files. Rclone will + not be able to see any other files on your drive and you won't be able + to see rclone's files from the web interface either. -Allow the filetype to change when uploading Google docs. + #### drive.metadata.readonly + + This allows read only access to file names only. It does not allow + rclone to download or upload data, or rename or delete files or + directories. -E.g. file.doc to file.docx. This will confuse sync and reupload every -time. + ### Root folder ID -Properties: + This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory + (identified by its `Folder ID`) that rclone considers to be the root + of your drive. -- Config: allow_import_name_change -- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE -- Type: bool -- Default: false + Normally you will leave this blank and rclone will determine the + correct root to use itself. ---drive-use-created-date + However you can set this to restrict rclone to a specific folder + hierarchy or to access data within the "Computers" tab on the drive + web interface (where files from Google's Backup and Sync desktop + program go). -Use file created date instead of modified date. + In order to do this you will have to find the `Folder ID` of the + directory you wish rclone to display. This will be the last segment + of the URL when you open the relevant folder in the drive web + interface. -Useful when downloading data and you want the creation date used in -place of the last modified date. + So if the folder you want rclone to use has a URL which looks like + `https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` + in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as + the `root_folder_id` in the config. -WARNING: This flag may have some unexpected consequences. + **NB** folders under the "Computers" tab seem to be read only (drive + gives a 500 error) when using rclone. -When uploading to your drive all files will be overwritten unless they -haven't been modified since their creation. And the inverse will occur -while downloading. This side effect can be avoided by using the -"--checksum" flag. + There doesn't appear to be an API to discover the folder IDs of the + "Computers" tab - please contact us if you know otherwise! -This feature was implemented to retain photos capture date as recorded -by google photos. You will first need to check the "Create a Google -Photos folder" option in your google drive settings. You can then copy -or move the photos locally and use the date the image was taken -(created) set as the modification date. + Note also that rclone can't access any data under the "Backups" tab on + the google drive web interface yet. -Properties: + ### Service Account support -- Config: use_created_date -- Env Var: RCLONE_DRIVE_USE_CREATED_DATE -- Type: bool -- Default: false + You can set up rclone with Google Drive in an unattended mode, + i.e. not tied to a specific end-user Google account. This is useful + when you want to synchronise files onto machines that don't have + actively logged-in users, for example build machines. ---drive-use-shared-date + To use a Service Account instead of OAuth2 token flow, enter the path + to your Service Account credentials at the `service_account_file` + prompt during `rclone config` and rclone won't use the browser based + authentication flow. If you'd rather stuff the contents of the + credentials file into the rclone config file, you can set + `service_account_credentials` with the actual contents of the file + instead, or set the equivalent environment variable. -Use date file was shared instead of modified date. + #### Use case - Google Apps/G-suite account and individual Drive -Note that, as with "--drive-use-created-date", this flag may have -unexpected consequences when uploading/downloading files. + Let's say that you are the administrator of a Google Apps (old) or + G-suite account. + The goal is to store data on an individual's Drive account, who IS + a member of the domain. + We'll call the domain **example.com**, and the user + **foo@example.com**. -If both this flag and "--drive-use-created-date" are set, the created -date is used. + There's a few steps we need to go through to accomplish this: -Properties: + ##### 1. Create a service account for example.com + - To create a service account and obtain its credentials, go to the + [Google Developer Console](https://console.developers.google.com). + - You must have a project - create one if you don't. + - Then go to "IAM & admin" -> "Service Accounts". + - Use the "Create Service Account" button. Fill in "Service account name" + and "Service account ID" with something that identifies your client. + - Select "Create And Continue". Step 2 and 3 are optional. + - These credentials are what rclone will use for authentication. + If you ever need to remove access, press the "Delete service + account key" button. -- Config: use_shared_date -- Env Var: RCLONE_DRIVE_USE_SHARED_DATE -- Type: bool -- Default: false + ##### 2. Allowing API access to example.com Google Drive + - Go to example.com's admin console + - Go into "Security" (or use the search bar) + - Select "Show more" and then "Advanced settings" + - Select "Manage API client access" in the "Authentication" section + - In the "Client Name" field enter the service account's + "Client ID" - this can be found in the Developer Console under + "IAM & Admin" -> "Service Accounts", then "View Client ID" for + the newly created service account. + It is a ~21 character numerical string. + - In the next field, "One or More API Scopes", enter + `https://www.googleapis.com/auth/drive` + to grant access to Google Drive specifically. + + ##### 3. Configure rclone, assuming a new install ---drive-list-chunk +rclone config -Size of listing chunk 100-1000, 0 to disable. +n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select +the number shown for Google Drive client_id> # Can be left blank +client_secret> # Can be left blank scope> # Select your scope, 1 for +example root_folder_id> # Can be left blank service_account_file> +/home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # +Auto config, n -Properties: -- Config: list_chunk -- Env Var: RCLONE_DRIVE_LIST_CHUNK -- Type: int -- Default: 1000 + ##### 4. Verify that it's working + - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` + - The arguments do: + - `-v` - verbose logging + - `--drive-impersonate foo@example.com` - this is what does + the magic, pretending to be user foo. + - `lsf` - list files in a parsing friendly way + - `gdrive:backup` - use the remote called gdrive, work in + the folder named backup. ---drive-impersonate + Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: + - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 + - use rclone without specifying the `--drive-impersonate` option, like this: + `rclone -v lsf gdrive:backup` -Impersonate this user when using a service account. -Properties: + ### Shared drives (team drives) -- Config: impersonate -- Env Var: RCLONE_DRIVE_IMPERSONATE -- Type: string -- Required: false + If you want to configure the remote to point to a Google Shared Drive + (previously known as Team Drives) then answer `y` to the question + `Configure this as a Shared Drive (Team Drive)?`. ---drive-upload-cutoff + This will fetch the list of Shared Drives from google and allow you to + configure which one you want to use. You can also type in a Shared + Drive ID if you prefer. -Cutoff for switching to chunked upload. + For example: -Properties: +Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y +Fetching Shared Drive list... Choose a number from below, or type in +your own value 1 / Rclone Test  "xxxxxxxxxxxxxxxxxxxx" 2 / Rclone Test 2 + "yyyyyyyyyyyyyyyyyyyy" 3 / Rclone Test 3  "zzzzzzzzzzzzzzzzzzzz" Enter +a Shared Drive ID> 1 -------------------- [remote] client_id = +client_secret = token = +{"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null} +team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK +e) Edit this remote d) Delete this remote y/e/d> y -- Config: upload_cutoff -- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 8Mi ---drive-chunk-size + ### --fast-list -Upload chunk size. + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. -Must a power of 2 >= 256k. + It does this by combining multiple `list` calls into a single API request. -Making this larger will improve performance, but note that each chunk is -buffered in memory one per transfer. + This works by combining many `'%s' in parents` filters into one expression. + To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: -Reducing this will reduce memory usage but decrease performance. +trashed=false and 'a' in parents trashed=false and 'b' in parents +trashed=false and 'c' in parents -Properties: + These can now be combined into a single request: -- Config: chunk_size -- Env Var: RCLONE_DRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 8Mi +trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) ---drive-acknowledge-abuse -Set to allow files which return cannotDownloadAbusiveFile to be -downloaded. + The implementation of `ListR` will put up to 50 `parents` filters into one request. + It will use the `--checkers` value to specify the number of requests to run in parallel. -If downloading a file returns the error "This file has been identified -as malware or spam and cannot be downloaded" with the error code -"cannotDownloadAbusiveFile" then supply this flag to rclone to indicate -you acknowledge the risks of downloading the file and rclone will -download it anyway. + In tests, these batch requests were up to 20x faster than the regular method. + Running the following command against different sized folders gives: -Note that if you are using service account it will need Manager -permission (not Content Manager) to for this flag to work. If the SA -does not have the right permission, Google will just ignore the flag. +rclone lsjson -vv -R --checkers=6 gdrive:folder -Properties: -- Config: acknowledge_abuse -- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE -- Type: bool -- Default: false + small folder (220 directories, 700 files): ---drive-keep-revision-forever + - without `--fast-list`: 38s + - with `--fast-list`: 10s -Keep new head revision of each file forever. + large folder (10600 directories, 39000 files): -Properties: + - without `--fast-list`: 22:05 min + - with `--fast-list`: 58s -- Config: keep_revision_forever -- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER -- Type: bool -- Default: false + ### Modification times and hashes ---drive-size-as-quota + Google drive stores modification times accurate to 1 ms. -Show sizes as storage quota usage, not actual size. + Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however, + that a small fraction of files uploaded may not have SHA1 or SHA256 + hashes especially if they were uploaded before 2018. -Show the size of a file as the storage quota used. This is the current -version plus any older versions that have been set to keep forever. + ### Restricted filename characters -WARNING: This flag may have some unexpected consequences. + Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -It is not recommended to set this flag in your config - the recommended -usage is using the flag form --drive-size-as-quota when doing rclone -ls/lsl/lsf/lsjson/etc only. + In contrast to other backends, `/` can also be used in names and `.` + or `..` are valid names. -If you do use this flag for syncing (not recommended) then you will need -to use --ignore size also. + ### Revisions -Properties: + Google drive stores revisions of files. When you upload a change to + an existing file to google drive using rclone it will create a new + revision of that file. -- Config: size_as_quota -- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA -- Type: bool -- Default: false + Revisions follow the standard google policy which at time of writing + was ---drive-v2-download-min-size + * They are deleted after 30 days or 100 revisions (whatever comes first). + * They do not count towards a user storage quota. -If Object's are greater, use drive v2 API to download. + ### Deleting files -Properties: + By default rclone will send all files to the trash when deleting + files. If deleting them permanently is required then use the + `--drive-use-trash=false` flag, or set the equivalent environment + variable. -- Config: v2_download_min_size -- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE -- Type: SizeSuffix -- Default: off + ### Shortcuts ---drive-pacer-min-sleep + In March 2020 Google introduced a new feature in Google Drive called + [drive shortcuts](https://support.google.com/drive/answer/9700156) + ([API](https://developers.google.com/drive/api/v3/shortcuts)). These + will (by September 2020) [replace the ability for files or folders to + be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). -Minimum time to sleep between API calls. + Shortcuts are files that link to other files on Google Drive somewhat + like a symlink in unix, except they point to the underlying file data + (e.g. the inode in unix terms) so they don't break if the source is + renamed or moved about. -Properties: + By default rclone treats these as follows. -- Config: pacer_min_sleep -- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP -- Type: Duration -- Default: 100ms + For shortcuts pointing to files: ---drive-pacer-burst + - When listing a file shortcut appears as the destination file. + - When downloading the contents of the destination file is downloaded. + - When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. + - When server-side moving (renaming) the shortcut is renamed, not the destination file. + - When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). + - When deleting the shortcut is deleted not the linked file. + - When setting the modification time, the modification time of the linked file will be set. -Number of API calls to allow without sleeping. + For shortcuts pointing to folders: -Properties: + - When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) + - When downloading the contents of the linked folder and sub contents are downloaded + - When uploading to a shortcut folder the file will be placed in the linked folder + - When server-side moving (renaming) the shortcut is renamed, not the destination folder + - When server-side copying the contents of the linked folder is copied, not the shortcut. + - When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. + - **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. -- Config: pacer_burst -- Env Var: RCLONE_DRIVE_PACER_BURST -- Type: int -- Default: 100 + The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. ---drive-server-side-across-configs + Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag + or the corresponding `skip_shortcuts` configuration setting. -Allow server-side operations (e.g. copy) to work across different drive -configs. + ### Emptying trash -This can be useful if you wish to do a server-side copy between two -different Google drives. Note that this isn't enabled by default because -it isn't easy to tell if it will work between any two configurations. + If you wish to empty your trash you can use the `rclone cleanup remote:` + command which will permanently delete all your trashed files. This command + does not take any path arguments. -Properties: + Note that Google Drive takes some time (minutes to days) to empty the + trash even though the command returns within a few seconds. No output + is echoed, so there will be no confirmation even using -v or -vv. + + ### Quota information + + To view your current quota you can use the `rclone about remote:` + command which will display your usage limit (quota), the usage in Google + Drive, the size of all files in the Trash and the space used by other + Google services such as Gmail. This command does not take any path + arguments. + + #### Import/Export of google documents + + Google documents can be exported from and uploaded to Google Drive. + + When rclone downloads a Google doc it chooses a format to download + depending upon the `--drive-export-formats` setting. + By default the export formats are `docx,xlsx,pptx,svg` which are a + sensible default for an editable document. + + When choosing a format, rclone runs down the list provided in order + and chooses the first file format the doc can be exported as from the + list. If the file can't be exported to a format on the formats list, + then rclone will choose a format from the default list. + + If you prefer an archive copy then you might use `--drive-export-formats + pdf`, or if you prefer openoffice/libreoffice formats you might use + `--drive-export-formats ods,odt,odp`. + + Note that rclone adds the extension to the google doc, so if it is + called `My Spreadsheet` on google docs, it will be exported as `My + Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. + + When importing files into Google Drive, rclone will convert all + files with an extension in `--drive-import-formats` to their + associated document type. + rclone will not convert any files by default, since the conversion + is lossy process. + + The conversion must result in a file with the same extension when + the `--drive-export-formats` rules are applied to the uploaded document. + + Here are some examples for allowed and prohibited conversions. + + | export-formats | import-formats | Upload Ext | Document Ext | Allowed | + | -------------- | -------------- | ---------- | ------------ | ------- | + | odt | odt | odt | odt | Yes | + | odt | docx,odt | odt | odt | Yes | + | | docx | docx | docx | Yes | + | | odt | odt | docx | No | + | odt,docx | docx,odt | docx | odt | No | + | docx,odt | docx,odt | docx | docx | Yes | + | docx,odt | docx,odt | odt | docx | No | + + This limitation can be disabled by specifying `--drive-allow-import-name-change`. + When using this flag, rclone can convert multiple files types resulting + in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, + all files having these extension would result in a document represented as a docx file. + This brings the additional risk of overwriting a document, if multiple files + have the same stem. Many rclone operations will not handle this name change + in any way. They assume an equal name when copying files and might copy the + file again or delete them when the name changes. + + Here are the possible export extensions with their corresponding mime types. + Most of these can also be used for importing, but there more that are not + listed here. Some of these additional ones might only be available when + the operating system provides the correct MIME type entries. + + This list can be changed by Google Drive at any time and might not + represent the currently available conversions. + + | Extension | Mime Type | Description | + | --------- |-----------| ------------| + | bmp | image/bmp | Windows Bitmap format | + | csv | text/csv | Standard CSV format for Spreadsheets | + | doc | application/msword | Classic Word file | + | docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | + | epub | application/epub+zip | E-book format | + | html | text/html | An HTML Document | + | jpg | image/jpeg | A JPEG Image File | + | json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | + | odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | + | ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | + | ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | + | odt | application/vnd.oasis.opendocument.text | Openoffice Document | + | pdf | application/pdf | Adobe PDF Format | + | pjpeg | image/pjpeg | Progressive JPEG Image | + | png | image/png | PNG Image Format| + | pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | + | rtf | application/rtf | Rich Text Format | + | svg | image/svg+xml | Scalable Vector Graphics Format | + | tsv | text/tab-separated-values | Standard TSV format for spreadsheets | + | txt | text/plain | Plain Text | + | wmf | application/x-msmetafile | Windows Meta File | + | xls | application/vnd.ms-excel | Classic Excel file | + | xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | + | zip | application/zip | A ZIP file of HTML, Images CSS | + + Google documents can also be exported as link files. These files will + open a browser window for the Google Docs website of that document + when opened. The link file extension has to be specified as a + `--drive-export-formats` parameter. They will match all available + Google Documents. + + | Extension | Description | OS Support | + | --------- | ----------- | ---------- | + | desktop | freedesktop.org specified desktop entry | Linux | + | link.html | An HTML Document with a redirect | All | + | url | INI style link file | macOS, Windows | + | webloc | macOS specific XML format | macOS | + + + ### Standard options + + Here are the Standard options specific to drive (Google Drive). + + #### --drive-client-id -- Config: server_side_across_configs -- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false + Google Application Client Id + Setting your own is recommended. + See https://rclone.org/drive/#making-your-own-client-id for how to create your own. + If you leave this blank, it will use an internal key which is low performance. ---drive-disable-http2 + Properties: -Disable drive using http2. + - Config: client_id + - Env Var: RCLONE_DRIVE_CLIENT_ID + - Type: string + - Required: false -There is currently an unsolved issue with the google drive backend and -HTTP/2. HTTP/2 is therefore disabled by default for the drive backend -but can be re-enabled here. When the issue is solved this flag will be -removed. + #### --drive-client-secret -See: https://github.com/rclone/rclone/issues/3631 + OAuth Client Secret. -Properties: + Leave blank normally. -- Config: disable_http2 -- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 -- Type: bool -- Default: true + Properties: ---drive-stop-on-upload-limit + - Config: client_secret + - Env Var: RCLONE_DRIVE_CLIENT_SECRET + - Type: string + - Required: false -Make upload limit errors be fatal. + #### --drive-scope -At the time of writing it is only possible to upload 750 GiB of data to -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop the -in-progress sync. + Comma separated list of scopes that rclone should use when requesting access from drive. -Note that this detection is relying on error message strings which -Google don't document so it may break in the future. + Properties: -See: https://github.com/rclone/rclone/issues/3857 + - Config: scope + - Env Var: RCLONE_DRIVE_SCOPE + - Type: string + - Required: false + - Examples: + - "drive" + - Full access all files, excluding Application Data Folder. + - "drive.readonly" + - Read-only access to file metadata and file contents. + - "drive.file" + - Access to files created by rclone only. + - These are visible in the drive website. + - File authorization is revoked when the user deauthorizes the app. + - "drive.appfolder" + - Allows read and write access to the Application Data folder. + - This is not visible in the drive website. + - "drive.metadata.readonly" + - Allows read-only access to file metadata but + - does not allow any access to read or download file content. -Properties: + #### --drive-service-account-file -- Config: stop_on_upload_limit -- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT -- Type: bool -- Default: false + Service Account Credentials JSON file path. ---drive-stop-on-download-limit + Leave blank normally. + Needed only if you want use SA instead of interactive login. -Make download limit errors be fatal. + Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. -At the time of writing it is only possible to download 10 TiB of data -from Google Drive a day (this is an undocumented limit). When this limit -is reached Google Drive produces a slightly different error message. -When this flag is set it causes these errors to be fatal. These will -stop the in-progress sync. + Properties: -Note that this detection is relying on error message strings which -Google don't document so it may break in the future. + - Config: service_account_file + - Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE + - Type: string + - Required: false -Properties: + #### --drive-alternate-export -- Config: stop_on_download_limit -- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT -- Type: bool -- Default: false + Deprecated: No longer needed. ---drive-skip-shortcuts + Properties: -If set skip shortcut files. + - Config: alternate_export + - Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT + - Type: bool + - Default: false -Normally rclone dereferences shortcut files making them appear as if -they are the original file (see the shortcuts section). If this flag is -set then rclone will ignore shortcut files completely. + ### Advanced options -Properties: + Here are the Advanced options specific to drive (Google Drive). -- Config: skip_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS -- Type: bool -- Default: false + #### --drive-token ---drive-skip-dangling-shortcuts + OAuth Access Token as a JSON blob. -If set skip dangling shortcut files. + Properties: -If this is set then rclone will not show any dangling shortcuts in -listings. + - Config: token + - Env Var: RCLONE_DRIVE_TOKEN + - Type: string + - Required: false -Properties: + #### --drive-auth-url -- Config: skip_dangling_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS -- Type: bool -- Default: false + Auth server URL. ---drive-resource-key + Leave blank to use the provider defaults. -Resource key for accessing a link-shared file. + Properties: -If you need to access files shared with a link like this + - Config: auth_url + - Env Var: RCLONE_DRIVE_AUTH_URL + - Type: string + - Required: false - https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing + #### --drive-token-url -Then you will need to use the first part "XXX" as the "root_folder_id" -and the second part "YYY" as the "resource_key" otherwise you will get -404 not found errors when trying to access the directory. + Token server url. -See: https://developers.google.com/drive/api/guides/resource-keys + Leave blank to use the provider defaults. -This resource key requirement only applies to a subset of old files. + Properties: -Note also that opening the folder once in the web interface (with the -user you've authenticated rclone with) seems to be enough so that the -resource key is no needed. + - Config: token_url + - Env Var: RCLONE_DRIVE_TOKEN_URL + - Type: string + - Required: false -Properties: + #### --drive-root-folder-id -- Config: resource_key -- Env Var: RCLONE_DRIVE_RESOURCE_KEY -- Type: string -- Required: false + ID of the root folder. + Leave blank normally. ---drive-encoding + Fill in to access "Computers" folders (see docs), or for rclone to use + a non root folder as its starting point. -The encoding for the backend. -See the encoding section in the overview for more info. + Properties: -Properties: + - Config: root_folder_id + - Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID + - Type: string + - Required: false -- Config: encoding -- Env Var: RCLONE_DRIVE_ENCODING -- Type: MultiEncoder -- Default: InvalidUtf8 + #### --drive-service-account-credentials -Backend commands + Service Account Credentials JSON blob. -Here are the commands specific to the drive backend. + Leave blank normally. + Needed only if you want use SA instead of interactive login. -Run them with + Properties: - rclone backend COMMAND remote: + - Config: service_account_credentials + - Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS + - Type: string + - Required: false -The help below will explain what arguments each command takes. + #### --drive-team-drive -See the backend command for more info on how to pass options and -arguments. + ID of the Shared Drive (Team Drive). -These can be run on a running backend using the rc command -backend/command. + Properties: -get + - Config: team_drive + - Env Var: RCLONE_DRIVE_TEAM_DRIVE + - Type: string + - Required: false -Get command for fetching the drive config parameters + #### --drive-auth-owner-only - rclone backend get remote: [options] [+] + Only consider files owned by the authenticated user. -This is a get command which will be used to fetch the various drive -config parameters + Properties: -Usage Examples: + - Config: auth_owner_only + - Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY + - Type: bool + - Default: false - rclone backend get drive: [-o service_account_file] [-o chunk_size] - rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] + #### --drive-use-trash -Options: + Send files to the trash instead of deleting permanently. -- "chunk_size": show the current upload chunk size -- "service_account_file": show the current service account file + Defaults to true, namely sending files to the trash. + Use `--drive-use-trash=false` to delete files permanently instead. -set + Properties: -Set command for updating the drive config parameters + - Config: use_trash + - Env Var: RCLONE_DRIVE_USE_TRASH + - Type: bool + - Default: true - rclone backend set remote: [options] [+] + #### --drive-copy-shortcut-content -This is a set command which will be used to update the various drive -config parameters + Server side copy contents of shortcuts instead of the shortcut. -Usage Examples: + When doing server side copies, normally rclone will copy shortcuts as + shortcuts. - rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] - rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + If this flag is used then rclone will copy the contents of shortcuts + rather than shortcuts themselves when doing server side copies. -Options: + Properties: -- "chunk_size": update the current upload chunk size -- "service_account_file": update the current service account file + - Config: copy_shortcut_content + - Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT + - Type: bool + - Default: false -shortcut + #### --drive-skip-gdocs -Create shortcuts from files or directories + Skip google documents in all listings. - rclone backend shortcut remote: [options] [+] + If given, gdocs practically become invisible to rclone. -This command creates shortcuts from files or directories. + Properties: -Usage: + - Config: skip_gdocs + - Env Var: RCLONE_DRIVE_SKIP_GDOCS + - Type: bool + - Default: false - rclone backend shortcut drive: source_item destination_shortcut - rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut + #### --drive-show-all-gdocs -In the first example this creates a shortcut from the "source_item" -which can be a file or a directory to the "destination_shortcut". The -"source_item" and the "destination_shortcut" should be relative paths -from "drive:" + Show all Google Docs including non-exportable ones in listings. -In the second example this creates a shortcut from the "source_item" -relative to "drive:" to the "destination_shortcut" relative to -"drive2:". This may fail with a permission error if the user -authenticated with "drive2:" can't read files from "drive:". + If you try a server side copy on a Google Form without this flag, you + will get this error: -Options: + No export formats found for "application/vnd.google-apps.form" -- "target": optional target remote for the shortcut destination + However adding this flag will allow the form to be server side copied. -drives + Note that rclone doesn't add extensions to the Google Docs file names + in this mode. -List the Shared Drives available to this account + Do **not** use this flag when trying to download Google Docs - rclone + will fail to download them. - rclone backend drives remote: [options] [+] -This command lists the Shared Drives (Team Drives) available to this -account. + Properties: -Usage: + - Config: show_all_gdocs + - Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS + - Type: bool + - Default: false - rclone backend [-o config] drives drive: + #### --drive-skip-checksum-gphotos -This will return a JSON list of objects like this + Skip checksums on Google photos and videos only. - [ - { - "id": "0ABCDEF-01234567890", - "kind": "drive#teamDrive", - "name": "My Drive" - }, - { - "id": "0ABCDEFabcdefghijkl", - "kind": "drive#teamDrive", - "name": "Test Drive" - } - ] + Use this if you get checksum errors when transferring Google photos or + videos. -With the -o config parameter it will output the list in a format -suitable for adding to a config file to make aliases for all the drives -found and a combined drive. + Setting this flag will cause Google photos and videos to return a + blank checksums. - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: + Google photos are identified by being in the "photos" space. - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: + Corrupted checksums are caused by Google modifying the image/video but + not updating the checksum. - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" + Properties: -Adding this to the rclone config file will cause those team drives to be -accessible with the aliases shown. Any illegal characters will be -substituted with "_" and duplicate names will have numbers suffixed. It -will also add a remote called AllDrives which shows all the shared -drives combined into one directory tree. + - Config: skip_checksum_gphotos + - Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS + - Type: bool + - Default: false -untrash + #### --drive-shared-with-me -Untrash files and directories + Only show files that are shared with me. - rclone backend untrash remote: [options] [+] + Instructs rclone to operate on your "Shared with me" folder (where + Google Drive lets you access the files and folders others have shared + with you). -This command untrashes all the files and directories in the directory -passed in recursively. + This works both with the "list" (lsd, lsl, etc.) and the "copy" + commands (copy, sync, etc.), and with all other commands too. -Usage: + Properties: -This takes an optional directory to trash which make this easier to use -via the API. + - Config: shared_with_me + - Env Var: RCLONE_DRIVE_SHARED_WITH_ME + - Type: bool + - Default: false - rclone backend untrash drive:directory - rclone backend --interactive untrash drive:directory subdir + #### --drive-trashed-only -Use the --interactive/-i or --dry-run flag to see what would be restored -before restoring it. + Only show files that are in the trash. -Result: + This will show trashed files in their original directory structure. - { - "Untrashed": 17, - "Errors": 0 - } + Properties: -copyid + - Config: trashed_only + - Env Var: RCLONE_DRIVE_TRASHED_ONLY + - Type: bool + - Default: false -Copy files by ID + #### --drive-starred-only - rclone backend copyid remote: [options] [+] + Only show files that are starred. -This command copies files by ID + Properties: -Usage: + - Config: starred_only + - Env Var: RCLONE_DRIVE_STARRED_ONLY + - Type: bool + - Default: false - rclone backend copyid drive: ID path - rclone backend copyid drive: ID1 path1 ID2 path2 + #### --drive-formats -It copies the drive file with ID given to the path (an rclone path which -will be passed internally to rclone copyto). The ID and path pairs can -be repeated. + Deprecated: See export_formats. -The path should end with a / to indicate copy the file as named to this -directory. If it doesn't end with a / then the last path component will -be used as the file name. + Properties: -If the destination is a drive backend then server-side copying will be -attempted if possible. + - Config: formats + - Env Var: RCLONE_DRIVE_FORMATS + - Type: string + - Required: false -Use the --interactive/-i or --dry-run flag to see what would be copied -before copying. + #### --drive-export-formats -exportformats + Comma separated list of preferred formats for downloading Google docs. -Dump the export formats for debug purposes + Properties: - rclone backend exportformats remote: [options] [+] + - Config: export_formats + - Env Var: RCLONE_DRIVE_EXPORT_FORMATS + - Type: string + - Default: "docx,xlsx,pptx,svg" -importformats + #### --drive-import-formats -Dump the import formats for debug purposes + Comma separated list of preferred formats for uploading Google docs. - rclone backend importformats remote: [options] [+] + Properties: -Limitations + - Config: import_formats + - Env Var: RCLONE_DRIVE_IMPORT_FORMATS + - Type: string + - Required: false -Drive has quite a lot of rate limiting. This causes rclone to be limited -to transferring about 2 files per second only. Individual files may be -transferred much faster at 100s of MiB/s but lots of small files can -take a long time. + #### --drive-allow-import-name-change -Server side copies are also subject to a separate rate limit. If you see -User rate limit exceeded errors, wait at least 24 hours and retry. You -can disable server-side copies with --disable copy to download and -upload the files if you prefer. + Allow the filetype to change when uploading Google docs. -Limitations of Google Docs + E.g. file.doc to file.docx. This will confuse sync and reupload every time. -Google docs will appear as size -1 in rclone ls, rclone ncdu etc, and as -size 0 in anything which uses the VFS layer, e.g. rclone mount and -rclone serve. When calculating directory totals, e.g. in rclone size and -rclone ncdu, they will be counted in as empty files. + Properties: -This is because rclone can't find out the size of the Google docs -without downloading them. + - Config: allow_import_name_change + - Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE + - Type: bool + - Default: false -Google docs will transfer correctly with rclone sync, rclone copy etc as -rclone knows to ignore the size when doing the transfer. + #### --drive-use-created-date -However an unfortunate consequence of this is that you may not be able -to download Google docs using rclone mount. If it doesn't work you will -get a 0 sized file. If you try again the doc may gain its correct size -and be downloadable. Whether it will work on not depends on the -application accessing the mount and the OS you are running - experiment -to find out if it does work for you! + Use file created date instead of modified date. -Duplicated files + Useful when downloading data and you want the creation date used in + place of the last modified date. -Sometimes, for no reason I've been able to track down, drive will -duplicate a file that rclone uploads. Drive unlike all the other remotes -can have duplicated files. + **WARNING**: This flag may have some unexpected consequences. -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. + When uploading to your drive all files will be overwritten unless they + haven't been modified since their creation. And the inverse will occur + while downloading. This side effect can be avoided by using the + "--checksum" flag. -Use rclone dedupe to fix duplicated files. + This feature was implemented to retain photos capture date as recorded + by google photos. You will first need to check the "Create a Google + Photos folder" option in your google drive settings. You can then copy + or move the photos locally and use the date the image was taken + (created) set as the modification date. -Note that this isn't just a problem with rclone, even Google Photos on -Android duplicates files on drive sometimes. + Properties: -Rclone appears to be re-copying files it shouldn't + - Config: use_created_date + - Env Var: RCLONE_DRIVE_USE_CREATED_DATE + - Type: bool + - Default: false -The most likely cause of this is the duplicated file issue above - run -rclone dedupe and check your logs for duplicate object or directory -messages. + #### --drive-use-shared-date -This can also be caused by a delay/caching on google drive's end when -comparing directory listings. Specifically with team drives used in -combination with --fast-list. Files that were uploaded recently may not -appear on the directory list sent to rclone when using --fast-list. + Use date file was shared instead of modified date. -Waiting a moderate period of time between attempts (estimated to be -approximately 1 hour) and/or not using --fast-list both seem to be -effective in preventing the problem. + Note that, as with "--drive-use-created-date", this flag may have + unexpected consequences when uploading/downloading files. -Making your own client_id + If both this flag and "--drive-use-created-date" are set, the created + date is used. -When you use rclone with Google drive in its default configuration you -are using rclone's client_id. This is shared between all the rclone -users. There is a global rate limit on the number of queries per second -that each client_id can do set by Google. rclone already has a high -quota and I will continue to make sure it is high enough by contacting -Google. + Properties: -It is strongly recommended to use your own client ID as the default -rclone ID is heavily used. If you have multiple services running, it is -recommended to use an API key for each service. The default Google quota -is 10 transactions per second so it is recommended to stay under that -number as if you use more than that, it will cause rclone to rate limit -and make things slower. + - Config: use_shared_date + - Env Var: RCLONE_DRIVE_USE_SHARED_DATE + - Type: bool + - Default: false -Here is how to create your own Google Drive client ID for rclone: + #### --drive-list-chunk -1. Log into the Google API Console with your Google account. It doesn't - matter what Google account you use. (It need not be the same account - as the Google Drive you want to access) + Size of listing chunk 100-1000, 0 to disable. -2. Select a project or create a new project. + Properties: -3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the - "Google Drive API". + - Config: list_chunk + - Env Var: RCLONE_DRIVE_LIST_CHUNK + - Type: int + - Default: 1000 -4. Click "Credentials" in the left-side panel (not "Create - credentials", which opens the wizard), then "Create credentials" - -5. If you already configured an "Oauth Consent Screen", then skip to - the next step; if not, click on "CONFIGURE CONSENT SCREEN" button - (near the top right corner of the right panel), then select - "External" and click on "CREATE"; on the next screen, enter an - "Application name" ("rclone" is OK); enter "User Support Email" - (your own email is OK); enter "Developer Contact Email" (your own - email is OK); then click on "Save" (all other data is optional). You - will also have to add some scopes, including .../auth/docs and - .../auth/drive in order to be able to edit, create and delete files - with RClone. You may also want to include the - ../auth/drive.metadata.readonly scope. After adding scopes, click - "Save and continue" to add test users. Be sure to add your own - account to the test users. Once you've added yourself as a test user - and saved the changes, click again on "Credentials" on the left - panel to go back to the "Credentials" screen. - - (PS: if you are a GSuite user, you could also select "Internal" - instead of "External" above, but this will restrict API use to - Google Workspace users in your organisation). - -6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, - then select "OAuth client ID". + #### --drive-impersonate -7. Choose an application type of "Desktop app" and click "Create". (the - default name is fine) + Impersonate this user when using a service account. -8. It will show you a client ID and client secret. Make a note of - these. + Properties: - (If you selected "External" at Step 5 continue to Step 9. If you - chose "Internal" you don't need to publish and can skip straight to - Step 10 but your destination drive must be part of the same Google - Workspace.) + - Config: impersonate + - Env Var: RCLONE_DRIVE_IMPERSONATE + - Type: string + - Required: false -9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and - confirm. You will also want to add yourself as a test user. + #### --drive-upload-cutoff -10. Provide the noted client ID and client secret to rclone. + Cutoff for switching to chunked upload. -Be aware that, due to the "enhanced security" recently introduced by -Google, you are theoretically expected to "submit your app for -verification" and then wait a few weeks(!) for their response; in -practice, you can go right ahead and use the client ID and client secret -with rclone, the only issue will be a very scary confirmation screen -shown when you connect via your browser for rclone to be able to get its -token-id (but as this only happens during the remote configuration, it's -not such a big deal). Keeping the application in "Testing" will work as -well, but the limitation is that any grants will expire after a week, -which can be annoying to refresh constantly. If, for whatever reason, a -short grant time is not a problem, then keeping the application in -testing mode would also be sufficient. + Properties: -(Thanks to @balazer on github for these instructions.) + - Config: upload_cutoff + - Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 8Mi -Sometimes, creation of an OAuth consent in Google API Console fails due -to an error message “The request failed because changes to one of the -field of the resource is not supported”. As a convenient workaround, the -necessary Google Drive API key can be created on the Python Quickstart -page. Just push the Enable the Drive API button to receive the Client ID -and Secret. Note that it will automatically create a new project in the -API Console. + #### --drive-chunk-size -Google Photos + Upload chunk size. -The rclone backend for Google Photos is a specialized backend for -transferring photos and videos to and from Google Photos. + Must a power of 2 >= 256k. -NB The Google Photos API which rclone uses has quite a few limitations, -so please read the limitations section carefully to make sure it is -suitable for your use. + Making this larger will improve performance, but note that each chunk + is buffered in memory one per transfer. -Configuration + Reducing this will reduce memory usage but decrease performance. -The initial setup for google cloud storage involves getting a token from -Google Photos which you need to do in your browser. rclone config walks -you through it. + Properties: -Here is an example of how to make a remote called remote. First run: + - Config: chunk_size + - Env Var: RCLONE_DRIVE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 8Mi - rclone config + #### --drive-acknowledge-abuse -This will guide you through an interactive setup process: + Set to allow files which return cannotDownloadAbusiveFile to be downloaded. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Google Photos - \ "google photos" - [snip] - Storage> google photos - ** See help for google photos backend at: https://rclone.org/googlephotos/ ** + If downloading a file returns the error "This file has been identified + as malware or spam and cannot be downloaded" with the error code + "cannotDownloadAbusiveFile" then supply this flag to rclone to + indicate you acknowledge the risks of downloading the file and rclone + will download it anyway. - Google Application Client Id - Leave blank normally. - Enter a string value. Press Enter for the default (""). - client_id> - Google Application Client Secret - Leave blank normally. - Enter a string value. Press Enter for the default (""). - client_secret> - Set to make the Google Photos backend read only. + Note that if you are using service account it will need Manager + permission (not Content Manager) to for this flag to work. If the SA + does not have the right permission, Google will just ignore the flag. - If you choose read only then rclone will only request read only access - to your photos, otherwise rclone will request full access. - Enter a boolean value (true or false). Press Enter for the default ("false"). - read_only> - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code + Properties: - *** IMPORTANT: All media items uploaded to Google Photos with rclone - *** are stored in full resolution at original quality. These uploads - *** will count towards storage in your Google Account. + - Config: acknowledge_abuse + - Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE + - Type: bool + - Default: false - -------------------- - [remote] - type = google photos - token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + #### --drive-keep-revision-forever -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + Keep new head revision of each file forever. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only runs from the moment it opens your browser to -the moment you get back the verification code. This is on -http://127.0.0.1:53682/ and this may require you to unblock it -temporarily if you are running a host firewall, or use manual mode. + Properties: -This remote is called remote and can now be used like this + - Config: keep_revision_forever + - Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER + - Type: bool + - Default: false -See all the albums in your photos + #### --drive-size-as-quota - rclone lsd remote:album + Show sizes as storage quota usage, not actual size. -Make a new album + Show the size of a file as the storage quota used. This is the + current version plus any older versions that have been set to keep + forever. - rclone mkdir remote:album/newAlbum + **WARNING**: This flag may have some unexpected consequences. -List the contents of an album + It is not recommended to set this flag in your config - the + recommended usage is using the flag form --drive-size-as-quota when + doing rclone ls/lsl/lsf/lsjson/etc only. - rclone ls remote:album/newAlbum + If you do use this flag for syncing (not recommended) then you will + need to use --ignore size also. -Sync /home/local/images to the Google Photos, removing any excess files -in the album. + Properties: - rclone sync --interactive /home/local/image remote:album/newAlbum + - Config: size_as_quota + - Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA + - Type: bool + - Default: false -Layout + #### --drive-v2-download-min-size -As Google Photos is not a general purpose cloud storage system, the -backend is laid out to help you navigate it. + If Object's are greater, use drive v2 API to download. -The directories under media show different ways of categorizing the -media. Each file will appear multiple times. So if you want to make a -backup of your google photos you might choose to backup -remote:media/by-month. (NB remote:media/by-day is rather slow at the -moment so avoid for syncing.) + Properties: -Note that all your photos and videos will appear somewhere under media, -but they may not appear under album unless you've put them into albums. + - Config: v2_download_min_size + - Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE + - Type: SizeSuffix + - Default: off - / - - upload - - file1.jpg - - file2.jpg - - ... - - media - - all - - file1.jpg - - file2.jpg - - ... - - by-year - - 2000 - - file1.jpg - - ... - - 2001 - - file2.jpg - - ... - - ... - - by-month - - 2000 - - 2000-01 - - file1.jpg - - ... - - 2000-02 - - file2.jpg - - ... - - ... - - by-day - - 2000 - - 2000-01-01 - - file1.jpg - - ... - - 2000-01-02 - - file2.jpg - - ... - - ... - - album - - album name - - album name/sub - - shared-album - - album name - - album name/sub - - feature - - favorites - - file1.jpg - - file2.jpg - -There are two writable parts of the tree, the upload directory and sub -directories of the album directory. - -The upload directory is for uploading files you don't want to put into -albums. This will be empty to start with and will contain the files -you've uploaded for one rclone session only, becoming empty again when -you restart rclone. The use case for this would be if you have a load of -files you just want to once off dump into Google Photos. For repeated -syncing, uploading to album will work better. - -Directories within the album directory are also writeable and you may -create new directories (albums) under album. If you copy files with a -directory hierarchy in there then rclone will create albums with the / -character in them. For example if you do - - rclone copy /path/to/images remote:album/images - -and the images directory contains - - images - - file1.jpg - dir - file2.jpg - dir2 - dir3 - file3.jpg - -Then rclone will create the following albums with the following files in - -- images - - file1.jpg -- images/dir - - file2.jpg -- images/dir2/dir3 - - file3.jpg - -This means that you can use the album path pretty much like a normal -filesystem and it is a good target for repeated syncing. - -The shared-album directory shows albums shared with you or by you. This -is similar to the Sharing tab in the Google Photos web interface. + #### --drive-pacer-min-sleep -Standard options + Minimum time to sleep between API calls. -Here are the Standard options specific to google photos (Google Photos). + Properties: ---gphotos-client-id + - Config: pacer_min_sleep + - Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP + - Type: Duration + - Default: 100ms -OAuth Client Id. + #### --drive-pacer-burst -Leave blank normally. + Number of API calls to allow without sleeping. -Properties: + Properties: -- Config: client_id -- Env Var: RCLONE_GPHOTOS_CLIENT_ID -- Type: string -- Required: false + - Config: pacer_burst + - Env Var: RCLONE_DRIVE_PACER_BURST + - Type: int + - Default: 100 ---gphotos-client-secret + #### --drive-server-side-across-configs -OAuth Client Secret. + Deprecated: use --server-side-across-configs instead. -Leave blank normally. + Allow server-side operations (e.g. copy) to work across different drive configs. -Properties: + This can be useful if you wish to do a server-side copy between two + different Google drives. Note that this isn't enabled by default + because it isn't easy to tell if it will work between any two + configurations. -- Config: client_secret -- Env Var: RCLONE_GPHOTOS_CLIENT_SECRET -- Type: string -- Required: false + Properties: ---gphotos-read-only + - Config: server_side_across_configs + - Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS + - Type: bool + - Default: false -Set to make the Google Photos backend read only. + #### --drive-disable-http2 -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. + Disable drive using http2. -Properties: + There is currently an unsolved issue with the google drive backend and + HTTP/2. HTTP/2 is therefore disabled by default for the drive backend + but can be re-enabled here. When the issue is solved this flag will + be removed. -- Config: read_only -- Env Var: RCLONE_GPHOTOS_READ_ONLY -- Type: bool -- Default: false + See: https://github.com/rclone/rclone/issues/3631 -Advanced options -Here are the Advanced options specific to google photos (Google Photos). ---gphotos-token + Properties: -OAuth Access Token as a JSON blob. + - Config: disable_http2 + - Env Var: RCLONE_DRIVE_DISABLE_HTTP2 + - Type: bool + - Default: true -Properties: + #### --drive-stop-on-upload-limit -- Config: token -- Env Var: RCLONE_GPHOTOS_TOKEN -- Type: string -- Required: false + Make upload limit errors be fatal. ---gphotos-auth-url + At the time of writing it is only possible to upload 750 GiB of data to + Google Drive a day (this is an undocumented limit). When this limit is + reached Google Drive produces a slightly different error message. When + this flag is set it causes these errors to be fatal. These will stop + the in-progress sync. -Auth server URL. + Note that this detection is relying on error message strings which + Google don't document so it may break in the future. -Leave blank to use the provider defaults. + See: https://github.com/rclone/rclone/issues/3857 -Properties: -- Config: auth_url -- Env Var: RCLONE_GPHOTOS_AUTH_URL -- Type: string -- Required: false + Properties: ---gphotos-token-url + - Config: stop_on_upload_limit + - Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT + - Type: bool + - Default: false -Token server url. + #### --drive-stop-on-download-limit -Leave blank to use the provider defaults. + Make download limit errors be fatal. -Properties: + At the time of writing it is only possible to download 10 TiB of data from + Google Drive a day (this is an undocumented limit). When this limit is + reached Google Drive produces a slightly different error message. When + this flag is set it causes these errors to be fatal. These will stop + the in-progress sync. -- Config: token_url -- Env Var: RCLONE_GPHOTOS_TOKEN_URL -- Type: string -- Required: false + Note that this detection is relying on error message strings which + Google don't document so it may break in the future. ---gphotos-read-size -Set to read the size of media items. + Properties: -Normally rclone does not read the size of media items since this takes -another transaction. This isn't necessary for syncing. However rclone -mount needs to know the size of files in advance of reading them, so -setting this flag when using rclone mount is recommended if you want to -read the media. + - Config: stop_on_download_limit + - Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT + - Type: bool + - Default: false -Properties: + #### --drive-skip-shortcuts -- Config: read_size -- Env Var: RCLONE_GPHOTOS_READ_SIZE -- Type: bool -- Default: false + If set skip shortcut files. ---gphotos-start-year + Normally rclone dereferences shortcut files making them appear as if + they are the original file (see [the shortcuts section](#shortcuts)). + If this flag is set then rclone will ignore shortcut files completely. -Year limits the photos to be downloaded to those which are uploaded -after the given year. -Properties: + Properties: -- Config: start_year -- Env Var: RCLONE_GPHOTOS_START_YEAR -- Type: int -- Default: 2000 + - Config: skip_shortcuts + - Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS + - Type: bool + - Default: false ---gphotos-include-archived + #### --drive-skip-dangling-shortcuts -Also view and download archived media. + If set skip dangling shortcut files. -By default, rclone does not request archived media. Thus, when syncing, -archived media is not visible in directory listings or transferred. + If this is set then rclone will not show any dangling shortcuts in listings. -Note that media in albums is always visible and synced, no matter their -archive status. -With this flag, archived media are always visible in directory listings -and transferred. + Properties: -Without this flag, archived media will not be visible in directory -listings and won't be transferred. + - Config: skip_dangling_shortcuts + - Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS + - Type: bool + - Default: false -Properties: + #### --drive-resource-key -- Config: include_archived -- Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED -- Type: bool -- Default: false + Resource key for accessing a link-shared file. ---gphotos-encoding + If you need to access files shared with a link like this -The encoding for the backend. + https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing -See the encoding section in the overview for more info. + Then you will need to use the first part "XXX" as the "root_folder_id" + and the second part "YYY" as the "resource_key" otherwise you will get + 404 not found errors when trying to access the directory. -Properties: + See: https://developers.google.com/drive/api/guides/resource-keys -- Config: encoding -- Env Var: RCLONE_GPHOTOS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot + This resource key requirement only applies to a subset of old files. -Limitations + Note also that opening the folder once in the web interface (with the + user you've authenticated rclone with) seems to be enough so that the + resource key is not needed. -Only images and videos can be uploaded. If you attempt to upload non -videos or images or formats that Google Photos doesn't understand, -rclone will upload the file, then Google Photos will give an error when -it is put turned into a media item. -Note that all media items uploaded to Google Photos through the API are -stored in full resolution at "original quality" and will count towards -your storage quota in your Google Account. The API does not offer a way -to upload in "high quality" mode.. + Properties: -rclone about is not supported by the Google Photos backend. Backends -without this capability cannot determine free space for an rclone mount -or use policy mfs (most free space) as a member of an rclone union -remote. + - Config: resource_key + - Env Var: RCLONE_DRIVE_RESOURCE_KEY + - Type: string + - Required: false -See List of backends that do not support rclone about See rclone about + #### --drive-fast-list-bug-fix -Downloading Images + Work around a bug in Google Drive listing. -When Images are downloaded this strips EXIF location (according to the -docs and my tests). This is a limitation of the Google Photos API and is -covered by bug #112096115. + Normally rclone will work around a bug in Google Drive when using + --fast-list (ListR) where the search "(A in parents) or (B in + parents)" returns nothing sometimes. See #3114, #4289 and + https://issuetracker.google.com/issues/149522397 -The current google API does not allow photos to be downloaded at -original resolution. This is very important if you are, for example, -relying on "Google Photos" as a backup of your photos. You will not be -able to use rclone to redownload original images. You could use 'google -takeout' to recover the original photos as a last resort + Rclone detects this by finding no items in more than one directory + when listing and retries them as lists of individual directories. -Downloading Videos + This means that if you have a lot of empty directories rclone will end + up listing them all individually and this can take many more API + calls. -When videos are downloaded they are downloaded in a really compressed -version of the video compared to downloading it via the Google Photos -web interface. This is covered by bug #113672044. + This flag allows the work-around to be disabled. This is **not** + recommended in normal use - only if you have a particular case you are + having trouble with like many empty directories. -Duplicates -If a file name is duplicated in a directory then rclone will add the -file ID into its name. So two files called file.jpg would then appear as -file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer -alas!). + Properties: -If you upload the same image (with the same binary data) twice then -Google Photos will deduplicate it. However it will retain the filename -from the first upload which may confuse rclone. For example if you -uploaded an image to upload then uploaded the same image to -album/my_album the filename of the image in album/my_album will be what -it was uploaded with initially, not what you uploaded it with to album. -In practise this shouldn't cause too many problems. + - Config: fast_list_bug_fix + - Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX + - Type: bool + - Default: true -Modified time + #### --drive-metadata-owner -The date shown of media in Google Photos is the creation date as -determined by the EXIF information, or the upload date if that is not -known. + Control whether owner should be read or written in metadata. -This is not changeable by rclone and is not the modification date of the -media on local disk. This means that rclone cannot use the dates from -Google Photos for syncing purposes. + Owner is a standard part of the file metadata so is easy to read. But it + isn't always desirable to set the owner from the metadata. -Size + Note that you can't set the owner on Shared Drives, and that setting + ownership will generate an email to the new owner (this can't be + disabled), and you can't transfer ownership to someone outside your + organization. -The Google Photos API does not return the size of media. This means that -when syncing to Google Photos, rclone can only do a file existence -check. -It is possible to read the size of the media, but this needs an extra -HTTP HEAD request per media item so is very slow and uses up a lot of -transactions. This can be enabled with the --gphotos-read-size option or -the read_size = true config parameter. + Properties: -If you want to use the backend with rclone mount you may need to enable -this flag (depending on your OS and application using the photos) -otherwise you may not be able to read media off the mount. You'll need -to experiment to see if it works for you without the flag. + - Config: metadata_owner + - Env Var: RCLONE_DRIVE_METADATA_OWNER + - Type: Bits + - Default: read + - Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -Albums + #### --drive-metadata-permissions -Rclone can only upload files to albums it created. This is a limitation -of the Google Photos API. + Control whether permissions should be read or written in metadata. -Rclone can remove files it uploaded from albums it created only. + Reading permissions metadata from files can be done quickly, but it + isn't always desirable to set the permissions from the metadata. -Deleting files + Note that rclone drops any inherited permissions on Shared Drives and + any owner permission on My Drives as these are duplicated in the owner + metadata. -Rclone can remove files from albums it created, but note that the Google -Photos API does not allow media to be deleted permanently so this media -will still remain. See bug #109759781. -Rclone cannot delete files anywhere except under album. + Properties: -Deleting albums + - Config: metadata_permissions + - Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS + - Type: Bits + - Default: off + - Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -The Google Photos API does not support deleting albums - see bug -#135714733. + #### --drive-metadata-labels -Hasher + Control whether labels should be read or written in metadata. -Hasher is a special overlay backend to create remotes which handle -checksums for other remotes. It's main functions include: - Emulate hash -types unimplemented by backends - Cache checksums to help with slow -hashing of large local or (S)FTP files - Warm up checksum cache from -external SUM files + Reading labels metadata from files takes an extra API transaction and + will slow down listings. It isn't always desirable to set the labels + from the metadata. -Getting started + The format of labels is documented in the drive API documentation at + https://developers.google.com/drive/api/reference/rest/v3/Label - + rclone just provides a JSON dump of this format. -To use Hasher, first set up the underlying remote following the -configuration instructions for that remote. You can also use a local -pathname instead of a remote. Check that your base remote is working. + When setting labels, the label and fields must already exist - rclone + will not create them. This means that if you are transferring labels + from two different accounts you will have to create the labels in + advance and use the metadata mapper to translate the IDs between the + two accounts. -Let's call the base remote myRemote:path here. Note that anything inside -myRemote:path will be handled by hasher and anything outside won't. This -means that if you are using a bucket based remote (S3, B2, Swift) then -you should put the bucket in the remote s3:bucket. -Now proceed to interactive or manual configuration. + Properties: -Interactive configuration + - Config: metadata_labels + - Env Var: RCLONE_DRIVE_METADATA_LABELS + - Type: Bits + - Default: off + - Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -Run rclone config: + #### --drive-encoding - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> Hasher1 - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Handle checksums for other remotes - \ "hasher" - [snip] - Storage> hasher - Remote to cache checksums for, like myremote:mypath. - Enter a string value. Press Enter for the default (""). - remote> myRemote:path - Comma separated list of supported checksum types. - Enter a string value. Press Enter for the default ("md5,sha1"). - hashsums> md5 - Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. - max_age> off - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - -------------------- - [Hasher1] - type = hasher - remote = myRemote:path - hashsums = md5 - max_age = off - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + The encoding for the backend. -Manual configuration - -Run rclone config path to see the path of current active config file, -usually YOURHOME/.config/rclone/rclone.conf. Open it in your favorite -text editor, find section for the base remote and create new section for -hasher like in the following examples: - - [Hasher1] - type = hasher - remote = myRemote:path - hashes = md5 - max_age = off - - [Hasher2] - type = hasher - remote = /local/path - hashes = dropbox,sha1 - max_age = 24h - -Hasher takes basically the following parameters: - remote is required, - -hashes is a comma separated list of supported checksums (by default -md5,sha1), - max_age - maximum time to keep a checksum value in the -cache, 0 will disable caching completely, off will cache "forever" (that -is until the files get changed). - -Make sure the remote has : (colon) in. If you specify the remote without -a colon then rclone will use a local directory of that name. So if you -use a remote of /local/path then rclone will handle hashes for that -directory. If you use remote = name literally then rclone will put files -in a directory called name located under current directory. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Usage + Properties: -Basic operations + - Config: encoding + - Env Var: RCLONE_DRIVE_ENCODING + - Type: Encoding + - Default: InvalidUtf8 -Now you can use it as Hasher2:subdir/file instead of base remote. Hasher -will transparently update cache with new checksums when a file is fully -read or overwritten, like: + #### --drive-env-auth - rclone copy External:path/file Hasher:dest/path + Get IAM credentials from runtime (environment variables or instance meta data if no env vars). - rclone cat Hasher:path/to/file > /dev/null + Only applies if service_account_file and service_account_credentials is blank. -The way to refresh all cached checksums (even unsupported by the base -backend) for a subtree is to re-download all files in the subtree. For -example, use hashsum --download using any supported hashsum on the -command line (we just care to re-read): + Properties: - rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null + - Config: env_auth + - Env Var: RCLONE_DRIVE_ENV_AUTH + - Type: bool + - Default: false + - Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). - rclone backend dump Hasher:path/to/subtree + ### Metadata -You can print or drop hashsum cache using custom backend commands: + User metadata is stored in the properties field of the drive object. - rclone backend dump Hasher:dir/subdir + Here are the possible system metadata items for the drive backend. - rclone backend drop Hasher: + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | + | content-type | The MIME type of the file. | string | text/plain | N | + | copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | + | description | A short description of the file. | string | Contract for signing | N | + | folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | + | labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | + | mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | + | owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N | + | permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | + | starred | Whether the user has starred the file. | boolean | false | N | + | viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | + | writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N | -Pre-Seed from a SUM File + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -Hasher supports two backend commands: generic SUM file import and faster -but less consistent stickyimport. + ## Backend commands - rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4] + Here are the commands specific to the drive backend. -Instead of SHA1 it can be any hash supported by the remote. The last -argument can point to either a local or an other-remote:path text file -in SUM format. The command will parse the SUM file, then walk down the -path given by the first argument, snapshot current fingerprints and fill -in the cache entries correspondingly. - Paths in the SUM file are -treated as relative to hasher:dir/subdir. - The command will not check -that supplied values are correct. You must know what you are doing. - -This is a one-time action. The SUM file will not get "attached" to the -remote. Cache entries can still be overwritten later, should the -object's fingerprint change. - The tree walk can take long depending on -the tree size. You can increase --checkers to make it faster. Or use -stickyimport if you don't care about fingerprints and consistency. + Run them with - rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1 + rclone backend COMMAND remote: -stickyimport is similar to import but works much faster because it does -not need to stat existing files and skips initial tree walk. Instead of -binding cache entries to file fingerprints it creates sticky entries -bound to the file name alone ignoring size, modification time etc. Such -hash entries can be replaced only by purge, delete, backend drop or by -full re-read/re-write of the files. + The help below will explain what arguments each command takes. -Configuration reference + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -Standard options + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -Here are the Standard options specific to hasher (Better checksums for -other remotes). + ### get ---hasher-remote + Get command for fetching the drive config parameters -Remote to cache checksums for (e.g. myRemote:path). + rclone backend get remote: [options] [+] -Properties: + This is a get command which will be used to fetch the various drive config parameters -- Config: remote -- Env Var: RCLONE_HASHER_REMOTE -- Type: string -- Required: true + Usage Examples: ---hasher-hashes + rclone backend get drive: [-o service_account_file] [-o chunk_size] + rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] -Comma separated list of supported checksum types. -Properties: + Options: -- Config: hashes -- Env Var: RCLONE_HASHER_HASHES -- Type: CommaSepList -- Default: md5,sha1 + - "chunk_size": show the current upload chunk size + - "service_account_file": show the current service account file ---hasher-max-age + ### set -Maximum time to keep checksums in cache (0 = no cache, off = cache -forever). + Set command for updating the drive config parameters -Properties: + rclone backend set remote: [options] [+] -- Config: max_age -- Env Var: RCLONE_HASHER_MAX_AGE -- Type: Duration -- Default: off + This is a set command which will be used to update the various drive config parameters -Advanced options + Usage Examples: -Here are the Advanced options specific to hasher (Better checksums for -other remotes). + rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] ---hasher-auto-size -Auto-update checksum for files smaller than this size (disabled by -default). + Options: -Properties: + - "chunk_size": update the current upload chunk size + - "service_account_file": update the current service account file -- Config: auto_size -- Env Var: RCLONE_HASHER_AUTO_SIZE -- Type: SizeSuffix -- Default: 0 + ### shortcut -Metadata + Create shortcuts from files or directories -Any metadata supported by the underlying remote is read and written. + rclone backend shortcut remote: [options] [+] -See the metadata docs for more info. + This command creates shortcuts from files or directories. -Backend commands + Usage: -Here are the commands specific to the hasher backend. + rclone backend shortcut drive: source_item destination_shortcut + rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut -Run them with + In the first example this creates a shortcut from the "source_item" + which can be a file or a directory to the "destination_shortcut". The + "source_item" and the "destination_shortcut" should be relative paths + from "drive:" - rclone backend COMMAND remote: + In the second example this creates a shortcut from the "source_item" + relative to "drive:" to the "destination_shortcut" relative to + "drive2:". This may fail with a permission error if the user + authenticated with "drive2:" can't read files from "drive:". -The help below will explain what arguments each command takes. -See the backend command for more info on how to pass options and -arguments. + Options: -These can be run on a running backend using the rc command -backend/command. + - "target": optional target remote for the shortcut destination -drop + ### drives -Drop cache + List the Shared Drives available to this account - rclone backend drop remote: [options] [+] + rclone backend drives remote: [options] [+] -Completely drop checksum cache. Usage Example: rclone backend drop -hasher: + This command lists the Shared Drives (Team Drives) available to this + account. -dump + Usage: -Dump the database + rclone backend [-o config] drives drive: - rclone backend dump remote: [options] [+] + This will return a JSON list of objects like this -Dump cache records covered by the current remote + [ + { + "id": "0ABCDEF-01234567890", + "kind": "drive#teamDrive", + "name": "My Drive" + }, + { + "id": "0ABCDEFabcdefghijkl", + "kind": "drive#teamDrive", + "name": "Test Drive" + } + ] -fulldump + With the -o config parameter it will output the list in a format + suitable for adding to a config file to make aliases for all the + drives found and a combined drive. -Full dump of the database + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: - rclone backend fulldump remote: [options] [+] + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: -Dump all cache records in the database + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" -import + Adding this to the rclone config file will cause those team drives to + be accessible with the aliases shown. Any illegal characters will be + substituted with "_" and duplicate names will have numbers suffixed. + It will also add a remote called AllDrives which shows all the shared + drives combined into one directory tree. -Import a SUM file - rclone backend import remote: [options] [+] + ### untrash -Amend hash cache from a SUM file and bind checksums to files by -size/time. Usage Example: rclone backend import hasher:subdir md5 -/path/to/sum.md5 + Untrash files and directories -stickyimport + rclone backend untrash remote: [options] [+] -Perform fast import of a SUM file + This command untrashes all the files and directories in the directory + passed in recursively. - rclone backend stickyimport remote: [options] [+] + Usage: -Fill hash cache from a SUM file without verifying file fingerprints. -Usage Example: rclone backend stickyimport hasher:subdir md5 -remote:path/to/sum.md5 + This takes an optional directory to trash which make this easier to + use via the API. -Implementation details (advanced) + rclone backend untrash drive:directory + rclone backend --interactive untrash drive:directory subdir -This section explains how various rclone operations work on a hasher -remote. + Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. -Disclaimer. This section describes current implementation which can -change in future rclone versions!. + Result: -Hashsum command + { + "Untrashed": 17, + "Errors": 0 + } -The rclone hashsum (or md5sum or sha1sum) command will: -1. if requested hash is supported by lower level, just pass it. -2. if object size is below auto_size then download object and calculate - requested hashes on the fly. -3. if unsupported and the size is big enough, build object fingerprint - (including size, modtime if supported, first-found other hash if - any). -4. if the strict match is found in cache for the requested remote, - return the stored hash. -5. if remote found but fingerprint mismatched, then purge the entry and - proceed to step 6. -6. if remote not found or had no requested hash type or after step 5: - download object, calculate all supported hashes on the fly and store - in cache; return requested hash. + ### copyid -Other operations + Copy files by ID -- whenever a file is uploaded or downloaded in full, capture the - stream to calculate all supported hashes on the fly and update - database -- server-side move will update keys of existing cache entries -- deletefile will remove a single cache entry -- purge will remove all cache entries under the purged path + rclone backend copyid remote: [options] [+] -Note that setting max_age = 0 will disable checksum caching completely. + This command copies files by ID -If you set max_age = off, checksums in cache will never age, unless you -fully rewrite or delete the file. + Usage: -Cache storage + rclone backend copyid drive: ID path + rclone backend copyid drive: ID1 path1 ID2 path2 -Cached checksums are stored as bolt database files under rclone cache -directory, usually ~/.cache/rclone/kv/. Databases are maintained one per -base backend, named like BaseRemote~hasher.bolt. Checksums for multiple -alias-es into a single base backend will be stored in the single -database. All local paths are treated as aliases into the local backend -(unless crypted or chunked) and stored in -~/.cache/rclone/kv/local~hasher.bolt. Databases can be shared between -multiple rclone processes. + It copies the drive file with ID given to the path (an rclone path which + will be passed internally to rclone copyto). The ID and path pairs can be + repeated. -HDFS + The path should end with a / to indicate copy the file as named to + this directory. If it doesn't end with a / then the last path + component will be used as the file name. -HDFS is a distributed file-system, part of the Apache Hadoop framework. + If the destination is a drive backend then server-side copying will be + attempted if possible. -Paths are specified as remote: or remote:path/to/dir. + Use the --interactive/-i or --dry-run flag to see what would be copied before copying. -Configuration -Here is an example of how to make a remote called remote. First run: + ### exportformats - rclone config + Dump the export formats for debug purposes -This will guide you through an interactive setup process: + rclone backend exportformats remote: [options] [+] - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [skip] - XX / Hadoop distributed file system - \ "hdfs" - [skip] - Storage> hdfs - ** See help for hdfs backend at: https://rclone.org/hdfs/ ** - - hadoop name node and port - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Connect to host namenode at port 8020 - \ "namenode:8020" - namenode> namenode.hadoop:8020 - hadoop user name - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Connect to hdfs as root - \ "root" - username> root - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [remote] - type = hdfs - namenode = namenode.hadoop:8020 - username = root - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: + ### importformats - Name Type - ==== ==== - hadoop hdfs + Dump the import formats for debug purposes - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> q + rclone backend importformats remote: [options] [+] -This remote is called remote and can now be used like this -See all the top level directories - rclone lsd remote: + ## Limitations -List the contents of a directory + Drive has quite a lot of rate limiting. This causes rclone to be + limited to transferring about 2 files per second only. Individual + files may be transferred much faster at 100s of MiB/s but lots of + small files can take a long time. - rclone ls remote:directory + Server side copies are also subject to a separate rate limit. If you + see User rate limit exceeded errors, wait at least 24 hours and retry. + You can disable server-side copies with `--disable copy` to download + and upload the files if you prefer. -Sync the remote directory to /home/local/directory, deleting any excess -files. + ### Limitations of Google Docs - rclone sync --interactive remote:directory /home/local/directory + Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, + and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` + and `rclone serve`. When calculating directory totals, e.g. in + `rclone size` and `rclone ncdu`, they will be counted in as empty + files. -Setting up your own HDFS instance for testing + This is because rclone can't find out the size of the Google docs + without downloading them. -You may start with a manual setup or use the docker image from the -tests: + Google docs will transfer correctly with `rclone sync`, `rclone copy` + etc as rclone knows to ignore the size when doing the transfer. -If you want to build the docker image + However an unfortunate consequence of this is that you may not be able + to download Google docs using `rclone mount`. If it doesn't work you + will get a 0 sized file. If you try again the doc may gain its + correct size and be downloadable. Whether it will work on not depends + on the application accessing the mount and the OS you are running - + experiment to find out if it does work for you! - git clone https://github.com/rclone/rclone.git - cd rclone/fstest/testserver/images/test-hdfs - docker build --rm -t rclone/test-hdfs . + ### Duplicated files -Or you can just use the latest one pushed + Sometimes, for no reason I've been able to track down, drive will + duplicate a file that rclone uploads. Drive unlike all the other + remotes can have duplicated files. - docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs + Duplicated files cause problems with the syncing and you will see + messages in the log about duplicates. -NB it need few seconds to startup. + Use `rclone dedupe` to fix duplicated files. -For this docker image the remote needs to be configured like this: + Note that this isn't just a problem with rclone, even Google Photos on + Android duplicates files on drive sometimes. - [remote] - type = hdfs - namenode = 127.0.0.1:8020 - username = root + ### Rclone appears to be re-copying files it shouldn't -You can stop this image with docker kill rclone-hdfs (NB it does not use -volumes, so all data uploaded will be lost.) + The most likely cause of this is the duplicated file issue above - run + `rclone dedupe` and check your logs for duplicate object or directory + messages. -Modified time + This can also be caused by a delay/caching on google drive's end when + comparing directory listings. Specifically with team drives used in + combination with --fast-list. Files that were uploaded recently may + not appear on the directory list sent to rclone when using --fast-list. -Time accurate to 1 second is stored. + Waiting a moderate period of time between attempts (estimated to be + approximately 1 hour) and/or not using --fast-list both seem to be + effective in preventing the problem. -Checksum + ### SHA1 or SHA256 hashes may be missing -No checksums are implemented. + All files have MD5 hashes, but a small fraction of files uploaded may + not have SHA1 or SHA256 hashes especially if they were uploaded before 2018. -Usage information + ## Making your own client_id -You can use the rclone about remote: command which will display -filesystem size and current usage. + When you use rclone with Google drive in its default configuration you + are using rclone's client_id. This is shared between all the rclone + users. There is a global rate limit on the number of queries per + second that each client_id can do set by Google. rclone already has a + high quota and I will continue to make sure it is high enough by + contacting Google. -Restricted filename characters + It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. -In addition to the default restricted characters set the following -characters are also replaced: + Here is how to create your own Google Drive client ID for rclone: - Character Value Replacement - ----------- ------- ------------- - : 0x3A : + 1. Log into the [Google API + Console](https://console.developers.google.com/) with your Google + account. It doesn't matter what Google account you use. (It need not + be the same account as the Google Drive you want to access) -Invalid UTF-8 bytes will also be replaced. + 2. Select a project or create a new project. -Standard options + 3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the + "Google Drive API". -Here are the Standard options specific to hdfs (Hadoop distributed file -system). + 4. Click "Credentials" in the left-side panel (not "Create + credentials", which opens the wizard). + + 5. If you already configured an "Oauth Consent Screen", then skip + to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button + (near the top right corner of the right panel), then select "External" + and click on "CREATE"; on the next screen, enter an "Application name" + ("rclone" is OK); enter "User Support Email" (your own email is OK); + enter "Developer Contact Email" (your own email is OK); then click on + "Save" (all other data is optional). You will also have to add some scopes, + including `.../auth/docs` and `.../auth/drive` in order to be able to edit, + create and delete files with RClone. You may also want to include the + `../auth/drive.metadata.readonly` scope. After adding scopes, click + "Save and continue" to add test users. Be sure to add your own account to + the test users. Once you've added yourself as a test user and saved the + changes, click again on "Credentials" on the left panel to go back to + the "Credentials" screen. + + (PS: if you are a GSuite user, you could also select "Internal" instead + of "External" above, but this will restrict API use to Google Workspace + users in your organisation). + + 6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, + then select "OAuth client ID". ---hdfs-namenode + 7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) -Hadoop name node and port. + 8. It will show you a client ID and client secret. Make a note of these. + + (If you selected "External" at Step 5 continue to Step 9. + If you chose "Internal" you don't need to publish and can skip straight to + Step 10 but your destination drive must be part of the same Google Workspace.) -E.g. "namenode:8020" to connect to host namenode at port 8020. + 9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. + You will also want to add yourself as a test user. -Properties: + 10. Provide the noted client ID and client secret to rclone. -- Config: namenode -- Env Var: RCLONE_HDFS_NAMENODE -- Type: string -- Required: true + Be aware that, due to the "enhanced security" recently introduced by + Google, you are theoretically expected to "submit your app for verification" + and then wait a few weeks(!) for their response; in practice, you can go right + ahead and use the client ID and client secret with rclone, the only issue will + be a very scary confirmation screen shown when you connect via your browser + for rclone to be able to get its token-id (but as this only happens during + the remote configuration, it's not such a big deal). Keeping the application in + "Testing" will work as well, but the limitation is that any grants will expire + after a week, which can be annoying to refresh constantly. If, for whatever + reason, a short grant time is not a problem, then keeping the application in + testing mode would also be sufficient. ---hdfs-username + (Thanks to @balazer on github for these instructions.) -Hadoop user name. + Sometimes, creation of an OAuth consent in Google API Console fails due to an error message + “The request failed because changes to one of the field of the resource is not supported”. + As a convenient workaround, the necessary Google Drive API key can be created on the + [Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. + Just push the Enable the Drive API button to receive the Client ID and Secret. + Note that it will automatically create a new project in the API Console. -Properties: + # Google Photos -- Config: username -- Env Var: RCLONE_HDFS_USERNAME -- Type: string -- Required: false -- Examples: - - "root" - - Connect to hdfs as root. + The rclone backend for [Google Photos](https://www.google.com/photos/about/) is + a specialized backend for transferring photos and videos to and from + Google Photos. -Advanced options + **NB** The Google Photos API which rclone uses has quite a few + limitations, so please read the [limitations section](#limitations) + carefully to make sure it is suitable for your use. -Here are the Advanced options specific to hdfs (Hadoop distributed file -system). + ## Configuration ---hdfs-service-principal-name + The initial setup for google cloud storage involves getting a token from Google Photos + which you need to do in your browser. `rclone config` walks you + through it. -Kerberos service principal name for the namenode. + Here is an example of how to make a remote called `remote`. First run: -Enables KERBEROS authentication. Specifies the Service Principal Name -(SERVICE/FQDN) for the namenode. E.g. "hdfs/namenode.hadoop.docker" for -namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. + rclone config -Properties: + This will guide you through an interactive setup process: -- Config: service_principal_name -- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME -- Type: string -- Required: false +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / Google +Photos  "google photos" [snip] Storage> google photos ** See help for +google photos backend at: https://rclone.org/googlephotos/ ** ---hdfs-data-transfer-protection +Google Application Client Id Leave blank normally. Enter a string value. +Press Enter for the default (""). client_id> Google Application Client +Secret Leave blank normally. Enter a string value. Press Enter for the +default (""). client_secret> Set to make the Google Photos backend read +only. -Kerberos data transfer protection: authentication|integrity|privacy. +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. Enter a +boolean value (true or false). Press Enter for the default ("false"). +read_only> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config +Use web browser to automatically authenticate rclone with remote? * Say +Y if the machine running rclone has a web browser you can use * Say N if +running rclone on a (remote) machine without web browser access If not +sure try Y. If Y failed, try N. y) Yes n) No y/n> y If your browser +doesn't open automatically go to the following link: +http://127.0.0.1:53682/auth Log in and authorize rclone for access +Waiting for code... Got code -Specifies whether or not authentication, data signature integrity -checks, and wire encryption is required when communicating the the -datanodes. Possible values are 'authentication', 'integrity' and -'privacy'. Used only with KERBEROS enabled. +*** IMPORTANT: All media items uploaded to Google Photos with rclone *** +are stored in full resolution at original quality. These uploads *** +will count towards storage in your Google Account. -Properties: + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + [remote] type = google photos token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -- Config: data_transfer_protection -- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION -- Type: string -- Required: false -- Examples: - - "privacy" - - Ensure authentication, integrity and encryption enabled. + See the remote setup docs for how to set it up on a machine with no Internet browser available. ---hdfs-encoding + Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode. -The encoding for the backend. + This remote is called remote and can now be used like this -See the encoding section in the overview for more info. + See all the albums in your photos -Properties: + rclone lsd remote:album -- Config: encoding -- Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder -- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot + Make a new album -Limitations + rclone mkdir remote:album/newAlbum -- No server-side Move or DirMove. -- Checksums not implemented. + List the contents of an album -HiDrive + rclone ls remote:album/newAlbum -Paths are specified as remote:path + Sync /home/local/images to the Google Photos, removing any excess files in the album. -Paths may be as deep as required, e.g. remote:directory/subdirectory. + rclone sync --interactive /home/local/image remote:album/newAlbum -The initial setup for hidrive involves getting a token from HiDrive -which you need to do in your browser. rclone config walks you through -it. + ### Layout -Configuration + As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it. -Here is an example of how to make a remote called remote. First run: + The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.) - rclone config + Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums. -This will guide you through an interactive setup process: + / - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg - No remotes found - make a new one - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / HiDrive - \ "hidrive" - [snip] - Storage> hidrive - OAuth Client Id - Leave blank normally. - client_id> - OAuth Client Secret - Leave blank normally. - client_secret> - Access permissions that rclone should use when requesting access from HiDrive. - Leave blank normally. - scope_access> - Edit advanced config? - y/n> n - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - type = hidrive - token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + There are two writable parts of the tree, the upload directory and sub directories of the album directory. -You should be aware that OAuth-tokens can be used to access your account -and hence should not be shared with other persons. See the below section -for more information. + The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do -Note that rclone runs a webserver on your local machine to collect the -token as returned from HiDrive. This only runs from the moment it opens -your browser to the moment you get back the verification code. The -webserver runs on http://127.0.0.1:53682/. If local port 53682 is -protected by a firewall you may need to temporarily unblock the firewall -to complete authorization. + rclone copy /path/to/images remote:album/images -Once configured you can then use rclone like this, + and the images directory contains -List directories in top level of your HiDrive root folder + images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg - rclone lsd remote: + Then rclone will create the following albums with the following files in -List all the files in your HiDrive filesystem + - images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - file3.jpg - rclone ls remote: + This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing. -To copy a local directory to a HiDrive directory called backup + The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface. - rclone copy /home/source remote:backup + ### Standard options -Keeping your tokens safe + Here are the Standard options specific to google photos (Google Photos). -Any OAuth-tokens will be stored by rclone in the remote's configuration -file as unencrypted text. Anyone can use a valid refresh-token to access -your HiDrive filesystem without knowing your password. Therefore you -should make sure no one else can access your configuration. + #### --gphotos-client-id -It is possible to encrypt rclone's configuration file. You can find -information on securing your configuration file by viewing the -configuration encryption docs. + OAuth Client Id. -Invalid refresh token + Leave blank normally. -As can be verified here, each refresh_token (for Native Applications) is -valid for 60 days. If used to access HiDrivei, its validity will be -automatically extended. + Properties: -This means that if you + - Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - Required: false -- Don't use the HiDrive remote for 60 days + #### --gphotos-client-secret -then rclone will return an error which includes a text that implies the -refresh token is invalid or expired. + OAuth Client Secret. -To fix this you will need to authorize rclone to access your HiDrive -account again. + Leave blank normally. -Using + Properties: - rclone config reconnect remote: + - Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: string - Required: false -the process is very similar to the process of initial setup exemplified -before. + #### --gphotos-read-only -Modified time and hashes + Set to make the Google Photos backend read only. -HiDrive allows modification times to be set on objects accurate to 1 -second. + If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access. -HiDrive supports its own hash type which is used to verify the integrity -of file contents after successful transfers. + Properties: -Restricted filename characters + - Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false -HiDrive cannot store files or folders that include / (0x2F) or -null-bytes (0x00) in their name. Any other characters can be used in the -names of files or folders. Additionally, files or folders cannot be -named either of the following: . or .. + ### Advanced options -Therefore rclone will automatically replace these characters, if files -or folders are stored or accessed with such names. + Here are the Advanced options specific to google photos (Google Photos). -You can read about how this filename encoding works in general here. + #### --gphotos-token -Keep in mind that HiDrive only supports file or folder names with a -length of 255 characters or less. + OAuth Access Token as a JSON blob. -Transfers + Properties: -HiDrive limits file sizes per single request to a maximum of 2 GiB. To -allow storage of larger files and allow for better upload performance, -the hidrive backend will use a chunked transfer for files larger than 96 -MiB. Rclone will upload multiple parts/chunks of the file at the same -time. Chunks in the process of being uploaded are buffered in memory, so -you may want to restrict this behaviour on systems with limited -resources. + - Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - Required: false -You can customize this behaviour using the following options: + #### --gphotos-auth-url -- chunk_size: size of file parts -- upload_cutoff: files larger or equal to this in size will use a - chunked transfer -- upload_concurrency: number of file-parts to upload at the same time + Auth server URL. -See the below section about configuration options for more details. + Leave blank to use the provider defaults. -Root folder + Properties: -You can set the root folder for rclone. This is the directory that -rclone considers to be the root of your HiDrive. + - Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - Required: false -Usually, you will leave this blank, and rclone will use the root of the -account. + #### --gphotos-token-url -However, you can set this to restrict rclone to a specific folder -hierarchy. + Token server url. -This works by prepending the contents of the root_prefix option to any -paths accessed by rclone. For example, the following two ways to access -the home directory are equivalent: + Leave blank to use the provider defaults. - rclone lsd --hidrive-root-prefix="/users/test/" remote:path + Properties: - rclone lsd remote:/users/test/path + - Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false -See the below section about configuration options for more details. + #### --gphotos-read-size -Directory member count + Set to read the size of media items. -By default, rclone will know the number of directory members contained -in a directory. For example, rclone lsd uses this information. + Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media. -The acquisition of this information will result in additional time costs -for HiDrive's API. When dealing with large directory structures, it may -be desirable to circumvent this time cost, especially when this -information is not explicitly needed. For this, the -disable_fetching_member_count option can be used. + Properties: -See the below section about configuration options for more details. + - Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false -Standard options + #### --gphotos-start-year -Here are the Standard options specific to hidrive (HiDrive). + Year limits the photos to be downloaded to those which are uploaded after the given year. ---hidrive-client-id + Properties: -OAuth Client Id. + - Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - Default: 2000 -Leave blank normally. + #### --gphotos-include-archived -Properties: + Also view and download archived media. -- Config: client_id -- Env Var: RCLONE_HIDRIVE_CLIENT_ID -- Type: string -- Required: false + By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred. ---hidrive-client-secret + Note that media in albums is always visible and synced, no matter their archive status. -OAuth Client Secret. + With this flag, archived media are always visible in directory listings and transferred. -Leave blank normally. + Without this flag, archived media will not be visible in directory listings and won't be transferred. -Properties: + Properties: -- Config: client_secret -- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET -- Type: string -- Required: false + - Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false ---hidrive-scope-access + #### --gphotos-encoding -Access permissions that rclone should use when requesting access from -HiDrive. + The encoding for the backend. -Properties: + See the encoding section in the overview for more info. -- Config: scope_access -- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS -- Type: string -- Default: "rw" -- Examples: - - "rw" - - Read and write access to resources. - - "ro" - - Read-only access to resources. + Properties: -Advanced options + - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot -Here are the Advanced options specific to hidrive (HiDrive). + #### --gphotos-batch-mode ---hidrive-token + Upload file batching sync|async|off. -OAuth Access Token as a JSON blob. + This sets the batch mode used by rclone. -Properties: + This has 3 possible values -- Config: token -- Env Var: RCLONE_HIDRIVE_TOKEN -- Type: string -- Required: false + - off - no batching - sync - batch uploads and check completion (default) - async - batch upload and don't check completion ---hidrive-auth-url + Rclone will close any outstanding batches when it exits which may make a delay on quit. -Auth server URL. + Properties: -Leave blank to use the provider defaults. + - Config: batch_mode - Env Var: RCLONE_GPHOTOS_BATCH_MODE - Type: string - Default: "sync" -Properties: + #### --gphotos-batch-size -- Config: auth_url -- Env Var: RCLONE_HIDRIVE_AUTH_URL -- Type: string -- Required: false + Max number of files in upload batch. ---hidrive-token-url + This sets the batch size of files to upload. It has to be less than 50. -Token server url. + By default this is 0 which means rclone which calculate the batch size depending on the setting of batch_mode. -Leave blank to use the provider defaults. + - batch_mode: async - default batch_size is 50 - batch_mode: sync - default batch_size is the same as --transfers - batch_mode: off - not in use -Properties: + Rclone will close any outstanding batches when it exits which may make a delay on quit. -- Config: token_url -- Env Var: RCLONE_HIDRIVE_TOKEN_URL -- Type: string -- Required: false + Setting this is a great idea if you are uploading lots of small files as it will make them a lot quicker. You can use --transfers 32 to maximise throughput. ---hidrive-scope-role + Properties: -User-level that rclone should use when requesting access from HiDrive. + - Config: batch_size - Env Var: RCLONE_GPHOTOS_BATCH_SIZE - Type: int - Default: 0 -Properties: + #### --gphotos-batch-timeout -- Config: scope_role -- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE -- Type: string -- Default: "user" -- Examples: - - "user" - - User-level access to management permissions. - - This will be sufficient in most cases. - - "admin" - - Extensive access to management permissions. - - "owner" - - Full access to management permissions. + Max time to allow an idle upload batch before uploading. ---hidrive-root-prefix + If an upload batch is idle for more than this long then it will be uploaded. -The root/parent folder for all paths. + The default for this is 0 which means rclone will choose a sensible default based on the batch_mode in use. -Fill in to use the specified folder as the parent for all paths given to -the remote. This way rclone can use any folder as its starting point. + - batch_mode: async - default batch_timeout is 10s - batch_mode: sync - default batch_timeout is 1s - batch_mode: off - not in use -Properties: + Properties: -- Config: root_prefix -- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX -- Type: string -- Default: "/" -- Examples: - - "/" - - The topmost directory accessible by rclone. - - This will be equivalent with "root" if rclone uses a regular - HiDrive user account. - - "root" - - The topmost directory of the HiDrive user account - - "" - - This specifies that there is no root-prefix for your paths. - - When using this you will always need to specify paths to - this remote with a valid parent e.g. "remote:/path/to/dir" - or "remote:root/path/to/dir". + - Config: batch_timeout - Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT - Type: Duration - Default: 0s ---hidrive-endpoint + #### --gphotos-batch-commit-timeout -Endpoint for the service. + Max time to wait for a batch to finish committing -This is the URL that API-calls will be made to. + Properties: -Properties: + - Config: batch_commit_timeout - Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT - Type: Duration - Default: 10m0s -- Config: endpoint -- Env Var: RCLONE_HIDRIVE_ENDPOINT -- Type: string -- Default: "https://api.hidrive.strato.com/2.1" + ## Limitations ---hidrive-disable-fetching-member-count + Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item. -Do not fetch number of objects in directories unless it is absolutely -necessary. + Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode.. -Requests may be faster if the number of objects in subdirectories is not -fetched. + rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote. -Properties: + See List of backends that do not support rclone about See rclone about -- Config: disable_fetching_member_count -- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT -- Type: bool -- Default: false + ### Downloading Images ---hidrive-chunk-size + When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115. -Chunksize for chunked uploads. + The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort -Any files larger than the configured cutoff (or files of unknown size) -will be uploaded in chunks of this size. + ### Downloading Videos -The upper limit for this is 2147483647 bytes (about 2.000Gi). That is -the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit or to a negative value will cause -uploads to fail. + When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044. -Setting this to larger values may increase the upload speed at the cost -of using more memory. It can be set to smaller values smaller to save on -memory. + ### Duplicates -Properties: + If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!). -- Config: chunk_size -- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi + If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause + too many problems. ---hidrive-upload-cutoff + ### Modification times -Cutoff/Threshold for chunked uploads. + The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known. -Any files larger than this will be uploaded in chunks of the configured -chunksize. + This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes. -The upper limit for this is 2147483647 bytes (about 2.000Gi). That is -the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit will cause uploads to fail. + ### Size -Properties: + The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check. -- Config: upload_cutoff -- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 96Mi + It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter. ---hidrive-upload-concurrency + If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag. -Concurrency for chunked uploads. + ### Albums -This is the upper limit for how many transfers for the same file are -running concurrently. Setting this above to a value smaller than 1 will -cause uploads to deadlock. + Rclone can only upload files to albums it created. This is a limitation of the Google Photos API. -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. + Rclone can remove files it uploaded from albums it created only. -Properties: + ### Deleting files -- Config: upload_concurrency -- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 + Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781. ---hidrive-encoding + Rclone cannot delete files anywhere except under album. -The encoding for the backend. + ### Deleting albums -See the encoding section in the overview for more info. + The Google Photos API does not support deleting albums - see bug #135714733. -Properties: + # Hasher + + Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files + + ## Getting started + + To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working. + + Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket. + + Now proceed to interactive or manual configuration. + + ### Interactive configuration + + Run rclone config: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> Hasher1 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Handle checksums for other remotes  "hasher" [snip] Storage> hasher Remote to cache checksums for, like myremote:mypath. Enter a string value. Press Enter for the default (""). remote> myRemote:path Comma + separated list of supported checksum types. Enter a string value. Press Enter for the default ("md5,sha1"). hashsums> md5 Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. max_age> off Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +[Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = +off -------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y + + + ### Manual configuration + + Run `rclone config path` to see the path of current active config file, + usually `YOURHOME/.config/rclone/rclone.conf`. + Open it in your favorite text editor, find section for the base remote + and create new section for hasher like in the following examples: + +[Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = +off + +[Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 +max_age = 24h + + + Hasher takes basically the following parameters: + - `remote` is required, + - `hashes` is a comma separated list of supported checksums + (by default `md5,sha1`), + - `max_age` - maximum time to keep a checksum value in the cache, + `0` will disable caching completely, + `off` will cache "forever" (that is until the files get changed). + + Make sure the `remote` has `:` (colon) in. If you specify the remote without + a colon then rclone will use a local directory of that name. So if you use + a remote of `/local/path` then rclone will handle hashes for that directory. + If you use `remote = name` literally then rclone will put files + **in a directory called `name` located under current directory**. + + ## Usage + + ### Basic operations + + Now you can use it as `Hasher2:subdir/file` instead of base remote. + Hasher will transparently update cache with new checksums when a file + is fully read or overwritten, like: + +rclone copy External:path/file Hasher:dest/path + +rclone cat Hasher:path/to/file > /dev/null + + + The way to refresh **all** cached checksums (even unsupported by the base backend) + for a subtree is to **re-download** all files in the subtree. For example, + use `hashsum --download` using **any** supported hashsum on the command line + (we just care to re-read): + +rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null + +rclone backend dump Hasher:path/to/subtree + + + You can print or drop hashsum cache using custom backend commands: + +rclone backend dump Hasher:dir/subdir + +rclone backend drop Hasher: + + + ### Pre-Seed from a SUM File + + Hasher supports two backend commands: generic SUM file `import` and faster + but less consistent `stickyimport`. + +rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM +[--checkers 4] + + + Instead of SHA1 it can be any hash supported by the remote. The last argument + can point to either a local or an `other-remote:path` text file in SUM format. + The command will parse the SUM file, then walk down the path given by the + first argument, snapshot current fingerprints and fill in the cache entries + correspondingly. + - Paths in the SUM file are treated as relative to `hasher:dir/subdir`. + - The command will **not** check that supplied values are correct. + You **must know** what you are doing. + - This is a one-time action. The SUM file will not get "attached" to the + remote. Cache entries can still be overwritten later, should the object's + fingerprint change. + - The tree walk can take long depending on the tree size. You can increase + `--checkers` to make it faster. Or use `stickyimport` if you don't care + about fingerprints and consistency. + +rclone backend stickyimport hasher:path/to/data sha1 +remote:/path/to/sum.sha1 + + + `stickyimport` is similar to `import` but works much faster because it + does not need to stat existing files and skips initial tree walk. + Instead of binding cache entries to file fingerprints it creates _sticky_ + entries bound to the file name alone ignoring size, modification time etc. + Such hash entries can be replaced only by `purge`, `delete`, `backend drop` + or by full re-read/re-write of the files. + + ## Configuration reference + + + ### Standard options + + Here are the Standard options specific to hasher (Better checksums for other remotes). + + #### --hasher-remote + + Remote to cache checksums for (e.g. myRemote:path). + + Properties: + + - Config: remote + - Env Var: RCLONE_HASHER_REMOTE + - Type: string + - Required: true + + #### --hasher-hashes + + Comma separated list of supported checksum types. + + Properties: + + - Config: hashes + - Env Var: RCLONE_HASHER_HASHES + - Type: CommaSepList + - Default: md5,sha1 + + #### --hasher-max-age + + Maximum time to keep checksums in cache (0 = no cache, off = cache forever). + + Properties: + + - Config: max_age + - Env Var: RCLONE_HASHER_MAX_AGE + - Type: Duration + - Default: off + + ### Advanced options + + Here are the Advanced options specific to hasher (Better checksums for other remotes). + + #### --hasher-auto-size + + Auto-update checksum for files smaller than this size (disabled by default). + + Properties: + + - Config: auto_size + - Env Var: RCLONE_HASHER_AUTO_SIZE + - Type: SizeSuffix + - Default: 0 + + ### Metadata + + Any metadata supported by the underlying remote is read and written. + + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + ## Backend commands + + Here are the commands specific to the hasher backend. + + Run them with + + rclone backend COMMAND remote: + + The help below will explain what arguments each command takes. + + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. + + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). + + ### drop + + Drop cache + + rclone backend drop remote: [options] [+] + + Completely drop checksum cache. + Usage Example: + rclone backend drop hasher: + + + ### dump + + Dump the database + + rclone backend dump remote: [options] [+] + + Dump cache records covered by the current remote + + ### fulldump + + Full dump of the database + + rclone backend fulldump remote: [options] [+] + + Dump all cache records in the database + + ### import + + Import a SUM file + + rclone backend import remote: [options] [+] + + Amend hash cache from a SUM file and bind checksums to files by size/time. + Usage Example: + rclone backend import hasher:subdir md5 /path/to/sum.md5 + + + ### stickyimport + + Perform fast import of a SUM file + + rclone backend stickyimport remote: [options] [+] + + Fill hash cache from a SUM file without verifying file fingerprints. + Usage Example: + rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 + + + + + ## Implementation details (advanced) + + This section explains how various rclone operations work on a hasher remote. + + **Disclaimer. This section describes current implementation which can + change in future rclone versions!.** + + ### Hashsum command + + The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: + + 1. if requested hash is supported by lower level, just pass it. + 2. if object size is below `auto_size` then download object and calculate + _requested_ hashes on the fly. + 3. if unsupported and the size is big enough, build object `fingerprint` + (including size, modtime if supported, first-found _other_ hash if any). + 4. if the strict match is found in cache for the requested remote, return + the stored hash. + 5. if remote found but fingerprint mismatched, then purge the entry and + proceed to step 6. + 6. if remote not found or had no requested hash type or after step 5: + download object, calculate all _supported_ hashes on the fly and store + in cache; return requested hash. + + ### Other operations + + - whenever a file is uploaded or downloaded **in full**, capture the stream + to calculate all supported hashes on the fly and update database + - server-side `move` will update keys of existing cache entries + - `deletefile` will remove a single cache entry + - `purge` will remove all cache entries under the purged path + + Note that setting `max_age = 0` will disable checksum caching completely. + + If you set `max_age = off`, checksums in cache will never age, unless you + fully rewrite or delete the file. + + ### Cache storage + + Cached checksums are stored as `bolt` database files under rclone cache + directory, usually `~/.cache/rclone/kv/`. Databases are maintained + one per _base_ backend, named like `BaseRemote~hasher.bolt`. + Checksums for multiple `alias`-es into a single base backend + will be stored in the single database. All local paths are treated as + aliases into the `local` backend (unless encrypted or chunked) and stored + in `~/.cache/rclone/kv/local~hasher.bolt`. + Databases can be shared between multiple rclone processes. + + # HDFS + + [HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a + distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. + + Paths are specified as `remote:` or `remote:path/to/dir`. + + ## Configuration + + Here is an example of how to make a remote called `remote`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [skip] XX / Hadoop +distributed file system  "hdfs" [skip] Storage> hdfs ** See help for +hdfs backend at: https://rclone.org/hdfs/ ** + +hadoop name node and port Enter a string value. Press Enter for the +default (""). Choose a number from below, or type in your own value 1 / +Connect to host namenode at port 8020  "namenode:8020" namenode> +namenode.hadoop:8020 hadoop user name Enter a string value. Press Enter +for the default (""). Choose a number from below, or type in your own +value 1 / Connect to hdfs as root  "root" username> root Edit advanced +config? (y/n) y) Yes n) No (default) y/n> n Remote config +-------------------- [remote] type = hdfs namenode = +namenode.hadoop:8020 username = root -------------------- y) Yes this is +OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current +remotes: + +Name Type ==== ==== hadoop hdfs + +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> q + + + This remote is called `remote` and can now be used like this + + See all the top level directories + + rclone lsd remote: + + List the contents of a directory + + rclone ls remote:directory + + Sync the remote `directory` to `/home/local/directory`, deleting any excess files. + + rclone sync --interactive remote:directory /home/local/directory + + ### Setting up your own HDFS instance for testing + + You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) + or use the docker image from the tests: + + If you want to build the docker image + +git clone https://github.com/rclone/rclone.git cd +rclone/fstest/testserver/images/test-hdfs docker build --rm -t +rclone/test-hdfs . + + + Or you can just use the latest one pushed + +docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p +127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs + + + **NB** it need few seconds to startup. + + For this docker image the remote needs to be configured like this: + +[remote] type = hdfs namenode = 127.0.0.1:8020 username = root + + + You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data + uploaded will be lost.) + + ### Modification times + + Time accurate to 1 second is stored. + + ### Checksum + + No checksums are implemented. + + ### Usage information + + You can use the `rclone about remote:` command which will display filesystem size and current usage. + + ### Restricted filename characters + + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | : | 0x3A | : | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). + + + ### Standard options + + Here are the Standard options specific to hdfs (Hadoop distributed file system). + + #### --hdfs-namenode + + Hadoop name nodes and ports. + + E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020. + + Properties: + + - Config: namenode + - Env Var: RCLONE_HDFS_NAMENODE + - Type: CommaSepList + - Default: + + #### --hdfs-username + + Hadoop user name. + + Properties: + + - Config: username + - Env Var: RCLONE_HDFS_USERNAME + - Type: string + - Required: false + - Examples: + - "root" + - Connect to hdfs as root. + + ### Advanced options + + Here are the Advanced options specific to hdfs (Hadoop distributed file system). + + #### --hdfs-service-principal-name + + Kerberos service principal name for the namenode. + + Enables KERBEROS authentication. Specifies the Service Principal Name + (SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" + for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. + + Properties: + + - Config: service_principal_name + - Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME + - Type: string + - Required: false + + #### --hdfs-data-transfer-protection + + Kerberos data transfer protection: authentication|integrity|privacy. + + Specifies whether or not authentication, data signature integrity + checks, and wire encryption are required when communicating with + the datanodes. Possible values are 'authentication', 'integrity' + and 'privacy'. Used only with KERBEROS enabled. + + Properties: + + - Config: data_transfer_protection + - Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION + - Type: string + - Required: false + - Examples: + - "privacy" + - Ensure authentication, integrity and encryption enabled. + + #### --hdfs-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_HDFS_ENCODING + - Type: Encoding + - Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot + + + + ## Limitations + + - No server-side `Move` or `DirMove`. + - Checksums not implemented. + + # HiDrive + + Paths are specified as `remote:path` + + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + + The initial setup for hidrive involves getting a token from HiDrive + which you need to do in your browser. + `rclone config` walks you through it. + + ## Configuration + + Here is an example of how to make a remote called `remote`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found - make a new one n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / HiDrive  "hidrive" [snip] Storage> hidrive OAuth Client Id - Leave +blank normally. client_id> OAuth Client Secret - Leave blank normally. +client_secret> Access permissions that rclone should use when requesting +access from HiDrive. Leave blank normally. scope_access> Edit advanced +config? y/n> n Use web browser to automatically authenticate rclone with +remote? * Say Y if the machine running rclone has a web browser you can +use * Say N if running rclone on a (remote) machine without web browser +access If not sure try Y. If Y failed, try N. y/n> y If your browser +doesn't open automatically go to the following link: +http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx Log in and +authorize rclone for access Waiting for code... Got code +-------------------- [remote] type = hidrive token = +{"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} +-------------------- y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> y + + + **You should be aware that OAuth-tokens can be used to access your account + and hence should not be shared with other persons.** + See the [below section](#keeping-your-tokens-safe) for more information. + + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. + + Note that rclone runs a webserver on your local machine to collect the + token as returned from HiDrive. This only runs from the moment it opens + your browser to the moment you get back the verification code. + The webserver runs on `http://127.0.0.1:53682/`. + If local port `53682` is protected by a firewall you may need to temporarily + unblock the firewall to complete authorization. + + Once configured you can then use `rclone` like this, + + List directories in top level of your HiDrive root folder + + rclone lsd remote: + + List all the files in your HiDrive filesystem + + rclone ls remote: + + To copy a local directory to a HiDrive directory called backup + + rclone copy /home/source remote:backup + + ### Keeping your tokens safe + + Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. + Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. + Therefore you should make sure no one else can access your configuration. + + It is possible to encrypt rclone's configuration file. + You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). + + ### Invalid refresh token + + As can be verified [here](https://developer.hidrive.com/basics-flows/), + each `refresh_token` (for Native Applications) is valid for 60 days. + If used to access HiDrivei, its validity will be automatically extended. + + This means that if you + + * Don't use the HiDrive remote for 60 days + + then rclone will return an error which includes a text + that implies the refresh token is *invalid* or *expired*. + + To fix this you will need to authorize rclone to access your HiDrive account again. + + Using + + rclone config reconnect remote: + + the process is very similar to the process of initial setup exemplified before. + + ### Modification times and hashes + + HiDrive allows modification times to be set on objects accurate to 1 second. + + HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) + which is used to verify the integrity of file contents after successful transfers. + + ### Restricted filename characters + + HiDrive cannot store files or folders that include + `/` (0x2F) or null-bytes (0x00) in their name. + Any other characters can be used in the names of files or folders. + Additionally, files or folders cannot be named either of the following: `.` or `..` + + Therefore rclone will automatically replace these characters, + if files or folders are stored or accessed with such names. + + You can read about how this filename encoding works in general + [here](overview/#restricted-filenames). + + Keep in mind that HiDrive only supports file or folder names + with a length of 255 characters or less. + + ### Transfers + + HiDrive limits file sizes per single request to a maximum of 2 GiB. + To allow storage of larger files and allow for better upload performance, + the hidrive backend will use a chunked transfer for files larger than 96 MiB. + Rclone will upload multiple parts/chunks of the file at the same time. + Chunks in the process of being uploaded are buffered in memory, + so you may want to restrict this behaviour on systems with limited resources. + + You can customize this behaviour using the following options: + + * `chunk_size`: size of file parts + * `upload_cutoff`: files larger or equal to this in size will use a chunked transfer + * `upload_concurrency`: number of file-parts to upload at the same time + + See the below section about configuration options for more details. + + ### Root folder + + You can set the root folder for rclone. + This is the directory that rclone considers to be the root of your HiDrive. + + Usually, you will leave this blank, and rclone will use the root of the account. + + However, you can set this to restrict rclone to a specific folder hierarchy. + + This works by prepending the contents of the `root_prefix` option + to any paths accessed by rclone. + For example, the following two ways to access the home directory are equivalent: + + rclone lsd --hidrive-root-prefix="/users/test/" remote:path + + rclone lsd remote:/users/test/path + + See the below section about configuration options for more details. + + ### Directory member count + + By default, rclone will know the number of directory members contained in a directory. + For example, `rclone lsd` uses this information. + + The acquisition of this information will result in additional time costs for HiDrive's API. + When dealing with large directory structures, it may be desirable to circumvent this time cost, + especially when this information is not explicitly needed. + For this, the `disable_fetching_member_count` option can be used. + + See the below section about configuration options for more details. + + + ### Standard options + + Here are the Standard options specific to hidrive (HiDrive). + + #### --hidrive-client-id + + OAuth Client Id. + + Leave blank normally. + + Properties: + + - Config: client_id + - Env Var: RCLONE_HIDRIVE_CLIENT_ID + - Type: string + - Required: false + + #### --hidrive-client-secret + + OAuth Client Secret. + + Leave blank normally. + + Properties: + + - Config: client_secret + - Env Var: RCLONE_HIDRIVE_CLIENT_SECRET + - Type: string + - Required: false + + #### --hidrive-scope-access + + Access permissions that rclone should use when requesting access from HiDrive. + + Properties: + + - Config: scope_access + - Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS + - Type: string + - Default: "rw" + - Examples: + - "rw" + - Read and write access to resources. + - "ro" + - Read-only access to resources. + + ### Advanced options + + Here are the Advanced options specific to hidrive (HiDrive). + + #### --hidrive-token + + OAuth Access Token as a JSON blob. + + Properties: + + - Config: token + - Env Var: RCLONE_HIDRIVE_TOKEN + - Type: string + - Required: false + + #### --hidrive-auth-url + + Auth server URL. + + Leave blank to use the provider defaults. + + Properties: + + - Config: auth_url + - Env Var: RCLONE_HIDRIVE_AUTH_URL + - Type: string + - Required: false + + #### --hidrive-token-url + + Token server url. + + Leave blank to use the provider defaults. + + Properties: + + - Config: token_url + - Env Var: RCLONE_HIDRIVE_TOKEN_URL + - Type: string + - Required: false + + #### --hidrive-scope-role + + User-level that rclone should use when requesting access from HiDrive. + + Properties: + + - Config: scope_role + - Env Var: RCLONE_HIDRIVE_SCOPE_ROLE + - Type: string + - Default: "user" + - Examples: + - "user" + - User-level access to management permissions. + - This will be sufficient in most cases. + - "admin" + - Extensive access to management permissions. + - "owner" + - Full access to management permissions. + + #### --hidrive-root-prefix + + The root/parent folder for all paths. + + Fill in to use the specified folder as the parent for all paths given to the remote. + This way rclone can use any folder as its starting point. + + Properties: + + - Config: root_prefix + - Env Var: RCLONE_HIDRIVE_ROOT_PREFIX + - Type: string + - Default: "/" + - Examples: + - "/" + - The topmost directory accessible by rclone. + - This will be equivalent with "root" if rclone uses a regular HiDrive user account. + - "root" + - The topmost directory of the HiDrive user account + - "" + - This specifies that there is no root-prefix for your paths. + - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". + + #### --hidrive-endpoint + + Endpoint for the service. + + This is the URL that API-calls will be made to. + + Properties: + + - Config: endpoint + - Env Var: RCLONE_HIDRIVE_ENDPOINT + - Type: string + - Default: "https://api.hidrive.strato.com/2.1" + + #### --hidrive-disable-fetching-member-count + + Do not fetch number of objects in directories unless it is absolutely necessary. + + Requests may be faster if the number of objects in subdirectories is not fetched. + + Properties: + + - Config: disable_fetching_member_count + - Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT + - Type: bool + - Default: false + + #### --hidrive-chunk-size + + Chunksize for chunked uploads. + + Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. + + The upper limit for this is 2147483647 bytes (about 2.000Gi). + That is the maximum amount of bytes a single upload-operation will support. + Setting this above the upper limit or to a negative value will cause uploads to fail. + + Setting this to larger values may increase the upload speed at the cost of using more memory. + It can be set to smaller values smaller to save on memory. + + Properties: + + - Config: chunk_size + - Env Var: RCLONE_HIDRIVE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 48Mi + + #### --hidrive-upload-cutoff + + Cutoff/Threshold for chunked uploads. + + Any files larger than this will be uploaded in chunks of the configured chunksize. + + The upper limit for this is 2147483647 bytes (about 2.000Gi). + That is the maximum amount of bytes a single upload-operation will support. + Setting this above the upper limit will cause uploads to fail. + + Properties: + + - Config: upload_cutoff + - Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 96Mi + + #### --hidrive-upload-concurrency + + Concurrency for chunked uploads. + + This is the upper limit for how many transfers for the same file are running concurrently. + Setting this above to a value smaller than 1 will cause uploads to deadlock. + + If you are uploading small numbers of large files over high-speed links + and these uploads do not fully utilize your bandwidth, then increasing + this may help to speed up the transfers. + + Properties: + + - Config: upload_concurrency + - Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY + - Type: int + - Default: 4 + + #### --hidrive-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_HIDRIVE_ENCODING + - Type: Encoding + - Default: Slash,Dot + + + + ## Limitations + + ### Symbolic links + + HiDrive is able to store symbolic links (*symlinks*) by design, + for example, when unpacked from a zip archive. + + There exists no direct mechanism to manage native symlinks in remotes. + As such this implementation has chosen to ignore any native symlinks present in the remote. + rclone will not be able to access or show any symlinks stored in the hidrive-remote. + This means symlinks cannot be individually removed, copied, or moved, + except when removing, copying, or moving the parent folder. + + *This does not affect the `.rclonelink`-files + that rclone uses to encode and store symbolic links.* + + ### Sparse files + + It is possible to store sparse files in HiDrive. + + Note that copying a sparse file will expand the holes + into null-byte (0x00) regions that will then consume disk space. + Likewise, when downloading a sparse file, + the resulting file will have null-byte regions in the place of file holes. + + # HTTP + + The HTTP remote is a read only remote for reading files of a + webserver. The webserver should provide file listings which rclone + will read and turn into a remote. This has been tested with common + webservers such as Apache/Nginx/Caddy and will likely work with file + listings from most web servers. (If it doesn't then please file an + issue, or send a pull request!) + + Paths are specified as `remote:` or `remote:path`. + + The `remote:` represents the configured [url](#http-url), and any path following + it will be resolved relative to this url, according to the URL standard. This + means with remote url `https://beta.rclone.org/branch` and path `fix`, the + resolved URL will be `https://beta.rclone.org/branch/fix`, while with path + `/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute + path is resolved from the root of the domain. + + If the path following the `remote:` ends with `/` it will be assumed to point + to a directory. If the path does not end with `/`, then a HEAD request is sent + and the response used to decide if it it is treated as a file or a directory + (run with `-vv` to see details). When [--http-no-head](#http-no-head) is + specified, a path without ending `/` is always assumed to be a file. If rclone + incorrectly assumes the path is a file, the solution is to specify the path with + ending `/`. When you know the path is a directory, ending it with `/` is always + better as it avoids the initial HEAD request. + + To just download a single file it is easier to use + [copyurl](https://rclone.org/commands/rclone_copyurl/). + + ## Configuration + + Here is an example of how to make a remote called `remote`. First + run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / HTTP  "http" [snip] Storage> http URL of http host to connect to +Choose a number from below, or type in your own value 1 / Connect to +example.com  "https://example.com" url> https://beta.rclone.org Remote +config -------------------- [remote] url = https://beta.rclone.org +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y Current remotes: + +Name Type ==== ==== remote http + +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> q + + + This remote is called `remote` and can now be used like this + + See all the top level directories + + rclone lsd remote: + + List the contents of a directory + + rclone ls remote:directory + + Sync the remote `directory` to `/home/local/directory`, deleting any excess files. + + rclone sync --interactive remote:directory /home/local/directory + + ### Read only + + This remote is read only - you can't upload files to an HTTP server. + + ### Modification times + + Most HTTP servers store time accurate to 1 second. + + ### Checksum + + No checksums are stored. + + ### Usage without a config file + + Since the http remote only has one config parameter it is easy to use + without a config file: + + rclone lsd --http-url https://beta.rclone.org :http: + + or: + + rclone lsd :http,url='https://beta.rclone.org': + + + ### Standard options + + Here are the Standard options specific to http (HTTP). + + #### --http-url + + URL of HTTP host to connect to. + + E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. + + Properties: + + - Config: url + - Env Var: RCLONE_HTTP_URL + - Type: string + - Required: true + + ### Advanced options + + Here are the Advanced options specific to http (HTTP). + + #### --http-headers + + Set HTTP headers for all transactions. + + Use this to set additional HTTP headers for all transactions. + + The input format is comma separated list of key,value pairs. Standard + [CSV encoding](https://godoc.org/encoding/csv) may be used. + + For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. + + You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. + + Properties: + + - Config: headers + - Env Var: RCLONE_HTTP_HEADERS + - Type: CommaSepList + - Default: + + #### --http-no-slash + + Set this if the site doesn't end directories with /. + + Use this if your target website does not use / on the end of + directories. + + A / on the end of a path is how rclone normally tells the difference + between files and directories. If this flag is set, then rclone will + treat all files with Content-Type: text/html as directories and read + URLs from them rather than downloading them. + + Note that this may cause rclone to confuse genuine HTML files with + directories. + + Properties: + + - Config: no_slash + - Env Var: RCLONE_HTTP_NO_SLASH + - Type: bool + - Default: false + + #### --http-no-head + + Don't use HEAD requests. + + HEAD requests are mainly used to find file sizes in dir listing. + If your site is being very slow to load then you can try this option. + Normally rclone does a HEAD request for each potential file in a + directory listing to: + + - find its size + - check it really exists + - check to see if it is a directory + + If you set this option, rclone will not do the HEAD request. This will mean + that directory listings are much quicker, but rclone won't have the times or + sizes of any files, and some files that don't exist may be in the listing. + + Properties: + + - Config: no_head + - Env Var: RCLONE_HTTP_NO_HEAD + - Type: bool + - Default: false + + ## Backend commands + + Here are the commands specific to the http backend. + + Run them with + + rclone backend COMMAND remote: + + The help below will explain what arguments each command takes. + + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. + + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). + + ### set + + Set command for updating the config parameters. + + rclone backend set remote: [options] [+] + + This set command can be used to update the config parameters + for a running http backend. + + Usage Examples: + + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com + + The option keys are named as they are in the config file. + + This rebuilds the connection to the http backend when it is called with + the new parameters. Only new parameters need be passed as the values + will default to those currently in use. + + It doesn't return anything. + + + + + ## Limitations + + `rclone about` is not supported by the HTTP backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. + + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + + # ImageKit + This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. + + #### About ImageKit + [ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. + + + #### Accounts & Pricing + + To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). + + ## Configuration + + Here is an example of making an imagekit configuration. + + Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. + + You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. + + Now run + +rclone config + + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n + +Enter the name for the new remote. name> imagekit-media-library + +Option Storage. Type of storage to configure. Choose a number from +below, or type in your own value. [snip] XX / ImageKit.io  (imagekit) +[snip] Storage> imagekit + +Option endpoint. You can find your ImageKit.io URL endpoint in your +dashboard Enter a value. endpoint> https://ik.imagekit.io/imagekit_id + +Option public_key. You can find your ImageKit.io public key in your +dashboard Enter a value. public_key> public_**************************** + +Option private_key. You can find your ImageKit.io private key in your +dashboard Enter a value. private_key> +private_**************************** + +Edit advanced config? y) Yes n) No (default) y/n> n + +Configuration complete. Options: - type: imagekit - endpoint: +https://ik.imagekit.io/imagekit_id - public_key: +public_**************************** - private_key: +private_**************************** + +Keep this "imagekit-media-library" remote? y) Yes this is OK (default) +e) Edit this remote d) Delete this remote y/e/d> y + + List directories in the top level of your Media Library + +rclone lsd imagekit-media-library: + + Make a new directory. + +rclone mkdir imagekit-media-library:directory + + List the contents of a directory. + +rclone ls imagekit-media-library:directory + + + ### Modified time and hashes + + ImageKit does not support modification times or hashes yet. + + ### Checksums + + No checksums are supported. + + + ### Standard options + + Here are the Standard options specific to imagekit (ImageKit.io). + + #### --imagekit-endpoint + + You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + + Properties: + + - Config: endpoint + - Env Var: RCLONE_IMAGEKIT_ENDPOINT + - Type: string + - Required: true + + #### --imagekit-public-key + + You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + + Properties: + + - Config: public_key + - Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY + - Type: string + - Required: true + + #### --imagekit-private-key + + You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + + Properties: + + - Config: private_key + - Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY + - Type: string + - Required: true + + ### Advanced options + + Here are the Advanced options specific to imagekit (ImageKit.io). + + #### --imagekit-only-signed + + If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true. + + Properties: + + - Config: only_signed + - Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED + - Type: bool + - Default: false + + #### --imagekit-versions + + Include old versions in directory listings. + + Properties: + + - Config: versions + - Env Var: RCLONE_IMAGEKIT_VERSIONS + - Type: bool + - Default: false + + #### --imagekit-upload-tags + + Tags to add to the uploaded files, e.g. "tag1,tag2". + + Properties: + + - Config: upload_tags + - Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS + - Type: string + - Required: false + + #### --imagekit-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_IMAGEKIT_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket + + ### Metadata + + Any metadata supported by the underlying remote is read and written. + + Here are the possible system metadata items for the imagekit backend. + + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | + | btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + | custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | + | file-type | Type of the file | string | image | **Y** | + | google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | + | has-alpha | Whether the image has alpha channel or not | bool | | **Y** | + | height | Height of the image or video in pixels | int | | **Y** | + | is-private-file | Whether the file is private or not | bool | | **Y** | + | size | Size of the object in bytes | int64 | | **Y** | + | tags | Tags associated with the file | string | tag1,tag2 | **Y** | + | width | Width of the image or video in pixels | int | | **Y** | + + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + + # Internet Archive + + The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) + + Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. + + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. + + Unlike S3, listing up all items uploaded by you isn't supported. + + Once you have made a remote, you can use it like this: + + Make a new item + + rclone mkdir remote:item + + List the contents of a item + + rclone ls remote:item + + Sync `/home/local/directory` to the remote item, deleting any excess + files in the item. + + rclone sync --interactive /home/local/directory remote:item + + ## Notes + Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. + The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. + + You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. + By making it wait, rclone can do normal file comparison. + Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. + + ## About metadata + This backend supports setting, updating and reading metadata of each file. + The metadata will appear as file metadata on Internet Archive. + However, some fields are reserved by both Internet Archive and rclone. + + The following are reserved by Internet Archive: + - `name` + - `source` + - `size` + - `md5` + - `crc32` + - `sha1` + - `format` + - `old_version` + - `viruscheck` + - `summation` + + Trying to set values to these keys is ignored with a warning. + Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. + + rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. + + If there are multiple values for a key, only the first one is returned. + This is a limitation of rclone, that supports one value per one key. + It can be triggered when you did a server-side copy. + + Reading metadata will also provide custom (non-standard nor reserved) ones. + + ## Filtering auto generated files + + The Internet Archive automatically creates metadata files after + upload. These can cause problems when doing an `rclone sync` as rclone + will try, and fail, to delete them. These metadata files are not + changeable, as they are created by the Internet Archive automatically. + + These auto-created files can be excluded from the sync using [metadata + filtering](https://rclone.org/filtering/#metadata). + + rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" + + Which excludes from the sync any files which have the + `source=metadata` or `format=Metadata` flags which are added to + Internet Archive auto-created files. + + ## Configuration + + Here is an example of making an internetarchive configuration. + Most applies to the other providers as well, any differences are described [below](#providers). + + First run + + rclone config + + This will guide you through an interactive setup process. + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. XX / InternetArchive Items  (internetarchive) Storage> +internetarchive Option access_key_id. IAS3 Access Key. Leave blank for +anonymous access. You can find one here: +https://archive.org/account/s3.php Enter a value. Press Enter to leave +empty. access_key_id> XXXX Option secret_access_key. IAS3 Secret Key +(password). Leave blank for anonymous access. Enter a value. Press Enter +to leave empty. secret_access_key> XXXX Edit advanced config? y) Yes n) +No (default) y/n> y Option endpoint. IAS3 Endpoint. Leave blank for +default value. Enter a string value. Press Enter for the default +(https://s3.us.archive.org). endpoint> Option front_endpoint. Host of +InternetArchive Frontend. Leave blank for default value. Enter a string +value. Press Enter for the default (https://archive.org). +front_endpoint> Option disable_checksum. Don't store MD5 checksum with +object metadata. Normally rclone will calculate the MD5 checksum of the +input before uploading it so it can ask the server to check the object +against checksum. This is great for data integrity checking but can +cause long delays for large files to start uploading. Enter a boolean +value (true or false). Press Enter for the default (true). +disable_checksum> true Option encoding. The encoding for the backend. +See the encoding section in the overview for more info. Enter a +encoder.MultiEncoder value. Press Enter for the default +(Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). encoding> Edit +advanced config? y) Yes n) No (default) y/n> n -------------------- +[remote] type = internetarchive access_key_id = XXXX secret_access_key = +XXXX -------------------- y) Yes this is OK (default) e) Edit this +remote d) Delete this remote y/e/d> y + + + + ### Standard options + + Here are the Standard options specific to internetarchive (Internet Archive). + + #### --internetarchive-access-key-id + + IAS3 Access Key. + + Leave blank for anonymous access. + You can find one here: https://archive.org/account/s3.php + + Properties: + + - Config: access_key_id + - Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID + - Type: string + - Required: false + + #### --internetarchive-secret-access-key + + IAS3 Secret Key (password). + + Leave blank for anonymous access. + + Properties: + + - Config: secret_access_key + - Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY + - Type: string + - Required: false + + ### Advanced options + + Here are the Advanced options specific to internetarchive (Internet Archive). + + #### --internetarchive-endpoint + + IAS3 Endpoint. + + Leave blank for default value. + + Properties: + + - Config: endpoint + - Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT + - Type: string + - Default: "https://s3.us.archive.org" + + #### --internetarchive-front-endpoint + + Host of InternetArchive Frontend. + + Leave blank for default value. + + Properties: + + - Config: front_endpoint + - Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT + - Type: string + - Default: "https://archive.org" + + #### --internetarchive-disable-checksum + + Don't ask the server to test against MD5 checksum calculated by rclone. + Normally rclone will calculate the MD5 checksum of the input before + uploading it so it can ask the server to check the object against checksum. + This is great for data integrity checking but can cause long delays for + large files to start uploading. + + Properties: + + - Config: disable_checksum + - Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM + - Type: bool + - Default: true + + #### --internetarchive-wait-archive + + Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. + Only enable if you need to be guaranteed to be reflected after write operations. + 0 to disable waiting. No errors to be thrown in case of timeout. + + Properties: + + - Config: wait_archive + - Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE + - Type: Duration + - Default: 0s + + #### --internetarchive-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_INTERNETARCHIVE_ENCODING + - Type: Encoding + - Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot + + ### Metadata + + Metadata fields provided by Internet Archive. + If there are multiple values for a key, only the first one is returned. + This is a limitation of Rclone, that supports one value per one key. + + Owner is able to add custom keys. Metadata feature grabs all the keys including them. + + Here are the possible system metadata items for the internetarchive backend. + + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | + | format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | + | md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | + | mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | + | name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | + | old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | + | rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | + | rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | + | rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | + | sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | + | size | File size in bytes | decimal number | 123456 | **Y** | + | source | The source of the file | string | original | **Y** | + | summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | + | viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | + + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + + # Jottacloud + + Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters + in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), + it also provides white-label solutions to different companies, such as: + * Telia + * Telia Cloud (cloud.telia.se) + * Telia Sky (sky.telia.no) + * Tele2 + * Tele2 Cloud (mittcloud.tele2.se) + * Onlime + * Onlime Cloud Storage (onlime.dk) + * Elkjøp (with subsidiaries): + * Elkjøp Cloud (cloud.elkjop.no) + * Elgiganten Sweden (cloud.elgiganten.se) + * Elgiganten Denmark (cloud.elgiganten.dk) + * Giganti Cloud (cloud.gigantti.fi) + * ELKO Cloud (cloud.elko.is) + + Most of the white-label versions are supported by this backend, although may require different + authentication setup - described below. + + Paths are specified as `remote:path` + + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + + ## Authentication types + + Some of the whitelabel versions uses a different authentication method than the official service, + and you have to choose the correct one when setting up the remote. + + ### Standard authentication + + The standard authentication method used by the official service (jottacloud.com), as well as + some of the whitelabel services, requires you to generate a single-use personal login token + from the account security settings in the service's web interface. Log in to your account, + go to "Settings" and then "Security", or use the direct link presented to you by rclone when + configuring the remote: . Scroll down to the section + "Personal login token", and click the "Generate" button. Note that if you are using a + whitelabel service you probably can't use the direct link, you need to find the same page in + their dedicated web interface, and also it may be in a different location than described above. + + To access your account from multiple instances of rclone, you need to configure each of them + with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one + location, and copy the configuration file to a second location where you also want to run + rclone and access the same remote. Then you need to replace the token for one of them, using + the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which + requires you to generate a new personal login token and supply as input. If you do not + do this, the token may easily end up being invalidated, resulting in both instances failing + with an error message something along the lines of: + + oauth2: cannot fetch token: 400 Bad Request + Response: {"error":"invalid_grant","error_description":"Stale token"} + + When this happens, you need to replace the token as described above to be able to use your + remote again. + + All personal login tokens you have taken into use will be listed in the web interface under + "My logged in devices", and from the right side of that list you can click the "X" button to + revoke individual tokens. + + ### Legacy authentication + + If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option + to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select + yes when the setup asks for legacy authentication and enter your username and password. + The rest of the setup is identical to the default setup. + + ### Telia Cloud authentication + + Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and + additionally uses a separate authentication flow where the username is generated internally. To setup + rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is + identical to the default setup. + + ### Tele2 Cloud authentication + + As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and + Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate + authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, + choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. + + ### Onlime Cloud Storage authentication + + Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but + have recently set up their own hosting, transferring their customers from Jottacloud servers to their + own ones. + + This, of course, necessitates using their servers for authentication, but otherwise functionality and + architecture seems equivalent to Jottacloud. + + To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest + of the setup is identical to the default setup. + + ## Configuration + + Here is an example of how to make a remote called `remote` with the default setup. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] XX / Jottacloud  (jottacloud) [snip] Storage> jottacloud +Edit advanced config? y) Yes n) No (default) y/n> n Option config_type. +Select authentication type. Choose a number from below, or type in an +existing string value. Press Enter for the default (standard). / +Standard authentication. 1 | Use this if you're a normal Jottacloud +user.  (standard) / Legacy authentication. 2 | This is only required for +certain whitelabel versions of Jottacloud and not recommended for normal +users.  (legacy) / Telia Cloud authentication. 3 | Use this if you are +using Telia Cloud.  (telia) / Tele2 Cloud authentication. 4 | Use this +if you are using Tele2 Cloud.  (tele2) / Onlime Cloud authentication. 5 +| Use this if you are using Onlime Cloud.  (onlime) config_type> 1 +Personal login token. Generate here: +https://www.jottacloud.com/web/secure Login Token> Use a non-standard +device/mountpoint? Choosing no, the default, will let you access the +storage used for the archive section of the official Jottacloud client. +If you instead want to access the sync or the backup section, for +example, you must choose yes. y) Yes n) No (default) y/n> y Option +config_device. The device to use. In standard setup the built-in Jotta +device is used, which contains predefined mountpoints for archive, sync +etc. All other devices are treated as backup devices by the official +Jottacloud client. You may create a new by entering a unique name. +Choose a number from below, or type in your own string value. Press +Enter for the default (DESKTOP-3H31129). 1 > DESKTOP-3H31129 2 > Jotta +config_device> 2 Option config_mountpoint. The mountpoint to use for the +built-in device Jotta. The standard setup is to use the Archive +mountpoint. Most other mountpoints have very limited support in rclone +and should generally be avoided. Choose a number from below, or type in +an existing string value. Press Enter for the default (Archive). 1 > +Archive 2 > Shared 3 > Sync config_mountpoint> 1 -------------------- +[remote] type = jottacloud configVersion = 1 client_id = jottacli +client_secret = tokenURL = +https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token +token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta +mountpoint = Archive -------------------- y) Yes this is OK (default) e) +Edit this remote d) Delete this remote y/e/d> y + + + Once configured you can then use `rclone` like this, + + List directories in top level of your Jottacloud + + rclone lsd remote: + + List all the files in your Jottacloud + + rclone ls remote: + + To copy a local directory to an Jottacloud directory called backup + + rclone copy /home/source remote:backup + + ### Devices and Mountpoints + + The official Jottacloud client registers a device for each computer you install + it on, and shows them in the backup section of the user interface. For each + folder you select for backup it will create a mountpoint within this device. + A built-in device called Jotta is special, and contains mountpoints Archive, + Sync and some others, used for corresponding features in official clients. + + With rclone you'll want to use the standard Jotta/Archive device/mountpoint in + most cases. However, you may for example want to access files from the sync or + backup functionality provided by the official clients, and rclone therefore + provides the option to select other devices and mountpoints during config. + + You are allowed to create new devices and mountpoints. All devices except the + built-in Jotta device are treated as backup devices by official Jottacloud + clients, and the mountpoints on them are individual backup sets. + + With the built-in Jotta device, only existing, built-in, mountpoints can be + selected. In addition to the mentioned Archive and Sync, it may contain + several other mountpoints such as: Latest, Links, Shared and Trash. All of + these are special mountpoints with a different internal representation than + the "regular" mountpoints. Rclone will only to a very limited degree support + them. Generally you should avoid these, unless you know what you are doing. + + ### --fast-list + + This backend supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. + + Note that the implementation in Jottacloud always uses only a single + API request to get the entire list, so for large folders this could + lead to long wait time before the first results are shown. + + Note also that with rclone version 1.58 and newer, information about + [MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata) + are not available when using `--fast-list`. + + ### Modification times and hashes + + Jottacloud allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. + + Jottacloud supports MD5 type hashes, so you can use the `--checksum` + flag. + + Note that Jottacloud requires the MD5 hash before upload so if the + source does not have an MD5 checksum then the file will be cached + temporarily on disk (in location given by + [--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. + Small files will be cached in memory - see the + [--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. + When uploading from local disk the source checksum is always available, + so this does not apply. Starting with rclone version 1.52 the same is + true for encrypted remotes (in older versions the crypt backend would not + calculate hashes for uploads from local disk, so the Jottacloud + backend had to do it as described above). + + ### Restricted filename characters + + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \| | 0x7C | | | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in XML strings. + + ### Deleting files + + By default, rclone will send all files to the trash when deleting files. They will be permanently + deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately + by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. + Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. + + ### Versions + + Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. + Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. + + Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading + a new version. If the upload the fails no version of the file will be available in the remote. + + ### Quota information + + To view your current quota you can use the `rclone about remote:` + command which will display your usage limit (unless it is unlimited) + and the current usage. + + + ### Standard options + + Here are the Standard options specific to jottacloud (Jottacloud). + + #### --jottacloud-client-id + + OAuth Client Id. + + Leave blank normally. + + Properties: + + - Config: client_id + - Env Var: RCLONE_JOTTACLOUD_CLIENT_ID + - Type: string + - Required: false + + #### --jottacloud-client-secret + + OAuth Client Secret. + + Leave blank normally. + + Properties: + + - Config: client_secret + - Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET + - Type: string + - Required: false + + ### Advanced options + + Here are the Advanced options specific to jottacloud (Jottacloud). + + #### --jottacloud-token + + OAuth Access Token as a JSON blob. + + Properties: + + - Config: token + - Env Var: RCLONE_JOTTACLOUD_TOKEN + - Type: string + - Required: false + + #### --jottacloud-auth-url + + Auth server URL. + + Leave blank to use the provider defaults. + + Properties: + + - Config: auth_url + - Env Var: RCLONE_JOTTACLOUD_AUTH_URL + - Type: string + - Required: false + + #### --jottacloud-token-url + + Token server url. + + Leave blank to use the provider defaults. + + Properties: + + - Config: token_url + - Env Var: RCLONE_JOTTACLOUD_TOKEN_URL + - Type: string + - Required: false + + #### --jottacloud-md5-memory-limit + + Files bigger than this will be cached on disk to calculate the MD5 if required. + + Properties: + + - Config: md5_memory_limit + - Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT + - Type: SizeSuffix + - Default: 10Mi + + #### --jottacloud-trashed-only + + Only show files that are in the trash. + + This will show trashed files in their original directory structure. + + Properties: + + - Config: trashed_only + - Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY + - Type: bool + - Default: false + + #### --jottacloud-hard-delete + + Delete files permanently rather than putting them into the trash. + + Properties: + + - Config: hard_delete + - Env Var: RCLONE_JOTTACLOUD_HARD_DELETE + - Type: bool + - Default: false + + #### --jottacloud-upload-resume-limit + + Files bigger than this can be resumed if the upload fail's. + + Properties: + + - Config: upload_resume_limit + - Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT + - Type: SizeSuffix + - Default: 10Mi + + #### --jottacloud-no-versions + + Avoid server side versioning by deleting files and recreating files instead of overwriting them. + + Properties: + + - Config: no_versions + - Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS + - Type: bool + - Default: false + + #### --jottacloud-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_JOTTACLOUD_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot + + ### Metadata + + Jottacloud has limited support for metadata, currently an extended set of timestamps. + + Here are the possible system metadata items for the jottacloud backend. + + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | + | content-type | MIME type, also known as media type | string | text/plain | **Y** | + | mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | + | utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + + ## Limitations + + Note that Jottacloud is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". + + There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical + looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. + + Jottacloud only supports filenames up to 255 characters in length. + + ## Troubleshooting + + Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove + operations to previously deleted paths to fail. Emptying the trash should help in such cases. + + # Koofr + + Paths are specified as `remote:path` + + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + + ## Configuration + + The initial setup for Koofr involves creating an application password for + rclone. You can do that by opening the Koofr + [web application](https://app.koofr.net/app/admin/preferences/password), + giving the password a nice name like `rclone` and clicking on generate. + + Here is an example of how to make a remote called `koofr`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> koofr Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible +storage providers  (koofr) [snip] Storage> koofr Option provider. Choose +your storage provider. Choose a number from below, or type in your own +value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ + (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 +/ Any other Koofr API compatible storage service  (other) provider> 1 +Option user. Your user name. Enter a value. user> USERNAME Option +password. Your password for rclone (generate one at +https://app.koofr.net/app/admin/preferences/password). Choose an +alternative below. y) Yes, type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Edit advanced config? y) Yes n) No (default) y/n> n Remote +config -------------------- [koofr] type = koofr provider = koofr user = +USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this +is OK (default) e) Edit this remote d) Delete this remote y/e/d> y + + + You can choose to edit advanced config in order to enter your own service URL + if you use an on-premise or white label Koofr instance, or choose an alternative + mount instead of your primary storage. + + Once configured you can then use `rclone` like this, + + List directories in top level of your Koofr + + rclone lsd koofr: + + List all the files in your Koofr + + rclone ls koofr: + + To copy a local directory to an Koofr directory called backup + + rclone copy /home/source koofr:backup + + ### Restricted filename characters + + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in XML strings. + + + ### Standard options + + Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). + + #### --koofr-provider + + Choose your storage provider. + + Properties: + + - Config: provider + - Env Var: RCLONE_KOOFR_PROVIDER + - Type: string + - Required: false + - Examples: + - "koofr" + - Koofr, https://app.koofr.net/ + - "digistorage" + - Digi Storage, https://storage.rcs-rds.ro/ + - "other" + - Any other Koofr API compatible storage service + + #### --koofr-endpoint + + The Koofr API endpoint to use. + + Properties: + + - Config: endpoint + - Env Var: RCLONE_KOOFR_ENDPOINT + - Provider: other + - Type: string + - Required: true + + #### --koofr-user + + Your user name. + + Properties: + + - Config: user + - Env Var: RCLONE_KOOFR_USER + - Type: string + - Required: true + + #### --koofr-password + + Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: password + - Env Var: RCLONE_KOOFR_PASSWORD + - Provider: koofr + - Type: string + - Required: true + + ### Advanced options + + Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). + + #### --koofr-mountid + + Mount ID of the mount to use. + + If omitted, the primary mount is used. + + Properties: + + - Config: mountid + - Env Var: RCLONE_KOOFR_MOUNTID + - Type: string + - Required: false + + #### --koofr-setmtime + + Does the backend support setting modification time. + + Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. + + Properties: + + - Config: setmtime + - Env Var: RCLONE_KOOFR_SETMTIME + - Type: bool + - Default: true + + #### --koofr-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_KOOFR_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + + + + ## Limitations + + Note that Koofr is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". + + ## Providers + + ### Koofr + + This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. + + ### Digi Storage + + [Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that + provides a Koofr API. + + Here is an example of how to make a remote called `ds`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> ds Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible +storage providers  (koofr) [snip] Storage> koofr Option provider. Choose +your storage provider. Choose a number from below, or type in your own +value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ + (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 +/ Any other Koofr API compatible storage service  (other) provider> 2 +Option user. Your user name. Enter a value. user> USERNAME Option +password. Your password for rclone (generate one at +https://storage.rcs-rds.ro/app/admin/preferences/password). Choose an +alternative below. y) Yes, type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Edit advanced config? y) Yes n) No (default) y/n> n +-------------------- [ds] type = koofr provider = digistorage user = +USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this +is OK (default) e) Edit this remote d) Delete this remote y/e/d> y + + + ### Other + + You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. + + Here is an example of how to make a remote called `other`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> other Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible +storage providers  (koofr) [snip] Storage> koofr Option provider. Choose +your storage provider. Choose a number from below, or type in your own +value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ + (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 +/ Any other Koofr API compatible storage service  (other) provider> 3 +Option endpoint. The Koofr API endpoint to use. Enter a value. endpoint> +https://koofr.other.org Option user. Your user name. Enter a value. +user> USERNAME Option password. Your password for rclone (generate one +at your service's settings page). Choose an alternative below. y) Yes, +type in my own password g) Generate random password y/g> y Enter the +password: password: Confirm the password: password: Edit advanced +config? y) Yes n) No (default) y/n> n -------------------- [other] type += koofr provider = other endpoint = https://koofr.other.org user = +USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this +is OK (default) e) Edit this remote d) Delete this remote y/e/d> y + + + # Linkbox + + Linkbox is [a private cloud drive](https://linkbox.to/). + + ## Configuration + + Here is an example of making a remote for Linkbox. + + First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n + +Enter name for new remote. name> remote + +Option Storage. Type of storage to configure. Choose a number from +below, or type in your own value. XX / Linkbox  (linkbox) Storage> XX + +Option token. Token from https://www.linkbox.to/admin/account Enter a +value. token> testFromCLToken + +Configuration complete. Options: - type: linkbox - token: XXXXXXXXXXX +Keep this "linkbox" remote? y) Yes this is OK (default) e) Edit this +remote d) Delete this remote y/e/d> y + + + + ### Standard options + + Here are the Standard options specific to linkbox (Linkbox). + + #### --linkbox-token + + Token from https://www.linkbox.to/admin/account + + Properties: + + - Config: token + - Env Var: RCLONE_LINKBOX_TOKEN + - Type: string + - Required: true + + + + ## Limitations + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + + # Mail.ru Cloud + + [Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. + + ## Features highlights + + - Paths may be as deep as required, e.g. `remote:directory/subdirectory` + - Files have a `last modified time` property, directories don't + - Deleted files are by default moved to the trash + - Files and directories can be shared via public links + - Partial uploads or streaming are not supported, file size must be known before upload + - Maximum file size is limited to 2G for a free account, unlimited for paid accounts + - Storage keeps hash for all files and performs transparent deduplication, + the hash algorithm is a modified SHA1 + - If a particular file is already present in storage, one can quickly submit file hash + instead of long file upload (this optimization is supported by rclone) + + ## Configuration + + Here is an example of making a mailru configuration. + + First create a Mail.ru Cloud account and choose a tariff. + + You will need to log in and create an app password for rclone. Rclone + **will not work** with your normal username and password - it will + give an error like `oauth2: server response missing access_token`. + + - Click on your user icon in the top right + - Go to Security / "Пароль и безопасность" + - Click password for apps / "Пароли для внешних приложений" + - Add the password - give it a name - eg "rclone" + - Copy the password and use this password below - your normal login password won't work. + + Now run + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Type of storage to configure. Enter a string value. Press +Enter for the default (""). Choose a number from below, or type in your +own value [snip] XX / Mail.ru Cloud  "mailru" [snip] Storage> mailru +User name (usually email) Enter a string value. Press Enter for the +default (""). user> username@mail.ru Password + +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. y) Yes type in my own password g) Generate random password +y/g> y Enter the password: password: Confirm the password: password: +Skip full upload if there is another file with same data hash. This +feature is called "speedup" or "put by hash". It is especially efficient +in case of generally available files like popular books, video or audio +clips [snip] Enter a boolean value (true or false). Press Enter for the +default ("true"). Choose a number from below, or type in your own value +1 / Enable  "true" 2 / Disable  "false" speedup_enable> 1 Edit advanced +config? (y/n) y) Yes n) No y/n> n Remote config -------------------- +[remote] type = mailru user = username@mail.ru pass = *** ENCRYPTED *** +speedup_enable = true -------------------- y) Yes this is OK e) Edit +this remote d) Delete this remote y/e/d> y + + + Configuration of this backend does not require a local web browser. + You can use the configured backend as shown below: + + See top level directories + + rclone lsd remote: + + Make a new directory + + rclone mkdir remote:directory + + List the contents of a directory + + rclone ls remote:directory + + Sync `/home/local/directory` to the remote path, deleting any + excess files in the path. + + rclone sync --interactive /home/local/directory remote:directory + + ### Modification times and hashes + + Files support a modification time attribute with up to 1 second precision. + Directories do not have a modification time, which is shown as "Jan 1 1970". + + File hashes are supported, with a custom Mail.ru algorithm based on SHA1. + If file size is less than or equal to the SHA1 block size (20 bytes), + its hash is simply its data right-padded with zero bytes. + Hashes of a larger file is computed as a SHA1 of the file data + bytes concatenated with a decimal representation of the data length. + + ### Emptying Trash + + Removing a file or directory actually moves it to the trash, which is not + visible to rclone but can be seen in a web browser. The trashed file + still occupies part of total quota. If you wish to empty your trash + and free some quota, you can use the `rclone cleanup remote:` command, + which will permanently delete all your trashed files. + This command does not take any path arguments. + + ### Quota information + + To view your current quota you can use the `rclone about remote:` + command which will display your usage limit (quota) and the current usage. + + ### Restricted filename characters + + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \ | 0x5C | \ | + | \| | 0x7C | | | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + + + ### Standard options + + Here are the Standard options specific to mailru (Mail.ru Cloud). + + #### --mailru-client-id + + OAuth Client Id. + + Leave blank normally. + + Properties: + + - Config: client_id + - Env Var: RCLONE_MAILRU_CLIENT_ID + - Type: string + - Required: false + + #### --mailru-client-secret + + OAuth Client Secret. + + Leave blank normally. + + Properties: + + - Config: client_secret + - Env Var: RCLONE_MAILRU_CLIENT_SECRET + - Type: string + - Required: false + + #### --mailru-user + + User name (usually email). + + Properties: + + - Config: user + - Env Var: RCLONE_MAILRU_USER + - Type: string + - Required: true + + #### --mailru-pass + + Password. + + This must be an app password - rclone will not work with your normal + password. See the Configuration section in the docs for how to make an + app password. + + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: pass + - Env Var: RCLONE_MAILRU_PASS + - Type: string + - Required: true + + #### --mailru-speedup-enable + + Skip full upload if there is another file with same data hash. + + This feature is called "speedup" or "put by hash". It is especially efficient + in case of generally available files like popular books, video or audio clips, + because files are searched by hash in all accounts of all mailru users. + It is meaningless and ineffective if source file is unique or encrypted. + Please note that rclone may need local memory and disk space to calculate + content hash in advance and decide whether full upload is required. + Also, if rclone does not know file size in advance (e.g. in case of + streaming or partial uploads), it will not even try this optimization. + + Properties: + + - Config: speedup_enable + - Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE + - Type: bool + - Default: true + - Examples: + - "true" + - Enable + - "false" + - Disable + + ### Advanced options + + Here are the Advanced options specific to mailru (Mail.ru Cloud). + + #### --mailru-token + + OAuth Access Token as a JSON blob. + + Properties: + + - Config: token + - Env Var: RCLONE_MAILRU_TOKEN + - Type: string + - Required: false + + #### --mailru-auth-url + + Auth server URL. + + Leave blank to use the provider defaults. + + Properties: + + - Config: auth_url + - Env Var: RCLONE_MAILRU_AUTH_URL + - Type: string + - Required: false + + #### --mailru-token-url + + Token server url. + + Leave blank to use the provider defaults. + + Properties: + + - Config: token_url + - Env Var: RCLONE_MAILRU_TOKEN_URL + - Type: string + - Required: false + + #### --mailru-speedup-file-patterns + + Comma separated list of file name patterns eligible for speedup (put by hash). + + Patterns are case insensitive and can contain '*' or '?' meta characters. + + Properties: + + - Config: speedup_file_patterns + - Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS + - Type: string + - Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" + - Examples: + - "" + - Empty list completely disables speedup (put by hash). + - "*" + - All files will be attempted for speedup. + - "*.mkv,*.avi,*.mp4,*.mp3" + - Only common audio/video files will be tried for put by hash. + - "*.zip,*.gz,*.rar,*.pdf" + - Only common archives or PDF books will be tried for speedup. + + #### --mailru-speedup-max-disk + + This option allows you to disable speedup (put by hash) for large files. + + Reason is that preliminary hashing can exhaust your RAM or disk space. + + Properties: + + - Config: speedup_max_disk + - Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK + - Type: SizeSuffix + - Default: 3Gi + - Examples: + - "0" + - Completely disable speedup (put by hash). + - "1G" + - Files larger than 1Gb will be uploaded directly. + - "3G" + - Choose this option if you have less than 3Gb free on local disk. + + #### --mailru-speedup-max-memory + + Files larger than the size given below will always be hashed on disk. + + Properties: + + - Config: speedup_max_memory + - Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY + - Type: SizeSuffix + - Default: 32Mi + - Examples: + - "0" + - Preliminary hashing will always be done in a temporary disk location. + - "32M" + - Do not dedicate more than 32Mb RAM for preliminary hashing. + - "256M" + - You have at most 256Mb RAM free for hash calculations. + + #### --mailru-check-hash + + What should copy do if file checksum is mismatched or invalid. + + Properties: + + - Config: check_hash + - Env Var: RCLONE_MAILRU_CHECK_HASH + - Type: bool + - Default: true + - Examples: + - "true" + - Fail with error. + - "false" + - Ignore and continue. + + #### --mailru-user-agent + + HTTP user agent used internally by client. + + Defaults to "rclone/VERSION" or "--user-agent" provided on command line. + + Properties: + + - Config: user_agent + - Env Var: RCLONE_MAILRU_USER_AGENT + - Type: string + - Required: false + + #### --mailru-quirks + + Comma separated list of internal maintenance flags. + + This option must not be used by an ordinary user. It is intended only to + facilitate remote troubleshooting of backend issues. Strict meaning of + flags is not documented and not guaranteed to persist between releases. + Quirks will be removed when the backend grows stable. + Supported quirks: atomicmkdir binlist unknowndirs + + Properties: + + - Config: quirks + - Env Var: RCLONE_MAILRU_QUIRKS + - Type: string + - Required: false + + #### --mailru-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_MAILRU_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot + + + + ## Limitations + + File size limits depend on your account. A single file size is limited by 2G + for a free account and unlimited for paid tariffs. Please refer to the Mail.ru + site for the total uploaded size limits. + + Note that Mailru is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". + + # Mega + + [Mega](https://mega.nz/) is a cloud storage and file hosting service + known for its security feature where all files are encrypted locally + before they are uploaded. This prevents anyone (including employees of + Mega) from accessing the files without knowledge of the key used for + encryption. + + This is an rclone backend for Mega which supports the file transfer + features of Mega using the same client side encryption. + + Paths are specified as `remote:path` + + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + + ## Configuration + + Here is an example of how to make a remote called `remote`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Mega  "mega" [snip] Storage> mega User name user> you@example.com +Password. y) Yes type in my own password g) Generate random password n) +No leave this optional password blank y/g/n> y Enter the password: +password: Confirm the password: password: Remote config +-------------------- [remote] type = mega user = you@example.com pass = +*** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this +remote d) Delete this remote y/e/d> y + + + **NOTE:** The encryption keys need to have been already generated after a regular login + via the browser, otherwise attempting to use the credentials in `rclone` will fail. + + Once configured you can then use `rclone` like this, + + List directories in top level of your Mega + + rclone lsd remote: + + List all the files in your Mega + + rclone ls remote: + + To copy a local directory to an Mega directory called backup + + rclone copy /home/source remote:backup + + ### Modification times and hashes + + Mega does not support modification times or hashes yet. + + ### Restricted filename characters + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | / | 0x2F | / | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + + ### Duplicated files + + Mega can have two files with exactly the same name and path (unlike a + normal file system). + + Duplicated files cause problems with the syncing and you will see + messages in the log about duplicates. + + Use `rclone dedupe` to fix duplicated files. + + ### Failure to log-in + + #### Object not found + + If you are connecting to your Mega remote for the first time, + to test access and synchronization, you may receive an error such as + +Failed to create file system for "my-mega-remote:": couldn't login: +Object (typically, node or user) not found + + + The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) + start with the **MEGAcmd** utility. Note that this refers to + the official C++ command from https://github.com/meganz/MEGAcmd + and not the go language built command from t3rm1n4l/megacmd + that is no longer maintained. + + Follow the instructions for installing MEGAcmd and try accessing + your remote as they recommend. You can establish whether or not + you can log in using MEGAcmd, and obtain diagnostic information + to help you, and search or work with others in the forum. + +MEGA CMD> login me@example.com Password: Fetching nodes ... Loading +transfers from local cache Login complete as me@example.com +me@example.com:/$ + + + Note that some have found issues with passwords containing special + characters. If you can not log on with rclone, but MEGAcmd logs on + just fine, then consider changing your password temporarily to + pure alphanumeric characters, in case that helps. + + + #### Repeated commands blocks access + + Mega remotes seem to get blocked (reject logins) under "heavy use". + We haven't worked out the exact blocking rules but it seems to be + related to fast paced, successive rclone commands. + + For example, executing this command 90 times in a row `rclone link + remote:file` will cause the remote to become "blocked". This is not an + abnormal situation, for example if you wish to get the public links of + a directory with hundred of files... After more or less a week, the + remote will remote accept rclone logins normally again. + + You can mitigate this issue by mounting the remote it with `rclone + mount`. This will log-in when mounting and a log-out when unmounting + only. You can also run `rclone rcd` and then use `rclone rc` to run + the commands over the API to avoid logging in each time. + + Rclone does not currently close mega sessions (you can see them in the + web interface), however closing the sessions does not solve the issue. + + If you space rclone commands by 3 seconds it will avoid blocking the + remote. We haven't identified the exact blocking rules, so perhaps one + could execute the command 80 times without waiting and avoid blocking + by waiting 3 seconds, then continuing... + + Note that this has been observed by trial and error and might not be + set in stone. + + Other tools seem not to produce this blocking effect, as they use a + different working approach (state-based, using sessionIDs instead of + log-in) which isn't compatible with the current stateless rclone + approach. + + Note that once blocked, the use of other tools (such as megacmd) is + not a sure workaround: following megacmd login times have been + observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 + min, 30min. Web access looks unaffected though. + + Investigation is continuing in relation to workarounds based on + timeouts, pacers, retrials and tpslimits - if you discover something + relevant, please post on the forum. + + So, if rclone was working nicely and suddenly you are unable to log-in + and you are sure the user and the password are correct, likely you + have got the remote blocked for a while. + + + ### Standard options + + Here are the Standard options specific to mega (Mega). + + #### --mega-user + + User name. + + Properties: + + - Config: user + - Env Var: RCLONE_MEGA_USER + - Type: string + - Required: true + + #### --mega-pass + + Password. + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: pass + - Env Var: RCLONE_MEGA_PASS + - Type: string + - Required: true + + ### Advanced options + + Here are the Advanced options specific to mega (Mega). + + #### --mega-debug + + Output more debug from Mega. + + If this flag is set (along with -vv) it will print further debugging + information from the mega backend. + + Properties: + + - Config: debug + - Env Var: RCLONE_MEGA_DEBUG + - Type: bool + - Default: false + + #### --mega-hard-delete + + Delete files permanently rather than putting them into the trash. + + Normally the mega backend will put all deletions into the trash rather + than permanently deleting them. If you specify this then rclone will + permanently delete objects instead. + + Properties: + + - Config: hard_delete + - Env Var: RCLONE_MEGA_HARD_DELETE + - Type: bool + - Default: false + + #### --mega-use-https + + Use HTTPS for transfers. + + MEGA uses plain text HTTP connections by default. + Some ISPs throttle HTTP connections, this causes transfers to become very slow. + Enabling this will force MEGA to use HTTPS for all transfers. + HTTPS is normally not necessary since all data is already encrypted anyway. + Enabling it will increase CPU usage and add network overhead. + + Properties: + + - Config: use_https + - Env Var: RCLONE_MEGA_USE_HTTPS + - Type: bool + - Default: false + + #### --mega-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_MEGA_ENCODING + - Type: Encoding + - Default: Slash,InvalidUtf8,Dot + + + + ### Process `killed` + + On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). + + ## Limitations + + This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource + go library implementing the Mega API. There doesn't appear to be any + documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code + so there are likely quite a few errors still remaining in this library. + + Mega allows duplicate files which may confuse rclone. + + # Memory + + The memory backend is an in RAM backend. It does not persist its + data - use the local backend for that. + + The memory backend behaves like a bucket-based remote (e.g. like + s3). Because it has no parameters you can just use it with the + `:memory:` remote name. + + ## Configuration + + You can configure it as a remote like this with `rclone config` too if + you want to: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / Memory + "memory" [snip] Storage> memory ** See help for memory backend at: +https://rclone.org/memory/ ** + +Remote config + + --------------- + [remote] + type = memory + --------------- + +y) Yes this is OK (default) +z) Edit this remote +a) Delete this remote y/e/d> y -- Config: encoding -- Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,Dot -Limitations + Because the memory backend isn't persistent it is most useful for + testing or with an rclone server or rclone mount, e.g. -Symbolic links + rclone mount :memory: /mnt/tmp + rclone serve webdav :memory: + rclone serve sftp :memory: -HiDrive is able to store symbolic links (symlinks) by design, for -example, when unpacked from a zip archive. + ### Modification times and hashes -There exists no direct mechanism to manage native symlinks in remotes. -As such this implementation has chosen to ignore any native symlinks -present in the remote. rclone will not be able to access or show any -symlinks stored in the hidrive-remote. This means symlinks cannot be -individually removed, copied, or moved, except when removing, copying, -or moving the parent folder. + The memory backend supports MD5 hashes and modification times accurate to 1 nS. -This does not affect the .rclonelink-files that rclone uses to encode -and store symbolic links. + ### Restricted filename characters -Sparse files + The memory backend replaces the [default restricted characters + set](https://rclone.org/overview/#restricted-characters). -It is possible to store sparse files in HiDrive. -Note that copying a sparse file will expand the holes into null-byte -(0x00) regions that will then consume disk space. Likewise, when -downloading a sparse file, the resulting file will have null-byte -regions in the place of file holes. -HTTP -The HTTP remote is a read only remote for reading files of a webserver. -The webserver should provide file listings which rclone will read and -turn into a remote. This has been tested with common webservers such as -Apache/Nginx/Caddy and will likely work with file listings from most web -servers. (If it doesn't then please file an issue, or send a pull -request!) + # Akamai NetStorage -Paths are specified as remote: or remote:path. + Paths are specified as `remote:` + You may put subdirectories in too, e.g. `remote:/path/to/dir`. + If you have a CP code you can use that as the folder after the domain such as \\/\\/\. -The remote: represents the configured url, and any path following it -will be resolved relative to this url, according to the URL standard. -This means with remote url https://beta.rclone.org/branch and path fix, -the resolved URL will be https://beta.rclone.org/branch/fix, while with -path /fix the resolved URL will be https://beta.rclone.org/fix as the -absolute path is resolved from the root of the domain. + For example, this is commonly configured with or without a CP code: + * **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` + * **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` -If the path following the remote: ends with / it will be assumed to -point to a directory. If the path does not end with /, then a HEAD -request is sent and the response used to decide if it it is treated as a -file or a directory (run with -vv to see details). When --http-no-head -is specified, a path without ending / is always assumed to be a file. If -rclone incorrectly assumes the path is a file, the solution is to -specify the path with ending /. When you know the path is a directory, -ending it with / is always better as it avoids the initial HEAD request. -To just download a single file it is easier to use copyurl. + See all buckets + rclone lsd remote: + The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. -Configuration + ## Configuration -Here is an example of how to make a remote called remote. First run: + Here's an example of how to make a remote called `ns1`. - rclone config + 1. To begin the interactive configuration process, enter this command: -This will guide you through an interactive setup process: +rclone config - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / HTTP - \ "http" - [snip] - Storage> http - URL of http host to connect to - Choose a number from below, or type in your own value - 1 / Connect to example.com - \ "https://example.com" - url> https://beta.rclone.org - Remote config - -------------------- - [remote] - url = https://beta.rclone.org - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: - Name Type - ==== ==== - remote http + 2. Type `n` to create a new remote. - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> q +n) New remote +o) Delete remote +p) Quit config e/n/d/q> n -This remote is called remote and can now be used like this -See all the top level directories + 3. For this example, enter `ns1` when you reach the name> prompt. - rclone lsd remote: +name> ns1 -List the contents of a directory - rclone ls remote:directory + 4. Enter `netstorage` as the type of storage to configure. -Sync the remote directory to /home/local/directory, deleting any excess -files. +Type of storage to configure. Enter a string value. Press Enter for the +default (""). Choose a number from below, or type in your own value XX / +NetStorage  "netstorage" Storage> netstorage - rclone sync --interactive remote:directory /home/local/directory -Read only + 5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. -This remote is read only - you can't upload files to an HTTP server. +Enter a string value. Press Enter for the default (""). Choose a number +from below, or type in your own value 1 / HTTP protocol  "http" 2 / +HTTPS protocol  "https" protocol> 1 -Modified time -Most HTTP servers store time accurate to 1 second. + 6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` -Checksum +Enter a string value. Press Enter for the default (""). host> +baseball-nsu.akamaihd.net/123456/content/ -No checksums are stored. -Usage without a config file + 7. Set the netstorage account name -Since the http remote only has one config parameter it is easy to use -without a config file: +Enter a string value. Press Enter for the default (""). account> +username - rclone lsd --http-url https://beta.rclone.org :http: -or: + 8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. + Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. - rclone lsd :http,url='https://beta.rclone.org': +y) Yes type in my own password +z) Generate random password y/g> y Enter the password: password: + Confirm the password: password: -Standard options -Here are the Standard options specific to http (HTTP). + 9. View the summary and confirm your remote configuration. ---http-url +[ns1] type = netstorage protocol = http host = +baseball-nsu.akamaihd.net/123456/content/ account = username secret = +*** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) +Edit this remote d) Delete this remote y/e/d> y -URL of HTTP host to connect to. -E.g. "https://example.com", or "https://user:pass@example.com" to use a -username and password. + This remote is called `ns1` and can now be used. -Properties: + ## Example operations -- Config: url -- Env Var: RCLONE_HTTP_URL -- Type: string -- Required: true + Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. -Advanced options + ### See contents of a directory in your project -Here are the Advanced options specific to http (HTTP). + rclone lsd ns1:/974012/testing/ ---http-headers + ### Sync the contents local with remote -Set HTTP headers for all transactions. + rclone sync . ns1:/974012/testing/ -Use this to set additional HTTP headers for all transactions. + ### Upload local content to remote + rclone copy notes.txt ns1:/974012/testing/ -The input format is comma separated list of key,value pairs. Standard -CSV encoding may be used. + ### Delete content on remote + rclone delete ns1:/974012/testing/notes.txt -For example, to set a Cookie use 'Cookie,name=value', or -'"Cookie","name=value"'. + ### Move or copy content between CP codes. -You can set multiple headers, e.g. -'"Cookie","name=value","Authorization","xxx"'. + Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. -Properties: + rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ -- Config: headers -- Env Var: RCLONE_HTTP_HEADERS -- Type: CommaSepList -- Default: + ## Features ---http-no-slash + ### Symlink Support -Set this if the site doesn't end directories with /. + The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. -Use this if your target website does not use / on the end of -directories. + This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. -A / on the end of a path is how rclone normally tells the difference -between files and directories. If this flag is set, then rclone will -treat all files with Content-Type: text/html as directories and read -URLs from them rather than downloading them. + Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. -Note that this may cause rclone to confuse genuine HTML files with -directories. + **Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. -Properties: + ### Implicit vs. Explicit Directories -- Config: no_slash -- Env Var: RCLONE_HTTP_NO_SLASH -- Type: bool -- Default: false + With NetStorage, directories can exist in one of two forms: ---http-no-head + 1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. + 2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. -Don't use HEAD requests. + Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. -HEAD requests are mainly used to find file sizes in dir listing. If your -site is being very slow to load then you can try this option. Normally -rclone does a HEAD request for each potential file in a directory -listing to: + ### `--fast-list` / ListR support -- find its size -- check it really exists -- check to see if it is a directory + NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. -If you set this option, rclone will not do the HEAD request. This will -mean that directory listings are much quicker, but rclone won't have the -times or sizes of any files, and some files that don't exist may be in -the listing. + * **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. -Properties: + * **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. -- Config: no_head -- Env Var: RCLONE_HTTP_NO_HEAD -- Type: bool -- Default: false + There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. -Limitations + **Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. -rclone about is not supported by the HTTP backend. Backends without this -capability cannot determine free space for an rclone mount or use policy -mfs (most free space) as a member of an rclone union remote. + ### Purge -See List of backends that do not support rclone about and rclone about + NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. -Internet Archive + **Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. -The Internet Archive backend utilizes Items on archive.org -Refer to IAS3 API documentation for the API this backend uses. + ### Standard options -Paths are specified as remote:bucket (or remote: for the lsd command.) -You may put subdirectories in too, e.g. remote:item/path/to/dir. + Here are the Standard options specific to netstorage (Akamai NetStorage). -Unlike S3, listing up all items uploaded by you isn't supported. + #### --netstorage-host -Once you have made a remote, you can use it like this: + Domain+path of NetStorage host to connect to. -Make a new item + Format should be `/` - rclone mkdir remote:item + Properties: -List the contents of a item + - Config: host + - Env Var: RCLONE_NETSTORAGE_HOST + - Type: string + - Required: true - rclone ls remote:item + #### --netstorage-account -Sync /home/local/directory to the remote item, deleting any excess files -in the item. + Set the NetStorage account name - rclone sync --interactive /home/local/directory remote:item + Properties: -Notes + - Config: account + - Env Var: RCLONE_NETSTORAGE_ACCOUNT + - Type: string + - Required: true -Because of Internet Archive's architecture, it enqueues write operations -(and extra post-processings) in a per-item queue. You can check item's -queue at https://catalogd.archive.org/history/item-name-here . Because -of that, all uploads/deletes will not show up immediately and takes some -time to be available. The per-item queue is enqueued to an another -queue, Item Deriver Queue. You can check the status of Item Deriver -Queue here. This queue has a limit, and it may block you from uploading, -or even deleting. You should avoid uploading a lot of small files for -better behavior. + #### --netstorage-secret -You can optionally wait for the server's processing to finish, by -setting non-zero value to wait_archive key. By making it wait, rclone -can do normal file comparison. Make sure to set a large enough value -(e.g. 30m0s for smaller files) as it can take a long time depending on -server's queue. + Set the NetStorage account secret/G2O key for authentication. -About metadata + Please choose the 'y' option to set your own password then enter your secret. -This backend supports setting, updating and reading metadata of each -file. The metadata will appear as file metadata on Internet Archive. -However, some fields are reserved by both Internet Archive and rclone. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -The following are reserved by Internet Archive: - name - source - size - -md5 - crc32 - sha1 - format - old_version - viruscheck - summation + Properties: -Trying to set values to these keys is ignored with a warning. Only -setting mtime is an exception. Doing so make it the identical behavior -as setting ModTime. + - Config: secret + - Env Var: RCLONE_NETSTORAGE_SECRET + - Type: string + - Required: true -rclone reserves all the keys starting with rclone-. Setting value for -these keys will give you warnings, but values are set according to -request. + ### Advanced options -If there are multiple values for a key, only the first one is returned. -This is a limitation of rclone, that supports one value per one key. It -can be triggered when you did a server-side copy. + Here are the Advanced options specific to netstorage (Akamai NetStorage). -Reading metadata will also provide custom (non-standard nor reserved) -ones. + #### --netstorage-protocol -Filtering auto generated files + Select between HTTP or HTTPS protocol. -The Internet Archive automatically creates metadata files after upload. -These can cause problems when doing an rclone sync as rclone will try, -and fail, to delete them. These metadata files are not changeable, as -they are created by the Internet Archive automatically. + Most users should choose HTTPS, which is the default. + HTTP is provided primarily for debugging purposes. -These auto-created files can be excluded from the sync using metadata -filtering. + Properties: - rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" + - Config: protocol + - Env Var: RCLONE_NETSTORAGE_PROTOCOL + - Type: string + - Default: "https" + - Examples: + - "http" + - HTTP protocol + - "https" + - HTTPS protocol -Which excludes from the sync any files which have the source=metadata or -format=Metadata flags which are added to Internet Archive auto-created -files. + ## Backend commands -Configuration + Here are the commands specific to the netstorage backend. -Here is an example of making an internetarchive configuration. Most -applies to the other providers as well, any differences are described -below. + Run them with -First run + rclone backend COMMAND remote: - rclone config + The help below will explain what arguments each command takes. -This will guide you through an interactive setup process. + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. + + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). + + ### du + + Return disk usage information for a specified directory + + rclone backend du remote: [options] [+] + + The usage information returned, includes the targeted directory as well as all + files stored in any sub-directories that may exist. + + ### symlink + + You can create a symbolic link in ObjectStore with the symlink action. + + rclone backend symlink remote: [options] [+] + + The desired path location (including applicable sub-directories) ending in + the object that will be the target of the symlink (for example, /links/mylink). + Include the file extension for the object, if applicable. + `rclone backend symlink ` + + + + # Microsoft Azure Blob Storage + + Paths are specified as `remote:container` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. + `remote:container/path/to/dir`. + + ## Configuration + + Here is an example of making a Microsoft Azure Blob Storage + configuration. For a remote called `remote`. First run: + + rclone config + + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Microsoft Azure Blob Storage  "azureblob" [snip] Storage> azureblob +Storage Account Name account> account_name Storage Account Key key> +base64encodedkey== Endpoint for the service - leave blank normally. +endpoint> Remote config -------------------- [remote] account = +account_name key = base64encodedkey== endpoint = -------------------- y) +Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y + + + See all containers + + rclone lsd remote: + + Make a new container + + rclone mkdir remote:container + + List the contents of a container + + rclone ls remote:container + + Sync `/home/local/directory` to the remote container, deleting any excess + files in the container. + + rclone sync --interactive /home/local/directory remote:container + + ### --fast-list + + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. + + ### Modification times and hashes + + The modification time is stored as metadata on the object with the + `mtime` key. It is stored using RFC3339 Format time with nanosecond + precision. The metadata is supplied during directory listings so + there is no performance overhead to using it. + + If you wish to use the Azure standard `LastModified` time stored on + the object as the modified time, then use the `--use-server-modtime` + flag. Note that rclone can't set `LastModified`, so using the + `--update` flag when syncing is recommended if using + `--use-server-modtime`. + + MD5 hashes are stored with blobs. However blobs that were uploaded in + chunks only have an MD5 if the source remote was capable of MD5 + hashes, e.g. the local disk. + + ### Performance + + When uploading large files, increasing the value of + `--azureblob-upload-concurrency` will increase performance at the cost + of using more memory. The default of 16 is set quite conservatively to + use less memory. It maybe be necessary raise it to 64 or higher to + fully utilize a 1 GBit/s link with a single file transfer. + + ### Restricted filename characters + + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | / | 0x2F | / | + | \ | 0x5C | \ | + + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | . | 0x2E | . | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + + ### Authentication {#authentication} + + There are a number of ways of supplying credentials for Azure Blob + Storage. Rclone tries them in the order of the sections below. + + #### Env Auth + + If the `env_auth` config parameter is `true` then rclone will pull + credentials from the environment or runtime. + + It tries these authentication methods in this order: + + 1. Environment Variables + 2. Managed Service Identity Credentials + 3. Azure CLI credentials (as used by the az tool) + + These are described in the following sections + + ##### Env Auth: 1. Environment Variables + + If `env_auth` is set and environment variables are present rclone + authenticates a service principal with a secret or certificate, or a + user with a password, depending on which environment variable are set. + It reads configuration from these variables, in the following order: + + 1. Service principal with client secret + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets + 2. Service principal with certificate + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. + 3. User with username and password + - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations". + - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to + - `AZURE_USERNAME`: a username (usually an email address) + - `AZURE_PASSWORD`: the user's password + 4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). + + + ##### Env Auth: 2. Managed Service Identity Credentials + + When using Managed Service Identity if the VM(SS) on which this + program is running has a system-assigned identity, it will be used by + default. If the resource has no system-assigned but exactly one + user-assigned identity, the user-assigned identity will be used by + default. + + If the resource has multiple user-assigned identities you will need to + unset `env_auth` and set `use_msi` instead. See the [`use_msi` + section](#use_msi). + + ##### Env Auth: 3. Azure CLI credentials (as used by the az tool) + + Credentials created with the `az` tool can be picked up using `env_auth`. + + For example if you were to login with a service principal like this: + + az login --service-principal -u XXX -p XXX --tenant XXX + + Then you could access rclone resources like this: + + rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER + + Or + + rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER + + Which is analogous to using the `az` tool: + + az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login + + #### Account and Shared Key + + This is the most straight forward and least flexible way. Just fill + in the `account` and `key` lines and leave the rest blank. + + #### SAS URL + + This can be an account level SAS URL or container level SAS URL. + + To use it leave `account` and `key` blank and fill in `sas_url`. + + An account level SAS URL or container level SAS URL can be obtained + from the Azure portal or the Azure Storage Explorer. To get a + container level SAS URL right click on a container in the Azure Blob + explorer in the Azure portal. + + If you use a container level SAS URL, rclone operations are permitted + only on a particular container, e.g. + + rclone ls azureblob:container + + You can also list the single container from the root. This will only + show the container specified by the SAS URL. + + $ rclone lsd azureblob: + container/ + + Note that you can't see or access any other containers - this will + fail + + rclone ls azureblob:othercontainer + + Container level SAS URLs are useful for temporarily allowing third + parties access to a single container or putting credentials into an + untrusted environment such as a CI build server. + + #### Service principal with client secret + + If these variables are set, rclone will authenticate with a service principal with a client secret. + + - `tenant`: ID of the service principal's tenant. Also called its "directory" ID. + - `client_id`: the service principal's client ID + - `client_secret`: one of the service principal's client secrets + + The credentials can also be placed in a file using the + `service_principal_file` configuration option. + + #### Service principal with certificate + + If these variables are set, rclone will authenticate with a service principal with certificate. + + - `tenant`: ID of the service principal's tenant. Also called its "directory" ID. + - `client_id`: the service principal's client ID + - `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key. + - `client_certificate_password`: (optional) password for the certificate file. + - `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. + + **NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + #### User with username and password + + If these variables are set, rclone will authenticate with username and password. + + - `tenant`: (optional) tenant to authenticate in. Defaults to "organizations". + - `client_id`: client ID of the application the user will authenticate to + - `username`: a username (usually an email address) + - `password`: the user's password + + Microsoft doesn't recommend this kind of authentication, because it's + less secure than other authentication flows. This method is not + interactive, so it isn't compatible with any form of multi-factor + authentication, and the application must already have user or admin + consent. This credential can only authenticate work and school + accounts; it can't authenticate Microsoft accounts. + + **NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + #### Managed Service Identity Credentials {#use_msi} + + If `use_msi` is set then managed service identity credentials are + used. This authentication only works when running in an Azure service. + `env_auth` needs to be unset to use this. + + However if you have multiple user identities to choose from these must + be explicitly specified using exactly one of the `msi_object_id`, + `msi_client_id`, or `msi_mi_res_id` parameters. + + If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is + set, this is is equivalent to using `env_auth`. + + + ### Standard options + + Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). + + #### --azureblob-account + + Azure Storage Account Name. + + Set this to the Azure Storage Account Name in use. + + Leave blank to use SAS URL or Emulator, otherwise it needs to be set. + + If this is blank and if env_auth is set it will be read from the + environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. + + + Properties: + + - Config: account + - Env Var: RCLONE_AZUREBLOB_ACCOUNT + - Type: string + - Required: false + + #### --azureblob-env-auth + + Read credentials from runtime (environment variables, CLI or MSI). + + See the [authentication docs](/azureblob#authentication) for full info. + + Properties: + + - Config: env_auth + - Env Var: RCLONE_AZUREBLOB_ENV_AUTH + - Type: bool + - Default: false + + #### --azureblob-key + + Storage Account Shared Key. + + Leave blank to use SAS URL or Emulator. + + Properties: + + - Config: key + - Env Var: RCLONE_AZUREBLOB_KEY + - Type: string + - Required: false + + #### --azureblob-sas-url + + SAS URL for container level access only. + + Leave blank if using account/key or Emulator. + + Properties: + + - Config: sas_url + - Env Var: RCLONE_AZUREBLOB_SAS_URL + - Type: string + - Required: false + + #### --azureblob-tenant + + ID of the service principal's tenant. Also called its directory ID. + + Set this if using + - Service principal with client secret + - Service principal with certificate + - User with username and password + + + Properties: + + - Config: tenant + - Env Var: RCLONE_AZUREBLOB_TENANT + - Type: string + - Required: false + + #### --azureblob-client-id + + The ID of the client in use. + + Set this if using + - Service principal with client secret + - Service principal with certificate + - User with username and password + + + Properties: + + - Config: client_id + - Env Var: RCLONE_AZUREBLOB_CLIENT_ID + - Type: string + - Required: false + + #### --azureblob-client-secret + + One of the service principal's client secrets + + Set this if using + - Service principal with client secret + + + Properties: + + - Config: client_secret + - Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET + - Type: string + - Required: false + + #### --azureblob-client-certificate-path + + Path to a PEM or PKCS12 certificate file including the private key. + + Set this if using + - Service principal with certificate + + + Properties: + + - Config: client_certificate_path + - Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH + - Type: string + - Required: false + + #### --azureblob-client-certificate-password + + Password for the certificate file (optional). + + Optionally set this if using + - Service principal with certificate + + And the certificate has a password. + + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: client_certificate_password + - Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD + - Type: string + - Required: false + + ### Advanced options + + Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). + + #### --azureblob-client-send-certificate-chain + + Send the certificate chain when using certificate auth. + + Specifies whether an authentication request will include an x5c header + to support subject name / issuer based authentication. When set to + true, authentication requests include the x5c header. + + Optionally set this if using + - Service principal with certificate + + + Properties: + + - Config: client_send_certificate_chain + - Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN + - Type: bool + - Default: false + + #### --azureblob-username + + User name (usually an email address) + + Set this if using + - User with username and password + + + Properties: + + - Config: username + - Env Var: RCLONE_AZUREBLOB_USERNAME + - Type: string + - Required: false + + #### --azureblob-password + + The user's password + + Set this if using + - User with username and password + + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: password + - Env Var: RCLONE_AZUREBLOB_PASSWORD + - Type: string + - Required: false + + #### --azureblob-service-principal-file + + Path to file containing credentials for use with a service principal. + + Leave blank normally. Needed only if you want to use a service principal instead of interactive login. + + $ az ad sp create-for-rbac --name "" \ + --role "Storage Blob Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json + + See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + + It may be more convenient to put the credentials directly into the + rclone config file under the `client_id`, `tenant` and `client_secret` + keys instead of setting `service_principal_file`. + + + Properties: + + - Config: service_principal_file + - Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE + - Type: string + - Required: false + + #### --azureblob-use-msi + + Use a managed service identity to authenticate (only works in Azure). + + When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) + to authenticate to Azure Storage instead of a SAS token or account key. + + If the VM(SS) on which this program is running has a system-assigned identity, it will + be used by default. If the resource has no system-assigned but exactly one user-assigned identity, + the user-assigned identity will be used by default. If the resource has multiple user-assigned + identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, + msi_client_id, or msi_mi_res_id parameters. + + Properties: + + - Config: use_msi + - Env Var: RCLONE_AZUREBLOB_USE_MSI + - Type: bool + - Default: false + + #### --azureblob-msi-object-id + + Object ID of the user-assigned MSI to use, if any. + + Leave blank if msi_client_id or msi_mi_res_id specified. + + Properties: + + - Config: msi_object_id + - Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID + - Type: string + - Required: false + + #### --azureblob-msi-client-id + + Object ID of the user-assigned MSI to use, if any. + + Leave blank if msi_object_id or msi_mi_res_id specified. + + Properties: + + - Config: msi_client_id + - Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID + - Type: string + - Required: false + + #### --azureblob-msi-mi-res-id + + Azure resource ID of the user-assigned MSI to use, if any. + + Leave blank if msi_client_id or msi_object_id specified. + + Properties: + + - Config: msi_mi_res_id + - Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID + - Type: string + - Required: false + + #### --azureblob-use-emulator + + Uses local storage emulator if provided as 'true'. + + Leave blank if using real azure storage endpoint. + + Properties: + + - Config: use_emulator + - Env Var: RCLONE_AZUREBLOB_USE_EMULATOR + - Type: bool + - Default: false + + #### --azureblob-endpoint + + Endpoint for the service. + + Leave blank normally. + + Properties: + + - Config: endpoint + - Env Var: RCLONE_AZUREBLOB_ENDPOINT + - Type: string + - Required: false + + #### --azureblob-upload-cutoff + + Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). + + Properties: + + - Config: upload_cutoff + - Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF + - Type: string + - Required: false + + #### --azureblob-chunk-size + + Upload chunk size. + + Note that this is stored in memory and there may be up to + "--transfers" * "--azureblob-upload-concurrency" chunks stored at once + in memory. + + Properties: + + - Config: chunk_size + - Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE + - Type: SizeSuffix + - Default: 4Mi + + #### --azureblob-upload-concurrency + + Concurrency for multipart uploads. + + This is the number of chunks of the same file that are uploaded + concurrently. + + If you are uploading small numbers of large files over high-speed + links and these uploads do not fully utilize your bandwidth, then + increasing this may help to speed up the transfers. + + In tests, upload speed increases almost linearly with upload + concurrency. For example to fill a gigabit pipe it may be necessary to + raise this to 64. Note that this will use more memory. + + Note that chunks are stored in memory and there may be up to + "--transfers" * "--azureblob-upload-concurrency" chunks stored at once + in memory. + + Properties: + + - Config: upload_concurrency + - Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY + - Type: int + - Default: 16 + + #### --azureblob-list-chunk + + Size of blob list. + + This sets the number of blobs requested in each listing chunk. Default + is the maximum, 5000. "List blobs" requests are permitted 2 minutes + per megabyte to complete. If an operation is taking longer than 2 + minutes per megabyte on average, it will time out ( + [source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) + ). This can be used to limit the number of blobs items to return, to + avoid the time out. + + Properties: + + - Config: list_chunk + - Env Var: RCLONE_AZUREBLOB_LIST_CHUNK + - Type: int + - Default: 5000 + + #### --azureblob-access-tier + + Access tier of blob: hot, cool, cold or archive. + + Archived blobs can be restored by setting access tier to hot, cool or + cold. Leave blank if you intend to use default access tier, which is + set at account level + + If there is no "access tier" specified, rclone doesn't apply any tier. + rclone performs "Set Tier" operation on blobs while uploading, if objects + are not modified, specifying "access tier" to new one will have no effect. + If blobs are in "archive tier" at remote, trying to perform data transfer + operations from remote will not be allowed. User should first restore by + tiering blob to "Hot", "Cool" or "Cold". + + Properties: + + - Config: access_tier + - Env Var: RCLONE_AZUREBLOB_ACCESS_TIER + - Type: string + - Required: false + + #### --azureblob-archive-tier-delete + + Delete archive tier blobs before overwriting. + + Archive tier blobs cannot be updated. So without this flag, if you + attempt to update an archive tier blob, then rclone will produce the + error: + + can't update archive tier blob without --azureblob-archive-tier-delete + + With this flag set then before rclone attempts to overwrite an archive + tier blob, it will delete the existing blob before uploading its + replacement. This has the potential for data loss if the upload fails + (unlike updating a normal blob) and also may cost more since deleting + archive tier blobs early may be chargable. + + + Properties: + + - Config: archive_tier_delete + - Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE + - Type: bool + - Default: false + + #### --azureblob-disable-checksum - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - XX / InternetArchive Items - \ (internetarchive) - Storage> internetarchive - Option access_key_id. - IAS3 Access Key. - Leave blank for anonymous access. - You can find one here: https://archive.org/account/s3.php - Enter a value. Press Enter to leave empty. - access_key_id> XXXX - Option secret_access_key. - IAS3 Secret Key (password). - Leave blank for anonymous access. - Enter a value. Press Enter to leave empty. - secret_access_key> XXXX - Edit advanced config? - y) Yes - n) No (default) - y/n> y - Option endpoint. - IAS3 Endpoint. - Leave blank for default value. - Enter a string value. Press Enter for the default (https://s3.us.archive.org). - endpoint> - Option front_endpoint. - Host of InternetArchive Frontend. - Leave blank for default value. - Enter a string value. Press Enter for the default (https://archive.org). - front_endpoint> - Option disable_checksum. Don't store MD5 checksum with object metadata. + Normally rclone will calculate the MD5 checksum of the input before - uploading it so it can ask the server to check the object against checksum. - This is great for data integrity checking but can cause long delays for - large files to start uploading. - Enter a boolean value (true or false). Press Enter for the default (true). - disable_checksum> true - Option encoding. + uploading it so it can add it to metadata on the object. This is great + for data integrity checking but can cause long delays for large files + to start uploading. + + Properties: + + - Config: disable_checksum + - Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM + - Type: bool + - Default: false + + #### --azureblob-memory-pool-flush-time + + How often internal memory buffer pools will be flushed. (no longer used) + + Properties: + + - Config: memory_pool_flush_time + - Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME + - Type: Duration + - Default: 1m0s + + #### --azureblob-memory-pool-use-mmap + + Whether to use mmap buffers in internal memory pool. (no longer used) + + Properties: + + - Config: memory_pool_use_mmap + - Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP + - Type: bool + - Default: false + + #### --azureblob-encoding + The encoding for the backend. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). - encoding> - Edit advanced config? - y) Yes - n) No (default) - y/n> n - -------------------- - [remote] - type = internetarchive - access_key_id = XXXX - secret_access_key = XXXX - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y -Standard options + Properties: -Here are the Standard options specific to internetarchive (Internet -Archive). + - Config: encoding + - Env Var: RCLONE_AZUREBLOB_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 ---internetarchive-access-key-id + #### --azureblob-public-access -IAS3 Access Key. + Public access level of a container: blob or container. -Leave blank for anonymous access. You can find one here: -https://archive.org/account/s3.php + Properties: -Properties: + - Config: public_access + - Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS + - Type: string + - Required: false + - Examples: + - "" + - The container and its blobs can be accessed only with an authorized request. + - It's a default value. + - "blob" + - Blob data within this container can be read via anonymous request. + - "container" + - Allow full public read access for container and blob data. -- Config: access_key_id -- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID -- Type: string -- Required: false + #### --azureblob-directory-markers ---internetarchive-secret-access-key + Upload an empty object with a trailing slash when a new directory is created -IAS3 Secret Key (password). + Empty folders are unsupported for bucket based remotes, this option + creates an empty object ending with "/", to persist the folder. -Leave blank for anonymous access. + This object also has the metadata "hdi_isfolder = true" to conform to + the Microsoft standard. + -Properties: + Properties: -- Config: secret_access_key -- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY -- Type: string -- Required: false + - Config: directory_markers + - Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS + - Type: bool + - Default: false -Advanced options + #### --azureblob-no-check-container -Here are the Advanced options specific to internetarchive (Internet -Archive). + If set, don't attempt to check the container exists or create it. ---internetarchive-endpoint + This can be useful when trying to minimise the number of transactions + rclone does if you know the container exists already. -IAS3 Endpoint. -Leave blank for default value. + Properties: -Properties: + - Config: no_check_container + - Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER + - Type: bool + - Default: false -- Config: endpoint -- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT -- Type: string -- Default: "https://s3.us.archive.org" + #### --azureblob-no-head-object ---internetarchive-front-endpoint + If set, do not do HEAD before GET when getting objects. -Host of InternetArchive Frontend. + Properties: -Leave blank for default value. + - Config: no_head_object + - Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT + - Type: bool + - Default: false -Properties: -- Config: front_endpoint -- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT -- Type: string -- Default: "https://archive.org" ---internetarchive-disable-checksum + ### Custom upload headers -Don't ask the server to test against MD5 checksum calculated by rclone. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against -checksum. This is great for data integrity checking but can cause long -delays for large files to start uploading. + You can set custom upload headers with the `--header-upload` flag. -Properties: + - Cache-Control + - Content-Disposition + - Content-Encoding + - Content-Language + - Content-Type -- Config: disable_checksum -- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM -- Type: bool -- Default: true + Eg `--header-upload "Content-Type: text/potato"` ---internetarchive-wait-archive + ## Limitations -Timeout for waiting the server's processing tasks (specifically archive -and book_op) to finish. Only enable if you need to be guaranteed to be -reflected after write operations. 0 to disable waiting. No errors to be -thrown in case of timeout. + MD5 sums are only uploaded with chunked files if the source has an MD5 + sum. This will always be the case for a local to azure copy. -Properties: + `rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. -- Config: wait_archive -- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE -- Type: Duration -- Default: 0s + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) ---internetarchive-encoding + ## Azure Storage Emulator Support -The encoding for the backend. + You can run rclone with the storage emulator (usually _azurite_). -See the encoding section in the overview for more info. + To do this, just set up a new remote with `rclone config` following + the instructions in the introduction and set `use_emulator` in the + advanced settings as `true`. You do not need to provide a default + account name nor an account key. But you can override them in the + `account` and `key` options. (Prior to v1.61 they were hard coded to + _azurite_'s `devstoreaccount1`.) -Properties: + Also, if you want to access a storage emulator instance running on a + different machine, you can override the `endpoint` parameter in the + advanced settings, setting it to + `http(s)://:/devstoreaccount1` + (e.g. `http://10.254.2.5:10000/devstoreaccount1`). -- Config: encoding -- Env Var: RCLONE_INTERNETARCHIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot + # Microsoft Azure Files Storage -Metadata + Paths are specified as `remote:` You may put subdirectories in too, + e.g. `remote:path/to/dir`. -Metadata fields provided by Internet Archive. If there are multiple -values for a key, only the first one is returned. This is a limitation -of Rclone, that supports one value per one key. + ## Configuration -Owner is able to add custom keys. Metadata feature grabs all the keys -including them. + Here is an example of making a Microsoft Azure Files Storage + configuration. For a remote called `remote`. First run: -Here are the possible system metadata items for the internetarchive -backend. + rclone config - -------------------------------------------------------------------------------------------------------------------------------------- - Name Help Type Example Read Only - --------------------- ---------------------------------- ----------- -------------------------------------------- -------------------- - crc32 CRC32 calculated by Internet string 01234567 Y - Archive + This will guide you through an interactive setup process: - format Name of format identified by string Comma-Separated Values Y - Internet Archive +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Microsoft Azure Files Storage  "azurefiles" [snip] - md5 MD5 hash calculated by Internet string 01234567012345670123456701234567 Y - Archive +Option account. Azure Storage Account Name. Set this to the Azure +Storage Account Name in use. Leave blank to use SAS URL or connection +string, otherwise it needs to be set. If this is blank and if env_auth +is set it will be read from the environment variable +AZURE_STORAGE_ACCOUNT_NAME if possible. Enter a value. Press Enter to +leave empty. account> account_name - mtime Time of last modification, managed RFC 3339 2006-01-02T15:04:05.999999999Z Y - by Rclone +Option share_name. Azure Files Share Name. This is required and is the +name of the share to access. Enter a value. Press Enter to leave empty. +share_name> share_name - name Full file path, without the bucket filename backend/internetarchive/internetarchive.go Y - part +Option env_auth. Read credentials from runtime (environment variables, +CLI or MSI). See the authentication docs for full info. Enter a boolean +value (true or false). Press Enter for the default (false). env_auth> - old_version Whether the file was replaced and boolean true Y - moved by keep-old-version flag +Option key. Storage Account Shared Key. Leave blank to use SAS URL or +connection string. Enter a value. Press Enter to leave empty. key> +base64encodedkey== - rclone-ia-mtime Time of last modification, managed RFC 3339 2006-01-02T15:04:05.999999999Z N - by Internet Archive +Option sas_url. SAS URL. Leave blank if using account/key or connection +string. Enter a value. Press Enter to leave empty. sas_url> - rclone-mtime Time of last modification, managed RFC 3339 2006-01-02T15:04:05.999999999Z N - by Rclone +Option connection_string. Azure Files Connection String. Enter a value. +Press Enter to leave empty. connection_string> [snip] - rclone-update-track Random value used by Rclone for string aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N - tracking changes inside Internet - Archive +Configuration complete. Options: - type: azurefiles - account: +account_name - share_name: share_name - key: base64encodedkey== Keep +this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> - sha1 SHA1 hash calculated by Internet string 0123456701234567012345670123456701234567 Y - Archive - size File size in bytes decimal 123456 Y - number + Once configured you can use rclone. - source The source of the file string original Y + See all files in the top level: - summation Check string md5 Y - https://forum.rclone.org/t/31922 - for how it is used + rclone lsf remote: - viruscheck The last time viruscheck process unixtime 1654191352 Y - was run for the file (?) - -------------------------------------------------------------------------------------------------------------------------------------- + Make a new directory in the root: -See the metadata docs for more info. + rclone mkdir remote:dir -Jottacloud + Recursively List the contents: -Jottacloud is a cloud storage service provider from a Norwegian company, -using its own datacenters in Norway. In addition to the official service -at jottacloud.com, it also provides white-label solutions to different -companies, such as: * Telia * Telia Cloud (cloud.telia.se) * Telia Sky -(sky.telia.no) * Tele2 * Tele2 Cloud (mittcloud.tele2.se) * Elkjøp (with -subsidiaries): * Elkjøp Cloud (cloud.elkjop.no) * Elgiganten Sweden -(cloud.elgiganten.se) * Elgiganten Denmark (cloud.elgiganten.dk) * -Giganti Cloud (cloud.gigantti.fi) * ELKO Cloud (cloud.elko.is) + rclone ls remote: -Most of the white-label versions are supported by this backend, although -may require different authentication setup - described below. + Sync `/home/local/directory` to the remote directory, deleting any + excess files in the directory. -Paths are specified as remote:path + rclone sync --interactive /home/local/directory remote:dir -Paths may be as deep as required, e.g. remote:directory/subdirectory. + ### Modified time + + The modified time is stored as Azure standard `LastModified` time on + files + + ### Performance + + When uploading large files, increasing the value of + `--azurefiles-upload-concurrency` will increase performance at the cost + of using more memory. The default of 16 is set quite conservatively to + use less memory. It maybe be necessary raise it to 64 or higher to + fully utilize a 1 GBit/s link with a single file transfer. + + ### Restricted filename characters + + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \ | 0x5C | \ | + | \| | 0x7C | | | + + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | . | 0x2E | . | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + + ### Hashes + + MD5 hashes are stored with files. Not all files will have MD5 hashes + as these have to be uploaded with the file. + + ### Authentication {#authentication} + + There are a number of ways of supplying credentials for Azure Files + Storage. Rclone tries them in the order of the sections below. + + #### Env Auth + + If the `env_auth` config parameter is `true` then rclone will pull + credentials from the environment or runtime. + + It tries these authentication methods in this order: + + 1. Environment Variables + 2. Managed Service Identity Credentials + 3. Azure CLI credentials (as used by the az tool) + + These are described in the following sections + + ##### Env Auth: 1. Environment Variables + + If `env_auth` is set and environment variables are present rclone + authenticates a service principal with a secret or certificate, or a + user with a password, depending on which environment variable are set. + It reads configuration from these variables, in the following order: + + 1. Service principal with client secret + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets + 2. Service principal with certificate + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. + 3. User with username and password + - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations". + - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to + - `AZURE_USERNAME`: a username (usually an email address) + - `AZURE_PASSWORD`: the user's password + 4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). + + + ##### Env Auth: 2. Managed Service Identity Credentials + + When using Managed Service Identity if the VM(SS) on which this + program is running has a system-assigned identity, it will be used by + default. If the resource has no system-assigned but exactly one + user-assigned identity, the user-assigned identity will be used by + default. + + If the resource has multiple user-assigned identities you will need to + unset `env_auth` and set `use_msi` instead. See the [`use_msi` + section](#use_msi). + + ##### Env Auth: 3. Azure CLI credentials (as used by the az tool) + + Credentials created with the `az` tool can be picked up using `env_auth`. + + For example if you were to login with a service principal like this: + + az login --service-principal -u XXX -p XXX --tenant XXX + + Then you could access rclone resources like this: + + rclone lsf :azurefiles,env_auth,account=ACCOUNT: + + Or + + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: + + #### Account and Shared Key + + This is the most straight forward and least flexible way. Just fill + in the `account` and `key` lines and leave the rest blank. + + #### SAS URL + + To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`. + + #### Connection String + + To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`. + + #### Service principal with client secret + + If these variables are set, rclone will authenticate with a service principal with a client secret. + + - `tenant`: ID of the service principal's tenant. Also called its "directory" ID. + - `client_id`: the service principal's client ID + - `client_secret`: one of the service principal's client secrets + + The credentials can also be placed in a file using the + `service_principal_file` configuration option. + + #### Service principal with certificate + + If these variables are set, rclone will authenticate with a service principal with certificate. + + - `tenant`: ID of the service principal's tenant. Also called its "directory" ID. + - `client_id`: the service principal's client ID + - `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key. + - `client_certificate_password`: (optional) password for the certificate file. + - `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. + + **NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + #### User with username and password + + If these variables are set, rclone will authenticate with username and password. + + - `tenant`: (optional) tenant to authenticate in. Defaults to "organizations". + - `client_id`: client ID of the application the user will authenticate to + - `username`: a username (usually an email address) + - `password`: the user's password + + Microsoft doesn't recommend this kind of authentication, because it's + less secure than other authentication flows. This method is not + interactive, so it isn't compatible with any form of multi-factor + authentication, and the application must already have user or admin + consent. This credential can only authenticate work and school + accounts; it can't authenticate Microsoft accounts. + + **NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + #### Managed Service Identity Credentials {#use_msi} + + If `use_msi` is set then managed service identity credentials are + used. This authentication only works when running in an Azure service. + `env_auth` needs to be unset to use this. + + However if you have multiple user identities to choose from these must + be explicitly specified using exactly one of the `msi_object_id`, + `msi_client_id`, or `msi_mi_res_id` parameters. + + If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is + set, this is is equivalent to using `env_auth`. + + + ### Standard options + + Here are the Standard options specific to azurefiles (Microsoft Azure Files). + + #### --azurefiles-account + + Azure Storage Account Name. + + Set this to the Azure Storage Account Name in use. + + Leave blank to use SAS URL or connection string, otherwise it needs to be set. + + If this is blank and if env_auth is set it will be read from the + environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. + + + Properties: + + - Config: account + - Env Var: RCLONE_AZUREFILES_ACCOUNT + - Type: string + - Required: false + + #### --azurefiles-share-name + + Azure Files Share Name. + + This is required and is the name of the share to access. + + + Properties: + + - Config: share_name + - Env Var: RCLONE_AZUREFILES_SHARE_NAME + - Type: string + - Required: false + + #### --azurefiles-env-auth + + Read credentials from runtime (environment variables, CLI or MSI). + + See the [authentication docs](/azurefiles#authentication) for full info. + + Properties: + + - Config: env_auth + - Env Var: RCLONE_AZUREFILES_ENV_AUTH + - Type: bool + - Default: false + + #### --azurefiles-key + + Storage Account Shared Key. + + Leave blank to use SAS URL or connection string. + + Properties: + + - Config: key + - Env Var: RCLONE_AZUREFILES_KEY + - Type: string + - Required: false + + #### --azurefiles-sas-url + + SAS URL. + + Leave blank if using account/key or connection string. -Authentication types - -Some of the whitelabel versions uses a different authentication method -than the official service, and you have to choose the correct one when -setting up the remote. - -Standard authentication - -The standard authentication method used by the official service -(jottacloud.com), as well as some of the whitelabel services, requires -you to generate a single-use personal login token from the account -security settings in the service's web interface. Log in to your -account, go to "Settings" and then "Security", or use the direct link -presented to you by rclone when configuring the remote: -https://www.jottacloud.com/web/secure. Scroll down to the section -"Personal login token", and click the "Generate" button. Note that if -you are using a whitelabel service you probably can't use the direct -link, you need to find the same page in their dedicated web interface, -and also it may be in a different location than described above. - -To access your account from multiple instances of rclone, you need to -configure each of them with a separate personal login token. E.g. you -create a Jottacloud remote with rclone in one location, and copy the -configuration file to a second location where you also want to run -rclone and access the same remote. Then you need to replace the token -for one of them, using the config reconnect command, which requires you -to generate a new personal login token and supply as input. If you do -not do this, the token may easily end up being invalidated, resulting in -both instances failing with an error message something along the lines -of: - - oauth2: cannot fetch token: 400 Bad Request - Response: {"error":"invalid_grant","error_description":"Stale token"} - -When this happens, you need to replace the token as described above to -be able to use your remote again. - -All personal login tokens you have taken into use will be listed in the -web interface under "My logged in devices", and from the right side of -that list you can click the "X" button to revoke individual tokens. - -Legacy authentication - -If you are using one of the whitelabel versions (e.g. from Elkjøp) you -may not have the option to generate a CLI token. In this case you'll -have to use the legacy authentication. To do this select yes when the -setup asks for legacy authentication and enter your username and -password. The rest of the setup is identical to the default setup. - -Telia Cloud authentication - -Similar to other whitelabel versions Telia Cloud doesn't offer the -option of creating a CLI token, and additionally uses a separate -authentication flow where the username is generated internally. To setup -rclone to use Telia Cloud, choose Telia Cloud authentication in the -setup. The rest of the setup is identical to the default setup. - -Tele2 Cloud authentication - -As Tele2-Com Hem merger was completed this authentication can be used -for former Com Hem Cloud and Tele2 Cloud customers as no support for -creating a CLI token exists, and additionally uses a separate -authentication flow where the username is generated internally. To setup -rclone to use Tele2 Cloud, choose Tele2 Cloud authentication in the -setup. The rest of the setup is identical to the default setup. + Properties: -Configuration + - Config: sas_url + - Env Var: RCLONE_AZUREFILES_SAS_URL + - Type: string + - Required: false -Here is an example of how to make a remote called remote with the -default setup. First run: + #### --azurefiles-connection-string - rclone config + Azure Files Connection String. -This will guide you through an interactive setup process: + Properties: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - XX / Jottacloud - \ (jottacloud) - [snip] - Storage> jottacloud - Edit advanced config? - y) Yes - n) No (default) - y/n> n - Option config_type. - Select authentication type. - Choose a number from below, or type in an existing string value. - Press Enter for the default (standard). - / Standard authentication. - 1 | Use this if you're a normal Jottacloud user. - \ (standard) - / Legacy authentication. - 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users. - \ (legacy) - / Telia Cloud authentication. - 3 | Use this if you are using Telia Cloud. - \ (telia) - / Tele2 Cloud authentication. - 4 | Use this if you are using Tele2 Cloud. - \ (tele2) - config_type> 1 - Personal login token. - Generate here: https://www.jottacloud.com/web/secure - Login Token> - Use a non-standard device/mountpoint? - Choosing no, the default, will let you access the storage used for the archive - section of the official Jottacloud client. If you instead want to access the - sync or the backup section, for example, you must choose yes. - y) Yes - n) No (default) - y/n> y - Option config_device. - The device to use. In standard setup the built-in Jotta device is used, - which contains predefined mountpoints for archive, sync etc. All other devices - are treated as backup devices by the official Jottacloud client. You may create - a new by entering a unique name. - Choose a number from below, or type in your own string value. - Press Enter for the default (DESKTOP-3H31129). - 1 > DESKTOP-3H31129 - 2 > Jotta - config_device> 2 - Option config_mountpoint. - The mountpoint to use for the built-in device Jotta. - The standard setup is to use the Archive mountpoint. Most other mountpoints - have very limited support in rclone and should generally be avoided. - Choose a number from below, or type in an existing string value. - Press Enter for the default (Archive). - 1 > Archive - 2 > Shared - 3 > Sync - config_mountpoint> 1 - -------------------- - [remote] - type = jottacloud - configVersion = 1 - client_id = jottacli - client_secret = - tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token - token = {........} - username = 2940e57271a93d987d6f8a21 - device = Jotta - mountpoint = Archive - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + - Config: connection_string + - Env Var: RCLONE_AZUREFILES_CONNECTION_STRING + - Type: string + - Required: false -Once configured you can then use rclone like this, + #### --azurefiles-tenant -List directories in top level of your Jottacloud + ID of the service principal's tenant. Also called its directory ID. - rclone lsd remote: + Set this if using + - Service principal with client secret + - Service principal with certificate + - User with username and password -List all the files in your Jottacloud - rclone ls remote: + Properties: -To copy a local directory to an Jottacloud directory called backup + - Config: tenant + - Env Var: RCLONE_AZUREFILES_TENANT + - Type: string + - Required: false - rclone copy /home/source remote:backup + #### --azurefiles-client-id -Devices and Mountpoints - -The official Jottacloud client registers a device for each computer you -install it on, and shows them in the backup section of the user -interface. For each folder you select for backup it will create a -mountpoint within this device. A built-in device called Jotta is -special, and contains mountpoints Archive, Sync and some others, used -for corresponding features in official clients. - -With rclone you'll want to use the standard Jotta/Archive -device/mountpoint in most cases. However, you may for example want to -access files from the sync or backup functionality provided by the -official clients, and rclone therefore provides the option to select -other devices and mountpoints during config. - -You are allowed to create new devices and mountpoints. All devices -except the built-in Jotta device are treated as backup devices by -official Jottacloud clients, and the mountpoints on them are individual -backup sets. - -With the built-in Jotta device, only existing, built-in, mountpoints can -be selected. In addition to the mentioned Archive and Sync, it may -contain several other mountpoints such as: Latest, Links, Shared and -Trash. All of these are special mountpoints with a different internal -representation than the "regular" mountpoints. Rclone will only to a -very limited degree support them. Generally you should avoid these, -unless you know what you are doing. + The ID of the client in use. ---fast-list + Set this if using + - Service principal with client secret + - Service principal with certificate + - User with username and password -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. -Note that the implementation in Jottacloud always uses only a single API -request to get the entire list, so for large folders this could lead to -long wait time before the first results are shown. + Properties: -Note also that with rclone version 1.58 and newer information about MIME -types are not available when using --fast-list. + - Config: client_id + - Env Var: RCLONE_AZUREFILES_CLIENT_ID + - Type: string + - Required: false -Modified time and hashes + #### --azurefiles-client-secret -Jottacloud allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. + One of the service principal's client secrets -Jottacloud supports MD5 type hashes, so you can use the --checksum flag. + Set this if using + - Service principal with client secret -Note that Jottacloud requires the MD5 hash before upload so if the -source does not have an MD5 checksum then the file will be cached -temporarily on disk (in location given by --temp-dir) before it is -uploaded. Small files will be cached in memory - see the ---jottacloud-md5-memory-limit flag. When uploading from local disk the -source checksum is always available, so this does not apply. Starting -with rclone version 1.52 the same is true for crypted remotes (in older -versions the crypt backend would not calculate hashes for uploads from -local disk, so the Jottacloud backend had to do it as described above). -Restricted filename characters + Properties: -In addition to the default restricted characters set the following -characters are also replaced: + - Config: client_secret + - Env Var: RCLONE_AZUREFILES_CLIENT_SECRET + - Type: string + - Required: false - Character Value Replacement - ----------- ------- ------------- - " 0x22 " - * 0x2A * - : 0x3A : - < 0x3C < - > 0x3E > - ? 0x3F ? - | 0x7C | + #### --azurefiles-client-certificate-path -Invalid UTF-8 bytes will also be replaced, as they can't be used in XML -strings. + Path to a PEM or PKCS12 certificate file including the private key. -Deleting files + Set this if using + - Service principal with certificate -By default, rclone will send all files to the trash when deleting files. -They will be permanently deleted automatically after 30 days. You may -bypass the trash and permanently delete files immediately by using the ---jottacloud-hard-delete flag, or set the equivalent environment -variable. Emptying the trash is supported by the cleanup command. -Versions + Properties: -Jottacloud supports file versioning. When rclone uploads a new version -of a file it creates a new version of it. Currently rclone only supports -retrieving the current version but older versions can be accessed via -the Jottacloud Website. + - Config: client_certificate_path + - Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH + - Type: string + - Required: false -Versioning can be disabled by --jottacloud-no-versions option. This is -achieved by deleting the remote file prior to uploading a new version. -If the upload the fails no version of the file will be available in the -remote. + #### --azurefiles-client-certificate-password -Quota information + Password for the certificate file (optional). -To view your current quota you can use the rclone about remote: command -which will display your usage limit (unless it is unlimited) and the -current usage. + Optionally set this if using + - Service principal with certificate -Advanced options + And the certificate has a password. -Here are the Advanced options specific to jottacloud (Jottacloud). ---jottacloud-md5-memory-limit + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Files bigger than this will be cached on disk to calculate the MD5 if -required. + Properties: -Properties: + - Config: client_certificate_password + - Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD + - Type: string + - Required: false -- Config: md5_memory_limit -- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT -- Type: SizeSuffix -- Default: 10Mi + ### Advanced options ---jottacloud-trashed-only + Here are the Advanced options specific to azurefiles (Microsoft Azure Files). -Only show files that are in the trash. + #### --azurefiles-client-send-certificate-chain -This will show trashed files in their original directory structure. + Send the certificate chain when using certificate auth. -Properties: + Specifies whether an authentication request will include an x5c header + to support subject name / issuer based authentication. When set to + true, authentication requests include the x5c header. -- Config: trashed_only -- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY -- Type: bool -- Default: false + Optionally set this if using + - Service principal with certificate ---jottacloud-hard-delete -Delete files permanently rather than putting them into the trash. + Properties: -Properties: + - Config: client_send_certificate_chain + - Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN + - Type: bool + - Default: false -- Config: hard_delete -- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE -- Type: bool -- Default: false + #### --azurefiles-username ---jottacloud-upload-resume-limit + User name (usually an email address) -Files bigger than this can be resumed if the upload fail's. + Set this if using + - User with username and password -Properties: -- Config: upload_resume_limit -- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT -- Type: SizeSuffix -- Default: 10Mi + Properties: ---jottacloud-no-versions + - Config: username + - Env Var: RCLONE_AZUREFILES_USERNAME + - Type: string + - Required: false -Avoid server side versioning by deleting files and recreating files -instead of overwriting them. + #### --azurefiles-password -Properties: + The user's password -- Config: no_versions -- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS -- Type: bool -- Default: false + Set this if using + - User with username and password ---jottacloud-encoding -The encoding for the backend. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -See the encoding section in the overview for more info. + Properties: -Properties: + - Config: password + - Env Var: RCLONE_AZUREFILES_PASSWORD + - Type: string + - Required: false -- Config: encoding -- Env Var: RCLONE_JOTTACLOUD_ENCODING -- Type: MultiEncoder -- Default: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot + #### --azurefiles-service-principal-file -Limitations + Path to file containing credentials for use with a service principal. -Note that Jottacloud is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + Leave blank normally. Needed only if you want to use a service principal instead of interactive login. -There are quite a few characters that can't be in Jottacloud file names. -Rclone will map these names to and from an identical looking unicode -equivalent. For example if a file has a ? in it will be mapped to ? -instead. + $ az ad sp create-for-rbac --name "" \ + --role "Storage Files Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json -Jottacloud only supports filenames up to 255 characters in length. + See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. -Troubleshooting + **NB** this section needs updating for Azure Files - pull requests appreciated! -Jottacloud exhibits some inconsistent behaviours regarding deleted files -and folders which may cause Copy, Move and DirMove operations to -previously deleted paths to fail. Emptying the trash should help in such -cases. + It may be more convenient to put the credentials directly into the + rclone config file under the `client_id`, `tenant` and `client_secret` + keys instead of setting `service_principal_file`. -Koofr -Paths are specified as remote:path + Properties: -Paths may be as deep as required, e.g. remote:directory/subdirectory. + - Config: service_principal_file + - Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE + - Type: string + - Required: false -Configuration + #### --azurefiles-use-msi -The initial setup for Koofr involves creating an application password -for rclone. You can do that by opening the Koofr web application, giving -the password a nice name like rclone and clicking on generate. + Use a managed service identity to authenticate (only works in Azure). -Here is an example of how to make a remote called koofr. First run: + When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) + to authenticate to Azure Storage instead of a SAS token or account key. - rclone config + If the VM(SS) on which this program is running has a system-assigned identity, it will + be used by default. If the resource has no system-assigned but exactly one user-assigned identity, + the user-assigned identity will be used by default. If the resource has multiple user-assigned + identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, + msi_client_id, or msi_mi_res_id parameters. -This will guide you through an interactive setup process: + Properties: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> koofr - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - 22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) - [snip] - Storage> koofr - Option provider. - Choose your storage provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) - provider> 1 - Option user. - Your user name. - Enter a value. - user> USERNAME - Option password. - Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). - Choose an alternative below. - y) Yes, type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - Edit advanced config? - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [koofr] - type = koofr - provider = koofr - user = USERNAME - password = *** ENCRYPTED *** - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + - Config: use_msi + - Env Var: RCLONE_AZUREFILES_USE_MSI + - Type: bool + - Default: false -You can choose to edit advanced config in order to enter your own -service URL if you use an on-premise or white label Koofr instance, or -choose an alternative mount instead of your primary storage. + #### --azurefiles-msi-object-id -Once configured you can then use rclone like this, + Object ID of the user-assigned MSI to use, if any. -List directories in top level of your Koofr + Leave blank if msi_client_id or msi_mi_res_id specified. - rclone lsd koofr: + Properties: -List all the files in your Koofr + - Config: msi_object_id + - Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID + - Type: string + - Required: false - rclone ls koofr: + #### --azurefiles-msi-client-id -To copy a local directory to an Koofr directory called backup + Object ID of the user-assigned MSI to use, if any. - rclone copy /home/source koofr:backup + Leave blank if msi_object_id or msi_mi_res_id specified. -Restricted filename characters + Properties: -In addition to the default restricted characters set the following -characters are also replaced: + - Config: msi_client_id + - Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID + - Type: string + - Required: false - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ + #### --azurefiles-msi-mi-res-id -Invalid UTF-8 bytes will also be replaced, as they can't be used in XML -strings. + Azure resource ID of the user-assigned MSI to use, if any. -Standard options + Leave blank if msi_client_id or msi_object_id specified. -Here are the Standard options specific to koofr (Koofr, Digi Storage and -other Koofr-compatible storage providers). + Properties: ---koofr-provider + - Config: msi_mi_res_id + - Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID + - Type: string + - Required: false -Choose your storage provider. + #### --azurefiles-endpoint -Properties: + Endpoint for the service. -- Config: provider -- Env Var: RCLONE_KOOFR_PROVIDER -- Type: string -- Required: false -- Examples: - - "koofr" - - Koofr, https://app.koofr.net/ - - "digistorage" - - Digi Storage, https://storage.rcs-rds.ro/ - - "other" - - Any other Koofr API compatible storage service + Leave blank normally. ---koofr-endpoint + Properties: -The Koofr API endpoint to use. + - Config: endpoint + - Env Var: RCLONE_AZUREFILES_ENDPOINT + - Type: string + - Required: false -Properties: + #### --azurefiles-chunk-size -- Config: endpoint -- Env Var: RCLONE_KOOFR_ENDPOINT -- Provider: other -- Type: string -- Required: true + Upload chunk size. ---koofr-user + Note that this is stored in memory and there may be up to + "--transfers" * "--azurefile-upload-concurrency" chunks stored at once + in memory. -Your user name. + Properties: -Properties: + - Config: chunk_size + - Env Var: RCLONE_AZUREFILES_CHUNK_SIZE + - Type: SizeSuffix + - Default: 4Mi -- Config: user -- Env Var: RCLONE_KOOFR_USER -- Type: string -- Required: true + #### --azurefiles-upload-concurrency ---koofr-password + Concurrency for multipart uploads. -Your password for rclone (generate one at -https://app.koofr.net/app/admin/preferences/password). + This is the number of chunks of the same file that are uploaded + concurrently. -NB Input to this must be obscured - see rclone obscure. + If you are uploading small numbers of large files over high-speed + links and these uploads do not fully utilize your bandwidth, then + increasing this may help to speed up the transfers. -Properties: + Note that chunks are stored in memory and there may be up to + "--transfers" * "--azurefile-upload-concurrency" chunks stored at once + in memory. -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: koofr -- Type: string -- Required: true + Properties: ---koofr-password + - Config: upload_concurrency + - Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY + - Type: int + - Default: 16 -Your password for rclone (generate one at -https://storage.rcs-rds.ro/app/admin/preferences/password). + #### --azurefiles-max-stream-size -NB Input to this must be obscured - see rclone obscure. + Max size for streamed files. -Properties: + Azure files needs to know in advance how big the file will be. When + rclone doesn't know it uses this value instead. -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: digistorage -- Type: string -- Required: true + This will be used when rclone is streaming data, the most common uses are: ---koofr-password + - Uploading files with `--vfs-cache-mode off` with `rclone mount` + - Using `rclone rcat` + - Copying files with unknown length -Your password for rclone (generate one at your service's settings page). + You will need this much free space in the share as the file will be this size temporarily. -NB Input to this must be obscured - see rclone obscure. -Properties: + Properties: -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: other -- Type: string -- Required: true + - Config: max_stream_size + - Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE + - Type: SizeSuffix + - Default: 10Gi -Advanced options + #### --azurefiles-encoding -Here are the Advanced options specific to koofr (Koofr, Digi Storage and -other Koofr-compatible storage providers). + The encoding for the backend. ---koofr-mountid + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Mount ID of the mount to use. + Properties: -If omitted, the primary mount is used. + - Config: encoding + - Env Var: RCLONE_AZUREFILES_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot -Properties: -- Config: mountid -- Env Var: RCLONE_KOOFR_MOUNTID -- Type: string -- Required: false ---koofr-setmtime + ### Custom upload headers -Does the backend support setting modification time. + You can set custom upload headers with the `--header-upload` flag. -Set this to false if you use a mount ID that points to a Dropbox or -Amazon Drive backend. + - Cache-Control + - Content-Disposition + - Content-Encoding + - Content-Language + - Content-Type -Properties: + Eg `--header-upload "Content-Type: text/potato"` -- Config: setmtime -- Env Var: RCLONE_KOOFR_SETMTIME -- Type: bool -- Default: true + ## Limitations ---koofr-encoding + MD5 sums are only uploaded with chunked files if the source has an MD5 + sum. This will always be the case for a local to azure copy. -The encoding for the backend. + # Microsoft OneDrive -See the encoding section in the overview for more info. + Paths are specified as `remote:path` -Properties: + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -- Config: encoding -- Env Var: RCLONE_KOOFR_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + ## Configuration -Limitations + The initial setup for OneDrive involves getting a token from + Microsoft which you need to do in your browser. `rclone config` walks + you through it. -Note that Koofr is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + Here is an example of how to make a remote called `remote`. First run: -Providers + rclone config -Koofr + This will guide you through an interactive setup process: -This is the original Koofr storage provider used as main example and -described in the configuration section above. +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> n name> remote Type of storage to + configure. Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value [snip] XX / + Microsoft OneDrive  "onedrive" [snip] Storage> onedrive Microsoft + App Client Id Leave blank normally. Enter a string value. Press + Enter for the default (""). client_id> Microsoft App Client Secret + Leave blank normally. Enter a string value. Press Enter for the + default (""). client_secret> Edit advanced config? (y/n) +l) Yes +m) No y/n> n Remote config Use web browser to automatically + authenticate rclone with remote? -Digi Storage +- Say Y if the machine running rclone has a web browser you can use +- Say N if running rclone on a (remote) machine without web browser + access If not sure try Y. If Y failed, try N. -Digi Storage is a cloud storage service run by Digi.ro that provides a -Koofr API. +y) Yes +z) No y/n> y If your browser doesn't open automatically go to the + following link: http://127.0.0.1:53682/auth Log in and authorize + rclone for access Waiting for code... Got code Choose a number from + below, or type in an existing value 1 / OneDrive Personal or + Business  "onedrive" 2 / Sharepoint site  "sharepoint" 3 / Type in + driveID  "driveid" 4 / Type in SiteID  "siteid" 5 / Search a + Sharepoint site  "search" Your choice> 1 Found 1 drives, please + select the one you want to use: 0: OneDrive (business) + id=b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk Chose + drive to use:> 0 Found drive 'root' of type 'business', URL: + https://org-my.sharepoint.com/personal/you/Documents Is that okay? +a) Yes +b) No y/n> y -------------------- [remote] type = onedrive token = + {"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2018-08-26T22:39:52.486512262+08:00"} + drive_id = + b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk + drive_type = business -------------------- +c) Yes this is OK +d) Edit this remote +e) Delete this remote y/e/d> y -Here is an example of how to make a remote called ds. First run: - rclone config + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -This will guide you through an interactive setup process: + Note that rclone runs a webserver on your local machine to collect the + token as returned from Microsoft. This only runs from the moment it + opens your browser to the moment you get back the verification + code. This is on `http://127.0.0.1:53682/` and this it may require + you to unblock it temporarily if you are running a host firewall. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> ds - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - 22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) - [snip] - Storage> koofr - Option provider. - Choose your storage provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) - provider> 2 - Option user. - Your user name. - Enter a value. - user> USERNAME - Option password. - Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). - Choose an alternative below. - y) Yes, type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - Edit advanced config? - y) Yes - n) No (default) - y/n> n - -------------------- - [ds] - type = koofr - provider = digistorage - user = USERNAME - password = *** ENCRYPTED *** - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + Once configured you can then use `rclone` like this, -Other + List directories in top level of your OneDrive -You may also want to use another, public or private storage provider -that runs a Koofr API compatible service, by simply providing the base -URL to connect to. + rclone lsd remote: -Here is an example of how to make a remote called other. First run: + List all the files in your OneDrive - rclone config + rclone ls remote: -This will guide you through an interactive setup process: + To copy a local directory to an OneDrive directory called backup - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> other - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - 22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) - [snip] - Storage> koofr - Option provider. - Choose your storage provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) - provider> 3 - Option endpoint. - The Koofr API endpoint to use. - Enter a value. - endpoint> https://koofr.other.org - Option user. - Your user name. - Enter a value. - user> USERNAME - Option password. - Your password for rclone (generate one at your service's settings page). - Choose an alternative below. - y) Yes, type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - Edit advanced config? - y) Yes - n) No (default) - y/n> n - -------------------- - [other] - type = koofr - provider = other - endpoint = https://koofr.other.org - user = USERNAME - password = *** ENCRYPTED *** - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + rclone copy /home/source remote:backup -Mail.ru Cloud + ### Getting your own Client ID and Key -Mail.ru Cloud is a cloud storage provided by a Russian internet company -Mail.Ru Group. The official desktop client is Disk-O:, available on -Windows and Mac OS. + rclone uses a default Client ID when talking to OneDrive, unless a custom `client_id` is specified in the config. + The default Client ID and Key are shared by all rclone users when performing requests. -Currently it is recommended to disable 2FA on Mail.ru accounts intended -for rclone until it gets eventually implemented. + You may choose to create and use your own Client ID, in case the default one does not work well for you. + For example, you might see throttling. -Features highlights + #### Creating Client ID for OneDrive Personal -- Paths may be as deep as required, e.g. remote:directory/subdirectory -- Files have a last modified time property, directories don't -- Deleted files are by default moved to the trash -- Files and directories can be shared via public links -- Partial uploads or streaming are not supported, file size must be - known before upload -- Maximum file size is limited to 2G for a free account, unlimited for - paid accounts -- Storage keeps hash for all files and performs transparent - deduplication, the hash algorithm is a modified SHA1 -- If a particular file is already present in storage, one can quickly - submit file hash instead of long file upload (this optimization is - supported by rclone) + To create your own Client ID, please follow these steps: -Configuration + 1. Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click `New registration`. + 2. Enter a name for your app, choose account type `Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)`, select `Web` in `Redirect URI`, then type (do not copy and paste) `http://localhost:53682/` and click Register. Copy and keep the `Application (client) ID` under the app name for later use. + 3. Under `manage` select `Certificates & secrets`, click `New client secret`. Enter a description (can be anything) and set `Expires` to 24 months. Copy and keep that secret _Value_ for later use (you _won't_ be able to see this value afterwards). + 4. Under `manage` select `API permissions`, click `Add a permission` and select `Microsoft Graph` then select `delegated permissions`. + 5. Search and select the following permissions: `Files.Read`, `Files.ReadWrite`, `Files.Read.All`, `Files.ReadWrite.All`, `offline_access`, `User.Read` and `Sites.Read.All` (if custom access scopes are configured, select the permissions accordingly). Once selected click `Add permissions` at the bottom. -Here is an example of making a mailru configuration. + Now the application is complete. Run `rclone config` to create or edit a OneDrive remote. + Supply the app ID and password as Client ID and Secret, respectively. rclone will walk you through the remaining steps. -First create a Mail.ru Cloud account and choose a tariff. + The access_scopes option allows you to configure the permissions requested by rclone. + See [Microsoft Docs](https://docs.microsoft.com/en-us/graph/permissions-reference#files-permissions) for more information about the different scopes. -You will need to log in and create an app password for rclone. Rclone -will not work with your normal username and password - it will give an -error like oauth2: server response missing access_token. + The `Sites.Read.All` permission is required if you need to [search SharePoint sites when configuring the remote](https://github.com/rclone/rclone/pull/5883). However, if that permission is not assigned, you need to exclude `Sites.Read.All` from your access scopes or set `disable_site_permission` option to true in the advanced options. -- Click on your user icon in the top right -- Go to Security / "Пароль и безопасность" -- Click password for apps / "Пароли для внешних приложений" -- Add the password - give it a name - eg "rclone" -- Copy the password and use this password below - your normal login - password won't work. + #### Creating Client ID for OneDrive Business -Now run + The steps for OneDrive Personal may or may not work for OneDrive Business, depending on the security settings of the organization. + A common error is that the publisher of the App is not verified. - rclone config + You may try to [verify you account](https://docs.microsoft.com/en-us/azure/active-directory/develop/publisher-verification-overview), or try to limit the App to your organization only, as shown below. -This will guide you through an interactive setup process: + 1. Make sure to create the App with your business account. + 2. Follow the steps above to create an App. However, we need a different account type here: `Accounts in this organizational directory only (*** - Single tenant)`. Note that you can also change the account type after creating the App. + 3. Find the [tenant ID](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant) of your organization. + 4. In the rclone config, set `auth_url` to `https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/authorize`. + 5. In the rclone config, set `token_url` to `https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token`. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Mail.ru Cloud - \ "mailru" - [snip] - Storage> mailru - User name (usually email) - Enter a string value. Press Enter for the default (""). - user> username@mail.ru - Password + Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). - This must be an app password - rclone will not work with your normal - password. See the Configuration section in the docs for how to make an - app password. - y) Yes type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - Skip full upload if there is another file with same data hash. - This feature is called "speedup" or "put by hash". It is especially efficient - in case of generally available files like popular books, video or audio clips - [snip] - Enter a boolean value (true or false). Press Enter for the default ("true"). - Choose a number from below, or type in your own value - 1 / Enable - \ "true" - 2 / Disable - \ "false" - speedup_enable> 1 - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - -------------------- - [remote] - type = mailru - user = username@mail.ru - pass = *** ENCRYPTED *** - speedup_enable = true - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y -Configuration of this backend does not require a local web browser. You -can use the configured backend as shown below: + ### Modification times and hashes -See top level directories + OneDrive allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. - rclone lsd remote: + OneDrive Personal, OneDrive for Business and Sharepoint Server support + [QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash). -Make a new directory + Before rclone 1.62 the default hash for Onedrive Personal was `SHA1`. + For rclone 1.62 and above the default for all Onedrive backends is + `QuickXorHash`. - rclone mkdir remote:directory + Starting from July 2023 `SHA1` support is being phased out in Onedrive + Personal in favour of `QuickXorHash`. If necessary the + `--onedrive-hash-type` flag (or `hash_type` config option) can be used + to select `SHA1` during the transition period if this is important + your workflow. -List the contents of a directory + For all types of OneDrive you can use the `--checksum` flag. - rclone ls remote:directory + ### --fast-list -Sync /home/local/directory to the remote path, deleting any excess files -in the path. + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. - rclone sync --interactive /home/local/directory remote:directory + This must be enabled with the `--onedrive-delta` flag (or `delta = + true` in the config file) as it can cause performance degradation. -Modified time + It does this by using the delta listing facilities of OneDrive which + returns all the files in the remote very efficiently. This is much + more efficient than listing directories recursively and is Microsoft's + recommended way of reading all the file information from a drive. -Files support a modification time attribute with up to 1 second -precision. Directories do not have a modification time, which is shown -as "Jan 1 1970". + This can be useful with `rclone mount` and [rclone rc vfs/refresh + recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with + information about all the files. -Hash checksums + The API used for the recursive listing (`ListR`) only supports listing + from the root of the drive. This will become increasingly inefficient + the further away you get from the root as rclone will have to discard + files outside of the directory you are using. -Hash sums use a custom Mail.ru algorithm based on SHA1. If file size is -less than or equal to the SHA1 block size (20 bytes), its hash is simply -its data right-padded with zero bytes. Hash sum of a larger file is -computed as a SHA1 sum of the file data bytes concatenated with a -decimal representation of the data length. + Some commands (like `rclone lsf -R`) will use `ListR` by default - you + can turn this off with `--disable ListR` if you need to. -Emptying Trash + ### Restricted filename characters -Removing a file or directory actually moves it to the trash, which is -not visible to rclone but can be seen in a web browser. The trashed file -still occupies part of total quota. If you wish to empty your trash and -free some quota, you can use the rclone cleanup remote: command, which -will permanently delete all your trashed files. This command does not -take any path arguments. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -Quota information + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \ | 0x5C | \ | + | \| | 0x7C | | | -To view your current quota you can use the rclone about remote: command -which will display your usage limit (quota) and the current usage. + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: -Restricted filename characters + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | + | . | 0x2E | . | -In addition to the default restricted characters set the following -characters are also replaced: + File names can also not begin with the following characters. + These only get replaced if they are the first character in the name: - Character Value Replacement - ----------- ------- ------------- - " 0x22 " - * 0x2A * - : 0x3A : - < 0x3C < - > 0x3E > - ? 0x3F ? - \ 0x5C \ - | 0x7C | + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | + | ~ | 0x7E | ~ | -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Standard options + ### Deleting files -Here are the Standard options specific to mailru (Mail.ru Cloud). + Any files you delete with rclone will end up in the trash. Microsoft + doesn't provide an API to permanently delete files, nor to empty the + trash, so you will have to do that with one of Microsoft's apps or via + the OneDrive website. ---mailru-user -User name (usually email). + ### Standard options -Properties: + Here are the Standard options specific to onedrive (Microsoft OneDrive). -- Config: user -- Env Var: RCLONE_MAILRU_USER -- Type: string -- Required: true + #### --onedrive-client-id ---mailru-pass + OAuth Client Id. -Password. + Leave blank normally. -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. + Properties: -NB Input to this must be obscured - see rclone obscure. + - Config: client_id + - Env Var: RCLONE_ONEDRIVE_CLIENT_ID + - Type: string + - Required: false -Properties: + #### --onedrive-client-secret -- Config: pass -- Env Var: RCLONE_MAILRU_PASS -- Type: string -- Required: true + OAuth Client Secret. ---mailru-speedup-enable + Leave blank normally. -Skip full upload if there is another file with same data hash. + Properties: -This feature is called "speedup" or "put by hash". It is especially -efficient in case of generally available files like popular books, video -or audio clips, because files are searched by hash in all accounts of -all mailru users. It is meaningless and ineffective if source file is -unique or encrypted. Please note that rclone may need local memory and -disk space to calculate content hash in advance and decide whether full -upload is required. Also, if rclone does not know file size in advance -(e.g. in case of streaming or partial uploads), it will not even try -this optimization. + - Config: client_secret + - Env Var: RCLONE_ONEDRIVE_CLIENT_SECRET + - Type: string + - Required: false -Properties: + #### --onedrive-region -- Config: speedup_enable -- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE -- Type: bool -- Default: true -- Examples: - - "true" - - Enable - - "false" - - Disable + Choose national cloud region for OneDrive. -Advanced options + Properties: -Here are the Advanced options specific to mailru (Mail.ru Cloud). + - Config: region + - Env Var: RCLONE_ONEDRIVE_REGION + - Type: string + - Default: "global" + - Examples: + - "global" + - Microsoft Cloud Global + - "us" + - Microsoft Cloud for US Government + - "de" + - Microsoft Cloud Germany + - "cn" + - Azure and Office 365 operated by Vnet Group in China ---mailru-speedup-file-patterns + ### Advanced options -Comma separated list of file name patterns eligible for speedup (put by -hash). + Here are the Advanced options specific to onedrive (Microsoft OneDrive). -Patterns are case insensitive and can contain '*' or '?' meta -characters. + #### --onedrive-token -Properties: + OAuth Access Token as a JSON blob. -- Config: speedup_file_patterns -- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS -- Type: string -- Default: ".mkv,.avi,.mp4,.mp3,.zip,.gz,.rar,.pdf" -- Examples: - - "" - - Empty list completely disables speedup (put by hash). - - "*" - - All files will be attempted for speedup. - - ".mkv,.avi,.mp4,.mp3" - - Only common audio/video files will be tried for put by hash. - - ".zip,.gz,.rar,.pdf" - - Only common archives or PDF books will be tried for speedup. + Properties: ---mailru-speedup-max-disk + - Config: token + - Env Var: RCLONE_ONEDRIVE_TOKEN + - Type: string + - Required: false -This option allows you to disable speedup (put by hash) for large files. + #### --onedrive-auth-url -Reason is that preliminary hashing can exhaust your RAM or disk space. + Auth server URL. -Properties: + Leave blank to use the provider defaults. -- Config: speedup_max_disk -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK -- Type: SizeSuffix -- Default: 3Gi -- Examples: - - "0" - - Completely disable speedup (put by hash). - - "1G" - - Files larger than 1Gb will be uploaded directly. - - "3G" - - Choose this option if you have less than 3Gb free on local - disk. + Properties: ---mailru-speedup-max-memory + - Config: auth_url + - Env Var: RCLONE_ONEDRIVE_AUTH_URL + - Type: string + - Required: false -Files larger than the size given below will always be hashed on disk. + #### --onedrive-token-url -Properties: + Token server url. -- Config: speedup_max_memory -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY -- Type: SizeSuffix -- Default: 32Mi -- Examples: - - "0" - - Preliminary hashing will always be done in a temporary disk - location. - - "32M" - - Do not dedicate more than 32Mb RAM for preliminary hashing. - - "256M" - - You have at most 256Mb RAM free for hash calculations. + Leave blank to use the provider defaults. ---mailru-check-hash + Properties: -What should copy do if file checksum is mismatched or invalid. + - Config: token_url + - Env Var: RCLONE_ONEDRIVE_TOKEN_URL + - Type: string + - Required: false -Properties: + #### --onedrive-chunk-size -- Config: check_hash -- Env Var: RCLONE_MAILRU_CHECK_HASH -- Type: bool -- Default: true -- Examples: - - "true" - - Fail with error. - - "false" - - Ignore and continue. + Chunk size to upload files with - must be multiple of 320k (327,680 bytes). ---mailru-user-agent + Above this size files will be chunked - must be multiple of 320k (327,680 bytes) and + should not exceed 250M (262,144,000 bytes) else you may encounter \"Microsoft.SharePoint.Client.InvalidClientQueryException: The request message is too big.\" + Note that the chunks will be buffered into memory. -HTTP user agent used internally by client. + Properties: -Defaults to "rclone/VERSION" or "--user-agent" provided on command line. + - Config: chunk_size + - Env Var: RCLONE_ONEDRIVE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 10Mi -Properties: + #### --onedrive-drive-id -- Config: user_agent -- Env Var: RCLONE_MAILRU_USER_AGENT -- Type: string -- Required: false + The ID of the drive to use. ---mailru-quirks + Properties: -Comma separated list of internal maintenance flags. + - Config: drive_id + - Env Var: RCLONE_ONEDRIVE_DRIVE_ID + - Type: string + - Required: false -This option must not be used by an ordinary user. It is intended only to -facilitate remote troubleshooting of backend issues. Strict meaning of -flags is not documented and not guaranteed to persist between releases. -Quirks will be removed when the backend grows stable. Supported quirks: -atomicmkdir binlist unknowndirs + #### --onedrive-drive-type -Properties: + The type of the drive (personal | business | documentLibrary). -- Config: quirks -- Env Var: RCLONE_MAILRU_QUIRKS -- Type: string -- Required: false + Properties: ---mailru-encoding + - Config: drive_type + - Env Var: RCLONE_ONEDRIVE_DRIVE_TYPE + - Type: string + - Required: false -The encoding for the backend. + #### --onedrive-root-folder-id -See the encoding section in the overview for more info. + ID of the root folder. -Properties: + This isn't normally needed, but in special circumstances you might + know the folder ID that you wish to access but not be able to get + there through a path traversal. -- Config: encoding -- Env Var: RCLONE_MAILRU_ENCODING -- Type: MultiEncoder -- Default: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot -Limitations + Properties: -File size limits depend on your account. A single file size is limited -by 2G for a free account and unlimited for paid tariffs. Please refer to -the Mail.ru site for the total uploaded size limits. + - Config: root_folder_id + - Env Var: RCLONE_ONEDRIVE_ROOT_FOLDER_ID + - Type: string + - Required: false -Note that Mailru is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + #### --onedrive-access-scopes -Mega + Set scopes to be requested by rclone. -Mega is a cloud storage and file hosting service known for its security -feature where all files are encrypted locally before they are uploaded. -This prevents anyone (including employees of Mega) from accessing the -files without knowledge of the key used for encryption. + Choose or manually enter a custom space separated list with all scopes, that rclone should request. -This is an rclone backend for Mega which supports the file transfer -features of Mega using the same client side encryption. -Paths are specified as remote:path + Properties: -Paths may be as deep as required, e.g. remote:directory/subdirectory. + - Config: access_scopes + - Env Var: RCLONE_ONEDRIVE_ACCESS_SCOPES + - Type: SpaceSepList + - Default: Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access + - Examples: + - "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access" + - Read and write access to all resources + - "Files.Read Files.Read.All Sites.Read.All offline_access" + - Read only access to all resources + - "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All offline_access" + - Read and write access to all resources, without the ability to browse SharePoint sites. + - Same as if disable_site_permission was set to true -Configuration + #### --onedrive-disable-site-permission -Here is an example of how to make a remote called remote. First run: + Disable the request for Sites.Read.All permission. - rclone config + If set to true, you will no longer be able to search for a SharePoint site when + configuring drive ID, because rclone will not request Sites.Read.All permission. + Set it to true if your organization didn't assign Sites.Read.All permission to the + application, and your organization disallows users to consent app permission + request on their own. -This will guide you through an interactive setup process: + Properties: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Mega - \ "mega" - [snip] - Storage> mega - User name - user> you@example.com - Password. - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank - y/g/n> y - Enter the password: - password: - Confirm the password: - password: - Remote config - -------------------- - [remote] - type = mega - user = you@example.com - pass = *** ENCRYPTED *** - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + - Config: disable_site_permission + - Env Var: RCLONE_ONEDRIVE_DISABLE_SITE_PERMISSION + - Type: bool + - Default: false -NOTE: The encryption keys need to have been already generated after a -regular login via the browser, otherwise attempting to use the -credentials in rclone will fail. + #### --onedrive-expose-onenote-files -Once configured you can then use rclone like this, + Set to make OneNote files show up in directory listings. -List directories in top level of your Mega + By default, rclone will hide OneNote files in directory listings because + operations like "Open" and "Update" won't work on them. But this + behaviour may also prevent you from deleting them. If you want to + delete OneNote files or otherwise want them to show up in directory + listing, set this option. - rclone lsd remote: + Properties: -List all the files in your Mega + - Config: expose_onenote_files + - Env Var: RCLONE_ONEDRIVE_EXPOSE_ONENOTE_FILES + - Type: bool + - Default: false - rclone ls remote: + #### --onedrive-server-side-across-configs -To copy a local directory to an Mega directory called backup + Deprecated: use --server-side-across-configs instead. - rclone copy /home/source remote:backup + Allow server-side operations (e.g. copy) to work across different onedrive configs. -Modified time and hashes + This will only work if you are copying between two OneDrive *Personal* drives AND + the files to copy are already shared between them. In other cases, rclone will + fall back to normal copy (which will be slightly slower). -Mega does not support modification times or hashes yet. + Properties: -Restricted filename characters + - Config: server_side_across_configs + - Env Var: RCLONE_ONEDRIVE_SERVER_SIDE_ACROSS_CONFIGS + - Type: bool + - Default: false - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - / 0x2F / + #### --onedrive-list-chunk -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Size of listing chunk. -Duplicated files + Properties: -Mega can have two files with exactly the same name and path (unlike a -normal file system). + - Config: list_chunk + - Env Var: RCLONE_ONEDRIVE_LIST_CHUNK + - Type: int + - Default: 1000 -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. + #### --onedrive-no-versions -Use rclone dedupe to fix duplicated files. + Remove all versions on modifying operations. -Failure to log-in + Onedrive for business creates versions when rclone uploads new files + overwriting an existing one and when it sets the modification time. -Object not found + These versions take up space out of the quota. -If you are connecting to your Mega remote for the first time, to test -access and synchronization, you may receive an error such as + This flag checks for versions after file upload and setting + modification time and removes all but the last version. - Failed to create file system for "my-mega-remote:": - couldn't login: Object (typically, node or user) not found + **NB** Onedrive personal can't currently delete versions so don't use + this flag there. -The diagnostic steps often recommended in the rclone forum start with -the MEGAcmd utility. Note that this refers to the official C++ command -from https://github.com/meganz/MEGAcmd and not the go language built -command from t3rm1n4l/megacmd that is no longer maintained. -Follow the instructions for installing MEGAcmd and try accessing your -remote as they recommend. You can establish whether or not you can log -in using MEGAcmd, and obtain diagnostic information to help you, and -search or work with others in the forum. + Properties: - MEGA CMD> login me@example.com - Password: - Fetching nodes ... - Loading transfers from local cache - Login complete as me@example.com - me@example.com:/$ + - Config: no_versions + - Env Var: RCLONE_ONEDRIVE_NO_VERSIONS + - Type: bool + - Default: false -Note that some have found issues with passwords containing special -characters. If you can not log on with rclone, but MEGAcmd logs on just -fine, then consider changing your password temporarily to pure -alphanumeric characters, in case that helps. + #### --onedrive-link-scope -Repeated commands blocks access + Set the scope of the links created by the link command. -Mega remotes seem to get blocked (reject logins) under "heavy use". We -haven't worked out the exact blocking rules but it seems to be related -to fast paced, successive rclone commands. + Properties: -For example, executing this command 90 times in a row -rclone link remote:file will cause the remote to become "blocked". This -is not an abnormal situation, for example if you wish to get the public -links of a directory with hundred of files... After more or less a week, -the remote will remote accept rclone logins normally again. + - Config: link_scope + - Env Var: RCLONE_ONEDRIVE_LINK_SCOPE + - Type: string + - Default: "anonymous" + - Examples: + - "anonymous" + - Anyone with the link has access, without needing to sign in. + - This may include people outside of your organization. + - Anonymous link support may be disabled by an administrator. + - "organization" + - Anyone signed into your organization (tenant) can use the link to get access. + - Only available in OneDrive for Business and SharePoint. -You can mitigate this issue by mounting the remote it with rclone mount. -This will log-in when mounting and a log-out when unmounting only. You -can also run rclone rcd and then use rclone rc to run the commands over -the API to avoid logging in each time. + #### --onedrive-link-type -Rclone does not currently close mega sessions (you can see them in the -web interface), however closing the sessions does not solve the issue. + Set the type of the links created by the link command. -If you space rclone commands by 3 seconds it will avoid blocking the -remote. We haven't identified the exact blocking rules, so perhaps one -could execute the command 80 times without waiting and avoid blocking by -waiting 3 seconds, then continuing... + Properties: -Note that this has been observed by trial and error and might not be set -in stone. + - Config: link_type + - Env Var: RCLONE_ONEDRIVE_LINK_TYPE + - Type: string + - Default: "view" + - Examples: + - "view" + - Creates a read-only link to the item. + - "edit" + - Creates a read-write link to the item. + - "embed" + - Creates an embeddable link to the item. -Other tools seem not to produce this blocking effect, as they use a -different working approach (state-based, using sessionIDs instead of -log-in) which isn't compatible with the current stateless rclone -approach. + #### --onedrive-link-password -Note that once blocked, the use of other tools (such as megacmd) is not -a sure workaround: following megacmd login times have been observed in -succession for blocked remote: 7 minutes, 20 min, 30min, 30 min, 30min. -Web access looks unaffected though. + Set the password for links created by the link command. -Investigation is continuing in relation to workarounds based on -timeouts, pacers, retrials and tpslimits - if you discover something -relevant, please post on the forum. + At the time of writing this only works with OneDrive personal paid accounts. -So, if rclone was working nicely and suddenly you are unable to log-in -and you are sure the user and the password are correct, likely you have -got the remote blocked for a while. -Standard options + Properties: -Here are the Standard options specific to mega (Mega). + - Config: link_password + - Env Var: RCLONE_ONEDRIVE_LINK_PASSWORD + - Type: string + - Required: false ---mega-user + #### --onedrive-hash-type -User name. + Specify the hash in use for the backend. -Properties: + This specifies the hash type in use. If set to "auto" it will use the + default hash which is QuickXorHash. -- Config: user -- Env Var: RCLONE_MEGA_USER -- Type: string -- Required: true + Before rclone 1.62 an SHA1 hash was used by default for Onedrive + Personal. For 1.62 and later the default is to use a QuickXorHash for + all onedrive types. If an SHA1 hash is desired then set this option + accordingly. ---mega-pass + From July 2023 QuickXorHash will be the only available hash for + both OneDrive for Business and OneDriver Personal. -Password. + This can be set to "none" to not use any hashes. -NB Input to this must be obscured - see rclone obscure. + If the hash requested does not exist on the object, it will be + returned as an empty string which is treated as a missing hash by + rclone. -Properties: -- Config: pass -- Env Var: RCLONE_MEGA_PASS -- Type: string -- Required: true + Properties: -Advanced options + - Config: hash_type + - Env Var: RCLONE_ONEDRIVE_HASH_TYPE + - Type: string + - Default: "auto" + - Examples: + - "auto" + - Rclone chooses the best hash + - "quickxor" + - QuickXor + - "sha1" + - SHA1 + - "sha256" + - SHA256 + - "crc32" + - CRC32 + - "none" + - None - don't use any hashes -Here are the Advanced options specific to mega (Mega). + #### --onedrive-av-override ---mega-debug + Allows download of files the server thinks has a virus. -Output more debug from Mega. + The onedrive/sharepoint server may check files uploaded with an Anti + Virus checker. If it detects any potential viruses or malware it will + block download of the file. -If this flag is set (along with -vv) it will print further debugging -information from the mega backend. + In this case you will see a message like this -Properties: + server reports this file is infected with a virus - use --onedrive-av-override to download anyway: Infected (name of virus): 403 Forbidden: -- Config: debug -- Env Var: RCLONE_MEGA_DEBUG -- Type: bool -- Default: false + If you are 100% sure you want to download this file anyway then use + the --onedrive-av-override flag, or av_override = true in the config + file. ---mega-hard-delete -Delete files permanently rather than putting them into the trash. + Properties: -Normally the mega backend will put all deletions into the trash rather -than permanently deleting them. If you specify this then rclone will -permanently delete objects instead. + - Config: av_override + - Env Var: RCLONE_ONEDRIVE_AV_OVERRIDE + - Type: bool + - Default: false -Properties: + #### --onedrive-delta -- Config: hard_delete -- Env Var: RCLONE_MEGA_HARD_DELETE -- Type: bool -- Default: false + If set rclone will use delta listing to implement recursive listings. ---mega-use-https + If this flag is set the the onedrive backend will advertise `ListR` + support for recursive listings. -Use HTTPS for transfers. + Setting this flag speeds up these things greatly: -MEGA uses plain text HTTP connections by default. Some ISPs throttle -HTTP connections, this causes transfers to become very slow. Enabling -this will force MEGA to use HTTPS for all transfers. HTTPS is normally -not necesary since all data is already encrypted anyway. Enabling it -will increase CPU usage and add network overhead. + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true -Properties: + **However** the delta listing API **only** works at the root of the + drive. If you use it not at the root then it recurses from the root + and discards all the data that is not under the directory you asked + for. So it will be correct but may not be very efficient. -- Config: use_https -- Env Var: RCLONE_MEGA_USE_HTTPS -- Type: bool -- Default: false + This is why this flag is not set as the default. ---mega-encoding + As a rule of thumb if nearly all of your data is under rclone's root + directory (the `root/directory` in `onedrive:root/directory`) then + using this flag will be be a big performance win. If your data is + mostly not under the root then using this flag will be a big + performance loss. -The encoding for the backend. + It is recommended if you are mounting your onedrive at the root + (or near the root when using crypt) and using rclone `rc vfs/refresh`. -See the encoding section in the overview for more info. -Properties: + Properties: -- Config: encoding -- Env Var: RCLONE_MEGA_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot + - Config: delta + - Env Var: RCLONE_ONEDRIVE_DELTA + - Type: bool + - Default: false -Limitations + #### --onedrive-encoding -This backend uses the go-mega go library which is an opensource go -library implementing the Mega API. There doesn't appear to be any -documentation for the mega protocol beyond the mega C++ SDK source code -so there are likely quite a few errors still remaining in this library. + The encoding for the backend. -Mega allows duplicate files which may confuse rclone. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Memory + Properties: -The memory backend is an in RAM backend. It does not persist its data - -use the local backend for that. + - Config: encoding + - Env Var: RCLONE_ONEDRIVE_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot -The memory backend behaves like a bucket-based remote (e.g. like s3). -Because it has no parameters you can just use it with the :memory: -remote name. -Configuration -You can configure it as a remote like this with rclone config too if you -want to: + ## Limitations - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Memory - \ "memory" - [snip] - Storage> memory - ** See help for memory backend at: https://rclone.org/memory/ ** + If you don't use rclone for 90 days the refresh token will + expire. This will result in authorization problems. This is easy to + fix by running the `rclone config reconnect remote:` command to get a + new token and refresh token. - Remote config + ### Naming - -------------------- - [remote] - type = memory - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + Note that OneDrive is case insensitive so you can't have a + file called "Hello.doc" and one called "hello.doc". -Because the memory backend isn't persistent it is most useful for -testing or with an rclone server or rclone mount, e.g. + There are quite a few characters that can't be in OneDrive file + names. These can't occur on Windows platforms, but on non-Windows + platforms they are common. Rclone will map these names to and from an + identical looking unicode equivalent. For example if a file has a `?` + in it will be mapped to `?` instead. - rclone mount :memory: /mnt/tmp - rclone serve webdav :memory: - rclone serve sftp :memory: + ### File sizes -Modified time and hashes + The largest allowed file size is 250 GiB for both OneDrive Personal and OneDrive for Business [(Updated 13 Jan 2021)](https://support.microsoft.com/en-us/office/invalid-file-names-and-file-types-in-onedrive-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa?ui=en-us&rs=en-us&ad=us#individualfilesize). -The memory backend supports MD5 hashes and modification times accurate -to 1 nS. + ### Path length -Restricted filename characters + The entire path, including the file name, must contain fewer than 400 characters for OneDrive, OneDrive for Business and SharePoint Online. If you are encrypting file and folder names with rclone, you may want to pay attention to this limitation because the encrypted names are typically longer than the original ones. -The memory backend replaces the default restricted characters set. + ### Number of files -Akamai NetStorage + OneDrive seems to be OK with at least 50,000 files in a folder, but at + 100,000 rclone will get errors listing the directory like `couldn’t + list files: UnknownError:`. See + [#2707](https://github.com/rclone/rclone/issues/2707) for more info. -Paths are specified as remote: You may put subdirectories in too, e.g. -remote:/path/to/dir. If you have a CP code you can use that as the -folder after the domain such as //. + An official document about the limitations for different types of OneDrive can be found [here](https://support.office.com/en-us/article/invalid-file-names-and-file-types-in-onedrive-onedrive-for-business-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa). -For example, this is commonly configured with or without a CP code: * -With a CP code. -[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/ * Without a -CP code. [your-domain-prefix]-nsu.akamaihd.net + ## Versions -See all buckets rclone lsd remote: The initial setup for Netstorage -involves getting an account and secret. Use rclone config to walk you -through the setup process. + Every change in a file OneDrive causes the service to create a new + version of the file. This counts against a users quota. For + example changing the modification time of a file creates a second + version, so the file apparently uses twice the space. -Configuration + For example the `copy` command is affected by this as rclone copies + the file and then afterwards sets the modification time to match the + source file which uses another version. -Here's an example of how to make a remote called ns1. + You can use the `rclone cleanup` command (see below) to remove all old + versions. -1. To begin the interactive configuration process, enter this command: + Or you can set the `no_versions` parameter to `true` and rclone will + remove versions after operations which create new versions. This takes + extra transactions so only enable it if you need it. - rclone config + **Note** At the time of writing Onedrive Personal creates versions + (but not for setting the modification time) but the API for removing + them returns "API not found" so cleanup and `no_versions` should not + be used on Onedrive Personal. -2. Type n to create a new remote. + ### Disabling versioning - n) New remote - d) Delete remote - q) Quit config - e/n/d/q> n + Starting October 2018, users will no longer be able to + disable versioning by default. This is because Microsoft has brought + an + [update](https://techcommunity.microsoft.com/t5/Microsoft-OneDrive-Blog/New-Updates-to-OneDrive-and-SharePoint-Team-Site-Versioning/ba-p/204390) + to the mechanism. To change this new default setting, a PowerShell + command is required to be run by a SharePoint admin. If you are an + admin, you can run these commands in PowerShell to change that + setting: -3. For this example, enter ns1 when you reach the name> prompt. + 1. `Install-Module -Name Microsoft.Online.SharePoint.PowerShell` (in case you haven't installed this already) + 2. `Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking` + 3. `Connect-SPOService -Url https://YOURSITE-admin.sharepoint.com -Credential YOU@YOURSITE.COM` (replacing `YOURSITE`, `YOU`, `YOURSITE.COM` with the actual values; this will prompt for your credentials) + 4. `Set-SPOTenant -EnableMinimumVersionRequirement $False` + 5. `Disconnect-SPOService` (to disconnect from the server) - name> ns1 + *Below are the steps for normal users to disable versioning. If you don't see the "No Versioning" option, make sure the above requirements are met.* -4. Enter netstorage as the type of storage to configure. + User [Weropol](https://github.com/Weropol) has found a method to disable + versioning on OneDrive - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - XX / NetStorage - \ "netstorage" - Storage> netstorage + 1. Open the settings menu by clicking on the gear symbol at the top of the OneDrive Business page. + 2. Click Site settings. + 3. Once on the Site settings page, navigate to Site Administration > Site libraries and lists. + 4. Click Customize "Documents". + 5. Click General Settings > Versioning Settings. + 6. Under Document Version History select the option No versioning. + Note: This will disable the creation of new file versions, but will not remove any previous versions. Your documents are safe. + 7. Apply the changes by clicking OK. + 8. Use rclone to upload or modify files. (I also use the --no-update-modtime flag) + 9. Restore the versioning settings after using rclone. (Optional) -5. Select between the HTTP or HTTPS protocol. Most users should choose - HTTPS, which is the default. HTTP is provided primarily for - debugging purposes. + ## Cleanup - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / HTTP protocol - \ "http" - 2 / HTTPS protocol - \ "https" - protocol> 1 + OneDrive supports `rclone cleanup` which causes rclone to look through + every file under the path supplied and delete all version but the + current version. Because this involves traversing all the files, then + querying each file for versions it can be quite slow. Rclone does + `--checkers` tests in parallel. The command also supports `--interactive`/`i` + or `--dry-run` which is a great way to see what it would do. -6. Specify your NetStorage host, CP code, and any necessary content - paths using this format: /// + rclone cleanup --interactive remote:path/subdir # interactively remove all old version for path/subdir + rclone cleanup remote:path/subdir # unconditionally remove all old version for path/subdir - Enter a string value. Press Enter for the default (""). - host> baseball-nsu.akamaihd.net/123456/content/ + **NB** Onedrive personal can't currently delete versions -7. Set the netstorage account name + ## Troubleshooting ## - Enter a string value. Press Enter for the default (""). - account> username + ### Excessive throttling or blocked on SharePoint -8. Set the Netstorage account secret/G2O key which will be used for - authentication purposes. Select the y option to set your own - password then enter your secret. Note: The secret is stored in the - rclone.conf file with hex-encoded encryption. + If you experience excessive throttling or is being blocked on SharePoint then it may help to set the user agent explicitly with a flag like this: `--user-agent "ISV|rclone.org|rclone/v1.55.1"` - y) Yes type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: + The specific details can be found in the Microsoft document: [Avoid getting throttled or blocked in SharePoint Online](https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#how-to-decorate-your-http-traffic-to-avoid-throttling) -9. View the summary and confirm your remote configuration. + ### Unexpected file size/hash differences on Sharepoint #### - [ns1] - type = netstorage - protocol = http - host = baseball-nsu.akamaihd.net/123456/content/ - account = username - secret = *** ENCRYPTED *** - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + It is a + [known](https://github.com/OneDrive/onedrive-api-docs/issues/935#issuecomment-441741631) + issue that Sharepoint (not OneDrive or OneDrive for Business) silently modifies + uploaded files, mainly Office files (.docx, .xlsx, etc.), causing file size and + hash checks to fail. There are also other situations that will cause OneDrive to + report inconsistent file sizes. To use rclone with such + affected files on Sharepoint, you + may disable these checks with the following command line arguments: -This remote is called ns1 and can now be used. +--ignore-checksum --ignore-size -Example operations -Get started with rclone and NetStorage with these examples. For -additional rclone commands, visit https://rclone.org/commands/. + Alternatively, if you have write access to the OneDrive files, it may be possible + to fix this problem for certain files, by attempting the steps below. + Open the web interface for [OneDrive](https://onedrive.live.com) and find the + affected files (which will be in the error messages/log for rclone). Simply click on + each of these files, causing OneDrive to open them on the web. This will cause each + file to be converted in place to a format that is functionally equivalent + but which will no longer trigger the size discrepancy. Once all problematic files + are converted you will no longer need the ignore options above. -See contents of a directory in your project + ### Replacing/deleting existing files on Sharepoint gets "item not found" #### - rclone lsd ns1:/974012/testing/ + It is a [known](https://github.com/OneDrive/onedrive-api-docs/issues/1068) issue + that Sharepoint (not OneDrive or OneDrive for Business) may return "item not + found" errors when users try to replace or delete uploaded files; this seems to + mainly affect Office files (.docx, .xlsx, etc.) and web files (.html, .aspx, etc.). As a workaround, you may use + the `--backup-dir ` command line argument so rclone moves the + files to be replaced/deleted into a given backup directory (instead of directly + replacing/deleting them). For example, to instruct rclone to move the files into + the directory `rclone-backup-dir` on backend `mysharepoint`, you may use: -Sync the contents local with remote +--backup-dir mysharepoint:rclone-backup-dir - rclone sync . ns1:/974012/testing/ -Upload local content to remote + ### access\_denied (AADSTS65005) #### - rclone copy notes.txt ns1:/974012/testing/ +Error: access_denied Code: AADSTS65005 Description: Using application +'rclone' is currently not supported for your organization +[YOUR_ORGANIZATION] because it is in an unmanaged state. An +administrator needs to claim ownership of the company by DNS validation +of [YOUR_ORGANIZATION] before the application rclone can be provisioned. -Delete content on remote - rclone delete ns1:/974012/testing/notes.txt + This means that rclone can't use the OneDrive for Business API with your account. You can't do much about it, maybe write an email to your admins. -Move or copy content between CP codes. + However, there are other ways to interact with your OneDrive account. Have a look at the WebDAV backend: https://rclone.org/webdav/#sharepoint -Your credentials must have access to two CP codes on the same remote. -You can't perform operations between different remotes. + ### invalid\_grant (AADSTS50076) #### - rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ +Error: invalid_grant Code: AADSTS50076 Description: Due to a +configuration change made by your administrator, or because you moved to +a new location, you must use multi-factor authentication to access +'...'. -Features -Symlink Support - -The Netstorage backend changes the rclone --links, -l behavior. When -uploading, instead of creating the .rclonelink file, use the "symlink" -API in order to create the corresponding symlink on the remote. The -.rclonelink file will not be created, the upload will be intercepted and -only the symlink file that matches the source file name with no suffix -will be created on the remote. - -This will effectively allow commands like copy/copyto, move/moveto and -sync to upload from local to remote and download from remote to local -directories with symlinks. Due to internal rclone limitations, it is not -possible to upload an individual symlink file to any remote backend. You -can always use the "backend symlink" command to create a symlink on the -NetStorage server, refer to "symlink" section below. - -Individual symlink files on the remote can be used with the commands -like "cat" to print the destination name, or "delete" to delete symlink, -or copy, copy/to and move/moveto to download from the remote to local. -Note: individual symlink files on the remote should be specified -including the suffix .rclonelink. - -Note: No file with the suffix .rclonelink should ever exist on the -server since it is not possible to actually upload/create a file with -.rclonelink suffix with rclone, it can only exist if it is manually -created through a non-rclone method on the remote. - -Implicit vs. Explicit Directories - -With NetStorage, directories can exist in one of two forms: - -1. Explicit Directory. This is an actual, physical directory that you - have created in a storage group. -2. Implicit Directory. This refers to a directory within a path that - has not been physically created. For example, during upload of a - file, nonexistent subdirectories can be specified in the target - path. NetStorage creates these as "implicit." While the directories - aren't physically created, they exist implicitly and the noted path - is connected with the uploaded file. - -Rclone will intercept all file uploads and mkdir commands for the -NetStorage remote and will explicitly issue the mkdir command for each -directory in the uploading path. This will help with the -interoperability with the other Akamai services such as SFTP and the -Content Management Shell (CMShell). Rclone will not guarantee -correctness of operations with implicit directories which might have -been created as a result of using an upload API directly. - ---fast-list / ListR support - -NetStorage remote supports the ListR feature by using the "list" -NetStorage API action to return a lexicographical list of all objects -within the specified CP code, recursing into subdirectories as they're -encountered. - -- Rclone will use the ListR method for some commands by default. - Commands such as lsf -R will use ListR by default. To disable this, - include the --disable listR option to use the non-recursive method - of listing objects. - -- Rclone will not use the ListR method for some commands. Commands - such as sync don't use ListR by default. To force using the ListR - method, include the --fast-list option. - -There are pros and cons of using the ListR method, refer to rclone -documentation. In general, the sync command over an existing deep tree -on the remote will run faster with the "--fast-list" flag but with extra -memory usage as a side effect. It might also result in higher CPU -utilization but the whole task can be completed faster. - -Note: There is a known limitation that "lsf -R" will display number of -files in the directory and directory size as -1 when ListR method is -used. The workaround is to pass "--disable listR" flag if these numbers -are important in the output. + If you see the error above after enabling multi-factor authentication for your account, you can fix it by refreshing your OAuth refresh token. To do that, run `rclone config`, and choose to edit your OneDrive backend. Then, you don't need to actually make any changes until you reach this question: `Already have a token - refresh?`. For this question, answer `y` and go through the process to refresh your token, just like the first time the backend is configured. After this, rclone should work again for this backend. -Purge + ### Invalid request when making public links #### -NetStorage remote supports the purge feature by using the "quick-delete" -NetStorage API action. The quick-delete action is disabled by default -for security reasons and can be enabled for the account through the -Akamai portal. Rclone will first try to use quick-delete action for the -purge command and if this functionality is disabled then will fall back -to a standard delete method. + On Sharepoint and OneDrive for Business, `rclone link` may return an "Invalid + request" error. A possible cause is that the organisation admin didn't allow + public links to be made for the organisation/sharepoint library. To fix the + permissions as an admin, take a look at the docs: + [1](https://docs.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off), + [2](https://support.microsoft.com/en-us/office/set-up-and-manage-access-requests-94b26e0b-2822-49d4-929a-8455698654b3). -Note: Read the NetStorage Usage API for considerations when using -"quick-delete". In general, using quick-delete method will not delete -the tree immediately and objects targeted for quick-delete may still be -accessible. + ### Can not access `Shared` with me files -Standard options + Shared with me files is not supported by rclone [currently](https://github.com/rclone/rclone/issues/4062), but there is a workaround: -Here are the Standard options specific to netstorage (Akamai -NetStorage). + 1. Visit [https://onedrive.live.com](https://onedrive.live.com/) + 2. Right click a item in `Shared`, then click `Add shortcut to My files` in the context + ![make_shortcut](https://user-images.githubusercontent.com/60313789/206118040-7e762b3b-aa61-41a1-8649-cc18889f3572.png "Screenshot (Shared with me)") + 3. The shortcut will appear in `My files`, you can access it with rclone, it behaves like a normal folder/file. + ![in_my_files](https://i.imgur.com/0S8H3li.png "Screenshot (My Files)") + ![rclone_mount](https://i.imgur.com/2Iq66sW.png "Screenshot (rclone mount)") ---netstorage-host + ### Live Photos uploaded from iOS (small video clips in .heic files) -Domain+path of NetStorage host to connect to. + The iOS OneDrive app introduced [upload and storage](https://techcommunity.microsoft.com/t5/microsoft-onedrive-blog/live-photos-come-to-onedrive/ba-p/1953452) + of [Live Photos](https://support.apple.com/en-gb/HT207310) in 2020. + The usage and download of these uploaded Live Photos is unfortunately still work-in-progress + and this introduces several issues when copying, synchronising and mounting – both in rclone and in the native OneDrive client on Windows. -Format should be / + The root cause can easily be seen if you locate one of your Live Photos in the OneDrive web interface. + Then download the photo from the web interface. You will then see that the size of downloaded .heic file is smaller than the size displayed in the web interface. + The downloaded file is smaller because it only contains a single frame (still photo) extracted from the Live Photo (movie) stored in OneDrive. -Properties: + The different sizes will cause `rclone copy/sync` to repeatedly recopy unmodified photos something like this: -- Config: host -- Env Var: RCLONE_NETSTORAGE_HOST -- Type: string -- Required: true + DEBUG : 20230203_123826234_iOS.heic: Sizes differ (src 4470314 vs dst 1298667) + DEBUG : 20230203_123826234_iOS.heic: sha1 = fc2edde7863b7a7c93ca6771498ac797f8460750 OK + INFO : 20230203_123826234_iOS.heic: Copied (replaced existing) ---netstorage-account + These recopies can be worked around by adding `--ignore-size`. Please note that this workaround only syncs the still-picture not the movie clip, + and relies on modification dates being correctly updated on all files in all situations. -Set the NetStorage account name + The different sizes will also cause `rclone check` to report size errors something like this: -Properties: + ERROR : 20230203_123826234_iOS.heic: sizes differ -- Config: account -- Env Var: RCLONE_NETSTORAGE_ACCOUNT -- Type: string -- Required: true + These check errors can be suppressed by adding `--ignore-size`. ---netstorage-secret + The different sizes will also cause `rclone mount` to fail downloading with an error something like this: -Set the NetStorage account secret/G2O key for authentication. + ERROR : 20230203_123826234_iOS.heic: ReadFileHandle.Read error: low level retry 1/10: unexpected EOF -Please choose the 'y' option to set your own password then enter your -secret. + or like this when using `--cache-mode=full`: -NB Input to this must be obscured - see rclone obscure. + INFO : 20230203_123826234_iOS.heic: vfs cache: downloader: error count now 1: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable: + ERROR : 20230203_123826234_iOS.heic: vfs cache: failed to download: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable: -Properties: + # OpenDrive -- Config: secret -- Env Var: RCLONE_NETSTORAGE_SECRET -- Type: string -- Required: true + Paths are specified as `remote:path` -Advanced options + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Here are the Advanced options specific to netstorage (Akamai -NetStorage). + ## Configuration ---netstorage-protocol + Here is an example of how to make a remote called `remote`. First run: -Select between HTTP or HTTPS protocol. + rclone config -Most users should choose HTTPS, which is the default. HTTP is provided -primarily for debugging purposes. + This will guide you through an interactive setup process: -Properties: +n) New remote +o) Delete remote +p) Quit config e/n/d/q> n name> remote Type of storage to configure. + Choose a number from below, or type in your own value [snip] XX / + OpenDrive  "opendrive" [snip] Storage> opendrive Username username> + Password +q) Yes type in my own password +r) Generate random password y/g> y Enter the password: password: + Confirm the password: password: -------------------- [remote] + username = password = *** ENCRYPTED *** -------------------- +s) Yes this is OK +t) Edit this remote +u) Delete this remote y/e/d> y -- Config: protocol -- Env Var: RCLONE_NETSTORAGE_PROTOCOL -- Type: string -- Default: "https" -- Examples: - - "http" - - HTTP protocol - - "https" - - HTTPS protocol -Backend commands + List directories in top level of your OpenDrive -Here are the commands specific to the netstorage backend. + rclone lsd remote: -Run them with + List all the files in your OpenDrive - rclone backend COMMAND remote: + rclone ls remote: -The help below will explain what arguments each command takes. + To copy a local directory to an OpenDrive directory called backup -See the backend command for more info on how to pass options and -arguments. + rclone copy /home/source remote:backup -These can be run on a running backend using the rc command -backend/command. + ### Modification times and hashes -du + OpenDrive allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. -Return disk usage information for a specified directory + The MD5 hash algorithm is supported. - rclone backend du remote: [options] [+] + ### Restricted filename characters -The usage information returned, includes the targeted directory as well -as all files stored in any sub-directories that may exist. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | / | 0x2F | / | + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \ | 0x5C | \ | + | \| | 0x7C | | | -symlink + File names can also not begin or end with the following characters. + These only get replaced if they are the first or last character in the name: -You can create a symbolic link in ObjectStore with the symlink action. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | + | HT | 0x09 | ␉ | + | LF | 0x0A | ␊ | + | VT | 0x0B | ␋ | + | CR | 0x0D | ␍ | - rclone backend symlink remote: [options] [+] -The desired path location (including applicable sub-directories) ending -in the object that will be the target of the symlink (for example, -/links/mylink). Include the file extension for the object, if -applicable. rclone backend symlink + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Microsoft Azure Blob Storage -Paths are specified as remote:container (or remote: for the lsd -command.) You may put subdirectories in too, e.g. -remote:container/path/to/dir. + ### Standard options -Configuration + Here are the Standard options specific to opendrive (OpenDrive). -Here is an example of making a Microsoft Azure Blob Storage -configuration. For a remote called remote. First run: + #### --opendrive-username - rclone config + Username. -This will guide you through an interactive setup process: + Properties: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Microsoft Azure Blob Storage - \ "azureblob" - [snip] - Storage> azureblob - Storage Account Name - account> account_name - Storage Account Key - key> base64encodedkey== - Endpoint for the service - leave blank normally. - endpoint> - Remote config - -------------------- - [remote] - account = account_name - key = base64encodedkey== - endpoint = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + - Config: username + - Env Var: RCLONE_OPENDRIVE_USERNAME + - Type: string + - Required: true -See all containers + #### --opendrive-password - rclone lsd remote: + Password. -Make a new container + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - rclone mkdir remote:container + Properties: -List the contents of a container + - Config: password + - Env Var: RCLONE_OPENDRIVE_PASSWORD + - Type: string + - Required: true - rclone ls remote:container + ### Advanced options -Sync /home/local/directory to the remote container, deleting any excess -files in the container. + Here are the Advanced options specific to opendrive (OpenDrive). - rclone sync --interactive /home/local/directory remote:container + #### --opendrive-encoding ---fast-list + The encoding for the backend. -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Modified time + Properties: -The modified time is stored as metadata on the object with the mtime -key. It is stored using RFC3339 Format time with nanosecond precision. -The metadata is supplied during directory listings so there is no -performance overhead to using it. + - Config: encoding + - Env Var: RCLONE_OPENDRIVE_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot -If you wish to use the Azure standard LastModified time stored on the -object as the modified time, then use the --use-server-modtime flag. -Note that rclone can't set LastModified, so using the --update flag when -syncing is recommended if using --use-server-modtime. + #### --opendrive-chunk-size -Performance + Files will be uploaded in chunks this size. -When uploading large files, increasing the value of ---azureblob-upload-concurrency will increase performance at the cost of -using more memory. The default of 16 is set quite conservatively to use -less memory. It maybe be necessary raise it to 64 or higher to fully -utilize a 1 GBit/s link with a single file transfer. + Note that these chunks are buffered in memory so increasing them will + increase memory use. -Restricted filename characters + Properties: -In addition to the default restricted characters set the following -characters are also replaced: + - Config: chunk_size + - Env Var: RCLONE_OPENDRIVE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 10Mi - Character Value Replacement - ----------- ------- ------------- - / 0x2F / - \ 0x5C \ -File names can also not end with the following characters. These only -get replaced if they are the last character in the name: - Character Value Replacement - ----------- ------- ------------- - . 0x2E . + ## Limitations -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Note that OpenDrive is case insensitive so you can't have a + file called "Hello.doc" and one called "hello.doc". -Hashes + There are quite a few characters that can't be in OpenDrive file + names. These can't occur on Windows platforms, but on non-Windows + platforms they are common. Rclone will map these names to and from an + identical looking unicode equivalent. For example if a file has a `?` + in it will be mapped to `?` instead. -MD5 hashes are stored with blobs. However blobs that were uploaded in -chunks only have an MD5 if the source remote was capable of MD5 hashes, -e.g. the local disk. + `rclone about` is not supported by the OpenDrive backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. -Authentication + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -There are a number of ways of supplying credentials for Azure Blob -Storage. Rclone tries them in the order of the sections below. + # Oracle Object Storage + - [Oracle Object Storage Overview](https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/objectstorageoverview.htm) + - [Oracle Object Storage FAQ](https://www.oracle.com/cloud/storage/object-storage/faq/) + - [Oracle Object Storage Limits](https://docs.oracle.com/en-us/iaas/Content/Resources/Assets/whitepapers/oci-object-storage-best-practices.pdf) -Env Auth + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` command.) You may put subdirectories in + too, e.g. `remote:bucket/path/to/dir`. -If the env_auth config parameter is true then rclone will pull -credentials from the environment or runtime. + Sample command to transfer local artifacts to remote:bucket in oracle object storage: -It tries these authentication methods in this order: + `rclone -vvv --progress --stats-one-line --max-stats-groups 10 --log-format date,time,UTC,longfile --fast-list --buffer-size 256Mi --oos-no-check-bucket --oos-upload-cutoff 10Mi --multi-thread-cutoff 16Mi --multi-thread-streams 3000 --transfers 3000 --checkers 64 --retries 2 --oos-chunk-size 10Mi --oos-upload-concurrency 10000 --oos-attempt-resume-upload --oos-leave-parts-on-error sync ./artifacts remote:bucket -vv` -1. Environment Variables -2. Managed Service Identity Credentials -3. Azure CLI credentials (as used by the az tool) + ## Configuration -These are described in the following sections + Here is an example of making an oracle object storage configuration. `rclone config` walks you + through it. -Env Auth: 1. Environment Variables + Here is an example of how to make a remote called `remote`. First run: -If env_auth is set and environment variables are present rclone -authenticates a service principal with a secret or certificate, or a -user with a password, depending on which environment variable are set. -It reads configuration from these variables, in the following order: + rclone config -1. Service principal with client secret - - AZURE_TENANT_ID: ID of the service principal's tenant. Also - called its "directory" ID. - - AZURE_CLIENT_ID: the service principal's client ID - - AZURE_CLIENT_SECRET: one of the service principal's client - secrets -2. Service principal with certificate - - AZURE_TENANT_ID: ID of the service principal's tenant. Also - called its "directory" ID. - - AZURE_CLIENT_ID: the service principal's client ID - - AZURE_CLIENT_CERTIFICATE_PATH: path to a PEM or PKCS12 - certificate file including the private key. - - AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the - certificate file. - - AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: (optional) Specifies - whether an authentication request will include an x5c header to - support subject name / issuer based authentication. When set to - "true" or "1", authentication requests include the x5c header. -3. User with username and password - - AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults - to "organizations". - - AZURE_CLIENT_ID: client ID of the application the user will - authenticate to - - AZURE_USERNAME: a username (usually an email address) - - AZURE_PASSWORD: the user's password + This will guide you through an interactive setup process: -Env Auth: 2. Managed Service Identity Credentials +n) New remote +o) Delete remote +p) Rename remote +q) Copy remote +r) Set configuration password +s) Quit config e/n/d/r/c/s/q> n -When using Managed Service Identity if the VM(SS) on which this program -is running has a system-assigned identity, it will be used by default. -If the resource has no system-assigned but exactly one user-assigned -identity, the user-assigned identity will be used by default. +Enter name for new remote. name> remote -If the resource has multiple user-assigned identities you will need to -unset env_auth and set use_msi instead. See the use_msi section. +Option Storage. Type of storage to configure. Choose a number from +below, or type in your own value. [snip] XX / Oracle Cloud +Infrastructure Object Storage  (oracleobjectstorage) Storage> +oracleobjectstorage -Env Auth: 3. Azure CLI credentials (as used by the az tool) +Option provider. Choose your Auth Provider Choose a number from below, +or type in your own string value. Press Enter for the default +(env_auth). 1 / automatically pickup the credentials from runtime(env), +first one to provide auth wins  (env_auth) / use an OCI user and an API +key for authentication. 2 | you’ll need to put in a config file your +tenancy OCID, user OCID, region, the path, fingerprint to an API key. | +https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm + (user_principal_auth) / use instance principals to authorize an +instance to make API calls. 3 | each instance has its own identity, and +authenticates using the certificates that are read from instance +metadata. | +https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm + (instance_principal_auth) 4 / use resource principals to make API calls + (resource_principal_auth) 5 / no credentials needed, this is typically +for reading public buckets  (no_auth) provider> 2 -Credentials created with the az tool can be picked up using env_auth. +Option namespace. Object storage namespace Enter a value. namespace> +idbamagbg734 -For example if you were to login with a service principal like this: +Option compartment. Object storage compartment OCID Enter a value. +compartment> +ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba - az login --service-principal -u XXX -p XXX --tenant XXX +Option region. Object storage Region Enter a value. region> us-ashburn-1 -Then you could access rclone resources like this: +Option endpoint. Endpoint for Object storage API. Leave blank to use the +default endpoint for the region. Enter a value. Press Enter to leave +empty. endpoint> - rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER +Option config_file. Full Path to OCI config file Choose a number from +below, or type in your own string value. Press Enter for the default +(~/.oci/config). 1 / oci configuration file location  (~/.oci/config) +config_file> /etc/oci/dev.conf -Or +Option config_profile. Profile name inside OCI config file Choose a +number from below, or type in your own string value. Press Enter for the +default (Default). 1 / Use the default profile  (Default) +config_profile> Test - rclone lsf --azureblob-env-auth --azureblob-acccount=ACCOUNT :azureblob:CONTAINER +Edit advanced config? y) Yes n) No (default) y/n> n -Which is analogous to using the az tool: +Configuration complete. Options: - type: oracleobjectstorage - +namespace: idbamagbg734 - compartment: +ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba +- region: us-ashburn-1 - provider: user_principal_auth - config_file: +/etc/oci/dev.conf - config_profile: Test Keep this "remote" remote? y) +Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> y - az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login -Account and Shared Key + See all buckets -This is the most straight forward and least flexible way. Just fill in -the account and key lines and leave the rest blank. + rclone lsd remote: -SAS URL + Create a new bucket -This can be an account level SAS URL or container level SAS URL. + rclone mkdir remote:bucket -To use it leave account and key blank and fill in sas_url. + List the contents of a bucket -An account level SAS URL or container level SAS URL can be obtained from -the Azure portal or the Azure Storage Explorer. To get a container level -SAS URL right click on a container in the Azure Blob explorer in the -Azure portal. + rclone ls remote:bucket + rclone ls remote:bucket --max-depth 1 -If you use a container level SAS URL, rclone operations are permitted -only on a particular container, e.g. + ## Authentication Providers - rclone ls azureblob:container + OCI has various authentication methods. To learn more about authentication methods please refer [oci authentication + methods](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm) + These choices can be specified in the rclone config file. -You can also list the single container from the root. This will only -show the container specified by the SAS URL. + Rclone supports the following OCI authentication provider. - $ rclone lsd azureblob: - container/ + User Principal + Instance Principal + Resource Principal + No authentication -Note that you can't see or access any other containers - this will fail + ### User Principal - rclone ls azureblob:othercontainer + Sample rclone config file for Authentication Provider User Principal: -Container level SAS URLs are useful for temporarily allowing third -parties access to a single container or putting credentials into an -untrusted environment such as a CI build server. + [oos] + type = oracleobjectstorage + namespace = id34 + compartment = ocid1.compartment.oc1..aaba + region = us-ashburn-1 + provider = user_principal_auth + config_file = /home/opc/.oci/config + config_profile = Default -Service principal with client secret + Advantages: + - One can use this method from any server within OCI or on-premises or from other cloud provider. -If these variables are set, rclone will authenticate with a service -principal with a client secret. + Considerations: + - you need to configure user’s privileges / policy to allow access to object storage + - Overhead of managing users and keys. + - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials. -- tenant: ID of the service principal's tenant. Also called its - "directory" ID. -- client_id: the service principal's client ID -- client_secret: one of the service principal's client secrets + ### Instance Principal -The credentials can also be placed in a file using the -service_principal_file configuration option. + An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. + With this approach no credentials have to be stored and managed. -Service principal with certificate + Sample rclone configuration file for Authentication Provider Instance Principal: -If these variables are set, rclone will authenticate with a service -principal with certificate. + [opc@rclone ~]$ cat ~/.config/rclone/rclone.conf + [oos] + type = oracleobjectstorage + namespace = idfn + compartment = ocid1.compartment.oc1..aak7a + region = us-ashburn-1 + provider = instance_principal_auth -- tenant: ID of the service principal's tenant. Also called its - "directory" ID. -- client_id: the service principal's client ID -- client_certificate_path: path to a PEM or PKCS12 certificate file - including the private key. -- client_certificate_password: (optional) password for the certificate - file. -- client_send_certificate_chain: (optional) Specifies whether an - authentication request will include an x5c header to support subject - name / issuer based authentication. When set to "true" or "1", - authentication requests include the x5c header. + Advantages: -NB client_certificate_password must be obscured - see rclone obscure. + - With instance principals, you don't need to configure user credentials and transfer/ save it to disk in your compute + instances or rotate the credentials. + - You don’t need to deal with users and keys. + - Greatly helps in automation as you don't have to manage access keys, user private keys, storing them in vault, + using kms etc. -User with username and password + Considerations: -If these variables are set, rclone will authenticate with username and -password. + - You need to configure a dynamic group having this instance as member and add policy to read object storage to that + dynamic group. + - Everyone who has access to this machine can execute the CLI commands. + - It is applicable for oci compute instances only. It cannot be used on external instance or resources. -- tenant: (optional) tenant to authenticate in. Defaults to - "organizations". -- client_id: client ID of the application the user will authenticate - to -- username: a username (usually an email address) -- password: the user's password + ### Resource Principal -Microsoft doesn't recommend this kind of authentication, because it's -less secure than other authentication flows. This method is not -interactive, so it isn't compatible with any form of multi-factor -authentication, and the application must already have user or admin -consent. This credential can only authenticate work and school accounts; -it can't authenticate Microsoft accounts. + Resource principal auth is very similar to instance principal auth but used for resources that are not + compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). + To use resource principal ensure Rclone process is started with these environment variables set in its process. -NB password must be obscured - see rclone obscure. + export OCI_RESOURCE_PRINCIPAL_VERSION=2.2 + export OCI_RESOURCE_PRINCIPAL_REGION=us-ashburn-1 + export OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM=/usr/share/model-server/key.pem + export OCI_RESOURCE_PRINCIPAL_RPST=/usr/share/model-server/security_token -Managed Service Identity Credentials + Sample rclone configuration file for Authentication Provider Resource Principal: -If use_msi is set then managed service identity credentials are used. -This authentication only works when running in an Azure service. -env_auth needs to be unset to use this. + [oos] + type = oracleobjectstorage + namespace = id34 + compartment = ocid1.compartment.oc1..aaba + region = us-ashburn-1 + provider = resource_principal_auth -However if you have multiple user identities to choose from these must -be explicitly specified using exactly one of the msi_object_id, -msi_client_id, or msi_mi_res_id parameters. + ### No authentication -If none of msi_object_id, msi_client_id, or msi_mi_res_id is set, this -is is equivalent to using env_auth. + Public buckets do not require any authentication mechanism to read objects. + Sample rclone configuration file for No authentication: + + [oos] + type = oracleobjectstorage + namespace = id34 + compartment = ocid1.compartment.oc1..aaba + region = us-ashburn-1 + provider = no_auth -Standard options + ### Modification times and hashes -Here are the Standard options specific to azureblob (Microsoft Azure -Blob Storage). + The modification time is stored as metadata on the object as + `opc-meta-mtime` as floating point since the epoch, accurate to 1 ns. ---azureblob-account + If the modification time needs to be updated rclone will attempt to perform a server + side copy to update the modification if the object can be copied in a single part. + In the case the object is larger than 5Gb, the object will be uploaded rather than copied. -Azure Storage Account Name. + Note that reading this from the object takes an additional `HEAD` request as the metadata + isn't returned in object listings. -Set this to the Azure Storage Account Name in use. + The MD5 hash algorithm is supported. -Leave blank to use SAS URL or Emulator, otherwise it needs to be set. + ### Multipart uploads -If this is blank and if env_auth is set it will be read from the -environment variable AZURE_STORAGE_ACCOUNT_NAME if possible. + rclone supports multipart uploads with OOS which means that it can + upload files bigger than 5 GiB. -Properties: + Note that files uploaded *both* with multipart upload *and* through + crypt remotes do not have MD5 sums. -- Config: account -- Env Var: RCLONE_AZUREBLOB_ACCOUNT -- Type: string -- Required: false + rclone switches from single part uploads to multipart uploads at the + point specified by `--oos-upload-cutoff`. This can be a maximum of 5 GiB + and a minimum of 0 (ie always upload multipart files). ---azureblob-env-auth + The chunk sizes used in the multipart upload are specified by + `--oos-chunk-size` and the number of chunks uploaded concurrently is + specified by `--oos-upload-concurrency`. -Read credentials from runtime (environment variables, CLI or MSI). + Multipart uploads will use `--transfers` * `--oos-upload-concurrency` * + `--oos-chunk-size` extra memory. Single part uploads to not use extra + memory. -See the authentication docs for full info. + Single part transfers can be faster than multipart transfers or slower + depending on your latency from oos - the more latency, the more likely + single part transfers will be faster. -Properties: + Increasing `--oos-upload-concurrency` will increase throughput (8 would + be a sensible value) and increasing `--oos-chunk-size` also increases + throughput (16M would be sensible). Increasing either of these will + use more memory. The default values are high enough to gain most of + the possible performance without using too much memory. -- Config: env_auth -- Env Var: RCLONE_AZUREBLOB_ENV_AUTH -- Type: bool -- Default: false ---azureblob-key + ### Standard options -Storage Account Shared Key. + Here are the Standard options specific to oracleobjectstorage (Oracle Cloud Infrastructure Object Storage). -Leave blank to use SAS URL or Emulator. + #### --oos-provider -Properties: + Choose your Auth Provider -- Config: key -- Env Var: RCLONE_AZUREBLOB_KEY -- Type: string -- Required: false + Properties: + + - Config: provider + - Env Var: RCLONE_OOS_PROVIDER + - Type: string + - Default: "env_auth" + - Examples: + - "env_auth" + - automatically pickup the credentials from runtime(env), first one to provide auth wins + - "user_principal_auth" + - use an OCI user and an API key for authentication. + - you’ll need to put in a config file your tenancy OCID, user OCID, region, the path, fingerprint to an API key. + - https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm + - "instance_principal_auth" + - use instance principals to authorize an instance to make API calls. + - each instance has its own identity, and authenticates using the certificates that are read from instance metadata. + - https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm + - "resource_principal_auth" + - use resource principals to make API calls + - "no_auth" + - no credentials needed, this is typically for reading public buckets + + #### --oos-namespace ---azureblob-sas-url + Object storage namespace -SAS URL for container level access only. + Properties: -Leave blank if using account/key or Emulator. + - Config: namespace + - Env Var: RCLONE_OOS_NAMESPACE + - Type: string + - Required: true -Properties: + #### --oos-compartment -- Config: sas_url -- Env Var: RCLONE_AZUREBLOB_SAS_URL -- Type: string -- Required: false + Object storage compartment OCID ---azureblob-tenant + Properties: -ID of the service principal's tenant. Also called its directory ID. + - Config: compartment + - Env Var: RCLONE_OOS_COMPARTMENT + - Provider: !no_auth + - Type: string + - Required: true -Set this if using - Service principal with client secret - Service -principal with certificate - User with username and password + #### --oos-region -Properties: + Object storage Region -- Config: tenant -- Env Var: RCLONE_AZUREBLOB_TENANT -- Type: string -- Required: false + Properties: ---azureblob-client-id + - Config: region + - Env Var: RCLONE_OOS_REGION + - Type: string + - Required: true -The ID of the client in use. + #### --oos-endpoint -Set this if using - Service principal with client secret - Service -principal with certificate - User with username and password + Endpoint for Object storage API. -Properties: + Leave blank to use the default endpoint for the region. -- Config: client_id -- Env Var: RCLONE_AZUREBLOB_CLIENT_ID -- Type: string -- Required: false + Properties: ---azureblob-client-secret + - Config: endpoint + - Env Var: RCLONE_OOS_ENDPOINT + - Type: string + - Required: false -One of the service principal's client secrets + #### --oos-config-file -Set this if using - Service principal with client secret + Path to OCI config file -Properties: + Properties: -- Config: client_secret -- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET -- Type: string -- Required: false + - Config: config_file + - Env Var: RCLONE_OOS_CONFIG_FILE + - Provider: user_principal_auth + - Type: string + - Default: "~/.oci/config" + - Examples: + - "~/.oci/config" + - oci configuration file location ---azureblob-client-certificate-path + #### --oos-config-profile -Path to a PEM or PKCS12 certificate file including the private key. + Profile name inside the oci config file -Set this if using - Service principal with certificate + Properties: -Properties: + - Config: config_profile + - Env Var: RCLONE_OOS_CONFIG_PROFILE + - Provider: user_principal_auth + - Type: string + - Default: "Default" + - Examples: + - "Default" + - Use the default profile -- Config: client_certificate_path -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH -- Type: string -- Required: false + ### Advanced options ---azureblob-client-certificate-password + Here are the Advanced options specific to oracleobjectstorage (Oracle Cloud Infrastructure Object Storage). -Password for the certificate file (optional). + #### --oos-storage-tier -Optionally set this if using - Service principal with certificate + The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm -And the certificate has a password. + Properties: -NB Input to this must be obscured - see rclone obscure. + - Config: storage_tier + - Env Var: RCLONE_OOS_STORAGE_TIER + - Type: string + - Default: "Standard" + - Examples: + - "Standard" + - Standard storage tier, this is the default tier + - "InfrequentAccess" + - InfrequentAccess storage tier + - "Archive" + - Archive storage tier -Properties: + #### --oos-upload-cutoff -- Config: client_certificate_password -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD -- Type: string -- Required: false + Cutoff for switching to chunked upload. -Advanced options + Any files larger than this will be uploaded in chunks of chunk_size. + The minimum is 0 and the maximum is 5 GiB. -Here are the Advanced options specific to azureblob (Microsoft Azure -Blob Storage). + Properties: ---azureblob-client-send-certificate-chain + - Config: upload_cutoff + - Env Var: RCLONE_OOS_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 200Mi -Send the certificate chain when using certificate auth. + #### --oos-chunk-size -Specifies whether an authentication request will include an x5c header -to support subject name / issuer based authentication. When set to true, -authentication requests include the x5c header. + Chunk size to use for uploading. -Optionally set this if using - Service principal with certificate + When uploading files larger than upload_cutoff or files with unknown + size (e.g. from "rclone rcat" or uploaded with "rclone mount" they will be uploaded + as multipart uploads using this chunk size. -Properties: + Note that "upload_concurrency" chunks of this size are buffered + in memory per transfer. -- Config: client_send_certificate_chain -- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN -- Type: bool -- Default: false + If you are transferring large files over high-speed links and you have + enough memory, then increasing this will speed up the transfers. ---azureblob-username + Rclone will automatically increase the chunk size when uploading a + large file of known size to stay below the 10,000 chunks limit. -User name (usually an email address) + Files of unknown size are uploaded with the configured + chunk_size. Since the default chunk size is 5 MiB and there can be at + most 10,000 chunks, this means that by default the maximum size of + a file you can stream upload is 48 GiB. If you wish to stream upload + larger files then you will need to increase chunk_size. -Set this if using - User with username and password + Increasing the chunk size decreases the accuracy of the progress + statistics displayed with "-P" flag. -Properties: -- Config: username -- Env Var: RCLONE_AZUREBLOB_USERNAME -- Type: string -- Required: false + Properties: ---azureblob-password + - Config: chunk_size + - Env Var: RCLONE_OOS_CHUNK_SIZE + - Type: SizeSuffix + - Default: 5Mi -The user's password + #### --oos-max-upload-parts -Set this if using - User with username and password + Maximum number of parts in a multipart upload. -NB Input to this must be obscured - see rclone obscure. + This option defines the maximum number of multipart chunks to use + when doing a multipart upload. -Properties: + OCI has max parts limit of 10,000 chunks. -- Config: password -- Env Var: RCLONE_AZUREBLOB_PASSWORD -- Type: string -- Required: false + Rclone will automatically increase the chunk size when uploading a + large file of a known size to stay below this number of chunks limit. ---azureblob-service-principal-file -Path to file containing credentials for use with a service principal. + Properties: -Leave blank normally. Needed only if you want to use a service principal -instead of interactive login. + - Config: max_upload_parts + - Env Var: RCLONE_OOS_MAX_UPLOAD_PARTS + - Type: int + - Default: 10000 - $ az ad sp create-for-rbac --name "" \ - --role "Storage Blob Data Owner" \ - --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ - > azure-principal.json + #### --oos-upload-concurrency -See "Create an Azure service principal" and "Assign an Azure role for -access to blob data" pages for more details. + Concurrency for multipart uploads. -It may be more convenient to put the credentials directly into the -rclone config file under the client_id, tenant and client_secret keys -instead of setting service_principal_file. + This is the number of chunks of the same file that are uploaded + concurrently. -Properties: + If you are uploading small numbers of large files over high-speed links + and these uploads do not fully utilize your bandwidth, then increasing + this may help to speed up the transfers. -- Config: service_principal_file -- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE -- Type: string -- Required: false + Properties: ---azureblob-use-msi + - Config: upload_concurrency + - Env Var: RCLONE_OOS_UPLOAD_CONCURRENCY + - Type: int + - Default: 10 -Use a managed service identity to authenticate (only works in Azure). + #### --oos-copy-cutoff -When true, use a managed service identity to authenticate to Azure -Storage instead of a SAS token or account key. + Cutoff for switching to multipart copy. -If the VM(SS) on which this program is running has a system-assigned -identity, it will be used by default. If the resource has no -system-assigned but exactly one user-assigned identity, the -user-assigned identity will be used by default. If the resource has -multiple user-assigned identities, the identity to use must be -explicitly specified using exactly one of the msi_object_id, -msi_client_id, or msi_mi_res_id parameters. + Any files larger than this that need to be server-side copied will be + copied in chunks of this size. -Properties: + The minimum is 0 and the maximum is 5 GiB. -- Config: use_msi -- Env Var: RCLONE_AZUREBLOB_USE_MSI -- Type: bool -- Default: false + Properties: ---azureblob-msi-object-id + - Config: copy_cutoff + - Env Var: RCLONE_OOS_COPY_CUTOFF + - Type: SizeSuffix + - Default: 4.656Gi -Object ID of the user-assigned MSI to use, if any. + #### --oos-copy-timeout -Leave blank if msi_client_id or msi_mi_res_id specified. + Timeout for copy. -Properties: + Copy is an asynchronous operation, specify timeout to wait for copy to succeed -- Config: msi_object_id -- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID -- Type: string -- Required: false ---azureblob-msi-client-id + Properties: -Object ID of the user-assigned MSI to use, if any. + - Config: copy_timeout + - Env Var: RCLONE_OOS_COPY_TIMEOUT + - Type: Duration + - Default: 1m0s -Leave blank if msi_object_id or msi_mi_res_id specified. + #### --oos-disable-checksum -Properties: + Don't store MD5 checksum with object metadata. -- Config: msi_client_id -- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID -- Type: string -- Required: false + Normally rclone will calculate the MD5 checksum of the input before + uploading it so it can add it to metadata on the object. This is great + for data integrity checking but can cause long delays for large files + to start uploading. ---azureblob-msi-mi-res-id + Properties: -Azure resource ID of the user-assigned MSI to use, if any. + - Config: disable_checksum + - Env Var: RCLONE_OOS_DISABLE_CHECKSUM + - Type: bool + - Default: false -Leave blank if msi_client_id or msi_object_id specified. + #### --oos-encoding -Properties: + The encoding for the backend. -- Config: msi_mi_res_id -- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID -- Type: string -- Required: false + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. ---azureblob-use-emulator + Properties: -Uses local storage emulator if provided as 'true'. + - Config: encoding + - Env Var: RCLONE_OOS_ENCODING + - Type: Encoding + - Default: Slash,InvalidUtf8,Dot -Leave blank if using real azure storage endpoint. + #### --oos-leave-parts-on-error -Properties: + If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery. -- Config: use_emulator -- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR -- Type: bool -- Default: false + It should be set to true for resuming uploads across different sessions. ---azureblob-endpoint + WARNING: Storing parts of an incomplete multipart upload counts towards space usage on object storage and will add + additional costs if not cleaned up. -Endpoint for the service. -Leave blank normally. + Properties: -Properties: + - Config: leave_parts_on_error + - Env Var: RCLONE_OOS_LEAVE_PARTS_ON_ERROR + - Type: bool + - Default: false -- Config: endpoint -- Env Var: RCLONE_AZUREBLOB_ENDPOINT -- Type: string -- Required: false + #### --oos-attempt-resume-upload ---azureblob-upload-cutoff + If true attempt to resume previously started multipart upload for the object. + This will be helpful to speed up multipart transfers by resuming uploads from past session. -Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). + WARNING: If chunk size differs in resumed session from past incomplete session, then the resumed multipart upload is + aborted and a new multipart upload is started with the new chunk size. -Properties: + The flag leave_parts_on_error must be true to resume and optimize to skip parts that were already uploaded successfully. -- Config: upload_cutoff -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF -- Type: string -- Required: false ---azureblob-chunk-size + Properties: -Upload chunk size. + - Config: attempt_resume_upload + - Env Var: RCLONE_OOS_ATTEMPT_RESUME_UPLOAD + - Type: bool + - Default: false -Note that this is stored in memory and there may be up to "--transfers" -* "--azureblob-upload-concurrency" chunks stored at once in memory. + #### --oos-no-check-bucket -Properties: + If set, don't attempt to check the bucket exists or create it. -- Config: chunk_size -- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE -- Type: SizeSuffix -- Default: 4Mi + This can be useful when trying to minimise the number of transactions + rclone does if you know the bucket exists already. ---azureblob-upload-concurrency + It can also be needed if the user you are using does not have bucket + creation permissions. -Concurrency for multipart uploads. -This is the number of chunks of the same file that are uploaded -concurrently. + Properties: -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. + - Config: no_check_bucket + - Env Var: RCLONE_OOS_NO_CHECK_BUCKET + - Type: bool + - Default: false -In tests, upload speed increases almost linearly with upload -concurrency. For example to fill a gigabit pipe it may be necessary to -raise this to 64. Note that this will use more memory. + #### --oos-sse-customer-key-file -Note that chunks are stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once -in memory. + To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + with the object. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.' -Properties: + Properties: -- Config: upload_concurrency -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY -- Type: int -- Default: 16 + - Config: sse_customer_key_file + - Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY_FILE + - Type: string + - Required: false + - Examples: + - "" + - None ---azureblob-list-chunk + #### --oos-sse-customer-key -Size of blob list. + To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + encrypt or decrypt the data. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is + needed. For more information, see Using Your Own Keys for Server-Side Encryption + (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm) -This sets the number of blobs requested in each listing chunk. Default -is the maximum, 5000. "List blobs" requests are permitted 2 minutes per -megabyte to complete. If an operation is taking longer than 2 minutes -per megabyte on average, it will time out ( source ). This can be used -to limit the number of blobs items to return, to avoid the time out. + Properties: -Properties: + - Config: sse_customer_key + - Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY + - Type: string + - Required: false + - Examples: + - "" + - None -- Config: list_chunk -- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK -- Type: int -- Default: 5000 + #### --oos-sse-customer-key-sha256 ---azureblob-access-tier + If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + key. This value is used to check the integrity of the encryption key. see Using Your Own Keys for + Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). -Access tier of blob: hot, cool or archive. + Properties: -Archived blobs can be restored by setting access tier to hot or cool. -Leave blank if you intend to use default access tier, which is set at -account level + - Config: sse_customer_key_sha256 + - Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY_SHA256 + - Type: string + - Required: false + - Examples: + - "" + - None -If there is no "access tier" specified, rclone doesn't apply any tier. -rclone performs "Set Tier" operation on blobs while uploading, if -objects are not modified, specifying "access tier" to new one will have -no effect. If blobs are in "archive tier" at remote, trying to perform -data transfer operations from remote will not be allowed. User should -first restore by tiering blob to "Hot" or "Cool". + #### --oos-sse-kms-key-id -Properties: + if using your own master key in vault, this header specifies the + OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a master encryption key used to call + the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key. + Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed. -- Config: access_tier -- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER -- Type: string -- Required: false + Properties: ---azureblob-archive-tier-delete + - Config: sse_kms_key_id + - Env Var: RCLONE_OOS_SSE_KMS_KEY_ID + - Type: string + - Required: false + - Examples: + - "" + - None -Delete archive tier blobs before overwriting. + #### --oos-sse-customer-algorithm -Archive tier blobs cannot be updated. So without this flag, if you -attempt to update an archive tier blob, then rclone will produce the -error: + If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm. + Object Storage supports "AES256" as the encryption algorithm. For more information, see + Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). - can't update archive tier blob without --azureblob-archive-tier-delete + Properties: -With this flag set then before rclone attempts to overwrite an archive -tier blob, it will delete the existing blob before uploading its -replacement. This has the potential for data loss if the upload fails -(unlike updating a normal blob) and also may cost more since deleting -archive tier blobs early may be chargable. + - Config: sse_customer_algorithm + - Env Var: RCLONE_OOS_SSE_CUSTOMER_ALGORITHM + - Type: string + - Required: false + - Examples: + - "" + - None + - "AES256" + - AES256 -Properties: + ## Backend commands -- Config: archive_tier_delete -- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE -- Type: bool -- Default: false + Here are the commands specific to the oracleobjectstorage backend. ---azureblob-disable-checksum + Run them with -Don't store MD5 checksum with object metadata. + rclone backend COMMAND remote: -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files to -start uploading. + The help below will explain what arguments each command takes. -Properties: + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -- Config: disable_checksum -- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM -- Type: bool -- Default: false + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). ---azureblob-memory-pool-flush-time + ### rename -How often internal memory buffer pools will be flushed. + change the name of an object -Uploads which requires additional buffers (f.e multipart) will use -memory pool for allocations. This option controls how often unused -buffers will be removed from the pool. + rclone backend rename remote: [options] [+] -Properties: + This command can be used to rename a object. -- Config: memory_pool_flush_time -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s + Usage Examples: ---azureblob-memory-pool-use-mmap + rclone backend rename oos:bucket relative-object-path-under-bucket object-new-name -Whether to use mmap buffers in internal memory pool. -Properties: + ### list-multipart-uploads -- Config: memory_pool_use_mmap -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false + List the unfinished multipart uploads ---azureblob-encoding + rclone backend list-multipart-uploads remote: [options] [+] -The encoding for the backend. + This command lists the unfinished multipart uploads in JSON format. -See the encoding section in the overview for more info. + rclone backend list-multipart-uploads oos:bucket/path/to/object -Properties: + It returns a dictionary of buckets with values as lists of unfinished + multipart uploads. -- Config: encoding -- Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 + You can call it with no bucket in which case it lists all bucket, with + a bucket or with a bucket and path. ---azureblob-public-access + { + "test-bucket": [ + { + "namespace": "test-namespace", + "bucket": "test-bucket", + "object": "600m.bin", + "uploadId": "51dd8114-52a4-b2f2-c42f-5291f05eb3c8", + "timeCreated": "2022-07-29T06:21:16.595Z", + "storageTier": "Standard" + } + ] -Public access level of a container: blob or container. -Properties: + ### cleanup -- Config: public_access -- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS -- Type: string -- Required: false -- Examples: - - "" - - The container and its blobs can be accessed only with an - authorized request. - - It's a default value. - - "blob" - - Blob data within this container can be read via anonymous - request. - - "container" - - Allow full public read access for container and blob data. + Remove unfinished multipart uploads. ---azureblob-no-check-container + rclone backend cleanup remote: [options] [+] -If set, don't attempt to check the container exists or create it. + This command removes unfinished multipart uploads of age greater than + max-age which defaults to 24 hours. -This can be useful when trying to minimise the number of transactions -rclone does if you know the container exists already. + Note that you can use --interactive/-i or --dry-run with this command to see what + it would do. -Properties: + rclone backend cleanup oos:bucket/path/to/object + rclone backend cleanup -o max-age=7w oos:bucket/path/to/object -- Config: no_check_container -- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER -- Type: bool -- Default: false + Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. ---azureblob-no-head-object -If set, do not do HEAD before GET when getting objects. + Options: -Properties: + - "max-age": Max age of upload to delete -- Config: no_head_object -- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT -- Type: bool -- Default: false -Custom upload headers -You can set custom upload headers with the --header-upload flag. + ## Tutorials + ### [Mounting Buckets](https://rclone.org/oracleobjectstorage/tutorial_mount/) -- Cache-Control -- Content-Disposition -- Content-Encoding -- Content-Language -- Content-Type + # QingStor -Eg --header-upload "Content-Type: text/potato" + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -Limitations + ## Configuration -MD5 sums are only uploaded with chunked files if the source has an MD5 -sum. This will always be the case for a local to azure copy. + Here is an example of making an QingStor configuration. First run -rclone about is not supported by the Microsoft Azure Blob storage -backend. Backends without this capability cannot determine free space -for an rclone mount or use policy mfs (most free space) as a member of -an rclone union remote. + rclone config -See List of backends that do not support rclone about and rclone about + This will guide you through an interactive setup process. -Azure Storage Emulator Support +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +remote Type of storage to configure. Choose a number from below, or type +in your own value [snip] XX / QingStor Object Storage  "qingstor" [snip] +Storage> qingstor Get QingStor credentials from runtime. Only applies if +access_key_id and secret_access_key is blank. Choose a number from +below, or type in your own value 1 / Enter QingStor credentials in the +next step  "false" 2 / Get QingStor credentials from the environment +(env vars or IAM)  "true" env_auth> 1 QingStor Access Key ID - leave +blank for anonymous access or runtime credentials. access_key_id> +access_key QingStor Secret Access Key (password) - leave blank for +anonymous access or runtime credentials. secret_access_key> secret_key +Enter an endpoint URL to connection QingStor API. Leave blank will use +the default value "https://qingstor.com:443" endpoint> Zone connect to. +Default is "pek3a". Choose a number from below, or type in your own +value / The Beijing (China) Three Zone 1 | Needs location constraint +pek3a.  "pek3a" / The Shanghai (China) First Zone 2 | Needs location +constraint sh1a.  "sh1a" zone> 1 Number of connection retry. Leave blank +will use the default value "3". connection_retries> Remote config +-------------------- [remote] env_auth = false access_key_id = +access_key secret_access_key = secret_key endpoint = zone = pek3a +connection_retries = -------------------- y) Yes this is OK e) Edit this +remote d) Delete this remote y/e/d> y -You can run rclone with the storage emulator (usually azurite). -To do this, just set up a new remote with rclone config following the -instructions in the introduction and set use_emulator in the advanced -settings as true. You do not need to provide a default account name nor -an account key. But you can override them in the account and key -options. (Prior to v1.61 they were hard coded to azurite's -devstoreaccount1.) + This remote is called `remote` and can now be used like this -Also, if you want to access a storage emulator instance running on a -different machine, you can override the endpoint parameter in the -advanced settings, setting it to -http(s)://:/devstoreaccount1 (e.g. -http://10.254.2.5:10000/devstoreaccount1). + See all buckets -Microsoft OneDrive + rclone lsd remote: -Paths are specified as remote:path + Make a new bucket -Paths may be as deep as required, e.g. remote:directory/subdirectory. + rclone mkdir remote:bucket -Configuration + List the contents of a bucket -The initial setup for OneDrive involves getting a token from Microsoft -which you need to do in your browser. rclone config walks you through -it. + rclone ls remote:bucket -Here is an example of how to make a remote called remote. First run: + Sync `/home/local/directory` to the remote bucket, deleting any excess + files in the bucket. - rclone config + rclone sync --interactive /home/local/directory remote:bucket -This will guide you through an interactive setup process: + ### --fast-list - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Microsoft OneDrive - \ "onedrive" - [snip] - Storage> onedrive - Microsoft App Client Id - Leave blank normally. - Enter a string value. Press Enter for the default (""). - client_id> - Microsoft App Client Secret - Leave blank normally. - Enter a string value. Press Enter for the default (""). - client_secret> - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - Choose a number from below, or type in an existing value - 1 / OneDrive Personal or Business - \ "onedrive" - 2 / Sharepoint site - \ "sharepoint" - 3 / Type in driveID - \ "driveid" - 4 / Type in SiteID - \ "siteid" - 5 / Search a Sharepoint site - \ "search" - Your choice> 1 - Found 1 drives, please select the one you want to use: - 0: OneDrive (business) id=b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk - Chose drive to use:> 0 - Found drive 'root' of type 'business', URL: https://org-my.sharepoint.com/personal/you/Documents - Is that okay? - y) Yes - n) No - y/n> y - -------------------- - [remote] - type = onedrive - token = {"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2018-08-26T22:39:52.486512262+08:00"} - drive_id = b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk - drive_type = business - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + ### Multipart uploads -Note that rclone runs a webserver on your local machine to collect the -token as returned from Microsoft. This only runs from the moment it -opens your browser to the moment you get back the verification code. -This is on http://127.0.0.1:53682/ and this it may require you to -unblock it temporarily if you are running a host firewall. + rclone supports multipart uploads with QingStor which means that it can + upload files bigger than 5 GiB. Note that files uploaded with multipart + upload don't have an MD5SUM. -Once configured you can then use rclone like this, + Note that incomplete multipart uploads older than 24 hours can be + removed with `rclone cleanup remote:bucket` just for one bucket + `rclone cleanup remote:` for all buckets. QingStor does not ever + remove incomplete multipart uploads so it may be necessary to run this + from time to time. -List directories in top level of your OneDrive + ### Buckets and Zone - rclone lsd remote: + With QingStor you can list buckets (`rclone lsd`) using any zone, + but you can only access the content of a bucket from the zone it was + created in. If you attempt to access a bucket from the wrong zone, + you will get an error, `incorrect zone, the bucket is not in 'XXX' + zone`. -List all the files in your OneDrive + ### Authentication - rclone ls remote: + There are two ways to supply `rclone` with a set of QingStor + credentials. In order of precedence: -To copy a local directory to an OneDrive directory called backup + - Directly in the rclone configuration file (as configured by `rclone config`) + - set `access_key_id` and `secret_access_key` + - Runtime configuration: + - set `env_auth` to `true` in the config file + - Exporting the following environment variables before running `rclone` + - Access Key ID: `QS_ACCESS_KEY_ID` or `QS_ACCESS_KEY` + - Secret Access Key: `QS_SECRET_ACCESS_KEY` or `QS_SECRET_KEY` - rclone copy /home/source remote:backup + ### Restricted filename characters -Getting your own Client ID and Key - -rclone uses a default Client ID when talking to OneDrive, unless a -custom client_id is specified in the config. The default Client ID and -Key are shared by all rclone users when performing requests. - -You may choose to create and use your own Client ID, in case the default -one does not work well for you. For example, you might see throttling. - -Creating Client ID for OneDrive Personal - -To create your own Client ID, please follow these steps: - -1. Open - https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade - and then click New registration. -2. Enter a name for your app, choose account type - Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox), - select Web in Redirect URI, then type (do not copy and paste) - http://localhost:53682/ and click Register. Copy and keep the - Application (client) ID under the app name for later use. -3. Under manage select Certificates & secrets, click New client secret. - Enter a description (can be anything) and set Expires to 24 months. - Copy and keep that secret Value for later use (you won't be able to - see this value afterwards). -4. Under manage select API permissions, click Add a permission and - select Microsoft Graph then select delegated permissions. -5. Search and select the following permissions: Files.Read, - Files.ReadWrite, Files.Read.All, Files.ReadWrite.All, - offline_access, User.Read and Sites.Read.All (if custom access - scopes are configured, select the permissions accordingly). Once - selected click Add permissions at the bottom. - -Now the application is complete. Run rclone config to create or edit a -OneDrive remote. Supply the app ID and password as Client ID and Secret, -respectively. rclone will walk you through the remaining steps. - -The access_scopes option allows you to configure the permissions -requested by rclone. See Microsoft Docs for more information about the -different scopes. - -The Sites.Read.All permission is required if you need to search -SharePoint sites when configuring the remote. However, if that -permission is not assigned, you need to exclude Sites.Read.All from your -access scopes or set disable_site_permission option to true in the -advanced options. - -Creating Client ID for OneDrive Business - -The steps for OneDrive Personal may or may not work for OneDrive -Business, depending on the security settings of the organization. A -common error is that the publisher of the App is not verified. - -You may try to verify you account, or try to limit the App to your -organization only, as shown below. - -1. Make sure to create the App with your business account. -2. Follow the steps above to create an App. However, we need a - different account type here: - Accounts in this organizational directory only (*** - Single tenant). - Note that you can also change the account type after creating the - App. -3. Find the tenant ID of your organization. -4. In the rclone config, set auth_url to - https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/authorize. -5. In the rclone config, set token_url to - https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token. - -Note: If you have a special region, you may need a different host in -step 4 and 5. Here are some hints. - -Modification time and hashes - -OneDrive allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. - -OneDrive Personal, OneDrive for Business and Sharepoint Server support -QuickXorHash. - -Before rclone 1.62 the default hash for Onedrive Personal was SHA1. For -rclone 1.62 and above the default for all Onedrive backends is -QuickXorHash. - -Starting from July 2023 SHA1 support is being phased out in Onedrive -Personal in favour of QuickXorHash. If necessary the ---onedrive-hash-type flag (or hash_type config option) can be used to -select SHA1 during the transition period if this is important your -workflow. - -For all types of OneDrive you can use the --checksum flag. + The control characters 0x00-0x1F and / are replaced as in the [default + restricted characters set](https://rclone.org/overview/#restricted-characters). Note + that 0x7F is not replaced. -Restricted filename characters + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -In addition to the default restricted characters set the following -characters are also replaced: - Character Value Replacement - ----------- ------- ------------- - " 0x22 " - * 0x2A * - : 0x3A : - < 0x3C < - > 0x3E > - ? 0x3F ? - \ 0x5C \ - | 0x7C | + ### Standard options -File names can also not end with the following characters. These only -get replaced if they are the last character in the name: + Here are the Standard options specific to qingstor (QingCloud Object Storage). - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ - . 0x2E . + #### --qingstor-env-auth -File names can also not begin with the following characters. These only -get replaced if they are the first character in the name: + Get QingStor credentials from runtime. - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ - ~ 0x7E ~ + Only applies if access_key_id and secret_access_key is blank. -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Properties: -Deleting files + - Config: env_auth + - Env Var: RCLONE_QINGSTOR_ENV_AUTH + - Type: bool + - Default: false + - Examples: + - "false" + - Enter QingStor credentials in the next step. + - "true" + - Get QingStor credentials from the environment (env vars or IAM). -Any files you delete with rclone will end up in the trash. Microsoft -doesn't provide an API to permanently delete files, nor to empty the -trash, so you will have to do that with one of Microsoft's apps or via -the OneDrive website. + #### --qingstor-access-key-id -Standard options + QingStor Access Key ID. -Here are the Standard options specific to onedrive (Microsoft OneDrive). + Leave blank for anonymous access or runtime credentials. ---onedrive-client-id + Properties: -OAuth Client Id. + - Config: access_key_id + - Env Var: RCLONE_QINGSTOR_ACCESS_KEY_ID + - Type: string + - Required: false -Leave blank normally. + #### --qingstor-secret-access-key -Properties: + QingStor Secret Access Key (password). -- Config: client_id -- Env Var: RCLONE_ONEDRIVE_CLIENT_ID -- Type: string -- Required: false + Leave blank for anonymous access or runtime credentials. ---onedrive-client-secret + Properties: -OAuth Client Secret. + - Config: secret_access_key + - Env Var: RCLONE_QINGSTOR_SECRET_ACCESS_KEY + - Type: string + - Required: false -Leave blank normally. + #### --qingstor-endpoint -Properties: + Enter an endpoint URL to connection QingStor API. -- Config: client_secret -- Env Var: RCLONE_ONEDRIVE_CLIENT_SECRET -- Type: string -- Required: false + Leave blank will use the default value "https://qingstor.com:443". ---onedrive-region + Properties: -Choose national cloud region for OneDrive. + - Config: endpoint + - Env Var: RCLONE_QINGSTOR_ENDPOINT + - Type: string + - Required: false -Properties: + #### --qingstor-zone -- Config: region -- Env Var: RCLONE_ONEDRIVE_REGION -- Type: string -- Default: "global" -- Examples: - - "global" - - Microsoft Cloud Global - - "us" - - Microsoft Cloud for US Government - - "de" - - Microsoft Cloud Germany - - "cn" - - Azure and Office 365 operated by Vnet Group in China + Zone to connect to. -Advanced options + Default is "pek3a". -Here are the Advanced options specific to onedrive (Microsoft OneDrive). + Properties: ---onedrive-token + - Config: zone + - Env Var: RCLONE_QINGSTOR_ZONE + - Type: string + - Required: false + - Examples: + - "pek3a" + - The Beijing (China) Three Zone. + - Needs location constraint pek3a. + - "sh1a" + - The Shanghai (China) First Zone. + - Needs location constraint sh1a. + - "gd2a" + - The Guangdong (China) Second Zone. + - Needs location constraint gd2a. -OAuth Access Token as a JSON blob. + ### Advanced options -Properties: + Here are the Advanced options specific to qingstor (QingCloud Object Storage). -- Config: token -- Env Var: RCLONE_ONEDRIVE_TOKEN -- Type: string -- Required: false + #### --qingstor-connection-retries ---onedrive-auth-url + Number of connection retries. -Auth server URL. + Properties: -Leave blank to use the provider defaults. + - Config: connection_retries + - Env Var: RCLONE_QINGSTOR_CONNECTION_RETRIES + - Type: int + - Default: 3 -Properties: + #### --qingstor-upload-cutoff -- Config: auth_url -- Env Var: RCLONE_ONEDRIVE_AUTH_URL -- Type: string -- Required: false + Cutoff for switching to chunked upload. ---onedrive-token-url + Any files larger than this will be uploaded in chunks of chunk_size. + The minimum is 0 and the maximum is 5 GiB. -Token server url. + Properties: -Leave blank to use the provider defaults. + - Config: upload_cutoff + - Env Var: RCLONE_QINGSTOR_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 200Mi -Properties: + #### --qingstor-chunk-size -- Config: token_url -- Env Var: RCLONE_ONEDRIVE_TOKEN_URL -- Type: string -- Required: false + Chunk size to use for uploading. ---onedrive-chunk-size + When uploading files larger than upload_cutoff they will be uploaded + as multipart uploads using this chunk size. -Chunk size to upload files with - must be multiple of 320k (327,680 -bytes). + Note that "--qingstor-upload-concurrency" chunks of this size are buffered + in memory per transfer. -Above this size files will be chunked - must be multiple of 320k -(327,680 bytes) and should not exceed 250M (262,144,000 bytes) else you -may encounter "Microsoft.SharePoint.Client.InvalidClientQueryException: -The request message is too big." Note that the chunks will be buffered -into memory. + If you are transferring large files over high-speed links and you have + enough memory, then increasing this will speed up the transfers. -Properties: + Properties: -- Config: chunk_size -- Env Var: RCLONE_ONEDRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 10Mi + - Config: chunk_size + - Env Var: RCLONE_QINGSTOR_CHUNK_SIZE + - Type: SizeSuffix + - Default: 4Mi ---onedrive-drive-id + #### --qingstor-upload-concurrency -The ID of the drive to use. + Concurrency for multipart uploads. -Properties: + This is the number of chunks of the same file that are uploaded + concurrently. -- Config: drive_id -- Env Var: RCLONE_ONEDRIVE_DRIVE_ID -- Type: string -- Required: false + NB if you set this to > 1 then the checksums of multipart uploads + become corrupted (the uploads themselves are not corrupted though). ---onedrive-drive-type + If you are uploading small numbers of large files over high-speed links + and these uploads do not fully utilize your bandwidth, then increasing + this may help to speed up the transfers. -The type of the drive (personal | business | documentLibrary). + Properties: -Properties: + - Config: upload_concurrency + - Env Var: RCLONE_QINGSTOR_UPLOAD_CONCURRENCY + - Type: int + - Default: 1 -- Config: drive_type -- Env Var: RCLONE_ONEDRIVE_DRIVE_TYPE -- Type: string -- Required: false + #### --qingstor-encoding ---onedrive-root-folder-id + The encoding for the backend. -ID of the root folder. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -This isn't normally needed, but in special circumstances you might know -the folder ID that you wish to access but not be able to get there -through a path traversal. + Properties: -Properties: + - Config: encoding + - Env Var: RCLONE_QINGSTOR_ENCODING + - Type: Encoding + - Default: Slash,Ctl,InvalidUtf8 -- Config: root_folder_id -- Env Var: RCLONE_ONEDRIVE_ROOT_FOLDER_ID -- Type: string -- Required: false ---onedrive-access-scopes -Set scopes to be requested by rclone. + ## Limitations -Choose or manually enter a custom space separated list with all scopes, -that rclone should request. + `rclone about` is not supported by the qingstor backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. -Properties: + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -- Config: access_scopes -- Env Var: RCLONE_ONEDRIVE_ACCESS_SCOPES -- Type: SpaceSepList -- Default: Files.Read Files.ReadWrite Files.Read.All - Files.ReadWrite.All Sites.Read.All offline_access -- Examples: - - "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All - Sites.Read.All offline_access" - - Read and write access to all resources - - "Files.Read Files.Read.All Sites.Read.All offline_access" - - Read only access to all resources - - "Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All - offline_access" - - Read and write access to all resources, without the ability - to browse SharePoint sites. - - Same as if disable_site_permission was set to true - ---onedrive-disable-site-permission - -Disable the request for Sites.Read.All permission. - -If set to true, you will no longer be able to search for a SharePoint -site when configuring drive ID, because rclone will not request -Sites.Read.All permission. Set it to true if your organization didn't -assign Sites.Read.All permission to the application, and your -organization disallows users to consent app permission request on their -own. + # Quatrix -Properties: + Quatrix by Maytech is [Quatrix Secure Compliant File Sharing | Maytech](https://www.maytech.net/products/quatrix-business). -- Config: disable_site_permission -- Env Var: RCLONE_ONEDRIVE_DISABLE_SITE_PERMISSION -- Type: bool -- Default: false + Paths are specified as `remote:path` ---onedrive-expose-onenote-files + Paths may be as deep as required, e.g., `remote:directory/subdirectory`. -Set to make OneNote files show up in directory listings. + The initial setup for Quatrix involves getting an API Key from Quatrix. You can get the API key in the user's profile at `https:///profile/api-keys` + or with the help of the API - https://docs.maytech.net/quatrix/quatrix-api/api-explorer#/API-Key/post_api_key_create. -By default, rclone will hide OneNote files in directory listings because -operations like "Open" and "Update" won't work on them. But this -behaviour may also prevent you from deleting them. If you want to delete -OneNote files or otherwise want them to show up in directory listing, -set this option. + See complete Swagger documentation for Quatrix - https://docs.maytech.net/quatrix/quatrix-api/api-explorer -Properties: + ## Configuration -- Config: expose_onenote_files -- Env Var: RCLONE_ONEDRIVE_EXPOSE_ONENOTE_FILES -- Type: bool -- Default: false + Here is an example of how to make a remote called `remote`. First run: + + rclone config ---onedrive-server-side-across-configs + This will guide you through an interactive setup process: -Allow server-side operations (e.g. copy) to work across different -onedrive configs. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Quatrix by Maytech  "quatrix" [snip] Storage> quatrix API key for +accessing Quatrix account. api_key> your_api_key Host name of Quatrix +account. host> example.quatrix.it -This will only work if you are copying between two OneDrive Personal -drives AND the files to copy are already shared between them. In other -cases, rclone will fall back to normal copy (which will be slightly -slower). + -------------------- + [remote] api_key = + your_api_key host = + example.quatrix.it + -------------------- + y) Yes this is OK e) + Edit this remote d) + Delete this remote + y/e/d> y ``` -Properties: + Once configured you + can then use rclone + like this, -- Config: server_side_across_configs -- Env Var: RCLONE_ONEDRIVE_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false + List directories in + top level of your + Quatrix + + rclone lsd remote: + + List all the files + in your Quatrix + + rclone ls remote: + + To copy a local + directory to an + Quatrix directory + called backup + + rclone copy + /home/source + remote:backup + + ### API key validity + + API Key is created + with no expiration + date. It will be + valid until you + delete or deactivate + it in your account. + After disabling, the + API Key can be + enabled back. If the + API Key was deleted + and a new key was + created, you can + update it in rclone + config. The same + happens if the + hostname was + changed. + + ``` $ rclone config + Current remotes: + + Name Type ==== ==== + remote quatrix + + e) Edit existing + remote n) New remote + d) Delete remote r) + Rename remote c) + Copy remote s) Set + configuration + password q) Quit + config + e/n/d/r/c/s/q> e + Choose a number from + below, or type in an + existing value 1 > + remote remote> + remote + -------------------- + +[remote] type = quatrix host = some_host.quatrix.it api_key = +your_api_key -------------------- Edit remote Option api_key. API key +for accessing Quatrix account Enter a string value. Press Enter for the +default (your_api_key) api_key> Option host. Host name of Quatrix +account Enter a string value. Press Enter for the default +(some_host.quatrix.it). + + -------------------------------------------------- + [remote] type = quatrix host = + some_host.quatrix.it api_key = your_api_key + -------------------------------------------------- + y) Yes this is OK e) Edit this remote d) Delete + this remote y/e/d> y ``` + + ### Modification times and hashes + + Quatrix allows modification times to be set on + objects accurate to 1 microsecond. These will be + used to detect whether objects need syncing or + not. + + Quatrix does not support hashes, so you cannot use + the --checksum flag. + + ### Restricted filename characters + + File names in Quatrix are case sensitive and have + limitations like the maximum length of a filename + is 255, and the minimum length is 1. A file name + cannot be equal to . or .. nor contain / , \ or + non-printable ascii. ---onedrive-list-chunk + ### Transfers -Size of listing chunk. + For files above 50 MiB rclone will use a chunked + transfer. Rclone will upload up to --transfers + chunks at the same time (shared among all + multipart uploads). Chunks are buffered in memory, + and the minimal chunk size is 10_000_000 bytes by + default, and it can be changed in the advanced + configuration, so increasing --transfers will + increase the memory use. The chunk size has a + maximum size limit, which is set to 100_000_000 + bytes by default and can be changed in the + advanced configuration. The size of the uploaded + chunk will dynamically change depending on the + upload speed. The total memory use equals the + number of transfers multiplied by the minimal + chunk size. In case there's free memory allocated + for the upload (which equals the difference of + maximal_summary_chunk_size and minimal_chunk_size + * transfers), the chunk size may increase in case + of high upload speed. As well as it can decrease + in case of upload speed problems. If no free + memory is available, all chunks will equal + minimal_chunk_size. -Properties: + ### Deleting files -- Config: list_chunk -- Env Var: RCLONE_ONEDRIVE_LIST_CHUNK -- Type: int -- Default: 1000 + Files you delete with rclone will end up in Trash + and be stored there for 30 days. Quatrix also + provides an API to permanently delete files and an + API to empty the Trash so that you can remove + files permanently from your account. ---onedrive-no-versions + ### Standard options -Remove all versions on modifying operations. + Here are the Standard options specific to quatrix + (Quatrix by Maytech). -Onedrive for business creates versions when rclone uploads new files -overwriting an existing one and when it sets the modification time. + #### --quatrix-api-key -These versions take up space out of the quota. + API key for accessing Quatrix account -This flag checks for versions after file upload and setting modification -time and removes all but the last version. + Properties: -NB Onedrive personal can't currently delete versions so don't use this -flag there. + - Config: api_key - Env Var: + RCLONE_QUATRIX_API_KEY - Type: string - Required: + true -Properties: + #### --quatrix-host -- Config: no_versions -- Env Var: RCLONE_ONEDRIVE_NO_VERSIONS -- Type: bool -- Default: false + Host name of Quatrix account ---onedrive-link-scope + Properties: -Set the scope of the links created by the link command. + - Config: host - Env Var: RCLONE_QUATRIX_HOST - + Type: string - Required: true -Properties: + ### Advanced options -- Config: link_scope -- Env Var: RCLONE_ONEDRIVE_LINK_SCOPE -- Type: string -- Default: "anonymous" -- Examples: - - "anonymous" - - Anyone with the link has access, without needing to sign in. - - This may include people outside of your organization. - - Anonymous link support may be disabled by an administrator. - - "organization" - - Anyone signed into your organization (tenant) can use the - link to get access. - - Only available in OneDrive for Business and SharePoint. + Here are the Advanced options specific to quatrix + (Quatrix by Maytech). ---onedrive-link-type + #### --quatrix-encoding -Set the type of the links created by the link command. + The encoding for the backend. -Properties: + See the encoding section in the overview for more + info. -- Config: link_type -- Env Var: RCLONE_ONEDRIVE_LINK_TYPE -- Type: string -- Default: "view" -- Examples: - - "view" - - Creates a read-only link to the item. - - "edit" - - Creates a read-write link to the item. - - "embed" - - Creates an embeddable link to the item. + Properties: ---onedrive-link-password + - Config: encoding - Env Var: + RCLONE_QUATRIX_ENCODING - Type: Encoding - + Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot -Set the password for links created by the link command. + #### --quatrix-effective-upload-time -At the time of writing this only works with OneDrive personal paid -accounts. + Wanted upload time for one chunk -Properties: + Properties: -- Config: link_password -- Env Var: RCLONE_ONEDRIVE_LINK_PASSWORD -- Type: string -- Required: false + - Config: effective_upload_time - Env Var: + RCLONE_QUATRIX_EFFECTIVE_UPLOAD_TIME - Type: + string - Default: "4s" ---onedrive-hash-type + #### --quatrix-minimal-chunk-size -Specify the hash in use for the backend. + The minimal size for one chunk -This specifies the hash type in use. If set to "auto" it will use the -default hash which is is QuickXorHash. + Properties: -Before rclone 1.62 an SHA1 hash was used by default for Onedrive -Personal. For 1.62 and later the default is to use a QuickXorHash for -all onedrive types. If an SHA1 hash is desired then set this option -accordingly. + - Config: minimal_chunk_size - Env Var: + RCLONE_QUATRIX_MINIMAL_CHUNK_SIZE - Type: + SizeSuffix - Default: 9.537Mi + + #### --quatrix-maximal-summary-chunk-size + + The maximal summary for all chunks. It should not + be less than 'transfers'*'minimal_chunk_size' -From July 2023 QuickXorHash will be the only available hash for both -OneDrive for Business and OneDriver Personal. + Properties: + + - Config: maximal_summary_chunk_size - Env Var: + RCLONE_QUATRIX_MAXIMAL_SUMMARY_CHUNK_SIZE - Type: + SizeSuffix - Default: 95.367Mi -This can be set to "none" to not use any hashes. + #### --quatrix-hard-delete -If the hash requested does not exist on the object, it will be returned -as an empty string which is treated as a missing hash by rclone. + Delete files permanently rather than putting them + into the trash. -Properties: + Properties: -- Config: hash_type -- Env Var: RCLONE_ONEDRIVE_HASH_TYPE -- Type: string -- Default: "auto" -- Examples: - - "auto" - - Rclone chooses the best hash - - "quickxor" - - QuickXor - - "sha1" - - SHA1 - - "sha256" - - SHA256 - - "crc32" - - CRC32 - - "none" - - None - don't use any hashes + - Config: hard_delete - Env Var: + RCLONE_QUATRIX_HARD_DELETE - Type: bool - Default: + false ---onedrive-encoding + ## Storage usage -The encoding for the backend. + The storage usage in Quatrix is restricted to the + account during the purchase. You can restrict any + user with a smaller storage limit. The account + limit is applied if the user has no custom storage + limit. Once you've reached the limit, the upload + of files will fail. This can be fixed by freeing + up the space or increasing the quota. -See the encoding section in the overview for more info. + ## Server-side operations + + Quatrix supports server-side operations (copy and + move). In case of conflict, files are overwritten + during server-side operation. -Properties: + # Sia -- Config: encoding -- Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder -- Default: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot + Sia (sia.tech) is a decentralized cloud storage + platform based on the blockchain technology. With + rclone you can use it like any other remote + filesystem or mount Sia folders locally. The + technology behind it involves a number of new + concepts such as Siacoins and Wallet, Blockchain + and Consensus, Renting and Hosting, and so on. If + you are new to it, you'd better first familiarize + yourself using their excellent support + documentation. -Limitations + ## Introduction -If you don't use rclone for 90 days the refresh token will expire. This -will result in authorization problems. This is easy to fix by running -the rclone config reconnect remote: command to get a new token and -refresh token. + Before you can use rclone with Sia, you will need + to have a running copy of Sia-UI or siad (the Sia + daemon) locally on your computer or on local + network (e.g. a NAS). Please follow the Get + started guide and install one. -Naming + rclone interacts with Sia network by talking to + the Sia daemon via HTTP API which is usually + available on port 9980. By default you will run + the daemon locally on the same computer so it's + safe to leave the API password blank (the API URL + will be http://127.0.0.1:9980 making external + access impossible). -Note that OneDrive is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + However, if you want to access Sia daemon running + on another node, for example due to memory + constraints or because you want to share single + daemon between several rclone and Sia-UI + instances, you'll need to make a few more + provisions: - Ensure you have Sia daemon installed + directly or in a docker container because Sia-UI + does not support this mode natively. - Run it on + externally accessible port, for example provide + --api-addr :9980 and --disable-api-security + arguments on the daemon command line. - Enforce + API password for the siad daemon via environment + variable SIA_API_PASSWORD or text file named + apipassword in the daemon directory. - Set rclone + backend option api_password taking it from above + locations. -There are quite a few characters that can't be in OneDrive file names. -These can't occur on Windows platforms, but on non-Windows platforms -they are common. Rclone will map these names to and from an identical -looking unicode equivalent. For example if a file has a ? in it will be -mapped to ? instead. + Notes: 1. If your wallet is locked, rclone cannot + unlock it automatically. You should either unlock + it in advance by using Sia-UI or via command line + siac wallet unlock. Alternatively you can make + siad unlock your wallet automatically upon startup + by running it with environment variable + SIA_WALLET_PASSWORD. 2. If siad cannot find the + SIA_API_PASSWORD variable or the apipassword file + in the SIA_DIR directory, it will generate a + random password and store in the text file named + apipassword under YOUR_HOME/.sia/ directory on + Unix or + C:\Users\YOUR_HOME\AppData\Local\Sia\apipassword + on Windows. Remember this when you configure + password in rclone. 3. The only way to use siad + without API password is to run it on localhost + with command line argument --authorize-api=false, + but this is insecure and strongly discouraged. + + ## Configuration + + Here is an example of how to make a sia remote + called mySia. First, run: + + rclone config + + This will guide you through an interactive setup + process: + + ``` No remotes found, make a new one? n) New + remote s) Set configuration password q) Quit + config n/s/q> n name> mySia Type of storage to + configure. Enter a string value. Press Enter for + the default (""). Choose a number from below, or + type in your own value ... 29 / Sia Decentralized + Cloud  "sia" ... Storage> sia Sia daemon API URL, + like http://sia.daemon.host:9980. Note that siad + must run with --disable-api-security to open API + port for other hosts (not recommended). Keep + default if Sia daemon runs on localhost. Enter a + string value. Press Enter for the default + ("http://127.0.0.1:9980"). api_url> + http://127.0.0.1:9980 Sia Daemon API Password. Can + be found in the apipassword file located in + HOME/.sia/ or in the daemon directory. y) Yes type + in my own password g) Generate random password n) + No leave this optional password blank (default) + y/g/n> y Enter the password: password: Confirm the + password: password: Edit advanced config? y) Yes + n) No (default) y/n> n + -------------------------------------------------- + +[mySia] type = sia api_url = http://127.0.0.1:9980 api_password = *** +ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit +this remote d) Delete this remote y/e/d> y + + + Once configured, you can then use `rclone` like this: + + - List directories in top level of your Sia storage + +rclone lsd mySia: + + + - List all the files in your Sia storage + +rclone ls mySia: + + + - Upload a local directory to the Sia directory called _backup_ + +rclone copy /home/source mySia:backup + + + + ### Standard options + + Here are the Standard options specific to sia (Sia Decentralized Cloud). + + #### --sia-api-url -File sizes + Sia daemon API URL, like http://sia.daemon.host:9980. -The largest allowed file size is 250 GiB for both OneDrive Personal and -OneDrive for Business (Updated 13 Jan 2021). + Note that siad must run with --disable-api-security to open API port for other hosts (not recommended). + Keep default if Sia daemon runs on localhost. -Path length + Properties: -The entire path, including the file name, must contain fewer than 400 -characters for OneDrive, OneDrive for Business and SharePoint Online. If -you are encrypting file and folder names with rclone, you may want to -pay attention to this limitation because the encrypted names are -typically longer than the original ones. + - Config: api_url + - Env Var: RCLONE_SIA_API_URL + - Type: string + - Default: "http://127.0.0.1:9980" -Number of files + #### --sia-api-password -OneDrive seems to be OK with at least 50,000 files in a folder, but at -100,000 rclone will get errors listing the directory like -couldn’t list files: UnknownError:. See #2707 for more info. + Sia Daemon API Password. -An official document about the limitations for different types of -OneDrive can be found here. + Can be found in the apipassword file located in HOME/.sia/ or in the daemon directory. -Versions + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Every change in a file OneDrive causes the service to create a new -version of the file. This counts against a users quota. For example -changing the modification time of a file creates a second version, so -the file apparently uses twice the space. - -For example the copy command is affected by this as rclone copies the -file and then afterwards sets the modification time to match the source -file which uses another version. - -You can use the rclone cleanup command (see below) to remove all old -versions. - -Or you can set the no_versions parameter to true and rclone will remove -versions after operations which create new versions. This takes extra -transactions so only enable it if you need it. - -Note At the time of writing Onedrive Personal creates versions (but not -for setting the modification time) but the API for removing them returns -"API not found" so cleanup and no_versions should not be used on -Onedrive Personal. - -Disabling versioning - -Starting October 2018, users will no longer be able to disable -versioning by default. This is because Microsoft has brought an update -to the mechanism. To change this new default setting, a PowerShell -command is required to be run by a SharePoint admin. If you are an -admin, you can run these commands in PowerShell to change that setting: - -1. Install-Module -Name Microsoft.Online.SharePoint.PowerShell (in case - you haven't installed this already) -2. Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking -3. Connect-SPOService -Url https://YOURSITE-admin.sharepoint.com -Credential YOU@YOURSITE.COM - (replacing YOURSITE, YOU, YOURSITE.COM with the actual values; this - will prompt for your credentials) -4. Set-SPOTenant -EnableMinimumVersionRequirement $False -5. Disconnect-SPOService (to disconnect from the server) - -Below are the steps for normal users to disable versioning. If you don't -see the "No Versioning" option, make sure the above requirements are -met. - -User Weropol has found a method to disable versioning on OneDrive - -1. Open the settings menu by clicking on the gear symbol at the top of - the OneDrive Business page. -2. Click Site settings. -3. Once on the Site settings page, navigate to Site Administration > - Site libraries and lists. -4. Click Customize "Documents". -5. Click General Settings > Versioning Settings. -6. Under Document Version History select the option No versioning. - Note: This will disable the creation of new file versions, but will - not remove any previous versions. Your documents are safe. -7. Apply the changes by clicking OK. -8. Use rclone to upload or modify files. (I also use the - --no-update-modtime flag) -9. Restore the versioning settings after using rclone. (Optional) + Properties: -Cleanup + - Config: api_password + - Env Var: RCLONE_SIA_API_PASSWORD + - Type: string + - Required: false -OneDrive supports rclone cleanup which causes rclone to look through -every file under the path supplied and delete all version but the -current version. Because this involves traversing all the files, then -querying each file for versions it can be quite slow. Rclone does ---checkers tests in parallel. The command also supports --interactive/i -or --dry-run which is a great way to see what it would do. + ### Advanced options - rclone cleanup --interactive remote:path/subdir # interactively remove all old version for path/subdir - rclone cleanup remote:path/subdir # unconditionally remove all old version for path/subdir + Here are the Advanced options specific to sia (Sia Decentralized Cloud). -NB Onedrive personal can't currently delete versions + #### --sia-user-agent -Troubleshooting + Siad User Agent -Excessive throttling or blocked on SharePoint + Sia daemon requires the 'Sia-Agent' user agent by default for security -If you experience excessive throttling or is being blocked on SharePoint -then it may help to set the user agent explicitly with a flag like this: ---user-agent "ISV|rclone.org|rclone/v1.55.1" + Properties: -The specific details can be found in the Microsoft document: Avoid -getting throttled or blocked in SharePoint Online + - Config: user_agent + - Env Var: RCLONE_SIA_USER_AGENT + - Type: string + - Default: "Sia-Agent" -Unexpected file size/hash differences on Sharepoint - -It is a known issue that Sharepoint (not OneDrive or OneDrive for -Business) silently modifies uploaded files, mainly Office files (.docx, -.xlsx, etc.), causing file size and hash checks to fail. There are also -other situations that will cause OneDrive to report inconsistent file -sizes. To use rclone with such affected files on Sharepoint, you may -disable these checks with the following command line arguments: + #### --sia-encoding - --ignore-checksum --ignore-size - -Alternatively, if you have write access to the OneDrive files, it may be -possible to fix this problem for certain files, by attempting the steps -below. Open the web interface for OneDrive and find the affected files -(which will be in the error messages/log for rclone). Simply click on -each of these files, causing OneDrive to open them on the web. This will -cause each file to be converted in place to a format that is -functionally equivalent but which will no longer trigger the size -discrepancy. Once all problematic files are converted you will no longer -need the ignore options above. + The encoding for the backend. -Replacing/deleting existing files on Sharepoint gets "item not found" + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -It is a known issue that Sharepoint (not OneDrive or OneDrive for -Business) may return "item not found" errors when users try to replace -or delete uploaded files; this seems to mainly affect Office files -(.docx, .xlsx, etc.) and web files (.html, .aspx, etc.). As a -workaround, you may use the --backup-dir command line -argument so rclone moves the files to be replaced/deleted into a given -backup directory (instead of directly replacing/deleting them). For -example, to instruct rclone to move the files into the directory -rclone-backup-dir on backend mysharepoint, you may use: + Properties: + + - Config: encoding + - Env Var: RCLONE_SIA_ENCODING + - Type: Encoding + - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot + + + + ## Limitations + + - Modification times not supported + - Checksums not supported + - `rclone about` not supported + - rclone can work only with _Siad_ or _Sia-UI_ at the moment, + the **SkyNet daemon is not supported yet.** + - Sia does not allow control characters or symbols like question and pound + signs in file names. rclone will transparently [encode](https://rclone.org/overview/#encoding) + them for you, but you'd better be aware + + # Swift + + Swift refers to [OpenStack Object Storage](https://docs.openstack.org/swift/latest/). + Commercial implementations of that being: + + * [Rackspace Cloud Files](https://www.rackspace.com/cloud/files/) + * [Memset Memstore](https://www.memset.com/cloud/storage/) + * [OVH Object Storage](https://www.ovh.co.uk/public-cloud/storage/object-storage/) + * [Oracle Cloud Storage](https://docs.oracle.com/en-us/iaas/integration/doc/configure-object-storage.html) + * [Blomp Cloud Storage](https://www.blomp.com/cloud-storage/) + * [IBM Bluemix Cloud ObjectStorage Swift](https://console.bluemix.net/docs/infrastructure/objectstorage-swift/index.html) + + Paths are specified as `remote:container` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:container/path/to/dir`. + + ## Configuration + + Here is an example of making a swift configuration. First run + + rclone config + + This will guide you through an interactive setup process. + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset +Memstore, OVH)  "swift" [snip] Storage> swift Get swift credentials from +environment variables in standard OpenStack form. Choose a number from +below, or type in your own value 1 / Enter swift credentials in the next +step  "false" 2 / Get swift credentials from environment vars. Leave +other fields blank if using this.  "true" env_auth> true User name to +log in (OS_USERNAME). user> API key or password (OS_PASSWORD). key> +Authentication URL for server (OS_AUTH_URL). Choose a number from below, +or type in your own value 1 / Rackspace US + "https://auth.api.rackspacecloud.com/v1.0" 2 / Rackspace UK + "https://lon.auth.api.rackspacecloud.com/v1.0" 3 / Rackspace v2 + "https://identity.api.rackspacecloud.com/v2.0" 4 / Memset Memstore UK + "https://auth.storage.memset.com/v1.0" 5 / Memset Memstore UK v2 + "https://auth.storage.memset.com/v2.0" 6 / OVH + "https://auth.cloud.ovh.net/v3" 7 / Blomp Cloud Storage + "https://authenticate.ain.net" auth> User ID to log in - optional - +most swift systems use user and leave this blank (v3 auth) (OS_USER_ID). +user_id> User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) domain> +Tenant name - optional for v1 auth, this or tenant_id required otherwise +(OS_TENANT_NAME or OS_PROJECT_NAME) tenant> Tenant ID - optional for v1 +auth, this or tenant required otherwise (OS_TENANT_ID) tenant_id> Tenant +domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) tenant_domain> +Region name - optional (OS_REGION_NAME) region> Storage URL - optional +(OS_STORAGE_URL) storage_url> Auth Token from alternate authentication - +optional (OS_AUTH_TOKEN) auth_token> AuthVersion - optional - set to +(1,2,3) if your auth URL has no version (ST_AUTH_VERSION) auth_version> +Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) +Choose a number from below, or type in your own value 1 / Public +(default, choose this if not sure)  "public" 2 / Internal (use internal +service net)  "internal" 3 / Admin  "admin" endpoint_type> Remote config +-------------------- [test] env_auth = true user = key = auth = user_id += domain = tenant = tenant_id = tenant_domain = region = storage_url = +auth_token = auth_version = endpoint_type = -------------------- y) Yes +this is OK e) Edit this remote d) Delete this remote y/e/d> y - --backup-dir mysharepoint:rclone-backup-dir -access_denied (AADSTS65005) + This remote is called `remote` and can now be used like this - Error: access_denied - Code: AADSTS65005 - Description: Using application 'rclone' is currently not supported for your organization [YOUR_ORGANIZATION] because it is in an unmanaged state. An administrator needs to claim ownership of the company by DNS validation of [YOUR_ORGANIZATION] before the application rclone can be provisioned. + See all containers -This means that rclone can't use the OneDrive for Business API with your -account. You can't do much about it, maybe write an email to your -admins. + rclone lsd remote: -However, there are other ways to interact with your OneDrive account. -Have a look at the WebDAV backend: https://rclone.org/webdav/#sharepoint + Make a new container -invalid_grant (AADSTS50076) + rclone mkdir remote:container - Error: invalid_grant - Code: AADSTS50076 - Description: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '...'. + List the contents of a container -If you see the error above after enabling multi-factor authentication -for your account, you can fix it by refreshing your OAuth refresh token. -To do that, run rclone config, and choose to edit your OneDrive backend. -Then, you don't need to actually make any changes until you reach this -question: Already have a token - refresh?. For this question, answer y -and go through the process to refresh your token, just like the first -time the backend is configured. After this, rclone should work again for -this backend. + rclone ls remote:container -Invalid request when making public links + Sync `/home/local/directory` to the remote container, deleting any + excess files in the container. -On Sharepoint and OneDrive for Business, rclone link may return an -"Invalid request" error. A possible cause is that the organisation admin -didn't allow public links to be made for the organisation/sharepoint -library. To fix the permissions as an admin, take a look at the docs: 1, -2. + rclone sync --interactive /home/local/directory remote:container -Can not access Shared with me files + ### Configuration from an OpenStack credentials file -Shared with me files is not supported by rclone currently, but there is -a workaround: + An OpenStack credentials file typically looks something something + like this (without the comments) -1. Visit https://onedrive.live.com -2. Right click a item in Shared, then click Add shortcut to My files in - the context [make_shortcut] -3. The shortcut will appear in My files, you can access it with rclone, - it behaves like a normal folder/file. [in_my_files] [rclone_mount] +export OS_AUTH_URL=https://a.provider.net/v2.0 export +OS_TENANT_ID=ffffffffffffffffffffffffffffffff export +OS_TENANT_NAME="1234567890123456" export OS_USERNAME="123abc567xy" echo +"Please enter your OpenStack Password: " read -sr OS_PASSWORD_INPUT +export +OS_PASSWORD=$OS_PASSWORD_INPUT export OS_REGION_NAME="SBG1" if [ -z "$OS_REGION_NAME" +]; then unset OS_REGION_NAME; fi -Live Photos uploaded from iOS (small video clips in .heic files) -The iOS OneDrive app introduced upload and storage of Live Photos in -2020. The usage and download of these uploaded Live Photos is -unfortunately still work-in-progress and this introduces several issues -when copying, synchronising and mounting – both in rclone and in the -native OneDrive client on Windows. + The config file needs to look something like this where `$OS_USERNAME` + represents the value of the `OS_USERNAME` variable - `123abc567xy` in + the example above. -The root cause can easily be seen if you locate one of your Live Photos -in the OneDrive web interface. Then download the photo from the web -interface. You will then see that the size of downloaded .heic file is -smaller than the size displayed in the web interface. The downloaded -file is smaller because it only contains a single frame (still photo) -extracted from the Live Photo (movie) stored in OneDrive. +[remote] type = swift user = $OS_USERNAME key = $OS_PASSWORD auth = +$OS_AUTH_URL tenant = $OS_TENANT_NAME -The different sizes will cause rclone copy/sync to repeatedly recopy -unmodified photos something like this: - DEBUG : 20230203_123826234_iOS.heic: Sizes differ (src 4470314 vs dst 1298667) - DEBUG : 20230203_123826234_iOS.heic: sha1 = fc2edde7863b7a7c93ca6771498ac797f8460750 OK - INFO : 20230203_123826234_iOS.heic: Copied (replaced existing) + Note that you may (or may not) need to set `region` too - try without first. -These recopies can be worked around by adding --ignore-size. Please note -that this workaround only syncs the still-picture not the movie clip, -and relies on modification dates being correctly updated on all files in -all situations. + ### Configuration from the environment -The different sizes will also cause rclone check to report size errors -something like this: + If you prefer you can configure rclone to use swift using a standard + set of OpenStack environment variables. - ERROR : 20230203_123826234_iOS.heic: sizes differ + When you run through the config, make sure you choose `true` for + `env_auth` and leave everything else blank. -These check errors can be suppressed by adding --ignore-size. + rclone will then set any empty config parameters from the environment + using standard OpenStack environment variables. There is [a list of + the + variables](https://godoc.org/github.com/ncw/swift#Connection.ApplyEnvironment) + in the docs for the swift library. -The different sizes will also cause rclone mount to fail downloading -with an error something like this: + ### Using an alternate authentication method - ERROR : 20230203_123826234_iOS.heic: ReadFileHandle.Read error: low level retry 1/10: unexpected EOF + If your OpenStack installation uses a non-standard authentication method + that might not be yet supported by rclone or the underlying swift library, + you can authenticate externally (e.g. calling manually the `openstack` + commands to get a token). Then, you just need to pass the two + configuration variables ``auth_token`` and ``storage_url``. + If they are both provided, the other variables are ignored. rclone will + not try to authenticate but instead assume it is already authenticated + and use these two variables to access the OpenStack installation. -or like this when using --cache-mode=full: + #### Using rclone without a config file - INFO : 20230203_123826234_iOS.heic: vfs cache: downloader: error count now 1: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable: - ERROR : 20230203_123826234_iOS.heic: vfs cache: failed to download: vfs reader: failed to write to cache file: 416 Requested Range Not Satisfiable: + You can use rclone with swift without a config file, if desired, like + this: -OpenDrive +source openstack-credentials-file export +RCLONE_CONFIG_MYREMOTE_TYPE=swift export +RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true rclone lsd myremote: -Paths are specified as remote:path -Paths may be as deep as required, e.g. remote:directory/subdirectory. + ### --fast-list -Configuration + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. -Here is an example of how to make a remote called remote. First run: + ### --update and --use-server-modtime - rclone config + As noted below, the modified time is stored on metadata on the object. It is + used by default for all operations that require checking the time a file was + last updated. It allows rclone to treat the remote more like a true filesystem, + but it is inefficient because it requires an extra API call to retrieve the + metadata. -This will guide you through an interactive setup process: + For many operations, the time the object was last uploaded to the remote is + sufficient to determine if it is "dirty". By using `--update` along with + `--use-server-modtime`, you can avoid the extra API call and simply upload + files whose local modtime is newer than the time it was last uploaded. - n) New remote - d) Delete remote - q) Quit config - e/n/d/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / OpenDrive - \ "opendrive" - [snip] - Storage> opendrive - Username - username> - Password - y) Yes type in my own password - g) Generate random password - y/g> y - Enter the password: - password: - Confirm the password: - password: - -------------------- - [remote] - username = - password = *** ENCRYPTED *** - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + ### Modification times and hashes -List directories in top level of your OpenDrive + The modified time is stored as metadata on the object as + `X-Object-Meta-Mtime` as floating point since the epoch accurate to 1 + ns. - rclone lsd remote: + This is a de facto standard (used in the official python-swiftclient + amongst others) for storing the modification time for an object. -List all the files in your OpenDrive + The MD5 hash algorithm is supported. - rclone ls remote: + ### Restricted filename characters -To copy a local directory to an OpenDrive directory called backup + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | / | 0x2F | / | - rclone copy /home/source remote:backup + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Modified time and MD5SUMs -OpenDrive allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. + ### Standard options -Restricted filename characters + Here are the Standard options specific to swift (OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)). - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - / 0x2F / - " 0x22 " - * 0x2A * - : 0x3A : - < 0x3C < - > 0x3E > - ? 0x3F ? - \ 0x5C \ - | 0x7C | + #### --swift-env-auth -File names can also not begin or end with the following characters. -These only get replaced if they are the first or last character in the -name: + Get swift credentials from environment variables in standard OpenStack form. - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ - HT 0x09 ␉ - LF 0x0A ␊ - VT 0x0B ␋ - CR 0x0D ␍ + Properties: -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + - Config: env_auth + - Env Var: RCLONE_SWIFT_ENV_AUTH + - Type: bool + - Default: false + - Examples: + - "false" + - Enter swift credentials in the next step. + - "true" + - Get swift credentials from environment vars. + - Leave other fields blank if using this. -Standard options + #### --swift-user -Here are the Standard options specific to opendrive (OpenDrive). + User name to log in (OS_USERNAME). ---opendrive-username + Properties: -Username. + - Config: user + - Env Var: RCLONE_SWIFT_USER + - Type: string + - Required: false -Properties: + #### --swift-key -- Config: username -- Env Var: RCLONE_OPENDRIVE_USERNAME -- Type: string -- Required: true + API key or password (OS_PASSWORD). ---opendrive-password + Properties: -Password. + - Config: key + - Env Var: RCLONE_SWIFT_KEY + - Type: string + - Required: false -NB Input to this must be obscured - see rclone obscure. + #### --swift-auth -Properties: + Authentication URL for server (OS_AUTH_URL). -- Config: password -- Env Var: RCLONE_OPENDRIVE_PASSWORD -- Type: string -- Required: true + Properties: + + - Config: auth + - Env Var: RCLONE_SWIFT_AUTH + - Type: string + - Required: false + - Examples: + - "https://auth.api.rackspacecloud.com/v1.0" + - Rackspace US + - "https://lon.auth.api.rackspacecloud.com/v1.0" + - Rackspace UK + - "https://identity.api.rackspacecloud.com/v2.0" + - Rackspace v2 + - "https://auth.storage.memset.com/v1.0" + - Memset Memstore UK + - "https://auth.storage.memset.com/v2.0" + - Memset Memstore UK v2 + - "https://auth.cloud.ovh.net/v3" + - OVH + - "https://authenticate.ain.net" + - Blomp Cloud Storage + + #### --swift-user-id -Advanced options + User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID). -Here are the Advanced options specific to opendrive (OpenDrive). + Properties: ---opendrive-encoding + - Config: user_id + - Env Var: RCLONE_SWIFT_USER_ID + - Type: string + - Required: false -The encoding for the backend. + #### --swift-domain -See the encoding section in the overview for more info. + User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) -Properties: + Properties: -- Config: encoding -- Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder -- Default: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot + - Config: domain + - Env Var: RCLONE_SWIFT_DOMAIN + - Type: string + - Required: false ---opendrive-chunk-size + #### --swift-tenant -Files will be uploaded in chunks this size. + Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME). -Note that these chunks are buffered in memory so increasing them will -increase memory use. + Properties: -Properties: + - Config: tenant + - Env Var: RCLONE_SWIFT_TENANT + - Type: string + - Required: false -- Config: chunk_size -- Env Var: RCLONE_OPENDRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 10Mi + #### --swift-tenant-id -Limitations + Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID). -Note that OpenDrive is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". + Properties: -There are quite a few characters that can't be in OpenDrive file names. -These can't occur on Windows platforms, but on non-Windows platforms -they are common. Rclone will map these names to and from an identical -looking unicode equivalent. For example if a file has a ? in it will be -mapped to ? instead. + - Config: tenant_id + - Env Var: RCLONE_SWIFT_TENANT_ID + - Type: string + - Required: false -rclone about is not supported by the OpenDrive backend. Backends without -this capability cannot determine free space for an rclone mount or use -policy mfs (most free space) as a member of an rclone union remote. + #### --swift-tenant-domain -See List of backends that do not support rclone about and rclone about + Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME). -Oracle Object Storage + Properties: -Oracle Object Storage Overview + - Config: tenant_domain + - Env Var: RCLONE_SWIFT_TENANT_DOMAIN + - Type: string + - Required: false -Oracle Object Storage FAQ + #### --swift-region -Paths are specified as remote:bucket (or remote: for the lsd command.) -You may put subdirectories in too, e.g. remote:bucket/path/to/dir. + Region name - optional (OS_REGION_NAME). -Configuration + Properties: -Here is an example of making an oracle object storage configuration. -rclone config walks you through it. + - Config: region + - Env Var: RCLONE_SWIFT_REGION + - Type: string + - Required: false -Here is an example of how to make a remote called remote. First run: + #### --swift-storage-url - rclone config + Storage URL - optional (OS_STORAGE_URL). -This will guide you through an interactive setup process: + Properties: - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> n + - Config: storage_url + - Env Var: RCLONE_SWIFT_STORAGE_URL + - Type: string + - Required: false - Enter name for new remote. - name> remote + #### --swift-auth-token - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - XX / Oracle Cloud Infrastructure Object Storage - \ (oracleobjectstorage) - Storage> oracleobjectstorage + Auth Token from alternate authentication - optional (OS_AUTH_TOKEN). - Option provider. - Choose your Auth Provider - Choose a number from below, or type in your own string value. - Press Enter for the default (env_auth). - 1 / automatically pickup the credentials from runtime(env), first one to provide auth wins - \ (env_auth) - / use an OCI user and an API key for authentication. - 2 | you’ll need to put in a config file your tenancy OCID, user OCID, region, the path, fingerprint to an API key. - | https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm - \ (user_principal_auth) - / use instance principals to authorize an instance to make API calls. - 3 | each instance has its own identity, and authenticates using the certificates that are read from instance metadata. - | https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm - \ (instance_principal_auth) - 4 / use resource principals to make API calls - \ (resource_principal_auth) - 5 / no credentials needed, this is typically for reading public buckets - \ (no_auth) - provider> 2 - - Option namespace. - Object storage namespace - Enter a value. - namespace> idbamagbg734 + Properties: - Option compartment. - Object storage compartment OCID - Enter a value. - compartment> ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba + - Config: auth_token + - Env Var: RCLONE_SWIFT_AUTH_TOKEN + - Type: string + - Required: false - Option region. - Object storage Region - Enter a value. - region> us-ashburn-1 + #### --swift-application-credential-id - Option endpoint. - Endpoint for Object storage API. - Leave blank to use the default endpoint for the region. - Enter a value. Press Enter to leave empty. - endpoint> - - Option config_file. - Full Path to OCI config file - Choose a number from below, or type in your own string value. - Press Enter for the default (~/.oci/config). - 1 / oci configuration file location - \ (~/.oci/config) - config_file> /etc/oci/dev.conf - - Option config_profile. - Profile name inside OCI config file - Choose a number from below, or type in your own string value. - Press Enter for the default (Default). - 1 / Use the default profile - \ (Default) - config_profile> Test + Application Credential ID (OS_APPLICATION_CREDENTIAL_ID). + + Properties: - Edit advanced config? - y) Yes - n) No (default) - y/n> n + - Config: application_credential_id + - Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_ID + - Type: string + - Required: false - Configuration complete. - Options: - - type: oracleobjectstorage - - namespace: idbamagbg734 - - compartment: ocid1.compartment.oc1..aaaaaaaapufkxc7ame3sthry5i7ujrwfc7ejnthhu6bhanm5oqfjpyasjkba - - region: us-ashburn-1 - - provider: user_principal_auth - - config_file: /etc/oci/dev.conf - - config_profile: Test - Keep this "remote" remote? - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + #### --swift-application-credential-name -See all buckets + Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME). - rclone lsd remote: + Properties: -Create a new bucket + - Config: application_credential_name + - Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_NAME + - Type: string + - Required: false - rclone mkdir remote:bucket + #### --swift-application-credential-secret -List the contents of a bucket + Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET). - rclone ls remote:bucket - rclone ls remote:bucket --max-depth 1 + Properties: -OCI Authentication Provider - -OCI has various authentication methods. To learn more about -authentication methods please refer oci authentication methods These -choices can be specified in the rclone config file. + - Config: application_credential_secret + - Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_SECRET + - Type: string + - Required: false -Rclone supports the following OCI authentication provider. + #### --swift-auth-version - User Principal - Instance Principal - Resource Principal - No authentication + AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION). -Authentication provider choice: User Principal + Properties: -Sample rclone config file for Authentication Provider User Principal: + - Config: auth_version + - Env Var: RCLONE_SWIFT_AUTH_VERSION + - Type: int + - Default: 0 - [oos] - type = oracleobjectstorage - namespace = id34 - compartment = ocid1.compartment.oc1..aaba - region = us-ashburn-1 - provider = user_principal_auth - config_file = /home/opc/.oci/config - config_profile = Default + #### --swift-endpoint-type -Advantages: - One can use this method from any server within OCI or -on-premises or from other cloud provider. + Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE). -Considerations: - you need to configure user’s privileges / policy to -allow access to object storage - Overhead of managing users and keys. - -If the user is deleted, the config file will no longer work and may -cause automation regressions that use the user's credentials. + Properties: -Authentication provider choice: Instance Principal + - Config: endpoint_type + - Env Var: RCLONE_SWIFT_ENDPOINT_TYPE + - Type: string + - Default: "public" + - Examples: + - "public" + - Public (default, choose this if not sure) + - "internal" + - Internal (use internal service net) + - "admin" + - Admin -An OCI compute instance can be authorized to use rclone by using it's -identity and certificates as an instance principal. With this approach -no credentials have to be stored and managed. + #### --swift-storage-policy -Sample rclone configuration file for Authentication Provider Instance -Principal: + The storage policy to use when creating a new container. - [opc@rclone ~]$ cat ~/.config/rclone/rclone.conf - [oos] - type = oracleobjectstorage - namespace = idfn - compartment = ocid1.compartment.oc1..aak7a - region = us-ashburn-1 - provider = instance_principal_auth + This applies the specified storage policy when creating a new + container. The policy cannot be changed afterwards. The allowed + configuration values and their meaning depend on your Swift storage + provider. -Advantages: + Properties: -- With instance principals, you don't need to configure user - credentials and transfer/ save it to disk in your compute instances - or rotate the credentials. -- You don’t need to deal with users and keys. -- Greatly helps in automation as you don't have to manage access keys, - user private keys, storing them in vault, using kms etc. + - Config: storage_policy + - Env Var: RCLONE_SWIFT_STORAGE_POLICY + - Type: string + - Required: false + - Examples: + - "" + - Default + - "pcs" + - OVH Public Cloud Storage + - "pca" + - OVH Public Cloud Archive -Considerations: + ### Advanced options -- You need to configure a dynamic group having this instance as member - and add policy to read object storage to that dynamic group. -- Everyone who has access to this machine can execute the CLI - commands. -- It is applicable for oci compute instances only. It cannot be used - on external instance or resources. + Here are the Advanced options specific to swift (OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)). -Authentication provider choice: Resource Principal + #### --swift-leave-parts-on-error -Resource principal auth is very similar to instance principal auth but -used for resources that are not compute instances such as serverless -functions. To use resource principal ensure Rclone process is started -with these environment variables set in its process. + If true avoid calling abort upload on a failure. - export OCI_RESOURCE_PRINCIPAL_VERSION=2.2 - export OCI_RESOURCE_PRINCIPAL_REGION=us-ashburn-1 - export OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM=/usr/share/model-server/key.pem - export OCI_RESOURCE_PRINCIPAL_RPST=/usr/share/model-server/security_token + It should be set to true for resuming uploads across different sessions. -Sample rclone configuration file for Authentication Provider Resource -Principal: + Properties: - [oos] - type = oracleobjectstorage - namespace = id34 - compartment = ocid1.compartment.oc1..aaba - region = us-ashburn-1 - provider = resource_principal_auth + - Config: leave_parts_on_error + - Env Var: RCLONE_SWIFT_LEAVE_PARTS_ON_ERROR + - Type: bool + - Default: false -Authentication provider choice: No authentication + #### --swift-chunk-size -Public buckets do not require any authentication mechanism to read -objects. Sample rclone configuration file for No authentication: + Above this size files will be chunked into a _segments container. - [oos] - type = oracleobjectstorage - namespace = id34 - compartment = ocid1.compartment.oc1..aaba - region = us-ashburn-1 - provider = no_auth + Above this size files will be chunked into a _segments container. The + default for this is 5 GiB which is its maximum value. -Options + Properties: -Modified time + - Config: chunk_size + - Env Var: RCLONE_SWIFT_CHUNK_SIZE + - Type: SizeSuffix + - Default: 5Gi -The modified time is stored as metadata on the object as opc-meta-mtime -as floating point since the epoch, accurate to 1 ns. + #### --swift-no-chunk -If the modification time needs to be updated rclone will attempt to -perform a server side copy to update the modification if the object can -be copied in a single part. In the case the object is larger than 5Gb, -the object will be uploaded rather than copied. + Don't chunk files during streaming upload. -Note that reading this from the object takes an additional HEAD request -as the metadata isn't returned in object listings. + When doing streaming uploads (e.g. using rcat or mount) setting this + flag will cause the swift backend to not upload chunked files. -Multipart uploads + This will limit the maximum upload size to 5 GiB. However non chunked + files are easier to deal with and have an MD5SUM. -rclone supports multipart uploads with OOS which means that it can -upload files bigger than 5 GiB. + Rclone will still chunk files bigger than chunk_size when doing normal + copy operations. -Note that files uploaded both with multipart upload and through crypt -remotes do not have MD5 sums. + Properties: -rclone switches from single part uploads to multipart uploads at the -point specified by --oos-upload-cutoff. This can be a maximum of 5 GiB -and a minimum of 0 (ie always upload multipart files). + - Config: no_chunk + - Env Var: RCLONE_SWIFT_NO_CHUNK + - Type: bool + - Default: false -The chunk sizes used in the multipart upload are specified by ---oos-chunk-size and the number of chunks uploaded concurrently is -specified by --oos-upload-concurrency. + #### --swift-no-large-objects -Multipart uploads will use --transfers * --oos-upload-concurrency * ---oos-chunk-size extra memory. Single part uploads to not use extra -memory. + Disable support for static and dynamic large objects -Single part transfers can be faster than multipart transfers or slower -depending on your latency from oos - the more latency, the more likely -single part transfers will be faster. + Swift cannot transparently store files bigger than 5 GiB. There are + two schemes for doing that, static or dynamic large objects, and the + API does not allow rclone to determine whether a file is a static or + dynamic large object without doing a HEAD on the object. Since these + need to be treated differently, this means rclone has to issue HEAD + requests for objects for example when reading checksums. -Increasing --oos-upload-concurrency will increase throughput (8 would be -a sensible value) and increasing --oos-chunk-size also increases -throughput (16M would be sensible). Increasing either of these will use -more memory. The default values are high enough to gain most of the -possible performance without using too much memory. + When `no_large_objects` is set, rclone will assume that there are no + static or dynamic large objects stored. This means it can stop doing + the extra HEAD calls which in turn increases performance greatly + especially when doing a swift to swift transfer with `--checksum` set. -Standard options + Setting this option implies `no_chunk` and also that no files will be + uploaded in chunks, so files bigger than 5 GiB will just fail on + upload. -Here are the Standard options specific to oracleobjectstorage (Oracle -Cloud Infrastructure Object Storage). + If you set this option and there *are* static or dynamic large objects, + then this will give incorrect hashes for them. Downloads will succeed, + but other operations such as Remove and Copy will fail. ---oos-provider -Choose your Auth Provider + Properties: -Properties: + - Config: no_large_objects + - Env Var: RCLONE_SWIFT_NO_LARGE_OBJECTS + - Type: bool + - Default: false -- Config: provider -- Env Var: RCLONE_OOS_PROVIDER -- Type: string -- Default: "env_auth" -- Examples: - - "env_auth" - - automatically pickup the credentials from runtime(env), - first one to provide auth wins - - "user_principal_auth" - - use an OCI user and an API key for authentication. - - you’ll need to put in a config file your tenancy OCID, user - OCID, region, the path, fingerprint to an API key. - - https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm - - "instance_principal_auth" - - use instance principals to authorize an instance to make API - calls. - - each instance has its own identity, and authenticates using - the certificates that are read from instance metadata. - - https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm - - "resource_principal_auth" - - use resource principals to make API calls - - "no_auth" - - no credentials needed, this is typically for reading public - buckets - ---oos-namespace - -Object storage namespace + #### --swift-encoding -Properties: + The encoding for the backend. -- Config: namespace -- Env Var: RCLONE_OOS_NAMESPACE -- Type: string -- Required: true + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. ---oos-compartment + Properties: -Object storage compartment OCID + - Config: encoding + - Env Var: RCLONE_SWIFT_ENCODING + - Type: Encoding + - Default: Slash,InvalidUtf8 -Properties: -- Config: compartment -- Env Var: RCLONE_OOS_COMPARTMENT -- Provider: !no_auth -- Type: string -- Required: true ---oos-region + ## Limitations -Object storage Region + The Swift API doesn't return a correct MD5SUM for segmented files + (Dynamic or Static Large Objects) so rclone won't check or use the + MD5SUM for these. -Properties: + ## Troubleshooting -- Config: region -- Env Var: RCLONE_OOS_REGION -- Type: string -- Required: true + ### Rclone gives Failed to create file system for "remote:": Bad Request ---oos-endpoint + Due to an oddity of the underlying swift library, it gives a "Bad + Request" error rather than a more sensible error when the + authentication fails for Swift. -Endpoint for Object storage API. + So this most likely means your username / password is wrong. You can + investigate further with the `--dump-bodies` flag. -Leave blank to use the default endpoint for the region. + This may also be caused by specifying the region when you shouldn't + have (e.g. OVH). -Properties: + ### Rclone gives Failed to create file system: Response didn't have storage url and auth token -- Config: endpoint -- Env Var: RCLONE_OOS_ENDPOINT -- Type: string -- Required: false + This is most likely caused by forgetting to specify your tenant when + setting up a swift remote. ---oos-config-file + ## OVH Cloud Archive -Path to OCI config file + To use rclone with OVH cloud archive, first use `rclone config` to set up a `swift` backend with OVH, choosing `pca` as the `storage_policy`. -Properties: + ### Uploading Objects -- Config: config_file -- Env Var: RCLONE_OOS_CONFIG_FILE -- Provider: user_principal_auth -- Type: string -- Default: "~/.oci/config" -- Examples: - - "~/.oci/config" - - oci configuration file location + Uploading objects to OVH cloud archive is no different to object storage, you just simply run the command you like (move, copy or sync) to upload the objects. Once uploaded the objects will show in a "Frozen" state within the OVH control panel. ---oos-config-profile + ### Retrieving Objects -Profile name inside the oci config file + To retrieve objects use `rclone copy` as normal. If the objects are in a frozen state then rclone will ask for them all to be unfrozen and it will wait at the end of the output with a message like the following: -Properties: + `2019/03/23 13:06:33 NOTICE: Received retry after error - sleeping until 2019-03-23T13:16:33.481657164+01:00 (9m59.99985121s)` -- Config: config_profile -- Env Var: RCLONE_OOS_CONFIG_PROFILE -- Provider: user_principal_auth -- Type: string -- Default: "Default" -- Examples: - - "Default" - - Use the default profile + Rclone will wait for the time specified then retry the copy. -Advanced options + # pCloud -Here are the Advanced options specific to oracleobjectstorage (Oracle -Cloud Infrastructure Object Storage). + Paths are specified as `remote:path` ---oos-storage-tier + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -The storage class to use when storing new objects in storage. -https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm + ## Configuration -Properties: + The initial setup for pCloud involves getting a token from pCloud which you + need to do in your browser. `rclone config` walks you through it. -- Config: storage_tier -- Env Var: RCLONE_OOS_STORAGE_TIER -- Type: string -- Default: "Standard" -- Examples: - - "Standard" - - Standard storage tier, this is the default tier - - "InfrequentAccess" - - InfrequentAccess storage tier - - "Archive" - - Archive storage tier + Here is an example of how to make a remote called `remote`. First run: ---oos-upload-cutoff + rclone config -Cutoff for switching to chunked upload. + This will guide you through an interactive setup process: -Any files larger than this will be uploaded in chunks of chunk_size. The -minimum is 0 and the maximum is 5 GiB. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Pcloud  "pcloud" [snip] Storage> pcloud Pcloud App Client Id - +leave blank normally. client_id> Pcloud App Client Secret - leave blank +normally. client_secret> Remote config Use web browser to automatically +authenticate rclone with remote? * Say Y if the machine running rclone +has a web browser you can use * Say N if running rclone on a (remote) +machine without web browser access If not sure try Y. If Y failed, try +N. y) Yes n) No y/n> y If your browser doesn't open automatically go to +the following link: http://127.0.0.1:53682/auth Log in and authorize +rclone for access Waiting for code... Got code -------------------- +[remote] client_id = client_secret = token = +{"access_token":"XXX","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y -Properties: -- Config: upload_cutoff -- Env Var: RCLONE_OOS_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. ---oos-chunk-size + Note that rclone runs a webserver on your local machine to collect the + token as returned from pCloud. This only runs from the moment it opens + your browser to the moment you get back the verification code. This + is on `http://127.0.0.1:53682/` and this it may require you to unblock + it temporarily if you are running a host firewall. -Chunk size to use for uploading. + Once configured you can then use `rclone` like this, -When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads using -this chunk size. + List directories in top level of your pCloud -Note that "upload_concurrency" chunks of this size are buffered in -memory per transfer. + rclone lsd remote: -If you are transferring large files over high-speed links and you have -enough memory, then increasing this will speed up the transfers. + List all the files in your pCloud -Rclone will automatically increase the chunk size when uploading a large -file of known size to stay below the 10,000 chunks limit. + rclone ls remote: -Files of unknown size are uploaded with the configured chunk_size. Since -the default chunk size is 5 MiB and there can be at most 10,000 chunks, -this means that by default the maximum size of a file you can stream -upload is 48 GiB. If you wish to stream upload larger files then you -will need to increase chunk_size. + To copy a local directory to a pCloud directory called backup -Increasing the chunk size decreases the accuracy of the progress -statistics displayed with "-P" flag. + rclone copy /home/source remote:backup -Properties: + ### Modification times and hashes -- Config: chunk_size -- Env Var: RCLONE_OOS_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi + pCloud allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. In order to set a Modification time pCloud requires the object + be re-uploaded. ---oos-upload-concurrency + pCloud supports MD5 and SHA1 hashes in the US region, and SHA1 and SHA256 + hashes in the EU region, so you can use the `--checksum` flag. -Concurrency for multipart uploads. + ### Restricted filename characters -This is the number of chunks of the same file that are uploaded -concurrently. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | -Properties: + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -- Config: upload_concurrency -- Env Var: RCLONE_OOS_UPLOAD_CONCURRENCY -- Type: int -- Default: 10 + ### Deleting files ---oos-copy-cutoff + Deleted files will be moved to the trash. Your subscription level + will determine how long items stay in the trash. `rclone cleanup` can + be used to empty the trash. -Cutoff for switching to multipart copy. + ### Emptying the trash -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. + Due to an API limitation, the `rclone cleanup` command will only work if you + set your username and password in the advanced options for this backend. + Since we generally want to avoid storing user passwords in the rclone config + file, we advise you to only set this up if you need the `rclone cleanup` command to work. -The minimum is 0 and the maximum is 5 GiB. + ### Root folder ID -Properties: + You can set the `root_folder_id` for rclone. This is the directory + (identified by its `Folder ID`) that rclone considers to be the root + of your pCloud drive. -- Config: copy_cutoff -- Env Var: RCLONE_OOS_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4.656Gi + Normally you will leave this blank and rclone will determine the + correct root to use itself. ---oos-copy-timeout + However you can set this to restrict rclone to a specific folder + hierarchy. -Timeout for copy. + In order to do this you will have to find the `Folder ID` of the + directory you wish rclone to display. This will be the `folder` field + of the URL when you open the relevant folder in the pCloud web + interface. -Copy is an asynchronous operation, specify timeout to wait for copy to -succeed + So if the folder you want rclone to use has a URL which looks like + `https://my.pcloud.com/#page=filemanager&folder=5xxxxxxxx8&tpl=foldergrid` + in the browser, then you use `5xxxxxxxx8` as + the `root_folder_id` in the config. -Properties: -- Config: copy_timeout -- Env Var: RCLONE_OOS_COPY_TIMEOUT -- Type: Duration -- Default: 1m0s + ### Standard options ---oos-disable-checksum + Here are the Standard options specific to pcloud (Pcloud). -Don't store MD5 checksum with object metadata. + #### --pcloud-client-id -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files to -start uploading. + OAuth Client Id. -Properties: + Leave blank normally. -- Config: disable_checksum -- Env Var: RCLONE_OOS_DISABLE_CHECKSUM -- Type: bool -- Default: false + Properties: ---oos-encoding + - Config: client_id + - Env Var: RCLONE_PCLOUD_CLIENT_ID + - Type: string + - Required: false -The encoding for the backend. + #### --pcloud-client-secret -See the encoding section in the overview for more info. + OAuth Client Secret. -Properties: + Leave blank normally. -- Config: encoding -- Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot + Properties: ---oos-leave-parts-on-error + - Config: client_secret + - Env Var: RCLONE_PCLOUD_CLIENT_SECRET + - Type: string + - Required: false -If true avoid calling abort upload on a failure, leaving all -successfully uploaded parts on S3 for manual recovery. + ### Advanced options -It should be set to true for resuming uploads across different sessions. + Here are the Advanced options specific to pcloud (Pcloud). -WARNING: Storing parts of an incomplete multipart upload counts towards -space usage on object storage and will add additional costs if not -cleaned up. + #### --pcloud-token -Properties: + OAuth Access Token as a JSON blob. -- Config: leave_parts_on_error -- Env Var: RCLONE_OOS_LEAVE_PARTS_ON_ERROR -- Type: bool -- Default: false + Properties: ---oos-no-check-bucket + - Config: token + - Env Var: RCLONE_PCLOUD_TOKEN + - Type: string + - Required: false -If set, don't attempt to check the bucket exists or create it. + #### --pcloud-auth-url -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. + Auth server URL. -It can also be needed if the user you are using does not have bucket -creation permissions. + Leave blank to use the provider defaults. -Properties: + Properties: -- Config: no_check_bucket -- Env Var: RCLONE_OOS_NO_CHECK_BUCKET -- Type: bool -- Default: false + - Config: auth_url + - Env Var: RCLONE_PCLOUD_AUTH_URL + - Type: string + - Required: false ---oos-sse-customer-key-file + #### --pcloud-token-url -To use SSE-C, a file containing the base64-encoded string of the AES-256 -encryption key associated with the object. Please note only one of -sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.' + Token server url. -Properties: + Leave blank to use the provider defaults. -- Config: sse_customer_key_file -- Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY_FILE -- Type: string -- Required: false -- Examples: - - "" - - None + Properties: ---oos-sse-customer-key + - Config: token_url + - Env Var: RCLONE_PCLOUD_TOKEN_URL + - Type: string + - Required: false -To use SSE-C, the optional header that specifies the base64-encoded -256-bit encryption key to use to encrypt or decrypt the data. Please -note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id -is needed. For more information, see Using Your Own Keys for Server-Side -Encryption -(https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm) + #### --pcloud-encoding -Properties: + The encoding for the backend. -- Config: sse_customer_key -- Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY -- Type: string -- Required: false -- Examples: - - "" - - None + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. ---oos-sse-customer-key-sha256 + Properties: -If using SSE-C, The optional header that specifies the base64-encoded -SHA256 hash of the encryption key. This value is used to check the -integrity of the encryption key. see Using Your Own Keys for Server-Side -Encryption -(https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). + - Config: encoding + - Env Var: RCLONE_PCLOUD_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot -Properties: + #### --pcloud-root-folder-id -- Config: sse_customer_key_sha256 -- Env Var: RCLONE_OOS_SSE_CUSTOMER_KEY_SHA256 -- Type: string -- Required: false -- Examples: - - "" - - None + Fill in for rclone to use a non root folder as its starting point. ---oos-sse-kms-key-id + Properties: -if using using your own master key in vault, this header specifies the -OCID -(https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) -of a master encryption key used to call the Key Management service to -generate a data encryption key or to encrypt or decrypt a data -encryption key. Please note only one of -sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed. + - Config: root_folder_id + - Env Var: RCLONE_PCLOUD_ROOT_FOLDER_ID + - Type: string + - Default: "d0" -Properties: + #### --pcloud-hostname -- Config: sse_kms_key_id -- Env Var: RCLONE_OOS_SSE_KMS_KEY_ID -- Type: string -- Required: false -- Examples: - - "" - - None + Hostname to connect to. ---oos-sse-customer-algorithm + This is normally set when rclone initially does the oauth connection, + however you will need to set it by hand if you are using remote config + with rclone authorize. -If using SSE-C, the optional header that specifies "AES256" as the -encryption algorithm. Object Storage supports "AES256" as the encryption -algorithm. For more information, see Using Your Own Keys for Server-Side -Encryption -(https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). -Properties: + Properties: -- Config: sse_customer_algorithm -- Env Var: RCLONE_OOS_SSE_CUSTOMER_ALGORITHM -- Type: string -- Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 + - Config: hostname + - Env Var: RCLONE_PCLOUD_HOSTNAME + - Type: string + - Default: "api.pcloud.com" + - Examples: + - "api.pcloud.com" + - Original/US region + - "eapi.pcloud.com" + - EU region -Backend commands + #### --pcloud-username -Here are the commands specific to the oracleobjectstorage backend. + Your pcloud username. + + This is only required when you want to use the cleanup command. Due to a bug + in the pcloud API the required API does not support OAuth authentication so + we have to rely on user password authentication for it. -Run them with + Properties: - rclone backend COMMAND remote: + - Config: username + - Env Var: RCLONE_PCLOUD_USERNAME + - Type: string + - Required: false -The help below will explain what arguments each command takes. + #### --pcloud-password -See the backend command for more info on how to pass options and -arguments. + Your pcloud password. -These can be run on a running backend using the rc command -backend/command. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -rename + Properties: -change the name of an object + - Config: password + - Env Var: RCLONE_PCLOUD_PASSWORD + - Type: string + - Required: false - rclone backend rename remote: [options] [+] -This command can be used to rename a object. -Usage Examples: + # PikPak - rclone backend rename oos:bucket relative-object-path-under-bucket object-new-name + PikPak is [a private cloud drive](https://mypikpak.com/). -list-multipart-uploads + Paths are specified as `remote:path`, and may be as deep as required, e.g. `remote:directory/subdirectory`. -List the unfinished multipart uploads + ## Configuration - rclone backend list-multipart-uploads remote: [options] [+] + Here is an example of making a remote for PikPak. -This command lists the unfinished multipart uploads in JSON format. + First run: - rclone backend list-multipart-uploads oos:bucket/path/to/object + rclone config -It returns a dictionary of buckets with values as lists of unfinished -multipart uploads. + This will guide you through an interactive setup process: -You can call it with no bucket in which case it lists all bucket, with a -bucket or with a bucket and path. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n - { - "test-bucket": [ - { - "namespace": "test-namespace", - "bucket": "test-bucket", - "object": "600m.bin", - "uploadId": "51dd8114-52a4-b2f2-c42f-5291f05eb3c8", - "timeCreated": "2022-07-29T06:21:16.595Z", - "storageTier": "Standard" - } - ] +Enter name for new remote. name> remote -cleanup +Option Storage. Type of storage to configure. Choose a number from +below, or type in your own value. XX / PikPak  (pikpak) Storage> XX -Remove unfinished multipart uploads. +Option user. Pikpak username. Enter a value. user> USERNAME - rclone backend cleanup remote: [options] [+] +Option pass. Pikpak password. Choose an alternative below. y) Yes, type +in my own password g) Generate random password y/g> y Enter the +password: password: Confirm the password: password: -This command removes unfinished multipart uploads of age greater than -max-age which defaults to 24 hours. +Edit advanced config? y) Yes n) No (default) y/n> -Note that you can use --interactive/-i or --dry-run with this command to -see what it would do. +Configuration complete. Options: - type: pikpak - user: USERNAME - pass: +*** ENCRYPTED *** - token: +{"access_token":"eyJ...","token_type":"Bearer","refresh_token":"os...","expiry":"2023-01-26T18:54:32.170582647+09:00"} +Keep this "remote" remote? y) Yes this is OK (default) e) Edit this +remote d) Delete this remote y/e/d> y - rclone backend cleanup oos:bucket/path/to/object - rclone backend cleanup -o max-age=7w oos:bucket/path/to/object -Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. + ### Modification times and hashes -Options: + PikPak keeps modification times on objects, and updates them when uploading objects, + but it does not support changing only the modification time -- "max-age": Max age of upload to delete + The MD5 hash algorithm is supported. -QingStor -Paths are specified as remote:bucket (or remote: for the lsd command.) -You may put subdirectories in too, e.g. remote:bucket/path/to/dir. + ### Standard options -Configuration + Here are the Standard options specific to pikpak (PikPak). -Here is an example of making an QingStor configuration. First run + #### --pikpak-user - rclone config + Pikpak username. -This will guide you through an interactive setup process. + Properties: - No remotes found, make a new one? - n) New remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - n/r/c/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / QingStor Object Storage - \ "qingstor" - [snip] - Storage> qingstor - Get QingStor credentials from runtime. Only applies if access_key_id and secret_access_key is blank. - Choose a number from below, or type in your own value - 1 / Enter QingStor credentials in the next step - \ "false" - 2 / Get QingStor credentials from the environment (env vars or IAM) - \ "true" - env_auth> 1 - QingStor Access Key ID - leave blank for anonymous access or runtime credentials. - access_key_id> access_key - QingStor Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> secret_key - Enter an endpoint URL to connection QingStor API. - Leave blank will use the default value "https://qingstor.com:443" - endpoint> - Zone connect to. Default is "pek3a". - Choose a number from below, or type in your own value - / The Beijing (China) Three Zone - 1 | Needs location constraint pek3a. - \ "pek3a" - / The Shanghai (China) First Zone - 2 | Needs location constraint sh1a. - \ "sh1a" - zone> 1 - Number of connection retry. - Leave blank will use the default value "3". - connection_retries> - Remote config - -------------------- - [remote] - env_auth = false - access_key_id = access_key - secret_access_key = secret_key - endpoint = - zone = pek3a - connection_retries = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + - Config: user + - Env Var: RCLONE_PIKPAK_USER + - Type: string + - Required: true -This remote is called remote and can now be used like this + #### --pikpak-pass -See all buckets + Pikpak password. - rclone lsd remote: + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Make a new bucket + Properties: - rclone mkdir remote:bucket + - Config: pass + - Env Var: RCLONE_PIKPAK_PASS + - Type: string + - Required: true -List the contents of a bucket + ### Advanced options - rclone ls remote:bucket + Here are the Advanced options specific to pikpak (PikPak). -Sync /home/local/directory to the remote bucket, deleting any excess -files in the bucket. + #### --pikpak-client-id - rclone sync --interactive /home/local/directory remote:bucket + OAuth Client Id. ---fast-list + Leave blank normally. -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. + Properties: -Multipart uploads + - Config: client_id + - Env Var: RCLONE_PIKPAK_CLIENT_ID + - Type: string + - Required: false -rclone supports multipart uploads with QingStor which means that it can -upload files bigger than 5 GiB. Note that files uploaded with multipart -upload don't have an MD5SUM. + #### --pikpak-client-secret -Note that incomplete multipart uploads older than 24 hours can be -removed with rclone cleanup remote:bucket just for one bucket -rclone cleanup remote: for all buckets. QingStor does not ever remove -incomplete multipart uploads so it may be necessary to run this from -time to time. + OAuth Client Secret. -Buckets and Zone + Leave blank normally. -With QingStor you can list buckets (rclone lsd) using any zone, but you -can only access the content of a bucket from the zone it was created in. -If you attempt to access a bucket from the wrong zone, you will get an -error, incorrect zone, the bucket is not in 'XXX' zone. + Properties: -Authentication + - Config: client_secret + - Env Var: RCLONE_PIKPAK_CLIENT_SECRET + - Type: string + - Required: false -There are two ways to supply rclone with a set of QingStor credentials. -In order of precedence: + #### --pikpak-token -- Directly in the rclone configuration file (as configured by - rclone config) - - set access_key_id and secret_access_key -- Runtime configuration: - - set env_auth to true in the config file - - Exporting the following environment variables before running - rclone - - Access Key ID: QS_ACCESS_KEY_ID or QS_ACCESS_KEY - - Secret Access Key: QS_SECRET_ACCESS_KEY or QS_SECRET_KEY + OAuth Access Token as a JSON blob. -Restricted filename characters + Properties: -The control characters 0x00-0x1F and / are replaced as in the default -restricted characters set. Note that 0x7F is not replaced. + - Config: token + - Env Var: RCLONE_PIKPAK_TOKEN + - Type: string + - Required: false -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + #### --pikpak-auth-url -Standard options + Auth server URL. -Here are the Standard options specific to qingstor (QingCloud Object -Storage). + Leave blank to use the provider defaults. ---qingstor-env-auth + Properties: -Get QingStor credentials from runtime. + - Config: auth_url + - Env Var: RCLONE_PIKPAK_AUTH_URL + - Type: string + - Required: false -Only applies if access_key_id and secret_access_key is blank. + #### --pikpak-token-url -Properties: + Token server url. -- Config: env_auth -- Env Var: RCLONE_QINGSTOR_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter QingStor credentials in the next step. - - "true" - - Get QingStor credentials from the environment (env vars or - IAM). + Leave blank to use the provider defaults. ---qingstor-access-key-id + Properties: -QingStor Access Key ID. + - Config: token_url + - Env Var: RCLONE_PIKPAK_TOKEN_URL + - Type: string + - Required: false -Leave blank for anonymous access or runtime credentials. + #### --pikpak-root-folder-id -Properties: + ID of the root folder. + Leave blank normally. -- Config: access_key_id -- Env Var: RCLONE_QINGSTOR_ACCESS_KEY_ID -- Type: string -- Required: false + Fill in for rclone to use a non root folder as its starting point. ---qingstor-secret-access-key -QingStor Secret Access Key (password). + Properties: -Leave blank for anonymous access or runtime credentials. + - Config: root_folder_id + - Env Var: RCLONE_PIKPAK_ROOT_FOLDER_ID + - Type: string + - Required: false -Properties: + #### --pikpak-use-trash -- Config: secret_access_key -- Env Var: RCLONE_QINGSTOR_SECRET_ACCESS_KEY -- Type: string -- Required: false + Send files to the trash instead of deleting permanently. ---qingstor-endpoint + Defaults to true, namely sending files to the trash. + Use `--pikpak-use-trash=false` to delete files permanently instead. -Enter an endpoint URL to connection QingStor API. + Properties: -Leave blank will use the default value "https://qingstor.com:443". + - Config: use_trash + - Env Var: RCLONE_PIKPAK_USE_TRASH + - Type: bool + - Default: true -Properties: + #### --pikpak-trashed-only -- Config: endpoint -- Env Var: RCLONE_QINGSTOR_ENDPOINT -- Type: string -- Required: false + Only show files that are in the trash. ---qingstor-zone + This will show trashed files in their original directory structure. -Zone to connect to. + Properties: -Default is "pek3a". + - Config: trashed_only + - Env Var: RCLONE_PIKPAK_TRASHED_ONLY + - Type: bool + - Default: false -Properties: + #### --pikpak-hash-memory-limit -- Config: zone -- Env Var: RCLONE_QINGSTOR_ZONE -- Type: string -- Required: false -- Examples: - - "pek3a" - - The Beijing (China) Three Zone. - - Needs location constraint pek3a. - - "sh1a" - - The Shanghai (China) First Zone. - - Needs location constraint sh1a. - - "gd2a" - - The Guangdong (China) Second Zone. - - Needs location constraint gd2a. + Files bigger than this will be cached on disk to calculate hash if required. -Advanced options + Properties: -Here are the Advanced options specific to qingstor (QingCloud Object -Storage). + - Config: hash_memory_limit + - Env Var: RCLONE_PIKPAK_HASH_MEMORY_LIMIT + - Type: SizeSuffix + - Default: 10Mi ---qingstor-connection-retries + #### --pikpak-encoding -Number of connection retries. + The encoding for the backend. -Properties: + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -- Config: connection_retries -- Env Var: RCLONE_QINGSTOR_CONNECTION_RETRIES -- Type: int -- Default: 3 + Properties: ---qingstor-upload-cutoff + - Config: encoding + - Env Var: RCLONE_PIKPAK_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot -Cutoff for switching to chunked upload. + ## Backend commands -Any files larger than this will be uploaded in chunks of chunk_size. The -minimum is 0 and the maximum is 5 GiB. + Here are the commands specific to the pikpak backend. -Properties: + Run them with -- Config: upload_cutoff -- Env Var: RCLONE_QINGSTOR_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi + rclone backend COMMAND remote: ---qingstor-chunk-size + The help below will explain what arguments each command takes. -Chunk size to use for uploading. + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -When uploading files larger than upload_cutoff they will be uploaded as -multipart uploads using this chunk size. + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -Note that "--qingstor-upload-concurrency" chunks of this size are -buffered in memory per transfer. + ### addurl -If you are transferring large files over high-speed links and you have -enough memory, then increasing this will speed up the transfers. + Add offline download task for url -Properties: + rclone backend addurl remote: [options] [+] -- Config: chunk_size -- Env Var: RCLONE_QINGSTOR_CHUNK_SIZE -- Type: SizeSuffix -- Default: 4Mi + This command adds offline download task for url. ---qingstor-upload-concurrency + Usage: -Concurrency for multipart uploads. + rclone backend addurl pikpak:dirpath url -This is the number of chunks of the same file that are uploaded -concurrently. + Downloads will be stored in 'dirpath'. If 'dirpath' is invalid, + download will fallback to default 'My Pack' folder. -NB if you set this to > 1 then the checksums of multipart uploads become -corrupted (the uploads themselves are not corrupted though). -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. + ### decompress -Properties: + Request decompress of a file/files in a folder -- Config: upload_concurrency -- Env Var: RCLONE_QINGSTOR_UPLOAD_CONCURRENCY -- Type: int -- Default: 1 + rclone backend decompress remote: [options] [+] ---qingstor-encoding + This command requests decompress of file/files in a folder. -The encoding for the backend. + Usage: -See the encoding section in the overview for more info. + rclone backend decompress pikpak:dirpath {filename} -o password=password + rclone backend decompress pikpak:dirpath {filename} -o delete-src-file -Properties: + An optional argument 'filename' can be specified for a file located in + 'pikpak:dirpath'. You may want to pass '-o password=password' for a + password-protected files. Also, pass '-o delete-src-file' to delete + source files after decompression finished. -- Config: encoding -- Env Var: RCLONE_QINGSTOR_ENCODING -- Type: MultiEncoder -- Default: Slash,Ctl,InvalidUtf8 + Result: -Limitations + { + "Decompressed": 17, + "SourceDeleted": 0, + "Errors": 0 + } -rclone about is not supported by the qingstor backend. Backends without -this capability cannot determine free space for an rclone mount or use -policy mfs (most free space) as a member of an rclone union remote. -See List of backends that do not support rclone about and rclone about -Sia -Sia (sia.tech) is a decentralized cloud storage platform based on the -blockchain technology. With rclone you can use it like any other remote -filesystem or mount Sia folders locally. The technology behind it -involves a number of new concepts such as Siacoins and Wallet, -Blockchain and Consensus, Renting and Hosting, and so on. If you are new -to it, you'd better first familiarize yourself using their excellent -support documentation. + ## Limitations -Introduction + ### Hashes may be empty -Before you can use rclone with Sia, you will need to have a running copy -of Sia-UI or siad (the Sia daemon) locally on your computer or on local -network (e.g. a NAS). Please follow the Get started guide and install -one. + PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files. -rclone interacts with Sia network by talking to the Sia daemon via HTTP -API which is usually available on port 9980. By default you will run the -daemon locally on the same computer so it's safe to leave the API -password blank (the API URL will be http://127.0.0.1:9980 making -external access impossible). - -However, if you want to access Sia daemon running on another node, for -example due to memory constraints or because you want to share single -daemon between several rclone and Sia-UI instances, you'll need to make -a few more provisions: - Ensure you have Sia daemon installed directly -or in a docker container because Sia-UI does not support this mode -natively. - Run it on externally accessible port, for example provide ---api-addr :9980 and --disable-api-security arguments on the daemon -command line. - Enforce API password for the siad daemon via environment -variable SIA_API_PASSWORD or text file named apipassword in the daemon -directory. - Set rclone backend option api_password taking it from above -locations. - -Notes: 1. If your wallet is locked, rclone cannot unlock it -automatically. You should either unlock it in advance by using Sia-UI or -via command line siac wallet unlock. Alternatively you can make siad -unlock your wallet automatically upon startup by running it with -environment variable SIA_WALLET_PASSWORD. 2. If siad cannot find the -SIA_API_PASSWORD variable or the apipassword file in the SIA_DIR -directory, it will generate a random password and store in the text file -named apipassword under YOUR_HOME/.sia/ directory on Unix or -C:\Users\YOUR_HOME\AppData\Local\Sia\apipassword on Windows. Remember -this when you configure password in rclone. 3. The only way to use siad -without API password is to run it on localhost with command line -argument --authorize-api=false, but this is insecure and strongly -discouraged. + ### Deleted files still visible with trashed-only -Configuration + Deleted files will still be visible with `--pikpak-trashed-only` even after the + trash emptied. This goes away after few days. -Here is an example of how to make a sia remote called mySia. First, run: + # premiumize.me - rclone config + Paths are specified as `remote:path` -This will guide you through an interactive setup process: + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> mySia - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - ... - 29 / Sia Decentralized Cloud - \ "sia" - ... - Storage> sia - Sia daemon API URL, like http://sia.daemon.host:9980. - Note that siad must run with --disable-api-security to open API port for other hosts (not recommended). - Keep default if Sia daemon runs on localhost. - Enter a string value. Press Enter for the default ("http://127.0.0.1:9980"). - api_url> http://127.0.0.1:9980 - Sia Daemon API Password. - Can be found in the apipassword file located in HOME/.sia/ or in the daemon directory. - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank (default) - y/g/n> y - Enter the password: - password: - Confirm the password: - password: - Edit advanced config? - y) Yes - n) No (default) - y/n> n - -------------------- - [mySia] - type = sia - api_url = http://127.0.0.1:9980 - api_password = *** ENCRYPTED *** - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + ## Configuration -Once configured, you can then use rclone like this: + The initial setup for [premiumize.me](https://premiumize.me/) involves getting a token from premiumize.me which you + need to do in your browser. `rclone config` walks you through it. -- List directories in top level of your Sia storage + Here is an example of how to make a remote called `remote`. First run: - rclone lsd mySia: + rclone config -- List all the files in your Sia storage + This will guide you through an interactive setup process: - rclone ls mySia: +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +premiumize.me  "premiumizeme" [snip] Storage> premiumizeme ** See help +for premiumizeme backend at: https://rclone.org/premiumizeme/ ** -- Upload a local directory to the Sia directory called backup +Remote config Use web browser to automatically authenticate rclone with +remote? * Say Y if the machine running rclone has a web browser you can +use * Say N if running rclone on a (remote) machine without web browser +access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If +your browser doesn't open automatically go to the following link: +http://127.0.0.1:53682/auth Log in and authorize rclone for access +Waiting for code... Got code -------------------- [remote] type = +premiumizeme token = +{"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2029-08-07T18:44:15.548915378+01:00"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> - rclone copy /home/source mySia:backup -Standard options + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -Here are the Standard options specific to sia (Sia Decentralized Cloud). + Note that rclone runs a webserver on your local machine to collect the + token as returned from premiumize.me. This only runs from the moment it opens + your browser to the moment you get back the verification code. This + is on `http://127.0.0.1:53682/` and this it may require you to unblock + it temporarily if you are running a host firewall. ---sia-api-url + Once configured you can then use `rclone` like this, -Sia daemon API URL, like http://sia.daemon.host:9980. + List directories in top level of your premiumize.me -Note that siad must run with --disable-api-security to open API port for -other hosts (not recommended). Keep default if Sia daemon runs on -localhost. + rclone lsd remote: -Properties: + List all the files in your premiumize.me -- Config: api_url -- Env Var: RCLONE_SIA_API_URL -- Type: string -- Default: "http://127.0.0.1:9980" + rclone ls remote: ---sia-api-password + To copy a local directory to an premiumize.me directory called backup -Sia Daemon API Password. + rclone copy /home/source remote:backup -Can be found in the apipassword file located in HOME/.sia/ or in the -daemon directory. + ### Modification times and hashes -NB Input to this must be obscured - see rclone obscure. + premiumize.me does not support modification times or hashes, therefore + syncing will default to `--size-only` checking. Note that using + `--update` will work. -Properties: + ### Restricted filename characters -- Config: api_password -- Env Var: RCLONE_SIA_API_PASSWORD -- Type: string -- Required: false + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -Advanced options + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | + | " | 0x22 | " | -Here are the Advanced options specific to sia (Sia Decentralized Cloud). + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. ---sia-user-agent -Siad User Agent + ### Standard options -Sia daemon requires the 'Sia-Agent' user agent by default for security + Here are the Standard options specific to premiumizeme (premiumize.me). -Properties: + #### --premiumizeme-client-id -- Config: user_agent -- Env Var: RCLONE_SIA_USER_AGENT -- Type: string -- Default: "Sia-Agent" + OAuth Client Id. ---sia-encoding + Leave blank normally. -The encoding for the backend. + Properties: -See the encoding section in the overview for more info. + - Config: client_id + - Env Var: RCLONE_PREMIUMIZEME_CLIENT_ID + - Type: string + - Required: false -Properties: + #### --premiumizeme-client-secret -- Config: encoding -- Env Var: RCLONE_SIA_ENCODING -- Type: MultiEncoder -- Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot + OAuth Client Secret. -Limitations + Leave blank normally. -- Modification times not supported -- Checksums not supported -- rclone about not supported -- rclone can work only with Siad or Sia-UI at the moment, the SkyNet - daemon is not supported yet. -- Sia does not allow control characters or symbols like question and - pound signs in file names. rclone will transparently encode them for - you, but you'd better be aware + Properties: -Swift + - Config: client_secret + - Env Var: RCLONE_PREMIUMIZEME_CLIENT_SECRET + - Type: string + - Required: false -Swift refers to OpenStack Object Storage. Commercial implementations of -that being: + #### --premiumizeme-api-key -- Rackspace Cloud Files -- Memset Memstore -- OVH Object Storage -- Oracle Cloud Storage -- IBM Bluemix Cloud ObjectStorage Swift + API Key. -Paths are specified as remote:container (or remote: for the lsd -command.) You may put subdirectories in too, e.g. -remote:container/path/to/dir. + This is not normally used - use oauth instead. -Configuration -Here is an example of making a swift configuration. First run + Properties: - rclone config + - Config: api_key + - Env Var: RCLONE_PREMIUMIZEME_API_KEY + - Type: string + - Required: false -This will guide you through an interactive setup process. + ### Advanced options - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) - \ "swift" - [snip] - Storage> swift - Get swift credentials from environment variables in standard OpenStack form. - Choose a number from below, or type in your own value - 1 / Enter swift credentials in the next step - \ "false" - 2 / Get swift credentials from environment vars. Leave other fields blank if using this. - \ "true" - env_auth> true - User name to log in (OS_USERNAME). - user> - API key or password (OS_PASSWORD). - key> - Authentication URL for server (OS_AUTH_URL). - Choose a number from below, or type in your own value - 1 / Rackspace US - \ "https://auth.api.rackspacecloud.com/v1.0" - 2 / Rackspace UK - \ "https://lon.auth.api.rackspacecloud.com/v1.0" - 3 / Rackspace v2 - \ "https://identity.api.rackspacecloud.com/v2.0" - 4 / Memset Memstore UK - \ "https://auth.storage.memset.com/v1.0" - 5 / Memset Memstore UK v2 - \ "https://auth.storage.memset.com/v2.0" - 6 / OVH - \ "https://auth.cloud.ovh.net/v3" - auth> - User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID). - user_id> - User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - domain> - Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) - tenant> - Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) - tenant_id> - Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) - tenant_domain> - Region name - optional (OS_REGION_NAME) - region> - Storage URL - optional (OS_STORAGE_URL) - storage_url> - Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) - auth_token> - AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) - auth_version> - Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) - Choose a number from below, or type in your own value - 1 / Public (default, choose this if not sure) - \ "public" - 2 / Internal (use internal service net) - \ "internal" - 3 / Admin - \ "admin" - endpoint_type> - Remote config - -------------------- - [test] - env_auth = true - user = - key = - auth = - user_id = - domain = - tenant = - tenant_id = - tenant_domain = - region = - storage_url = - auth_token = - auth_version = - endpoint_type = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Here are the Advanced options specific to premiumizeme (premiumize.me). -This remote is called remote and can now be used like this + #### --premiumizeme-token -See all containers + OAuth Access Token as a JSON blob. - rclone lsd remote: + Properties: -Make a new container + - Config: token + - Env Var: RCLONE_PREMIUMIZEME_TOKEN + - Type: string + - Required: false - rclone mkdir remote:container + #### --premiumizeme-auth-url -List the contents of a container + Auth server URL. - rclone ls remote:container + Leave blank to use the provider defaults. -Sync /home/local/directory to the remote container, deleting any excess -files in the container. + Properties: - rclone sync --interactive /home/local/directory remote:container + - Config: auth_url + - Env Var: RCLONE_PREMIUMIZEME_AUTH_URL + - Type: string + - Required: false -Configuration from an OpenStack credentials file + #### --premiumizeme-token-url -An OpenStack credentials file typically looks something something like -this (without the comments) + Token server url. - export OS_AUTH_URL=https://a.provider.net/v2.0 - export OS_TENANT_ID=ffffffffffffffffffffffffffffffff - export OS_TENANT_NAME="1234567890123456" - export OS_USERNAME="123abc567xy" - echo "Please enter your OpenStack Password: " - read -sr OS_PASSWORD_INPUT - export OS_PASSWORD=$OS_PASSWORD_INPUT - export OS_REGION_NAME="SBG1" - if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi + Leave blank to use the provider defaults. -The config file needs to look something like this where $OS_USERNAME -represents the value of the OS_USERNAME variable - 123abc567xy in the -example above. + Properties: - [remote] - type = swift - user = $OS_USERNAME - key = $OS_PASSWORD - auth = $OS_AUTH_URL - tenant = $OS_TENANT_NAME + - Config: token_url + - Env Var: RCLONE_PREMIUMIZEME_TOKEN_URL + - Type: string + - Required: false -Note that you may (or may not) need to set region too - try without -first. + #### --premiumizeme-encoding -Configuration from the environment + The encoding for the backend. -If you prefer you can configure rclone to use swift using a standard set -of OpenStack environment variables. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -When you run through the config, make sure you choose true for env_auth -and leave everything else blank. + Properties: -rclone will then set any empty config parameters from the environment -using standard OpenStack environment variables. There is a list of the -variables in the docs for the swift library. + - Config: encoding + - Env Var: RCLONE_PREMIUMIZEME_ENCODING + - Type: Encoding + - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot -Using an alternate authentication method -If your OpenStack installation uses a non-standard authentication method -that might not be yet supported by rclone or the underlying swift -library, you can authenticate externally (e.g. calling manually the -openstack commands to get a token). Then, you just need to pass the two -configuration variables auth_token and storage_url. If they are both -provided, the other variables are ignored. rclone will not try to -authenticate but instead assume it is already authenticated and use -these two variables to access the OpenStack installation. -Using rclone without a config file + ## Limitations -You can use rclone with swift without a config file, if desired, like -this: + Note that premiumize.me is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". - source openstack-credentials-file - export RCLONE_CONFIG_MYREMOTE_TYPE=swift - export RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true - rclone lsd myremote: + premiumize.me file names can't have the `\` or `"` characters in. + rclone maps these to and from an identical looking unicode equivalents + `\` and `"` ---fast-list + premiumize.me only supports filenames up to 255 characters in length. -This remote supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. + # Proton Drive ---update and --use-server-modtime + [Proton Drive](https://proton.me/drive) is an end-to-end encrypted Swiss vault + for your files that protects your data. -As noted below, the modified time is stored on metadata on the object. -It is used by default for all operations that require checking the time -a file was last updated. It allows rclone to treat the remote more like -a true filesystem, but it is inefficient because it requires an extra -API call to retrieve the metadata. + This is an rclone backend for Proton Drive which supports the file transfer + features of Proton Drive using the same client-side encryption. -For many operations, the time the object was last uploaded to the remote -is sufficient to determine if it is "dirty". By using --update along -with --use-server-modtime, you can avoid the extra API call and simply -upload files whose local modtime is newer than the time it was last -uploaded. + Due to the fact that Proton Drive doesn't publish its API documentation, this + backend is implemented with best efforts by reading the open-sourced client + source code and observing the Proton Drive traffic in the browser. -Modified time + **NB** This backend is currently in Beta. It is believed to be correct + and all the integration tests pass. However the Proton Drive protocol + has evolved over time there may be accounts it is not compatible + with. Please [post on the rclone forum](https://forum.rclone.org/) if + you find an incompatibility. -The modified time is stored as metadata on the object as -X-Object-Meta-Mtime as floating point since the epoch accurate to 1 ns. + Paths are specified as `remote:path` -This is a de facto standard (used in the official python-swiftclient -amongst others) for storing the modification time for an object. + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Restricted filename characters + ## Configurations - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - / 0x2F / + Here is an example of how to make a remote called `remote`. First run: -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + rclone config -Standard options + This will guide you through an interactive setup process: -Here are the Standard options specific to swift (OpenStack Swift -(Rackspace Cloud Files, Memset Memstore, OVH)). +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Proton Drive  "Proton Drive" [snip] Storage> protondrive User name +user> you@protonmail.com Password. y) Yes type in my own password g) +Generate random password n) No leave this optional password blank y/g/n> +y Enter the password: password: Confirm the password: password: Option +2fa. 2FA code (if the account requires one) Enter a value. Press Enter +to leave empty. 2fa> 123456 Remote config -------------------- [remote] +type = protondrive user = you@protonmail.com pass = *** ENCRYPTED *** +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y ---swift-env-auth -Get swift credentials from environment variables in standard OpenStack -form. + **NOTE:** The Proton Drive encryption keys need to have been already generated + after a regular login via the browser, otherwise attempting to use the + credentials in `rclone` will fail. -Properties: + Once configured you can then use `rclone` like this, -- Config: env_auth -- Env Var: RCLONE_SWIFT_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter swift credentials in the next step. - - "true" - - Get swift credentials from environment vars. - - Leave other fields blank if using this. + List directories in top level of your Proton Drive ---swift-user + rclone lsd remote: -User name to log in (OS_USERNAME). + List all the files in your Proton Drive -Properties: + rclone ls remote: -- Config: user -- Env Var: RCLONE_SWIFT_USER -- Type: string -- Required: false + To copy a local directory to an Proton Drive directory called backup ---swift-key + rclone copy /home/source remote:backup -API key or password (OS_PASSWORD). + ### Modification times and hashes -Properties: + Proton Drive Bridge does not support updating modification times yet. -- Config: key -- Env Var: RCLONE_SWIFT_KEY -- Type: string -- Required: false + The SHA1 hash algorithm is supported. ---swift-auth + ### Restricted filename characters -Authentication URL for server (OS_AUTH_URL). + Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and + right spaces will be removed ([code reference](https://github.com/ProtonMail/WebClients/blob/b4eba99d241af4fdae06ff7138bd651a40ef5d3c/applications/drive/src/app/store/_links/validation.ts#L51)) -Properties: + ### Duplicated files -- Config: auth -- Env Var: RCLONE_SWIFT_AUTH -- Type: string -- Required: false -- Examples: - - "https://auth.api.rackspacecloud.com/v1.0" - - Rackspace US - - "https://lon.auth.api.rackspacecloud.com/v1.0" - - Rackspace UK - - "https://identity.api.rackspacecloud.com/v2.0" - - Rackspace v2 - - "https://auth.storage.memset.com/v1.0" - - Memset Memstore UK - - "https://auth.storage.memset.com/v2.0" - - Memset Memstore UK v2 - - "https://auth.cloud.ovh.net/v3" - - OVH - ---swift-user-id - -User ID to log in - optional - most swift systems use user and leave -this blank (v3 auth) (OS_USER_ID). + Proton Drive can not have two files with exactly the same name and path. If the + conflict occurs, depending on the advanced config, the file might or might not + be overwritten. -Properties: + ### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password) -- Config: user_id -- Env Var: RCLONE_SWIFT_USER_ID -- Type: string -- Required: false + Please set your mailbox password in the advanced config section. ---swift-domain + ### Caching -User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + The cache is currently built for the case when the rclone is the only instance + performing operations to the mount point. The event system, which is the proton + API system that provides visibility of what has changed on the drive, is yet + to be implemented, so updates from other clients won’t be reflected in the + cache. Thus, if there are concurrent clients accessing the same mount point, + then we might have a problem with caching the stale data. -Properties: -- Config: domain -- Env Var: RCLONE_SWIFT_DOMAIN -- Type: string -- Required: false + ### Standard options ---swift-tenant + Here are the Standard options specific to protondrive (Proton Drive). -Tenant name - optional for v1 auth, this or tenant_id required otherwise -(OS_TENANT_NAME or OS_PROJECT_NAME). + #### --protondrive-username -Properties: + The username of your proton account -- Config: tenant -- Env Var: RCLONE_SWIFT_TENANT -- Type: string -- Required: false + Properties: ---swift-tenant-id + - Config: username + - Env Var: RCLONE_PROTONDRIVE_USERNAME + - Type: string + - Required: true -Tenant ID - optional for v1 auth, this or tenant required otherwise -(OS_TENANT_ID). + #### --protondrive-password -Properties: + The password of your proton account. -- Config: tenant_id -- Env Var: RCLONE_SWIFT_TENANT_ID -- Type: string -- Required: false + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). ---swift-tenant-domain + Properties: -Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME). + - Config: password + - Env Var: RCLONE_PROTONDRIVE_PASSWORD + - Type: string + - Required: true -Properties: + #### --protondrive-2fa -- Config: tenant_domain -- Env Var: RCLONE_SWIFT_TENANT_DOMAIN -- Type: string -- Required: false + The 2FA code ---swift-region + The value can also be provided with --protondrive-2fa=000000 -Region name - optional (OS_REGION_NAME). + The 2FA code of your proton drive account if the account is set up with + two-factor authentication -Properties: + Properties: -- Config: region -- Env Var: RCLONE_SWIFT_REGION -- Type: string -- Required: false + - Config: 2fa + - Env Var: RCLONE_PROTONDRIVE_2FA + - Type: string + - Required: false ---swift-storage-url + ### Advanced options -Storage URL - optional (OS_STORAGE_URL). + Here are the Advanced options specific to protondrive (Proton Drive). -Properties: + #### --protondrive-mailbox-password -- Config: storage_url -- Env Var: RCLONE_SWIFT_STORAGE_URL -- Type: string -- Required: false + The mailbox password of your two-password proton account. ---swift-auth-token + For more information regarding the mailbox password, please check the + following official knowledge base article: + https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password -Auth Token from alternate authentication - optional (OS_AUTH_TOKEN). -Properties: + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -- Config: auth_token -- Env Var: RCLONE_SWIFT_AUTH_TOKEN -- Type: string -- Required: false + Properties: ---swift-application-credential-id + - Config: mailbox_password + - Env Var: RCLONE_PROTONDRIVE_MAILBOX_PASSWORD + - Type: string + - Required: false -Application Credential ID (OS_APPLICATION_CREDENTIAL_ID). + #### --protondrive-client-uid -Properties: + Client uid key (internal use only) -- Config: application_credential_id -- Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_ID -- Type: string -- Required: false + Properties: ---swift-application-credential-name + - Config: client_uid + - Env Var: RCLONE_PROTONDRIVE_CLIENT_UID + - Type: string + - Required: false -Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME). + #### --protondrive-client-access-token -Properties: + Client access token key (internal use only) -- Config: application_credential_name -- Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_NAME -- Type: string -- Required: false + Properties: ---swift-application-credential-secret + - Config: client_access_token + - Env Var: RCLONE_PROTONDRIVE_CLIENT_ACCESS_TOKEN + - Type: string + - Required: false -Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET). + #### --protondrive-client-refresh-token -Properties: + Client refresh token key (internal use only) -- Config: application_credential_secret -- Env Var: RCLONE_SWIFT_APPLICATION_CREDENTIAL_SECRET -- Type: string -- Required: false + Properties: ---swift-auth-version + - Config: client_refresh_token + - Env Var: RCLONE_PROTONDRIVE_CLIENT_REFRESH_TOKEN + - Type: string + - Required: false -AuthVersion - optional - set to (1,2,3) if your auth URL has no version -(ST_AUTH_VERSION). + #### --protondrive-client-salted-key-pass -Properties: + Client salted key pass key (internal use only) -- Config: auth_version -- Env Var: RCLONE_SWIFT_AUTH_VERSION -- Type: int -- Default: 0 + Properties: ---swift-endpoint-type + - Config: client_salted_key_pass + - Env Var: RCLONE_PROTONDRIVE_CLIENT_SALTED_KEY_PASS + - Type: string + - Required: false -Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE). + #### --protondrive-encoding -Properties: + The encoding for the backend. -- Config: endpoint_type -- Env Var: RCLONE_SWIFT_ENDPOINT_TYPE -- Type: string -- Default: "public" -- Examples: - - "public" - - Public (default, choose this if not sure) - - "internal" - - Internal (use internal service net) - - "admin" - - Admin + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. ---swift-storage-policy + Properties: -The storage policy to use when creating a new container. + - Config: encoding + - Env Var: RCLONE_PROTONDRIVE_ENCODING + - Type: Encoding + - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot -This applies the specified storage policy when creating a new container. -The policy cannot be changed afterwards. The allowed configuration -values and their meaning depend on your Swift storage provider. + #### --protondrive-original-file-size -Properties: + Return the file size before encryption + + The size of the encrypted file will be different from (bigger than) the + original file size. Unless there is a reason to return the file size + after encryption is performed, otherwise, set this option to true, as + features like Open() which will need to be supplied with original content + size, will fail to operate properly -- Config: storage_policy -- Env Var: RCLONE_SWIFT_STORAGE_POLICY -- Type: string -- Required: false -- Examples: - - "" - - Default - - "pcs" - - OVH Public Cloud Storage - - "pca" - - OVH Public Cloud Archive + Properties: -Advanced options + - Config: original_file_size + - Env Var: RCLONE_PROTONDRIVE_ORIGINAL_FILE_SIZE + - Type: bool + - Default: true -Here are the Advanced options specific to swift (OpenStack Swift -(Rackspace Cloud Files, Memset Memstore, OVH)). + #### --protondrive-app-version ---swift-leave-parts-on-error + The app version string -If true avoid calling abort upload on a failure. + The app version string indicates the client that is currently performing + the API request. This information is required and will be sent with every + API request. -It should be set to true for resuming uploads across different sessions. + Properties: -Properties: + - Config: app_version + - Env Var: RCLONE_PROTONDRIVE_APP_VERSION + - Type: string + - Default: "macos-drive@1.0.0-alpha.1+rclone" + + #### --protondrive-replace-existing-draft -- Config: leave_parts_on_error -- Env Var: RCLONE_SWIFT_LEAVE_PARTS_ON_ERROR -- Type: bool -- Default: false + Create a new revision when filename conflict is detected ---swift-chunk-size + When a file upload is cancelled or failed before completion, a draft will be + created and the subsequent upload of the same file to the same location will be + reported as a conflict. -Above this size files will be chunked into a _segments container. + The value can also be set by --protondrive-replace-existing-draft=true -Above this size files will be chunked into a _segments container. The -default for this is 5 GiB which is its maximum value. + If the option is set to true, the draft will be replaced and then the upload + operation will restart. If there are other clients also uploading at the same + file location at the same time, the behavior is currently unknown. Need to set + to true for integration tests. + If the option is set to false, an error "a draft exist - usually this means a + file is being uploaded at another client, or, there was a failed upload attempt" + will be returned, and no upload will happen. -Properties: + Properties: -- Config: chunk_size -- Env Var: RCLONE_SWIFT_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Gi + - Config: replace_existing_draft + - Env Var: RCLONE_PROTONDRIVE_REPLACE_EXISTING_DRAFT + - Type: bool + - Default: false ---swift-no-chunk + #### --protondrive-enable-caching -Don't chunk files during streaming upload. + Caches the files and folders metadata to reduce API calls -When doing streaming uploads (e.g. using rcat or mount) setting this -flag will cause the swift backend to not upload chunked files. + Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, + as the current implementation doesn't update or clear the cache when there are + external changes. -This will limit the maximum upload size to 5 GiB. However non chunked -files are easier to deal with and have an MD5SUM. + The files and folders on ProtonDrive are represented as links with keyrings, + which can be cached to improve performance and be friendly to the API server. -Rclone will still chunk files bigger than chunk_size when doing normal -copy operations. + The cache is currently built for the case when the rclone is the only instance + performing operations to the mount point. The event system, which is the proton + API system that provides visibility of what has changed on the drive, is yet + to be implemented, so updates from other clients won’t be reflected in the + cache. Thus, if there are concurrent clients accessing the same mount point, + then we might have a problem with caching the stale data. -Properties: + Properties: -- Config: no_chunk -- Env Var: RCLONE_SWIFT_NO_CHUNK -- Type: bool -- Default: false + - Config: enable_caching + - Env Var: RCLONE_PROTONDRIVE_ENABLE_CACHING + - Type: bool + - Default: true ---swift-no-large-objects -Disable support for static and dynamic large objects -Swift cannot transparently store files bigger than 5 GiB. There are two -schemes for doing that, static or dynamic large objects, and the API -does not allow rclone to determine whether a file is a static or dynamic -large object without doing a HEAD on the object. Since these need to be -treated differently, this means rclone has to issue HEAD requests for -objects for example when reading checksums. + ## Limitations -When no_large_objects is set, rclone will assume that there are no -static or dynamic large objects stored. This means it can stop doing the -extra HEAD calls which in turn increases performance greatly especially -when doing a swift to swift transfer with --checksum set. + This backend uses the + [Proton-API-Bridge](https://github.com/henrybear327/Proton-API-Bridge), which + is based on [go-proton-api](https://github.com/henrybear327/go-proton-api), a + fork of the [official repo](https://github.com/ProtonMail/go-proton-api). -Setting this option implies no_chunk and also that no files will be -uploaded in chunks, so files bigger than 5 GiB will just fail on upload. + There is no official API documentation available from Proton Drive. But, thanks + to Proton open sourcing [proton-go-api](https://github.com/ProtonMail/go-proton-api) + and the web, iOS, and Android client codebases, we don't need to completely + reverse engineer the APIs by observing the web client traffic! -If you set this option and there are static or dynamic large objects, -then this will give incorrect hashes for them. Downloads will succeed, -but other operations such as Remove and Copy will fail. + [proton-go-api](https://github.com/ProtonMail/go-proton-api) provides the basic + building blocks of API calls and error handling, such as 429 exponential + back-off, but it is pretty much just a barebone interface to the Proton API. + For example, the encryption and decryption of the Proton Drive file are not + provided in this library. -Properties: + The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on + top of this quickly. This codebase handles the intricate tasks before and after + calling Proton APIs, particularly the complex encryption scheme, allowing + developers to implement features for other software on top of this codebase. + There are likely quite a few errors in this library, as there isn't official + documentation available. -- Config: no_large_objects -- Env Var: RCLONE_SWIFT_NO_LARGE_OBJECTS -- Type: bool -- Default: false + # put.io ---swift-encoding + Paths are specified as `remote:path` -The encoding for the backend. + put.io paths may be as deep as required, e.g. + `remote:directory/subdirectory`. -See the encoding section in the overview for more info. + ## Configuration -Properties: + The initial setup for put.io involves getting a token from put.io + which you need to do in your browser. `rclone config` walks you + through it. -- Config: encoding -- Env Var: RCLONE_SWIFT_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8 + Here is an example of how to make a remote called `remote`. First run: -Limitations + rclone config -The Swift API doesn't return a correct MD5SUM for segmented files -(Dynamic or Static Large Objects) so rclone won't check or use the -MD5SUM for these. + This will guide you through an interactive setup process: -Troubleshooting +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> putio Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / Put.io + "putio" [snip] Storage> putio ** See help for putio backend at: +https://rclone.org/putio/ ** -Rclone gives Failed to create file system for "remote:": Bad Request +Remote config Use web browser to automatically authenticate rclone with +remote? * Say Y if the machine running rclone has a web browser you can +use * Say N if running rclone on a (remote) machine without web browser +access If not sure try Y. If Y failed, try N. y) Yes n) No y/n> y If +your browser doesn't open automatically go to the following link: +http://127.0.0.1:53682/auth Log in and authorize rclone for access +Waiting for code... Got code -------------------- [putio] type = putio +token = {"access_token":"XXXXXXXX","expiry":"0001-01-01T00:00:00Z"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y Current remotes: -Due to an oddity of the underlying swift library, it gives a "Bad -Request" error rather than a more sensible error when the authentication -fails for Swift. +Name Type ==== ==== putio putio -So this most likely means your username / password is wrong. You can -investigate further with the --dump-bodies flag. +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> q -This may also be caused by specifying the region when you shouldn't have -(e.g. OVH). -Rclone gives Failed to create file system: Response didn't have storage url and auth token + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -This is most likely caused by forgetting to specify your tenant when -setting up a swift remote. + Note that rclone runs a webserver on your local machine to collect the + token as returned from put.io if using web browser to automatically + authenticate. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and this + it may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. -OVH Cloud Archive + You can then use it like this, -To use rclone with OVH cloud archive, first use rclone config to set up -a swift backend with OVH, choosing pca as the storage_policy. + List directories in top level of your put.io -Uploading Objects + rclone lsd remote: -Uploading objects to OVH cloud archive is no different to object -storage, you just simply run the command you like (move, copy or sync) -to upload the objects. Once uploaded the objects will show in a "Frozen" -state within the OVH control panel. + List all the files in your put.io -Retrieving Objects + rclone ls remote: -To retrieve objects use rclone copy as normal. If the objects are in a -frozen state then rclone will ask for them all to be unfrozen and it -will wait at the end of the output with a message like the following: + To copy a local directory to a put.io directory called backup -2019/03/23 13:06:33 NOTICE: Received retry after error - sleeping until 2019-03-23T13:16:33.481657164+01:00 (9m59.99985121s) + rclone copy /home/source remote:backup -Rclone will wait for the time specified then retry the copy. + ### Restricted filename characters -pCloud + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -Paths are specified as remote:path + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | -Paths may be as deep as required, e.g. remote:directory/subdirectory. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Configuration -The initial setup for pCloud involves getting a token from pCloud which -you need to do in your browser. rclone config walks you through it. + ### Standard options -Here is an example of how to make a remote called remote. First run: + Here are the Standard options specific to putio (Put.io). - rclone config + #### --putio-client-id -This will guide you through an interactive setup process: + OAuth Client Id. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Pcloud - \ "pcloud" - [snip] - Storage> pcloud - Pcloud App Client Id - leave blank normally. - client_id> - Pcloud App Client Secret - leave blank normally. - client_secret> - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - client_id = - client_secret = - token = {"access_token":"XXX","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Leave blank normally. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + Properties: -Note that rclone runs a webserver on your local machine to collect the -token as returned from pCloud. This only runs from the moment it opens -your browser to the moment you get back the verification code. This is -on http://127.0.0.1:53682/ and this it may require you to unblock it -temporarily if you are running a host firewall. + - Config: client_id + - Env Var: RCLONE_PUTIO_CLIENT_ID + - Type: string + - Required: false -Once configured you can then use rclone like this, + #### --putio-client-secret -List directories in top level of your pCloud + OAuth Client Secret. - rclone lsd remote: + Leave blank normally. -List all the files in your pCloud + Properties: - rclone ls remote: + - Config: client_secret + - Env Var: RCLONE_PUTIO_CLIENT_SECRET + - Type: string + - Required: false -To copy a local directory to a pCloud directory called backup + ### Advanced options - rclone copy /home/source remote:backup + Here are the Advanced options specific to putio (Put.io). -Modified time and hashes + #### --putio-token -pCloud allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. In order to set a Modification time pCloud requires the object be -re-uploaded. + OAuth Access Token as a JSON blob. -pCloud supports MD5 and SHA1 hashes in the US region, and SHA1 and -SHA256 hashes in the EU region, so you can use the --checksum flag. + Properties: -Restricted filename characters + - Config: token + - Env Var: RCLONE_PUTIO_TOKEN + - Type: string + - Required: false -In addition to the default restricted characters set the following -characters are also replaced: + #### --putio-auth-url - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ + Auth server URL. -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Leave blank to use the provider defaults. -Deleting files + Properties: -Deleted files will be moved to the trash. Your subscription level will -determine how long items stay in the trash. rclone cleanup can be used -to empty the trash. + - Config: auth_url + - Env Var: RCLONE_PUTIO_AUTH_URL + - Type: string + - Required: false -Emptying the trash + #### --putio-token-url -Due to an API limitation, the rclone cleanup command will only work if -you set your username and password in the advanced options for this -backend. Since we generally want to avoid storing user passwords in the -rclone config file, we advise you to only set this up if you need the -rclone cleanup command to work. + Token server url. -Root folder ID + Leave blank to use the provider defaults. -You can set the root_folder_id for rclone. This is the directory -(identified by its Folder ID) that rclone considers to be the root of -your pCloud drive. + Properties: -Normally you will leave this blank and rclone will determine the correct -root to use itself. + - Config: token_url + - Env Var: RCLONE_PUTIO_TOKEN_URL + - Type: string + - Required: false -However you can set this to restrict rclone to a specific folder -hierarchy. + #### --putio-encoding -In order to do this you will have to find the Folder ID of the directory -you wish rclone to display. This will be the folder field of the URL -when you open the relevant folder in the pCloud web interface. + The encoding for the backend. -So if the folder you want rclone to use has a URL which looks like -https://my.pcloud.com/#page=filemanager&folder=5xxxxxxxx8&tpl=foldergrid -in the browser, then you use 5xxxxxxxx8 as the root_folder_id in the -config. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Standard options + Properties: -Here are the Standard options specific to pcloud (Pcloud). + - Config: encoding + - Env Var: RCLONE_PUTIO_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot ---pcloud-client-id -OAuth Client Id. -Leave blank normally. + ## Limitations -Properties: + put.io has rate limiting. When you hit a limit, rclone automatically + retries after waiting the amount of time requested by the server. -- Config: client_id -- Env Var: RCLONE_PCLOUD_CLIENT_ID -- Type: string -- Required: false + If you want to avoid ever hitting these limits, you may use the + `--tpslimit` flag with a low number. Note that the imposed limits + may be different for different operations, and may change over time. ---pcloud-client-secret + # Proton Drive -OAuth Client Secret. + [Proton Drive](https://proton.me/drive) is an end-to-end encrypted Swiss vault + for your files that protects your data. -Leave blank normally. + This is an rclone backend for Proton Drive which supports the file transfer + features of Proton Drive using the same client-side encryption. -Properties: + Due to the fact that Proton Drive doesn't publish its API documentation, this + backend is implemented with best efforts by reading the open-sourced client + source code and observing the Proton Drive traffic in the browser. -- Config: client_secret -- Env Var: RCLONE_PCLOUD_CLIENT_SECRET -- Type: string -- Required: false + **NB** This backend is currently in Beta. It is believed to be correct + and all the integration tests pass. However the Proton Drive protocol + has evolved over time there may be accounts it is not compatible + with. Please [post on the rclone forum](https://forum.rclone.org/) if + you find an incompatibility. -Advanced options + Paths are specified as `remote:path` -Here are the Advanced options specific to pcloud (Pcloud). + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. ---pcloud-token + ## Configurations -OAuth Access Token as a JSON blob. + Here is an example of how to make a remote called `remote`. First run: -Properties: + rclone config -- Config: token -- Env Var: RCLONE_PCLOUD_TOKEN -- Type: string -- Required: false + This will guide you through an interactive setup process: ---pcloud-auth-url +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Proton Drive  "Proton Drive" [snip] Storage> protondrive User name +user> you@protonmail.com Password. y) Yes type in my own password g) +Generate random password n) No leave this optional password blank y/g/n> +y Enter the password: password: Confirm the password: password: Option +2fa. 2FA code (if the account requires one) Enter a value. Press Enter +to leave empty. 2fa> 123456 Remote config -------------------- [remote] +type = protondrive user = you@protonmail.com pass = *** ENCRYPTED *** +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y -Auth server URL. -Leave blank to use the provider defaults. + **NOTE:** The Proton Drive encryption keys need to have been already generated + after a regular login via the browser, otherwise attempting to use the + credentials in `rclone` will fail. -Properties: + Once configured you can then use `rclone` like this, -- Config: auth_url -- Env Var: RCLONE_PCLOUD_AUTH_URL -- Type: string -- Required: false + List directories in top level of your Proton Drive ---pcloud-token-url + rclone lsd remote: -Token server url. + List all the files in your Proton Drive -Leave blank to use the provider defaults. + rclone ls remote: -Properties: + To copy a local directory to an Proton Drive directory called backup -- Config: token_url -- Env Var: RCLONE_PCLOUD_TOKEN_URL -- Type: string -- Required: false + rclone copy /home/source remote:backup ---pcloud-encoding + ### Modification times and hashes -The encoding for the backend. + Proton Drive Bridge does not support updating modification times yet. -See the encoding section in the overview for more info. + The SHA1 hash algorithm is supported. -Properties: + ### Restricted filename characters -- Config: encoding -- Env Var: RCLONE_PCLOUD_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and + right spaces will be removed ([code reference](https://github.com/ProtonMail/WebClients/blob/b4eba99d241af4fdae06ff7138bd651a40ef5d3c/applications/drive/src/app/store/_links/validation.ts#L51)) ---pcloud-root-folder-id + ### Duplicated files -Fill in for rclone to use a non root folder as its starting point. + Proton Drive can not have two files with exactly the same name and path. If the + conflict occurs, depending on the advanced config, the file might or might not + be overwritten. -Properties: + ### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password) -- Config: root_folder_id -- Env Var: RCLONE_PCLOUD_ROOT_FOLDER_ID -- Type: string -- Default: "d0" + Please set your mailbox password in the advanced config section. ---pcloud-hostname + ### Caching -Hostname to connect to. + The cache is currently built for the case when the rclone is the only instance + performing operations to the mount point. The event system, which is the proton + API system that provides visibility of what has changed on the drive, is yet + to be implemented, so updates from other clients won’t be reflected in the + cache. Thus, if there are concurrent clients accessing the same mount point, + then we might have a problem with caching the stale data. -This is normally set when rclone initially does the oauth connection, -however you will need to set it by hand if you are using remote config -with rclone authorize. -Properties: + ### Standard options -- Config: hostname -- Env Var: RCLONE_PCLOUD_HOSTNAME -- Type: string -- Default: "api.pcloud.com" -- Examples: - - "api.pcloud.com" - - Original/US region - - "eapi.pcloud.com" - - EU region + Here are the Standard options specific to protondrive (Proton Drive). ---pcloud-username + #### --protondrive-username -Your pcloud username. + The username of your proton account -This is only required when you want to use the cleanup command. Due to a -bug in the pcloud API the required API does not support OAuth -authentication so we have to rely on user password authentication for -it. + Properties: -Properties: + - Config: username + - Env Var: RCLONE_PROTONDRIVE_USERNAME + - Type: string + - Required: true -- Config: username -- Env Var: RCLONE_PCLOUD_USERNAME -- Type: string -- Required: false + #### --protondrive-password ---pcloud-password + The password of your proton account. -Your pcloud password. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -NB Input to this must be obscured - see rclone obscure. + Properties: -Properties: + - Config: password + - Env Var: RCLONE_PROTONDRIVE_PASSWORD + - Type: string + - Required: true -- Config: password -- Env Var: RCLONE_PCLOUD_PASSWORD -- Type: string -- Required: false + #### --protondrive-2fa -premiumize.me + The 2FA code -Paths are specified as remote:path + The value can also be provided with --protondrive-2fa=000000 -Paths may be as deep as required, e.g. remote:directory/subdirectory. + The 2FA code of your proton drive account if the account is set up with + two-factor authentication -Configuration + Properties: -The initial setup for premiumize.me involves getting a token from -premiumize.me which you need to do in your browser. rclone config walks -you through it. + - Config: 2fa + - Env Var: RCLONE_PROTONDRIVE_2FA + - Type: string + - Required: false -Here is an example of how to make a remote called remote. First run: + ### Advanced options - rclone config + Here are the Advanced options specific to protondrive (Proton Drive). -This will guide you through an interactive setup process: + #### --protondrive-mailbox-password - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / premiumize.me - \ "premiumizeme" - [snip] - Storage> premiumizeme - ** See help for premiumizeme backend at: https://rclone.org/premiumizeme/ ** + The mailbox password of your two-password proton account. - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [remote] - type = premiumizeme - token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2029-08-07T18:44:15.548915378+01:00"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> + For more information regarding the mailbox password, please check the + following official knowledge base article: + https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password -See the remote setup docs for how to set it up on a machine with no -Internet browser available. -Note that rclone runs a webserver on your local machine to collect the -token as returned from premiumize.me. This only runs from the moment it -opens your browser to the moment you get back the verification code. -This is on http://127.0.0.1:53682/ and this it may require you to -unblock it temporarily if you are running a host firewall. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Once configured you can then use rclone like this, + Properties: -List directories in top level of your premiumize.me + - Config: mailbox_password + - Env Var: RCLONE_PROTONDRIVE_MAILBOX_PASSWORD + - Type: string + - Required: false - rclone lsd remote: + #### --protondrive-client-uid -List all the files in your premiumize.me + Client uid key (internal use only) - rclone ls remote: + Properties: -To copy a local directory to an premiumize.me directory called backup + - Config: client_uid + - Env Var: RCLONE_PROTONDRIVE_CLIENT_UID + - Type: string + - Required: false - rclone copy /home/source remote:backup + #### --protondrive-client-access-token -Modified time and hashes + Client access token key (internal use only) -premiumize.me does not support modification times or hashes, therefore -syncing will default to --size-only checking. Note that using --update -will work. + Properties: -Restricted filename characters + - Config: client_access_token + - Env Var: RCLONE_PROTONDRIVE_CLIENT_ACCESS_TOKEN + - Type: string + - Required: false -In addition to the default restricted characters set the following -characters are also replaced: + #### --protondrive-client-refresh-token - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ - " 0x22 " + Client refresh token key (internal use only) -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + Properties: -Standard options + - Config: client_refresh_token + - Env Var: RCLONE_PROTONDRIVE_CLIENT_REFRESH_TOKEN + - Type: string + - Required: false -Here are the Standard options specific to premiumizeme (premiumize.me). + #### --protondrive-client-salted-key-pass ---premiumizeme-api-key + Client salted key pass key (internal use only) -API Key. + Properties: -This is not normally used - use oauth instead. + - Config: client_salted_key_pass + - Env Var: RCLONE_PROTONDRIVE_CLIENT_SALTED_KEY_PASS + - Type: string + - Required: false -Properties: + #### --protondrive-encoding -- Config: api_key -- Env Var: RCLONE_PREMIUMIZEME_API_KEY -- Type: string -- Required: false + The encoding for the backend. -Advanced options + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Here are the Advanced options specific to premiumizeme (premiumize.me). + Properties: ---premiumizeme-encoding + - Config: encoding + - Env Var: RCLONE_PROTONDRIVE_ENCODING + - Type: Encoding + - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot -The encoding for the backend. + #### --protondrive-original-file-size -See the encoding section in the overview for more info. + Return the file size before encryption + + The size of the encrypted file will be different from (bigger than) the + original file size. Unless there is a reason to return the file size + after encryption is performed, otherwise, set this option to true, as + features like Open() which will need to be supplied with original content + size, will fail to operate properly -Properties: + Properties: -- Config: encoding -- Env Var: RCLONE_PREMIUMIZEME_ENCODING -- Type: MultiEncoder -- Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot + - Config: original_file_size + - Env Var: RCLONE_PROTONDRIVE_ORIGINAL_FILE_SIZE + - Type: bool + - Default: true -Limitations + #### --protondrive-app-version -Note that premiumize.me is case insensitive so you can't have a file -called "Hello.doc" and one called "hello.doc". + The app version string -premiumize.me file names can't have the \ or " characters in. rclone -maps these to and from an identical looking unicode equivalents \ and -" + The app version string indicates the client that is currently performing + the API request. This information is required and will be sent with every + API request. -premiumize.me only supports filenames up to 255 characters in length. + Properties: -put.io + - Config: app_version + - Env Var: RCLONE_PROTONDRIVE_APP_VERSION + - Type: string + - Default: "macos-drive@1.0.0-alpha.1+rclone" -Paths are specified as remote:path + #### --protondrive-replace-existing-draft -put.io paths may be as deep as required, e.g. -remote:directory/subdirectory. + Create a new revision when filename conflict is detected -Configuration + When a file upload is cancelled or failed before completion, a draft will be + created and the subsequent upload of the same file to the same location will be + reported as a conflict. -The initial setup for put.io involves getting a token from put.io which -you need to do in your browser. rclone config walks you through it. + The value can also be set by --protondrive-replace-existing-draft=true -Here is an example of how to make a remote called remote. First run: + If the option is set to true, the draft will be replaced and then the upload + operation will restart. If there are other clients also uploading at the same + file location at the same time, the behavior is currently unknown. Need to set + to true for integration tests. + If the option is set to false, an error "a draft exist - usually this means a + file is being uploaded at another client, or, there was a failed upload attempt" + will be returned, and no upload will happen. - rclone config + Properties: -This will guide you through an interactive setup process: + - Config: replace_existing_draft + - Env Var: RCLONE_PROTONDRIVE_REPLACE_EXISTING_DRAFT + - Type: bool + - Default: false - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> putio - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Put.io - \ "putio" - [snip] - Storage> putio - ** See help for putio backend at: https://rclone.org/putio/ ** + #### --protondrive-enable-caching - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes - n) No - y/n> y - If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth - Log in and authorize rclone for access - Waiting for code... - Got code - -------------------- - [putio] - type = putio - token = {"access_token":"XXXXXXXX","expiry":"0001-01-01T00:00:00Z"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: + Caches the files and folders metadata to reduce API calls - Name Type - ==== ==== - putio putio + Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, + as the current implementation doesn't update or clear the cache when there are + external changes. - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> q + The files and folders on ProtonDrive are represented as links with keyrings, + which can be cached to improve performance and be friendly to the API server. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. + The cache is currently built for the case when the rclone is the only instance + performing operations to the mount point. The event system, which is the proton + API system that provides visibility of what has changed on the drive, is yet + to be implemented, so updates from other clients won’t be reflected in the + cache. Thus, if there are concurrent clients accessing the same mount point, + then we might have a problem with caching the stale data. -Note that rclone runs a webserver on your local machine to collect the -token as returned from put.io if using web browser to automatically -authenticate. This only runs from the moment it opens your browser to -the moment you get back the verification code. This is on -http://127.0.0.1:53682/ and this it may require you to unblock it -temporarily if you are running a host firewall, or use manual mode. + Properties: -You can then use it like this, + - Config: enable_caching + - Env Var: RCLONE_PROTONDRIVE_ENABLE_CACHING + - Type: bool + - Default: true -List directories in top level of your put.io - rclone lsd remote: -List all the files in your put.io + ## Limitations - rclone ls remote: + This backend uses the + [Proton-API-Bridge](https://github.com/henrybear327/Proton-API-Bridge), which + is based on [go-proton-api](https://github.com/henrybear327/go-proton-api), a + fork of the [official repo](https://github.com/ProtonMail/go-proton-api). -To copy a local directory to a put.io directory called backup + There is no official API documentation available from Proton Drive. But, thanks + to Proton open sourcing [proton-go-api](https://github.com/ProtonMail/go-proton-api) + and the web, iOS, and Android client codebases, we don't need to completely + reverse engineer the APIs by observing the web client traffic! - rclone copy /home/source remote:backup + [proton-go-api](https://github.com/ProtonMail/go-proton-api) provides the basic + building blocks of API calls and error handling, such as 429 exponential + back-off, but it is pretty much just a barebone interface to the Proton API. + For example, the encryption and decryption of the Proton Drive file are not + provided in this library. -Restricted filename characters + The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on + top of this quickly. This codebase handles the intricate tasks before and after + calling Proton APIs, particularly the complex encryption scheme, allowing + developers to implement features for other software on top of this codebase. + There are likely quite a few errors in this library, as there isn't official + documentation available. -In addition to the default restricted characters set the following -characters are also replaced: + # Seafile - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ + This is a backend for the [Seafile](https://www.seafile.com/) storage service: + - It works with both the free community edition or the professional edition. + - Seafile versions 6.x, 7.x, 8.x and 9.x are all supported. + - Encrypted libraries are also supported. + - It supports 2FA enabled users + - Using a Library API Token is **not** supported -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + ## Configuration -Advanced options + There are two distinct modes you can setup your remote: + - you point your remote to the **root of the server**, meaning you don't specify a library during the configuration: + Paths are specified as `remote:library`. You may put subdirectories in too, e.g. `remote:library/path/to/dir`. + - you point your remote to a specific library during the configuration: + Paths are specified as `remote:path/to/dir`. **This is the recommended mode when using encrypted libraries**. (_This mode is possibly slightly faster than the root mode_) -Here are the Advanced options specific to putio (Put.io). + ### Configuration in root mode ---putio-encoding + Here is an example of making a seafile configuration for a user with **no** two-factor authentication. First run -The encoding for the backend. + rclone config -See the encoding section in the overview for more info. + This will guide you through an interactive setup process. To authenticate + you will need the URL of your server, your email (or username) and your password. -Properties: +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> seafile Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +Seafile  "seafile" [snip] Storage> seafile ** See help for seafile +backend at: https://rclone.org/seafile/ ** -- Config: encoding -- Env Var: RCLONE_PUTIO_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +URL of seafile host to connect to Enter a string value. Press Enter for +the default (""). Choose a number from below, or type in your own value +1 / Connect to cloud.seafile.com  "https://cloud.seafile.com/" url> +http://my.seafile.server/ User name (usually email address) Enter a +string value. Press Enter for the default (""). user> me@example.com +Password y) Yes type in my own password g) Generate random password n) +No leave this optional password blank (default) y/g> y Enter the +password: password: Confirm the password: password: Two-factor +authentication ('true' if the account has 2FA enabled) Enter a boolean +value (true or false). Press Enter for the default ("false"). 2fa> false +Name of the library. Leave blank to access all non-encrypted libraries. +Enter a string value. Press Enter for the default (""). library> Library +password (for encrypted libraries only). Leave blank if you pass it +through the command line. y) Yes type in my own password g) Generate +random password n) No leave this optional password blank (default) +y/g/n> n Edit advanced config? (y/n) y) Yes n) No (default) y/n> n +Remote config Two-factor authentication is not enabled on this account. +-------------------- [seafile] type = seafile url = +http://my.seafile.server/ user = me@example.com pass = *** ENCRYPTED *** +2fa = false -------------------- y) Yes this is OK (default) e) Edit +this remote d) Delete this remote y/e/d> y -Limitations -put.io has rate limiting. When you hit a limit, rclone automatically -retries after waiting the amount of time requested by the server. + This remote is called `seafile`. It's pointing to the root of your seafile server and can now be used like this: -If you want to avoid ever hitting these limits, you may use the ---tpslimit flag with a low number. Note that the imposed limits may be -different for different operations, and may change over time. + See all libraries -Seafile + rclone lsd seafile: -This is a backend for the Seafile storage service: - It works with both -the free community edition or the professional edition. - Seafile -versions 6.x, 7.x, 8.x and 9.x are all supported. - Encrypted libraries -are also supported. - It supports 2FA enabled users - Using a Library -API Token is not supported + Create a new library -Configuration + rclone mkdir seafile:library -There are two distinct modes you can setup your remote: - you point your -remote to the root of the server, meaning you don't specify a library -during the configuration: Paths are specified as remote:library. You may -put subdirectories in too, e.g. remote:library/path/to/dir. - you point -your remote to a specific library during the configuration: Paths are -specified as remote:path/to/dir. This is the recommended mode when using -encrypted libraries. (This mode is possibly slightly faster than the -root mode) + List the contents of a library -Configuration in root mode + rclone ls seafile:library -Here is an example of making a seafile configuration for a user with no -two-factor authentication. First run + Sync `/home/local/directory` to the remote library, deleting any + excess files in the library. - rclone config + rclone sync --interactive /home/local/directory seafile:library -This will guide you through an interactive setup process. To -authenticate you will need the URL of your server, your email (or -username) and your password. + ### Configuration in library mode - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> seafile - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Seafile - \ "seafile" - [snip] - Storage> seafile - ** See help for seafile backend at: https://rclone.org/seafile/ ** + Here's an example of a configuration in library mode with a user that has the two-factor authentication enabled. Your 2FA code will be asked at the end of the configuration, and will attempt to authenticate you: - URL of seafile host to connect to - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Connect to cloud.seafile.com - \ "https://cloud.seafile.com/" - url> http://my.seafile.server/ - User name (usually email address) - Enter a string value. Press Enter for the default (""). - user> me@example.com - Password - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank (default) - y/g> y - Enter the password: - password: - Confirm the password: - password: - Two-factor authentication ('true' if the account has 2FA enabled) - Enter a boolean value (true or false). Press Enter for the default ("false"). - 2fa> false - Name of the library. Leave blank to access all non-encrypted libraries. - Enter a string value. Press Enter for the default (""). - library> - Library password (for encrypted libraries only). Leave blank if you pass it through the command line. - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank (default) - y/g/n> n - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - Two-factor authentication is not enabled on this account. - -------------------- - [seafile] - type = seafile - url = http://my.seafile.server/ - user = me@example.com - pass = *** ENCRYPTED *** - 2fa = false - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> seafile Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +Seafile  "seafile" [snip] Storage> seafile ** See help for seafile +backend at: https://rclone.org/seafile/ ** -This remote is called seafile. It's pointing to the root of your seafile -server and can now be used like this: +URL of seafile host to connect to Enter a string value. Press Enter for +the default (""). Choose a number from below, or type in your own value +1 / Connect to cloud.seafile.com  "https://cloud.seafile.com/" url> +http://my.seafile.server/ User name (usually email address) Enter a +string value. Press Enter for the default (""). user> me@example.com +Password y) Yes type in my own password g) Generate random password n) +No leave this optional password blank (default) y/g> y Enter the +password: password: Confirm the password: password: Two-factor +authentication ('true' if the account has 2FA enabled) Enter a boolean +value (true or false). Press Enter for the default ("false"). 2fa> true +Name of the library. Leave blank to access all non-encrypted libraries. +Enter a string value. Press Enter for the default (""). library> My +Library Library password (for encrypted libraries only). Leave blank if +you pass it through the command line. y) Yes type in my own password g) +Generate random password n) No leave this optional password blank +(default) y/g/n> n Edit advanced config? (y/n) y) Yes n) No (default) +y/n> n Remote config Two-factor authentication: please enter your 2FA +code 2fa code> 123456 Authenticating... Success! -------------------- +[seafile] type = seafile url = http://my.seafile.server/ user = +me@example.com pass = 2fa = true library = My Library +-------------------- y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> y -See all libraries - rclone lsd seafile: + You'll notice your password is blank in the configuration. It's because we only need the password to authenticate you once. -Create a new library + You specified `My Library` during the configuration. The root of the remote is pointing at the + root of the library `My Library`: - rclone mkdir seafile:library + See all files in the library: -List the contents of a library + rclone lsd seafile: - rclone ls seafile:library + Create a new directory inside the library -Sync /home/local/directory to the remote library, deleting any excess -files in the library. + rclone mkdir seafile:directory - rclone sync --interactive /home/local/directory seafile:library + List the contents of a directory -Configuration in library mode + rclone ls seafile:directory -Here's an example of a configuration in library mode with a user that -has the two-factor authentication enabled. Your 2FA code will be asked -at the end of the configuration, and will attempt to authenticate you: + Sync `/home/local/directory` to the remote library, deleting any + excess files in the library. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> seafile - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / Seafile - \ "seafile" - [snip] - Storage> seafile - ** See help for seafile backend at: https://rclone.org/seafile/ ** + rclone sync --interactive /home/local/directory seafile: - URL of seafile host to connect to - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Connect to cloud.seafile.com - \ "https://cloud.seafile.com/" - url> http://my.seafile.server/ - User name (usually email address) - Enter a string value. Press Enter for the default (""). - user> me@example.com - Password - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank (default) - y/g> y - Enter the password: - password: - Confirm the password: - password: - Two-factor authentication ('true' if the account has 2FA enabled) - Enter a boolean value (true or false). Press Enter for the default ("false"). - 2fa> true - Name of the library. Leave blank to access all non-encrypted libraries. - Enter a string value. Press Enter for the default (""). - library> My Library - Library password (for encrypted libraries only). Leave blank if you pass it through the command line. - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank (default) - y/g/n> n - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - Two-factor authentication: please enter your 2FA code - 2fa code> 123456 - Authenticating... - Success! - -------------------- - [seafile] - type = seafile - url = http://my.seafile.server/ - user = me@example.com - pass = - 2fa = true - library = My Library - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y -You'll notice your password is blank in the configuration. It's because -we only need the password to authenticate you once. + ### --fast-list -You specified My Library during the configuration. The root of the -remote is pointing at the root of the library My Library: + Seafile version 7+ supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. + Please note this is not supported on seafile server version 6.x -See all files in the library: - rclone lsd seafile: + ### Restricted filename characters -Create a new directory inside the library + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: - rclone mkdir seafile:directory + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | / | 0x2F | / | + | " | 0x22 | " | + | \ | 0x5C | \ | -List the contents of a directory + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. - rclone ls seafile:directory + ### Seafile and rclone link -Sync /home/local/directory to the remote library, deleting any excess -files in the library. + Rclone supports generating share links for non-encrypted libraries only. + They can either be for a file or a directory: - rclone sync --interactive /home/local/directory seafile: +rclone link seafile:seafile-tutorial.doc +http://my.seafile.server/f/fdcd8a2f93f84b8b90f4/ ---fast-list -Seafile version 7+ supports --fast-list which allows you to use fewer -transactions in exchange for more memory. See the rclone docs for more -details. Please note this is not supported on seafile server version 6.x + or if run on a directory you will get: -Restricted filename characters +rclone link seafile:dir http://my.seafile.server/d/9ea2455f6f55478bbb0d/ -In addition to the default restricted characters set the following -characters are also replaced: - Character Value Replacement - ----------- ------- ------------- - / 0x2F / - " 0x22 " - \ 0x5C \ + Please note a share link is unique for each file or directory. If you run a link command on a file/dir + that has already been shared, you will get the exact same link. -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. + ### Compatibility -Seafile and rclone link + It has been actively developed using the [seafile docker image](https://github.com/haiwen/seafile-docker) of these versions: + - 6.3.4 community edition + - 7.0.5 community edition + - 7.1.3 community edition + - 9.0.10 community edition -Rclone supports generating share links for non-encrypted libraries only. -They can either be for a file or a directory: + Versions below 6.0 are not supported. + Versions between 6.0 and 6.3 haven't been tested and might not work properly. - rclone link seafile:seafile-tutorial.doc - http://my.seafile.server/f/fdcd8a2f93f84b8b90f4/ + Each new version of `rclone` is automatically tested against the [latest docker image](https://hub.docker.com/r/seafileltd/seafile-mc/) of the seafile community server. -or if run on a directory you will get: - rclone link seafile:dir - http://my.seafile.server/d/9ea2455f6f55478bbb0d/ + ### Standard options -Please note a share link is unique for each file or directory. If you -run a link command on a file/dir that has already been shared, you will -get the exact same link. + Here are the Standard options specific to seafile (seafile). -Compatibility + #### --seafile-url -It has been actively developed using the seafile docker image of these -versions: - 6.3.4 community edition - 7.0.5 community edition - 7.1.3 -community edition - 9.0.10 community edition + URL of seafile host to connect to. -Versions below 6.0 are not supported. Versions between 6.0 and 6.3 -haven't been tested and might not work properly. + Properties: -Each new version of rclone is automatically tested against the latest -docker image of the seafile community server. + - Config: url + - Env Var: RCLONE_SEAFILE_URL + - Type: string + - Required: true + - Examples: + - "https://cloud.seafile.com/" + - Connect to cloud.seafile.com. -Standard options + #### --seafile-user -Here are the Standard options specific to seafile (seafile). + User name (usually email address). ---seafile-url + Properties: -URL of seafile host to connect to. + - Config: user + - Env Var: RCLONE_SEAFILE_USER + - Type: string + - Required: true -Properties: + #### --seafile-pass -- Config: url -- Env Var: RCLONE_SEAFILE_URL -- Type: string -- Required: true -- Examples: - - "https://cloud.seafile.com/" - - Connect to cloud.seafile.com. + Password. ---seafile-user + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -User name (usually email address). + Properties: -Properties: + - Config: pass + - Env Var: RCLONE_SEAFILE_PASS + - Type: string + - Required: false -- Config: user -- Env Var: RCLONE_SEAFILE_USER -- Type: string -- Required: true + #### --seafile-2fa ---seafile-pass + Two-factor authentication ('true' if the account has 2FA enabled). -Password. + Properties: -NB Input to this must be obscured - see rclone obscure. + - Config: 2fa + - Env Var: RCLONE_SEAFILE_2FA + - Type: bool + - Default: false -Properties: + #### --seafile-library -- Config: pass -- Env Var: RCLONE_SEAFILE_PASS -- Type: string -- Required: false + Name of the library. ---seafile-2fa + Leave blank to access all non-encrypted libraries. -Two-factor authentication ('true' if the account has 2FA enabled). + Properties: -Properties: + - Config: library + - Env Var: RCLONE_SEAFILE_LIBRARY + - Type: string + - Required: false -- Config: 2fa -- Env Var: RCLONE_SEAFILE_2FA -- Type: bool -- Default: false + #### --seafile-library-key ---seafile-library + Library password (for encrypted libraries only). -Name of the library. + Leave blank if you pass it through the command line. -Leave blank to access all non-encrypted libraries. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Properties: + Properties: -- Config: library -- Env Var: RCLONE_SEAFILE_LIBRARY -- Type: string -- Required: false + - Config: library_key + - Env Var: RCLONE_SEAFILE_LIBRARY_KEY + - Type: string + - Required: false ---seafile-library-key + #### --seafile-auth-token -Library password (for encrypted libraries only). + Authentication token. -Leave blank if you pass it through the command line. + Properties: -NB Input to this must be obscured - see rclone obscure. + - Config: auth_token + - Env Var: RCLONE_SEAFILE_AUTH_TOKEN + - Type: string + - Required: false -Properties: + ### Advanced options -- Config: library_key -- Env Var: RCLONE_SEAFILE_LIBRARY_KEY -- Type: string -- Required: false + Here are the Advanced options specific to seafile (seafile). ---seafile-auth-token + #### --seafile-create-library -Authentication token. + Should rclone create a library if it doesn't exist. -Properties: + Properties: -- Config: auth_token -- Env Var: RCLONE_SEAFILE_AUTH_TOKEN -- Type: string -- Required: false + - Config: create_library + - Env Var: RCLONE_SEAFILE_CREATE_LIBRARY + - Type: bool + - Default: false -Advanced options + #### --seafile-encoding -Here are the Advanced options specific to seafile (seafile). + The encoding for the backend. ---seafile-create-library + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Should rclone create a library if it doesn't exist. + Properties: -Properties: + - Config: encoding + - Env Var: RCLONE_SEAFILE_ENCODING + - Type: Encoding + - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 -- Config: create_library -- Env Var: RCLONE_SEAFILE_CREATE_LIBRARY -- Type: bool -- Default: false ---seafile-encoding -The encoding for the backend. + # SFTP -See the encoding section in the overview for more info. + SFTP is the [Secure (or SSH) File Transfer + Protocol](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol). -Properties: + The SFTP backend can be used with a number of different providers: -- Config: encoding -- Env Var: RCLONE_SEAFILE_ENCODING -- Type: MultiEncoder -- Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 -SFTP + - Hetzner Storage Box + - rsync.net -SFTP is the Secure (or SSH) File Transfer Protocol. -The SFTP backend can be used with a number of different providers: + SFTP runs over SSH v2 and is installed as standard with most modern + SSH installations. -- Hetzner Storage Box -- rsync.net + Paths are specified as `remote:path`. If the path does not begin with + a `/` it is relative to the home directory of the user. An empty path + `remote:` refers to the user's home directory. For example, `rclone lsd remote:` + would list the home directory of the user configured in the rclone remote config + (`i.e /home/sftpuser`). However, `rclone lsd remote:/` would list the root + directory for remote machine (i.e. `/`) -SFTP runs over SSH v2 and is installed as standard with most modern SSH -installations. + Note that some SFTP servers will need the leading / - Synology is a + good example of this. rsync.net and Hetzner, on the other hand, requires users to + OMIT the leading /. -Paths are specified as remote:path. If the path does not begin with a / -it is relative to the home directory of the user. An empty path remote: -refers to the user's home directory. For example, rclone lsd remote: -would list the home directory of the user configured in the rclone -remote config (i.e /home/sftpuser). However, rclone lsd remote:/ would -list the root directory for remote machine (i.e. /) + Note that by default rclone will try to execute shell commands on + the server, see [shell access considerations](#shell-access-considerations). -Note that some SFTP servers will need the leading / - Synology is a good -example of this. rsync.net and Hetzner, on the other hand, requires -users to OMIT the leading /. + ## Configuration -Note that by default rclone will try to execute shell commands on the -server, see shell access considerations. + Here is an example of making an SFTP configuration. First run -Configuration + rclone config -Here is an example of making an SFTP configuration. First run + This will guide you through an interactive setup process. - rclone config +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / SSH/SFTP  "sftp" [snip] Storage> sftp SSH host to connect to Choose +a number from below, or type in your own value 1 / Connect to +example.com  "example.com" host> example.com SSH username Enter a string +value. Press Enter for the default ("$USER"). user> sftpuser SSH port +number Enter a signed integer. Press Enter for the default (22). port> +SSH password, leave blank to use ssh-agent. y) Yes type in my own +password g) Generate random password n) No leave this optional password +blank y/g/n> n Path to unencrypted PEM-encoded private key file, leave +blank to use ssh-agent. key_file> Remote config -------------------- +[remote] host = example.com user = sftpuser port = pass = key_file = +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y -This will guide you through an interactive setup process. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / SSH/SFTP - \ "sftp" - [snip] - Storage> sftp - SSH host to connect to - Choose a number from below, or type in your own value - 1 / Connect to example.com - \ "example.com" - host> example.com - SSH username - Enter a string value. Press Enter for the default ("$USER"). - user> sftpuser - SSH port number - Enter a signed integer. Press Enter for the default (22). - port> - SSH password, leave blank to use ssh-agent. - y) Yes type in my own password - g) Generate random password - n) No leave this optional password blank - y/g/n> n - Path to unencrypted PEM-encoded private key file, leave blank to use ssh-agent. - key_file> - Remote config - -------------------- - [remote] - host = example.com - user = sftpuser - port = - pass = - key_file = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + This remote is called `remote` and can now be used like this: -This remote is called remote and can now be used like this: + See all directories in the home directory -See all directories in the home directory + rclone lsd remote: - rclone lsd remote: + See all directories in the root directory -See all directories in the root directory + rclone lsd remote:/ - rclone lsd remote:/ + Make a new directory -Make a new directory + rclone mkdir remote:path/to/directory - rclone mkdir remote:path/to/directory + List the contents of a directory -List the contents of a directory + rclone ls remote:path/to/directory - rclone ls remote:path/to/directory + Sync `/home/local/directory` to the remote directory, deleting any + excess files in the directory. -Sync /home/local/directory to the remote directory, deleting any excess -files in the directory. + rclone sync --interactive /home/local/directory remote:directory - rclone sync --interactive /home/local/directory remote:directory + Mount the remote path `/srv/www-data/` to the local path + `/mnt/www-data` -Mount the remote path /srv/www-data/ to the local path /mnt/www-data + rclone mount remote:/srv/www-data/ /mnt/www-data - rclone mount remote:/srv/www-data/ /mnt/www-data + ### SSH Authentication -SSH Authentication + The SFTP remote supports three authentication methods: -The SFTP remote supports three authentication methods: + * Password + * Key file, including certificate signed keys + * ssh-agent -- Password -- Key file, including certificate signed keys -- ssh-agent + Key files should be PEM-encoded private key files. For instance `/home/$USER/.ssh/id_rsa`. + Only unencrypted OpenSSH or PEM encrypted files are supported. -Key files should be PEM-encoded private key files. For instance -/home/$USER/.ssh/id_rsa. Only unencrypted OpenSSH or PEM encrypted files -are supported. + The key file can be specified in either an external file (key_file) or contained within the + rclone config file (key_pem). If using key_pem in the config file, the entry should be on a + single line with new line ('\n' or '\r\n') separating lines. i.e. -The key file can be specified in either an external file (key_file) or -contained within the rclone config file (key_pem). If using key_pem in -the config file, the entry should be on a single line with new line ('' -or '') separating lines. i.e. + key_pem = -----BEGIN RSA PRIVATE KEY-----\nMaMbaIXtE\n0gAMbMbaSsd\nMbaass\n-----END RSA PRIVATE KEY----- - key_pem = -----BEGIN RSA PRIVATE KEY-----\nMaMbaIXtE\n0gAMbMbaSsd\nMbaass\n-----END RSA PRIVATE KEY----- + This will generate it correctly for key_pem for use in the config: -This will generate it correctly for key_pem for use in the config: + awk '{printf "%s\\n", $0}' < ~/.ssh/id_rsa - awk '{printf "%s\\n", $0}' < ~/.ssh/id_rsa + If you don't specify `pass`, `key_file`, or `key_pem` or `ask_password` then + rclone will attempt to contact an ssh-agent. You can also specify `key_use_agent` + to force the usage of an ssh-agent. In this case `key_file` or `key_pem` can + also be specified to force the usage of a specific key in the ssh-agent. -If you don't specify pass, key_file, or key_pem or ask_password then -rclone will attempt to contact an ssh-agent. You can also specify -key_use_agent to force the usage of an ssh-agent. In this case key_file -or key_pem can also be specified to force the usage of a specific key in -the ssh-agent. + Using an ssh-agent is the only way to load encrypted OpenSSH keys at the moment. -Using an ssh-agent is the only way to load encrypted OpenSSH keys at the -moment. + If you set the `ask_password` option, rclone will prompt for a password when + needed and no password has been configured. -If you set the ask_password option, rclone will prompt for a password -when needed and no password has been configured. + #### Certificate-signed keys -Certificate-signed keys + With traditional key-based authentication, you configure your private key only, + and the public key built into it will be used during the authentication process. -With traditional key-based authentication, you configure your private -key only, and the public key built into it will be used during the -authentication process. + If you have a certificate you may use it to sign your public key, creating a + separate SSH user certificate that should be used instead of the plain public key + extracted from the private key. Then you must provide the path to the + user certificate public key file in `pubkey_file`. -If you have a certificate you may use it to sign your public key, -creating a separate SSH user certificate that should be used instead of -the plain public key extracted from the private key. Then you must -provide the path to the user certificate public key file in pubkey_file. + Note: This is not the traditional public key paired with your private key, + typically saved as `/home/$USER/.ssh/id_rsa.pub`. Setting this path in + `pubkey_file` will not work. -Note: This is not the traditional public key paired with your private -key, typically saved as /home/$USER/.ssh/id_rsa.pub. Setting this path -in pubkey_file will not work. + Example: -Example: +[remote] type = sftp host = example.com user = sftpuser key_file = +~/id_rsa pubkey_file = ~/id_rsa-cert.pub - [remote] - type = sftp - host = example.com - user = sftpuser - key_file = ~/id_rsa - pubkey_file = ~/id_rsa-cert.pub -If you concatenate a cert with a private key then you can specify the -merged file in both places. + If you concatenate a cert with a private key then you can specify the + merged file in both places. -Note: the cert must come first in the file. e.g. + Note: the cert must come first in the file. e.g. + ``` cat id_rsa-cert.pub id_rsa > merged_key + ``` -Host key validation + ### Host key validation -By default rclone will not check the server's host key for validation. -This can allow an attacker to replace a server with their own and if you -use password authentication then this can lead to that password being -exposed. + By default rclone will not check the server's host key for validation. This + can allow an attacker to replace a server with their own and if you use + password authentication then this can lead to that password being exposed. -Host key matching, using standard known_hosts files can be turned on by -enabling the known_hosts_file option. This can point to the file -maintained by OpenSSH or can point to a unique file. + Host key matching, using standard `known_hosts` files can be turned on by + enabling the `known_hosts_file` option. This can point to the file maintained + by `OpenSSH` or can point to a unique file. -e.g. using the OpenSSH known_hosts file: + e.g. using the OpenSSH `known_hosts` file: + ``` [remote] type = sftp host = example.com @@ -38470,7 +43322,7 @@ disable_hashcheck to true to disable checksumming entirely, or set shell_type to none to disable all functionality based on remote shell command execution. -Modified time +Modification times and hashes Modified times are stored on the server to 1 second precision. @@ -38676,6 +43528,41 @@ Properties: - Type: bool - Default: false +--sftp-ssh + +Path and arguments to external ssh binary. + +Normally rclone will use its internal ssh library to connect to the SFTP +server. However it does not implement all possible ssh options so it may +be desirable to use an external ssh binary. + +Rclone ignores all the internal config if you use this option and +expects you to configure the ssh binary with the user/host/port and any +other options you need. + +Important The ssh command must log in without asking for a password so +needs to be configured with keys or certificates. + +Rclone will run the command supplied either with the additional +arguments "-s sftp" to access the SFTP subsystem or with commands such +as "md5sum /path/to/file" appended to read checksums. + +Any arguments with spaces in should be surrounded by "double quotes". + +An example setting might be: + + ssh -o ServerAliveInterval=20 user@example.com + +Note that when using an external ssh binary rclone makes a new ssh +connection for every hash it calculates. + +Properties: + +- Config: ssh +- Env Var: RCLONE_SFTP_SSH +- Type: SpaceSepList +- Default: + Advanced options Here are the Advanced options specific to sftp (SSH/SFTP). @@ -38728,6 +43615,22 @@ E.g. if home directory can be found in a shared folder called "home": rclone sync /home/local/directory remote:/home/directory --sftp-path-override /volume1/homes/USER/directory +To specify only the path to the SFTP remote's root, and allow rclone to +add any relative subpaths automatically (including unwrapping/decrypting +remotes as necessary), add the '@' character to the beginning of the +path. + +E.g. the first example above could be rewritten as: + + rclone sync /home/local/directory remote:/directory --sftp-path-override @/volume2 + +Note that when using this method with Synology "home" folders, the full +"/homes/USER" path should be specified instead of "/home". + +E.g. the second example above should be rewritten as: + + rclone sync /home/local/directory remote:/homes/USER/directory --sftp-path-override @/volume1 + Properties: - Config: path_override @@ -38822,6 +43725,15 @@ Specifies the path or command to run a sftp server on the remote host. The subsystem option is ignored when server_command is defined. +If adding server_command to the configuration file please note that it +should not be enclosed in quotes, since that will make rclone fail. + +A working example is: + + [remote_name] + type = sftp + server_command = sudo /usr/libexec/openssh/sftp-server + Properties: - Config: server_command @@ -38963,7 +43875,7 @@ Pass multiple variables space separated, eg VAR1=value VAR2=value -and pass variables with spaces in in quotes, eg +and pass variables with spaces in quotes, eg "VAR3=value with space" "VAR4=value with space" VAR5=nospacehere @@ -39034,6 +43946,70 @@ Properties: - Type: SpaceSepList - Default: +--sftp-host-key-algorithms + +Space separated list of host key algorithms, ordered by preference. + +At least one must match with server configuration. This can be checked +for example using ssh -Q HostKeyAlgorithms. + +Note: This can affect the outcome of key negotiation with the server +even if server host key validation is not enabled. + +Example: + + ssh-ed25519 ssh-rsa ssh-dss + +Properties: + +- Config: host_key_algorithms +- Env Var: RCLONE_SFTP_HOST_KEY_ALGORITHMS +- Type: SpaceSepList +- Default: + +--sftp-socks-proxy + +Socks 5 proxy host. + +Supports the format user:pass@host:port, user@host:port, host:port. + +Example: + + myUser:myPass@localhost:9005 + +Properties: + +- Config: socks_proxy +- Env Var: RCLONE_SFTP_SOCKS_PROXY +- Type: string +- Required: false + +--sftp-copy-is-hardlink + +Set to enable server side copies using hardlinks. + +The SFTP protocol does not define a copy command so normally server side +copies are not allowed with the sftp backend. + +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. These +will be implemented by doing a hardlink from the source to the +destination. + +Not all sftp servers support this. + +Note that hardlinking two files together will use no additional space as +the source and the destination will be the same file. + +This feature may be useful backups made with --copy-dest. + +Properties: + +- Config: copy_is_hardlink +- Env Var: RCLONE_SFTP_COPY_IS_HARDLINK +- Type: bool +- Default: false + Limitations On some SFTP servers (e.g. Synology) the paths are different for SSH and @@ -39081,7 +44057,7 @@ Notes The first path segment must be the name of the share, which you entered when you started to share on Windows. On smbd, it's the section title in -smb.conf (usually in /etc/samba/) file. You can find shares by quering +smb.conf (usually in /etc/samba/) file. You can find shares by querying the root if you're unsure (e.g. rclone lsd remote:). You can't access to the shared printers from rclone, obviously. @@ -39310,7 +44286,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SMB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -39835,7 +44811,7 @@ Paths may be as deep as required, e.g. remote:directory/subdirectory. NB you can't create files in the top level folder you have to create a folder, which rclone will create as a "Sync Folder" with SugarSync. -Modified time and hashes +Modification times and hashes SugarSync does not support modification times or hashes, therefore syncing will default to --size-only checking. Note that using --update @@ -40003,7 +44979,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SUGARSYNC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8,Dot Limitations @@ -40098,9 +45074,10 @@ To copy a local directory to an Uptobox directory called backup rclone copy /home/source remote:backup -Modified time and hashes +Modification times and hashes -Uptobox supports neither modified times nor checksums. +Uptobox supports neither modified times nor checksums. All timestamps +will read as that set by --default-time. Restricted filename characters @@ -40136,6 +45113,17 @@ Advanced options Here are the Advanced options specific to uptobox (Uptobox). +--uptobox-private + +Set to make uploaded files private + +Properties: + +- Config: private +- Env Var: RCLONE_UPTOBOX_PRIVATE +- Type: bool +- Default: false + --uptobox-encoding The encoding for the backend. @@ -40146,7 +45134,7 @@ Properties: - Config: encoding - Env Var: RCLONE_UPTOBOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot @@ -40160,27 +45148,29 @@ can however been seen in the uptobox web interface. Union -The union remote provides a unification similar to UnionFS using other -remotes. - -Paths may be as deep as required or a local path, e.g. -remote:directory/subdirectory or /directory/subdirectory. +The union backend joins several remotes together to make a single +unified view of them. During the initial setup with rclone config you will specify the upstream remotes as a space separated list. The upstream remotes can either be a local paths or other remotes. -Attribute :ro and :nc can be attach to the end of path to tag the remote -as read only or no create, e.g. remote:directory/subdirectory:ro or -remote:directory/subdirectory:nc. +The attributes :ro, :nc and :writeback can be attached to the end of the +remote to tag the remote as read only, no create or writeback, e.g. +remote:directory/subdirectory:ro or remote:directory/subdirectory:nc. + +- :ro means files will only be read from here and never written +- :nc means new files or directories won't be created here +- :writeback means files found in different remotes will be written + back here. See the writeback section for more info. Subfolders can be used in upstream remotes. Assume a union remote named backup with the remotes mydrive:private/backup. Invoking rclone mkdir backup:desktop is exactly the same as invoking rclone mkdir mydrive:private/backup/desktop. -There will be no special handling of paths containing .. segments. -Invoking rclone mkdir backup:../desktop is exactly the same as invoking +There is no special handling of paths containing .. segments. Invoking +rclone mkdir backup:../desktop is exactly the same as invoking rclone mkdir mydrive:private/backup/../desktop. Configuration @@ -40402,6 +45392,34 @@ much larger latency of remote file systems. upstream. ----------------------------------------------------------------------- +Writeback + +The tag :writeback on an upstream remote can be used to make a simple +cache system like this: + + [union] + type = union + action_policy = all + create_policy = all + search_policy = ff + upstreams = /local:writeback remote:dir + +When files are opened for read, if the file is in remote:dir but not +/local then rclone will copy the file entirely into /local before +returning a reference to the file in /local. The copy will be done with +the equivalent of rclone copy so will use --multi-thread-streams if +configured. Any copies will be logged with an INFO log. + +When files are written, they will be written to both remote:dir and +/local. + +As many remotes as desired can be added to upstreams but there should +only be one :writeback tag. + +Rclone does not manage the :writeback remote in any way other than +writing files back to it. So if you need to expire old files or manage +the size then you will have to do this yourself. + Standard options Here are the Standard options specific to union (Union merges the @@ -40530,17 +45548,21 @@ This will guide you through an interactive setup process: url> https://example.com/remote.php/webdav/ Name of the WebDAV site/service/software you are using Choose a number from below, or type in your own value - 1 / Nextcloud - \ "nextcloud" - 2 / Owncloud - \ "owncloud" - 3 / Sharepoint Online, authenticated by Microsoft account. - \ "sharepoint" - 4 / Sharepoint with NTLM authentication. Usually self-hosted or on-premises. - \ "sharepoint-ntlm" - 5 / Other site/service or software - \ "other" - vendor> 1 + 1 / Fastmail Files + \ (fastmail) + 2 / Nextcloud + \ (nextcloud) + 3 / Owncloud + \ (owncloud) + 4 / Sharepoint Online, authenticated by Microsoft account + \ (sharepoint) + 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises + \ (sharepoint-ntlm) + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \ (rclone) + 7 / Other site/service or software + \ (other) + vendor> 2 User name user> user Password. @@ -40583,15 +45605,17 @@ To copy a local directory to an WebDAV directory called backup rclone copy /home/source remote:backup -Modified time and hashes +Modification times and hashes Plain WebDAV does not support modified times. However when used with -Owncloud or Nextcloud rclone will support modified times. +Fastmail Files, Owncloud or Nextcloud rclone will support modified +times. Likewise plain WebDAV does not support hashes, however when used with -Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. Depending -on the exact version of Owncloud or Nextcloud hashes may appear on all -objects, or only on objects which had a hash uploaded with them. +Fastmail Files, Owncloud or Nextcloud rclone will support SHA1 and MD5 +hashes. Depending on the exact version of Owncloud or Nextcloud hashes +may appear on all objects, or only on objects which had a hash uploaded +with them. Standard options @@ -40621,6 +45645,8 @@ Properties: - Type: string - Required: false - Examples: + - "fastmail" + - Fastmail Files - "nextcloud" - Nextcloud - "owncloud" @@ -40630,6 +45656,9 @@ Properties: - "sharepoint-ntlm" - Sharepoint with NTLM authentication, usually self-hosted or on-premises + - "rclone" + - rclone WebDAV server to serve a remote over HTTP via the + WebDAV protocol - "other" - Other site/service or software @@ -40725,10 +45754,47 @@ Properties: - Type: CommaSepList - Default: +--webdav-pacer-min-sleep + +Minimum time to sleep between API calls. + +Properties: + +- Config: pacer_min_sleep +- Env Var: RCLONE_WEBDAV_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms + +--webdav-nextcloud-chunk-size + +Nextcloud upload chunk size. + +We recommend configuring your NextCloud instance to increase the max +chunk size to 1 GB for better upload performances. See +https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#adjust-chunk-size-on-nextcloud-side + +Set to 0 to disable chunked uploading. + +Properties: + +- Config: nextcloud_chunk_size +- Env Var: RCLONE_WEBDAV_NEXTCLOUD_CHUNK_SIZE +- Type: SizeSuffix +- Default: 10Mi + Provider notes See below for notes on specific providers. +Fastmail Files + +Use https://webdav.fastmail.com/ or a subdirectory as the URL, and your +Fastmail email username@domain.tld as the username. Follow this +documentation to create an app password with access to Files (WebDAV) +and use this as the password. + +Fastmail supports modified times using the X-OC-Mtime header. + Owncloud Click on the settings cog in the bottom right of the page and this will @@ -40823,6 +45889,13 @@ property to compare your documents: --ignore-size --ignore-checksum --update +Rclone + +Use this option if you are hosting remotes over WebDAV provided by +rclone. Read rclone serve webdav for more details. + +rclone serve supports modified times using the X-OC-Mtime header. + dCache dCache is a storage system that supports many protocols and @@ -40972,14 +46045,12 @@ in the path. Yandex paths may be as deep as required, e.g. remote:directory/subdirectory. -Modified time +Modification times and hashes Modified times are supported and are stored accurate to 1 ns in custom metadata called rclone_modified in RFC3339 with nanoseconds format. -MD5 checksums - -MD5 checksums are natively supported by Yandex Disk. +The MD5 hash algorithm is natively supported by Yandex Disk. Emptying Trash @@ -41091,7 +46162,7 @@ Properties: - Config: encoding - Env Var: RCLONE_YANDEX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot Limitations @@ -41213,13 +46284,11 @@ in the path. Zoho paths may be as deep as required, eg remote:directory/subdirectory. -Modified time +Modification times and hashes Modified times are currently not supported for Zoho Workdrive -Checksums - -No checksums are supported. +No hash algorithms are supported. Usage information @@ -41340,7 +46409,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ZOHO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Del,Ctl,InvalidUtf8 Setting up your own client_id @@ -41374,11 +46443,11 @@ For consistencies sake one can also configure a remote of type local in the config file, and access the local filesystem using rclone remote paths, e.g. remote:path/to/wherever, but it is probably easier not to. -Modified time +Modification times -Rclone reads and writes the modified time using an accuracy determined -by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second -on OS X. +Rclone reads and writes the modification times using an accuracy +determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows +and 1 Second on OS X. Filenames @@ -41780,6 +46849,12 @@ we: - Only checksum the size that stat gave - Don't update the stat info for the file +NB do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. + Properties: - Config: no_check_updated @@ -41888,7 +46963,7 @@ Properties: - Config: encoding - Env Var: RCLONE_LOCAL_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot Metadata @@ -41964,6 +47039,689 @@ Options: Changelog +v1.65.0 - 2023-11-26 + +See commits + +- New backends + - Azure Files (karan, moongdal, Nick Craig-Wood) + - ImageKit (Abhinav Dhiman) + - Linkbox (viktor, Nick Craig-Wood) +- New commands + - serve s3: Let rclone act as an S3 compatible server (Mikubill, + Artur Neumann, Saw-jan, Nick Craig-Wood) + - nfsmount: mount command to provide mount mechanism on macOS + without FUSE (Saleh Dindar) + - serve nfs: to serve a remote for use by nfsmount (Saleh Dindar) +- New Features + - install.sh: Clean up temp files in install script (Jacob Hands) + - build + - Update all dependencies (Nick Craig-Wood) + - Refactor version info and icon resource handling on windows + (albertony) + - doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri + Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick + Craig-Wood) + - Implement --metadata-mapper to transform metatadata with a user + supplied program (Nick Craig-Wood) + - Add ChunkWriterDoesntSeek feature flag and set it for b2 (Nick + Craig-Wood) + - lib/http: Export basic go string functions for use in --template + (Gabriel Espinoza) + - makefile: Use POSIX compatible install arguments (Mina Galić) + - operations + - Use less memory when doing multithread uploads (Nick + Craig-Wood) + - Implement --partial-suffix to control extension of temporary + file names (Volodymyr) + - rc + - Add operations/check to the rc API (Nick Craig-Wood) + - Always report an error as JSON (Nick Craig-Wood) + - Set Last-Modified header for files served by --rc-serve + (Nikita Shoshin) + - size: Dont show duplicate object count when less than 1k + (albertony) +- Bug Fixes + - fshttp: Fix --contimeout being ignored (你知道未来吗) + - march: Fix excessive parallelism when using --no-traverse (Nick + Craig-Wood) + - ncdu: Fix crash when re-entering changed directory after rescan + (Nick Craig-Wood) + - operations + - Fix overwrite of destination when multi-thread transfer + fails (Nick Craig-Wood) + - Fix invalid UTF-8 when truncating file names when not using + --inplace (Nick Craig-Wood) + - serve dnla: Fix crash on graceful exit (wuxingzhong) +- Mount + - Disable mount for freebsd and alias cmount as mount on that + platform (Nick Craig-Wood) +- VFS + - Add --vfs-refresh flag to read all the directories on start + (Beyond Meat) + - Implement Name() method in WriteFileHandle and ReadFileHandle + (Saleh Dindar) + - Add go-billy dependency and make sure vfs.Handle implements + billy.File (Saleh Dindar) + - Error out early if can't upload 0 length file (Nick Craig-Wood) +- Local + - Fix copying from Windows Volume Shadows (Nick Craig-Wood) +- Azure Blob + - Add support for cold tier (Ivan Yanitra) +- B2 + - Implement "rclone backend lifecycle" to read and set bucket + lifecycles (Nick Craig-Wood) + - Implement --b2-lifecycle to control lifecycle when creating + buckets (Nick Craig-Wood) + - Fix listing all buckets when not needed (Nick Craig-Wood) + - Fix multi-thread upload with copyto going to wrong name (Nick + Craig-Wood) + - Fix server side chunked copy when file size was exactly + --b2-copy-cutoff (Nick Craig-Wood) + - Fix streaming chunked files an exact multiple of chunk size + (Nick Craig-Wood) +- Box + - Filter more EventIDs when polling (David Sze) + - Add more logging for polling (David Sze) + - Fix performance problem reading metadata for single files (Nick + Craig-Wood) +- Drive + - Add read/write metadata support (Nick Craig-Wood) + - Add support for SHA-1 and SHA-256 checksums (rinsuki) + - Add --drive-show-all-gdocs to allow unexportable gdocs to be + server side copied (Nick Craig-Wood) + - Add a note that --drive-scope accepts comma-separated list of + scopes (Keigo Imai) + - Fix error updating created time metadata on existing object + (Nick Craig-Wood) + - Fix integration tests by enabling metadata support from the + context (Nick Craig-Wood) +- Dropbox + - Factor batcher into lib/batcher (Nick Craig-Wood) + - Fix missing encoding for rclone purge (Nick Craig-Wood) +- Google Cloud Storage + - Fix 400 Bad request errors when using multi-thread copy (Nick + Craig-Wood) +- Googlephotos + - Implement batcher for uploads (Nick Craig-Wood) +- Hdfs + - Added support for list of namenodes in hdfs remote config + (Tayo-pasedaRJ) +- HTTP + - Implement set backend command to update running backend (Nick + Craig-Wood) + - Enable methods used with WebDAV (Alen Šiljak) +- Jottacloud + - Add support for reading and writing metadata (albertony) +- Onedrive + - Implement ListR method which gives --fast-list support (Nick + Craig-Wood) + - This must be enabled with the --onedrive-delta flag +- Quatrix + - Add partial upload support (Oksana Zhykina) + - Overwrite files on conflict during server-side move (Oksana + Zhykina) +- S3 + - Add Linode provider (Nick Craig-Wood) + - Add docs on how to add a new provider (Nick Craig-Wood) + - Fix no error being returned when creating a bucket we don't own + (Nick Craig-Wood) + - Emit a debug message if anonymous credentials are in use (Nick + Craig-Wood) + - Add --s3-disable-multipart-uploads flag (Nick Craig-Wood) + - Detect looping when using gcs and versions (Nick Craig-Wood) +- SFTP + - Implement --sftp-copy-is-hardlink to server side copy as + hardlink (Nick Craig-Wood) +- Smb + - Fix incorrect about size by switching to + github.com/cloudsoda/go-smb2 fork (Nick Craig-Wood) + - Fix modtime of multithread uploads by setting PartialUploads + (Nick Craig-Wood) +- WebDAV + - Added an rclone vendor to work with rclone serve webdav (Adithya + Kumar) + +v1.64.2 - 2023-10-19 + +See commits + +- Bug Fixes + - selfupdate: Fix "invalid hashsum signature" error (Nick + Craig-Wood) + - build: Fix docker build running out of space (Nick Craig-Wood) + +v1.64.1 - 2023-10-17 + +See commits + +- Bug Fixes + - cmd: Make --progress output logs in the same format as without + (Nick Craig-Wood) + - docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj + Ghosh, Nick Craig-Wood) + - lsjson: Make sure we set the global metadata flag too (Nick + Craig-Wood) + - operations + - Ensure concurrency is no greater than the number of chunks + (Pat Patterson) + - Fix OpenOptions ignored in copy if operation was a + multiThreadCopy (Vitor Gomes) + - Fix error message on delete to have file name (Nick + Craig-Wood) + - serve sftp: Return not supported error for not supported + commands (Nick Craig-Wood) + - build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid + reset (Nick Craig-Wood) + - pacer: Fix b2 deadlock by defaulting max connections to + unlimited (Nick Craig-Wood) +- Mount + - Fix automount not detecting drive is ready (Nick Craig-Wood) +- VFS + - Fix update dir modification time (Saleh Dindar) +- Azure Blob + - Fix "fatal error: concurrent map writes" (Nick Craig-Wood) +- B2 + - Fix multipart upload: corrupted on transfer: sizes differ XXX vs + 0 (Nick Craig-Wood) + - Fix locking window when getting mutipart upload URL (Nick + Craig-Wood) + - Fix server side copies greater than 4GB (Nick Craig-Wood) + - Fix chunked streaming uploads (Nick Craig-Wood) + - Reduce default --b2-upload-concurrency to 4 to reduce memory + usage (Nick Craig-Wood) +- Onedrive + - Fix the configurator to allow /teams/ID in the config (Nick + Craig-Wood) +- Oracleobjectstorage + - Fix OpenOptions being ignored in uploadMultipart with + chunkWriter (Nick Craig-Wood) +- S3 + - Fix slice bounds out of range error when listing (Nick + Craig-Wood) + - Fix OpenOptions being ignored in uploadMultipart with + chunkWriter (Vitor Gomes) +- Storj + - Update storj.io/uplink to v1.12.0 (Kaloyan Raev) + +v1.64.0 - 2023-09-11 + +See commits + +- New backends + - Proton Drive (Chun-Hung Tseng) + - Quatrix (Oksana, Volodymyr Kit) + - New S3 providers + - Synology C2 (BakaWang) + - Leviia (Benjamin) + - New Jottacloud providers + - Onlime (Fjodor42) + - Telia Sky (NoLooseEnds) +- Major changes + - Multi-thread transfers (Vitor Gomes, Nick Craig-Wood, Manoj + Ghosh, Edwin Mackenzie-Owen) + - Multi-thread transfers are now available when transferring + to: + - local, s3, azureblob, b2, oracleobjectstorage and smb + - This greatly improves transfer speed between two network + sources. + - In memory buffering has been unified between all backends + and should share memory better. + - See --multi-thread docs for more info +- New commands + - rclone config redacted support mechanism for showing redacted + config (Nick Craig-Wood) +- New Features + - accounting + - Show server side stats in own lines and not as bytes + transferred (Nick Craig-Wood) + - bisync + - Add new --ignore-listing-checksum flag to distinguish from + --ignore-checksum (nielash) + - Add experimental --resilient mode to allow recovery from + self-correctable errors (nielash) + - Add support for --create-empty-src-dirs (nielash) + - Dry runs no longer commit filter changes (nielash) + - Enforce --check-access during --resync (nielash) + - Apply filters correctly during deletes (nielash) + - Equality check before renaming (leave identical files alone) + (nielash) + - Fix dryRun rc parameter being ignored (nielash) + - build + - Update to go1.21 and make go1.19 the minimum required + version (Anagh Kumar Baranwal, Nick Craig-Wood) + - Update dependencies (Nick Craig-Wood) + - Add snap installation (hideo aoyama) + - Change Winget Releaser job to ubuntu-latest (sitiom) + - cmd: Refactor and use sysdnotify in more commands (eNV25) + - config: Add --multi-thread-chunk-size flag (Vitor Gomes) + - doc updates (antoinetran, Benjamin, Bjørn Smith, Dean Attali, + gabriel-suela, James Braza, Justin Hellings, kapitainsky, Mahad, + Masamune3210, Nick Craig-Wood, Nihaal Sangha, Niklas Hambüchen, + Raymond Berger, r-ricci, Sawada Tsunayoshi, Tiago Boeing, + Vladislav Vorobev) + - fs + - Use atomic types everywhere (Roberto Ricci) + - When --max-transfer limit is reached exit with code (10) + (kapitainsky) + - Add rclone completion powershell - basic implementation only + (Nick Craig-Wood) + - http servers: Allow CORS to be set with --allow-origin flag + (yuudi) + - lib/rest: Remove unnecessary nil check (Eng Zer Jun) + - ncdu: Add keybinding to rescan filesystem (eNV25) + - rc + - Add executeId to job listings (yuudi) + - Add core/du to measure local disk usage (Nick Craig-Wood) + - Add operations/settier to API (Drew Stinnett) + - rclone test info: Add --check-base32768 flag to check can store + all base32768 characters (Nick Craig-Wood) + - rmdirs: Remove directories concurrently controlled by --checkers + (Nick Craig-Wood) +- Bug Fixes + - accounting: Don't stop calculating average transfer speed until + the operation is complete (Jacob Hands) + - fs: Fix transferTime not being set in JSON logs (Jacob Hands) + - fshttp: Fix --bind 0.0.0.0 allowing IPv6 and --bind ::0 allowing + IPv4 (Nick Craig-Wood) + - operations: Fix overlapping check on case insensitive file + systems (Nick Craig-Wood) + - serve dlna: Fix MIME type if backend can't identify it (Nick + Craig-Wood) + - serve ftp: Fix race condition when using the auth proxy (Nick + Craig-Wood) + - serve sftp: Fix hash calculations with --vfs-cache-mode full + (Nick Craig-Wood) + - serve webdav: Fix error: Expecting fs.Object or fs.Directory, + got nil (Nick Craig-Wood) + - sync: Fix lockup with --cutoff-mode=soft and --max-duration + (Nick Craig-Wood) +- Mount + - fix: Mount parsing for linux (Anagh Kumar Baranwal) +- VFS + - Add --vfs-cache-min-free-space to control minimum free space on + the disk containing the cache (Nick Craig-Wood) + - Added cache cleaner for directories to reduce memory usage + (Anagh Kumar Baranwal) + - Update parent directory modtimes on vfs actions (David Pedersen) + - Keep virtual directory status accurate and reduce deadlock + potential (Anagh Kumar Baranwal) + - Make sure struct field is aligned for atomic access (Roberto + Ricci) +- Local + - Rmdir return an error if the path is not a dir (zjx20) +- Azure Blob + - Implement OpenChunkWriter and multi-thread uploads (Nick + Craig-Wood) + - Fix creation of directory markers (Nick Craig-Wood) + - Fix purging with directory markers (Nick Craig-Wood) +- B2 + - Implement OpenChunkWriter and multi-thread uploads (Nick + Craig-Wood) + - Fix rclone link when object path contains special characters + (Alishan Ladhani) +- Box + - Add polling support (David Sze) + - Add --box-impersonate to impersonate a user ID (Nick Craig-Wood) + - Fix unhelpful decoding of error messages into decimal numbers + (Nick Craig-Wood) +- Chunker + - Update documentation to mention issue with small files (Ricardo + D'O. Albanus) +- Compress + - Fix ChangeNotify (Nick Craig-Wood) +- Drive + - Add --drive-fast-list-bug-fix to control ListR bug workaround + (Nick Craig-Wood) +- Fichier + - Implement DirMove (Nick Craig-Wood) + - Fix error code parsing (alexia) +- FTP + - Add socks_proxy support for SOCKS5 proxies (Zach) + - Fix 425 "TLS session of data connection not resumed" errors + (Nick Craig-Wood) +- Hdfs + - Retry "replication in progress" errors when uploading (Nick + Craig-Wood) + - Fix uploading to the wrong object on Update with overridden + remote name (Nick Craig-Wood) +- HTTP + - CORS should not be sent if not set (yuudi) + - Fix webdav OPTIONS response (yuudi) +- Opendrive + - Fix List on a just deleted and remade directory (Nick + Craig-Wood) +- Oracleobjectstorage + - Use rclone's rate limiter in multipart transfers (Manoj Ghosh) + - Implement OpenChunkWriter and multi-thread uploads (Manoj Ghosh) +- S3 + - Refactor multipart upload to use OpenChunkWriter and ChunkWriter + (Vitor Gomes) + - Factor generic multipart upload into lib/multipart (Nick + Craig-Wood) + - Fix purging of root directory with --s3-directory-markers (Nick + Craig-Wood) + - Add rclone backend set command to update the running config + (Nick Craig-Wood) + - Add rclone backend restore-status command (Nick Craig-Wood) +- SFTP + - Stop uploads re-using the same ssh connection to improve + performance (Nick Craig-Wood) + - Add --sftp-ssh to specify an external ssh binary to use (Nick + Craig-Wood) + - Add socks_proxy support for SOCKS5 proxies (Zach) + - Support dynamic --sftp-path-override (nielash) + - Fix spurious warning when using --sftp-ssh (Nick Craig-Wood) +- Smb + - Implement multi-threaded writes for copies to smb (Edwin + Mackenzie-Owen) +- Storj + - Performance improvement for large file uploads (Kaloyan Raev) +- Swift + - Fix HEADing 0-length objects when --swift-no-large-objects set + (Julian Lepinski) +- Union + - Add :writback to act as a simple cache (Nick Craig-Wood) +- WebDAV + - Nextcloud: fix segment violation in low-level retry (Paul) +- Zoho + - Remove Range requests workarounds to fix integration tests (Nick + Craig-Wood) + +v1.63.1 - 2023-07-17 + +See commits + +- Bug Fixes + - build: Fix macos builds for versions < 12 (Anagh Kumar Baranwal) + - dirtree: Fix performance with large directories of directories + and --fast-list (Nick Craig-Wood) + - operations + - Fix deadlock when using lsd/ls with --progress (Nick + Craig-Wood) + - Fix .rclonelink files not being converted back to symlinks + (Nick Craig-Wood) + - doc fixes (Dean Attali, Mahad, Nick Craig-Wood, Sawada + Tsunayoshi, Vladislav Vorobev) +- Local + - Fix partial directory read for corrupted filesystem (Nick + Craig-Wood) +- Box + - Fix reconnect failing with HTTP 400 Bad Request (albertony) +- Smb + - Fix "Statfs failed: bucket or container name is needed" when + mounting (Nick Craig-Wood) +- WebDAV + - Nextcloud: fix must use /dav/files/USER endpoint not /webdav + error (Paul) + - Nextcloud chunking: add more guidance for the user to check the + config (darix) + +v1.63.0 - 2023-06-30 + +See commits + +- New backends + - Pikpak (wiserain) + - New S3 providers + - petabox.io (Andrei Smirnov) + - Google Cloud Storage (Anthony Pessy) + - New WebDAV providers + - Fastmail (Arnavion) +- Major changes + - Files will be copied to a temporary name ending in .partial when + copying to local,ftp,sftp then renamed at the end of the + transfer. (Janne Hellsten, Nick Craig-Wood) + - This helps with data integrity as we don't delete the + existing file until the new one is complete. + - It can be disabled with the --inplace flag. + - This behaviour will also happen if the backend is wrapped, + for example sftp wrapped with crypt. + - The s3, azureblob and gcs backends now support directory markers + so empty directories are supported (Jānis Bebrītis, Nick + Craig-Wood) + - The --default-time flag now controls the unknown modification + time of files/dirs (Nick Craig-Wood) + - If a file or directory does not have a modification time + rclone can read then rclone will display this fixed time + instead. + - For the old behaviour use --default-time 0s which will set + this time to the time rclone started up. +- New Features + - build + - Modernise linters in use and fixup all affected code + (albertony) + - Push docker beta to GHCR (GitHub container registry) + (Richard Tweed) + - cat: Add --separator option to cat command (Loren Gordon) + - config + - Do not remove/overwrite other files during config file save + (albertony) + - Do not overwrite config file symbolic link (albertony) + - Stop config create making invalid config files (Nick + Craig-Wood) + - doc updates (Adam K, Aditya Basu, albertony, asdffdsazqqq, Damo, + danielkrajnik, Dimitri Papadopoulos, dlitster, Drew Parsons, + jumbi77, kapitainsky, mac-15, Mariusz Suchodolski, Nick + Craig-Wood, NickIAm, Rintze Zelle, Stanislav Gromov, Tareq + Sharafy, URenko, yuudi, Zach Kipp) + - fs + - Add size to JSON logs when moving or copying an object (Nick + Craig-Wood) + - Allow boolean features to be enabled with --disable !Feature + (Nick Craig-Wood) + - genautocomplete: Rename to completion with alias to the old name + (Nick Craig-Wood) + - librclone: Added example on using librclone with Go (alankrit) + - lsjson: Make --stat more efficient (Nick Craig-Wood) + - operations + - Implement --multi-thread-write-buffer-size for speed + improvements on downloads (Paulo Schreiner) + - Reopen downloads on error when using check --download and + cat (Nick Craig-Wood) + - rc: config/listremotes includes remotes defined with environment + variables (kapitainsky) + - selfupdate: Obey --no-check-certificate flag (Nick Craig-Wood) + - serve restic: Trigger systemd notify (Shyim) + - serve webdav: Implement owncloud checksum and modtime extensions + (WeidiDeng) + - sync: --suffix-keep-extension preserve 2 part extensions like + .tar.gz (Nick Craig-Wood) +- Bug Fixes + - accounting + - Fix Prometheus metrics to be the same as core/stats (Nick + Craig-Wood) + - Bwlimit signal handler should always start (Sam Lai) + - bisync: Fix maxDelete parameter being ignored via the rc (Nick + Craig-Wood) + - cmd/ncdu: Fix screen corruption when logging (eNV25) + - filter: Fix deadlock with errors on --files-from (douchen) + - fs + - Fix interaction between --progress and --interactive (Nick + Craig-Wood) + - Fix infinite recursive call in pacer ModifyCalculator (fixes + issue reported by the staticcheck linter) (albertony) + - lib/atexit: Ensure OnError only calls cancel function once (Nick + Craig-Wood) + - lib/rest: Fix problems re-using HTTP connections (Nick + Craig-Wood) + - rc + - Fix operations/stat with trailing / (Nick Craig-Wood) + - Fix missing --rc flags (Nick Craig-Wood) + - Fix output of Time values in options/get (Nick Craig-Wood) + - serve dlna: Fix potential data race (Nick Craig-Wood) + - version: Fix reported os/kernel version for windows (albertony) +- Mount + - Add --mount-case-insensitive to force the mount to be case + insensitive (Nick Craig-Wood) + - Removed unnecessary byte slice allocation for reads (Anagh Kumar + Baranwal) + - Clarify rclone mount error when installed via homebrew (Nick + Craig-Wood) + - Added _netdev to the example mount so it gets treated as a + remote-fs rather than local-fs (Anagh Kumar Baranwal) +- Mount2 + - Updated go-fuse version (Anagh Kumar Baranwal) + - Fixed statfs (Anagh Kumar Baranwal) + - Disable xattrs (Anagh Kumar Baranwal) +- VFS + - Add MkdirAll function to make a directory and all beneath (Nick + Craig-Wood) + - Fix reload: failed to add virtual dir entry: file does not exist + (Nick Craig-Wood) + - Fix writing to a read only directory creating spurious directory + entries (WeidiDeng) + - Fix potential data race (Nick Craig-Wood) + - Fix backends being Shutdown too early when startup takes a long + time (Nick Craig-Wood) +- Local + - Fix filtering of symlinks with -l/--links flag (Nick Craig-Wood) + - Fix /path/to/file.rclonelink when -l/--links is in use (Nick + Craig-Wood) + - Fix crash with --metadata on Android (Nick Craig-Wood) +- Cache + - Fix backends shutting down when in use when used via the rc + (Nick Craig-Wood) +- Crypt + - Add --crypt-suffix option to set a custom suffix for encrypted + files (jladbrook) + - Add --crypt-pass-bad-blocks to allow corrupted file output (Nick + Craig-Wood) + - Fix reading 0 length files (Nick Craig-Wood) + - Try not to return "unexpected EOF" error (Nick Craig-Wood) + - Reduce allocations (albertony) + - Recommend Dropbox for base32768 encoding (Nick Craig-Wood) +- Azure Blob + - Empty directory markers (Nick Craig-Wood) + - Support azure workload identities (Tareq Sharafy) + - Fix azure blob uploads with multiple bits of metadata (Nick + Craig-Wood) + - Fix azurite compatibility by sending nil tier if set to empty + string (Roel Arents) +- Combine + - Implement missing methods (Nick Craig-Wood) + - Fix goroutine stack overflow on bad object (Nick Craig-Wood) +- Drive + - Add --drive-env-auth to get IAM credentials from runtime (Peter + Brunner) + - Update drive service account guide (Juang, Yi-Lin) + - Fix change notify picking up files outside the root (Nick + Craig-Wood) + - Fix trailing slash mis-identificaton of folder as file (Nick + Craig-Wood) + - Fix incorrect remote after Update on object (Nick Craig-Wood) +- Dropbox + - Implement --dropbox-pacer-min-sleep flag (Nick Craig-Wood) + - Fix the dropbox batcher stalling (Misty) +- Fichier + - Add --ficicher-cdn option to use the CDN for download (Nick + Craig-Wood) +- FTP + - Lower log message priority when SetModTime is not supported to + debug (Tobias Gion) + - Fix "unsupported LIST line" errors on startup (Nick Craig-Wood) + - Fix "501 Not a valid pathname." errors when creating directories + (Nick Craig-Wood) +- Google Cloud Storage + - Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) + - Added --gcs-user-project needed for requester pays (Christopher + Merry) +- HTTP + - Add client certificate user auth middleware. This can auth + serve restic from the username in the client cert. (Peter Fern) +- Jottacloud + - Fix vfs writeback stuck in a failed upload loop with file + versioning disabled (albertony) +- Onedrive + - Add --onedrive-av-override flag to download files flagged as + virus (Nick Craig-Wood) + - Fix quickxorhash on 32 bit architectures (Nick Craig-Wood) + - Report any list errors during rclone cleanup (albertony) +- Putio + - Fix uploading to the wrong object on Update with overridden + remote name (Nick Craig-Wood) + - Fix modification times not being preserved for server side copy + and move (Nick Craig-Wood) + - Fix server side copy failures (400 errors) (Nick Craig-Wood) +- S3 + - Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) + - Update Scaleway storage classes (Brian Starkey) + - Fix --s3-versions on individual objects (Nick Craig-Wood) + - Fix hang on aborting multipart upload with iDrive e2 (Nick + Craig-Wood) + - Fix missing "tier" metadata (Nick Craig-Wood) + - Fix V3sign: add missing subresource delete (cc) + - Fix Arvancloud Domain and region changes and alphabetise the + provider (Ehsan Tadayon) + - Fix Qiniu KODO quirks virtualHostStyle is false (zzq) +- SFTP + - Add --sftp-host-key-algorithms to allow specifying SSH host key + algorithms (Joel) + - Fix using --sftp-key-use-agent and --sftp-key-file together + needing private key file (Arnav Singh) + - Fix move to allow overwriting existing files (Nick Craig-Wood) + - Don't stat directories before listing them (Nick Craig-Wood) + - Don't check remote points to a file if it ends with / (Nick + Craig-Wood) +- Sharefile + - Disable streamed transfers as they no longer work (Nick + Craig-Wood) +- Smb + - Code cleanup to avoid overwriting ctx before first use (fixes + issue reported by the staticcheck linter) (albertony) +- Storj + - Fix "uplink: too many requests" errors when uploading to the + same file (Nick Craig-Wood) + - Fix uploading to the wrong object on Update with overridden + remote name (Nick Craig-Wood) +- Swift + - Ignore 404 error when deleting an object (Nick Craig-Wood) +- Union + - Implement missing methods (Nick Craig-Wood) + - Allow errors to be unwrapped for inspection (Nick Craig-Wood) +- Uptobox + - Add --uptobox-private flag to make all uploaded files private + (Nick Craig-Wood) + - Fix improper regex (Aaron Gokaslan) + - Fix Update returning the wrong object (Nick Craig-Wood) + - Fix rmdir declaring that directories weren't empty (Nick + Craig-Wood) +- WebDAV + - nextcloud: Add support for chunked uploads (Paul) + - Set modtime using propset for owncloud and nextcloud (WeidiDeng) + - Make pacer minSleep configurable with --webdav-pacer-min-sleep + (ed) + - Fix server side copy/move not overwriting (WeidiDeng) + - Fix modtime on server side copy for owncloud and nextcloud (Nick + Craig-Wood) +- Yandex + - Fix 400 Bad Request on transfer failure (Nick Craig-Wood) +- Zoho + - Fix downloads with Range: header returning the wrong data (Nick + Craig-Wood) + +v1.62.2 - 2023-03-16 + +See commits + +- Bug Fixes + - docker volume plugin: Add missing fuse3 dependency (Nick + Craig-Wood) + - docs: Fix size documentation (asdffdsazqqq) +- FTP + - Fix 426 errors on downloads with vsftpd (Lesmiscore) + +v1.62.1 - 2023-03-15 + +See commits + +- Bug Fixes + - docker: Add missing fuse3 dependency (cycneuramus) + - build: Update release docs to be more careful with the tag (Nick + Craig-Wood) + - build: Set Github release to draft while uploading binaries + (Nick Craig-Wood) + v1.62.0 - 2023-03-14 See commits @@ -44707,9 +50465,9 @@ See commits - Use proper import path go.etcd.io/bbolt (Robert-André Mauchin) - Crypt - Calculate hashes for uploads from local disk (Nick Craig-Wood) - - This allows crypted Jottacloud uploads without using local + - This allows encrypted Jottacloud uploads without using local disk - - This means crypted s3/b2 uploads will now have hashes + - This means encrypted s3/b2 uploads will now have hashes - Added rclone backend decode/encode commands to replicate functionality of cryptdecode (Anagh Kumar Baranwal) - Get rid of the unused Cipher interface as it obfuscated the code @@ -46345,7 +52103,7 @@ v1.42 - 2018-06-16 - Fix panic when running without plex configs (Remus Bunduc) - Fix root folder caching (Remus Bunduc) - Crypt - - Check the crypted hash of files when uploading for extra data + - Check the encrypted hash of files when uploading for extra data security - Dropbox - Make Dropbox for business folders accessible using an initial / @@ -46767,7 +52525,7 @@ v1.38 - 2017-09-30 - New commands - rcat - read from standard input and stream upload - tree - shows a nicely formatted recursive listing - - cryptdecode - decode crypted file names (thanks ishuah) + - cryptdecode - decode encrypted file names (thanks ishuah) - config show - print the config file - config file - print the config file location - New Features @@ -46796,7 +52554,7 @@ v1.38 - 2017-09-30 - Revert to copy when moving file across file system boundaries - --skip-links to suppress symlink warnings (thanks Zhiming Wang) - Mount - - Re-use rcat internals to support uploads from all remotes + - Reuse rcat internals to support uploads from all remotes - Dropbox - Fix "entry doesn't belong in directory" error - Stop using deprecated API methods @@ -47117,7 +52875,7 @@ v1.34 - 2016-11-06 - Fix rclone move command - Delete src files which already existed in dst - Fix deletion of src file when dst file older - - Fix rclone check on crypted file systems + - Fix rclone check on encrypted file systems - Make failed uploads not count as "Transferred" - Make sure high level retries show with -q - Use a vendor directory with godep for repeatable builds @@ -47953,10 +53711,27 @@ If you are using systemd-resolved (default on Arch Linux), ensure it is at version 233 or higher. Previous releases contain a bug which causes not all domains to be resolved properly. -Additionally with the GODEBUG=netdns= environment variable the Go -resolver decision can be influenced. This also allows to resolve certain -issues with DNS resolution. See the name resolution section in the go -docs. +The Go resolver decision can be influenced with the GODEBUG=netdns=... +environment variable. This also allows to resolve certain issues with +DNS resolution. On Windows or MacOS systems, try forcing use of the +internal Go resolver by setting GODEBUG=netdns=go at runtime. On other +systems (Linux, *BSD, etc) try forcing use of the system name resolver +by setting GODEBUG=netdns=cgo (and recompile rclone from source with CGO +enabled if necessary). See the name resolution section in the go docs. + +Failed to start auth webserver on Windows + + Error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions. + ... + yyyy/mm/dd hh:mm:ss Fatal error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions. + +This is sometimes caused by the Host Network Service causing issues with +opening the port on the host. + +A simple solution may be restarting the Host Network Service with eg. +Powershell + + Restart-Service hns The total size reported in the stats for a sync is wrong and keeps changing @@ -48032,7 +53807,7 @@ Authors Contributors {{< rem -email addresses removed from here need to be addeed to bin/.ignore-emails to make sure update-authors.py doesn't immediately put them back in again. +email addresses removed from here need to be added to bin/.ignore-emails to make sure update-authors.py doesn't immediately put them back in again. >}} - Alex Couper amcouper@gmail.com @@ -48551,7 +54326,7 @@ email addresses removed from here need to be addeed to bin/.ignore-emails to mak - HNGamingUK connor@earnshawhome.co.uk - Jonta 359397+Jonta@users.noreply.github.com - YenForYang YenForYang@users.noreply.github.com -- Joda Stößer stoesser@yay-digital.de services+github@simjo.st +- SimJoSt / Joda Stößer git@simjo.st - Logeshwaran waranlogesh@gmail.com - Rajat Goel rajat@dropbox.com - r0kk3rz r0kk3rz@gmail.com @@ -48566,7 +54341,6 @@ email addresses removed from here need to be addeed to bin/.ignore-emails to mak - Chris Nelson stuff@cjnaz.com - Felix Bünemann felix.buenemann@gmail.com - Atílio Antônio atiliodadalto@hotmail.com -- Roberto Ricci ricci@disroot.org - Carlo Mion mion00@gmail.com - Chris Lu chris.lu@gmail.com - Vitor Arruda vitor.pimenta.arruda@gmail.com @@ -48612,7 +54386,7 @@ email addresses removed from here need to be addeed to bin/.ignore-emails to mak - Leroy van Logchem lr.vanlogchem@gmail.com - Zsolt Ero zsolt.ero@gmail.com - Lesmiscore nao20010128@gmail.com -- ehsantdy ehsan.tadayon@arvancloud.com +- ehsantdy ehsan.tadayon@arvancloud.com ehsantadayon85@gmail.com - SwazRGB 65694696+swazrgb@users.noreply.github.com - Mateusz Puczyński mati6095@gmail.com - Michael C Tiernan - MIT-Research Computing Project mtiernan@mit.edu @@ -48622,6 +54396,7 @@ email addresses removed from here need to be addeed to bin/.ignore-emails to mak - Christian Galo 36752715+cgalo5758@users.noreply.github.com - Erik van Velzen erik@evanv.nl - Derek Battams derek@battams.ca +- Paul devnoname120@gmail.com - SimonLiu simonliu009@users.noreply.github.com - Hugo Laloge hla@lescompanions.com - Mr-Kanister 68117355+Mr-Kanister@users.noreply.github.com @@ -48722,6 +54497,116 @@ email addresses removed from here need to be addeed to bin/.ignore-emails to mak - Peter Brunner peter@psykhe.com - Leandro Sacchet leandro.sacchet@animati.com.br - dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +- cycneuramus 56681631+cycneuramus@users.noreply.github.com +- Arnavion me@arnavion.dev +- Christopher Merry christopher.merry@mlb.com +- Thibault Coupin thibault.coupin@gmail.com +- Richard Tweed RichardoC@users.noreply.github.com +- Zach Kipp Zacho2@users.noreply.github.com +- yuudi 26199752+yuudi@users.noreply.github.com +- NickIAm NickIAm@users.noreply.github.com +- Juang, Yi-Lin frankyjuang@gmail.com +- jumbi77 jumbi77@users.noreply.github.com +- Aditya Basu ab.aditya.basu@gmail.com +- ed s@ocv.me +- Drew Parsons dparsons@emerall.com +- Joel joelnb@users.noreply.github.com +- wiserain mail275@gmail.com +- Roel Arents roel.arents@kadaster.nl +- Shyim github@shyim.de +- Rintze Zelle 78232505+rzelle-lallemand@users.noreply.github.com +- Damo damoclark@users.noreply.github.com +- WeidiDeng weidi_deng@icloud.com +- Brian Starkey stark3y@gmail.com +- jladbrook jhladbrook@gmail.com +- Loren Gordon lorengordon@users.noreply.github.com +- dlitster davidlitster@gmail.com +- Tobias Gion tobias@gion.io +- Jānis Bebrītis janis.bebritis@wunder.io +- Adam K github.com@ak.tidy.email +- Andrei Smirnov smirnov.captain@gmail.com +- Janne Hellsten jjhellst@gmail.com +- cc 12904584+shvc@users.noreply.github.com +- Tareq Sharafy tareq.sha@gmail.com +- kapitainsky dariuszb@me.com +- douchen playgoobug@gmail.com +- Sam Lai 70988+slai@users.noreply.github.com +- URenko 18209292+URenko@users.noreply.github.com +- Stanislav Gromov kullfar@gmail.com +- Paulo Schreiner paulo.schreiner@delivion.de +- Mariusz Suchodolski mariusz@suchodol.ski +- danielkrajnik dan94kra@gmail.com +- Peter Fern github@0xc0dedbad.com +- zzq i@zhangzqs.cn +- mac-15 usman.ilamdin@phpstudios.com +- Sawada Tsunayoshi 34431649+TsunayoshiSawada@users.noreply.github.com +- Dean Attali daattali@gmail.com +- Fjodor42 molgaard@gmail.com +- BakaWang wa11579@hotmail.com +- Mahad 56235065+Mahad-lab@users.noreply.github.com +- Vladislav Vorobev x.miere@gmail.com +- darix darix@users.noreply.github.com +- Benjamin 36415086+bbenjamin-sys@users.noreply.github.com +- Chun-Hung Tseng henrybear327@users.noreply.github.com +- Ricardo D'O. Albanus rdalbanus@users.noreply.github.com +- gabriel-suela gscsuela@gmail.com +- Tiago Boeing contato@tiagoboeing.com +- Edwin Mackenzie-Owen edwin.mowen@gmail.com +- Niklas Hambüchen mail@nh2.me +- yuudi yuudi@users.noreply.github.com +- Zach github@prozach.org +- nielash 31582349+nielash@users.noreply.github.com +- Julian Lepinski lepinsk@users.noreply.github.com +- Raymond Berger RayBB@users.noreply.github.com +- Nihaal Sangha nihaal.git@gmail.com +- Masamune3210 1053504+Masamune3210@users.noreply.github.com +- James Braza jamesbraza@gmail.com +- antoinetran antoinetran@users.noreply.github.com +- alexia me@alexia.lol +- nielash nielronash@gmail.com +- Vitor Gomes vitor.gomes@delivion.de mail@vitorgomes.com +- Jacob Hands jacob@gogit.io +- hideo aoyama 100831251+boukendesho@users.noreply.github.com +- Roberto Ricci io@r-ricci.it +- Bjørn Smith bjornsmith@gmail.com +- Alishan Ladhani 8869764+aladh@users.noreply.github.com +- zjx20 zhoujianxiong2@gmail.com +- Oksana 142890647+oks-maytech@users.noreply.github.com +- Volodymyr Kit v.kit@maytech.net +- David Pedersen limero@me.com +- Drew Stinnett drew@drewlink.com +- Pat Patterson pat@backblaze.com +- Herby Gillot herby.gillot@gmail.com +- Nikita Shoshin shoshin_nikita@fastmail.com +- rinsuki 428rinsuki+git@gmail.com +- Beyond Meat 51850644+beyondmeat@users.noreply.github.com +- Saleh Dindar salh@fb.com +- Volodymyr 142890760+vkit-maytech@users.noreply.github.com +- Gabriel Espinoza 31670639+gspinoza@users.noreply.github.com +- Keigo Imai keigo.imai@gmail.com +- Ivan Yanitra iyanitra@tesla-consulting.com +- alfish2000 alfish2000@gmail.com +- wuxingzhong qq330332812@gmail.com +- Adithya Kumar akumar42@protonmail.com +- Tayo-pasedaRJ 138471223+Tayo-pasedaRJ@users.noreply.github.com +- Peter Kreuser logo@kreuser.name +- Piyush +- fotile96 fotile96@users.noreply.github.com +- Luc Ritchie luc.ritchie@gmail.com +- cynful cynful@users.noreply.github.com +- wjielai wjielai@tencent.com +- Jack Deng jackdeng@gmail.com +- Mikubill 31246794+Mikubill@users.noreply.github.com +- Artur Neumann artur@jankaritech.com +- Saw-jan saw.jan.grg3e@gmail.com +- Oksana Zhykina o.zhykina@maytech.net +- karan karan.gupta92@gmail.com +- viktor viktor@yakovchuk.net +- moongdal moongdal@tutanota.com +- Mina Galić freebsd@igalic.co +- Alen Šiljak dev@alensiljak.eu.org +- 你知道未来吗 rkonfj@gmail.com +- Abhinav Dhiman 8640877+ahnv@users.noreply.github.com Contact the rclone project @@ -48731,6 +54616,13 @@ Forum for questions and general discussion: - https://forum.rclone.org +Business support + +For business support or sponsorship enquiries please see: + +- https://rclone.com/ +- sponsorship@rclone.com + GitHub repository The project's repository is located at: @@ -48741,12 +54633,16 @@ There you can file bug reports or contribute with pull requests. Twitter -You can also follow me on twitter for rclone announcements: +You can also follow Nick on twitter for rclone announcements: - [@njcw](https://twitter.com/njcw) Email Or if all else fails or you want to ask something private or -confidential email Nick Craig-Wood. Please don't email me requests for -help - those are better directed to the forum. Thanks! +confidential + +- info@rclone.com + +Please don't email requests for help to this address - those are better +directed to the forum unless you'd like to sign up for business support. diff --git a/Makefile b/Makefile index 7a9f4a660914a..13b92fb9082e4 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ ifdef RELEASE_TAG TAG := $(RELEASE_TAG) endif GO_VERSION := $(shell go version) +GO_OS := $(shell go env GOOS) ifdef BETA_SUBDIR BETA_SUBDIR := /$(BETA_SUBDIR) endif @@ -46,7 +47,13 @@ endif .PHONY: rclone test_all vars version rclone: +ifeq ($(GO_OS),windows) + go run bin/resource_windows.go -version $(TAG) -syso resource_windows_`go env GOARCH`.syso +endif go build -v --ldflags "-s -X github.com/rclone/rclone/fs.Version=$(TAG)" $(BUILDTAGS) $(BUILD_ARGS) +ifeq ($(GO_OS),windows) + rm resource_windows_`go env GOARCH`.syso +endif mkdir -p `go env GOPATH`/bin/ cp -av rclone`go env GOEXE` `go env GOPATH`/bin/rclone`go env GOEXE`.new mv -v `go env GOPATH`/bin/rclone`go env GOEXE`.new `go env GOPATH`/bin/rclone`go env GOEXE` @@ -66,6 +73,10 @@ btest: @echo "[$(TAG)]($(BETA_URL)) on branch [$(BRANCH)](https://github.com/rclone/rclone/tree/$(BRANCH)) (uploaded in 15-30 mins)" | xclip -r -sel clip @echo "Copied markdown of beta release to clip board" +btesth: + @echo "$(TAG) on branch $(BRANCH) (uploaded in 15-30 mins)" | xclip -r -sel clip -t text/html + @echo "Copied beta release in HTML to clip board" + version: @echo '$(TAG)' @@ -96,11 +107,7 @@ build_dep: # Get the release dependencies we only install on linux release_dep_linux: - go run bin/get-github-release.go -extract nfpm goreleaser/nfpm 'nfpm_.*_Linux_x86_64\.tar\.gz' - -# Get the release dependencies we only install on Windows -release_dep_windows: - GOOS="" GOARCH="" go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest + go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest # Update dependencies showupdates: @@ -146,7 +153,7 @@ rcdocs: rclone install: rclone install -d ${DESTDIR}/usr/bin - install -t ${DESTDIR}/usr/bin ${GOPATH}/bin/rclone + install ${GOPATH}/bin/rclone ${DESTDIR}/usr/bin clean: go clean ./... diff --git a/README.md b/README.md index 9c47e6b770b76..fc8c8fe57bf12 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,19 @@ Rclone *("rsync for cloud storage")* is a command-line program to sync files and * Alibaba Cloud (Aliyun) Object Storage System (OSS) [:page_facing_up:](https://rclone.org/s3/#alibaba-oss) * Amazon Drive [:page_facing_up:](https://rclone.org/amazonclouddrive/) ([See note](https://rclone.org/amazonclouddrive/#status)) * Amazon S3 [:page_facing_up:](https://rclone.org/s3/) + * ArvanCloud Object Storage (AOS) [:page_facing_up:](https://rclone.org/s3/#arvan-cloud-object-storage-aos) * Backblaze B2 [:page_facing_up:](https://rclone.org/b2/) * Box [:page_facing_up:](https://rclone.org/box/) * Ceph [:page_facing_up:](https://rclone.org/s3/#ceph) * China Mobile Ecloud Elastic Object Storage (EOS) [:page_facing_up:](https://rclone.org/s3/#china-mobile-ecloud-eos) * Cloudflare R2 [:page_facing_up:](https://rclone.org/s3/#cloudflare-r2) - * Arvan Cloud Object Storage (AOS) [:page_facing_up:](https://rclone.org/s3/#arvan-cloud-object-storage-aos) * Citrix ShareFile [:page_facing_up:](https://rclone.org/sharefile/) * DigitalOcean Spaces [:page_facing_up:](https://rclone.org/s3/#digitalocean-spaces) * Digi Storage [:page_facing_up:](https://rclone.org/koofr/#digi-storage) * Dreamhost [:page_facing_up:](https://rclone.org/s3/#dreamhost) * Dropbox [:page_facing_up:](https://rclone.org/dropbox/) * Enterprise File Fabric [:page_facing_up:](https://rclone.org/filefabric/) + * Fastmail Files [:page_facing_up:](https://rclone.org/webdav/#fastmail-files) * FTP [:page_facing_up:](https://rclone.org/ftp/) * Google Cloud Storage [:page_facing_up:](https://rclone.org/googlecloudstorage/) * Google Drive [:page_facing_up:](https://rclone.org/drive/) @@ -50,26 +51,35 @@ Rclone *("rsync for cloud storage")* is a command-line program to sync files and * IBM COS S3 [:page_facing_up:](https://rclone.org/s3/#ibm-cos-s3) * IONOS Cloud [:page_facing_up:](https://rclone.org/s3/#ionos) * Koofr [:page_facing_up:](https://rclone.org/koofr/) + * Leviia Object Storage [:page_facing_up:](https://rclone.org/s3/#leviia) * Liara Object Storage [:page_facing_up:](https://rclone.org/s3/#liara-object-storage) + * Linkbox [:page_facing_up:](https://rclone.org/linkbox) + * Linode Object Storage [:page_facing_up:](https://rclone.org/s3/#linode) * Mail.ru Cloud [:page_facing_up:](https://rclone.org/mailru/) * Memset Memstore [:page_facing_up:](https://rclone.org/swift/) * Mega [:page_facing_up:](https://rclone.org/mega/) * Memory [:page_facing_up:](https://rclone.org/memory/) * Microsoft Azure Blob Storage [:page_facing_up:](https://rclone.org/azureblob/) + * Microsoft Azure Files Storage [:page_facing_up:](https://rclone.org/azurefiles/) * Microsoft OneDrive [:page_facing_up:](https://rclone.org/onedrive/) * Minio [:page_facing_up:](https://rclone.org/s3/#minio) * Nextcloud [:page_facing_up:](https://rclone.org/webdav/#nextcloud) * OVH [:page_facing_up:](https://rclone.org/swift/) + * Blomp Cloud Storage [:page_facing_up:](https://rclone.org/swift/) * OpenDrive [:page_facing_up:](https://rclone.org/opendrive/) * OpenStack Swift [:page_facing_up:](https://rclone.org/swift/) * Oracle Cloud Storage [:page_facing_up:](https://rclone.org/swift/) * Oracle Object Storage [:page_facing_up:](https://rclone.org/oracleobjectstorage/) * ownCloud [:page_facing_up:](https://rclone.org/webdav/#owncloud) * pCloud [:page_facing_up:](https://rclone.org/pcloud/) + * Petabox [:page_facing_up:](https://rclone.org/s3/#petabox) + * PikPak [:page_facing_up:](https://rclone.org/pikpak/) * premiumize.me [:page_facing_up:](https://rclone.org/premiumizeme/) * put.io [:page_facing_up:](https://rclone.org/putio/) + * Proton Drive [:page_facing_up:](https://rclone.org/protondrive/) * QingStor [:page_facing_up:](https://rclone.org/qingstor/) * Qiniu Cloud Object Storage (Kodo) [:page_facing_up:](https://rclone.org/s3/#qiniu) + * Quatrix [:page_facing_up:](https://rclone.org/quatrix/) * Rackspace Cloud Files [:page_facing_up:](https://rclone.org/swift/) * RackCorp Object Storage [:page_facing_up:](https://rclone.org/s3/#RackCorp) * Scaleway [:page_facing_up:](https://rclone.org/s3/#scaleway) @@ -80,6 +90,7 @@ Rclone *("rsync for cloud storage")* is a command-line program to sync files and * StackPath [:page_facing_up:](https://rclone.org/s3/#stackpath) * Storj [:page_facing_up:](https://rclone.org/storj/) * SugarSync [:page_facing_up:](https://rclone.org/sugarsync/) + * Synology C2 Object Storage [:page_facing_up:](https://rclone.org/s3/#synology-c2) * Tencent Cloud Object Storage (COS) [:page_facing_up:](https://rclone.org/s3/#tencent-cos) * Wasabi [:page_facing_up:](https://rclone.org/s3/#wasabi) * WebDAV [:page_facing_up:](https://rclone.org/webdav/) diff --git a/RELEASE.md b/RELEASE.md index 7883ec696b6a5..09bc34a4dfcf6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,12 +41,15 @@ Early in the next release cycle update the dependencies * Review any pinned packages in go.mod and remove if possible * make updatedirect - * make + * make GOTAGS=cmount + * make compiletest * git commit -a -v * make update - * make + * make GOTAGS=cmount + * make compiletest * roll back any updates which didn't compile * git commit -a -v --amend + * **NB** watch out for this changing the default go version in `go.mod` Note that `make update` updates all direct and indirect dependencies and there can occasionally be forwards compatibility problems with @@ -90,6 +93,35 @@ Now * git commit -a -v -m "Changelog updates from Version ${NEW_TAG}" * git push +## Sponsor logos + +If updating the website note that the sponsor logos have been moved out of the main repository. + +You will need to checkout `/docs/static/img/logos` from https://github.com/rclone/third-party-logos +which is a private repo containing artwork from sponsors. + +## Update the website between releases + +Create an update website branch based off the last release + + git co -b update-website + +If the branch already exists, double check there are no commits that need saving. + +Now reset the branch to the last release + + git reset --hard v1.64.0 + +Create the changes, check them in, test with `make serve` then + + make upload_test_website + +Check out https://test.rclone.org and when happy + + make upload_website + +Cherry pick any changes back to master and the stable branch if it is active. + ## Making a manual build of docker The rclone docker image should autobuild on via GitHub actions. If it doesn't diff --git a/VERSION b/VERSION index 1a3653420d91e..483a6500f21c2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.63.0 +v1.65.0 diff --git a/backend/all/all.go b/backend/all/all.go index 1b6e965d9c395..27bb4be447dc0 100644 --- a/backend/all/all.go +++ b/backend/all/all.go @@ -7,6 +7,7 @@ import ( _ "github.com/rclone/rclone/backend/alias" _ "github.com/rclone/rclone/backend/amazonclouddrive" _ "github.com/rclone/rclone/backend/azureblob" + _ "github.com/rclone/rclone/backend/azurefiles" _ "github.com/rclone/rclone/backend/b2" _ "github.com/rclone/rclone/backend/box" _ "github.com/rclone/rclone/backend/cache" @@ -25,9 +26,11 @@ import ( _ "github.com/rclone/rclone/backend/hdfs" _ "github.com/rclone/rclone/backend/hidrive" _ "github.com/rclone/rclone/backend/http" + _ "github.com/rclone/rclone/backend/imagekit" _ "github.com/rclone/rclone/backend/internetarchive" _ "github.com/rclone/rclone/backend/jottacloud" _ "github.com/rclone/rclone/backend/koofr" + _ "github.com/rclone/rclone/backend/linkbox" _ "github.com/rclone/rclone/backend/local" _ "github.com/rclone/rclone/backend/mailru" _ "github.com/rclone/rclone/backend/mega" @@ -37,9 +40,12 @@ import ( _ "github.com/rclone/rclone/backend/opendrive" _ "github.com/rclone/rclone/backend/oracleobjectstorage" _ "github.com/rclone/rclone/backend/pcloud" + _ "github.com/rclone/rclone/backend/pikpak" _ "github.com/rclone/rclone/backend/premiumizeme" + _ "github.com/rclone/rclone/backend/protondrive" _ "github.com/rclone/rclone/backend/putio" _ "github.com/rclone/rclone/backend/qingstor" + _ "github.com/rclone/rclone/backend/quatrix" _ "github.com/rclone/rclone/backend/s3" _ "github.com/rclone/rclone/backend/seafile" _ "github.com/rclone/rclone/backend/sftp" diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index 85bc208a6e4fd..89e308aed04be 100644 --- a/backend/azureblob/azureblob.go +++ b/backend/azureblob/azureblob.go @@ -1,11 +1,10 @@ -//go:build !plan9 && !solaris && !js && go1.18 -// +build !plan9,!solaris,!js,go1.18 +//go:build !plan9 && !solaris && !js +// +build !plan9,!solaris,!js // Package azureblob provides an interface to the Microsoft Azure blob object storage system package azureblob import ( - "bytes" "context" "crypto/md5" "encoding/base64" @@ -18,6 +17,7 @@ import ( "net/url" "os" "path" + "sort" "strconv" "strings" "sync" @@ -33,7 +33,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/service" "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/chunksize" "github.com/rclone/rclone/fs/config" "github.com/rclone/rclone/fs/config/configmap" @@ -46,10 +45,8 @@ import ( "github.com/rclone/rclone/lib/bucket" "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/env" + "github.com/rclone/rclone/lib/multipart" "github.com/rclone/rclone/lib/pacer" - "github.com/rclone/rclone/lib/pool" - "github.com/rclone/rclone/lib/readers" - "golang.org/x/sync/errgroup" ) const ( @@ -58,6 +55,8 @@ const ( decayConstant = 1 // bigger for slower decay, exponential maxListChunkSize = 5000 // number of items to read at once modTimeKey = "mtime" + dirMetaKey = "hdi_isfolder" + dirMetaValue = "true" timeFormatIn = time.RFC3339 timeFormatOut = "2006-01-02T15:04:05.000000000Z07:00" storageDefaultBaseURL = "blob.core.windows.net" @@ -68,12 +67,16 @@ const ( emulatorAccount = "devstoreaccount1" emulatorAccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" emulatorBlobEndpoint = "http://127.0.0.1:10000/devstoreaccount1" - memoryPoolFlushTime = fs.Duration(time.Minute) // flush the cached buffers after this long - memoryPoolUseMmap = false ) var ( errCantUpdateArchiveTierBlobs = fserrors.NoRetryError(errors.New("can't update archive tier blob without --azureblob-archive-tier-delete")) + + // Take this when changing or reading metadata. + // + // It acts as global metadata lock so we don't bloat Object + // with an extra lock that will only very rarely be contended. + metadataMu sync.Mutex ) // Register with Fs @@ -93,6 +96,7 @@ Leave blank to use SAS URL or Emulator, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable ` + "`AZURE_STORAGE_ACCOUNT_NAME`" + ` if possible. `, + Sensitive: true, }, { Name: "env_auth", Help: `Read credentials from runtime (environment variables, CLI or MSI). @@ -104,11 +108,13 @@ See the [authentication docs](/azureblob#authentication) for full info.`, Help: `Storage Account Shared Key. Leave blank to use SAS URL or Emulator.`, + Sensitive: true, }, { Name: "sas_url", Help: `SAS URL for container level access only. Leave blank if using account/key or Emulator.`, + Sensitive: true, }, { Name: "tenant", Help: `ID of the service principal's tenant. Also called its directory ID. @@ -118,6 +124,7 @@ Set this if using - Service principal with certificate - User with username and password `, + Sensitive: true, }, { Name: "client_id", Help: `The ID of the client in use. @@ -127,6 +134,7 @@ Set this if using - Service principal with certificate - User with username and password `, + Sensitive: true, }, { Name: "client_secret", Help: `One of the service principal's client secrets @@ -134,6 +142,7 @@ Set this if using Set this if using - Service principal with client secret `, + Sensitive: true, }, { Name: "client_certificate_path", Help: `Path to a PEM or PKCS12 certificate file including the private key. @@ -171,7 +180,8 @@ Optionally set this if using Set this if using - User with username and password `, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "password", Help: `The user's password @@ -214,17 +224,20 @@ msi_client_id, or msi_mi_res_id parameters.`, Default: false, Advanced: true, }, { - Name: "msi_object_id", - Help: "Object ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_client_id or msi_mi_res_id specified.", - Advanced: true, + Name: "msi_object_id", + Help: "Object ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_client_id or msi_mi_res_id specified.", + Advanced: true, + Sensitive: true, }, { - Name: "msi_client_id", - Help: "Object ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_object_id or msi_mi_res_id specified.", - Advanced: true, + Name: "msi_client_id", + Help: "Object ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_object_id or msi_mi_res_id specified.", + Advanced: true, + Sensitive: true, }, { - Name: "msi_mi_res_id", - Help: "Azure resource ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_client_id or msi_object_id specified.", - Advanced: true, + Name: "msi_mi_res_id", + Help: "Azure resource ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_client_id or msi_object_id specified.", + Advanced: true, + Sensitive: true, }, { Name: "use_emulator", Help: "Uses local storage emulator if provided as 'true'.\n\nLeave blank if using real azure storage endpoint.", @@ -282,10 +295,10 @@ avoid the time out.`, Advanced: true, }, { Name: "access_tier", - Help: `Access tier of blob: hot, cool or archive. + Help: `Access tier of blob: hot, cool, cold or archive. -Archived blobs can be restored by setting access tier to hot or -cool. Leave blank if you intend to use default access tier, which is +Archived blobs can be restored by setting access tier to hot, cool or +cold. Leave blank if you intend to use default access tier, which is set at account level If there is no "access tier" specified, rclone doesn't apply any tier. @@ -293,7 +306,7 @@ rclone performs "Set Tier" operation on blobs while uploading, if objects are not modified, specifying "access tier" to new one will have no effect. If blobs are in "archive tier" at remote, trying to perform data transfer operations from remote will not be allowed. User should first restore by -tiering blob to "Hot" or "Cool".`, +tiering blob to "Hot", "Cool" or "Cold".`, Advanced: true, }, { Name: "archive_tier_delete", @@ -325,17 +338,16 @@ to start uploading.`, Advanced: true, }, { Name: "memory_pool_flush_time", - Default: memoryPoolFlushTime, + Default: fs.Duration(time.Minute), Advanced: true, - Help: `How often internal memory buffer pools will be flushed. - -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool.`, + Hide: fs.OptionHideBoth, + Help: `How often internal memory buffer pools will be flushed. (no longer used)`, }, { Name: "memory_pool_use_mmap", - Default: memoryPoolUseMmap, + Default: false, Advanced: true, - Help: `Whether to use mmap buffers in internal memory pool.`, + Hide: fs.OptionHideBoth, + Help: `Whether to use mmap buffers in internal memory pool. (no longer used)`, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -363,6 +375,18 @@ This option controls how often unused buffers will be removed from the pool.`, }, }, Advanced: true, + }, { + Name: "directory_markers", + Default: false, + Advanced: true, + Help: `Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with "/", to persist the folder. + +This object also has the metadata "` + dirMetaKey + ` = ` + dirMetaValue + `" to conform to +the Microsoft standard. + `, }, { Name: "no_check_container", Help: `If set, don't attempt to check the container exists or create it. @@ -408,10 +432,9 @@ type Options struct { ArchiveTierDelete bool `config:"archive_tier_delete"` UseEmulator bool `config:"use_emulator"` DisableCheckSum bool `config:"disable_checksum"` - MemoryPoolFlushTime fs.Duration `config:"memory_pool_flush_time"` - MemoryPoolUseMmap bool `config:"memory_pool_use_mmap"` Enc encoder.MultiEncoder `config:"encoding"` PublicAccess string `config:"public_access"` + DirectoryMarkers bool `config:"directory_markers"` NoCheckContainer bool `config:"no_check_container"` NoHeadObject bool `config:"no_head_object"` } @@ -432,8 +455,6 @@ type Fs struct { cache *bucket.Cache // cache for container creation status pacer *fs.Pacer // To pace and retry the API calls uploadToken *pacer.TokenDispenser // control concurrency - pool *pool.Pool // memory pool - poolSize int64 // size of pages in memory pool publicAccess container.PublicAccessType // Container Public Access Level } @@ -446,7 +467,7 @@ type Object struct { size int64 // Size of the object mimeType string // Content-Type of the object accessTier blob.AccessTier // Blob Access Tier - meta map[string]string // blob metadata + meta map[string]string // blob metadata - take metadataMu when accessing } // ------------------------------------------------------------ @@ -486,7 +507,7 @@ func parsePath(path string) (root string) { // split returns container and containerPath from the rootRelativePath // relative to f.root func (f *Fs) split(rootRelativePath string) (containerName, containerPath string) { - containerName, containerPath = bucket.Split(path.Join(f.root, rootRelativePath)) + containerName, containerPath = bucket.Split(bucket.Join(f.root, rootRelativePath)) return f.opt.Enc.FromStandardName(containerName), f.opt.Enc.FromStandardPath(containerPath) } @@ -499,6 +520,7 @@ func (o *Object) split() (container, containerPath string) { func validateAccessTier(tier string) bool { return strings.EqualFold(tier, string(blob.AccessTierHot)) || strings.EqualFold(tier, string(blob.AccessTierCool)) || + strings.EqualFold(tier, string(blob.AccessTierCold)) || strings.EqualFold(tier, string(blob.AccessTierArchive)) } @@ -628,8 +650,8 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e if opt.AccessTier == "" { opt.AccessTier = string(defaultAccessTier) } else if !validateAccessTier(opt.AccessTier) { - return nil, fmt.Errorf("supported access tiers are %s, %s and %s", - string(blob.AccessTierHot), string(blob.AccessTierCool), string(blob.AccessTierArchive)) + return nil, fmt.Errorf("supported access tiers are %s, %s, %s and %s", + string(blob.AccessTierHot), string(blob.AccessTierCool), string(blob.AccessTierCold), string(blob.AccessTierArchive)) } if !validatePublicAccess((opt.PublicAccess)) { @@ -646,13 +668,6 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e uploadToken: pacer.NewTokenDispenser(ci.Transfers), cache: bucket.NewCache(), cntSVCcache: make(map[string]*container.Client, 1), - pool: pool.New( - time.Duration(opt.MemoryPoolFlushTime), - int(opt.ChunkSize), - ci.Transfers, - opt.MemoryPoolUseMmap, - ), - poolSize: int64(opt.ChunkSize), } f.publicAccess = container.PublicAccessType(opt.PublicAccess) f.setRoot(root) @@ -664,6 +679,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e SetTier: true, GetTier: true, }).Fill(ctx, f) + if opt.DirectoryMarkers { + f.features.CanHaveEmptyDirectories = true + fs.Debugf(f, "Using directory markers") + } // Client options specifying our own transport policyClientOptions := policy.ClientOptions{ @@ -690,7 +709,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } cred, err = azidentity.NewDefaultAzureCredential(&options) if err != nil { - return nil, fmt.Errorf("create azure enviroment credential failed: %w", err) + return nil, fmt.Errorf("create azure environment credential failed: %w", err) } case opt.UseEmulator: if opt.Account == "" { @@ -906,7 +925,7 @@ func (f *Fs) cntSVC(containerName string) (containerClient *container.Client) { // Return an Object from a path // // If it can't be found it returns the error fs.ErrorObjectNotFound. -func (f *Fs) newObjectWithInfo(remote string, info *container.BlobItem) (fs.Object, error) { +func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *container.BlobItem) (fs.Object, error) { o := &Object{ fs: f, remote: remote, @@ -917,7 +936,7 @@ func (f *Fs) newObjectWithInfo(remote string, info *container.BlobItem) (fs.Obje return nil, err } } else if !o.fs.opt.NoHeadObject { - err := o.readMetaData() // reads info and headers, returning an error + err := o.readMetaData(ctx) // reads info and headers, returning an error if err != nil { return nil, err } @@ -928,7 +947,7 @@ func (f *Fs) newObjectWithInfo(remote string, info *container.BlobItem) (fs.Obje // NewObject finds the Object at remote. If it can't be found // it returns the error fs.ErrorObjectNotFound. func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { - return f.newObjectWithInfo(remote, nil) + return f.newObjectWithInfo(ctx, remote, nil) } // getBlobSVC creates a blob client @@ -943,6 +962,9 @@ func (f *Fs) getBlockBlobSVC(container, containerPath string) *blockblob.Client // updateMetadataWithModTime adds the modTime passed in to o.meta. func (o *Object) updateMetadataWithModTime(modTime time.Time) { + metadataMu.Lock() + defer metadataMu.Unlock() + // Make sure o.meta is not nil if o.meta == nil { o.meta = make(map[string]string, 1) @@ -964,31 +986,7 @@ func isDirectoryMarker(size int64, metadata map[string]*string, remote string) b // defacto standard for marking blobs as directories. // Note also that the metadata hasn't been normalised to lower case yet for k, v := range metadata { - if v != nil && strings.EqualFold(k, "hdi_isfolder") && *v == "true" { - return true - } - } - } - return false -} - -// Returns whether file is a directory marker or not using metadata -// with pointers to strings as the SDK seems to use both forms rather -// annoyingly. -// -// NB This is a duplicate of isDirectoryMarker -func isDirectoryMarkerP(size int64, metadata map[string]*string, remote string) bool { - // Directory markers are 0 length - if size == 0 { - endsWithSlash := strings.HasSuffix(remote, "/") - if endsWithSlash || remote == "" { - return true - } - // Note that metadata with hdi_isfolder = true seems to be a - // defacto standard for marking blobs as directories. - // Note also that the metadata hasn't been normalised to lower case yet - for k, pv := range metadata { - if strings.EqualFold(k, "hdi_isfolder") && pv != nil && *pv == "true" { + if v != nil && strings.EqualFold(k, dirMetaKey) && *v == dirMetaValue { return true } } @@ -1033,6 +1031,7 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string, Prefix: &directory, MaxResults: &maxResults, }) + foundItems := 0 for pager.More() { var response container.ListBlobsHierarchyResponse err := f.pacer.Call(func() (bool, error) { @@ -1051,6 +1050,7 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string, } // Advance marker to next // marker = response.NextMarker + foundItems += len(response.Segment.BlobItems) for i := range response.Segment.BlobItems { file := response.Segment.BlobItems[i] // Finish if file name no longer has prefix @@ -1066,20 +1066,27 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string, fs.Debugf(f, "Odd name received %q", remote) continue } - remote = remote[len(prefix):] - if isDirectoryMarkerP(*file.Properties.ContentLength, file.Metadata, remote) { - continue // skip directory marker + isDirectory := isDirectoryMarker(*file.Properties.ContentLength, file.Metadata, remote) + if isDirectory { + // Don't insert the root directory + if remote == directory { + continue + } + // process directory markers as directories + remote = strings.TrimRight(remote, "/") } + remote = remote[len(prefix):] if addContainer { remote = path.Join(containerName, remote) } // Send object - err = fn(remote, file, false) + err = fn(remote, file, isDirectory) if err != nil { return err } } // Send the subdirectories + foundItems += len(response.Segment.BlobPrefixes) for _, remote := range response.Segment.BlobPrefixes { if remote.Name == nil { fs.Debugf(f, "Nil prefix received") @@ -1102,16 +1109,26 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string, } } } + if f.opt.DirectoryMarkers && foundItems == 0 && directory != "" { + // Determine whether the directory exists or not by whether it has a marker + _, err := f.readMetaData(ctx, containerName, directory) + if err != nil { + if err == fs.ErrorObjectNotFound { + return fs.ErrorDirNotFound + } + return err + } + } return nil } // Convert a list item into a DirEntry -func (f *Fs) itemToDirEntry(remote string, object *container.BlobItem, isDirectory bool) (fs.DirEntry, error) { +func (f *Fs) itemToDirEntry(ctx context.Context, remote string, object *container.BlobItem, isDirectory bool) (fs.DirEntry, error) { if isDirectory { d := fs.NewDir(remote, time.Time{}) return d, nil } - o, err := f.newObjectWithInfo(remote, object) + o, err := f.newObjectWithInfo(ctx, remote, object) if err != nil { return nil, err } @@ -1139,7 +1156,7 @@ func (f *Fs) listDir(ctx context.Context, containerName, directory, prefix strin return nil, fs.ErrorDirNotFound } err = f.list(ctx, containerName, directory, prefix, addContainer, false, int32(f.opt.ListChunkSize), func(remote string, object *container.BlobItem, isDirectory bool) error { - entry, err := f.itemToDirEntry(remote, object, isDirectory) + entry, err := f.itemToDirEntry(ctx, remote, object, isDirectory) if err != nil { return err } @@ -1220,7 +1237,7 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( list := walk.NewListRHelper(callback) listR := func(containerName, directory, prefix string, addContainer bool) error { return f.list(ctx, containerName, directory, prefix, addContainer, true, int32(f.opt.ListChunkSize), func(remote string, object *container.BlobItem, isDirectory bool) error { - entry, err := f.itemToDirEntry(remote, object, isDirectory) + entry, err := f.itemToDirEntry(ctx, remote, object, isDirectory) if err != nil { return err } @@ -1314,10 +1331,71 @@ func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, opt return f.Put(ctx, in, src, options...) } +// Create directory marker file and parents +func (f *Fs) createDirectoryMarker(ctx context.Context, container, dir string) error { + if !f.opt.DirectoryMarkers || container == "" { + return nil + } + + // Object to be uploaded + o := &Object{ + fs: f, + modTime: time.Now(), + meta: map[string]string{ + dirMetaKey: dirMetaValue, + }, + } + + for { + _, containerPath := f.split(dir) + // Don't create the directory marker if it is the bucket or at the very root + if containerPath == "" { + break + } + o.remote = dir + "/" + + // Check to see if object already exists + _, err := f.readMetaData(ctx, container, containerPath+"/") + if err == nil { + return nil + } + + // Upload it if not + fs.Debugf(o, "Creating directory marker") + content := io.Reader(strings.NewReader("")) + err = o.Update(ctx, content, o) + if err != nil { + return fmt.Errorf("creating directory marker failed: %w", err) + } + + // Now check parent directory exists + dir = path.Dir(dir) + if dir == "/" || dir == "." { + break + } + } + + return nil +} + // Mkdir creates the container if it doesn't exist func (f *Fs) Mkdir(ctx context.Context, dir string) error { container, _ := f.split(dir) - return f.makeContainer(ctx, container) + e := f.makeContainer(ctx, container) + if e != nil { + return e + } + return f.createDirectoryMarker(ctx, container, dir) +} + +// mkdirParent creates the parent bucket/directory if it doesn't exist +func (f *Fs) mkdirParent(ctx context.Context, remote string) error { + remote = strings.TrimRight(remote, "/") + dir := path.Dir(remote) + if dir == "/" || dir == "." { + dir = "" + } + return f.Mkdir(ctx, dir) } // makeContainer creates the container if it doesn't exist @@ -1417,6 +1495,18 @@ func (f *Fs) deleteContainer(ctx context.Context, containerName string) error { // Returns an error if it isn't empty func (f *Fs) Rmdir(ctx context.Context, dir string) error { container, directory := f.split(dir) + // Remove directory marker file + if f.opt.DirectoryMarkers && container != "" && directory != "" { + o := &Object{ + fs: f, + remote: dir + "/", + } + fs.Debugf(o, "Removing directory marker") + err := o.Remove(ctx) + if err != nil { + return fmt.Errorf("removing directory marker failed: %w", err) + } + } if container == "" || directory != "" { return nil } @@ -1440,7 +1530,10 @@ func (f *Fs) Hashes() hash.Set { // Purge deletes all the files and directories including the old versions. func (f *Fs) Purge(ctx context.Context, dir string) error { container, directory := f.split(dir) - if container == "" || directory != "" { + if container == "" { + return errors.New("can't purge from root") + } + if directory != "" { // Delegate to caller if not root of a container return fs.ErrorCantPurge } @@ -1458,7 +1551,7 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // If it isn't possible then return fs.ErrorCantCopy func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { dstContainer, dstPath := f.split(remote) - err := f.makeContainer(ctx, dstContainer) + err := f.mkdirParent(ctx, remote) if err != nil { return nil, err } @@ -1471,9 +1564,8 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, srcBlobSVC := srcObj.getBlobSVC() srcURL := srcBlobSVC.URL() - tier := blob.AccessTier(f.opt.AccessTier) options := blob.StartCopyFromURLOptions{ - Tier: &tier, + Tier: parseTier(f.opt.AccessTier), } var startCopy blob.StartCopyFromURLResponse err = f.pacer.Call(func() (bool, error) { @@ -1498,19 +1590,6 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, return f.NewObject(ctx, remote) } -func (f *Fs) getMemoryPool(size int64) *pool.Pool { - if size == int64(f.opt.ChunkSize) { - return f.pool - } - - return pool.New( - time.Duration(f.opt.MemoryPoolFlushTime), - int(size), - f.ci.Transfers, - f.opt.MemoryPoolUseMmap, - ) -} - // ------------------------------------------------------------ // Fs returns the parent Fs @@ -1554,6 +1633,9 @@ func (o *Object) Size() int64 { // Set o.metadata from metadata func (o *Object) setMetadata(metadata map[string]*string) { + metadataMu.Lock() + defer metadataMu.Unlock() + if len(metadata) > 0 { // Lower case the metadata o.meta = make(map[string]string, len(metadata)) @@ -1578,11 +1660,15 @@ func (o *Object) setMetadata(metadata map[string]*string) { // Get metadata from o.meta func (o *Object) getMetadata() (metadata map[string]*string) { + metadataMu.Lock() + defer metadataMu.Unlock() + if len(o.meta) == 0 { return nil } metadata = make(map[string]*string, len(o.meta)) for k, v := range o.meta { + v := v metadata[k] = &v } return metadata @@ -1695,7 +1781,7 @@ func (o *Object) decodeMetaDataFromBlob(info *container.BlobItem) (err error) { } else { size = *info.Properties.ContentLength } - if isDirectoryMarkerP(size, metadata, o.remote) { + if isDirectoryMarker(size, metadata, o.remote) { return fs.ErrorNotAFile } // NOTE - Client library always returns MD5 as base64 decoded string, Object needs to maintain @@ -1728,17 +1814,34 @@ func (o *Object) getBlobSVC() *blob.Client { return o.fs.getBlobSVC(container, directory) } -// getBlockBlobSVC creates a block blob client -func (o *Object) getBlockBlobSVC() *blockblob.Client { - container, directory := o.split() - return o.fs.getBlockBlobSVC(container, directory) -} - // clearMetaData clears enough metadata so readMetaData will re-read it func (o *Object) clearMetaData() { o.modTime = time.Time{} } +// readMetaData gets the metadata if it hasn't already been fetched +func (f *Fs) readMetaData(ctx context.Context, container, containerPath string) (blobProperties blob.GetPropertiesResponse, err error) { + if !f.containerOK(container) { + return blobProperties, fs.ErrorObjectNotFound + } + blb := f.getBlobSVC(container, containerPath) + + // Read metadata (this includes metadata) + options := blob.GetPropertiesOptions{} + err = f.pacer.Call(func() (bool, error) { + blobProperties, err = blb.GetProperties(ctx, &options) + return f.shouldRetry(ctx, err) + }) + if err != nil { + // On directories - GetProperties does not work and current SDK does not populate service code correctly hence check regular http response as well + if storageErr, ok := err.(*azcore.ResponseError); ok && (storageErr.ErrorCode == string(bloberror.BlobNotFound) || storageErr.StatusCode == http.StatusNotFound) { + return blobProperties, fs.ErrorObjectNotFound + } + return blobProperties, err + } + return blobProperties, nil +} + // readMetaData gets the metadata if it hasn't already been fetched // // Sets @@ -1747,33 +1850,15 @@ func (o *Object) clearMetaData() { // o.modTime // o.size // o.md5 -func (o *Object) readMetaData() (err error) { - container, _ := o.split() - if !o.fs.containerOK(container) { - return fs.ErrorObjectNotFound - } +func (o *Object) readMetaData(ctx context.Context) (err error) { if !o.modTime.IsZero() { return nil } - blb := o.getBlobSVC() - // fs.Debugf(o, "Blob URL = %q", blb.URL()) - - // Read metadata (this includes metadata) - options := blob.GetPropertiesOptions{} - ctx := context.Background() - var blobProperties blob.GetPropertiesResponse - err = o.fs.pacer.Call(func() (bool, error) { - blobProperties, err = blb.GetProperties(ctx, &options) - return o.fs.shouldRetry(ctx, err) - }) + container, containerPath := o.split() + blobProperties, err := o.fs.readMetaData(ctx, container, containerPath) if err != nil { - // On directories - GetProperties does not work and current SDK does not populate service code correctly hence check regular http response as well - if storageErr, ok := err.(*azcore.ResponseError); ok && (storageErr.ErrorCode == string(bloberror.BlobNotFound) || storageErr.StatusCode == http.StatusNotFound) { - return fs.ErrorObjectNotFound - } return err } - return o.decodeMetaDataFromPropertiesResponse(&blobProperties) } @@ -1783,18 +1868,13 @@ func (o *Object) readMetaData() (err error) { // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) (result time.Time) { // The error is logged in readMetaData - _ = o.readMetaData() + _ = o.readMetaData(ctx) return o.modTime } // SetModTime sets the modification time of the local fs object func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { - // Make sure o.meta is not nil - if o.meta == nil { - o.meta = make(map[string]string, 1) - } - // Set modTimeKey in it - o.meta[modTimeKey] = modTime.Format(timeFormatOut) + o.updateMetadataWithModTime(modTime) blb := o.getBlobSVC() opt := blob.SetMetadataOptions{} @@ -1820,7 +1900,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read var offset int64 var count int64 if o.AccessTier() == blob.AccessTierArchive { - return nil, fmt.Errorf("blob in archive tier, you need to set tier to hot or cool first") + return nil, fmt.Errorf("blob in archive tier, you need to set tier to hot, cool, cold first") } fs.FixRangeOption(options, o.size) for _, option := range options { @@ -1870,48 +1950,6 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read return downloadResponse.Body, nil } -// poolWrapper wraps a pool.Pool as an azblob.TransferManager -type poolWrapper struct { - pool *pool.Pool - bufToken chan struct{} - runToken chan struct{} -} - -// newPoolWrapper creates an azblob.TransferManager that will use a -// pool.Pool with maximum concurrency as specified. -func (f *Fs) newPoolWrapper(concurrency int) *poolWrapper { - return &poolWrapper{ - pool: f.pool, - bufToken: make(chan struct{}, concurrency), - runToken: make(chan struct{}, concurrency), - } -} - -// Get implements TransferManager.Get(). -func (pw *poolWrapper) Get() []byte { - pw.bufToken <- struct{}{} - return pw.pool.Get() -} - -// Put implements TransferManager.Put(). -func (pw *poolWrapper) Put(b []byte) { - pw.pool.Put(b) - <-pw.bufToken -} - -// Run implements TransferManager.Run(). -func (pw *poolWrapper) Run(f func()) { - pw.runToken <- struct{}{} - go func() { - f() - <-pw.runToken - }() -} - -// Close implements TransferManager.Close(). -func (pw *poolWrapper) Close() { -} - // Converts a string into a pointer to a string func pString(s string) *string { return &s @@ -1928,8 +1966,8 @@ func (rs *readSeekCloser) Close() error { return nil } -// increment the slice passed in as LSB binary -func increment(xs []byte) { +// increment the array as LSB binary +func increment(xs *[8]byte) { for i, digit := range xs { newDigit := digit + 1 xs[i] = newDigit @@ -1940,22 +1978,43 @@ func increment(xs []byte) { } } -var warnStreamUpload sync.Once +// record chunk number and id for Close +type azBlock struct { + chunkNumber int + id string +} -// uploadMultipart uploads a file using multipart upload +// Implements the fs.ChunkWriter interface +type azChunkWriter struct { + chunkSize int64 + size int64 + f *Fs + ui uploadInfo + blocksMu sync.Mutex // protects the below + blocks []azBlock // list of blocks for finalize + binaryBlockID [8]byte // block counter as LSB first 8 bytes + o *Object +} + +// OpenChunkWriter returns the chunk size and a ChunkWriter // -// Write a larger blob, using CreateBlockBlob, PutBlock, and PutBlockList. -func (o *Object) uploadMultipart(ctx context.Context, in io.Reader, size int64, blb *blockblob.Client, httpHeaders *blob.HTTPHeaders) (err error) { +// Pass in the remote and the src object +// You can also use options to hint at the desired chunk size +func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectInfo, options ...fs.OpenOption) (info fs.ChunkWriterInfo, writer fs.ChunkWriter, err error) { + // Temporary Object under construction + o := &Object{ + fs: f, + remote: remote, + } + ui, err := o.prepareUpload(ctx, src, options) + if err != nil { + return info, nil, fmt.Errorf("failed to prepare upload: %w", err) + } + // Calculate correct partSize - partSize := o.fs.opt.ChunkSize + partSize := f.opt.ChunkSize totalParts := -1 - - // make concurrency machinery - concurrency := o.fs.opt.UploadConcurrency - if concurrency < 1 { - concurrency = 1 - } - tokens := pacer.NewTokenDispenser(concurrency) + size := src.Size() // Note that the max size of file is 4.75 TB (100 MB X 50,000 // blocks) and this is bigger than the max uncommitted block @@ -1969,13 +2028,13 @@ func (o *Object) uploadMultipart(ctx context.Context, in io.Reader, size int64, // 195GB which seems like a not too unreasonable limit. if size == -1 { warnStreamUpload.Do(func() { - fs.Logf(o, "Streaming uploads using chunk size %v will have maximum file size of %v", - o.fs.opt.ChunkSize, partSize*fs.SizeSuffix(blockblob.MaxBlocks)) + fs.Logf(f, "Streaming uploads using chunk size %v will have maximum file size of %v", + f.opt.ChunkSize, partSize*fs.SizeSuffix(blockblob.MaxBlocks)) }) } else { - partSize = chunksize.Calculator(o, size, blockblob.MaxBlocks, o.fs.opt.ChunkSize) + partSize = chunksize.Calculator(remote, size, blockblob.MaxBlocks, f.opt.ChunkSize) if partSize > fs.SizeSuffix(blockblob.MaxStageBlockBytes) { - return fmt.Errorf("can't upload as it is too big %v - takes more than %d chunks of %v", fs.SizeSuffix(size), fs.SizeSuffix(blockblob.MaxBlocks), fs.SizeSuffix(blockblob.MaxStageBlockBytes)) + return info, nil, fmt.Errorf("can't upload as it is too big %v - takes more than %d chunks of %v", fs.SizeSuffix(size), fs.SizeSuffix(blockblob.MaxBlocks), fs.SizeSuffix(blockblob.MaxStageBlockBytes)) } totalParts = int(fs.SizeSuffix(size) / partSize) if fs.SizeSuffix(size)%partSize != 0 { @@ -1985,207 +2044,224 @@ func (o *Object) uploadMultipart(ctx context.Context, in io.Reader, size int64, fs.Debugf(o, "Multipart upload session started for %d parts of size %v", totalParts, partSize) - // unwrap the accounting from the input, we use wrap to put it - // back on after the buffering - in, wrap := accounting.UnWrap(in) + chunkWriter := &azChunkWriter{ + chunkSize: int64(partSize), + size: size, + f: f, + ui: ui, + o: o, + } + info = fs.ChunkWriterInfo{ + ChunkSize: int64(partSize), + Concurrency: o.fs.opt.UploadConcurrency, + //LeavePartsOnError: o.fs.opt.LeavePartsOnError, + } + fs.Debugf(o, "open chunk writer: started multipart upload") + return info, chunkWriter, nil +} - // FIXME it would be nice to delete uncommitted blocks - // See: https://github.com/rclone/rclone/issues/5583 - // - // However there doesn't seem to be an easy way of doing this other than - // by deleting the target. - // - // This means that a failed upload deletes the target which isn't ideal. - // - // Uploading a zero length blob and deleting it will remove the - // uncommitted blocks I think. - // - // Could check to see if a file exists already and if it - // doesn't then create a 0 length file and delete it to flush - // the uncommitted blocks. - // - // This is what azcopy does - // https://github.com/MicrosoftDocs/azure-docs/issues/36347#issuecomment-541457962 - // defer atexit.OnError(&err, func() { - // fs.Debugf(o, "Cancelling multipart upload") - // // Code goes here! - // })() - - // Upload the chunks - var ( - g, gCtx = errgroup.WithContext(ctx) - remaining = fs.SizeSuffix(size) // remaining size in file for logging only, -1 if size < 0 - position = fs.SizeSuffix(0) // position in file - memPool = o.fs.getMemoryPool(int64(partSize)) // pool to get memory from - finished = false // set when we have read EOF - blocks []string // list of blocks for finalize - binaryBlockID = make([]byte, 8) // block counter as LSB first 8 bytes - ) - for part := 0; !finished; part++ { - // Get a block of memory from the pool and a token which limits concurrency - tokens.Get() - buf := memPool.Get() +// WriteChunk will write chunk number with reader bytes, where chunk number >= 0 +func (w *azChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (int64, error) { + if chunkNumber < 0 { + err := fmt.Errorf("invalid chunk number provided: %v", chunkNumber) + return -1, err + } - free := func() { - memPool.Put(buf) // return the buf - tokens.Put() // return the token - } + // Upload the block, with MD5 for check + m := md5.New() + currentChunkSize, err := io.Copy(m, reader) + if err != nil { + return -1, err + } + // If no data read, don't write the chunk + if currentChunkSize == 0 { + return 0, nil + } + md5sum := m.Sum(nil) + transactionalMD5 := md5sum[:] - // Fail fast, in case an errgroup managed function returns an error - // gCtx is cancelled. There is no point in uploading all the other parts. - if gCtx.Err() != nil { - free() - break - } + // increment the blockID and save the blocks for finalize + increment(&w.binaryBlockID) + blockID := base64.StdEncoding.EncodeToString(w.binaryBlockID[:]) - // Read the chunk - n, err := readers.ReadFill(in, buf) // this can never return 0, nil - if err == io.EOF { - if n == 0 { // end if no data - free() - break - } - finished = true - } else if err != nil { - free() - return fmt.Errorf("multipart upload failed to read source: %w", err) - } - buf = buf[:n] - - // increment the blockID and save the blocks for finalize - increment(binaryBlockID) - blockID := base64.StdEncoding.EncodeToString(binaryBlockID) - blocks = append(blocks, blockID) - - // Transfer the chunk - fs.Debugf(o, "Uploading part %d/%d offset %v/%v part size %d", part+1, totalParts, position, fs.SizeSuffix(size), len(buf)) - g.Go(func() (err error) { - defer free() - - // Upload the block, with MD5 for check - md5sum := md5.Sum(buf) - transactionalMD5 := md5sum[:] - err = o.fs.pacer.Call(func() (bool, error) { - bufferReader := bytes.NewReader(buf) - wrappedReader := wrap(bufferReader) - rs := readSeekCloser{wrappedReader, bufferReader} - options := blockblob.StageBlockOptions{ - // Specify the transactional md5 for the body, to be validated by the service. - TransactionalValidation: blob.TransferValidationTypeMD5(transactionalMD5), - } - _, err = blb.StageBlock(ctx, blockID, &rs, &options) - return o.fs.shouldRetry(ctx, err) - }) - if err != nil { - return fmt.Errorf("multipart upload failed to upload part: %w", err) - } - return nil - }) + // Save the blockID for the commit + w.blocksMu.Lock() + w.blocks = append(w.blocks, azBlock{ + chunkNumber: chunkNumber, + id: blockID, + }) + w.blocksMu.Unlock() - // ready for next block - if size >= 0 { - remaining -= partSize + err = w.f.pacer.Call(func() (bool, error) { + // rewind the reader on retry and after reading md5 + _, err = reader.Seek(0, io.SeekStart) + if err != nil { + return false, err } - position += partSize - } - err = g.Wait() + options := blockblob.StageBlockOptions{ + // Specify the transactional md5 for the body, to be validated by the service. + TransactionalValidation: blob.TransferValidationTypeMD5(transactionalMD5), + } + _, err = w.ui.blb.StageBlock(ctx, blockID, &readSeekCloser{Reader: reader, Seeker: reader}, &options) + if err != nil { + if chunkNumber <= 8 { + return w.f.shouldRetry(ctx, err) + } + // retry all chunks once have done the first few + return true, err + } + return false, nil + }) if err != nil { - return err + return -1, fmt.Errorf("failed to upload chunk %d with %v bytes: %w", chunkNumber+1, currentChunkSize, err) + } + + fs.Debugf(w.o, "multipart upload wrote chunk %d with %v bytes", chunkNumber+1, currentChunkSize) + return currentChunkSize, err +} + +// Abort the multipart upload. +// +// FIXME it would be nice to delete uncommitted blocks. +// +// See: https://github.com/rclone/rclone/issues/5583 +// +// However there doesn't seem to be an easy way of doing this other than +// by deleting the target. +// +// This means that a failed upload deletes the target which isn't ideal. +// +// Uploading a zero length blob and deleting it will remove the +// uncommitted blocks I think. +// +// Could check to see if a file exists already and if it doesn't then +// create a 0 length file and delete it to flush the uncommitted +// blocks. +// +// This is what azcopy does +// https://github.com/MicrosoftDocs/azure-docs/issues/36347#issuecomment-541457962 +func (w *azChunkWriter) Abort(ctx context.Context) error { + fs.Debugf(w.o, "multipart upload aborted (did nothing - see issue #5583)") + return nil +} + +// Close and finalise the multipart upload +func (w *azChunkWriter) Close(ctx context.Context) (err error) { + // sort the completed parts by part number + sort.Slice(w.blocks, func(i, j int) bool { + return w.blocks[i].chunkNumber < w.blocks[j].chunkNumber + }) + + // Create a list of block IDs + blockIDs := make([]string, len(w.blocks)) + for i := range w.blocks { + blockIDs[i] = w.blocks[i].id } - tier := blob.AccessTier(o.fs.opt.AccessTier) options := blockblob.CommitBlockListOptions{ - Metadata: o.getMetadata(), - Tier: &tier, - HTTPHeaders: httpHeaders, + Metadata: w.o.getMetadata(), + Tier: parseTier(w.f.opt.AccessTier), + HTTPHeaders: &w.ui.httpHeaders, } // Finalise the upload session - err = o.fs.pacer.Call(func() (bool, error) { - _, err := blb.CommitBlockList(ctx, blocks, &options) - return o.fs.shouldRetry(ctx, err) + err = w.f.pacer.Call(func() (bool, error) { + _, err := w.ui.blb.CommitBlockList(ctx, blockIDs, &options) + return w.f.shouldRetry(ctx, err) }) if err != nil { - return fmt.Errorf("multipart upload failed to finalize: %w", err) + return fmt.Errorf("failed to complete multipart upload: %w", err) } - return nil + fs.Debugf(w.o, "multipart upload finished") + return err +} + +var warnStreamUpload sync.Once + +// uploadMultipart uploads a file using multipart upload +// +// Write a larger blob, using CreateBlockBlob, PutBlock, and PutBlockList. +func (o *Object) uploadMultipart(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (ui uploadInfo, err error) { + chunkWriter, err := multipart.UploadMultipart(ctx, src, in, multipart.UploadMultipartOptions{ + Open: o.fs, + OpenOptions: options, + }) + if err != nil { + return ui, err + } + return chunkWriter.(*azChunkWriter).ui, nil } // uploadSinglepart uploads a short blob using a single part upload -func (o *Object) uploadSinglepart(ctx context.Context, in io.Reader, size int64, blb *blockblob.Client, httpHeaders *blob.HTTPHeaders) (err error) { +func (o *Object) uploadSinglepart(ctx context.Context, in io.Reader, size int64, ui uploadInfo) (err error) { + chunkSize := int64(o.fs.opt.ChunkSize) // fs.Debugf(o, "Single part upload starting of object %d bytes", size) - if size > o.fs.poolSize || size < 0 { - return fmt.Errorf("internal error: single part upload size too big %d > %d", size, o.fs.opt.ChunkSize) + if size > chunkSize || size < 0 { + return fmt.Errorf("internal error: single part upload size too big %d > %d", size, chunkSize) } - buf := o.fs.pool.Get() - defer o.fs.pool.Put(buf) + rw := multipart.NewRW() + defer fs.CheckClose(rw, &err) - n, err := readers.ReadFill(in, buf) - if err == nil { - // Check to see whether in is exactly len(buf) or bigger - var buf2 = []byte{0} - n2, err2 := readers.ReadFill(in, buf2) - if n2 != 0 || err2 != io.EOF { - return fmt.Errorf("single part upload read failed: object longer than expected (expecting %d but got > %d)", size, len(buf)) - } - } + n, err := io.CopyN(rw, in, size+1) if err != nil && err != io.EOF { return fmt.Errorf("single part upload read failed: %w", err) } - if int64(n) != size { + if n != size { return fmt.Errorf("single part upload: expecting to read %d bytes but read %d", size, n) } - b := bytes.NewReader(buf[:n]) - rs := &readSeekCloser{Reader: b, Seeker: b} + rs := &readSeekCloser{Reader: rw, Seeker: rw} - tier := blob.AccessTier(o.fs.opt.AccessTier) options := blockblob.UploadOptions{ Metadata: o.getMetadata(), - Tier: &tier, - HTTPHeaders: httpHeaders, + Tier: parseTier(o.fs.opt.AccessTier), + HTTPHeaders: &ui.httpHeaders, } - // Don't retry, return a retry error instead - return o.fs.pacer.CallNoRetry(func() (bool, error) { - _, err = blb.Upload(ctx, rs, &options) + return o.fs.pacer.Call(func() (bool, error) { + // rewind the reader on retry + _, err = rs.Seek(0, io.SeekStart) + if err != nil { + return false, err + } + _, err = ui.blb.Upload(ctx, rs, &options) return o.fs.shouldRetry(ctx, err) }) } -// Update the object with the contents of the io.Reader, modTime and size -// -// The new object may have been created if an error is returned -func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { - if o.accessTier == blob.AccessTierArchive { - if o.fs.opt.ArchiveTierDelete { - fs.Debugf(o, "deleting archive tier blob before updating") - err = o.Remove(ctx) - if err != nil { - return fmt.Errorf("failed to delete archive blob before updating: %w", err) - } - } else { - return errCantUpdateArchiveTierBlobs - } - } +// Info needed for an upload +type uploadInfo struct { + blb *blockblob.Client + httpHeaders blob.HTTPHeaders + isDirMarker bool +} + +// Prepare the object for upload +func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options []fs.OpenOption) (ui uploadInfo, err error) { container, containerPath := o.split() if container == "" || containerPath == "" { - return fmt.Errorf("can't upload to root - need a container") - } - err = o.fs.makeContainer(ctx, container) - if err != nil { - return err + return ui, fmt.Errorf("can't upload to root - need a container") + } + // Create parent dir/bucket if not saving directory marker + metadataMu.Lock() + _, ui.isDirMarker = o.meta[dirMetaKey] + metadataMu.Unlock() + if !ui.isDirMarker { + err = o.fs.mkdirParent(ctx, o.remote) + if err != nil { + return ui, err + } } // Update Mod time o.updateMetadataWithModTime(src.ModTime(ctx)) if err != nil { - return err + return ui, err } // Create the HTTP headers for the upload - httpHeaders := blob.HTTPHeaders{ + ui.httpHeaders = blob.HTTPHeaders{ BlobContentType: pString(fs.MimeType(ctx, src)), } @@ -2195,7 +2271,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if sourceMD5, _ := src.Hash(ctx, hash.MD5); sourceMD5 != "" { sourceMD5bytes, err := hex.DecodeString(sourceMD5) if err == nil { - httpHeaders.BlobContentMD5 = sourceMD5bytes + ui.httpHeaders.BlobContentMD5 = sourceMD5bytes } else { fs.Debugf(o, "Failed to decode %q as MD5: %v", sourceMD5, err) } @@ -2210,36 +2286,62 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op case "": // ignore case "cache-control": - httpHeaders.BlobCacheControl = pString(value) + ui.httpHeaders.BlobCacheControl = pString(value) case "content-disposition": - httpHeaders.BlobContentDisposition = pString(value) + ui.httpHeaders.BlobContentDisposition = pString(value) case "content-encoding": - httpHeaders.BlobContentEncoding = pString(value) + ui.httpHeaders.BlobContentEncoding = pString(value) case "content-language": - httpHeaders.BlobContentLanguage = pString(value) + ui.httpHeaders.BlobContentLanguage = pString(value) case "content-type": - httpHeaders.BlobContentType = pString(value) + ui.httpHeaders.BlobContentType = pString(value) + } + } + + ui.blb = o.fs.getBlockBlobSVC(container, containerPath) + return ui, nil +} + +// Update the object with the contents of the io.Reader, modTime and size +// +// The new object may have been created if an error is returned +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + if o.accessTier == blob.AccessTierArchive { + if o.fs.opt.ArchiveTierDelete { + fs.Debugf(o, "deleting archive tier blob before updating") + err = o.Remove(ctx) + if err != nil { + return fmt.Errorf("failed to delete archive blob before updating: %w", err) + } + } else { + return errCantUpdateArchiveTierBlobs } } - blb := o.fs.getBlockBlobSVC(container, containerPath) size := src.Size() - multipartUpload := size < 0 || size > o.fs.poolSize + multipartUpload := size < 0 || size > int64(o.fs.opt.ChunkSize) + var ui uploadInfo if multipartUpload { - err = o.uploadMultipart(ctx, in, size, blb, &httpHeaders) + ui, err = o.uploadMultipart(ctx, in, src, options...) } else { - err = o.uploadSinglepart(ctx, in, size, blb, &httpHeaders) + ui, err = o.prepareUpload(ctx, src, options) + if err != nil { + return fmt.Errorf("failed to prepare upload: %w", err) + } + err = o.uploadSinglepart(ctx, in, size, ui) } if err != nil { return err } // Refresh metadata on object - o.clearMetaData() - err = o.readMetaData() - if err != nil { - return err + if !ui.isDirMarker { + o.clearMetaData() + err = o.readMetaData(ctx) + if err != nil { + return err + } } // If tier is not changed or not specified, do not attempt to invoke `SetBlobTier` operation @@ -2313,15 +2415,24 @@ func (o *Object) GetTier() string { return string(o.accessTier) } +func parseTier(tier string) *blob.AccessTier { + if tier == "" { + return nil + } + msTier := blob.AccessTier(tier) + return &msTier +} + // Check the interfaces are satisfied var ( - _ fs.Fs = &Fs{} - _ fs.Copier = &Fs{} - _ fs.PutStreamer = &Fs{} - _ fs.Purger = &Fs{} - _ fs.ListRer = &Fs{} - _ fs.Object = &Object{} - _ fs.MimeTyper = &Object{} - _ fs.GetTierer = &Object{} - _ fs.SetTierer = &Object{} + _ fs.Fs = &Fs{} + _ fs.Copier = &Fs{} + _ fs.PutStreamer = &Fs{} + _ fs.Purger = &Fs{} + _ fs.ListRer = &Fs{} + _ fs.OpenChunkWriter = &Fs{} + _ fs.Object = &Object{} + _ fs.MimeTyper = &Object{} + _ fs.GetTierer = &Object{} + _ fs.SetTierer = &Object{} ) diff --git a/backend/azureblob/azureblob_internal_test.go b/backend/azureblob/azureblob_internal_test.go index daa3b811482c3..1871fa26522dc 100644 --- a/backend/azureblob/azureblob_internal_test.go +++ b/backend/azureblob/azureblob_internal_test.go @@ -1,5 +1,5 @@ -//go:build !plan9 && !solaris && !js && go1.18 -// +build !plan9,!solaris,!js,go1.18 +//go:build !plan9 && !solaris && !js +// +build !plan9,!solaris,!js package azureblob @@ -20,17 +20,18 @@ func (f *Fs) InternalTest(t *testing.T) { func TestIncrement(t *testing.T) { for _, test := range []struct { - in []byte - want []byte + in [8]byte + want [8]byte }{ - {[]byte{0, 0, 0, 0}, []byte{1, 0, 0, 0}}, - {[]byte{0xFE, 0, 0, 0}, []byte{0xFF, 0, 0, 0}}, - {[]byte{0xFF, 0, 0, 0}, []byte{0, 1, 0, 0}}, - {[]byte{0, 1, 0, 0}, []byte{1, 1, 0, 0}}, - {[]byte{0xFF, 0xFF, 0xFF, 0xFE}, []byte{0, 0, 0, 0xFF}}, - {[]byte{0xFF, 0xFF, 0xFF, 0xFF}, []byte{0, 0, 0, 0}}, + {[8]byte{0, 0, 0, 0}, [8]byte{1, 0, 0, 0}}, + {[8]byte{0xFE, 0, 0, 0}, [8]byte{0xFF, 0, 0, 0}}, + {[8]byte{0xFF, 0, 0, 0}, [8]byte{0, 1, 0, 0}}, + {[8]byte{0, 1, 0, 0}, [8]byte{1, 1, 0, 0}}, + {[8]byte{0xFF, 0xFF, 0xFF, 0xFE}, [8]byte{0, 0, 0, 0xFF}}, + {[8]byte{0xFF, 0xFF, 0xFF, 0xFF}, [8]byte{0, 0, 0, 0, 1}}, + {[8]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, [8]byte{0, 0, 0, 0, 0, 0, 0}}, } { - increment(test.in) + increment(&test.in) assert.Equal(t, test.want, test.in) } } diff --git a/backend/azureblob/azureblob_test.go b/backend/azureblob/azureblob_test.go index fba31da8452a5..7caf512338c39 100644 --- a/backend/azureblob/azureblob_test.go +++ b/backend/azureblob/azureblob_test.go @@ -1,7 +1,7 @@ // Test AzureBlob filesystem interface -//go:build !plan9 && !solaris && !js && go1.18 -// +build !plan9,!solaris,!js,go1.18 +//go:build !plan9 && !solaris && !js +// +build !plan9,!solaris,!js package azureblob @@ -9,6 +9,7 @@ import ( "testing" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/fstest/fstests" "github.com/stretchr/testify/assert" ) @@ -18,13 +19,32 @@ func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ RemoteName: "TestAzureBlob:", NilObject: (*Object)(nil), - TiersToTest: []string{"Hot", "Cool"}, + TiersToTest: []string{"Hot", "Cool", "Cold"}, ChunkedUpload: fstests.ChunkedUploadConfig{ MinChunkSize: defaultChunkSize, }, }) } +// TestIntegration2 runs integration tests against the remote +func TestIntegration2(t *testing.T) { + if *fstest.RemoteName != "" { + t.Skip("Skipping as -remote set") + } + name := "TestAzureBlob" + fstests.Run(t, &fstests.Opt{ + RemoteName: name + ":", + NilObject: (*Object)(nil), + TiersToTest: []string{"Hot", "Cool", "Cold"}, + ChunkedUpload: fstests.ChunkedUploadConfig{ + MinChunkSize: defaultChunkSize, + }, + ExtraConfig: []fstests.ExtraConfigItem{ + {Name: name, Key: "directory_markers", Value: "true"}, + }, + }) +} + func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadChunkSize(cs) } @@ -42,6 +62,7 @@ func TestValidateAccessTier(t *testing.T) { "HOT": {"HOT", true}, "Hot": {"Hot", true}, "cool": {"cool", true}, + "cold": {"cold", true}, "archive": {"archive", true}, "empty": {"", false}, "unknown": {"unknown", false}, diff --git a/backend/azureblob/azureblob_unsupported.go b/backend/azureblob/azureblob_unsupported.go index 08d5c40630aaa..369d6e367bace 100644 --- a/backend/azureblob/azureblob_unsupported.go +++ b/backend/azureblob/azureblob_unsupported.go @@ -1,7 +1,7 @@ // Build for azureblob for unsupported platforms to stop go complaining // about "no buildable Go source files " -//go:build plan9 || solaris || js || !go1.18 -// +build plan9 solaris js !go1.18 +//go:build plan9 || solaris || js +// +build plan9 solaris js package azureblob diff --git a/backend/azurefiles/azurefiles.go b/backend/azurefiles/azurefiles.go new file mode 100644 index 0000000000000..fd8b4a06e9147 --- /dev/null +++ b/backend/azurefiles/azurefiles.go @@ -0,0 +1,1367 @@ +//go:build !plan9 && !js +// +build !plan9,!js + +// Package azurefiles provides an interface to Microsoft Azure Files +package azurefiles + +/* + TODO + + This uses LastWriteTime which seems to work. The API return also + has LastModified - needs investigation + + Needs pacer to have retries + + HTTP headers need to be passed + + Could support Metadata + + FIXME write mime type + + See FIXME markers + + Optional interfaces for Object + - ID + +*/ + +import ( + "bytes" + "context" + "crypto/md5" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path" + "strings" + "sync" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/file" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/fileerror" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/service" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/share" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/config/obscure" + "github.com/rclone/rclone/fs/fshttp" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/env" + "github.com/rclone/rclone/lib/readers" +) + +const ( + maxFileSize = 4 * fs.Tebi + defaultChunkSize = 4 * fs.Mebi + storageDefaultBaseURL = "core.windows.net" // FIXME not sure this is correct +) + +func init() { + fs.Register(&fs.RegInfo{ + Name: "azurefiles", + Description: "Microsoft Azure Files", + NewFs: NewFs, + Options: []fs.Option{{ + Name: "account", + Help: `Azure Storage Account Name. + +Set this to the Azure Storage Account Name in use. + +Leave blank to use SAS URL or connection string, otherwise it needs to be set. + +If this is blank and if env_auth is set it will be read from the +environment variable ` + "`AZURE_STORAGE_ACCOUNT_NAME`" + ` if possible. +`, + Sensitive: true, + }, { + Name: "share_name", + Help: `Azure Files Share Name. + +This is required and is the name of the share to access. +`, + }, { + Name: "env_auth", + Help: `Read credentials from runtime (environment variables, CLI or MSI). + +See the [authentication docs](/azurefiles#authentication) for full info.`, + Default: false, + }, { + Name: "key", + Help: `Storage Account Shared Key. + +Leave blank to use SAS URL or connection string.`, + Sensitive: true, + }, { + Name: "sas_url", + Help: `SAS URL. + +Leave blank if using account/key or connection string.`, + Sensitive: true, + }, { + Name: "connection_string", + Help: `Azure Files Connection String.`, + Sensitive: true, + }, { + Name: "tenant", + Help: `ID of the service principal's tenant. Also called its directory ID. + +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password +`, + Sensitive: true, + }, { + Name: "client_id", + Help: `The ID of the client in use. + +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password +`, + Sensitive: true, + }, { + Name: "client_secret", + Help: `One of the service principal's client secrets + +Set this if using +- Service principal with client secret +`, + Sensitive: true, + }, { + Name: "client_certificate_path", + Help: `Path to a PEM or PKCS12 certificate file including the private key. + +Set this if using +- Service principal with certificate +`, + }, { + Name: "client_certificate_password", + Help: `Password for the certificate file (optional). + +Optionally set this if using +- Service principal with certificate + +And the certificate has a password. +`, + IsPassword: true, + }, { + Name: "client_send_certificate_chain", + Help: `Send the certificate chain when using certificate auth. + +Specifies whether an authentication request will include an x5c header +to support subject name / issuer based authentication. When set to +true, authentication requests include the x5c header. + +Optionally set this if using +- Service principal with certificate +`, + Default: false, + Advanced: true, + }, { + Name: "username", + Help: `User name (usually an email address) + +Set this if using +- User with username and password +`, + Advanced: true, + Sensitive: true, + }, { + Name: "password", + Help: `The user's password + +Set this if using +- User with username and password +`, + IsPassword: true, + Advanced: true, + }, { + Name: "service_principal_file", + Help: `Path to file containing credentials for use with a service principal. + +Leave blank normally. Needed only if you want to use a service principal instead of interactive login. + + $ az ad sp create-for-rbac --name "" \ + --role "Storage Files Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json + +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + +**NB** this section needs updating for Azure Files - pull requests appreciated! + +It may be more convenient to put the credentials directly into the +rclone config file under the ` + "`client_id`, `tenant` and `client_secret`" + ` +keys instead of setting ` + "`service_principal_file`" + `. +`, + Advanced: true, + }, { + Name: "use_msi", + Help: `Use a managed service identity to authenticate (only works in Azure). + +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) +to authenticate to Azure Storage instead of a SAS token or account key. + +If the VM(SS) on which this program is running has a system-assigned identity, it will +be used by default. If the resource has no system-assigned but exactly one user-assigned identity, +the user-assigned identity will be used by default. If the resource has multiple user-assigned +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, +msi_client_id, or msi_mi_res_id parameters.`, + Default: false, + Advanced: true, + }, { + Name: "msi_object_id", + Help: "Object ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_client_id or msi_mi_res_id specified.", + Advanced: true, + Sensitive: true, + }, { + Name: "msi_client_id", + Help: "Object ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_object_id or msi_mi_res_id specified.", + Advanced: true, + Sensitive: true, + }, { + Name: "msi_mi_res_id", + Help: "Azure resource ID of the user-assigned MSI to use, if any.\n\nLeave blank if msi_client_id or msi_object_id specified.", + Advanced: true, + Sensitive: true, + }, { + Name: "endpoint", + Help: "Endpoint for the service.\n\nLeave blank normally.", + Advanced: true, + }, { + Name: "chunk_size", + Help: `Upload chunk size. + +Note that this is stored in memory and there may be up to +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once +in memory.`, + Default: defaultChunkSize, + Advanced: true, + }, { + Name: "upload_concurrency", + Help: `Concurrency for multipart uploads. + +This is the number of chunks of the same file that are uploaded +concurrently. + +If you are uploading small numbers of large files over high-speed +links and these uploads do not fully utilize your bandwidth, then +increasing this may help to speed up the transfers. + +Note that chunks are stored in memory and there may be up to +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once +in memory.`, + Default: 16, + Advanced: true, + }, { + Name: "max_stream_size", + Help: strings.ReplaceAll(`Max size for streamed files. + +Azure files needs to know in advance how big the file will be. When +rclone doesn't know it uses this value instead. + +This will be used when rclone is streaming data, the most common uses are: + +- Uploading files with |--vfs-cache-mode off| with |rclone mount| +- Using |rclone rcat| +- Copying files with unknown length + +You will need this much free space in the share as the file will be this size temporarily. +`, "|", "`"), + Default: 10 * fs.Gibi, + Advanced: true, + }, { + Name: config.ConfigEncoding, + Help: config.ConfigEncodingHelp, + Advanced: true, + Default: (encoder.EncodeDoubleQuote | + encoder.EncodeBackSlash | + encoder.EncodeSlash | + encoder.EncodeColon | + encoder.EncodePipe | + encoder.EncodeLtGt | + encoder.EncodeAsterisk | + encoder.EncodeQuestion | + encoder.EncodeInvalidUtf8 | + encoder.EncodeCtl | encoder.EncodeDel | + encoder.EncodeDot | encoder.EncodeRightPeriod), + }}, + }) +} + +// Options defines the configuration for this backend +type Options struct { + Account string `config:"account"` + ShareName string `config:"share_name"` + EnvAuth bool `config:"env_auth"` + Key string `config:"key"` + SASURL string `config:"sas_url"` + ConnectionString string `config:"connection_string"` + Tenant string `config:"tenant"` + ClientID string `config:"client_id"` + ClientSecret string `config:"client_secret"` + ClientCertificatePath string `config:"client_certificate_path"` + ClientCertificatePassword string `config:"client_certificate_password"` + ClientSendCertificateChain bool `config:"client_send_certificate_chain"` + Username string `config:"username"` + Password string `config:"password"` + ServicePrincipalFile string `config:"service_principal_file"` + UseMSI bool `config:"use_msi"` + MSIObjectID string `config:"msi_object_id"` + MSIClientID string `config:"msi_client_id"` + MSIResourceID string `config:"msi_mi_res_id"` + Endpoint string `config:"endpoint"` + ChunkSize fs.SizeSuffix `config:"chunk_size"` + MaxStreamSize fs.SizeSuffix `config:"max_stream_size"` + UploadConcurrency int `config:"upload_concurrency"` + Enc encoder.MultiEncoder `config:"encoding"` +} + +// Fs represents a root directory inside a share. The root directory can be "" +type Fs struct { + name string // name of this remote + root string // the path we are working on if any + opt Options // parsed config options + features *fs.Features // optional features + shareClient *share.Client // a client for the share itself + svc *directory.Client // the root service +} + +// Object describes a Azure File Share File +type Object struct { + fs *Fs // what this object is part of + remote string // The remote path + size int64 // Size of the object + md5 []byte // MD5 hash if known + modTime time.Time // The modified time of the object if known + contentType string // content type if known +} + +// Wrap the http.Transport to satisfy the Transporter interface +type transporter struct { + http.RoundTripper +} + +// Make a new transporter +func newTransporter(ctx context.Context) transporter { + return transporter{ + RoundTripper: fshttp.NewTransport(ctx), + } +} + +// Do sends the HTTP request and returns the HTTP response or error. +func (tr transporter) Do(req *http.Request) (*http.Response, error) { + return tr.RoundTripper.RoundTrip(req) +} + +type servicePrincipalCredentials struct { + AppID string `json:"appId"` + Password string `json:"password"` + Tenant string `json:"tenant"` +} + +// parseServicePrincipalCredentials unmarshals a service principal credentials JSON file as generated by az cli. +func parseServicePrincipalCredentials(ctx context.Context, credentialsData []byte) (*servicePrincipalCredentials, error) { + var spCredentials servicePrincipalCredentials + if err := json.Unmarshal(credentialsData, &spCredentials); err != nil { + return nil, fmt.Errorf("error parsing credentials from JSON file: %w", err) + } + // TODO: support certificate credentials + // Validate all fields present + if spCredentials.AppID == "" || spCredentials.Password == "" || spCredentials.Tenant == "" { + return nil, fmt.Errorf("missing fields in credentials file") + } + return &spCredentials, nil +} + +// Factored out from NewFs so that it can be tested with opt *Options and without m configmap.Mapper +func newFsFromOptions(ctx context.Context, name, root string, opt *Options) (fs.Fs, error) { + // Client options specifying our own transport + policyClientOptions := policy.ClientOptions{ + Transport: newTransporter(ctx), + } + clientOpt := service.ClientOptions{ + ClientOptions: policyClientOptions, + } + + // Here we auth by setting one of cred, sharedKeyCred or f.client + var ( + cred azcore.TokenCredential + sharedKeyCred *service.SharedKeyCredential + client *service.Client + err error + ) + switch { + case opt.EnvAuth: + // Read account from environment if needed + if opt.Account == "" { + opt.Account, _ = os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") + } + // Read credentials from the environment + options := azidentity.DefaultAzureCredentialOptions{ + ClientOptions: policyClientOptions, + } + cred, err = azidentity.NewDefaultAzureCredential(&options) + if err != nil { + return nil, fmt.Errorf("create azure environment credential failed: %w", err) + } + case opt.Account != "" && opt.Key != "": + sharedKeyCred, err = service.NewSharedKeyCredential(opt.Account, opt.Key) + if err != nil { + return nil, fmt.Errorf("create new shared key credential failed: %w", err) + } + case opt.SASURL != "": + client, err = service.NewClientWithNoCredential(opt.SASURL, &clientOpt) + if err != nil { + return nil, fmt.Errorf("unable to create SAS URL client: %w", err) + } + case opt.ConnectionString != "": + client, err = service.NewClientFromConnectionString(opt.ConnectionString, &clientOpt) + if err != nil { + return nil, fmt.Errorf("unable to create connection string client: %w", err) + } + case opt.ClientID != "" && opt.Tenant != "" && opt.ClientSecret != "": + // Service principal with client secret + options := azidentity.ClientSecretCredentialOptions{ + ClientOptions: policyClientOptions, + } + cred, err = azidentity.NewClientSecretCredential(opt.Tenant, opt.ClientID, opt.ClientSecret, &options) + if err != nil { + return nil, fmt.Errorf("error creating a client secret credential: %w", err) + } + case opt.ClientID != "" && opt.Tenant != "" && opt.ClientCertificatePath != "": + // Service principal with certificate + // + // Read the certificate + data, err := os.ReadFile(env.ShellExpand(opt.ClientCertificatePath)) + if err != nil { + return nil, fmt.Errorf("error reading client certificate file: %w", err) + } + // NewClientCertificateCredential requires at least one *x509.Certificate, and a + // crypto.PrivateKey. + // + // ParseCertificates returns these given certificate data in PEM or PKCS12 format. + // It handles common scenarios but has limitations, for example it doesn't load PEM + // encrypted private keys. + var password []byte + if opt.ClientCertificatePassword != "" { + pw, err := obscure.Reveal(opt.Password) + if err != nil { + return nil, fmt.Errorf("certificate password decode failed - did you obscure it?: %w", err) + } + password = []byte(pw) + } + certs, key, err := azidentity.ParseCertificates(data, password) + if err != nil { + return nil, fmt.Errorf("failed to parse client certificate file: %w", err) + } + options := azidentity.ClientCertificateCredentialOptions{ + ClientOptions: policyClientOptions, + SendCertificateChain: opt.ClientSendCertificateChain, + } + cred, err = azidentity.NewClientCertificateCredential( + opt.Tenant, opt.ClientID, certs, key, &options, + ) + if err != nil { + return nil, fmt.Errorf("create azure service principal with client certificate credential failed: %w", err) + } + case opt.ClientID != "" && opt.Tenant != "" && opt.Username != "" && opt.Password != "": + // User with username and password + options := azidentity.UsernamePasswordCredentialOptions{ + ClientOptions: policyClientOptions, + } + password, err := obscure.Reveal(opt.Password) + if err != nil { + return nil, fmt.Errorf("user password decode failed - did you obscure it?: %w", err) + } + cred, err = azidentity.NewUsernamePasswordCredential( + opt.Tenant, opt.ClientID, opt.Username, password, &options, + ) + if err != nil { + return nil, fmt.Errorf("authenticate user with password failed: %w", err) + } + case opt.ServicePrincipalFile != "": + // Loading service principal credentials from file. + loadedCreds, err := os.ReadFile(env.ShellExpand(opt.ServicePrincipalFile)) + if err != nil { + return nil, fmt.Errorf("error opening service principal credentials file: %w", err) + } + parsedCreds, err := parseServicePrincipalCredentials(ctx, loadedCreds) + if err != nil { + return nil, fmt.Errorf("error parsing service principal credentials file: %w", err) + } + options := azidentity.ClientSecretCredentialOptions{ + ClientOptions: policyClientOptions, + } + cred, err = azidentity.NewClientSecretCredential(parsedCreds.Tenant, parsedCreds.AppID, parsedCreds.Password, &options) + if err != nil { + return nil, fmt.Errorf("error creating a client secret credential: %w", err) + } + case opt.UseMSI: + // Specifying a user-assigned identity. Exactly one of the above IDs must be specified. + // Validate and ensure exactly one is set. (To do: better validation.) + var b2i = map[bool]int{false: 0, true: 1} + set := b2i[opt.MSIClientID != ""] + b2i[opt.MSIObjectID != ""] + b2i[opt.MSIResourceID != ""] + if set > 1 { + return nil, errors.New("more than one user-assigned identity ID is set") + } + var options azidentity.ManagedIdentityCredentialOptions + switch { + case opt.MSIClientID != "": + options.ID = azidentity.ClientID(opt.MSIClientID) + case opt.MSIObjectID != "": + // FIXME this doesn't appear to be in the new SDK? + return nil, fmt.Errorf("MSI object ID is currently unsupported") + case opt.MSIResourceID != "": + options.ID = azidentity.ResourceID(opt.MSIResourceID) + } + cred, err = azidentity.NewManagedIdentityCredential(&options) + if err != nil { + return nil, fmt.Errorf("failed to acquire MSI token: %w", err) + } + default: + return nil, errors.New("no authentication method configured") + } + + // Make the client if not already created + if client == nil { + // Work out what the endpoint is if it is still unset + if opt.Endpoint == "" { + if opt.Account == "" { + return nil, fmt.Errorf("account must be set: can't make service URL") + } + u, err := url.Parse(fmt.Sprintf("https://%s.%s", opt.Account, storageDefaultBaseURL)) + if err != nil { + return nil, fmt.Errorf("failed to make azure storage URL from account: %w", err) + } + opt.Endpoint = u.String() + } + if sharedKeyCred != nil { + // Shared key cred + client, err = service.NewClientWithSharedKeyCredential(opt.Endpoint, sharedKeyCred, &clientOpt) + if err != nil { + return nil, fmt.Errorf("create client with shared key failed: %w", err) + } + } else if cred != nil { + // Azidentity cred + client, err = service.NewClient(opt.Endpoint, cred, &clientOpt) + if err != nil { + return nil, fmt.Errorf("create client failed: %w", err) + } + } + } + if client == nil { + return nil, fmt.Errorf("internal error: auth failed to make credentials or client") + } + + shareClient := client.NewShareClient(opt.ShareName) + svc := shareClient.NewRootDirectoryClient() + f := &Fs{ + shareClient: shareClient, + svc: svc, + name: name, + root: root, + opt: *opt, + } + f.features = (&fs.Features{ + CanHaveEmptyDirectories: true, + PartialUploads: true, // files are visible as they are being uploaded + CaseInsensitive: true, + SlowHash: true, // calling Hash() generally takes an extra transaction + ReadMimeType: true, + WriteMimeType: true, + }).Fill(ctx, f) + + // Check whether a file exists at this location + _, propsErr := f.fileClient("").GetProperties(ctx, nil) + if propsErr == nil { + f.root = path.Dir(root) + return f, fs.ErrorIsFile + } + + return f, nil +} + +// NewFs constructs an Fs from the root +func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { + opt := new(Options) + err := configstruct.Set(m, opt) + if err != nil { + return nil, err + } + return newFsFromOptions(ctx, name, root, opt) +} + +// ------------------------------------------------------------ + +// Name of the remote (as passed into NewFs) +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return f.root +} + +// String converts this Fs to a string +func (f *Fs) String() string { + return fmt.Sprintf("azurefiles root '%s'", f.root) +} + +// Features returns the optional features of this Fs +func (f *Fs) Features() *fs.Features { + return f.features +} + +// Precision return the precision of this Fs +// +// One second. FileREST API times are in RFC1123 which in the example shows a precision of seconds +// Source: https://learn.microsoft.com/en-us/rest/api/storageservices/representation-of-date-time-values-in-headers +func (f *Fs) Precision() time.Duration { + return time.Second +} + +// Hashes returns the supported hash sets. +// +// MD5: since it is listed as header in the response for file properties +// Source: https://learn.microsoft.com/en-us/rest/api/storageservices/get-file-properties +func (f *Fs) Hashes() hash.Set { + return hash.NewHashSet(hash.MD5) +} + +// Encode remote and turn it into an absolute path in the share +func (f *Fs) absPath(remote string) string { + return f.opt.Enc.FromStandardPath(path.Join(f.root, remote)) +} + +// Make a directory client from the dir +func (f *Fs) dirClient(dir string) *directory.Client { + return f.svc.NewSubdirectoryClient(f.absPath(dir)) +} + +// Make a file client from the remote +func (f *Fs) fileClient(remote string) *file.Client { + return f.svc.NewFileClient(f.absPath(remote)) +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error fs.ErrorObjectNotFound. +// +// Does not return ErrorIsDir when a directory exists instead of file. since the documentation +// for [rclone.fs.Fs.NewObject] rqeuires no extra work to determine whether it is directory +// +// This initiates a network request and returns an error if object is not found. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + resp, err := f.fileClient(remote).GetProperties(ctx, nil) + if fileerror.HasCode(err, fileerror.ParentNotFound, fileerror.ResourceNotFound) { + return nil, fs.ErrorObjectNotFound + } else if err != nil { + return nil, fmt.Errorf("unable to find object remote %q: %w", remote, err) + } + + o := &Object{ + fs: f, + remote: remote, + } + o.setMetadata(&resp) + return o, nil +} + +// Make a directory using the absolute path from the root of the share +// +// This recursiely creating parent directories all the way to the root +// of the share. +func (f *Fs) absMkdir(ctx context.Context, absPath string) error { + if absPath == "" { + return nil + } + dirClient := f.svc.NewSubdirectoryClient(absPath) + + // now := time.Now() + // smbProps := &file.SMBProperties{ + // LastWriteTime: &now, + // } + // dirCreateOptions := &directory.CreateOptions{ + // FileSMBProperties: smbProps, + // } + + _, createDirErr := dirClient.Create(ctx, nil) + if fileerror.HasCode(createDirErr, fileerror.ParentNotFound) { + parentDir := path.Dir(absPath) + if parentDir == absPath { + return fmt.Errorf("internal error: infinite recursion since parent and remote are equal") + } + makeParentErr := f.absMkdir(ctx, parentDir) + if makeParentErr != nil { + return fmt.Errorf("could not make parent of %q: %w", absPath, makeParentErr) + } + return f.absMkdir(ctx, absPath) + } else if fileerror.HasCode(createDirErr, fileerror.ResourceAlreadyExists) { + return nil + } else if createDirErr != nil { + return fmt.Errorf("unable to MkDir: %w", createDirErr) + } + return nil +} + +// Mkdir creates nested directories +func (f *Fs) Mkdir(ctx context.Context, remote string) error { + return f.absMkdir(ctx, f.absPath(remote)) +} + +// Make the parent directory of remote +func (f *Fs) mkParentDir(ctx context.Context, remote string) error { + // Can't make the parent of root + if remote == "" { + return nil + } + return f.Mkdir(ctx, path.Dir(remote)) +} + +// Rmdir deletes the root folder +// +// Returns an error if it isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) error { + dirClient := f.dirClient(dir) + _, err := dirClient.Delete(ctx, nil) + if err != nil { + if fileerror.HasCode(err, fileerror.DirectoryNotEmpty) { + return fs.ErrorDirectoryNotEmpty + } else if fileerror.HasCode(err, fileerror.ResourceNotFound) { + return fs.ErrorDirNotFound + } + return fmt.Errorf("could not rmdir dir %q: %w", dir, err) + } + return nil +} + +// Put the object +// +// Copies the reader in to the new object. This new object is returned. +// +// The new object may have been created if an error is returned +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + // Temporary Object under construction + fs := &Object{ + fs: f, + remote: src.Remote(), + } + return fs, fs.Update(ctx, in, src, options...) +} + +// PutStream uploads to the remote path with the modTime given of indeterminate size +func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + return f.Put(ctx, in, src, options...) +} + +// List the objects and directories in dir into entries. The entries can be +// returned in any order but should be for a complete directory. +// +// dir should be "" to list the root, and should not have trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't found. +func (f *Fs) List(ctx context.Context, dir string) (fs.DirEntries, error) { + var entries fs.DirEntries + subDirClient := f.dirClient(dir) + + // Checking whether directory exists + _, err := subDirClient.GetProperties(ctx, nil) + if fileerror.HasCode(err, fileerror.ParentNotFound, fileerror.ResourceNotFound) { + return entries, fs.ErrorDirNotFound + } else if err != nil { + return entries, err + } + + var opt = &directory.ListFilesAndDirectoriesOptions{ + Include: directory.ListFilesInclude{ + Timestamps: true, + }, + } + pager := subDirClient.NewListFilesAndDirectoriesPager(opt) + for pager.More() { + resp, err := pager.NextPage(ctx) + if err != nil { + return entries, err + } + for _, directory := range resp.Segment.Directories { + // Name *string `xml:"Name"` + // Attributes *string `xml:"Attributes"` + // ID *string `xml:"FileId"` + // PermissionKey *string `xml:"PermissionKey"` + // Properties.ContentLength *int64 `xml:"Content-Length"` + // Properties.ChangeTime *time.Time `xml:"ChangeTime"` + // Properties.CreationTime *time.Time `xml:"CreationTime"` + // Properties.ETag *azcore.ETag `xml:"Etag"` + // Properties.LastAccessTime *time.Time `xml:"LastAccessTime"` + // Properties.LastModified *time.Time `xml:"Last-Modified"` + // Properties.LastWriteTime *time.Time `xml:"LastWriteTime"` + var modTime time.Time + if directory.Properties.LastWriteTime != nil { + modTime = *directory.Properties.LastWriteTime + } + leaf := f.opt.Enc.ToStandardPath(*directory.Name) + entry := fs.NewDir(path.Join(dir, leaf), modTime) + if directory.ID != nil { + entry.SetID(*directory.ID) + } + if directory.Properties.ContentLength != nil { + entry.SetSize(*directory.Properties.ContentLength) + } + entries = append(entries, entry) + } + for _, file := range resp.Segment.Files { + leaf := f.opt.Enc.ToStandardPath(*file.Name) + entry := &Object{ + fs: f, + remote: path.Join(dir, leaf), + } + if file.Properties.ContentLength != nil { + entry.size = *file.Properties.ContentLength + } + if file.Properties.LastWriteTime != nil { + entry.modTime = *file.Properties.LastWriteTime + } + entries = append(entries, entry) + } + } + return entries, nil +} + +// ------------------------------------------------------------ + +// Fs returns the parent Fs +func (o *Object) Fs() fs.Info { + return o.fs +} + +// Size of object in bytes +func (o *Object) Size() int64 { + return o.size +} + +// Return a string version +func (o *Object) String() string { + if o == nil { + return "" + } + return o.remote +} + +// Remote returns the remote path +func (o *Object) Remote() string { + return o.remote +} + +// fileClient makes a specialized client for this object +func (o *Object) fileClient() *file.Client { + return o.fs.fileClient(o.remote) +} + +// set the metadata from file.GetPropertiesResponse +func (o *Object) setMetadata(resp *file.GetPropertiesResponse) { + if resp.ContentLength != nil { + o.size = *resp.ContentLength + } + o.md5 = resp.ContentMD5 + if resp.FileLastWriteTime != nil { + o.modTime = *resp.FileLastWriteTime + } + if resp.ContentType != nil { + o.contentType = *resp.ContentType + } +} + +// readMetaData gets the metadata if it hasn't already been fetched +func (o *Object) getMetadata(ctx context.Context) error { + resp, err := o.fileClient().GetProperties(ctx, nil) + if err != nil { + return fmt.Errorf("failed to fetch properties: %w", err) + } + o.setMetadata(&resp) + return nil +} + +// Hash returns the MD5 of an object returning a lowercase hex string +// +// May make a network request becaue the [fs.List] method does not +// return MD5 hashes for DirEntry +func (o *Object) Hash(ctx context.Context, ty hash.Type) (string, error) { + if ty != hash.MD5 { + return "", hash.ErrUnsupported + } + if len(o.md5) == 0 { + err := o.getMetadata(ctx) + if err != nil { + return "", err + } + } + return hex.EncodeToString(o.md5), nil +} + +// MimeType returns the content type of the Object if +// known, or "" if not +func (o *Object) MimeType(ctx context.Context) string { + if o.contentType == "" { + err := o.getMetadata(ctx) + if err != nil { + fs.Errorf(o, "Failed to fetch Content-Type") + } + } + return o.contentType +} + +// Storable returns a boolean showing whether this object storable +func (o *Object) Storable() bool { + return true +} + +// ModTime returns the modification time of the object +// +// Returns time.Now() if not present +func (o *Object) ModTime(ctx context.Context) time.Time { + if o.modTime.IsZero() { + return time.Now() + } + return o.modTime +} + +// SetModTime sets the modification time +func (o *Object) SetModTime(ctx context.Context, t time.Time) error { + opt := file.SetHTTPHeadersOptions{ + SMBProperties: &file.SMBProperties{ + LastWriteTime: &t, + }, + } + _, err := o.fileClient().SetHTTPHeaders(ctx, &opt) + if err != nil { + return fmt.Errorf("unable to set modTime: %w", err) + } + o.modTime = t + return nil +} + +// Remove an object +func (o *Object) Remove(ctx context.Context) error { + if _, err := o.fileClient().Delete(ctx, nil); err != nil { + return fmt.Errorf("unable to delete remote %q: %w", o.remote, err) + } + return nil +} + +// Open an object for read +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + // Offset and Count for range download + var offset int64 + var count int64 + fs.FixRangeOption(options, o.size) + for _, option := range options { + switch x := option.(type) { + case *fs.RangeOption: + offset, count = x.Decode(o.size) + if count < 0 { + count = o.size - offset + } + case *fs.SeekOption: + offset = x.Offset + default: + if option.Mandatory() { + fs.Logf(o, "Unsupported mandatory option: %v", option) + } + } + } + opt := file.DownloadStreamOptions{ + Range: file.HTTPRange{ + Offset: offset, + Count: count, + }, + } + resp, err := o.fileClient().DownloadStream(ctx, &opt) + if err != nil { + return nil, fmt.Errorf("could not open remote %q: %w", o.remote, err) + } + return resp.Body, nil +} + +// Returns a pointer to t - useful for returning pointers to constants +func ptr[T any](t T) *T { + return &t +} + +var warnStreamUpload sync.Once + +// Update the object with the contents of the io.Reader, modTime, size and MD5 hash +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + var ( + size = src.Size() + sizeUnknown = false + hashUnknown = true + fc = o.fileClient() + isNewlyCreated = o.modTime.IsZero() + counter *readers.CountingReader + md5Hash []byte + hasher = md5.New() + ) + + if size > int64(maxFileSize) { + return fmt.Errorf("update: max supported file size is %vB. provided size is %vB", maxFileSize, fs.SizeSuffix(size)) + } else if size < 0 { + size = int64(o.fs.opt.MaxStreamSize) + sizeUnknown = true + warnStreamUpload.Do(func() { + fs.Logf(o.fs, "Streaming uploads will have maximum file size of %v - adjust with --azurefiles-max-stream-size", o.fs.opt.MaxStreamSize) + }) + } + + if isNewlyCreated { + // Make parent directory + if mkDirErr := o.fs.mkParentDir(ctx, src.Remote()); mkDirErr != nil { + return fmt.Errorf("update: unable to make parent directories: %w", mkDirErr) + } + // Create the file at the size given + if _, createErr := fc.Create(ctx, size, nil); createErr != nil { + return fmt.Errorf("update: unable to create file: %w", createErr) + } + } else { + // Resize the file if needed + if size != o.Size() { + if _, resizeErr := fc.Resize(ctx, size, nil); resizeErr != nil { + return fmt.Errorf("update: unable to resize while trying to update: %w ", resizeErr) + } + } + } + + // Measure the size if it is unknown + if sizeUnknown { + counter = readers.NewCountingReader(in) + in = counter + } + + // Check we have a source MD5 hash... + if hashStr, err := src.Hash(ctx, hash.MD5); err == nil && hashStr != "" { + md5Hash, err = hex.DecodeString(hashStr) + if err == nil { + hashUnknown = false + } else { + fs.Errorf(o, "internal error: decoding hex encoded md5 %q: %v", hashStr, err) + } + } + + // ...if not calculate one + if hashUnknown { + in = io.TeeReader(in, hasher) + } + + // Upload the file + opt := file.UploadStreamOptions{ + ChunkSize: int64(o.fs.opt.ChunkSize), + Concurrency: o.fs.opt.UploadConcurrency, + } + if err := fc.UploadStream(ctx, in, &opt); err != nil { + // Remove partially uploaded file on error + if isNewlyCreated { + if _, delErr := fc.Delete(ctx, nil); delErr != nil { + fs.Errorf(o, "failed to delete partially uploaded file: %v", delErr) + } + } + return fmt.Errorf("update: failed to upload stream: %w", err) + } + + if sizeUnknown { + // Read the uploaded size - the file will be truncated to that size by updateSizeHashModTime + size = int64(counter.BytesRead()) + } + if hashUnknown { + md5Hash = hasher.Sum(nil) + } + + // Update the properties + modTime := src.ModTime(ctx) + contentType := fs.MimeType(ctx, src) + httpHeaders := file.HTTPHeaders{ + ContentMD5: md5Hash, + ContentType: &contentType, + } + // Apply upload options (also allows one to overwrite content-type) + for _, option := range options { + key, value := option.Header() + lowerKey := strings.ToLower(key) + switch lowerKey { + case "cache-control": + httpHeaders.CacheControl = &value + case "content-disposition": + httpHeaders.ContentDisposition = &value + case "content-encoding": + httpHeaders.ContentEncoding = &value + case "content-language": + httpHeaders.ContentLanguage = &value + case "content-type": + httpHeaders.ContentType = &value + } + } + _, err = fc.SetHTTPHeaders(ctx, &file.SetHTTPHeadersOptions{ + FileContentLength: &size, + SMBProperties: &file.SMBProperties{ + LastWriteTime: &modTime, + }, + HTTPHeaders: &httpHeaders, + }) + if err != nil { + return fmt.Errorf("update: failed to set properties: %w", err) + } + + // Make sure Object is in sync + o.size = size + o.md5 = md5Hash + o.modTime = modTime + o.contentType = contentType + return nil +} + +// Move src to this remote using server-side move operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantMove +func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't move - not same remote type") + return nil, fs.ErrorCantMove + } + err := f.mkParentDir(ctx, remote) + if err != nil { + return nil, fmt.Errorf("Move: mkParentDir failed: %w", err) + } + opt := file.RenameOptions{ + IgnoreReadOnly: ptr(true), + ReplaceIfExists: ptr(true), + } + dstAbsPath := f.absPath(remote) + fc := srcObj.fileClient() + _, err = fc.Rename(ctx, dstAbsPath, &opt) + if err != nil { + return nil, fmt.Errorf("Move: Rename failed: %w", err) + } + dstObj, err := f.NewObject(ctx, remote) + if err != nil { + return nil, fmt.Errorf("Move: NewObject failed: %w", err) + } + return dstObj, nil +} + +// DirMove moves src, srcRemote to this remote at dstRemote +// using server-side move operations. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantDirMove +// +// If destination exists then return fs.ErrorDirExists +func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error { + dstFs := f + srcFs, ok := src.(*Fs) + if !ok { + fs.Debugf(srcFs, "Can't move directory - not same remote type") + return fs.ErrorCantDirMove + } + + _, err := dstFs.dirClient(dstRemote).GetProperties(ctx, nil) + if err == nil { + return fs.ErrorDirExists + } + if !fileerror.HasCode(err, fileerror.ParentNotFound, fileerror.ResourceNotFound) { + return fmt.Errorf("DirMove: failed to get status of destination directory: %w", err) + } + + err = dstFs.mkParentDir(ctx, dstRemote) + if err != nil { + return fmt.Errorf("DirMove: mkParentDir failed: %w", err) + } + + opt := directory.RenameOptions{ + IgnoreReadOnly: ptr(false), + ReplaceIfExists: ptr(false), + } + dstAbsPath := dstFs.absPath(dstRemote) + dirClient := srcFs.dirClient(srcRemote) + _, err = dirClient.Rename(ctx, dstAbsPath, &opt) + if err != nil { + if fileerror.HasCode(err, fileerror.ResourceAlreadyExists) { + return fs.ErrorDirExists + } + return fmt.Errorf("DirMove: Rename failed: %w", err) + } + return nil +} + +// Copy src to this remote using server-side copy operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantCopy +func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't copy - not same remote type") + return nil, fs.ErrorCantCopy + } + err := f.mkParentDir(ctx, remote) + if err != nil { + return nil, fmt.Errorf("Copy: mkParentDir failed: %w", err) + } + opt := file.StartCopyFromURLOptions{ + CopyFileSMBInfo: &file.CopyFileSMBInfo{ + Attributes: file.SourceCopyFileAttributes{}, + ChangeTime: file.SourceCopyFileChangeTime{}, + CreationTime: file.SourceCopyFileCreationTime{}, + LastWriteTime: file.SourceCopyFileLastWriteTime{}, + PermissionCopyMode: ptr(file.PermissionCopyModeTypeSource), + IgnoreReadOnly: ptr(true), + }, + } + srcURL := srcObj.fileClient().URL() + fc := f.fileClient(remote) + _, err = fc.StartCopyFromURL(ctx, srcURL, &opt) + if err != nil { + return nil, fmt.Errorf("Copy failed: %w", err) + } + dstObj, err := f.NewObject(ctx, remote) + if err != nil { + return nil, fmt.Errorf("Copy: NewObject failed: %w", err) + } + return dstObj, nil +} + +// Implementation of WriterAt +type writerAt struct { + ctx context.Context + f *Fs + fc *file.Client + mu sync.Mutex // protects variables below + size int64 +} + +// Adaptor to add a Close method to bytes.Reader +type bytesReaderCloser struct { + *bytes.Reader +} + +// Close the bytesReaderCloser +func (bytesReaderCloser) Close() error { + return nil +} + +// WriteAt writes len(p) bytes from p to the underlying data stream +// at offset off. It returns the number of bytes written from p (0 <= n <= len(p)) +// and any error encountered that caused the write to stop early. +// WriteAt must return a non-nil error if it returns n < len(p). +// +// If WriteAt is writing to a destination with a seek offset, +// WriteAt should not affect nor be affected by the underlying +// seek offset. +// +// Clients of WriteAt can execute parallel WriteAt calls on the same +// destination if the ranges do not overlap. +// +// Implementations must not retain p. +func (w *writerAt) WriteAt(p []byte, off int64) (n int, err error) { + endOffset := off + int64(len(p)) + w.mu.Lock() + if w.size < endOffset { + _, err = w.fc.Resize(w.ctx, endOffset, nil) + if err != nil { + w.mu.Unlock() + return 0, fmt.Errorf("WriteAt: failed to resize file: %w ", err) + } + w.size = endOffset + } + w.mu.Unlock() + + in := bytesReaderCloser{bytes.NewReader(p)} + _, err = w.fc.UploadRange(w.ctx, off, in, nil) + if err != nil { + return 0, err + } + return len(p), nil +} + +// Close the writer +func (w *writerAt) Close() error { + // FIXME should we be doing something here? + return nil +} + +// OpenWriterAt opens with a handle for random access writes +// +// Pass in the remote desired and the size if known. +// +// It truncates any existing object +func (f *Fs) OpenWriterAt(ctx context.Context, remote string, size int64) (fs.WriterAtCloser, error) { + err := f.mkParentDir(ctx, remote) + if err != nil { + return nil, fmt.Errorf("OpenWriterAt: failed to create parent directory: %w", err) + } + fc := f.fileClient(remote) + if size < 0 { + size = 0 + } + _, err = fc.Create(ctx, size, nil) + if err != nil { + return nil, fmt.Errorf("OpenWriterAt: unable to create file: %w", err) + } + w := &writerAt{ + ctx: ctx, + f: f, + fc: fc, + size: size, + } + return w, nil +} + +// About gets quota information +func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { + stats, err := f.shareClient.GetStatistics(ctx, nil) + if err != nil { + return nil, fmt.Errorf("failed to read share statistics: %w", err) + } + usage := &fs.Usage{ + Used: stats.ShareUsageBytes, // bytes in use + } + return usage, nil +} + +// Check the interfaces are satisfied +var ( + _ fs.Fs = &Fs{} + _ fs.PutStreamer = &Fs{} + _ fs.Abouter = &Fs{} + _ fs.Mover = &Fs{} + _ fs.DirMover = &Fs{} + _ fs.Copier = &Fs{} + _ fs.OpenWriterAter = &Fs{} + _ fs.Object = &Object{} + _ fs.MimeTyper = &Object{} +) diff --git a/backend/azurefiles/azurefiles_internal_test.go b/backend/azurefiles/azurefiles_internal_test.go new file mode 100644 index 0000000000000..b123ad73002c4 --- /dev/null +++ b/backend/azurefiles/azurefiles_internal_test.go @@ -0,0 +1,70 @@ +//go:build !plan9 && !js +// +build !plan9,!js + +package azurefiles + +import ( + "context" + "math/rand" + "strings" + "testing" + + "github.com/rclone/rclone/fstest/fstests" + "github.com/stretchr/testify/assert" +) + +func (f *Fs) InternalTest(t *testing.T) { + t.Run("Authentication", f.InternalTestAuth) +} + +var _ fstests.InternalTester = (*Fs)(nil) + +func (f *Fs) InternalTestAuth(t *testing.T) { + t.Skip("skipping since this requires authentication credentials which are not part of repo") + shareName := "test-rclone-oct-2023" + testCases := []struct { + name string + options *Options + }{ + { + name: "ConnectionString", + options: &Options{ + ShareName: shareName, + ConnectionString: "", + }, + }, + { + name: "AccountAndKey", + options: &Options{ + ShareName: shareName, + Account: "", + Key: "", + }}, + { + name: "SASUrl", + options: &Options{ + ShareName: shareName, + SASURL: "", + }}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + fs, err := newFsFromOptions(context.TODO(), "TestAzureFiles", "", tc.options) + assert.NoError(t, err) + dirName := randomString(10) + assert.NoError(t, fs.Mkdir(context.TODO(), dirName)) + }) + } +} + +const chars = "abcdefghijklmnopqrstuvwzyxABCDEFGHIJKLMNOPQRSTUVWZYX" + +func randomString(charCount int) string { + strBldr := strings.Builder{} + for i := 0; i < charCount; i++ { + randPos := rand.Int63n(52) + strBldr.WriteByte(chars[randPos]) + } + return strBldr.String() +} diff --git a/backend/azurefiles/azurefiles_test.go b/backend/azurefiles/azurefiles_test.go new file mode 100644 index 0000000000000..d8091fa499701 --- /dev/null +++ b/backend/azurefiles/azurefiles_test.go @@ -0,0 +1,18 @@ +//go:build !plan9 && !js +// +build !plan9,!js + +package azurefiles + +import ( + "testing" + + "github.com/rclone/rclone/fstest/fstests" +) + +func TestIntegration(t *testing.T) { + var objPtr *Object + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestAzureFiles:", + NilObject: objPtr, + }) +} diff --git a/backend/azurefiles/azurefiles_unsupported.go b/backend/azurefiles/azurefiles_unsupported.go new file mode 100644 index 0000000000000..1674e8f201068 --- /dev/null +++ b/backend/azurefiles/azurefiles_unsupported.go @@ -0,0 +1,7 @@ +// Build for azurefiles for unsupported platforms to stop go complaining +// about "no buildable Go source files " + +//go:build plan9 || js +// +build plan9 js + +package azurefiles diff --git a/backend/b2/api/types.go b/backend/b2/api/types.go index 4d981d950daec..b2aa1a7fb6f90 100644 --- a/backend/b2/api/types.go +++ b/backend/b2/api/types.go @@ -33,10 +33,18 @@ var _ fserrors.Fataler = (*Error)(nil) // Bucket describes a B2 bucket type Bucket struct { - ID string `json:"bucketId"` - AccountID string `json:"accountId"` - Name string `json:"bucketName"` - Type string `json:"bucketType"` + ID string `json:"bucketId"` + AccountID string `json:"accountId"` + Name string `json:"bucketName"` + Type string `json:"bucketType"` + LifecycleRules []LifecycleRule `json:"lifecycleRules,omitempty"` +} + +// LifecycleRule is a single lifecycle rule +type LifecycleRule struct { + DaysFromHidingToDeleting *int `json:"daysFromHidingToDeleting"` + DaysFromUploadingToHiding *int `json:"daysFromUploadingToHiding"` + FileNamePrefix string `json:"fileNamePrefix"` } // Timestamp is a UTC time when this file was uploaded. It is a base @@ -206,9 +214,10 @@ type FileInfo struct { // CreateBucketRequest is used to create a bucket type CreateBucketRequest struct { - AccountID string `json:"accountId"` - Name string `json:"bucketName"` - Type string `json:"bucketType"` + AccountID string `json:"accountId"` + Name string `json:"bucketName"` + Type string `json:"bucketType"` + LifecycleRules []LifecycleRule `json:"lifecycleRules,omitempty"` } // DeleteBucketRequest is used to create a bucket @@ -331,3 +340,11 @@ type CopyPartRequest struct { PartNumber int64 `json:"partNumber"` // Which part this is (starting from 1) Range string `json:"range,omitempty"` // The range of bytes to copy. If not provided, the whole source file will be copied. } + +// UpdateBucketRequest describes a request to modify a B2 bucket +type UpdateBucketRequest struct { + ID string `json:"bucketId"` + AccountID string `json:"accountId"` + Type string `json:"bucketType,omitempty"` + LifecycleRules []LifecycleRule `json:"lifecycleRules,omitempty"` +} diff --git a/backend/b2/b2.go b/backend/b2/b2.go index aa0a80e7b66e5..778d856f187df 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -9,6 +9,7 @@ import ( "bytes" "context" "crypto/sha1" + "encoding/json" "errors" "fmt" gohash "hash" @@ -32,6 +33,7 @@ import ( "github.com/rclone/rclone/fs/walk" "github.com/rclone/rclone/lib/bucket" "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/multipart" "github.com/rclone/rclone/lib/pacer" "github.com/rclone/rclone/lib/pool" "github.com/rclone/rclone/lib/rest" @@ -57,9 +59,7 @@ const ( minChunkSize = 5 * fs.Mebi defaultChunkSize = 96 * fs.Mebi defaultUploadCutoff = 200 * fs.Mebi - largeFileCopyCutoff = 4 * fs.Gibi // 5E9 is the max - memoryPoolFlushTime = fs.Duration(time.Minute) // flush the cached buffers after this long - memoryPoolUseMmap = false + largeFileCopyCutoff = 4 * fs.Gibi // 5E9 is the max ) // Globals @@ -74,14 +74,17 @@ func init() { Name: "b2", Description: "Backblaze B2", NewFs: NewFs, + CommandHelp: commandHelp, Options: []fs.Option{{ - Name: "account", - Help: "Account ID or Application Key ID.", - Required: true, + Name: "account", + Help: "Account ID or Application Key ID.", + Required: true, + Sensitive: true, }, { - Name: "key", - Help: "Application Key.", - Required: true, + Name: "key", + Help: "Application Key.", + Required: true, + Sensitive: true, }, { Name: "endpoint", Help: "Endpoint for the service.\n\nLeave blank normally.", @@ -147,6 +150,18 @@ might a maximum of "--transfers" chunks in progress at once. 5,000,000 Bytes is the minimum size.`, Default: defaultChunkSize, Advanced: true, + }, { + Name: "upload_concurrency", + Help: `Concurrency for multipart uploads. + +This is the number of chunks of the same file that are uploaded +concurrently. + +Note that chunks are stored in memory and there may be up to +"--transfers" * "--b2-upload-concurrency" chunks stored at once +in memory.`, + Default: 4, + Advanced: true, }, { Name: "disable_checksum", Help: `Disable checksums for large (> upload cutoff) files. @@ -186,16 +201,41 @@ The minimum value is 1 second. The maximum value is one week.`, Advanced: true, }, { Name: "memory_pool_flush_time", - Default: memoryPoolFlushTime, + Default: fs.Duration(time.Minute), Advanced: true, - Help: `How often internal memory buffer pools will be flushed. -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool.`, + Hide: fs.OptionHideBoth, + Help: `How often internal memory buffer pools will be flushed. (no longer used)`, }, { Name: "memory_pool_use_mmap", - Default: memoryPoolUseMmap, + Default: false, + Advanced: true, + Hide: fs.OptionHideBoth, + Help: `Whether to use mmap buffers in internal memory pool. (no longer used)`, + }, { + Name: "lifecycle", + Help: `Set the number of days deleted files should be kept when creating a bucket. + +On bucket creation, this parameter is used to create a lifecycle rule +for the entire bucket. + +If lifecycle is 0 (the default) it does not create a lifecycle rule so +the default B2 behaviour applies. This is to create versions of files +on delete and overwrite and to keep them indefinitely. + +If lifecycle is >0 then it creates a single rule setting the number of +days before a file that is deleted or overwritten is deleted +permanently. This is known as daysFromHidingToDeleting in the b2 docs. + +The minimum value for this parameter is 1 day. + +You can also enable hard_delete in the config also which will mean +deletions won't cause versions but overwrites will still cause +versions to be made. + +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. +`, + Default: 0, Advanced: true, - Help: `Whether to use mmap buffers in internal memory pool.`, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -222,11 +262,11 @@ type Options struct { UploadCutoff fs.SizeSuffix `config:"upload_cutoff"` CopyCutoff fs.SizeSuffix `config:"copy_cutoff"` ChunkSize fs.SizeSuffix `config:"chunk_size"` + UploadConcurrency int `config:"upload_concurrency"` DisableCheckSum bool `config:"disable_checksum"` DownloadURL string `config:"download_url"` DownloadAuthorizationDuration fs.Duration `config:"download_auth_duration"` - MemoryPoolFlushTime fs.Duration `config:"memory_pool_flush_time"` - MemoryPoolUseMmap bool `config:"memory_pool_use_mmap"` + Lifecycle int `config:"lifecycle"` Enc encoder.MultiEncoder `config:"encoding"` } @@ -251,7 +291,6 @@ type Fs struct { authMu sync.Mutex // lock for authorizing the account pacer *fs.Pacer // To pace and retry the API calls uploadToken *pacer.TokenDispenser // control concurrency - pool *pool.Pool // memory pool } // Object describes a b2 object @@ -361,11 +400,18 @@ func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (b // errorHandler parses a non 2xx error response into an error func errorHandler(resp *http.Response) error { - // Decode error response - errResponse := new(api.Error) - err := rest.DecodeJSON(resp, &errResponse) + body, err := rest.ReadBody(resp) if err != nil { - fs.Debugf(nil, "Couldn't decode error response: %v", err) + fs.Errorf(nil, "Couldn't read error out of body: %v", err) + body = nil + } + // Decode error response if there was one - they can be blank + errResponse := new(api.Error) + if len(body) > 0 { + err = json.Unmarshal(body, errResponse) + if err != nil { + fs.Errorf(nil, "Couldn't decode error response: %v", err) + } } if errResponse.Code == "" { errResponse.Code = "unknown" @@ -409,6 +455,14 @@ func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { return } +func (f *Fs) setCopyCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + err = checkUploadChunkSize(cs) + if err == nil { + old, f.opt.CopyCutoff = f.opt.CopyCutoff, cs + } + return +} + // setRoot changes the root of the Fs func (f *Fs) setRoot(root string) { f.root = parsePath(root) @@ -456,19 +510,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e uploads: make(map[string][]*api.GetUploadURLResponse), pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), uploadToken: pacer.NewTokenDispenser(ci.Transfers), - pool: pool.New( - time.Duration(opt.MemoryPoolFlushTime), - int(opt.ChunkSize), - ci.Transfers, - opt.MemoryPoolUseMmap, - ), } f.setRoot(root) f.features = (&fs.Features{ - ReadMimeType: true, - WriteMimeType: true, - BucketBased: true, - BucketBasedRootOK: true, + ReadMimeType: true, + WriteMimeType: true, + BucketBased: true, + BucketBasedRootOK: true, + ChunkWriterDoesntSeek: true, }).Fill(ctx, f) // Set the test flag if required if opt.TestMode != "" { @@ -595,23 +644,24 @@ func (f *Fs) clearUploadURL(bucketID string) { f.uploadMu.Unlock() } -// getBuf gets a buffer of f.opt.ChunkSize and an upload token +// getRW gets a RW buffer and an upload token // // If noBuf is set then it just gets an upload token -func (f *Fs) getBuf(noBuf bool) (buf []byte) { +func (f *Fs) getRW(noBuf bool) (rw *pool.RW) { f.uploadToken.Get() if !noBuf { - buf = f.pool.Get() + rw = multipart.NewRW() } - return buf + return rw } -// putBuf returns a buffer to the memory pool and an upload token +// putRW returns a RW buffer to the memory pool and returns an upload +// token // -// If noBuf is set then it just returns the upload token -func (f *Fs) putBuf(buf []byte, noBuf bool) { - if !noBuf { - f.pool.Put(buf) +// If buf is nil then it just returns the upload token +func (f *Fs) putRW(rw *pool.RW) { + if rw != nil { + _ = rw.Close() } f.uploadToken.Put() } @@ -818,7 +868,7 @@ func (f *Fs) listDir(ctx context.Context, bucket, directory, prefix string, addB // listBuckets returns all the buckets to out func (f *Fs) listBuckets(ctx context.Context) (entries fs.DirEntries, err error) { - err = f.listBucketsToFn(ctx, func(bucket *api.Bucket) error { + err = f.listBucketsToFn(ctx, "", func(bucket *api.Bucket) error { d := fs.NewDir(bucket.Name, time.Time{}) entries = append(entries, d) return nil @@ -911,11 +961,14 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( type listBucketFn func(*api.Bucket) error // listBucketsToFn lists the buckets to the function supplied -func (f *Fs) listBucketsToFn(ctx context.Context, fn listBucketFn) error { +func (f *Fs) listBucketsToFn(ctx context.Context, bucketName string, fn listBucketFn) error { var account = api.ListBucketsRequest{ AccountID: f.info.AccountID, BucketID: f.info.Allowed.BucketID, } + if bucketName != "" && account.BucketID == "" { + account.BucketName = f.opt.Enc.FromStandardName(bucketName) + } var response api.ListBucketsResponse opts := rest.Opts{ @@ -961,7 +1014,7 @@ func (f *Fs) getbucketType(ctx context.Context, bucket string) (bucketType strin if bucketType != "" { return bucketType, nil } - err = f.listBucketsToFn(ctx, func(bucket *api.Bucket) error { + err = f.listBucketsToFn(ctx, bucket, func(bucket *api.Bucket) error { // listBucketsToFn reads bucket Types return nil }) @@ -996,7 +1049,7 @@ func (f *Fs) getBucketID(ctx context.Context, bucket string) (bucketID string, e if bucketID != "" { return bucketID, nil } - err = f.listBucketsToFn(ctx, func(bucket *api.Bucket) error { + err = f.listBucketsToFn(ctx, bucket, func(bucket *api.Bucket) error { // listBucketsToFn sets IDs return nil }) @@ -1060,6 +1113,11 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) error { Name: f.opt.Enc.FromStandardName(bucket), Type: "allPrivate", } + if f.opt.Lifecycle > 0 { + request.LifecycleRules = []api.LifecycleRule{{ + DaysFromHidingToDeleting: &f.opt.Lifecycle, + }} + } var response api.Bucket err := f.pacer.Call(func() (bool, error) { resp, err := f.srv.CallJSON(ctx, &opts, &request, &response) @@ -1280,7 +1338,7 @@ func (f *Fs) CleanUp(ctx context.Context) error { // If newInfo is nil then the metadata will be copied otherwise it // will be replaced with newInfo func (f *Fs) copy(ctx context.Context, dstObj *Object, srcObj *Object, newInfo *api.File) (err error) { - if srcObj.size >= int64(f.opt.CopyCutoff) { + if srcObj.size > int64(f.opt.CopyCutoff) { if newInfo == nil { newInfo, err = srcObj.getMetaData(ctx) if err != nil { @@ -1291,7 +1349,11 @@ func (f *Fs) copy(ctx context.Context, dstObj *Object, srcObj *Object, newInfo * if err != nil { return err } - return up.Upload(ctx) + err = up.Copy(ctx) + if err != nil { + return err + } + return dstObj.decodeMetaDataFileInfo(up.info) } dstBucket, dstPath := dstObj.split() @@ -1420,7 +1482,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, if err != nil { return "", err } - absPath := "/" + bucketPath + absPath := "/" + urlEncode(bucketPath) link = RootURL + "/file/" + urlEncode(bucket) + absPath bucketType, err := f.getbucketType(ctx, bucket) if err != nil { @@ -1859,11 +1921,11 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if err != nil { return err } - if size == -1 { + if size < 0 { // Check if the file is large enough for a chunked upload (needs to be at least two chunks) - buf := o.fs.getBuf(false) + rw := o.fs.getRW(false) - n, err := io.ReadFull(in, buf) + n, err := io.CopyN(rw, in, int64(o.fs.opt.ChunkSize)) if err == nil { bufReader := bufio.NewReader(in) in = bufReader @@ -1874,26 +1936,34 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op fs.Debugf(o, "File is big enough for chunked streaming") up, err := o.fs.newLargeUpload(ctx, o, in, src, o.fs.opt.ChunkSize, false, nil) if err != nil { - o.fs.putBuf(buf, false) + o.fs.putRW(rw) return err } // NB Stream returns the buffer and token - return up.Stream(ctx, buf) - } else if err == io.EOF || err == io.ErrUnexpectedEOF { + err = up.Stream(ctx, rw) + if err != nil { + return err + } + return o.decodeMetaDataFileInfo(up.info) + } else if err == io.EOF { fs.Debugf(o, "File has %d bytes, which makes only one chunk. Using direct upload.", n) - defer o.fs.putBuf(buf, false) - size = int64(n) - in = bytes.NewReader(buf[:n]) + defer o.fs.putRW(rw) + size = n + in = rw } else { - o.fs.putBuf(buf, false) + o.fs.putRW(rw) return err } } else if size > int64(o.fs.opt.UploadCutoff) { - up, err := o.fs.newLargeUpload(ctx, o, in, src, o.fs.opt.ChunkSize, false, nil) + chunkWriter, err := multipart.UploadMultipart(ctx, src, in, multipart.UploadMultipartOptions{ + Open: o.fs, + OpenOptions: options, + }) if err != nil { return err } - return up.Upload(ctx) + up := chunkWriter.(*largeUpload) + return o.decodeMetaDataFileInfo(up.info) } modTime := src.ModTime(ctx) @@ -2001,6 +2071,41 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return o.decodeMetaDataFileInfo(&response) } +// OpenChunkWriter returns the chunk size and a ChunkWriter +// +// Pass in the remote and the src object +// You can also use options to hint at the desired chunk size +func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectInfo, options ...fs.OpenOption) (info fs.ChunkWriterInfo, writer fs.ChunkWriter, err error) { + // FIXME what if file is smaller than 1 chunk? + if f.opt.Versions { + return info, nil, errNotWithVersions + } + if f.opt.VersionAt.IsSet() { + return info, nil, errNotWithVersionAt + } + //size := src.Size() + + // Temporary Object under construction + o := &Object{ + fs: f, + remote: remote, + } + + bucket, _ := o.split() + err = f.makeBucket(ctx, bucket) + if err != nil { + return info, nil, err + } + + info = fs.ChunkWriterInfo{ + ChunkSize: int64(f.opt.ChunkSize), + Concurrency: o.fs.opt.UploadConcurrency, + //LeavePartsOnError: o.fs.opt.LeavePartsOnError, + } + up, err := f.newLargeUpload(ctx, o, nil, src, f.opt.ChunkSize, false, nil) + return info, up, err +} + // Remove an object func (o *Object) Remove(ctx context.Context) error { bucket, bucketPath := o.split() @@ -2026,16 +2131,149 @@ func (o *Object) ID() string { return o.id } +var lifecycleHelp = fs.CommandHelp{ + Name: "lifecycle", + Short: "Read or set the lifecycle for a bucket", + Long: `This command can be used to read or set the lifecycle for a bucket. + +Usage Examples: + +To show the current lifecycle rules: + + rclone backend lifecycle b2:bucket + +This will dump something like this showing the lifecycle rules. + + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] + +If there are no lifecycle rules (the default) then it will just return []. + +To reset the current lifecycle rules: + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 + +This will run and then print the new lifecycle rules as above. + +Rclone only lets you set lifecycles for the whole bucket with the +fileNamePrefix = "". + +You can't disable versioning with B2. The best you can do is to set +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in +the config also which will mean deletions won't cause versions but +overwrites will still cause versions to be made. + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 + +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules +`, + Opts: map[string]string{ + "daysFromHidingToDeleting": "After a file has been hidden for this many days it is deleted. 0 is off.", + "daysFromUploadingToHiding": "This many days after uploading a file is hidden", + }, +} + +func (f *Fs) lifecycleCommand(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error) { + var newRule api.LifecycleRule + if daysStr := opt["daysFromHidingToDeleting"]; daysStr != "" { + days, err := strconv.Atoi(daysStr) + if err != nil { + return nil, fmt.Errorf("bad daysFromHidingToDeleting: %w", err) + } + newRule.DaysFromHidingToDeleting = &days + } + if daysStr := opt["daysFromUploadingToHiding"]; daysStr != "" { + days, err := strconv.Atoi(daysStr) + if err != nil { + return nil, fmt.Errorf("bad daysFromUploadingToHiding: %w", err) + } + newRule.DaysFromUploadingToHiding = &days + } + bucketName, _ := f.split("") + if bucketName == "" { + return nil, errors.New("bucket required") + + } + + var bucket *api.Bucket + if newRule.DaysFromHidingToDeleting != nil || newRule.DaysFromUploadingToHiding != nil { + bucketID, err := f.getBucketID(ctx, bucketName) + if err != nil { + return nil, err + } + opts := rest.Opts{ + Method: "POST", + Path: "/b2_update_bucket", + } + var request = api.UpdateBucketRequest{ + ID: bucketID, + AccountID: f.info.AccountID, + LifecycleRules: []api.LifecycleRule{newRule}, + } + var response api.Bucket + err = f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, &request, &response) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, err + } + bucket = &response + } else { + err = f.listBucketsToFn(ctx, bucketName, func(b *api.Bucket) error { + bucket = b + return nil + }) + if err != nil { + return nil, err + } + } + if bucket == nil { + return nil, fs.ErrorDirNotFound + } + return bucket.LifecycleRules, nil +} + +var commandHelp = []fs.CommandHelp{ + lifecycleHelp, +} + +// Command the backend to run a named command +// +// The command run is name +// args may be used to read arguments from +// opts may be used to read optional arguments from +// +// The result should be capable of being JSON encoded +// If it is a string or a []string it will be shown to the user +// otherwise it will be JSON encoded and shown to the user like that +func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error) { + switch name { + case "lifecycle": + return f.lifecycleCommand(ctx, name, arg, opt) + default: + return nil, fs.ErrorCommandNotFound + } +} + // Check the interfaces are satisfied var ( - _ fs.Fs = &Fs{} - _ fs.Purger = &Fs{} - _ fs.Copier = &Fs{} - _ fs.PutStreamer = &Fs{} - _ fs.CleanUpper = &Fs{} - _ fs.ListRer = &Fs{} - _ fs.PublicLinker = &Fs{} - _ fs.Object = &Object{} - _ fs.MimeTyper = &Object{} - _ fs.IDer = &Object{} + _ fs.Fs = &Fs{} + _ fs.Purger = &Fs{} + _ fs.Copier = &Fs{} + _ fs.PutStreamer = &Fs{} + _ fs.CleanUpper = &Fs{} + _ fs.ListRer = &Fs{} + _ fs.PublicLinker = &Fs{} + _ fs.OpenChunkWriter = &Fs{} + _ fs.Commander = &Fs{} + _ fs.Object = &Object{} + _ fs.MimeTyper = &Object{} + _ fs.IDer = &Object{} ) diff --git a/backend/b2/b2_internal_test.go b/backend/b2/b2_internal_test.go index 74072d552d0f2..8253ca167754c 100644 --- a/backend/b2/b2_internal_test.go +++ b/backend/b2/b2_internal_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/rclone/rclone/fstest" + "github.com/rclone/rclone/fstest/fstests" ) // Test b2 string encoding @@ -168,3 +169,10 @@ func TestParseTimeString(t *testing.T) { } } + +// -run TestIntegration/FsMkdir/FsPutFiles/Internal +func (f *Fs) InternalTest(t *testing.T) { + // Internal tests go here +} + +var _ fstests.InternalTester = (*Fs)(nil) diff --git a/backend/b2/b2_test.go b/backend/b2/b2_test.go index 6437d2adc3799..43e28e5b1ab9c 100644 --- a/backend/b2/b2_test.go +++ b/backend/b2/b2_test.go @@ -28,7 +28,12 @@ func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadCutoff(cs) } +func (f *Fs) SetCopyCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setCopyCutoff(cs) +} + var ( _ fstests.SetUploadChunkSizer = (*Fs)(nil) _ fstests.SetUploadCutoffer = (*Fs)(nil) + _ fstests.SetCopyCutoffer = (*Fs)(nil) ) diff --git a/backend/b2/upload.go b/backend/b2/upload.go index cdf8dbef041e5..777852b1a502f 100644 --- a/backend/b2/upload.go +++ b/backend/b2/upload.go @@ -5,7 +5,6 @@ package b2 import ( - "bytes" "context" "crypto/sha1" "encoding/hex" @@ -14,7 +13,6 @@ import ( "io" "strings" "sync" - "time" "github.com/rclone/rclone/backend/b2/api" "github.com/rclone/rclone/fs" @@ -80,12 +78,14 @@ type largeUpload struct { wrap accounting.WrapFn // account parts being transferred id string // ID of the file being uploaded size int64 // total size - parts int64 // calculated number of parts, if known + parts int // calculated number of parts, if known + sha1smu sync.Mutex // mutex to protect sha1s sha1s []string // slice of SHA1s for each part uploadMu sync.Mutex // lock for upload variable uploads []*api.GetUploadPartURLResponse // result of get upload URL calls chunkSize int64 // chunk size to use src *Object // if copying, object we are reading from + info *api.FileInfo // final response with info about the object } // newLargeUpload starts an upload of object o from in with metadata in src @@ -93,18 +93,16 @@ type largeUpload struct { // If newInfo is set then metadata from that will be used instead of reading it from src func (f *Fs) newLargeUpload(ctx context.Context, o *Object, in io.Reader, src fs.ObjectInfo, defaultChunkSize fs.SizeSuffix, doCopy bool, newInfo *api.File) (up *largeUpload, err error) { size := src.Size() - parts := int64(0) - sha1SliceSize := int64(maxParts) + parts := 0 chunkSize := defaultChunkSize if size == -1 { fs.Debugf(o, "Streaming upload with --b2-chunk-size %s allows uploads of up to %s and will fail only when that limit is reached.", f.opt.ChunkSize, maxParts*f.opt.ChunkSize) } else { chunkSize = chunksize.Calculator(o, size, maxParts, defaultChunkSize) - parts = size / int64(chunkSize) + parts = int(size / int64(chunkSize)) if size%int64(chunkSize) != 0 { parts++ } - sha1SliceSize = parts } opts := rest.Opts{ @@ -152,7 +150,7 @@ func (f *Fs) newLargeUpload(ctx context.Context, o *Object, in io.Reader, src fs id: response.ID, size: size, parts: parts, - sha1s: make([]string, sha1SliceSize), + sha1s: make([]string, 0, 16), chunkSize: int64(chunkSize), } // unwrap the accounting from the input, we use wrap to put it @@ -171,24 +169,26 @@ func (f *Fs) newLargeUpload(ctx context.Context, o *Object, in io.Reader, src fs // This should be returned with returnUploadURL when finished func (up *largeUpload) getUploadURL(ctx context.Context) (upload *api.GetUploadPartURLResponse, err error) { up.uploadMu.Lock() - defer up.uploadMu.Unlock() - if len(up.uploads) == 0 { - opts := rest.Opts{ - Method: "POST", - Path: "/b2_get_upload_part_url", - } - var request = api.GetUploadPartURLRequest{ - ID: up.id, - } - err := up.f.pacer.Call(func() (bool, error) { - resp, err := up.f.srv.CallJSON(ctx, &opts, &request, &upload) - return up.f.shouldRetry(ctx, resp, err) - }) - if err != nil { - return nil, fmt.Errorf("failed to get upload URL: %w", err) - } - } else { + if len(up.uploads) > 0 { upload, up.uploads = up.uploads[0], up.uploads[1:] + up.uploadMu.Unlock() + return upload, nil + } + up.uploadMu.Unlock() + + opts := rest.Opts{ + Method: "POST", + Path: "/b2_get_upload_part_url", + } + var request = api.GetUploadPartURLRequest{ + ID: up.id, + } + err = up.f.pacer.Call(func() (bool, error) { + resp, err := up.f.srv.CallJSON(ctx, &opts, &request, &upload) + return up.f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to get upload URL: %w", err) } return upload, nil } @@ -203,10 +203,39 @@ func (up *largeUpload) returnUploadURL(upload *api.GetUploadPartURLResponse) { up.uploadMu.Unlock() } -// Transfer a chunk -func (up *largeUpload) transferChunk(ctx context.Context, part int64, body []byte) error { - err := up.f.pacer.Call(func() (bool, error) { - fs.Debugf(up.o, "Sending chunk %d length %d", part, len(body)) +// Add an sha1 to the being built up sha1s +func (up *largeUpload) addSha1(chunkNumber int, sha1 string) { + up.sha1smu.Lock() + defer up.sha1smu.Unlock() + if len(up.sha1s) < chunkNumber+1 { + up.sha1s = append(up.sha1s, make([]string, chunkNumber+1-len(up.sha1s))...) + } + up.sha1s[chunkNumber] = sha1 +} + +// WriteChunk will write chunk number with reader bytes, where chunk number >= 0 +func (up *largeUpload) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (size int64, err error) { + // Only account after the checksum reads have been done + if do, ok := reader.(pool.DelayAccountinger); ok { + // To figure out this number, do a transfer and if the accounted size is 0 or a + // multiple of what it should be, increase or decrease this number. + do.DelayAccounting(1) + } + + err = up.f.pacer.Call(func() (bool, error) { + // Discover the size by seeking to the end + size, err = reader.Seek(0, io.SeekEnd) + if err != nil { + return false, err + } + + // rewind the reader on retry and after reading size + _, err = reader.Seek(0, io.SeekStart) + if err != nil { + return false, err + } + + fs.Debugf(up.o, "Sending chunk %d length %d", chunkNumber, size) // Get upload URL upload, err := up.getUploadURL(ctx) @@ -214,8 +243,8 @@ func (up *largeUpload) transferChunk(ctx context.Context, part int64, body []byt return false, err } - in := newHashAppendingReader(bytes.NewReader(body), sha1.New()) - size := int64(len(body)) + int64(in.AdditionalLength()) + in := newHashAppendingReader(reader, sha1.New()) + sizeWithHash := size + int64(in.AdditionalLength()) // Authorization // @@ -245,10 +274,10 @@ func (up *largeUpload) transferChunk(ctx context.Context, part int64, body []byt Body: up.wrap(in), ExtraHeaders: map[string]string{ "Authorization": upload.AuthorizationToken, - "X-Bz-Part-Number": fmt.Sprintf("%d", part), + "X-Bz-Part-Number": fmt.Sprintf("%d", chunkNumber+1), sha1Header: "hex_digits_at_end", }, - ContentLength: &size, + ContentLength: &sizeWithHash, } var response api.UploadPartResponse @@ -256,7 +285,7 @@ func (up *largeUpload) transferChunk(ctx context.Context, part int64, body []byt resp, err := up.f.srv.CallJSON(ctx, &opts, nil, &response) retry, err := up.f.shouldRetry(ctx, resp, err) if err != nil { - fs.Debugf(up.o, "Error sending chunk %d (retry=%v): %v: %#v", part, retry, err, err) + fs.Debugf(up.o, "Error sending chunk %d (retry=%v): %v: %#v", chunkNumber, retry, err, err) } // On retryable error clear PartUploadURL if retry { @@ -264,30 +293,30 @@ func (up *largeUpload) transferChunk(ctx context.Context, part int64, body []byt upload = nil } up.returnUploadURL(upload) - up.sha1s[part-1] = in.HexSum() + up.addSha1(chunkNumber, in.HexSum()) return retry, err }) if err != nil { - fs.Debugf(up.o, "Error sending chunk %d: %v", part, err) + fs.Debugf(up.o, "Error sending chunk %d: %v", chunkNumber, err) } else { - fs.Debugf(up.o, "Done sending chunk %d", part) + fs.Debugf(up.o, "Done sending chunk %d", chunkNumber) } - return err + return size, err } // Copy a chunk -func (up *largeUpload) copyChunk(ctx context.Context, part int64, partSize int64) error { +func (up *largeUpload) copyChunk(ctx context.Context, part int, partSize int64) error { err := up.f.pacer.Call(func() (bool, error) { fs.Debugf(up.o, "Copying chunk %d length %d", part, partSize) opts := rest.Opts{ Method: "POST", Path: "/b2_copy_part", } - offset := (part - 1) * up.chunkSize // where we are in the source file + offset := int64(part) * up.chunkSize // where we are in the source file var request = api.CopyPartRequest{ SourceID: up.src.id, LargeFileID: up.id, - PartNumber: part, + PartNumber: int64(part + 1), Range: fmt.Sprintf("bytes=%d-%d", offset, offset+partSize-1), } var response api.UploadPartResponse @@ -296,7 +325,7 @@ func (up *largeUpload) copyChunk(ctx context.Context, part int64, partSize int64 if err != nil { fs.Debugf(up.o, "Error copying chunk %d (retry=%v): %v: %#v", part, retry, err, err) } - up.sha1s[part-1] = response.SHA1 + up.addSha1(part, response.SHA1) return retry, err }) if err != nil { @@ -307,8 +336,8 @@ func (up *largeUpload) copyChunk(ctx context.Context, part int64, partSize int64 return err } -// finish closes off the large upload -func (up *largeUpload) finish(ctx context.Context) error { +// Close closes off the large upload +func (up *largeUpload) Close(ctx context.Context) error { fs.Debugf(up.o, "Finishing large file %s with %d parts", up.what, up.parts) opts := rest.Opts{ Method: "POST", @@ -326,11 +355,12 @@ func (up *largeUpload) finish(ctx context.Context) error { if err != nil { return err } - return up.o.decodeMetaDataFileInfo(&response) + up.info = &response + return nil } -// cancel aborts the large upload -func (up *largeUpload) cancel(ctx context.Context) error { +// Abort aborts the large upload +func (up *largeUpload) Abort(ctx context.Context) error { fs.Debugf(up.o, "Cancelling large file %s", up.what) opts := rest.Opts{ Method: "POST", @@ -355,157 +385,105 @@ func (up *largeUpload) cancel(ctx context.Context) error { // reaches EOF. // // Note that initialUploadBlock must be returned to f.putBuf() -func (up *largeUpload) Stream(ctx context.Context, initialUploadBlock []byte) (err error) { - defer atexit.OnError(&err, func() { _ = up.cancel(ctx) })() +func (up *largeUpload) Stream(ctx context.Context, initialUploadBlock *pool.RW) (err error) { + defer atexit.OnError(&err, func() { _ = up.Abort(ctx) })() fs.Debugf(up.o, "Starting streaming of large file (id %q)", up.id) var ( g, gCtx = errgroup.WithContext(ctx) hasMoreParts = true ) - up.size = int64(len(initialUploadBlock)) - g.Go(func() error { - for part := int64(1); hasMoreParts; part++ { - // Get a block of memory from the pool and token which limits concurrency. - var buf []byte - if part == 1 { - buf = initialUploadBlock - } else { - buf = up.f.getBuf(false) - } + up.size = initialUploadBlock.Size() + up.parts = 0 + for part := 0; hasMoreParts; part++ { + // Get a block of memory from the pool and token which limits concurrency. + var rw *pool.RW + if part == 0 { + rw = initialUploadBlock + } else { + rw = up.f.getRW(false) + } - // Fail fast, in case an errgroup managed function returns an error - // gCtx is cancelled. There is no point in uploading all the other parts. - if gCtx.Err() != nil { - up.f.putBuf(buf, false) - return nil - } + // Fail fast, in case an errgroup managed function returns an error + // gCtx is cancelled. There is no point in uploading all the other parts. + if gCtx.Err() != nil { + up.f.putRW(rw) + break + } - // Read the chunk - var n int - if part == 1 { - n = len(buf) - } else { - n, err = io.ReadFull(up.in, buf) - if err == io.ErrUnexpectedEOF { - fs.Debugf(up.o, "Read less than a full chunk, making this the last one.") - buf = buf[:n] - hasMoreParts = false - } else if err == io.EOF { - fs.Debugf(up.o, "Could not read any more bytes, previous chunk was the last.") - up.f.putBuf(buf, false) - return nil - } else if err != nil { - // other kinds of errors indicate failure - up.f.putBuf(buf, false) - return err + // Read the chunk + var n int64 + if part == 0 { + n = rw.Size() + } else { + n, err = io.CopyN(rw, up.in, up.chunkSize) + if err == io.EOF { + if n == 0 { + fs.Debugf(up.o, "Not sending empty chunk after EOF - ending.") + up.f.putRW(rw) + break + } else { + fs.Debugf(up.o, "Read less than a full chunk %d, making this the last one.", n) } + hasMoreParts = false + } else if err != nil { + // other kinds of errors indicate failure + up.f.putRW(rw) + return err } + } - // Keep stats up to date - up.parts = part - up.size += int64(n) - if part > maxParts { - up.f.putBuf(buf, false) - return fmt.Errorf("%q too big (%d bytes so far) makes too many parts %d > %d - increase --b2-chunk-size", up.o, up.size, up.parts, maxParts) - } - - part := part // for the closure - g.Go(func() (err error) { - defer up.f.putBuf(buf, false) - return up.transferChunk(gCtx, part, buf) - }) + // Keep stats up to date + up.parts += 1 + up.size += n + if part > maxParts { + up.f.putRW(rw) + return fmt.Errorf("%q too big (%d bytes so far) makes too many parts %d > %d - increase --b2-chunk-size", up.o, up.size, up.parts, maxParts) } - return nil - }) + + part := part // for the closure + g.Go(func() (err error) { + defer up.f.putRW(rw) + _, err = up.WriteChunk(gCtx, part, rw) + return err + }) + } err = g.Wait() if err != nil { return err } - up.sha1s = up.sha1s[:up.parts] - return up.finish(ctx) + return up.Close(ctx) } -// Upload uploads the chunks from the input -func (up *largeUpload) Upload(ctx context.Context) (err error) { - defer atexit.OnError(&err, func() { _ = up.cancel(ctx) })() +// Copy the chunks from the source to the destination +func (up *largeUpload) Copy(ctx context.Context) (err error) { + defer atexit.OnError(&err, func() { _ = up.Abort(ctx) })() fs.Debugf(up.o, "Starting %s of large file in %d chunks (id %q)", up.what, up.parts, up.id) var ( - g, gCtx = errgroup.WithContext(ctx) - remaining = up.size - uploadPool *pool.Pool - ci = fs.GetConfig(ctx) + g, gCtx = errgroup.WithContext(ctx) + remaining = up.size ) - // If using large chunk size then make a temporary pool - if up.chunkSize <= int64(up.f.opt.ChunkSize) { - uploadPool = up.f.pool - } else { - uploadPool = pool.New( - time.Duration(up.f.opt.MemoryPoolFlushTime), - int(up.chunkSize), - ci.Transfers, - up.f.opt.MemoryPoolUseMmap, - ) - defer uploadPool.Flush() - } - // Get an upload token and a buffer - getBuf := func() (buf []byte) { - up.f.getBuf(true) - if !up.doCopy { - buf = uploadPool.Get() + g.SetLimit(up.f.opt.UploadConcurrency) + for part := 0; part < up.parts; part++ { + // Fail fast, in case an errgroup managed function returns an error + // gCtx is cancelled. There is no point in copying all the other parts. + if gCtx.Err() != nil { + break } - return buf - } - // Put an upload token and a buffer - putBuf := func(buf []byte) { - if !up.doCopy { - uploadPool.Put(buf) - } - up.f.putBuf(nil, true) - } - g.Go(func() error { - for part := int64(1); part <= up.parts; part++ { - // Get a block of memory from the pool and token which limits concurrency. - buf := getBuf() - - // Fail fast, in case an errgroup managed function returns an error - // gCtx is cancelled. There is no point in uploading all the other parts. - if gCtx.Err() != nil { - putBuf(buf) - return nil - } - - reqSize := remaining - if reqSize >= up.chunkSize { - reqSize = up.chunkSize - } - - if !up.doCopy { - // Read the chunk - buf = buf[:reqSize] - _, err = io.ReadFull(up.in, buf) - if err != nil { - putBuf(buf) - return err - } - } - part := part // for the closure - g.Go(func() (err error) { - defer putBuf(buf) - if !up.doCopy { - err = up.transferChunk(gCtx, part, buf) - } else { - err = up.copyChunk(gCtx, part, reqSize) - } - return err - }) - remaining -= reqSize + reqSize := remaining + if reqSize >= up.chunkSize { + reqSize = up.chunkSize } - return nil - }) + + part := part // for the closure + g.Go(func() (err error) { + return up.copyChunk(gCtx, part, reqSize) + }) + remaining -= reqSize + } err = g.Wait() if err != nil { return err } - return up.finish(ctx) + return up.Close(ctx) } diff --git a/backend/box/api/types.go b/backend/box/api/types.go index 6ff87761c25bc..275dea9502ad7 100644 --- a/backend/box/api/types.go +++ b/backend/box/api/types.go @@ -52,7 +52,7 @@ func (e *Error) Error() string { out += ": " + e.Message } if e.ContextInfo != nil { - out += fmt.Sprintf(" (%+v)", e.ContextInfo) + out += fmt.Sprintf(" (%s)", string(e.ContextInfo)) } return out } @@ -63,7 +63,7 @@ var _ error = (*Error)(nil) // ItemFields are the fields needed for FileInfo var ItemFields = "type,id,sequence_id,etag,sha1,name,size,created_at,modified_at,content_created_at,content_modified_at,item_status,shared_link,owned_by" -// Types of things in Item +// Types of things in Item/ItemMini const ( ItemTypeFolder = "folder" ItemTypeFile = "file" @@ -72,20 +72,31 @@ const ( ItemStatusDeleted = "deleted" ) +// ItemMini is a subset of the elements in a full Item returned by some API calls +type ItemMini struct { + Type string `json:"type"` + ID string `json:"id"` + SequenceID int64 `json:"sequence_id,string"` + Etag string `json:"etag"` + SHA1 string `json:"sha1"` + Name string `json:"name"` +} + // Item describes a folder or a file as returned by Get Folder Items and others type Item struct { - Type string `json:"type"` - ID string `json:"id"` - SequenceID string `json:"sequence_id"` - Etag string `json:"etag"` - SHA1 string `json:"sha1"` - Name string `json:"name"` - Size float64 `json:"size"` // box returns this in xEyy format for very large numbers - see #2261 - CreatedAt Time `json:"created_at"` - ModifiedAt Time `json:"modified_at"` - ContentCreatedAt Time `json:"content_created_at"` - ContentModifiedAt Time `json:"content_modified_at"` - ItemStatus string `json:"item_status"` // active, trashed if the file has been moved to the trash, and deleted if the file has been permanently deleted + Type string `json:"type"` + ID string `json:"id"` + SequenceID int64 `json:"sequence_id,string"` + Etag string `json:"etag"` + SHA1 string `json:"sha1"` + Name string `json:"name"` + Size float64 `json:"size"` // box returns this in xEyy format for very large numbers - see #2261 + CreatedAt Time `json:"created_at"` + ModifiedAt Time `json:"modified_at"` + ContentCreatedAt Time `json:"content_created_at"` + ContentModifiedAt Time `json:"content_modified_at"` + ItemStatus string `json:"item_status"` // active, trashed if the file has been moved to the trash, and deleted if the file has been permanently deleted + Parent ItemMini `json:"parent"` SharedLink struct { URL string `json:"url,omitempty"` Access string `json:"access,omitempty"` @@ -156,19 +167,7 @@ type PreUploadCheckResponse struct { // PreUploadCheckConflict is returned in the ContextInfo error field // from PreUploadCheck when the error code is "item_name_in_use" type PreUploadCheckConflict struct { - Conflicts struct { - Type string `json:"type"` - ID string `json:"id"` - FileVersion struct { - Type string `json:"type"` - ID string `json:"id"` - Sha1 string `json:"sha1"` - } `json:"file_version"` - SequenceID string `json:"sequence_id"` - Etag string `json:"etag"` - Sha1 string `json:"sha1"` - Name string `json:"name"` - } `json:"conflicts"` + Conflicts ItemMini `json:"conflicts"` } // UpdateFileModTime is used in Update File Info @@ -281,3 +280,30 @@ type User struct { Address string `json:"address"` AvatarURL string `json:"avatar_url"` } + +// FileTreeChangeEventTypes are the events that can require cache invalidation +var FileTreeChangeEventTypes = map[string]struct{}{ + "ITEM_COPY": {}, + "ITEM_CREATE": {}, + "ITEM_MAKE_CURRENT_VERSION": {}, + "ITEM_MODIFY": {}, + "ITEM_MOVE": {}, + "ITEM_RENAME": {}, + "ITEM_TRASH": {}, + "ITEM_UNDELETE_VIA_TRASH": {}, + "ITEM_UPLOAD": {}, +} + +// Event is an array element in the response returned from /events +type Event struct { + EventType string `json:"event_type"` + EventID string `json:"event_id"` + Source Item `json:"source"` +} + +// Events is returned from /events +type Events struct { + ChunkSize int64 `json:"chunk_size"` + Entries []Event `json:"entries"` + NextStreamPosition int64 `json:"next_stream_position"` +} diff --git a/backend/box/box.go b/backend/box/box.go index e0cfbed07d6bf..26e2cb35642de 100644 --- a/backend/box/box.go +++ b/backend/box/box.go @@ -27,6 +27,7 @@ import ( "sync/atomic" "time" + "github.com/golang-jwt/jwt/v4" "github.com/rclone/rclone/backend/box/api" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config" @@ -45,7 +46,6 @@ import ( "github.com/rclone/rclone/lib/rest" "github.com/youmark/pkcs8" "golang.org/x/oauth2" - "golang.org/x/oauth2/jws" ) const ( @@ -76,6 +76,11 @@ var ( } ) +type boxCustomClaims struct { + jwt.StandardClaims + BoxSubType string `json:"box_sub_type,omitempty"` +} + // Register with Fs func init() { fs.Register(&fs.RegInfo{ @@ -102,16 +107,18 @@ func init() { return nil, nil }, Options: append(oauthutil.SharedOptions, []fs.Option{{ - Name: "root_folder_id", - Help: "Fill in for rclone to use a non root folder as its starting point.", - Default: "0", - Advanced: true, + Name: "root_folder_id", + Help: "Fill in for rclone to use a non root folder as its starting point.", + Default: "0", + Advanced: true, + Sensitive: true, }, { Name: "box_config_file", Help: "Box App config.json location\n\nLeave blank normally." + env.ShellExpandHelp, }, { - Name: "access_token", - Help: "Box App Primary Access Token\n\nLeave blank normally.", + Name: "access_token", + Help: "Box App Primary Access Token\n\nLeave blank normally.", + Sensitive: true, }, { Name: "box_sub_type", Default: "user", @@ -142,6 +149,23 @@ func init() { Default: "", Help: "Only show items owned by the login (email address) passed in.", Advanced: true, + }, { + Name: "impersonate", + Default: "", + Help: `Impersonate this user ID when using a service account. + +Setting this flag allows rclone, when using a JWT service account, to +act on behalf of another user by setting the as-user header. + +The user ID is the Box identifier for a user. User IDs can found for +any user via the GET /users endpoint, which is only available to +admins, or by calling the GET /users/me endpoint with an authenticated +user session. + +See: https://developer.box.com/guides/authentication/jwt/as-user/ +`, + Advanced: true, + Sensitive: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -178,7 +202,7 @@ func refreshJWTToken(ctx context.Context, jsonFile string, boxSubType string, na signingHeaders := getSigningHeaders(boxConfig) queryParams := getQueryParams(boxConfig) client := fshttp.NewClient(ctx) - err = jwtutil.Config("box", name, claims, signingHeaders, queryParams, privateKey, m, client) + err = jwtutil.Config("box", name, tokenURL, *claims, signingHeaders, queryParams, privateKey, m, client) return err } @@ -194,34 +218,31 @@ func getBoxConfig(configFile string) (boxConfig *api.ConfigJSON, err error) { return boxConfig, nil } -func getClaims(boxConfig *api.ConfigJSON, boxSubType string) (claims *jws.ClaimSet, err error) { +func getClaims(boxConfig *api.ConfigJSON, boxSubType string) (claims *boxCustomClaims, err error) { val, err := jwtutil.RandomHex(20) if err != nil { return nil, fmt.Errorf("box: failed to generate random string for jti: %w", err) } - claims = &jws.ClaimSet{ - Iss: boxConfig.BoxAppSettings.ClientID, - Sub: boxConfig.EnterpriseID, - Aud: tokenURL, - Exp: time.Now().Add(time.Second * 45).Unix(), - PrivateClaims: map[string]interface{}{ - "box_sub_type": boxSubType, - "aud": tokenURL, - "jti": val, + claims = &boxCustomClaims{ + //lint:ignore SA1019 since we need to use jwt.StandardClaims even if deprecated in jwt-go v4 until a more permanent solution is ready in time before jwt-go v5 where it is removed entirely + //nolint:staticcheck // Don't include staticcheck when running golangci-lint to avoid SA1019 + StandardClaims: jwt.StandardClaims{ + Id: val, + Issuer: boxConfig.BoxAppSettings.ClientID, + Subject: boxConfig.EnterpriseID, + Audience: tokenURL, + ExpiresAt: time.Now().Add(time.Second * 45).Unix(), }, + BoxSubType: boxSubType, } - return claims, nil } -func getSigningHeaders(boxConfig *api.ConfigJSON) *jws.Header { - signingHeaders := &jws.Header{ - Algorithm: "RS256", - Typ: "JWT", - KeyID: boxConfig.BoxAppSettings.AppAuth.PublicKeyID, +func getSigningHeaders(boxConfig *api.ConfigJSON) map[string]interface{} { + signingHeaders := map[string]interface{}{ + "kid": boxConfig.BoxAppSettings.AppAuth.PublicKeyID, } - return signingHeaders } @@ -258,19 +279,29 @@ type Options struct { AccessToken string `config:"access_token"` ListChunk int `config:"list_chunk"` OwnedBy string `config:"owned_by"` + Impersonate string `config:"impersonate"` +} + +// ItemMeta defines metadata we cache for each Item ID +type ItemMeta struct { + SequenceID int64 // the most recent event processed for this item + ParentID string // ID of the parent directory of this item + Name string // leaf name of this item } // Fs represents a remote box type Fs struct { - name string // name of this remote - root string // the path we are working on - opt Options // parsed options - features *fs.Features // optional features - srv *rest.Client // the connection to the server - dirCache *dircache.DirCache // Map of directory path to directory id - pacer *fs.Pacer // pacer for API calls - tokenRenewer *oauthutil.Renew // renew the token on expiry - uploadToken *pacer.TokenDispenser // control concurrency + name string // name of this remote + root string // the path we are working on + opt Options // parsed options + features *fs.Features // optional features + srv *rest.Client // the connection to the server + dirCache *dircache.DirCache // Map of directory path to directory id + pacer *fs.Pacer // pacer for API calls + tokenRenewer *oauthutil.Renew // renew the token on expiry + uploadToken *pacer.TokenDispenser // control concurrency + itemMetaCacheMu *sync.Mutex // protects itemMetaCache + itemMetaCache map[string]ItemMeta // map of Item ID to selected metadata } // Object describes a box object @@ -349,7 +380,7 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, err // readMetaDataForPath reads the metadata from the path func (f *Fs) readMetaDataForPath(ctx context.Context, path string) (info *api.Item, err error) { - // defer fs.Trace(f, "path=%q", path)("info=%+v, err=%v", &info, &err) + // defer log.Trace(f, "path=%q", path)("info=%+v, err=%v", &info, &err) leaf, directoryID, err := f.dirCache.FindPath(ctx, path, false) if err != nil { if err == fs.ErrorDirNotFound { @@ -358,20 +389,30 @@ func (f *Fs) readMetaDataForPath(ctx context.Context, path string) (info *api.It return nil, err } - found, err := f.listAll(ctx, directoryID, false, true, true, func(item *api.Item) bool { - if strings.EqualFold(item.Name, leaf) { - info = item - return true - } - return false - }) + // Use preupload to find the ID + itemMini, err := f.preUploadCheck(ctx, leaf, directoryID, -1) if err != nil { return nil, err } - if !found { + if itemMini == nil { return nil, fs.ErrorObjectNotFound } - return info, nil + + // Now we have the ID we can look up the object proper + opts := rest.Opts{ + Method: "GET", + Path: "/files/" + itemMini.ID, + Parameters: fieldsValue(), + } + var item api.Item + err = f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, nil, &item) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, err + } + return &item, nil } // errorHandler parses a non 2xx error response into an error @@ -418,12 +459,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e ci := fs.GetConfig(ctx) f := &Fs{ - name: name, - root: root, - opt: *opt, - srv: rest.NewClient(client).SetRoot(rootURL), - pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), - uploadToken: pacer.NewTokenDispenser(ci.Transfers), + name: name, + root: root, + opt: *opt, + srv: rest.NewClient(client).SetRoot(rootURL), + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + uploadToken: pacer.NewTokenDispenser(ci.Transfers), + itemMetaCacheMu: new(sync.Mutex), + itemMetaCache: make(map[string]ItemMeta), } f.features = (&fs.Features{ CaseInsensitive: true, @@ -436,6 +479,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e f.srv.SetHeader("Authorization", "Bearer "+f.opt.AccessToken) } + // If using impersonate set an as-user header + if f.opt.Impersonate != "" { + f.srv.SetHeader("as-user", f.opt.Impersonate) + } + jsonFile, ok := m.Get("box_config_file") boxSubType, boxSubTypeOk := m.Get("box_sub_type") @@ -678,6 +726,17 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e } entries = append(entries, o) } + + // Cache some metadata for this Item to help us process events later + // on. In particular, the box event API does not provide the old path + // of the Item when it is renamed/deleted/moved/etc. + f.itemMetaCacheMu.Lock() + cachedItemMeta, found := f.itemMetaCache[info.ID] + if !found || cachedItemMeta.SequenceID < info.SequenceID { + f.itemMetaCache[info.ID] = ItemMeta{SequenceID: info.SequenceID, ParentID: directoryID, Name: info.Name} + } + f.itemMetaCacheMu.Unlock() + return false }) if err != nil { @@ -713,7 +772,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // // It returns "", nil if the file is good to go // It returns "ID", nil if the file must be updated -func (f *Fs) preUploadCheck(ctx context.Context, leaf, directoryID string, size int64) (ID string, err error) { +func (f *Fs) preUploadCheck(ctx context.Context, leaf, directoryID string, size int64) (item *api.ItemMini, err error) { check := api.PreUploadCheck{ Name: f.opt.Enc.FromStandardName(leaf), Parent: api.Parent{ @@ -738,16 +797,16 @@ func (f *Fs) preUploadCheck(ctx context.Context, leaf, directoryID string, size var conflict api.PreUploadCheckConflict err = json.Unmarshal(apiErr.ContextInfo, &conflict) if err != nil { - return "", fmt.Errorf("pre-upload check: JSON decode failed: %w", err) + return nil, fmt.Errorf("pre-upload check: JSON decode failed: %w", err) } if conflict.Conflicts.Type != api.ItemTypeFile { - return "", fmt.Errorf("pre-upload check: can't overwrite non file with file: %w", err) + return nil, fs.ErrorIsDir } - return conflict.Conflicts.ID, nil + return &conflict.Conflicts, nil } - return "", fmt.Errorf("pre-upload check: %w", err) + return nil, fmt.Errorf("pre-upload check: %w", err) } - return "", nil + return nil, nil } // Put the object @@ -768,11 +827,11 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // Preflight check the upload, which returns the ID if the // object already exists - ID, err := f.preUploadCheck(ctx, leaf, directoryID, src.Size()) + item, err := f.preUploadCheck(ctx, leaf, directoryID, src.Size()) if err != nil { return nil, err } - if ID == "" { + if item == nil { return f.PutUnchecked(ctx, in, src, options...) } @@ -780,7 +839,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . o := &Object{ fs: f, remote: remote, - id: ID, + id: item.ID, } return o, o.Update(ctx, in, src, options...) } @@ -1117,7 +1176,7 @@ func (f *Fs) deletePermanently(ctx context.Context, itemType, id string) error { // CleanUp empties the trash func (f *Fs) CleanUp(ctx context.Context) (err error) { var ( - deleteErrors = int64(0) + deleteErrors atomic.Uint64 concurrencyControl = make(chan struct{}, fs.GetConfig(ctx).Checkers) wg sync.WaitGroup ) @@ -1133,7 +1192,7 @@ func (f *Fs) CleanUp(ctx context.Context) (err error) { err := f.deletePermanently(ctx, item.Type, item.ID) if err != nil { fs.Errorf(f, "failed to delete trash item %q (%q): %v", item.Name, item.ID, err) - atomic.AddInt64(&deleteErrors, 1) + deleteErrors.Add(1) } }() } else { @@ -1142,12 +1201,277 @@ func (f *Fs) CleanUp(ctx context.Context) (err error) { return false }) wg.Wait() - if deleteErrors != 0 { - return fmt.Errorf("failed to delete %d trash items", deleteErrors) + if deleteErrors.Load() != 0 { + return fmt.Errorf("failed to delete %d trash items", deleteErrors.Load()) } return err } +// ChangeNotify calls the passed function with a path that has had changes. +// If the implementation uses polling, it should adhere to the given interval. +// +// Automatically restarts itself in case of unexpected behavior of the remote. +// +// Close the returned channel to stop being notified. +func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryType), pollIntervalChan <-chan time.Duration) { + go func() { + // get the `stream_position` early so all changes from now on get processed + streamPosition, err := f.changeNotifyStreamPosition(ctx) + if err != nil { + fs.Infof(f, "Failed to get StreamPosition: %s", err) + } + + // box can send duplicate Event IDs. Use this map to track and filter + // the ones we've already processed. + processedEventIDs := make(map[string]time.Time) + + var ticker *time.Ticker + var tickerC <-chan time.Time + for { + select { + case pollInterval, ok := <-pollIntervalChan: + if !ok { + if ticker != nil { + ticker.Stop() + } + return + } + if ticker != nil { + ticker.Stop() + ticker, tickerC = nil, nil + } + if pollInterval != 0 { + ticker = time.NewTicker(pollInterval) + tickerC = ticker.C + } + case <-tickerC: + if streamPosition == "" { + streamPosition, err = f.changeNotifyStreamPosition(ctx) + if err != nil { + fs.Infof(f, "Failed to get StreamPosition: %s", err) + continue + } + } + + // Garbage collect EventIDs older than 1 minute + for eventID, timestamp := range processedEventIDs { + if time.Since(timestamp) > time.Minute { + delete(processedEventIDs, eventID) + } + } + + streamPosition, err = f.changeNotifyRunner(ctx, notifyFunc, streamPosition, processedEventIDs) + if err != nil { + fs.Infof(f, "Change notify listener failure: %s", err) + } + } + } + }() +} + +func (f *Fs) changeNotifyStreamPosition(ctx context.Context) (streamPosition string, err error) { + opts := rest.Opts{ + Method: "GET", + Path: "/events", + Parameters: fieldsValue(), + } + opts.Parameters.Set("stream_position", "now") + opts.Parameters.Set("stream_type", "changes") + + var result api.Events + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, nil, &result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return "", err + } + + return strconv.FormatInt(result.NextStreamPosition, 10), nil +} + +// Attempts to construct the full path for an object, given the ID of its +// parent directory and the name of the object. +// +// Can return "" if the parentID is not currently in the directory cache. +func (f *Fs) getFullPath(parentID string, childName string) (fullPath string) { + fullPath = "" + name := f.opt.Enc.ToStandardName(childName) + if parentID != "" { + if parentDir, ok := f.dirCache.GetInv(parentID); ok { + if len(parentDir) > 0 { + fullPath = parentDir + "/" + name + } else { + fullPath = name + } + } + } else { + // No parent, this object is at the root + fullPath = name + } + return fullPath +} + +func (f *Fs) changeNotifyRunner(ctx context.Context, notifyFunc func(string, fs.EntryType), streamPosition string, processedEventIDs map[string]time.Time) (nextStreamPosition string, err error) { + nextStreamPosition = streamPosition + + for { + limit := f.opt.ListChunk + + // box only allows a max of 500 events + if limit > 500 { + limit = 500 + } + + opts := rest.Opts{ + Method: "GET", + Path: "/events", + Parameters: fieldsValue(), + } + opts.Parameters.Set("stream_position", nextStreamPosition) + opts.Parameters.Set("stream_type", "changes") + opts.Parameters.Set("limit", strconv.Itoa(limit)) + + var result api.Events + var resp *http.Response + fs.Debugf(f, "Checking for changes on remote (next_stream_position: %q)", nextStreamPosition) + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, nil, &result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return "", err + } + + if result.ChunkSize != int64(len(result.Entries)) { + return "", fmt.Errorf("invalid response to event request, chunk_size (%v) not equal to number of entries (%v)", result.ChunkSize, len(result.Entries)) + } + + nextStreamPosition = strconv.FormatInt(result.NextStreamPosition, 10) + if result.ChunkSize == 0 { + return nextStreamPosition, nil + } + + type pathToClear struct { + path string + entryType fs.EntryType + } + var pathsToClear []pathToClear + newEventIDs := 0 + for _, entry := range result.Entries { + eventDetails := fmt.Sprintf("[%q(%d)|%s|%s|%s|%s]", entry.Source.Name, entry.Source.SequenceID, + entry.Source.Type, entry.EventType, entry.Source.ID, entry.EventID) + + if entry.EventID == "" { + fs.Debugf(f, "%s ignored due to missing EventID", eventDetails) + continue + } + if _, ok := processedEventIDs[entry.EventID]; ok { + fs.Debugf(f, "%s ignored due to duplicate EventID", eventDetails) + continue + } + processedEventIDs[entry.EventID] = time.Now() + newEventIDs++ + + if entry.Source.ID == "" { // missing File or Folder ID + fs.Debugf(f, "%s ignored due to missing SourceID", eventDetails) + continue + } + if entry.Source.Type != api.ItemTypeFile && entry.Source.Type != api.ItemTypeFolder { // event is not for a file or folder + fs.Debugf(f, "%s ignored due to unsupported SourceType", eventDetails) + continue + } + + // Only interested in event types that result in a file tree change + if _, found := api.FileTreeChangeEventTypes[entry.EventType]; !found { + fs.Debugf(f, "%s ignored due to unsupported EventType", eventDetails) + continue + } + + f.itemMetaCacheMu.Lock() + itemMeta, cachedItemMetaFound := f.itemMetaCache[entry.Source.ID] + if cachedItemMetaFound { + if itemMeta.SequenceID >= entry.Source.SequenceID { + // Item in the cache has the same or newer SequenceID than + // this event. Ignore this event, it must be old. + f.itemMetaCacheMu.Unlock() + fs.Debugf(f, "%s ignored due to old SequenceID (%q)", eventDetails, itemMeta.SequenceID) + continue + } + + // This event is newer. Delete its entry from the cache, + // we'll notify about its change below, then it's up to a + // future list operation to repopulate the cache. + delete(f.itemMetaCache, entry.Source.ID) + } + f.itemMetaCacheMu.Unlock() + + entryType := fs.EntryDirectory + if entry.Source.Type == api.ItemTypeFile { + entryType = fs.EntryObject + } + + // The box event only includes the new path for the object (e.g. + // the path after the object was moved). If there was an old path + // saved in our cache, it must be cleared. + if cachedItemMetaFound { + path := f.getFullPath(itemMeta.ParentID, itemMeta.Name) + if path != "" { + fs.Debugf(f, "%s added old path (%q) for notify", eventDetails, path) + pathsToClear = append(pathsToClear, pathToClear{path: path, entryType: entryType}) + } else { + fs.Debugf(f, "%s old parent not cached", eventDetails) + } + + // If this is a directory, also delete it from the dir cache. + // This will effectively invalidate the item metadata cache + // entries for all descendents of this directory, since we + // will no longer be able to construct a full path for them. + // This is exactly what we want, since we don't want to notify + // on the paths of these descendents if one of their ancestors + // has been renamed/deleted. + if entry.Source.Type == api.ItemTypeFolder { + f.dirCache.FlushDir(path) + } + } + + // If the item is "active", then it is not trashed or deleted, so + // it potentially has a valid parent. + // + // Construct the new path of the object, based on the Parent ID + // and its name. If we get an empty result, it means we don't + // currently know about this object so notification is unnecessary. + if entry.Source.ItemStatus == api.ItemStatusActive { + path := f.getFullPath(entry.Source.Parent.ID, entry.Source.Name) + if path != "" { + fs.Debugf(f, "%s added new path (%q) for notify", eventDetails, path) + pathsToClear = append(pathsToClear, pathToClear{path: path, entryType: entryType}) + } else { + fs.Debugf(f, "%s new parent not found", eventDetails) + } + } + } + + // box can sometimes repeatedly return the same Event IDs within a + // short period of time. If it stops giving us new ones, treat it + // the same as if it returned us none at all. + if newEventIDs == 0 { + return nextStreamPosition, nil + } + + notifiedPaths := make(map[string]bool) + for _, p := range pathsToClear { + if _, ok := notifiedPaths[p.path]; ok { + continue + } + notifiedPaths[p.path] = true + notifyFunc(p.path, p.entryType) + } + fs.Debugf(f, "Received %v events, resulting in %v paths and %v notifications", len(result.Entries), len(pathsToClear), len(notifiedPaths)) + } +} + // DirCacheFlush resets the directory cache - used in testing as an // optional interface func (f *Fs) DirCacheFlush() { diff --git a/backend/cache/cache.go b/backend/cache/cache.go index dd16642c9a3db..828744c47340a 100644 --- a/backend/cache/cache.go +++ b/backend/cache/cache.go @@ -76,17 +76,19 @@ func init() { Name: "plex_url", Help: "The URL of the Plex server.", }, { - Name: "plex_username", - Help: "The username of the Plex user.", + Name: "plex_username", + Help: "The username of the Plex user.", + Sensitive: true, }, { Name: "plex_password", Help: "The password of the Plex user.", IsPassword: true, }, { - Name: "plex_token", - Help: "The plex token for authentication - auto set normally.", - Hide: fs.OptionHideBoth, - Advanced: true, + Name: "plex_token", + Help: "The plex token for authentication - auto set normally.", + Hide: fs.OptionHideBoth, + Advanced: true, + Sensitive: true, }, { Name: "plex_insecure", Help: "Skip all certificate verification when connecting to the Plex server.", @@ -1787,7 +1789,7 @@ func (f *Fs) CleanUpCache(ignoreLastTs bool) { } } -// StopBackgroundRunners will signall all the runners to stop their work +// StopBackgroundRunners will signal all the runners to stop their work // can be triggered from a terminate signal or from testing between runs func (f *Fs) StopBackgroundRunners() { f.cleanupChan <- false diff --git a/backend/cache/cache_internal_test.go b/backend/cache/cache_internal_test.go index 82ae0bf012f12..d7ee0fba253d4 100644 --- a/backend/cache/cache_internal_test.go +++ b/backend/cache/cache_internal_test.go @@ -1098,27 +1098,6 @@ func (r *run) list(t *testing.T, f fs.Fs, remote string) ([]interface{}, error) return l, err } -func (r *run) copyFile(t *testing.T, f fs.Fs, src, dst string) error { - in, err := os.Open(src) - if err != nil { - return err - } - defer func() { - _ = in.Close() - }() - - out, err := os.Create(dst) - if err != nil { - return err - } - defer func() { - _ = out.Close() - }() - - _, err = io.Copy(out, in) - return err -} - func (r *run) dirMove(t *testing.T, rootFs fs.Fs, src, dst string) error { var err error diff --git a/backend/cache/cache_test.go b/backend/cache/cache_test.go index 9ad4e31e5afe8..594149596334d 100644 --- a/backend/cache/cache_test.go +++ b/backend/cache/cache_test.go @@ -18,7 +18,7 @@ func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ RemoteName: "TestCache:", NilObject: (*cache.Object)(nil), - UnimplementableFsMethods: []string{"PublicLink", "OpenWriterAt"}, + UnimplementableFsMethods: []string{"PublicLink", "OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType", "ID", "GetTier", "SetTier", "Metadata"}, SkipInvalidUTF8: true, // invalid UTF-8 confuses the cache }) diff --git a/backend/cache/cache_upload_test.go b/backend/cache/cache_upload_test.go index b6a2c584274bd..d0246740a0c7d 100644 --- a/backend/cache/cache_upload_test.go +++ b/backend/cache/cache_upload_test.go @@ -160,11 +160,11 @@ func TestInternalUploadQueueMoreFiles(t *testing.T) { minSize := 5242880 maxSize := 10485760 totalFiles := 10 - rand.Seed(time.Now().Unix()) + randInstance := rand.New(rand.NewSource(time.Now().Unix())) lastFile := "" for i := 0; i < totalFiles; i++ { - size := int64(rand.Intn(maxSize-minSize) + minSize) + size := int64(randInstance.Intn(maxSize-minSize) + minSize) testReader := runInstance.randomReader(t, size) remote := "test/" + strconv.Itoa(i) + ".bin" runInstance.writeRemoteReader(t, rootFs, remote, testReader) diff --git a/backend/chunker/chunker_test.go b/backend/chunker/chunker_test.go index 7f0c0310d0856..d5ce656dda7e6 100644 --- a/backend/chunker/chunker_test.go +++ b/backend/chunker/chunker_test.go @@ -40,6 +40,7 @@ func TestIntegration(t *testing.T) { UnimplementableFsMethods: []string{ "PublicLink", "OpenWriterAt", + "OpenChunkWriter", "MergeDirs", "DirCacheFlush", "UserInfo", diff --git a/backend/combine/combine.go b/backend/combine/combine.go index 63fb4635ecee5..74384fb48f706 100644 --- a/backend/combine/combine.go +++ b/backend/combine/combine.go @@ -1,4 +1,4 @@ -// Package combine implents a backend to combine multiple remotes in a directory tree +// Package combine implements a backend to combine multiple remotes in a directory tree package combine /* @@ -233,6 +233,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (outFs fs ReadMetadata: true, WriteMetadata: true, UserMetadata: true, + PartialUploads: true, }).Fill(ctx, f) canMove := true for _, u := range f.upstreams { @@ -289,6 +290,16 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (outFs fs } } + // Enable CleanUp when any upstreams support it + if features.CleanUp == nil { + for _, u := range f.upstreams { + if u.f.Features().CleanUp != nil { + features.CleanUp = f.CleanUp + break + } + } + } + // Enable ChangeNotify when any upstreams support it if features.ChangeNotify == nil { for _, u := range f.upstreams { @@ -299,6 +310,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (outFs fs } } + // show that we wrap other backends + features.Overlay = true + f.features = features // Get common intersection of hashes @@ -351,7 +365,7 @@ func (f *Fs) multithread(ctx context.Context, fn func(context.Context, *upstream return g.Wait() } -// join the elements together but unline path.Join return empty string +// join the elements together but unlike path.Join return empty string func join(elem ...string) string { result := path.Join(elem...) if result == "." { @@ -887,6 +901,100 @@ func (f *Fs) Shutdown(ctx context.Context) error { }) } +// PublicLink generates a public link to the remote path (usually readable by anyone) +func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error) { + u, uRemote, err := f.findUpstream(remote) + if err != nil { + return "", err + } + do := u.f.Features().PublicLink + if do == nil { + return "", fs.ErrorNotImplemented + } + return do(ctx, uRemote, expire, unlink) +} + +// PutUnchecked in to the remote path with the modTime given of the given size +// +// May create the object even if it returns an error - if so +// will return the object and the error, otherwise will return +// nil and the error +// +// May create duplicates or return errors if src already +// exists. +func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + srcPath := src.Remote() + u, uRemote, err := f.findUpstream(srcPath) + if err != nil { + return nil, err + } + do := u.f.Features().PutUnchecked + if do == nil { + return nil, fs.ErrorNotImplemented + } + uSrc := fs.NewOverrideRemote(src, uRemote) + return do(ctx, in, uSrc, options...) +} + +// MergeDirs merges the contents of all the directories passed +// in into the first one and rmdirs the other directories. +func (f *Fs) MergeDirs(ctx context.Context, dirs []fs.Directory) error { + if len(dirs) == 0 { + return nil + } + var ( + u *upstream + uDirs []fs.Directory + ) + for _, dir := range dirs { + uNew, uDir, err := f.findUpstream(dir.Remote()) + if err != nil { + return err + } + if u == nil { + u = uNew + } else if u != uNew { + return fmt.Errorf("can't merge directories from different upstreams") + } + uDirs = append(uDirs, fs.NewOverrideDirectory(dir, uDir)) + } + do := u.f.Features().MergeDirs + if do == nil { + return fs.ErrorNotImplemented + } + return do(ctx, uDirs) +} + +// CleanUp the trash in the Fs +// +// Implement this if you have a way of emptying the trash or +// otherwise cleaning up old versions of files. +func (f *Fs) CleanUp(ctx context.Context) error { + return f.multithread(ctx, func(ctx context.Context, u *upstream) error { + if do := u.f.Features().CleanUp; do != nil { + return do(ctx) + } + return nil + }) +} + +// OpenWriterAt opens with a handle for random access writes +// +// Pass in the remote desired and the size if known. +// +// It truncates any existing object +func (f *Fs) OpenWriterAt(ctx context.Context, remote string, size int64) (fs.WriterAtCloser, error) { + u, uRemote, err := f.findUpstream(remote) + if err != nil { + return nil, err + } + do := u.f.Features().OpenWriterAt + if do == nil { + return nil, fs.ErrorNotImplemented + } + return do(ctx, uRemote, size) +} + // Object describes a wrapped Object // // This is a wrapped Object which knows its path prefix @@ -916,7 +1024,7 @@ func (o *Object) String() string { func (o *Object) Remote() string { newPath, err := o.u.pathAdjustment.do(o.Object.String()) if err != nil { - fs.Errorf(o, "Bad object: %v", err) + fs.Errorf(o.Object, "Bad object: %v", err) return err.Error() } return newPath @@ -988,5 +1096,10 @@ var ( _ fs.Abouter = (*Fs)(nil) _ fs.ListRer = (*Fs)(nil) _ fs.Shutdowner = (*Fs)(nil) + _ fs.PublicLinker = (*Fs)(nil) + _ fs.PutUncheckeder = (*Fs)(nil) + _ fs.MergeDirser = (*Fs)(nil) + _ fs.CleanUpper = (*Fs)(nil) + _ fs.OpenWriterAter = (*Fs)(nil) _ fs.FullObject = (*Object)(nil) ) diff --git a/backend/combine/combine_test.go b/backend/combine/combine_test.go index 46b49bcf0305f..c132377b1452f 100644 --- a/backend/combine/combine_test.go +++ b/backend/combine/combine_test.go @@ -10,6 +10,11 @@ import ( "github.com/rclone/rclone/fstest/fstests" ) +var ( + unimplementableFsMethods = []string{"UnWrap", "WrapFs", "SetWrapper", "UserInfo", "Disconnect", "OpenChunkWriter"} + unimplementableObjectMethods = []string{} +) + // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { if *fstest.RemoteName == "" { @@ -17,8 +22,8 @@ func TestIntegration(t *testing.T) { } fstests.Run(t, &fstests.Opt{ RemoteName: *fstest.RemoteName, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, }) } @@ -35,7 +40,9 @@ func TestLocal(t *testing.T) { {Name: name, Key: "type", Value: "combine"}, {Name: name, Key: "upstreams", Value: upstreams}, }, - QuickTestOK: true, + QuickTestOK: true, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, }) } @@ -51,7 +58,9 @@ func TestMemory(t *testing.T) { {Name: name, Key: "type", Value: "combine"}, {Name: name, Key: "upstreams", Value: upstreams}, }, - QuickTestOK: true, + QuickTestOK: true, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, }) } @@ -68,6 +77,8 @@ func TestMixed(t *testing.T) { {Name: name, Key: "type", Value: "combine"}, {Name: name, Key: "upstreams", Value: upstreams}, }, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, }) } diff --git a/backend/compress/compress.go b/backend/compress/compress.go index 21ab99c03f50a..f635c5e595621 100644 --- a/backend/compress/compress.go +++ b/backend/compress/compress.go @@ -186,6 +186,7 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs, ReadMetadata: true, WriteMetadata: true, UserMetadata: true, + PartialUploads: true, }).Fill(ctx, f).Mask(ctx, wrappedFs).WrapsFs(f, wrappedFs) // We support reading MIME types no matter the wrapped fs f.features.ReadMimeType = true @@ -256,6 +257,16 @@ func isMetadataFile(filename string) bool { return strings.HasSuffix(filename, metaFileExt) } +// Checks whether a file is a metadata file and returns the original +// file name and a flag indicating whether it was a metadata file or +// not. +func unwrapMetadataFile(filename string) (string, bool) { + if !isMetadataFile(filename) { + return "", false + } + return filename[:len(filename)-len(metaFileExt)], true +} + // makeDataName generates the file name for a data file with specified compression mode func makeDataName(remote string, size int64, mode int) (newRemote string) { if mode != Uncompressed { @@ -978,7 +989,8 @@ func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryT wrappedNotifyFunc := func(path string, entryType fs.EntryType) { fs.Logf(f, "path %q entryType %d", path, entryType) var ( - wrappedPath string + wrappedPath string + isMetadataFile bool ) switch entryType { case fs.EntryDirectory: @@ -986,7 +998,10 @@ func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryT case fs.EntryObject: // Note: All we really need to do to monitor the object is to check whether the metadata changed, // as the metadata contains the hash. This will work unless there's a hash collision and the sizes stay the same. - wrappedPath = makeMetadataName(path) + wrappedPath, isMetadataFile = unwrapMetadataFile(path) + if !isMetadataFile { + return + } default: fs.Errorf(path, "press ChangeNotify: ignoring unknown EntryType %d", entryType) return diff --git a/backend/compress/compress_test.go b/backend/compress/compress_test.go index 356e9dd438295..8fc954dfa56ba 100644 --- a/backend/compress/compress_test.go +++ b/backend/compress/compress_test.go @@ -14,23 +14,26 @@ import ( "github.com/rclone/rclone/fstest/fstests" ) +var defaultOpt = fstests.Opt{ + RemoteName: "TestCompress:", + NilObject: (*Object)(nil), + UnimplementableFsMethods: []string{ + "OpenWriterAt", + "OpenChunkWriter", + "MergeDirs", + "DirCacheFlush", + "PutUnchecked", + "PutStream", + "UserInfo", + "Disconnect", + }, + TiersToTest: []string{"STANDARD", "STANDARD_IA"}, + UnimplementableObjectMethods: []string{}, +} + // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { - opt := fstests.Opt{ - RemoteName: *fstest.RemoteName, - NilObject: (*Object)(nil), - UnimplementableFsMethods: []string{ - "OpenWriterAt", - "MergeDirs", - "DirCacheFlush", - "PutUnchecked", - "PutStream", - "UserInfo", - "Disconnect", - }, - TiersToTest: []string{"STANDARD", "STANDARD_IA"}, - UnimplementableObjectMethods: []string{}} - fstests.Run(t, &opt) + fstests.Run(t, &defaultOpt) } // TestRemoteGzip tests GZIP compression @@ -40,27 +43,13 @@ func TestRemoteGzip(t *testing.T) { } tempdir := filepath.Join(os.TempDir(), "rclone-compress-test-gzip") name := "TestCompressGzip" - fstests.Run(t, &fstests.Opt{ - RemoteName: name + ":", - NilObject: (*Object)(nil), - UnimplementableFsMethods: []string{ - "OpenWriterAt", - "MergeDirs", - "DirCacheFlush", - "PutUnchecked", - "PutStream", - "UserInfo", - "Disconnect", - }, - UnimplementableObjectMethods: []string{ - "GetTier", - "SetTier", - }, - ExtraConfig: []fstests.ExtraConfigItem{ - {Name: name, Key: "type", Value: "compress"}, - {Name: name, Key: "remote", Value: tempdir}, - {Name: name, Key: "compression_mode", Value: "gzip"}, - }, - QuickTestOK: true, - }) + opt := defaultOpt + opt.RemoteName = name + ":" + opt.ExtraConfig = []fstests.ExtraConfigItem{ + {Name: name, Key: "type", Value: "compress"}, + {Name: name, Key: "remote", Value: tempdir}, + {Name: name, Key: "compression_mode", Value: "gzip"}, + } + opt.QuickTestOK = true + fstests.Run(t, &opt) } diff --git a/backend/crypt/cipher.go b/backend/crypt/cipher.go index ae1e623936dec..d0f8a658e8cde 100644 --- a/backend/crypt/cipher.go +++ b/backend/crypt/cipher.go @@ -21,6 +21,7 @@ import ( "github.com/rclone/rclone/backend/crypt/pkcs7" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/lib/readers" "github.com/rclone/rclone/lib/version" "github.com/rfjakob/eme" "golang.org/x/crypto/nacl/secretbox" @@ -37,7 +38,6 @@ const ( blockHeaderSize = secretbox.Overhead blockDataSize = 64 * 1024 blockSize = blockHeaderSize + blockDataSize - encryptedSuffix = ".bin" // when file name encryption is off we add this suffix to make sure the cloud provider doesn't process the file ) // Errors returned by cipher @@ -53,8 +53,9 @@ var ( ErrorEncryptedBadBlock = errors.New("failed to authenticate decrypted block - bad password?") ErrorBadBase32Encoding = errors.New("bad base32 filename encoding") ErrorFileClosed = errors.New("file already closed") - ErrorNotAnEncryptedFile = errors.New("not an encrypted file - no \"" + encryptedSuffix + "\" suffix") + ErrorNotAnEncryptedFile = errors.New("not an encrypted file - does not match suffix") ErrorBadSeek = errors.New("Seek beyond end of file") + ErrorSuffixMissingDot = errors.New("suffix config setting should include a '.'") defaultSalt = []byte{0xA8, 0x0D, 0xF4, 0x3A, 0x8F, 0xBD, 0x03, 0x08, 0xA7, 0xCA, 0xB8, 0x3E, 0x58, 0x1F, 0x86, 0xB1} obfuscQuoteRune = '!' ) @@ -169,27 +170,30 @@ func NewNameEncoding(s string) (enc fileNameEncoding, err error) { // Cipher defines an encoding and decoding cipher for the crypt backend type Cipher struct { - dataKey [32]byte // Key for secretbox - nameKey [32]byte // 16,24 or 32 bytes - nameTweak [nameCipherBlockSize]byte // used to tweak the name crypto - block gocipher.Block - mode NameEncryptionMode - fileNameEnc fileNameEncoding - buffers sync.Pool // encrypt/decrypt buffers - cryptoRand io.Reader // read crypto random numbers from here - dirNameEncrypt bool + dataKey [32]byte // Key for secretbox + nameKey [32]byte // 16,24 or 32 bytes + nameTweak [nameCipherBlockSize]byte // used to tweak the name crypto + block gocipher.Block + mode NameEncryptionMode + fileNameEnc fileNameEncoding + buffers sync.Pool // encrypt/decrypt buffers + cryptoRand io.Reader // read crypto random numbers from here + dirNameEncrypt bool + passBadBlocks bool // if set passed bad blocks as zeroed blocks + encryptedSuffix string } // newCipher initialises the cipher. If salt is "" then it uses a built in salt val func newCipher(mode NameEncryptionMode, password, salt string, dirNameEncrypt bool, enc fileNameEncoding) (*Cipher, error) { c := &Cipher{ - mode: mode, - fileNameEnc: enc, - cryptoRand: rand.Reader, - dirNameEncrypt: dirNameEncrypt, + mode: mode, + fileNameEnc: enc, + cryptoRand: rand.Reader, + dirNameEncrypt: dirNameEncrypt, + encryptedSuffix: ".bin", } c.buffers.New = func() interface{} { - return make([]byte, blockSize) + return new([blockSize]byte) } err := c.Key(password, salt) if err != nil { @@ -198,11 +202,29 @@ func newCipher(mode NameEncryptionMode, password, salt string, dirNameEncrypt bo return c, nil } +// setEncryptedSuffix set suffix, or an empty string +func (c *Cipher) setEncryptedSuffix(suffix string) { + if strings.EqualFold(suffix, "none") { + c.encryptedSuffix = "" + return + } + if !strings.HasPrefix(suffix, ".") { + fs.Errorf(nil, "crypt: bad suffix: %v", ErrorSuffixMissingDot) + suffix = "." + suffix + } + c.encryptedSuffix = suffix +} + +// Call to set bad block pass through +func (c *Cipher) setPassBadBlocks(passBadBlocks bool) { + c.passBadBlocks = passBadBlocks +} + // Key creates all the internal keys from the password passed in using // scrypt. // // If salt is "" we use a fixed salt just to make attackers lives -// slighty harder than using no salt. +// slightly harder than using no salt. // // Note that empty password makes all 0x00 keys which is used in the // tests. @@ -230,15 +252,12 @@ func (c *Cipher) Key(password, salt string) (err error) { } // getBlock gets a block from the pool of size blockSize -func (c *Cipher) getBlock() []byte { - return c.buffers.Get().([]byte) +func (c *Cipher) getBlock() *[blockSize]byte { + return c.buffers.Get().(*[blockSize]byte) } // putBlock returns a block to the pool of size blockSize -func (c *Cipher) putBlock(buf []byte) { - if len(buf) != blockSize { - panic("bad blocksize returned to pool") - } +func (c *Cipher) putBlock(buf *[blockSize]byte) { c.buffers.Put(buf) } @@ -508,7 +527,7 @@ func (c *Cipher) encryptFileName(in string) string { // EncryptFileName encrypts a file path func (c *Cipher) EncryptFileName(in string) string { if c.mode == NameEncryptionOff { - return in + encryptedSuffix + return in + c.encryptedSuffix } return c.encryptFileName(in) } @@ -568,8 +587,8 @@ func (c *Cipher) decryptFileName(in string) (string, error) { // DecryptFileName decrypts a file path func (c *Cipher) DecryptFileName(in string) (string, error) { if c.mode == NameEncryptionOff { - remainingLength := len(in) - len(encryptedSuffix) - if remainingLength == 0 || !strings.HasSuffix(in, encryptedSuffix) { + remainingLength := len(in) - len(c.encryptedSuffix) + if remainingLength == 0 || !strings.HasSuffix(in, c.encryptedSuffix) { return "", ErrorNotAnEncryptedFile } decrypted := in[:remainingLength] @@ -609,7 +628,7 @@ func (n *nonce) pointer() *[fileNonceSize]byte { // fromReader fills the nonce from an io.Reader - normally the OSes // crypto random number generator func (n *nonce) fromReader(in io.Reader) error { - read, err := io.ReadFull(in, (*n)[:]) + read, err := readers.ReadFill(in, (*n)[:]) if read != fileNonceSize { return fmt.Errorf("short read of nonce: %w", err) } @@ -664,8 +683,8 @@ type encrypter struct { in io.Reader c *Cipher nonce nonce - buf []byte - readBuf []byte + buf *[blockSize]byte + readBuf *[blockSize]byte bufIndex int bufSize int err error @@ -690,9 +709,9 @@ func (c *Cipher) newEncrypter(in io.Reader, nonce *nonce) (*encrypter, error) { } } // Copy magic into buffer - copy(fh.buf, fileMagicBytes) + copy((*fh.buf)[:], fileMagicBytes) // Copy nonce into buffer - copy(fh.buf[fileMagicSize:], fh.nonce[:]) + copy((*fh.buf)[fileMagicSize:], fh.nonce[:]) return fh, nil } @@ -707,22 +726,20 @@ func (fh *encrypter) Read(p []byte) (n int, err error) { if fh.bufIndex >= fh.bufSize { // Read data // FIXME should overlap the reads with a go-routine and 2 buffers? - readBuf := fh.readBuf[:blockDataSize] - n, err = io.ReadFull(fh.in, readBuf) + readBuf := (*fh.readBuf)[:blockDataSize] + n, err = readers.ReadFill(fh.in, readBuf) if n == 0 { - // err can't be nil since: - // n == len(buf) if and only if err == nil. return fh.finish(err) } // possibly err != nil here, but we will process the - // data and the next call to ReadFull will return 0, err + // data and the next call to ReadFill will return 0, err // Encrypt the block using the nonce - secretbox.Seal(fh.buf[:0], readBuf[:n], fh.nonce.pointer(), &fh.c.dataKey) + secretbox.Seal((*fh.buf)[:0], readBuf[:n], fh.nonce.pointer(), &fh.c.dataKey) fh.bufIndex = 0 fh.bufSize = blockHeaderSize + n fh.nonce.increment() } - n = copy(p, fh.buf[fh.bufIndex:fh.bufSize]) + n = copy(p, (*fh.buf)[fh.bufIndex:fh.bufSize]) fh.bufIndex += n return n, nil } @@ -763,8 +780,8 @@ type decrypter struct { nonce nonce initialNonce nonce c *Cipher - buf []byte - readBuf []byte + buf *[blockSize]byte + readBuf *[blockSize]byte bufIndex int bufSize int err error @@ -782,12 +799,12 @@ func (c *Cipher) newDecrypter(rc io.ReadCloser) (*decrypter, error) { limit: -1, } // Read file header (magic + nonce) - readBuf := fh.readBuf[:fileHeaderSize] - _, err := io.ReadFull(fh.rc, readBuf) - if err == io.EOF || err == io.ErrUnexpectedEOF { + readBuf := (*fh.readBuf)[:fileHeaderSize] + n, err := readers.ReadFill(fh.rc, readBuf) + if n < fileHeaderSize && err == io.EOF { // This read from 0..fileHeaderSize-1 bytes return nil, fh.finishAndClose(ErrorEncryptedFileTooShort) - } else if err != nil { + } else if err != io.EOF && err != nil { return nil, fh.finishAndClose(err) } // check the magic @@ -845,10 +862,8 @@ func (c *Cipher) newDecrypterSeek(ctx context.Context, open OpenRangeSeek, offse func (fh *decrypter) fillBuffer() (err error) { // FIXME should overlap the reads with a go-routine and 2 buffers? readBuf := fh.readBuf - n, err := io.ReadFull(fh.rc, readBuf) + n, err := readers.ReadFill(fh.rc, (*readBuf)[:]) if n == 0 { - // err can't be nil since: - // n == len(buf) if and only if err == nil. return err } // possibly err != nil here, but we will process the data and @@ -856,18 +871,25 @@ func (fh *decrypter) fillBuffer() (err error) { // Check header + 1 byte exists if n <= blockHeaderSize { - if err != nil { + if err != nil && err != io.EOF { return err // return pending error as it is likely more accurate } return ErrorEncryptedFileBadHeader } // Decrypt the block using the nonce - _, ok := secretbox.Open(fh.buf[:0], readBuf[:n], fh.nonce.pointer(), &fh.c.dataKey) + _, ok := secretbox.Open((*fh.buf)[:0], (*readBuf)[:n], fh.nonce.pointer(), &fh.c.dataKey) if !ok { - if err != nil { + if err != nil && err != io.EOF { return err // return pending error as it is likely more accurate } - return ErrorEncryptedBadBlock + if !fh.c.passBadBlocks { + return ErrorEncryptedBadBlock + } + fs.Errorf(nil, "crypt: ignoring: %v", ErrorEncryptedBadBlock) + // Zero out the bad block and continue + for i := range (*fh.buf)[:n] { + (*fh.buf)[i] = 0 + } } fh.bufIndex = 0 fh.bufSize = n - blockHeaderSize @@ -893,7 +915,7 @@ func (fh *decrypter) Read(p []byte) (n int, err error) { if fh.limit >= 0 && fh.limit < int64(toCopy) { toCopy = int(fh.limit) } - n = copy(p, fh.buf[fh.bufIndex:fh.bufIndex+toCopy]) + n = copy(p, (*fh.buf)[fh.bufIndex:fh.bufIndex+toCopy]) fh.bufIndex += n if fh.limit >= 0 { fh.limit -= int64(n) @@ -904,9 +926,8 @@ func (fh *decrypter) Read(p []byte) (n int, err error) { return n, nil } -// calculateUnderlying converts an (offset, limit) in a crypted file -// into an (underlyingOffset, underlyingLimit) for the underlying -// file. +// calculateUnderlying converts an (offset, limit) in an encrypted file +// into an (underlyingOffset, underlyingLimit) for the underlying file. // // It also returns number of bytes to discard after reading the first // block and number of blocks this is from the start so the nonce can diff --git a/backend/crypt/cipher_test.go b/backend/crypt/cipher_test.go index d0ba808be4678..559a6f5492708 100644 --- a/backend/crypt/cipher_test.go +++ b/backend/crypt/cipher_test.go @@ -27,14 +27,14 @@ func TestNewNameEncryptionMode(t *testing.T) { {"off", NameEncryptionOff, ""}, {"standard", NameEncryptionStandard, ""}, {"obfuscate", NameEncryptionObfuscated, ""}, - {"potato", NameEncryptionOff, "Unknown file name encryption mode \"potato\""}, + {"potato", NameEncryptionOff, "unknown file name encryption mode \"potato\""}, } { actual, actualErr := NewNameEncryptionMode(test.in) assert.Equal(t, actual, test.expected) if test.expectedErr == "" { assert.NoError(t, actualErr) } else { - assert.Error(t, actualErr, test.expectedErr) + assert.EqualError(t, actualErr, test.expectedErr) } } } @@ -405,6 +405,13 @@ func TestNonStandardEncryptFileName(t *testing.T) { // Off mode c, _ := newCipher(NameEncryptionOff, "", "", true, nil) assert.Equal(t, "1/12/123.bin", c.EncryptFileName("1/12/123")) + // Off mode with custom suffix + c, _ = newCipher(NameEncryptionOff, "", "", true, nil) + c.setEncryptedSuffix(".jpg") + assert.Equal(t, "1/12/123.jpg", c.EncryptFileName("1/12/123")) + // Off mode with empty suffix + c.setEncryptedSuffix("none") + assert.Equal(t, "1/12/123", c.EncryptFileName("1/12/123")) // Obfuscation mode c, _ = newCipher(NameEncryptionObfuscated, "", "", true, nil) assert.Equal(t, "49.6/99.23/150.890/53.!!lipps", c.EncryptFileName("1/12/123/!hello")) @@ -483,21 +490,27 @@ func TestNonStandardDecryptFileName(t *testing.T) { in string expected string expectedErr error + customSuffix string }{ - {NameEncryptionOff, true, "1/12/123.bin", "1/12/123", nil}, - {NameEncryptionOff, true, "1/12/123.bix", "", ErrorNotAnEncryptedFile}, - {NameEncryptionOff, true, ".bin", "", ErrorNotAnEncryptedFile}, - {NameEncryptionOff, true, "1/12/123-v2001-02-03-040506-123.bin", "1/12/123-v2001-02-03-040506-123", nil}, - {NameEncryptionOff, true, "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123.bin", "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123", nil}, - {NameEncryptionOff, true, "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123.txt.bin", "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123.txt", nil}, - {NameEncryptionObfuscated, true, "!.hello", "hello", nil}, - {NameEncryptionObfuscated, true, "hello", "", ErrorNotAnEncryptedFile}, - {NameEncryptionObfuscated, true, "161.\u00e4", "\u00a1", nil}, - {NameEncryptionObfuscated, true, "160.\u03c2", "\u03a0", nil}, - {NameEncryptionObfuscated, false, "1/12/123/53.!!lipps", "1/12/123/!hello", nil}, - {NameEncryptionObfuscated, false, "1/12/123/53-v2001-02-03-040506-123.!!lipps", "1/12/123/!hello-v2001-02-03-040506-123", nil}, + {NameEncryptionOff, true, "1/12/123.bin", "1/12/123", nil, ""}, + {NameEncryptionOff, true, "1/12/123.bix", "", ErrorNotAnEncryptedFile, ""}, + {NameEncryptionOff, true, ".bin", "", ErrorNotAnEncryptedFile, ""}, + {NameEncryptionOff, true, "1/12/123-v2001-02-03-040506-123.bin", "1/12/123-v2001-02-03-040506-123", nil, ""}, + {NameEncryptionOff, true, "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123.bin", "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123", nil, ""}, + {NameEncryptionOff, true, "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123.txt.bin", "1/12/123-v1970-01-01-010101-123-v2001-02-03-040506-123.txt", nil, ""}, + {NameEncryptionOff, true, "1/12/123.jpg", "1/12/123", nil, ".jpg"}, + {NameEncryptionOff, true, "1/12/123", "1/12/123", nil, "none"}, + {NameEncryptionObfuscated, true, "!.hello", "hello", nil, ""}, + {NameEncryptionObfuscated, true, "hello", "", ErrorNotAnEncryptedFile, ""}, + {NameEncryptionObfuscated, true, "161.\u00e4", "\u00a1", nil, ""}, + {NameEncryptionObfuscated, true, "160.\u03c2", "\u03a0", nil, ""}, + {NameEncryptionObfuscated, false, "1/12/123/53.!!lipps", "1/12/123/!hello", nil, ""}, + {NameEncryptionObfuscated, false, "1/12/123/53-v2001-02-03-040506-123.!!lipps", "1/12/123/!hello-v2001-02-03-040506-123", nil, ""}, } { c, _ := newCipher(test.mode, "", "", test.dirNameEncrypt, enc) + if test.customSuffix != "" { + c.setEncryptedSuffix(test.customSuffix) + } actual, actualErr := c.DecryptFileName(test.in) what := fmt.Sprintf("Testing %q (mode=%v)", test.in, test.mode) assert.Equal(t, test.expected, actual, what) @@ -726,7 +739,7 @@ func TestNonceFromReader(t *testing.T) { assert.Equal(t, nonce{'1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o'}, x) buf = bytes.NewBufferString("123456789abcdefghijklmn") err = x.fromReader(buf) - assert.Error(t, err, "short read of nonce") + assert.EqualError(t, err, "short read of nonce: EOF") } func TestNonceFromBuf(t *testing.T) { @@ -1050,7 +1063,7 @@ func TestRandomSource(t *testing.T) { _, _ = source.Read(buf) sink = newRandomSource(1e8) _, err = io.Copy(sink, source) - assert.Error(t, err, "Error in stream") + assert.EqualError(t, err, "Error in stream at 1") } type zeroes struct{} @@ -1167,13 +1180,13 @@ func TestNewEncrypter(t *testing.T) { fh, err := c.newEncrypter(z, nil) assert.NoError(t, err) assert.Equal(t, nonce{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}, fh.nonce) - assert.Equal(t, []byte{'R', 'C', 'L', 'O', 'N', 'E', 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}, fh.buf[:32]) + assert.Equal(t, []byte{'R', 'C', 'L', 'O', 'N', 'E', 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}, (*fh.buf)[:32]) // Test error path c.cryptoRand = bytes.NewBufferString("123456789abcdefghijklmn") fh, err = c.newEncrypter(z, nil) assert.Nil(t, fh) - assert.Error(t, err, "short read of nonce") + assert.EqualError(t, err, "short read of nonce: EOF") } // Test the stream returning 0, io.ErrUnexpectedEOF - this used to @@ -1224,7 +1237,7 @@ func TestNewDecrypter(t *testing.T) { cd := newCloseDetector(bytes.NewBuffer(file0[:i])) fh, err = c.newDecrypter(cd) assert.Nil(t, fh) - assert.Error(t, err, ErrorEncryptedFileTooShort.Error()) + assert.EqualError(t, err, ErrorEncryptedFileTooShort.Error()) assert.Equal(t, 1, cd.closed) } @@ -1232,7 +1245,7 @@ func TestNewDecrypter(t *testing.T) { cd = newCloseDetector(er) fh, err = c.newDecrypter(cd) assert.Nil(t, fh) - assert.Error(t, err, "potato") + assert.EqualError(t, err, "potato") assert.Equal(t, 1, cd.closed) // bad magic @@ -1243,7 +1256,7 @@ func TestNewDecrypter(t *testing.T) { cd := newCloseDetector(bytes.NewBuffer(file0copy)) fh, err := c.newDecrypter(cd) assert.Nil(t, fh) - assert.Error(t, err, ErrorEncryptedBadMagic.Error()) + assert.EqualError(t, err, ErrorEncryptedBadMagic.Error()) file0copy[i] ^= 0x1 assert.Equal(t, 1, cd.closed) } @@ -1495,8 +1508,10 @@ func TestDecrypterRead(t *testing.T) { case i == fileHeaderSize: // This would normally produce an error *except* on the first block expectedErr = nil + case i <= fileHeaderSize+blockHeaderSize: + expectedErr = ErrorEncryptedFileBadHeader default: - expectedErr = io.ErrUnexpectedEOF + expectedErr = ErrorEncryptedBadBlock } if expectedErr != nil { assert.EqualError(t, err, expectedErr.Error(), what) @@ -1514,7 +1529,7 @@ func TestDecrypterRead(t *testing.T) { fh, err := c.newDecrypter(cd) assert.NoError(t, err) _, err = io.ReadAll(fh) - assert.Error(t, err, "potato") + assert.EqualError(t, err, "potato") assert.Equal(t, 0, cd.closed) // Test corrupting the input @@ -1525,15 +1540,26 @@ func TestDecrypterRead(t *testing.T) { file16copy[i] ^= 0xFF fh, err := c.newDecrypter(io.NopCloser(bytes.NewBuffer(file16copy))) if i < fileMagicSize { - assert.Error(t, err, ErrorEncryptedBadMagic.Error()) + assert.EqualError(t, err, ErrorEncryptedBadMagic.Error()) assert.Nil(t, fh) } else { assert.NoError(t, err) _, err = io.ReadAll(fh) - assert.Error(t, err, ErrorEncryptedFileBadHeader.Error()) + assert.EqualError(t, err, ErrorEncryptedBadBlock.Error()) } file16copy[i] ^= 0xFF } + + // Test that we can corrupt a byte and read zeroes if + // passBadBlocks is set + copy(file16copy, file16) + file16copy[len(file16copy)-1] ^= 0xFF + c.passBadBlocks = true + fh, err = c.newDecrypter(io.NopCloser(bytes.NewBuffer(file16copy))) + assert.NoError(t, err) + buf, err := io.ReadAll(fh) + assert.NoError(t, err) + assert.Equal(t, make([]byte, 16), buf) } func TestDecrypterClose(t *testing.T) { @@ -1554,7 +1580,7 @@ func TestDecrypterClose(t *testing.T) { // double close err = fh.Close() - assert.Error(t, err, ErrorFileClosed.Error()) + assert.EqualError(t, err, ErrorFileClosed.Error()) assert.Equal(t, 1, cd.closed) // try again reading the file this time @@ -1581,8 +1607,6 @@ func TestPutGetBlock(t *testing.T) { block := c.getBlock() c.putBlock(block) c.putBlock(block) - - assert.Panics(t, func() { c.putBlock(block[:len(block)-1]) }) } func TestKey(t *testing.T) { diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.go index f3eb8317da9d4..281805fd5bef2 100644 --- a/backend/crypt/crypt.go +++ b/backend/crypt/crypt.go @@ -48,7 +48,7 @@ func init() { Help: "Very simple filename obfuscation.", }, { Value: "off", - Help: "Don't encrypt the file names.\nAdds a \".bin\" extension only.", + Help: "Don't encrypt the file names.\nAdds a \".bin\", or \"suffix\" extension only.", }, }, }, { @@ -79,7 +79,9 @@ NB If filename_encryption is "off" then this option will do nothing.`, }, { Name: "server_side_across_configs", Default: false, - Help: `Allow server-side operations (e.g. copy) to work across different crypt configs. + Help: `Deprecated: use --server-side-across-configs instead. + +Allow server-side operations (e.g. copy) to work across different crypt configs. Normally this option is not what you want, but if you have two crypts pointing to the same backend you can use it. @@ -119,6 +121,15 @@ names, or for debugging purposes.`, Help: "Encrypt file data.", }, }, + }, { + Name: "pass_bad_blocks", + Help: `If set this will pass bad blocks through as all 0. + +This should not be set in normal operation, it should only be set if +trying to recover an encrypted file with errors and it is desired to +recover as much of the file as possible.`, + Default: false, + Advanced: true, }, { Name: "filename_encoding", Help: `How to encode the encrypted filename to text string. @@ -138,10 +149,18 @@ length and if it's case sensitive.`, }, { Value: "base32768", - Help: "Encode using base32768. Suitable if your remote counts UTF-16 or\nUnicode codepoint instead of UTF-8 byte length. (Eg. Onedrive)", + Help: "Encode using base32768. Suitable if your remote counts UTF-16 or\nUnicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox)", }, }, Advanced: true, + }, { + Name: "suffix", + Help: `If this is set it will override the default suffix of ".bin". + +Setting suffix to "none" will result in an empty suffix. This may be useful +when the path length is critical.`, + Default: ".bin", + Advanced: true, }}, }) } @@ -174,6 +193,8 @@ func newCipherForConfig(opt *Options) (*Cipher, error) { if err != nil { return nil, fmt.Errorf("failed to make cipher: %w", err) } + cipher.setEncryptedSuffix(opt.Suffix) + cipher.setPassBadBlocks(opt.PassBadBlocks) return cipher, nil } @@ -247,6 +268,7 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs, ReadMetadata: true, WriteMetadata: true, UserMetadata: true, + PartialUploads: true, }).Fill(ctx, f).Mask(ctx, wrappedFs).WrapsFs(f, wrappedFs) return f, err @@ -262,7 +284,9 @@ type Options struct { Password2 string `config:"password2"` ServerSideAcrossConfigs bool `config:"server_side_across_configs"` ShowMapping bool `config:"show_mapping"` + PassBadBlocks bool `config:"pass_bad_blocks"` FilenameEncoding string `config:"filename_encoding"` + Suffix string `config:"suffix"` } // Fs represents a wrapped fs.Fs @@ -454,7 +478,7 @@ func (f *Fs) put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options [ if err != nil { fs.Errorf(o, "Failed to remove corrupted object: %v", err) } - return nil, fmt.Errorf("corrupted on transfer: %v crypted hash differ src %q vs dst %q", ht, srcHash, dstHash) + return nil, fmt.Errorf("corrupted on transfer: %v encrypted hash differ src %q vs dst %q", ht, srcHash, dstHash) } fs.Debugf(src, "%v = %s OK", ht, srcHash) } diff --git a/backend/crypt/crypt_test.go b/backend/crypt/crypt_test.go index d4b9dc1e43283..49db07dc73292 100644 --- a/backend/crypt/crypt_test.go +++ b/backend/crypt/crypt_test.go @@ -24,7 +24,7 @@ func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ RemoteName: *fstest.RemoteName, NilObject: (*crypt.Object)(nil), - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, }) } @@ -45,7 +45,7 @@ func TestStandardBase32(t *testing.T) { {Name: name, Key: "password", Value: obscure.MustObscure("potato")}, {Name: name, Key: "filename_encryption", Value: "standard"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, QuickTestOK: true, }) @@ -67,7 +67,7 @@ func TestStandardBase64(t *testing.T) { {Name: name, Key: "filename_encryption", Value: "standard"}, {Name: name, Key: "filename_encoding", Value: "base64"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, QuickTestOK: true, }) @@ -89,7 +89,7 @@ func TestStandardBase32768(t *testing.T) { {Name: name, Key: "filename_encryption", Value: "standard"}, {Name: name, Key: "filename_encoding", Value: "base32768"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, QuickTestOK: true, }) @@ -111,7 +111,7 @@ func TestOff(t *testing.T) { {Name: name, Key: "password", Value: obscure.MustObscure("potato2")}, {Name: name, Key: "filename_encryption", Value: "off"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, QuickTestOK: true, }) @@ -137,7 +137,7 @@ func TestObfuscate(t *testing.T) { {Name: name, Key: "filename_encryption", Value: "obfuscate"}, }, SkipBadWindowsCharacters: true, - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, QuickTestOK: true, }) @@ -164,7 +164,7 @@ func TestNoDataObfuscate(t *testing.T) { {Name: name, Key: "no_data_encryption", Value: "true"}, }, SkipBadWindowsCharacters: true, - UnimplementableFsMethods: []string{"OpenWriterAt"}, + UnimplementableFsMethods: []string{"OpenWriterAt", "OpenChunkWriter"}, UnimplementableObjectMethods: []string{"MimeType"}, QuickTestOK: true, }) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 96214d503da08..88e2b7253728b 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -71,7 +71,7 @@ const ( // 1<<18 is the minimum size supported by the Google uploader, and there is no maximum. minChunkSize = fs.SizeSuffix(googleapi.MinUploadChunkSize) defaultChunkSize = 8 * fs.Mebi - partialFields = "id,name,size,md5Checksum,trashed,explicitlyTrashed,modifiedTime,createdTime,mimeType,parents,webViewLink,shortcutDetails,exportLinks,resourceKey" + partialFields = "id,name,size,md5Checksum,sha1Checksum,sha256Checksum,trashed,explicitlyTrashed,modifiedTime,createdTime,mimeType,parents,webViewLink,shortcutDetails,exportLinks,resourceKey" listRGrouping = 50 // number of IDs to search at once when using ListR listRInputBuffer = 1000 // size of input buffer when using ListR defaultXDGIcon = "text-html" @@ -143,6 +143,41 @@ var ( _linkTemplates map[string]*template.Template // available link types ) +// rwChoices type for fs.Bits +type rwChoices struct{} + +func (rwChoices) Choices() []fs.BitsChoicesInfo { + return []fs.BitsChoicesInfo{ + {Bit: uint64(rwOff), Name: "off"}, + {Bit: uint64(rwRead), Name: "read"}, + {Bit: uint64(rwWrite), Name: "write"}, + } +} + +// rwChoice type alias +type rwChoice = fs.Bits[rwChoices] + +const ( + rwRead rwChoice = 1 << iota + rwWrite + rwOff rwChoice = 0 +) + +// Examples for the options +var rwExamples = fs.OptionExamples{{ + Value: rwOff.String(), + Help: "Do not read or write the value", +}, { + Value: rwRead.String(), + Help: "Read the value only", +}, { + Value: rwWrite.String(), + Help: "Write the value only", +}, { + Value: (rwRead | rwWrite).String(), + Help: "Read and Write the value.", +}} + // Parse the scopes option returning a slice of scopes func driveScopes(scopesString string) (scopes []string) { if scopesString == "" { @@ -202,7 +237,7 @@ func init() { m.Set("root_folder_id", "appDataFolder") } - if opt.ServiceAccountFile == "" && opt.ServiceAccountCredentials == "" { + if opt.ServiceAccountFile == "" && opt.ServiceAccountCredentials == "" && !opt.EnvAuth { return oauthutil.ConfigOut("teamdrive", &oauthutil.Options{ OAuth2Config: driveConfig, }) @@ -250,9 +285,13 @@ func init() { } return nil, fmt.Errorf("unknown state %q", config.State) }, + MetadataInfo: &fs.MetadataInfo{ + System: systemMetadataInfo, + Help: `User metadata is stored in the properties field of the drive object.`, + }, Options: append(driveOAuthOptions(), []fs.Option{{ Name: "scope", - Help: "Scope that rclone should use when requesting access from drive.", + Help: "Comma separated list of scopes that rclone should use when requesting access from drive.", Examples: []fs.OptionExample{{ Value: "drive", Help: "Full access all files, excluding Application Data Folder.", @@ -277,20 +316,23 @@ Leave blank normally. Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point. `, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "service_account_file", Help: "Service Account Credentials JSON file path.\n\nLeave blank normally.\nNeeded only if you want use SA instead of interactive login." + env.ShellExpandHelp, }, { - Name: "service_account_credentials", - Help: "Service Account Credentials JSON blob.\n\nLeave blank normally.\nNeeded only if you want use SA instead of interactive login.", - Hide: fs.OptionHideConfigurator, - Advanced: true, + Name: "service_account_credentials", + Help: "Service Account Credentials JSON blob.\n\nLeave blank normally.\nNeeded only if you want use SA instead of interactive login.", + Hide: fs.OptionHideConfigurator, + Advanced: true, + Sensitive: true, }, { - Name: "team_drive", - Help: "ID of the Shared Drive (Team Drive).", - Hide: fs.OptionHideConfigurator, - Advanced: true, + Name: "team_drive", + Help: "ID of the Shared Drive (Team Drive).", + Hide: fs.OptionHideConfigurator, + Advanced: true, + Sensitive: true, }, { Name: "auth_owner_only", Default: false, @@ -317,16 +359,35 @@ rather than shortcuts themselves when doing server side copies.`, Default: false, Help: "Skip google documents in all listings.\n\nIf given, gdocs practically become invisible to rclone.", Advanced: true, + }, { + Name: "show_all_gdocs", + Default: false, + Help: `Show all Google Docs including non-exportable ones in listings. + +If you try a server side copy on a Google Form without this flag, you +will get this error: + + No export formats found for "application/vnd.google-apps.form" + +However adding this flag will allow the form to be server side copied. + +Note that rclone doesn't add extensions to the Google Docs file names +in this mode. + +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. +`, + Advanced: true, }, { Name: "skip_checksum_gphotos", Default: false, - Help: `Skip MD5 checksum on Google photos and videos only. + Help: `Skip checksums on Google photos and videos only. Use this if you get checksum errors when transferring Google photos or videos. Setting this flag will cause Google photos and videos to return a -blank MD5 checksum. +blank checksums. Google photos are identified by being in the "photos" space. @@ -416,10 +477,11 @@ date is used.`, Help: "Size of listing chunk 100-1000, 0 to disable.", Advanced: true, }, { - Name: "impersonate", - Default: "", - Help: `Impersonate this user when using a service account.`, - Advanced: true, + Name: "impersonate", + Default: "", + Help: `Impersonate this user when using a service account.`, + Advanced: true, + Sensitive: true, }, { Name: "alternate_export", Default: false, @@ -499,7 +561,9 @@ need to use --ignore size also.`, }, { Name: "server_side_across_configs", Default: false, - Help: `Allow server-side operations (e.g. copy) to work across different drive configs. + Help: `Deprecated: use --server-side-across-configs instead. + +Allow server-side operations (e.g. copy) to work across different drive configs. This can be useful if you wish to do a server-side copy between two different Google drives. Note that this isn't enabled by default @@ -588,9 +652,82 @@ This resource key requirement only applies to a subset of old files. Note also that opening the folder once in the web interface (with the user you've authenticated rclone with) seems to be enough so that the -resource key is no needed. +resource key is not needed. +`, + Advanced: true, + Sensitive: true, + }, { + Name: "fast_list_bug_fix", + Help: `Work around a bug in Google Drive listing. + +Normally rclone will work around a bug in Google Drive when using +--fast-list (ListR) where the search "(A in parents) or (B in +parents)" returns nothing sometimes. See #3114, #4289 and +https://issuetracker.google.com/issues/149522397 + +Rclone detects this by finding no items in more than one directory +when listing and retries them as lists of individual directories. + +This means that if you have a lot of empty directories rclone will end +up listing them all individually and this can take many more API +calls. + +This flag allows the work-around to be disabled. This is **not** +recommended in normal use - only if you have a particular case you are +having trouble with like many empty directories. `, Advanced: true, + Default: true, + }, { + Name: "metadata_owner", + Help: `Control whether owner should be read or written in metadata. + +Owner is a standard part of the file metadata so is easy to read. But it +isn't always desirable to set the owner from the metadata. + +Note that you can't set the owner on Shared Drives, and that setting +ownership will generate an email to the new owner (this can't be +disabled), and you can't transfer ownership to someone outside your +organization. +`, + Advanced: true, + Default: rwRead, + Examples: rwExamples, + }, { + Name: "metadata_permissions", + Help: `Control whether permissions should be read or written in metadata. + +Reading permissions metadata from files can be done quickly, but it +isn't always desirable to set the permissions from the metadata. + +Note that rclone drops any inherited permissions on Shared Drives and +any owner permission on My Drives as these are duplicated in the owner +metadata. +`, + Advanced: true, + Default: rwOff, + Examples: rwExamples, + }, { + Name: "metadata_labels", + Help: `Control whether labels should be read or written in metadata. + +Reading labels metadata from files takes an extra API transaction and +will slow down listings. It isn't always desirable to set the labels +from the metadata. + +The format of labels is documented in the drive API documentation at +https://developers.google.com/drive/api/reference/rest/v3/Label - +rclone just provides a JSON dump of this format. + +When setting labels, the label and fields must already exist - rclone +will not create them. This means that if you are transferring labels +from two different accounts you will have to create the labels in +advance and use the metadata mapper to translate the IDs between the +two accounts. +`, + Advanced: true, + Default: rwOff, + Examples: rwExamples, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -598,6 +735,18 @@ resource key is no needed. // Encode invalid UTF-8 bytes as json doesn't handle them properly. // Don't encode / as it's a valid name character in drive. Default: encoder.EncodeInvalidUtf8, + }, { + Name: "env_auth", + Help: "Get IAM credentials from runtime (environment variables or instance meta data if no env vars).\n\nOnly applies if service_account_file and service_account_credentials is blank.", + Default: false, + Advanced: true, + Examples: []fs.OptionExample{{ + Value: "false", + Help: "Enter credentials in the next step.", + }, { + Value: "true", + Help: "Get GCP IAM credentials from the environment (env vars or IAM).", + }}, }}...), }) @@ -626,6 +775,7 @@ type Options struct { UseTrash bool `config:"use_trash"` CopyShortcutContent bool `config:"copy_shortcut_content"` SkipGdocs bool `config:"skip_gdocs"` + ShowAllGdocs bool `config:"show_all_gdocs"` SkipChecksumGphotos bool `config:"skip_checksum_gphotos"` SharedWithMe bool `config:"shared_with_me"` TrashedOnly bool `config:"trashed_only"` @@ -653,7 +803,12 @@ type Options struct { SkipShortcuts bool `config:"skip_shortcuts"` SkipDanglingShortcuts bool `config:"skip_dangling_shortcuts"` ResourceKey string `config:"resource_key"` + FastListBugFix bool `config:"fast_list_bug_fix"` + MetadataOwner rwChoice `config:"metadata_owner"` + MetadataPermissions rwChoice `config:"metadata_permissions"` + MetadataLabels rwChoice `config:"metadata_labels"` Enc encoder.MultiEncoder `config:"encoding"` + EnvAuth bool `config:"env_auth"` } // Fs represents a remote drive server @@ -673,23 +828,25 @@ type Fs struct { exportExtensions []string // preferred extensions to download docs importMimeTypes []string // MIME types to convert to docs isTeamDrive bool // true if this is a team drive - fileFields googleapi.Field // fields to fetch file info with m configmap.Mapper - grouping int32 // number of IDs to search at once in ListR - read with atomic - listRmu *sync.Mutex // protects listRempties - listRempties map[string]struct{} // IDs of supposedly empty directories which triggered grouping disable - dirResourceKeys *sync.Map // map directory ID to resource key + grouping int32 // number of IDs to search at once in ListR - read with atomic + listRmu *sync.Mutex // protects listRempties + listRempties map[string]struct{} // IDs of supposedly empty directories which triggered grouping disable + dirResourceKeys *sync.Map // map directory ID to resource key + permissionsMu *sync.Mutex // protect the below + permissions map[string]*drive.Permission // map permission IDs to Permissions } type baseObject struct { - fs *Fs // what this object is part of - remote string // The remote path - id string // Drive Id of this object - modifiedDate string // RFC3339 time it was last modified - mimeType string // The object MIME type - bytes int64 // size of the object - parents []string // IDs of the parent directories - resourceKey *string // resourceKey is needed for link shared objects + fs *Fs // what this object is part of + remote string // The remote path + id string // Drive Id of this object + modifiedDate string // RFC3339 time it was last modified + mimeType string // The object MIME type + bytes int64 // size of the object + parents []string // IDs of the parent directories + resourceKey *string // resourceKey is needed for link shared objects + metadata *fs.Metadata // metadata if known } type documentObject struct { baseObject @@ -708,6 +865,8 @@ type Object struct { baseObject url string // Download URL of this object md5sum string // md5sum of the object + sha1sum string // sha1sum of the object + sha256sum string // sha256sum of the object v2Download bool // generate v2 download link ondemand } @@ -936,7 +1095,7 @@ func (f *Fs) list(ctx context.Context, dirIDs []string, title string, directorie list.Header().Add("X-Goog-Drive-Resource-Keys", resourceKeysHeader) } - fields := fmt.Sprintf("files(%s),nextPageToken,incompleteSearch", f.fileFields) + fields := fmt.Sprintf("files(%s),nextPageToken,incompleteSearch", f.getFileFields(ctx)) OUTER: for { @@ -1122,6 +1281,12 @@ func createOAuthClient(ctx context.Context, opt *Options, name string, m configm if err != nil { return nil, fmt.Errorf("failed to create oauth client from service account: %w", err) } + } else if opt.EnvAuth { + scopes := driveScopes(opt.Scope) + oAuthClient, err = google.DefaultClient(ctx, scopes...) + if err != nil { + return nil, fmt.Errorf("failed to create client from environment: %w", err) + } } else { oAuthClient, _, err = oauthutil.NewClientWithBaseClient(ctx, name, m, driveConfig, getClient(ctx, opt)) if err != nil { @@ -1204,9 +1369,10 @@ func newFs(ctx context.Context, name, path string, m configmap.Mapper) (*Fs, err listRmu: new(sync.Mutex), listRempties: make(map[string]struct{}), dirResourceKeys: new(sync.Map), + permissionsMu: new(sync.Mutex), + permissions: make(map[string]*drive.Permission), } f.isTeamDrive = opt.TeamDriveID != "" - f.fileFields = f.getFileFields() f.features = (&fs.Features{ DuplicateFiles: true, ReadMimeType: true, @@ -1214,6 +1380,9 @@ func newFs(ctx context.Context, name, path string, m configmap.Mapper) (*Fs, err CanHaveEmptyDirectories: true, ServerSideAcrossConfigs: opt.ServerSideAcrossConfigs, FilterAware: true, + ReadMetadata: true, + WriteMetadata: true, + UserMetadata: true, }).Fill(ctx, f) // Create a new authorized Drive client. @@ -1318,7 +1487,7 @@ func NewFs(ctx context.Context, name, path string, m configmap.Mapper) (fs.Fs, e return f, nil } -func (f *Fs) newBaseObject(remote string, info *drive.File) baseObject { +func (f *Fs) newBaseObject(ctx context.Context, remote string, info *drive.File) (o baseObject, err error) { modifiedDate := info.ModifiedTime if f.opt.UseCreatedDate { modifiedDate = info.CreatedTime @@ -1329,7 +1498,7 @@ func (f *Fs) newBaseObject(remote string, info *drive.File) baseObject { if f.opt.SizeAsQuota { size = info.QuotaBytesUsed } - return baseObject{ + o = baseObject{ fs: f, remote: remote, id: info.Id, @@ -1338,10 +1507,15 @@ func (f *Fs) newBaseObject(remote string, info *drive.File) baseObject { bytes: size, parents: info.Parents, } + err = nil + if fs.GetConfig(ctx).Metadata { + err = o.parseMetadata(ctx, info) + } + return o, err } // getFileFields gets the fields for a normal file Get or List -func (f *Fs) getFileFields() (fields googleapi.Field) { +func (f *Fs) getFileFields(ctx context.Context) (fields googleapi.Field) { fields = partialFields if f.opt.AuthOwnerOnly { fields += ",owners" @@ -1355,40 +1529,53 @@ func (f *Fs) getFileFields() (fields googleapi.Field) { if f.opt.SizeAsQuota { fields += ",quotaBytesUsed" } + if fs.GetConfig(ctx).Metadata { + fields += "," + metadataFields + } return fields } // newRegularObject creates an fs.Object for a normal drive.File -func (f *Fs) newRegularObject(remote string, info *drive.File) fs.Object { +func (f *Fs) newRegularObject(ctx context.Context, remote string, info *drive.File) (obj fs.Object, err error) { // wipe checksum if SkipChecksumGphotos and file is type Photo or Video if f.opt.SkipChecksumGphotos { for _, space := range info.Spaces { if space == "photos" { info.Md5Checksum = "" + info.Sha1Checksum = "" + info.Sha256Checksum = "" break } } } o := &Object{ - baseObject: f.newBaseObject(remote, info), url: fmt.Sprintf("%sfiles/%s?alt=media", f.svc.BasePath, actualID(info.Id)), md5sum: strings.ToLower(info.Md5Checksum), + sha1sum: strings.ToLower(info.Sha1Checksum), + sha256sum: strings.ToLower(info.Sha256Checksum), v2Download: f.opt.V2DownloadMinSize != -1 && info.Size >= int64(f.opt.V2DownloadMinSize), } + o.baseObject, err = f.newBaseObject(ctx, remote, info) + if err != nil { + return nil, err + } if info.ResourceKey != "" { o.resourceKey = &info.ResourceKey } - return o + return o, nil } // newDocumentObject creates an fs.Object for a google docs drive.File -func (f *Fs) newDocumentObject(remote string, info *drive.File, extension, exportMimeType string) (fs.Object, error) { +func (f *Fs) newDocumentObject(ctx context.Context, remote string, info *drive.File, extension, exportMimeType string) (fs.Object, error) { mediaType, _, err := mime.ParseMediaType(exportMimeType) if err != nil { return nil, err } url := info.ExportLinks[mediaType] - baseObject := f.newBaseObject(remote+extension, info) + baseObject, err := f.newBaseObject(ctx, remote+extension, info) + if err != nil { + return nil, err + } baseObject.bytes = -1 baseObject.mimeType = exportMimeType return &documentObject{ @@ -1400,7 +1587,7 @@ func (f *Fs) newDocumentObject(remote string, info *drive.File, extension, expor } // newLinkObject creates an fs.Object that represents a link a google docs drive.File -func (f *Fs) newLinkObject(remote string, info *drive.File, extension, exportMimeType string) (fs.Object, error) { +func (f *Fs) newLinkObject(ctx context.Context, remote string, info *drive.File, extension, exportMimeType string) (fs.Object, error) { t := linkTemplate(exportMimeType) if t == nil { return nil, fmt.Errorf("unsupported link type %s", exportMimeType) @@ -1419,7 +1606,10 @@ func (f *Fs) newLinkObject(remote string, info *drive.File, extension, exportMim return nil, fmt.Errorf("executing template failed: %w", err) } - baseObject := f.newBaseObject(remote+extension, info) + baseObject, err := f.newBaseObject(ctx, remote+extension, info) + if err != nil { + return nil, err + } baseObject.bytes = int64(buf.Len()) baseObject.mimeType = exportMimeType return &linkObject{ @@ -1435,7 +1625,7 @@ func (f *Fs) newLinkObject(remote string, info *drive.File, extension, exportMim func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *drive.File) (fs.Object, error) { // If item has MD5 sum it is a file stored on drive if info.Md5Checksum != "" { - return f.newRegularObject(remote, info), nil + return f.newRegularObject(ctx, remote, info) } extension, exportName, exportMimeType, isDocument := f.findExportFormat(ctx, info) @@ -1466,13 +1656,15 @@ func (f *Fs) newObjectWithExportInfo( case info.MimeType == shortcutMimeTypeDangling: // Pretend a dangling shortcut is a regular object // It will error if used, but appear in listings so it can be deleted - return f.newRegularObject(remote, info), nil + return f.newRegularObject(ctx, remote, info) case info.Md5Checksum != "": // If item has MD5 sum it is a file stored on drive - return f.newRegularObject(remote, info), nil + return f.newRegularObject(ctx, remote, info) case f.opt.SkipGdocs: fs.Debugf(remote, "Skipping google document type %q", info.MimeType) return nil, fs.ErrorObjectNotFound + case f.opt.ShowAllGdocs: + return f.newDocumentObject(ctx, remote, info, "", info.MimeType) default: // If item MimeType is in the ExportFormats then it is a google doc if !isDocument { @@ -1484,15 +1676,18 @@ func (f *Fs) newObjectWithExportInfo( return nil, fs.ErrorObjectNotFound } if isLinkMimeType(exportMimeType) { - return f.newLinkObject(remote, info, extension, exportMimeType) + return f.newLinkObject(ctx, remote, info, extension, exportMimeType) } - return f.newDocumentObject(remote, info, extension, exportMimeType) + return f.newDocumentObject(ctx, remote, info, extension, exportMimeType) } } // NewObject finds the Object at remote. If it can't be found // it returns the error fs.ErrorObjectNotFound. func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + if strings.HasSuffix(remote, "/") { + return nil, fs.ErrorIsDir + } info, extension, exportName, exportMimeType, isDocument, err := f.getRemoteInfoWithExport(ctx, remote) if err != nil { return nil, err @@ -1862,7 +2057,7 @@ func (f *Fs) listRRunner(ctx context.Context, wg *sync.WaitGroup, in chan listRE // drive where (A in parents) or (B in parents) returns nothing // sometimes. See #3114, #4289 and // https://issuetracker.google.com/issues/149522397 - if len(dirs) > 1 && !foundItems { + if f.opt.FastListBugFix && len(dirs) > 1 && !foundItems { if atomic.SwapInt32(&f.grouping, 1) != 1 { fs.Debugf(f, "Disabling ListR to work around bug in drive as multi listing (%d) returned no entries", len(dirs)) } @@ -2111,7 +2306,7 @@ func (f *Fs) resolveShortcut(ctx context.Context, item *drive.File) (newItem *dr fs.Errorf(nil, "Expecting shortcutDetails in %v", item) return item, nil } - newItem, err = f.getFile(ctx, item.ShortcutDetails.TargetId, f.fileFields) + newItem, err = f.getFile(ctx, item.ShortcutDetails.TargetId, f.getFileFields(ctx)) if err != nil { var gerr *googleapi.Error if errors.As(err, &gerr) && gerr.Code == 404 { @@ -2243,6 +2438,10 @@ func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, } else { createInfo.MimeType = fs.MimeTypeFromName(remote) } + updateMetadata, err := f.fetchAndUpdateMetadata(ctx, src, options, createInfo, false) + if err != nil { + return nil, err + } var info *drive.File if size >= 0 && size < int64(f.opt.UploadCutoff) { @@ -2267,6 +2466,10 @@ func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, return nil, err } } + err = updateMetadata(ctx, info) + if err != nil { + return nil, err + } return f.newObjectWithInfo(ctx, remote, info) } @@ -2880,6 +3083,7 @@ func (f *Fs) changeNotifyRunner(ctx context.Context, notifyFunc func(string, fs. if f.rootFolderID == "appDataFolder" { changesCall.Spaces("appDataFolder") } + changesCall.RestrictToMyDrive(!f.opt.SharedWithMe) changeList, err = changesCall.Context(ctx).Do() return f.shouldRetry(ctx, err) }) @@ -2954,7 +3158,7 @@ func (f *Fs) DirCacheFlush() { // Hashes returns the supported hash sets. func (f *Fs) Hashes() hash.Set { - return hash.Set(hash.MD5) + return hash.NewHashSet(hash.MD5, hash.SHA1, hash.SHA256) } func (f *Fs) changeChunkSize(chunkSizeString string) (err error) { @@ -3183,7 +3387,7 @@ func (f *Fs) unTrashDir(ctx context.Context, dir string, recurse bool) (r unTras // copy file with id to dest func (f *Fs) copyID(ctx context.Context, id, dest string) (err error) { - info, err := f.getFile(ctx, id, f.fileFields) + info, err := f.getFile(ctx, id, f.getFileFields(ctx)) if err != nil { return fmt.Errorf("couldn't find id: %w", err) } @@ -3515,10 +3719,16 @@ func (o *baseObject) Remote() string { // Hash returns the Md5sum of an object returning a lowercase hex string func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { - if t != hash.MD5 { - return "", hash.ErrUnsupported + if t == hash.MD5 { + return o.md5sum, nil + } + if t == hash.SHA1 { + return o.sha1sum, nil } - return o.md5sum, nil + if t == hash.SHA256 { + return o.sha256sum, nil + } + return "", hash.ErrUnsupported } func (o *baseObject) Hash(ctx context.Context, t hash.Type) (string, error) { if t != hash.MD5 { @@ -3857,11 +4067,21 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op MimeType: srcMimeType, ModifiedTime: src.ModTime(ctx).Format(timeFormatOut), } + + updateMetadata, err := o.fs.fetchAndUpdateMetadata(ctx, src, options, updateInfo, true) + if err != nil { + return err + } + info, err := o.baseObject.update(ctx, updateInfo, srcMimeType, in, src) if err != nil { return err } - newO, err := o.fs.newObjectWithInfo(ctx, src.Remote(), info) + err = updateMetadata(ctx, info) + if err != nil { + return err + } + newO, err := o.fs.newObjectWithInfo(ctx, o.remote, info) if err != nil { return err } @@ -3946,6 +4166,26 @@ func (o *baseObject) ParentID() string { return "" } +// Metadata returns metadata for an object +// +// It should return nil if there is no Metadata +func (o *baseObject) Metadata(ctx context.Context) (metadata fs.Metadata, err error) { + if o.metadata != nil { + return *o.metadata, nil + } + fs.Debugf(o, "Fetching metadata") + id := actualID(o.id) + info, err := o.fs.getFile(ctx, id, o.fs.getFileFields(ctx)) + if err != nil { + return nil, err + } + err = o.parseMetadata(ctx, info) + if err != nil { + return nil, err + } + return *o.metadata, nil +} + func (o *documentObject) ext() string { return o.baseObject.remote[len(o.baseObject.remote)-o.extLen:] } @@ -4007,6 +4247,7 @@ var ( _ fs.MimeTyper = (*Object)(nil) _ fs.IDer = (*Object)(nil) _ fs.ParentIDer = (*Object)(nil) + _ fs.Metadataer = (*Object)(nil) _ fs.Object = (*documentObject)(nil) _ fs.MimeTyper = (*documentObject)(nil) _ fs.IDer = (*documentObject)(nil) diff --git a/backend/drive/metadata.go b/backend/drive/metadata.go new file mode 100644 index 0000000000000..ab2ae94d048bf --- /dev/null +++ b/backend/drive/metadata.go @@ -0,0 +1,608 @@ +package drive + +import ( + "context" + "encoding/json" + "fmt" + "strconv" + "strings" + "sync" + + "github.com/rclone/rclone/fs" + "golang.org/x/sync/errgroup" + drive "google.golang.org/api/drive/v3" + "google.golang.org/api/googleapi" +) + +// system metadata keys which this backend owns +var systemMetadataInfo = map[string]fs.MetadataHelp{ + "content-type": { + Help: "The MIME type of the file.", + Type: "string", + Example: "text/plain", + }, + "mtime": { + Help: "Time of last modification with mS accuracy.", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999Z07:00", + }, + "btime": { + Help: "Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates.", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999Z07:00", + }, + "copy-requires-writer-permission": { + Help: "Whether the options to copy, print, or download this file, should be disabled for readers and commenters.", + Type: "boolean", + Example: "true", + }, + "writers-can-share": { + Help: "Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.", + Type: "boolean", + Example: "false", + }, + "viewed-by-me": { + Help: "Whether the file has been viewed by this user.", + Type: "boolean", + Example: "true", + ReadOnly: true, + }, + "owner": { + Help: "The owner of the file. Usually an email address. Enable with --drive-metadata-owner.", + Type: "string", + Example: "user@example.com", + }, + "permissions": { + Help: "Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions.", + Type: "JSON", + Example: "{}", + }, + "folder-color-rgb": { + Help: "The color for a folder or a shortcut to a folder as an RGB hex string.", + Type: "string", + Example: "881133", + }, + "description": { + Help: "A short description of the file.", + Type: "string", + Example: "Contract for signing", + }, + "starred": { + Help: "Whether the user has starred the file.", + Type: "boolean", + Example: "false", + }, + "labels": { + Help: "Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels.", + Type: "JSON", + Example: "[]", + }, +} + +// Extra fields we need to fetch to implement the system metadata above +var metadataFields = googleapi.Field(strings.Join([]string{ + "copyRequiresWriterPermission", + "description", + "folderColorRgb", + "hasAugmentedPermissions", + "owners", + "permissionIds", + "permissions", + "properties", + "starred", + "viewedByMe", + "viewedByMeTime", + "writersCanShare", +}, ",")) + +// Fields we need to read from permissions +var permissionsFields = googleapi.Field(strings.Join([]string{ + "*", + "permissionDetails/*", +}, ",")) + +// getPermission returns permissions for the fileID and permissionID passed in +func (f *Fs) getPermission(ctx context.Context, fileID, permissionID string, useCache bool) (perm *drive.Permission, inherited bool, err error) { + f.permissionsMu.Lock() + defer f.permissionsMu.Unlock() + if useCache { + perm = f.permissions[permissionID] + if perm != nil { + return perm, false, nil + } + } + fs.Debugf(f, "Fetching permission %q", permissionID) + err = f.pacer.Call(func() (bool, error) { + perm, err = f.svc.Permissions.Get(fileID, permissionID). + Fields(permissionsFields). + SupportsAllDrives(true). + Context(ctx).Do() + return f.shouldRetry(ctx, err) + }) + if err != nil { + return nil, false, err + } + + inherited = len(perm.PermissionDetails) > 0 && perm.PermissionDetails[0].Inherited + + cleanPermission(perm) + + // cache the permission + f.permissions[permissionID] = perm + + return perm, inherited, err +} + +// Set the permissions on the info +func (f *Fs) setPermissions(ctx context.Context, info *drive.File, permissions []*drive.Permission) (err error) { + for _, perm := range permissions { + if perm.Role == "owner" { + // ignore owner permissions - these are set with owner + continue + } + cleanPermissionForWrite(perm) + err = f.pacer.Call(func() (bool, error) { + _, err = f.svc.Permissions.Create(info.Id, perm). + SupportsAllDrives(true). + Context(ctx).Do() + return f.shouldRetry(ctx, err) + }) + if err != nil { + return fmt.Errorf("failed to set permission: %w", err) + } + } + return nil +} + +// Clean attributes from permissions which we can't write +func cleanPermissionForWrite(perm *drive.Permission) { + perm.Deleted = false + perm.DisplayName = "" + perm.Id = "" + perm.Kind = "" + perm.PermissionDetails = nil + perm.TeamDrivePermissionDetails = nil +} + +// Clean and cache the permission if not already cached +func (f *Fs) cleanAndCachePermission(perm *drive.Permission) { + f.permissionsMu.Lock() + defer f.permissionsMu.Unlock() + cleanPermission(perm) + if _, found := f.permissions[perm.Id]; !found { + f.permissions[perm.Id] = perm + } +} + +// Clean fields we don't need to keep from the permission +func cleanPermission(perm *drive.Permission) { + // DisplayName: Output only. The "pretty" name of the value of the + // permission. The following is a list of examples for each type of + // permission: * `user` - User's full name, as defined for their Google + // account, such as "Joe Smith." * `group` - Name of the Google Group, + // such as "The Company Administrators." * `domain` - String domain + // name, such as "thecompany.com." * `anyone` - No `displayName` is + // present. + perm.DisplayName = "" + + // Kind: Output only. Identifies what kind of resource this is. Value: + // the fixed string "drive#permission". + perm.Kind = "" + + // PermissionDetails: Output only. Details of whether the permissions on + // this shared drive item are inherited or directly on this item. This + // is an output-only field which is present only for shared drive items. + perm.PermissionDetails = nil + + // PhotoLink: Output only. A link to the user's profile photo, if + // available. + perm.PhotoLink = "" + + // TeamDrivePermissionDetails: Output only. Deprecated: Output only. Use + // `permissionDetails` instead. + perm.TeamDrivePermissionDetails = nil +} + +// Fields we need to read from labels +var labelsFields = googleapi.Field(strings.Join([]string{ + "*", +}, ",")) + +// getLabels returns labels for the fileID passed in +func (f *Fs) getLabels(ctx context.Context, fileID string) (labels []*drive.Label, err error) { + fs.Debugf(f, "Fetching labels for %q", fileID) + listLabels := f.svc.Files.ListLabels(fileID). + Fields(labelsFields). + Context(ctx) + for { + var info *drive.LabelList + err = f.pacer.Call(func() (bool, error) { + info, err = listLabels.Do() + return f.shouldRetry(ctx, err) + }) + if err != nil { + return nil, err + } + labels = append(labels, info.Labels...) + if info.NextPageToken == "" { + break + } + listLabels.PageToken(info.NextPageToken) + } + for _, label := range labels { + cleanLabel(label) + } + return labels, nil +} + +// Set the labels on the info +func (f *Fs) setLabels(ctx context.Context, info *drive.File, labels []*drive.Label) (err error) { + if len(labels) == 0 { + return nil + } + req := drive.ModifyLabelsRequest{} + for _, label := range labels { + req.LabelModifications = append(req.LabelModifications, &drive.LabelModification{ + FieldModifications: labelFieldsToFieldModifications(label.Fields), + LabelId: label.Id, + }) + } + err = f.pacer.Call(func() (bool, error) { + _, err = f.svc.Files.ModifyLabels(info.Id, &req). + Context(ctx).Do() + return f.shouldRetry(ctx, err) + }) + if err != nil { + return fmt.Errorf("failed to set owner: %w", err) + } + return nil +} + +// Convert label fields into something which can set the fields +func labelFieldsToFieldModifications(fields map[string]drive.LabelField) (out []*drive.LabelFieldModification) { + for id, field := range fields { + var emails []string + for _, user := range field.User { + emails = append(emails, user.EmailAddress) + } + out = append(out, &drive.LabelFieldModification{ + // FieldId: The ID of the field to be modified. + FieldId: id, + + // SetDateValues: Replaces the value of a dateString Field with these + // new values. The string must be in the RFC 3339 full-date format: + // YYYY-MM-DD. + SetDateValues: field.DateString, + + // SetIntegerValues: Replaces the value of an `integer` field with these + // new values. + SetIntegerValues: field.Integer, + + // SetSelectionValues: Replaces a `selection` field with these new + // values. + SetSelectionValues: field.Selection, + + // SetTextValues: Sets the value of a `text` field. + SetTextValues: field.Text, + + // SetUserValues: Replaces a `user` field with these new values. The + // values must be valid email addresses. + SetUserValues: emails, + }) + } + return out +} + +// Clean fields we don't need to keep from the label +func cleanLabel(label *drive.Label) { + // Kind: This is always drive#label + label.Kind = "" + + for name, field := range label.Fields { + // Kind: This is always drive#labelField. + field.Kind = "" + + // Note the fields are copies so we need to write them + // back to the map + label.Fields[name] = field + } +} + +// Parse the metadata from drive item +// +// It should return nil if there is no Metadata +func (o *baseObject) parseMetadata(ctx context.Context, info *drive.File) (err error) { + metadata := make(fs.Metadata, 16) + + // Dump user metadata first as it overrides system metadata + for k, v := range info.Properties { + metadata[k] = v + } + + // System metadata + metadata["copy-requires-writer-permission"] = fmt.Sprint(info.CopyRequiresWriterPermission) + metadata["writers-can-share"] = fmt.Sprint(info.WritersCanShare) + metadata["viewed-by-me"] = fmt.Sprint(info.ViewedByMe) + metadata["content-type"] = info.MimeType + + // Owners: Output only. The owner of this file. Only certain legacy + // files may have more than one owner. This field isn't populated for + // items in shared drives. + if o.fs.opt.MetadataOwner.IsSet(rwRead) && len(info.Owners) > 0 { + user := info.Owners[0] + if len(info.Owners) > 1 { + fs.Logf(o, "Ignoring more than 1 owner") + } + if user != nil { + id := user.EmailAddress + if id == "" { + id = user.DisplayName + } + metadata["owner"] = id + } + } + + if o.fs.opt.MetadataPermissions.IsSet(rwRead) { + // We only write permissions out if they are not inherited. + // + // On My Drives permissions seem to be attached to every item + // so they will always be written out. + // + // On Shared Drives only non-inherited permissions will be + // written out. + + // To read the inherited permissions flag will mean we need to + // read the permissions for each object and the cache will be + // useless. However shared drives don't return permissions + // only permissionIds so will need to fetch them for each + // object. We use HasAugmentedPermissions to see if there are + // special permissions before fetching them to save transactions. + + // HasAugmentedPermissions: Output only. Whether there are permissions + // directly on this file. This field is only populated for items in + // shared drives. + if o.fs.isTeamDrive && !info.HasAugmentedPermissions { + // Don't process permissions if there aren't any specifically set + info.Permissions = nil + info.PermissionIds = nil + } + + // PermissionIds: Output only. List of permission IDs for users with + // access to this file. + // + // Only process these if we have no Permissions + if len(info.PermissionIds) > 0 && len(info.Permissions) == 0 { + info.Permissions = make([]*drive.Permission, 0, len(info.PermissionIds)) + g, gCtx := errgroup.WithContext(ctx) + g.SetLimit(o.fs.ci.Checkers) + var mu sync.Mutex // protect the info.Permissions from concurrent writes + for _, permissionID := range info.PermissionIds { + permissionID := permissionID + g.Go(func() error { + // must fetch the team drive ones individually to check the inherited flag + perm, inherited, err := o.fs.getPermission(gCtx, actualID(info.Id), permissionID, !o.fs.isTeamDrive) + if err != nil { + return fmt.Errorf("failed to read permission: %w", err) + } + // Don't write inherited permissions out + if inherited { + return nil + } + // Don't write owner role out - these are covered by the owner metadata + if perm.Role == "owner" { + return nil + } + mu.Lock() + info.Permissions = append(info.Permissions, perm) + mu.Unlock() + return nil + }) + } + err = g.Wait() + if err != nil { + return err + } + } else { + // Clean the fetched permissions + for _, perm := range info.Permissions { + o.fs.cleanAndCachePermission(perm) + } + } + + // Permissions: Output only. The full list of permissions for the file. + // This is only available if the requesting user can share the file. Not + // populated for items in shared drives. + if len(info.Permissions) > 0 { + buf, err := json.Marshal(info.Permissions) + if err != nil { + return fmt.Errorf("failed to marshal permissions: %w", err) + } + metadata["permissions"] = string(buf) + } + + // Permission propagation + // https://developers.google.com/drive/api/guides/manage-sharing#permission-propagation + // Leads me to believe that in non shared drives, permissions + // are added to each item when you set permissions for a + // folder whereas in shared drives they are inherited and + // placed on the item directly. + } + + if info.FolderColorRgb != "" { + metadata["folder-color-rgb"] = info.FolderColorRgb + } + if info.Description != "" { + metadata["description"] = info.Description + } + metadata["starred"] = fmt.Sprint(info.Starred) + metadata["btime"] = info.CreatedTime + metadata["mtime"] = info.ModifiedTime + + if o.fs.opt.MetadataLabels.IsSet(rwRead) { + // FIXME would be really nice if we knew if files had labels + // before listing but we need to know all possible label IDs + // to get it in the listing. + + labels, err := o.fs.getLabels(ctx, actualID(info.Id)) + if err != nil { + return fmt.Errorf("failed to fetch labels: %w", err) + } + buf, err := json.Marshal(labels) + if err != nil { + return fmt.Errorf("failed to marshal labels: %w", err) + } + metadata["labels"] = string(buf) + } + + o.metadata = &metadata + return nil +} + +// Set the owner on the info +func (f *Fs) setOwner(ctx context.Context, info *drive.File, owner string) (err error) { + perm := drive.Permission{ + Role: "owner", + EmailAddress: owner, + // Type: The type of the grantee. Valid values are: * `user` * `group` * + // `domain` * `anyone` When creating a permission, if `type` is `user` + // or `group`, you must provide an `emailAddress` for the user or group. + // When `type` is `domain`, you must provide a `domain`. There isn't + // extra information required for an `anyone` type. + Type: "user", + } + err = f.pacer.Call(func() (bool, error) { + _, err = f.svc.Permissions.Create(info.Id, &perm). + SupportsAllDrives(true). + TransferOwnership(true). + // SendNotificationEmail(false). - required apparently! + Context(ctx).Do() + return f.shouldRetry(ctx, err) + }) + if err != nil { + return fmt.Errorf("failed to set owner: %w", err) + } + return nil +} + +// Call back to set metadata that can't be set on the upload/update +// +// The *drive.File passed in holds the current state of the drive.File +// and this should update it with any modifications. +type updateMetadataFn func(context.Context, *drive.File) error + +// read the metadata from meta and write it into updateInfo +// +// update should be true if this is being used to create metadata for +// an update/PATCH call as the rules on what can be updated are +// slightly different there. +// +// It returns a callback which should be called to finish the updates +// after the data is uploaded. +func (f *Fs) updateMetadata(ctx context.Context, updateInfo *drive.File, meta fs.Metadata, update bool) (callback updateMetadataFn, err error) { + callbackFns := []updateMetadataFn{} + callback = func(ctx context.Context, info *drive.File) error { + for _, fn := range callbackFns { + err := fn(ctx, info) + if err != nil { + return err + } + } + return nil + } + // merge metadata into request and user metadata + for k, v := range meta { + k, v := k, v + // parse a boolean from v and write into out + parseBool := func(out *bool) error { + b, err := strconv.ParseBool(v) + if err != nil { + return fmt.Errorf("can't parse metadata %q = %q: %w", k, v, err) + } + *out = b + return nil + } + switch k { + case "copy-requires-writer-permission": + if err := parseBool(&updateInfo.CopyRequiresWriterPermission); err != nil { + return nil, err + } + case "writers-can-share": + if err := parseBool(&updateInfo.WritersCanShare); err != nil { + return nil, err + } + case "viewed-by-me": + // Can't write this + case "content-type": + updateInfo.MimeType = v + case "owner": + if !f.opt.MetadataOwner.IsSet(rwWrite) { + continue + } + // Can't set Owner on upload so need to set afterwards + callbackFns = append(callbackFns, func(ctx context.Context, info *drive.File) error { + return f.setOwner(ctx, info, v) + }) + case "permissions": + if !f.opt.MetadataPermissions.IsSet(rwWrite) { + continue + } + var perms []*drive.Permission + err := json.Unmarshal([]byte(v), &perms) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal permissions: %w", err) + } + // Can't set Permissions on upload so need to set afterwards + callbackFns = append(callbackFns, func(ctx context.Context, info *drive.File) error { + return f.setPermissions(ctx, info, perms) + }) + case "labels": + if !f.opt.MetadataLabels.IsSet(rwWrite) { + continue + } + var labels []*drive.Label + err := json.Unmarshal([]byte(v), &labels) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal labels: %w", err) + } + // Can't set Labels on upload so need to set afterwards + callbackFns = append(callbackFns, func(ctx context.Context, info *drive.File) error { + return f.setLabels(ctx, info, labels) + }) + case "folder-color-rgb": + updateInfo.FolderColorRgb = v + case "description": + updateInfo.Description = v + case "starred": + if err := parseBool(&updateInfo.Starred); err != nil { + return nil, err + } + case "btime": + if update { + fs.Debugf(f, "Skipping btime metadata as can't update it on an existing file: %v", v) + } else { + updateInfo.CreatedTime = v + } + case "mtime": + updateInfo.ModifiedTime = v + default: + if updateInfo.Properties == nil { + updateInfo.Properties = make(map[string]string, 1) + } + updateInfo.Properties[k] = v + } + } + return callback, nil +} + +// Fetch metadata and update updateInfo if --metadata is in use +func (f *Fs) fetchAndUpdateMetadata(ctx context.Context, src fs.ObjectInfo, options []fs.OpenOption, updateInfo *drive.File, update bool) (callback updateMetadataFn, err error) { + meta, err := fs.GetMetadataOptions(ctx, f, src, options) + if err != nil { + return nil, fmt.Errorf("failed to read metadata from source object: %w", err) + } + callback, err = f.updateMetadata(ctx, updateInfo, meta, update) + if err != nil { + return nil, fmt.Errorf("failed to update metadata from source object: %w", err) + } + return callback, nil +} diff --git a/backend/dropbox/batcher.go b/backend/dropbox/batcher.go index 82a4b5524d76e..f55223d1fd2a4 100644 --- a/backend/dropbox/batcher.go +++ b/backend/dropbox/batcher.go @@ -8,122 +8,19 @@ package dropbox import ( "context" - "errors" "fmt" - "sync" - "time" - "github.com/dropbox/dropbox-sdk-go-unofficial/v6/dropbox/async" "github.com/dropbox/dropbox-sdk-go-unofficial/v6/dropbox/files" - "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/fserrors" - "github.com/rclone/rclone/lib/atexit" ) -const ( - maxBatchSize = 1000 // max size the batch can be - defaultTimeoutSync = 500 * time.Millisecond // kick off the batch if nothing added for this long (sync) - defaultTimeoutAsync = 10 * time.Second // kick off the batch if nothing added for this long (ssync) - defaultBatchSizeAsync = 100 // default batch size if async -) - -// batcher holds info about the current items waiting for upload -type batcher struct { - f *Fs // Fs this batch is part of - mode string // configured batch mode - size int // maximum size for batch - timeout time.Duration // idle timeout for batch - async bool // whether we are using async batching - in chan batcherRequest // incoming items to batch - closed chan struct{} // close to indicate batcher shut down - atexit atexit.FnHandle // atexit handle - shutOnce sync.Once // make sure we shutdown once only - wg sync.WaitGroup // wait for shutdown -} - -// batcherRequest holds an incoming request with a place for a reply -type batcherRequest struct { - commitInfo *files.UploadSessionFinishArg - result chan<- batcherResponse -} - -// Return true if batcherRequest is the quit request -func (br *batcherRequest) isQuit() bool { - return br.commitInfo == nil -} - -// Send this to get the engine to quit -var quitRequest = batcherRequest{} - -// batcherResponse holds a response to be delivered to clients waiting -// for a batch to complete. -type batcherResponse struct { - err error - entry *files.FileMetadata -} - -// newBatcher creates a new batcher structure -func newBatcher(ctx context.Context, f *Fs, mode string, size int, timeout time.Duration) (*batcher, error) { - // fs.Debugf(f, "Creating batcher with mode %q, size %d, timeout %v", mode, size, timeout) - if size > maxBatchSize || size < 0 { - return nil, fmt.Errorf("dropbox: batch size must be < %d and >= 0 - it is currently %d", maxBatchSize, size) - } - - async := false - - switch mode { - case "sync": - if size <= 0 { - ci := fs.GetConfig(ctx) - size = ci.Transfers - } - if timeout <= 0 { - timeout = defaultTimeoutSync - } - case "async": - if size <= 0 { - size = defaultBatchSizeAsync - } - if timeout <= 0 { - timeout = defaultTimeoutAsync - } - async = true - case "off": - size = 0 - default: - return nil, fmt.Errorf("dropbox: batch mode must be sync|async|off not %q", mode) - } - - b := &batcher{ - f: f, - mode: mode, - size: size, - timeout: timeout, - async: async, - in: make(chan batcherRequest, size), - closed: make(chan struct{}), - } - if b.Batching() { - b.atexit = atexit.Register(b.Shutdown) - b.wg.Add(1) - go b.commitLoop(context.Background()) - } - return b, nil - -} - -// Batching returns true if batching is active -func (b *batcher) Batching() bool { - return b.size > 0 -} - // finishBatch commits the batch, returning a batch status to poll or maybe complete -func (b *batcher) finishBatch(ctx context.Context, items []*files.UploadSessionFinishArg) (complete *files.UploadSessionFinishBatchResult, err error) { +func (f *Fs) finishBatch(ctx context.Context, items []*files.UploadSessionFinishArg) (complete *files.UploadSessionFinishBatchResult, err error) { var arg = &files.UploadSessionFinishBatchArg{ Entries: items, } - err = b.f.pacer.Call(func() (bool, error) { - complete, err = b.f.srv.UploadSessionFinishBatchV2(arg) + err = f.pacer.Call(func() (bool, error) { + complete, err = f.srv.UploadSessionFinishBatchV2(arg) // If error is insufficient space then don't retry if e, ok := err.(files.UploadSessionFinishAPIError); ok { if e.EndpointError != nil && e.EndpointError.Path != nil && e.EndpointError.Path.Tag == files.WriteErrorInsufficientSpace { @@ -140,66 +37,10 @@ func (b *batcher) finishBatch(ctx context.Context, items []*files.UploadSessionF return complete, nil } -// finishBatchJobStatus waits for the batch to complete returning completed entries -func (b *batcher) finishBatchJobStatus(ctx context.Context, launchBatchStatus *files.UploadSessionFinishBatchLaunch) (complete *files.UploadSessionFinishBatchResult, err error) { - if launchBatchStatus.AsyncJobId == "" { - return nil, errors.New("wait for batch completion: empty job ID") - } - var batchStatus *files.UploadSessionFinishBatchJobStatus - sleepTime := 100 * time.Millisecond - const maxSleepTime = 1 * time.Second - startTime := time.Now() - try := 1 - for { - remaining := time.Duration(b.f.opt.BatchCommitTimeout) - time.Since(startTime) - if remaining < 0 { - break - } - err = b.f.pacer.Call(func() (bool, error) { - batchStatus, err = b.f.srv.UploadSessionFinishBatchCheck(&async.PollArg{ - AsyncJobId: launchBatchStatus.AsyncJobId, - }) - return shouldRetry(ctx, err) - }) - if err != nil { - fs.Debugf(b.f, "Wait for batch: sleeping for %v after error: %v: try %d remaining %v", sleepTime, err, try, remaining) - } else { - if batchStatus.Tag == "complete" { - fs.Debugf(b.f, "Upload batch completed in %v", time.Since(startTime)) - return batchStatus.Complete, nil - } - fs.Debugf(b.f, "Wait for batch: sleeping for %v after status: %q: try %d remaining %v", sleepTime, batchStatus.Tag, try, remaining) - } - time.Sleep(sleepTime) - sleepTime *= 2 - if sleepTime > maxSleepTime { - sleepTime = maxSleepTime - } - try++ - } - if err == nil { - err = errors.New("batch didn't complete") - } - return nil, fmt.Errorf("wait for batch failed after %d tries in %v: %w", try, time.Since(startTime), err) -} - -// commit a batch -func (b *batcher) commitBatch(ctx context.Context, items []*files.UploadSessionFinishArg, results []chan<- batcherResponse) (err error) { - // If commit fails then signal clients if sync - var signalled = b.async - defer func() { - if err != nil && signalled { - // Signal to clients that there was an error - for _, result := range results { - result <- batcherResponse{err: err} - } - } - }() - desc := fmt.Sprintf("%s batch length %d starting with: %s", b.mode, len(items), items[0].Commit.Path) - fs.Debugf(b.f, "Committing %s", desc) - +// Called by the batcher to commit a batch +func (f *Fs) commitBatch(ctx context.Context, items []*files.UploadSessionFinishArg, results []*files.FileMetadata, errors []error) (err error) { // finalise the batch getting either a result or a job id to poll - complete, err := b.finishBatch(ctx, items) + complete, err := f.finishBatch(ctx, items) if err != nil { return err } @@ -210,19 +51,13 @@ func (b *batcher) commitBatch(ctx context.Context, items []*files.UploadSessionF return fmt.Errorf("expecting %d items in batch but got %d", len(results), len(entries)) } - // Report results to clients - var ( - errorTag = "" - errorCount = 0 - ) + // Format results for return for i := range results { item := entries[i] - resp := batcherResponse{} if item.Tag == "success" { - resp.entry = item.Success + results[i] = item.Success } else { - errorCount++ - errorTag = item.Tag + errorTag := item.Tag if item.Failure != nil { errorTag = item.Failure.Tag if item.Failure.LookupFailed != nil { @@ -235,112 +70,9 @@ func (b *batcher) commitBatch(ctx context.Context, items []*files.UploadSessionF errorTag += "/" + item.Failure.PropertiesError.Tag } } - resp.err = fmt.Errorf("batch upload failed: %s", errorTag) - } - if !b.async { - results[i] <- resp + errors[i] = fmt.Errorf("upload failed: %s", errorTag) } } - // Show signalled so no need to report error to clients from now on - signalled = true - // Report an error if any failed in the batch - if errorTag != "" { - return fmt.Errorf("batch had %d errors: last error: %s", errorCount, errorTag) - } - - fs.Debugf(b.f, "Committed %s", desc) return nil } - -// commitLoop runs the commit engine in the background -func (b *batcher) commitLoop(ctx context.Context) { - var ( - items []*files.UploadSessionFinishArg // current batch of uncommitted files - results []chan<- batcherResponse // current batch of clients awaiting results - idleTimer = time.NewTimer(b.timeout) - commit = func() { - err := b.commitBatch(ctx, items, results) - if err != nil { - fs.Errorf(b.f, "%s batch commit: failed to commit batch length %d: %v", b.mode, len(items), err) - } - items, results = nil, nil - } - ) - defer b.wg.Done() - defer idleTimer.Stop() - idleTimer.Stop() - -outer: - for { - select { - case req := <-b.in: - if req.isQuit() { - break outer - } - items = append(items, req.commitInfo) - results = append(results, req.result) - idleTimer.Stop() - if len(items) >= b.size { - commit() - } else { - idleTimer.Reset(b.timeout) - } - case <-idleTimer.C: - if len(items) > 0 { - fs.Debugf(b.f, "Batch idle for %v so committing", b.timeout) - commit() - } - } - - } - // commit any remaining items - if len(items) > 0 { - commit() - } -} - -// Shutdown finishes any pending batches then shuts everything down -// -// Can be called from atexit handler -func (b *batcher) Shutdown() { - if !b.Batching() { - return - } - b.shutOnce.Do(func() { - atexit.Unregister(b.atexit) - fs.Infof(b.f, "Committing uploads - please wait...") - // show that batcher is shutting down - close(b.closed) - // quit the commitLoop by sending a quitRequest message - // - // Note that we don't close b.in because that will - // cause write to closed channel in Commit when we are - // exiting due to a signal. - b.in <- quitRequest - b.wg.Wait() - }) -} - -// Commit commits the file using a batch call, first adding it to the -// batch and then waiting for the batch to complete in a synchronous -// way if async is not set. -func (b *batcher) Commit(ctx context.Context, commitInfo *files.UploadSessionFinishArg) (entry *files.FileMetadata, err error) { - select { - case <-b.closed: - return nil, fserrors.FatalError(errors.New("batcher is shutting down")) - default: - } - fs.Debugf(b.f, "Adding %q to batch", commitInfo.Commit.Path) - resp := make(chan batcherResponse, 1) - b.in <- batcherRequest{ - commitInfo: commitInfo, - result: resp, - } - // If running async then don't wait for the result - if b.async { - return nil, nil - } - result := <-resp - return result.entry, result.err -} diff --git a/backend/dropbox/dropbox.go b/backend/dropbox/dropbox.go index 740bd76e34f1c..1b647af0819e2 100644 --- a/backend/dropbox/dropbox.go +++ b/backend/dropbox/dropbox.go @@ -47,6 +47,7 @@ import ( "github.com/rclone/rclone/fs/config/obscure" "github.com/rclone/rclone/fs/fserrors" "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/batcher" "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/oauthutil" "github.com/rclone/rclone/lib/pacer" @@ -58,7 +59,7 @@ import ( const ( rcloneClientID = "5jcck7diasz0rqy" rcloneEncryptedClientSecret = "fRS5vVLr2v6FbyXYnIgjwBuUAt0osq_QZTXAEcmZ7g" - minSleep = 10 * time.Millisecond + defaultMinSleep = fs.Duration(10 * time.Millisecond) maxSleep = 2 * time.Second decayConstant = 2 // bigger for slower decay, exponential // Upload chunk size - setting too small makes uploads slow. @@ -121,6 +122,14 @@ var ( // Errors errNotSupportedInSharedMode = fserrors.NoRetryError(errors.New("not supported in shared files mode")) + + // Configure the batcher + defaultBatcherOptions = batcher.Options{ + MaxBatchSize: 1000, + DefaultTimeoutSync: 500 * time.Millisecond, + DefaultTimeoutAsync: 10 * time.Second, + DefaultBatchSizeAsync: 100, + } ) // Gets an oauth config with the right scopes @@ -152,7 +161,7 @@ func init() { }, }) }, - Options: append(oauthutil.SharedOptions, []fs.Option{{ + Options: append(append(oauthutil.SharedOptions, []fs.Option{{ Name: "chunk_size", Help: fmt.Sprintf(`Upload chunk size (< %v). @@ -182,8 +191,9 @@ client_secret) to use this option as currently rclone's default set of permissions doesn't include "members.read". This can be added once v1.55 or later is in use everywhere. `, - Default: "", - Advanced: true, + Default: "", + Advanced: true, + Sensitive: true, }, { Name: "shared_files", Help: `Instructs rclone to work on individual shared files. @@ -210,66 +220,9 @@ shared folder.`, Default: false, Advanced: true, }, { - Name: "batch_mode", - Help: `Upload file batching sync|async|off. - -This sets the batch mode used by rclone. - -For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) - -This has 3 possible values - -- off - no batching -- sync - batch uploads and check completion (default) -- async - batch upload and don't check completion - -Rclone will close any outstanding batches when it exits which may make -a delay on quit. -`, - Default: "sync", - Advanced: true, - }, { - Name: "batch_size", - Help: `Max number of files in upload batch. - -This sets the batch size of files to upload. It has to be less than 1000. - -By default this is 0 which means rclone which calculate the batch size -depending on the setting of batch_mode. - -- batch_mode: async - default batch_size is 100 -- batch_mode: sync - default batch_size is the same as --transfers -- batch_mode: off - not in use - -Rclone will close any outstanding batches when it exits which may make -a delay on quit. - -Setting this is a great idea if you are uploading lots of small files -as it will make them a lot quicker. You can use --transfers 32 to -maximise throughput. -`, - Default: 0, - Advanced: true, - }, { - Name: "batch_timeout", - Help: `Max time to allow an idle upload batch before uploading. - -If an upload batch is idle for more than this long then it will be -uploaded. - -The default for this is 0 which means rclone will choose a sensible -default based on the batch_mode in use. - -- batch_mode: async - default batch_timeout is 500ms -- batch_mode: sync - default batch_timeout is 10s -- batch_mode: off - not in use -`, - Default: fs.Duration(0), - Advanced: true, - }, { - Name: "batch_commit_timeout", - Help: `Max time to wait for a batch to finish committing`, - Default: fs.Duration(10 * time.Minute), + Name: "pacer_min_sleep", + Default: defaultMinSleep, + Help: "Minimum time to sleep between API calls.", Advanced: true, }, { Name: config.ConfigEncoding, @@ -284,22 +237,22 @@ default based on the batch_mode in use. encoder.EncodeDel | encoder.EncodeRightSpace | encoder.EncodeInvalidUtf8, - }}...), + }}...), defaultBatcherOptions.FsOptions("For full info see [the main docs](https://rclone.org/dropbox/#batch-mode)\n\n")...), }) } // Options defines the configuration for this backend type Options struct { - ChunkSize fs.SizeSuffix `config:"chunk_size"` - Impersonate string `config:"impersonate"` - SharedFiles bool `config:"shared_files"` - SharedFolders bool `config:"shared_folders"` - BatchMode string `config:"batch_mode"` - BatchSize int `config:"batch_size"` - BatchTimeout fs.Duration `config:"batch_timeout"` - BatchCommitTimeout fs.Duration `config:"batch_commit_timeout"` - AsyncBatch bool `config:"async_batch"` - Enc encoder.MultiEncoder `config:"encoding"` + ChunkSize fs.SizeSuffix `config:"chunk_size"` + Impersonate string `config:"impersonate"` + SharedFiles bool `config:"shared_files"` + SharedFolders bool `config:"shared_folders"` + BatchMode string `config:"batch_mode"` + BatchSize int `config:"batch_size"` + BatchTimeout fs.Duration `config:"batch_timeout"` + AsyncBatch bool `config:"async_batch"` + PacerMinSleep fs.Duration `config:"pacer_min_sleep"` + Enc encoder.MultiEncoder `config:"encoding"` } // Fs represents a remote dropbox server @@ -318,7 +271,7 @@ type Fs struct { slashRootSlash string // root with "/" prefix and postfix, lowercase pacer *fs.Pacer // To pace the API calls ns string // The namespace we are using or "" for none - batcher *batcher // batch builder + batcher *batcher.Batcher[*files.UploadSessionFinishArg, *files.FileMetadata] } // Object describes a dropbox object @@ -442,9 +395,13 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e name: name, opt: *opt, ci: ci, - pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(opt.PacerMinSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), } - f.batcher, err = newBatcher(ctx, f, f.opt.BatchMode, f.opt.BatchSize, time.Duration(f.opt.BatchTimeout)) + batcherOptions := defaultBatcherOptions + batcherOptions.Mode = f.opt.BatchMode + batcherOptions.Size = f.opt.BatchSize + batcherOptions.Timeout = time.Duration(f.opt.BatchTimeout) + f.batcher, err = batcher.New(ctx, f, f.commitBatch, batcherOptions) if err != nil { return nil, err } @@ -536,7 +493,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e default: return nil, err } - // if the moint failed we have to abort here + // if the mount failed we have to abort here } // if the mount succeeded it's now a normal folder in the users root namespace // we disable shared folder mode and proceed normally @@ -719,7 +676,7 @@ func (f *Fs) listSharedFolders(ctx context.Context) (entries fs.DirEntries, err } for _, entry := range res.Entries { leaf := f.opt.Enc.ToStandardName(entry.Name) - d := fs.NewDir(leaf, time.Now()).SetID(entry.SharedFolderId) + d := fs.NewDir(leaf, time.Time{}).SetID(entry.SharedFolderId) entries = append(entries, d) if err != nil { return nil, err @@ -906,7 +863,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e leaf := f.opt.Enc.ToStandardName(path.Base(entryPath)) remote := path.Join(dir, leaf) if folderInfo != nil { - d := fs.NewDir(remote, time.Now()).SetID(folderInfo.Id) + d := fs.NewDir(remote, time.Time{}).SetID(folderInfo.Id) entries = append(entries, d) } else if fileInfo != nil { o, err := f.newObjectWithInfo(ctx, remote, fileInfo) @@ -989,6 +946,7 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) (err error) if root == "/" { return errors.New("can't remove root directory") } + encRoot := f.opt.Enc.FromStandardPath(root) if check { // check directory exists @@ -997,10 +955,9 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) (err error) return fmt.Errorf("Rmdir: %w", err) } - root = f.opt.Enc.FromStandardPath(root) // check directory empty arg := files.ListFolderArg{ - Path: root, + Path: encRoot, Recursive: false, } if root == "/" { @@ -1021,7 +978,7 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) (err error) // remove it err = f.pacer.Call(func() (bool, error) { - _, err = f.srv.DeleteV2(&files.DeleteArg{Path: root}) + _, err = f.srv.DeleteV2(&files.DeleteArg{Path: encRoot}) return shouldRetry(ctx, err) }) return err @@ -1715,7 +1672,7 @@ func (o *Object) uploadChunked(ctx context.Context, in0 io.Reader, commitInfo *f // If we are batching then we should have written all the data now // store the commit info now for a batch commit if o.fs.batcher.Batching() { - return o.fs.batcher.Commit(ctx, args) + return o.fs.batcher.Commit(ctx, o.remote, args) } err = o.fs.pacer.Call(func() (bool, error) { diff --git a/backend/fichier/api.go b/backend/fichier/api.go index 1ee812c47de5d..8e1bdbb61a764 100644 --- a/backend/fichier/api.go +++ b/backend/fichier/api.go @@ -28,14 +28,14 @@ var retryErrorCodes = []int{ 509, // Bandwidth Limit Exceeded } -var errorRegex = regexp.MustCompile(`#\d{1,3}`) +var errorRegex = regexp.MustCompile(`#(\d{1,3})`) func parseFichierError(err error) int { matches := errorRegex.FindStringSubmatch(err.Error()) if len(matches) == 0 { return 0 } - code, err := strconv.Atoi(matches[0]) + code, err := strconv.Atoi(matches[1]) if err != nil { fs.Debugf(nil, "failed parsing fichier error: %v", err) return 0 @@ -118,6 +118,9 @@ func (f *Fs) getDownloadToken(ctx context.Context, url string) (*GetTokenRespons Single: 1, Pass: f.opt.FilePassword, } + if f.opt.CDN { + request.CDN = 1 + } opts := rest.Opts{ Method: "POST", Path: "/download/get_token.cgi", @@ -405,6 +408,32 @@ func (f *Fs) moveFile(ctx context.Context, url string, folderID int, rename stri return response, nil } +func (f *Fs) moveDir(ctx context.Context, folderID int, newLeaf string, destinationFolderID int) (response *MoveDirResponse, err error) { + request := &MoveDirRequest{ + FolderID: folderID, + DestinationFolderID: destinationFolderID, + Rename: newLeaf, + // DestinationUser: destinationUser, + } + + opts := rest.Opts{ + Method: "POST", + Path: "/folder/mv.cgi", + } + + response = &MoveDirResponse{} + err = f.pacer.Call(func() (bool, error) { + resp, err := f.rest.CallJSON(ctx, &opts, request, response) + return shouldRetry(ctx, resp, err) + }) + + if err != nil { + return nil, fmt.Errorf("couldn't move dir: %w", err) + } + + return response, nil +} + func (f *Fs) copyFile(ctx context.Context, url string, folderID int, rename string) (response *CopyFileResponse, err error) { request := &CopyFileRequest{ URLs: []string{url}, @@ -473,7 +502,7 @@ func (f *Fs) getUploadNode(ctx context.Context) (response *GetUploadNodeResponse return shouldRetry(ctx, resp, err) }) if err != nil { - return nil, fmt.Errorf("didnt got an upload node: %w", err) + return nil, fmt.Errorf("didn't get an upload node: %w", err) } // fs.Debugf(f, "Got Upload node") diff --git a/backend/fichier/fichier.go b/backend/fichier/fichier.go index e6c05305154ef..4a2caf5bf5376 100644 --- a/backend/fichier/fichier.go +++ b/backend/fichier/fichier.go @@ -38,8 +38,9 @@ func init() { Description: "1Fichier", NewFs: NewFs, Options: []fs.Option{{ - Help: "Your API Key, get it from https://1fichier.com/console/params.pl.", - Name: "api_key", + Help: "Your API Key, get it from https://1fichier.com/console/params.pl.", + Name: "api_key", + Sensitive: true, }, { Help: "If you want to download a shared folder, add this parameter.", Name: "shared_folder", @@ -54,6 +55,11 @@ func init() { Name: "folder_password", Advanced: true, IsPassword: true, + }, { + Help: "Set if you wish to use CDN download links.", + Name: "cdn", + Default: false, + Advanced: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -89,6 +95,7 @@ type Options struct { SharedFolder string `config:"shared_folder"` FilePassword string `config:"file_password"` FolderPassword string `config:"folder_password"` + CDN bool `config:"cdn"` Enc encoder.MultiEncoder `config:"encoding"` } @@ -333,7 +340,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // checking to see if there is one already - use Put() for that. func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size int64, options ...fs.OpenOption) (fs.Object, error) { if size > int64(300e9) { - return nil, errors.New("File too big, cant upload") + return nil, errors.New("File too big, can't upload") } else if size == 0 { return nil, fs.ErrorCantUploadEmptyFiles } @@ -481,6 +488,51 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, return dstObj, nil } +// DirMove moves src, srcRemote to this remote at dstRemote +// using server-side move operations. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantDirMove. +// +// If destination exists then return fs.ErrorDirExists. +// +// This is complicated by the fact that we can't use moveDir to move +// to a different directory AND rename at the same time as it can +// overwrite files in the source directory. +func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error { + srcFs, ok := src.(*Fs) + if !ok { + fs.Debugf(srcFs, "Can't move directory - not same remote type") + return fs.ErrorCantDirMove + } + + srcID, _, _, dstDirectoryID, dstLeaf, err := f.dirCache.DirMove(ctx, srcFs.dirCache, srcFs.root, srcRemote, f.root, dstRemote) + if err != nil { + return err + } + srcIDnumeric, err := strconv.Atoi(srcID) + if err != nil { + return err + } + dstDirectoryIDnumeric, err := strconv.Atoi(dstDirectoryID) + if err != nil { + return err + } + + var resp *MoveDirResponse + resp, err = f.moveDir(ctx, srcIDnumeric, dstLeaf, dstDirectoryIDnumeric) + if err != nil { + return fmt.Errorf("couldn't rename leaf: %w", err) + } + if resp.Status != "OK" { + return fmt.Errorf("couldn't rename leaf: %s", resp.Message) + } + + srcFs.dirCache.FlushDir(srcRemote) + return nil +} + // Copy src to this remote using server side move operations. func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { srcObj, ok := src.(*Object) @@ -554,6 +606,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, var ( _ fs.Fs = (*Fs)(nil) _ fs.Mover = (*Fs)(nil) + _ fs.DirMover = (*Fs)(nil) _ fs.Copier = (*Fs)(nil) _ fs.PublicLinker = (*Fs)(nil) _ fs.PutUncheckeder = (*Fs)(nil) diff --git a/backend/fichier/structs.go b/backend/fichier/structs.go index 02e50a632715e..289aa64b7812f 100644 --- a/backend/fichier/structs.go +++ b/backend/fichier/structs.go @@ -20,6 +20,7 @@ type DownloadRequest struct { URL string `json:"url"` Single int `json:"single"` Pass string `json:"pass,omitempty"` + CDN int `json:"cdn,omitempty"` } // RemoveFolderRequest is the request structure of the corresponding request @@ -69,6 +70,22 @@ type MoveFileResponse struct { URLs []string `json:"urls"` } +// MoveDirRequest is the request structure of the corresponding request +type MoveDirRequest struct { + FolderID int `json:"folder_id"` + DestinationFolderID int `json:"destination_folder_id,omitempty"` + DestinationUser string `json:"destination_user"` + Rename string `json:"rename,omitempty"` +} + +// MoveDirResponse is the response structure of the corresponding request +type MoveDirResponse struct { + Status string `json:"status"` + Message string `json:"message"` + OldName string `json:"old_name"` + NewName string `json:"new_name"` +} + // CopyFileRequest is the request structure of the corresponding request type CopyFileRequest struct { URLs []string `json:"urls"` diff --git a/backend/filefabric/filefabric.go b/backend/filefabric/filefabric.go index 3d157f8fbbea0..454dc3c950418 100644 --- a/backend/filefabric/filefabric.go +++ b/backend/filefabric/filefabric.go @@ -84,6 +84,7 @@ Leave blank normally. Fill in to make rclone start with directory of a given ID. `, + Sensitive: true, }, { Name: "permanent_token", Help: `Permanent Authentication Token. @@ -97,6 +98,7 @@ These tokens are normally valid for several years. For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens `, + Sensitive: true, }, { Name: "token", Help: `Session Token. @@ -106,7 +108,8 @@ usually valid for 1 hour. Don't set this value - rclone will set it automatically. `, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "token_expiry", Help: `Token expiry time. @@ -155,9 +158,9 @@ type Fs struct { tokenMu sync.Mutex // hold when reading the token token string // current access token tokenExpiry time.Time // time the current token expires - tokenExpired int32 // read and written with atomic - canCopyWithName bool // set if detected that can use fi_name in copy - precision time.Duration // precision reported + tokenExpired atomic.Int32 + canCopyWithName bool // set if detected that can use fi_name in copy + precision time.Duration // precision reported } // Object describes a filefabric object @@ -240,7 +243,7 @@ func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error, st err = status // return the error from the RPC code := status.GetCode() if code == "login_token_expired" { - atomic.AddInt32(&f.tokenExpired, 1) + f.tokenExpired.Add(1) } else { for _, retryCode := range retryStatusCodes { if code == retryCode.code { @@ -320,12 +323,12 @@ func (f *Fs) getToken(ctx context.Context) (token string, err error) { var refreshed = false defer func() { if refreshed { - atomic.StoreInt32(&f.tokenExpired, 0) + f.tokenExpired.Store(0) } f.tokenMu.Unlock() }() - expired := atomic.LoadInt32(&f.tokenExpired) != 0 + expired := f.tokenExpired.Load() != 0 if expired { fs.Debugf(f, "Token invalid - refreshing") } diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go index 8dd520efb15da..aab419779235f 100644 --- a/backend/ftp/ftp.go +++ b/backend/ftp/ftp.go @@ -28,6 +28,7 @@ import ( "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/env" "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/proxy" "github.com/rclone/rclone/lib/readers" ) @@ -48,13 +49,15 @@ func init() { Description: "FTP", NewFs: NewFs, Options: []fs.Option{{ - Name: "host", - Help: "FTP host to connect to.\n\nE.g. \"ftp.example.com\".", - Required: true, + Name: "host", + Help: "FTP host to connect to.\n\nE.g. \"ftp.example.com\".", + Required: true, + Sensitive: true, }, { - Name: "user", - Help: "FTP username.", - Default: currentUser, + Name: "user", + Help: "FTP username.", + Default: currentUser, + Sensitive: true, }, { Name: "port", Help: "FTP port number.", @@ -172,6 +175,18 @@ Enabled by default. Use 0 to disable.`, If this is set and no password is supplied then rclone will ask for a password `, Advanced: true, + }, { + Name: "socks_proxy", + Default: "", + Help: `Socks 5 proxy host. + + Supports the format user:pass@host:port, user@host:port, host:port. + + Example: + + myUser:myPass@localhost:9005 + `, + Advanced: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -216,6 +231,7 @@ type Options struct { ShutTimeout fs.Duration `config:"shut_timeout"` AskPassword bool `config:"ask_password"` Enc encoder.MultiEncoder `config:"encoding"` + SocksProxy string `config:"socks_proxy"` } // Fs represents a remote FTP server @@ -233,7 +249,6 @@ type Fs struct { pool []*ftp.ServerConn drain *time.Timer // used to drain the pool when we stop using the connections tokens *pacer.TokenDispenser - tlsConf *tls.Config pacer *fs.Pacer // pacer for FTP connections fGetTime bool // true if the ftp library accepts GetTime fSetTime bool // true if the ftp library accepts SetTime @@ -315,10 +330,17 @@ func (dl *debugLog) Write(p []byte) (n int, err error) { return len(p), nil } +// Return a *textproto.Error if err contains one or nil otherwise +func textprotoError(err error) (errX *textproto.Error) { + if errors.As(err, &errX) { + return errX + } + return nil +} + // returns true if this FTP error should be retried func isRetriableFtpError(err error) bool { - switch errX := err.(type) { - case *textproto.Error: + if errX := textprotoError(err); errX != nil { switch errX.Code { case ftp.StatusNotAvailable, ftp.StatusTransfertAborted: return true @@ -339,10 +361,36 @@ func shouldRetry(ctx context.Context, err error) (bool, error) { return fserrors.ShouldRetry(err), err } +// Get a TLS config with a unique session cache. +// +// We can't share session caches between connections. +// +// See: https://github.com/rclone/rclone/issues/7234 +func (f *Fs) tlsConfig() *tls.Config { + var tlsConfig *tls.Config + if f.opt.TLS || f.opt.ExplicitTLS { + tlsConfig = &tls.Config{ + ServerName: f.opt.Host, + InsecureSkipVerify: f.opt.SkipVerifyTLSCert, + } + if f.opt.TLSCacheSize > 0 { + tlsConfig.ClientSessionCache = tls.NewLRUClientSessionCache(f.opt.TLSCacheSize) + } + if f.opt.DisableTLS13 { + tlsConfig.MaxVersion = tls.VersionTLS12 + } + } + return tlsConfig +} + // Open a new connection to the FTP server. func (f *Fs) ftpConnection(ctx context.Context) (c *ftp.ServerConn, err error) { fs.Debugf(f, "Connecting to FTP server") + // tls.Config for this connection only. Will be used for data + // and control connections. + tlsConfig := f.tlsConfig() + // Make ftp library dial with fshttp dialer optionally using TLS initialConnection := true dial := func(network, address string) (conn net.Conn, err error) { @@ -350,12 +398,17 @@ func (f *Fs) ftpConnection(ctx context.Context) (c *ftp.ServerConn, err error) { defer func() { fs.Debugf(f, "> dial: conn=%T, err=%v", conn, err) }() - conn, err = fshttp.NewDialer(ctx).Dial(network, address) + baseDialer := fshttp.NewDialer(ctx) + if f.opt.SocksProxy != "" { + conn, err = proxy.SOCKS5Dial(network, address, f.opt.SocksProxy, baseDialer) + } else { + conn, err = baseDialer.Dial(network, address) + } if err != nil { return nil, err } // Connect using cleartext only for non TLS - if f.tlsConf == nil { + if tlsConfig == nil { return conn, nil } // Initial connection only needs to be cleartext for explicit TLS @@ -364,7 +417,7 @@ func (f *Fs) ftpConnection(ctx context.Context) (c *ftp.ServerConn, err error) { return conn, nil } // Upgrade connection to TLS - tlsConn := tls.Client(conn, f.tlsConf) + tlsConn := tls.Client(conn, tlsConfig) // Do the initial handshake - tls.Client doesn't do it for us // If we do this then connections to proftpd/pureftpd lock up // See: https://github.com/rclone/rclone/issues/6426 @@ -386,9 +439,9 @@ func (f *Fs) ftpConnection(ctx context.Context) (c *ftp.ServerConn, err error) { if f.opt.TLS { // Our dialer takes care of TLS but ftp library also needs tlsConf // as a trigger for sending PSBZ and PROT options to server. - ftpConfig = append(ftpConfig, ftp.DialWithTLS(f.tlsConf)) + ftpConfig = append(ftpConfig, ftp.DialWithTLS(tlsConfig)) } else if f.opt.ExplicitTLS { - ftpConfig = append(ftpConfig, ftp.DialWithExplicitTLS(f.tlsConf)) + ftpConfig = append(ftpConfig, ftp.DialWithExplicitTLS(tlsConfig)) } if f.opt.DisableEPSV { ftpConfig = append(ftpConfig, ftp.DialWithDisabledEPSV(true)) @@ -471,8 +524,7 @@ func (f *Fs) putFtpConnection(pc **ftp.ServerConn, err error) { *pc = nil if err != nil { // If not a regular FTP error code then check the connection - var tpErr *textproto.Error - if !errors.As(err, &tpErr) { + if tpErr := textprotoError(err); tpErr != nil { nopErr := c.NoOp() if nopErr != nil { fs.Debugf(f, "Connection failed, closing: %v", nopErr) @@ -544,19 +596,6 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (ff fs.Fs if opt.TLS && opt.ExplicitTLS { return nil, errors.New("implicit TLS and explicit TLS are mutually incompatible, please revise your config") } - var tlsConfig *tls.Config - if opt.TLS || opt.ExplicitTLS { - tlsConfig = &tls.Config{ - ServerName: opt.Host, - InsecureSkipVerify: opt.SkipVerifyTLSCert, - } - if opt.TLSCacheSize > 0 { - tlsConfig.ClientSessionCache = tls.NewLRUClientSessionCache(opt.TLSCacheSize) - } - if opt.DisableTLS13 { - tlsConfig.MaxVersion = tls.VersionTLS12 - } - } u := protocol + path.Join(dialAddr+"/", root) ci := fs.GetConfig(ctx) f := &Fs{ @@ -569,11 +608,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (ff fs.Fs pass: pass, dialAddr: dialAddr, tokens: pacer.NewTokenDispenser(opt.Concurrency), - tlsConf: tlsConfig, pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), } f.features = (&fs.Features{ CanHaveEmptyDirectories: true, + PartialUploads: true, }).Fill(ctx, f) // set the pool drainer timer going if f.opt.IdleTimeout > 0 { @@ -621,8 +660,7 @@ func (f *Fs) Shutdown(ctx context.Context) error { // translateErrorFile turns FTP errors into rclone errors if possible for a file func translateErrorFile(err error) error { - switch errX := err.(type) { - case *textproto.Error: + if errX := textprotoError(err); errX != nil { switch errX.Code { case ftp.StatusFileUnavailable, ftp.StatusFileActionIgnored: err = fs.ErrorObjectNotFound @@ -633,8 +671,7 @@ func translateErrorFile(err error) error { // translateErrorDir turns FTP errors into rclone errors if possible for a directory func translateErrorDir(err error) error { - switch errX := err.(type) { - case *textproto.Error: + if errX := textprotoError(err); errX != nil { switch errX.Code { case ftp.StatusFileUnavailable, ftp.StatusFileActionIgnored: err = fs.ErrorDirNotFound @@ -688,6 +725,12 @@ func (f *Fs) findItem(ctx context.Context, remote string) (entry *ftp.Entry, err if err == fs.ErrorObjectNotFound { return nil, nil } + if errX := textprotoError(err); errX != nil { + switch errX.Code { + case ftp.StatusBadArguments: + err = nil + } + } return nil, err } if entry != nil { @@ -925,8 +968,7 @@ func (f *Fs) mkdir(ctx context.Context, abspath string) error { } err = c.MakeDir(f.dirFromStandardPath(abspath)) f.putFtpConnection(&c, err) - switch errX := err.(type) { - case *textproto.Error: + if errX := textprotoError(err); errX != nil { switch errX.Code { case ftp.StatusFileUnavailable: // dir already exists: see issue #2181 err = nil @@ -1095,7 +1137,7 @@ func (o *Object) ModTime(ctx context.Context) time.Time { // SetModTime sets the modification time of the object func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { if !o.fs.fSetTime { - fs.Errorf(o.fs, "SetModTime is not supported") + fs.Debugf(o.fs, "SetModTime is not supported") return nil } c, err := o.fs.getFtpConnection(ctx) @@ -1167,8 +1209,7 @@ func (f *ftpReadCloser) Close() error { // mask the error if it was caused by a premature close // NB StatusAboutToSend is to work around a bug in pureftpd // See: https://github.com/rclone/rclone/issues/3445#issuecomment-521654257 - switch errX := err.(type) { - case *textproto.Error: + if errX := textprotoError(err); errX != nil { switch errX.Code { case ftp.StatusTransfertAborted, ftp.StatusFileUnavailable, ftp.StatusAboutToSend: err = nil @@ -1246,13 +1287,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } err = c.Stor(o.fs.opt.Enc.FromStandardPath(path), in) // Ignore error 250 here - send by some servers - if err != nil { - switch errX := err.(type) { - case *textproto.Error: - switch errX.Code { - case ftp.StatusRequestedFileActionOK: - err = nil - } + if errX := textprotoError(err); errX != nil { + switch errX.Code { + case ftp.StatusRequestedFileActionOK: + err = nil } } if err != nil { diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.go index 4017c206b677b..1d1bffaee53ce 100644 --- a/backend/googlecloudstorage/googlecloudstorage.go +++ b/backend/googlecloudstorage/googlecloudstorage.go @@ -91,15 +91,21 @@ func init() { }) }, Options: append(oauthutil.SharedOptions, []fs.Option{{ - Name: "project_number", - Help: "Project number.\n\nOptional - needed only for list/create/delete buckets - see your developer console.", + Name: "project_number", + Help: "Project number.\n\nOptional - needed only for list/create/delete buckets - see your developer console.", + Sensitive: true, + }, { + Name: "user_project", + Help: "User project.\n\nOptional - needed only for requester pays.", + Sensitive: true, }, { Name: "service_account_file", Help: "Service Account Credentials JSON file path.\n\nLeave blank normally.\nNeeded only if you want use SA instead of interactive login." + env.ShellExpandHelp, }, { - Name: "service_account_credentials", - Help: "Service Account Credentials JSON blob.\n\nLeave blank normally.\nNeeded only if you want use SA instead of interactive login.", - Hide: fs.OptionHideBoth, + Name: "service_account_credentials", + Help: "Service Account Credentials JSON blob.\n\nLeave blank normally.\nNeeded only if you want use SA instead of interactive login.", + Hide: fs.OptionHideBoth, + Sensitive: true, }, { Name: "anonymous", Help: "Access public buckets and objects without credentials.\n\nSet to 'true' if you just want to download files and don't configure credentials.", @@ -298,6 +304,15 @@ Docs: https://cloud.google.com/storage/docs/bucket-policy-only Value: "DURABLE_REDUCED_AVAILABILITY", Help: "Durable reduced availability storage class", }}, + }, { + Name: "directory_markers", + Default: false, + Advanced: true, + Help: `Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. +`, }, { Name: "no_check_bucket", Help: `If set, don't attempt to check the bucket exists or create it. @@ -349,6 +364,7 @@ can't check the size and hash but the file contents will be decompressed. // Options defines the configuration for this backend type Options struct { ProjectNumber string `config:"project_number"` + UserProject string `config:"user_project"` ServiceAccountFile string `config:"service_account_file"` ServiceAccountCredentials string `config:"service_account_credentials"` Anonymous bool `config:"anonymous"` @@ -362,6 +378,7 @@ type Options struct { Endpoint string `config:"endpoint"` Enc encoder.MultiEncoder `config:"encoding"` EnvAuth bool `config:"env_auth"` + DirectoryMarkers bool `config:"directory_markers"` } // Fs represents a remote storage server @@ -457,7 +474,7 @@ func parsePath(path string) (root string) { // split returns bucket and bucketPath from the rootRelativePath // relative to f.root func (f *Fs) split(rootRelativePath string) (bucketName, bucketPath string) { - bucketName, bucketPath = bucket.Split(path.Join(f.root, rootRelativePath)) + bucketName, bucketPath = bucket.Split(bucket.Join(f.root, rootRelativePath)) return f.opt.Enc.FromStandardName(bucketName), f.opt.Enc.FromStandardPath(bucketPath) } @@ -543,6 +560,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e BucketBased: true, BucketBasedRootOK: true, }).Fill(ctx, f) + if opt.DirectoryMarkers { + f.features.CanHaveEmptyDirectories = true + } // Create a new authorized Drive client. f.client = oAuthClient @@ -559,7 +579,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e // Check to see if the object exists encodedDirectory := f.opt.Enc.FromStandardPath(f.rootDirectory) err = f.pacer.Call(func() (bool, error) { - _, err = f.svc.Objects.Get(f.rootBucket, encodedDirectory).Context(ctx).Do() + get := f.svc.Objects.Get(f.rootBucket, encodedDirectory).Context(ctx) + if f.opt.UserProject != "" { + get = get.UserProject(f.opt.UserProject) + } + _, err = get.Do() return shouldRetry(ctx, err) }) if err == nil { @@ -619,9 +643,13 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck directory += "/" } list := f.svc.Objects.List(bucket).Prefix(directory).MaxResults(listChunks) + if f.opt.UserProject != "" { + list = list.UserProject(f.opt.UserProject) + } if !recurse { list = list.Delimiter("/") } + foundItems := 0 for { var objects *storage.Objects err = f.pacer.Call(func() (bool, error) { @@ -637,6 +665,7 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck return err } if !recurse { + foundItems += len(objects.Prefixes) var object storage.Object for _, remote := range objects.Prefixes { if !strings.HasSuffix(remote, "/") { @@ -657,22 +686,29 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck } } } + foundItems += len(objects.Items) for _, object := range objects.Items { remote := f.opt.Enc.ToStandardPath(object.Name) if !strings.HasPrefix(remote, prefix) { fs.Logf(f, "Odd name received %q", object.Name) continue } - remote = remote[len(prefix):] isDirectory := remote == "" || strings.HasSuffix(remote, "/") - if addBucket { - remote = path.Join(bucket, remote) - } // is this a directory marker? if isDirectory { - continue // skip directory marker + // Don't insert the root directory + if remote == directory { + continue + } + // process directory markers as directories + remote = strings.TrimRight(remote, "/") } - err = fn(remote, object, false) + remote = remote[len(prefix):] + if addBucket { + remote = path.Join(bucket, remote) + } + + err = fn(remote, object, isDirectory) if err != nil { return err } @@ -682,6 +718,17 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck } list.PageToken(objects.NextPageToken) } + if f.opt.DirectoryMarkers && foundItems == 0 && directory != "" { + // Determine whether the directory exists or not by whether it has a marker + _, err := f.readObjectInfo(ctx, bucket, directory) + if err != nil { + if err == fs.ErrorObjectNotFound { + return fs.ErrorDirNotFound + } + return err + } + } + return nil } @@ -725,6 +772,9 @@ func (f *Fs) listBuckets(ctx context.Context) (entries fs.DirEntries, err error) return nil, errors.New("can't list buckets without project number") } listBuckets := f.svc.Buckets.List(f.opt.ProjectNumber).MaxResults(listChunks) + if f.opt.UserProject != "" { + listBuckets = listBuckets.UserProject(f.opt.UserProject) + } for { var buckets *storage.Buckets err = f.pacer.Call(func() (bool, error) { @@ -842,10 +892,69 @@ func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, opt return f.Put(ctx, in, src, options...) } +// Create directory marker file and parents +func (f *Fs) createDirectoryMarker(ctx context.Context, bucket, dir string) error { + if !f.opt.DirectoryMarkers || bucket == "" { + return nil + } + + // Object to be uploaded + o := &Object{ + fs: f, + modTime: time.Now(), + } + + for { + _, bucketPath := f.split(dir) + // Don't create the directory marker if it is the bucket or at the very root + if bucketPath == "" { + break + } + o.remote = dir + "/" + + // Check to see if object already exists + _, err := o.readObjectInfo(ctx) + if err == nil { + return nil + } + + // Upload it if not + fs.Debugf(o, "Creating directory marker") + content := io.Reader(strings.NewReader("")) + err = o.Update(ctx, content, o) + if err != nil { + return fmt.Errorf("creating directory marker failed: %w", err) + } + + // Now check parent directory exists + dir = path.Dir(dir) + if dir == "/" || dir == "." { + break + } + } + + return nil +} + // Mkdir creates the bucket if it doesn't exist func (f *Fs) Mkdir(ctx context.Context, dir string) (err error) { bucket, _ := f.split(dir) - return f.makeBucket(ctx, bucket) + e := f.checkBucket(ctx, bucket) + if e != nil { + return e + } + return f.createDirectoryMarker(ctx, bucket, dir) + +} + +// mkdirParent creates the parent bucket/directory if it doesn't exist +func (f *Fs) mkdirParent(ctx context.Context, remote string) error { + remote = strings.TrimRight(remote, "/") + dir := path.Dir(remote) + if dir == "/" || dir == "." { + dir = "" + } + return f.Mkdir(ctx, dir) } // makeBucket creates the bucket if it doesn't exist @@ -854,7 +963,11 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) (err error) { // List something from the bucket to see if it exists. Doing it like this enables the use of a // service account that only has the "Storage Object Admin" role. See #2193 for details. err = f.pacer.Call(func() (bool, error) { - _, err = f.svc.Objects.List(bucket).MaxResults(1).Context(ctx).Do() + list := f.svc.Objects.List(bucket).MaxResults(1).Context(ctx) + if f.opt.UserProject != "" { + list = list.UserProject(f.opt.UserProject) + } + _, err = list.Do() return shouldRetry(ctx, err) }) if err == nil { @@ -889,7 +1002,11 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) (err error) { if !f.opt.BucketPolicyOnly { insertBucket.PredefinedAcl(f.opt.BucketACL) } - _, err = insertBucket.Context(ctx).Do() + insertBucket = insertBucket.Context(ctx) + if f.opt.UserProject != "" { + insertBucket = insertBucket.UserProject(f.opt.UserProject) + } + _, err = insertBucket.Do() return shouldRetry(ctx, err) }) }, nil) @@ -909,12 +1026,28 @@ func (f *Fs) checkBucket(ctx context.Context, bucket string) error { // to delete was not empty. func (f *Fs) Rmdir(ctx context.Context, dir string) (err error) { bucket, directory := f.split(dir) + // Remove directory marker file + if f.opt.DirectoryMarkers && bucket != "" && dir != "" { + o := &Object{ + fs: f, + remote: dir + "/", + } + fs.Debugf(o, "Removing directory marker") + err := o.Remove(ctx) + if err != nil { + return fmt.Errorf("removing directory marker failed: %w", err) + } + } if bucket == "" || directory != "" { return nil } return f.cache.Remove(bucket, func() error { return f.pacer.Call(func() (bool, error) { - err = f.svc.Buckets.Delete(bucket).Context(ctx).Do() + deleteBucket := f.svc.Buckets.Delete(bucket).Context(ctx) + if f.opt.UserProject != "" { + deleteBucket = deleteBucket.UserProject(f.opt.UserProject) + } + err = deleteBucket.Do() return shouldRetry(ctx, err) }) }) @@ -936,7 +1069,7 @@ func (f *Fs) Precision() time.Duration { // If it isn't possible then return fs.ErrorCantCopy func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { dstBucket, dstPath := f.split(remote) - err := f.checkBucket(ctx, dstBucket) + err := f.mkdirParent(ctx, remote) if err != nil { return nil, err } @@ -960,7 +1093,11 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, var rewriteResponse *storage.RewriteResponse for { err = f.pacer.Call(func() (bool, error) { - rewriteResponse, err = rewriteRequest.Context(ctx).Do() + rewriteRequest = rewriteRequest.Context(ctx) + if f.opt.UserProject != "" { + rewriteRequest.UserProject(f.opt.UserProject) + } + rewriteResponse, err = rewriteRequest.Do() return shouldRetry(ctx, err) }) if err != nil { @@ -1070,8 +1207,17 @@ func (o *Object) setMetaData(info *storage.Object) { // readObjectInfo reads the definition for an object func (o *Object) readObjectInfo(ctx context.Context) (object *storage.Object, err error) { bucket, bucketPath := o.split() - err = o.fs.pacer.Call(func() (bool, error) { - object, err = o.fs.svc.Objects.Get(bucket, bucketPath).Context(ctx).Do() + return o.fs.readObjectInfo(ctx, bucket, bucketPath) +} + +// readObjectInfo reads the definition for an object +func (f *Fs) readObjectInfo(ctx context.Context, bucket, bucketPath string) (object *storage.Object, err error) { + err = f.pacer.Call(func() (bool, error) { + get := f.svc.Objects.Get(bucket, bucketPath).Context(ctx) + if f.opt.UserProject != "" { + get = get.UserProject(f.opt.UserProject) + } + object, err = get.Do() return shouldRetry(ctx, err) }) if err != nil { @@ -1143,7 +1289,11 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) (err error) if !o.fs.opt.BucketPolicyOnly { copyObject.DestinationPredefinedAcl(o.fs.opt.ObjectACL) } - newObject, err = copyObject.Context(ctx).Do() + copyObject = copyObject.Context(ctx) + if o.fs.opt.UserProject != "" { + copyObject = copyObject.UserProject(o.fs.opt.UserProject) + } + newObject, err = copyObject.Do() return shouldRetry(ctx, err) }) if err != nil { @@ -1160,7 +1310,11 @@ func (o *Object) Storable() bool { // Open an object for read func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) { - req, err := http.NewRequestWithContext(ctx, "GET", o.url, nil) + url := o.url + if o.fs.opt.UserProject != "" { + url += "&userProject=" + o.fs.opt.UserProject + } + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, err } @@ -1203,11 +1357,14 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // // The new object may have been created if an error is returned -func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { bucket, bucketPath := o.split() - err := o.fs.checkBucket(ctx, bucket) - if err != nil { - return err + // Create parent dir/bucket if not saving directory marker + if !strings.HasSuffix(o.remote, "/") { + err = o.fs.mkdirParent(ctx, o.remote) + if err != nil { + return err + } } modTime := src.ModTime(ctx) @@ -1252,7 +1409,11 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if !o.fs.opt.BucketPolicyOnly { insertObject.PredefinedAcl(o.fs.opt.ObjectACL) } - newObject, err = insertObject.Context(ctx).Do() + insertObject = insertObject.Context(ctx) + if o.fs.opt.UserProject != "" { + insertObject = insertObject.UserProject(o.fs.opt.UserProject) + } + newObject, err = insertObject.Do() return shouldRetry(ctx, err) }) if err != nil { @@ -1267,7 +1428,11 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op func (o *Object) Remove(ctx context.Context) (err error) { bucket, bucketPath := o.split() err = o.fs.pacer.Call(func() (bool, error) { - err = o.fs.svc.Objects.Delete(bucket, bucketPath).Context(ctx).Do() + deleteBucket := o.fs.svc.Objects.Delete(bucket, bucketPath).Context(ctx) + if o.fs.opt.UserProject != "" { + deleteBucket = deleteBucket.UserProject(o.fs.opt.UserProject) + } + err = deleteBucket.Do() return shouldRetry(ctx, err) }) return err diff --git a/backend/googlecloudstorage/googlecloudstorage_test.go b/backend/googlecloudstorage/googlecloudstorage_test.go index d54f2b061a5a7..f1aa02647d485 100644 --- a/backend/googlecloudstorage/googlecloudstorage_test.go +++ b/backend/googlecloudstorage/googlecloudstorage_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/rclone/rclone/backend/googlecloudstorage" + "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/fstest/fstests" ) @@ -16,3 +17,17 @@ func TestIntegration(t *testing.T) { NilObject: (*googlecloudstorage.Object)(nil), }) } + +func TestIntegration2(t *testing.T) { + if *fstest.RemoteName != "" { + t.Skip("Skipping as -remote set") + } + name := "TestGoogleCloudStorage" + fstests.Run(t, &fstests.Opt{ + RemoteName: name + ":", + NilObject: (*googlecloudstorage.Object)(nil), + ExtraConfig: []fstests.ExtraConfigItem{ + {Name: name, Key: "directory_markers", Value: "true"}, + }, + }) +} diff --git a/backend/googlephotos/googlephotos.go b/backend/googlephotos/googlephotos.go index c743ddec4a806..df031b606d8df 100644 --- a/backend/googlephotos/googlephotos.go +++ b/backend/googlephotos/googlephotos.go @@ -29,6 +29,7 @@ import ( "github.com/rclone/rclone/fs/fshttp" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/log" + "github.com/rclone/rclone/lib/batcher" "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/oauthutil" "github.com/rclone/rclone/lib/pacer" @@ -71,6 +72,14 @@ var ( ClientSecret: obscure.MustReveal(rcloneEncryptedClientSecret), RedirectURL: oauthutil.RedirectURL, } + + // Configure the batcher + defaultBatcherOptions = batcher.Options{ + MaxBatchSize: 50, + DefaultTimeoutSync: 1000 * time.Millisecond, + DefaultTimeoutAsync: 10 * time.Second, + DefaultBatchSizeAsync: 50, + } ) // Register with Fs @@ -111,7 +120,7 @@ will count towards storage in your Google Account.`) } return nil, fmt.Errorf("unknown state %q", config.State) }, - Options: append(oauthutil.SharedOptions, []fs.Option{{ + Options: append(append(oauthutil.SharedOptions, []fs.Option{{ Name: "read_only", Default: false, Help: `Set to make the Google Photos backend read only. @@ -158,7 +167,7 @@ listings and won't be transferred.`, Default: (encoder.Base | encoder.EncodeCrLf | encoder.EncodeInvalidUtf8), - }}...), + }}...), defaultBatcherOptions.FsOptions("")...), }) } @@ -169,6 +178,9 @@ type Options struct { StartYear int `config:"start_year"` IncludeArchived bool `config:"include_archived"` Enc encoder.MultiEncoder `config:"encoding"` + BatchMode string `config:"batch_mode"` + BatchSize int `config:"batch_size"` + BatchTimeout fs.Duration `config:"batch_timeout"` } // Fs represents a remote storage server @@ -187,6 +199,7 @@ type Fs struct { uploadedMu sync.Mutex // to protect the below uploaded dirtree.DirTree // record of uploaded items createMu sync.Mutex // held when creating albums to prevent dupes + batcher *batcher.Batcher[uploadedItem, *api.MediaItem] } // Object describes a storage object @@ -312,6 +325,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e albums: map[bool]*albums{}, uploaded: dirtree.New(), } + batcherOptions := defaultBatcherOptions + batcherOptions.Mode = f.opt.BatchMode + batcherOptions.Size = f.opt.BatchSize + batcherOptions.Timeout = time.Duration(f.opt.BatchTimeout) + f.batcher, err = batcher.New(ctx, f, f.commitBatch, batcherOptions) + if err != nil { + return nil, err + } f.features = (&fs.Features{ ReadMimeType: true, }).Fill(ctx, f) @@ -781,6 +802,13 @@ func (f *Fs) Hashes() hash.Set { return hash.Set(hash.None) } +// Shutdown the backend, closing any background tasks and any +// cached connections. +func (f *Fs) Shutdown(ctx context.Context) error { + f.batcher.Shutdown() + return nil +} + // ------------------------------------------------------------ // Fs returns the parent Fs @@ -961,6 +989,82 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read return resp.Body, err } +// input to the batcher +type uploadedItem struct { + AlbumID string // desired album + UploadToken string // upload ID +} + +// Commit a batch of items to albumID returning the errors in errors +func (f *Fs) commitBatchAlbumID(ctx context.Context, items []uploadedItem, results []*api.MediaItem, errors []error, albumID string) { + // Create the media item from an UploadToken, optionally adding to an album + opts := rest.Opts{ + Method: "POST", + Path: "/mediaItems:batchCreate", + } + var request = api.BatchCreateRequest{ + AlbumID: albumID, + } + itemsInBatch := 0 + for i := range items { + if items[i].AlbumID == albumID { + request.NewMediaItems = append(request.NewMediaItems, api.NewMediaItem{ + SimpleMediaItem: api.SimpleMediaItem{ + UploadToken: items[i].UploadToken, + }, + }) + itemsInBatch++ + } + } + var result api.BatchCreateResponse + var resp *http.Response + var err error + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, request, &result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + err = fmt.Errorf("failed to create media item: %w", err) + } + if err == nil && len(result.NewMediaItemResults) != itemsInBatch { + err = fmt.Errorf("bad response to BatchCreate expecting %d items but got %d", itemsInBatch, len(result.NewMediaItemResults)) + } + j := 0 + for i := range items { + if items[i].AlbumID == albumID { + if err == nil { + media := &result.NewMediaItemResults[j] + if media.Status.Code != 0 { + errors[i] = fmt.Errorf("upload failed: %s (%d)", media.Status.Message, media.Status.Code) + } else { + results[i] = &media.MediaItem + } + } else { + errors[i] = err + } + j++ + } + } +} + +// Called by the batcher to commit a batch +func (f *Fs) commitBatch(ctx context.Context, items []uploadedItem, results []*api.MediaItem, errors []error) (err error) { + // Discover all the AlbumIDs as we have to upload these separately + // + // Should maybe have one batcher per AlbumID + albumIDs := map[string]struct{}{} + for i := range items { + albumIDs[items[i].AlbumID] = struct{}{} + } + + // batch the albums + for albumID := range albumIDs { + // errors returned in errors + f.commitBatchAlbumID(ctx, items, results, errors, albumID) + } + return nil +} + // Update the object with the contents of the io.Reader, modTime and size // // The new object may have been created if an error is returned @@ -1021,37 +1125,26 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return errors.New("empty upload token") } - // Create the media item from an UploadToken, optionally adding to an album - opts = rest.Opts{ - Method: "POST", - Path: "/mediaItems:batchCreate", + uploaded := uploadedItem{ + AlbumID: albumID, + UploadToken: uploadToken, } - var request = api.BatchCreateRequest{ - AlbumID: albumID, - NewMediaItems: []api.NewMediaItem{ - { - SimpleMediaItem: api.SimpleMediaItem{ - UploadToken: uploadToken, - }, - }, - }, - } - var result api.BatchCreateResponse - err = o.fs.pacer.Call(func() (bool, error) { - resp, err = o.fs.srv.CallJSON(ctx, &opts, request, &result) - return shouldRetry(ctx, resp, err) - }) - if err != nil { - return fmt.Errorf("failed to create media item: %w", err) - } - if len(result.NewMediaItemResults) != 1 { - return errors.New("bad response to BatchCreate wrong number of items") - } - mediaItemResult := result.NewMediaItemResults[0] - if mediaItemResult.Status.Code != 0 { - return fmt.Errorf("upload failed: %s (%d)", mediaItemResult.Status.Message, mediaItemResult.Status.Code) + + // Save the upload into an album + var info *api.MediaItem + if o.fs.batcher.Batching() { + info, err = o.fs.batcher.Commit(ctx, o.remote, uploaded) + } else { + errors := make([]error, 1) + results := make([]*api.MediaItem, 1) + err = o.fs.commitBatch(ctx, []uploadedItem{uploaded}, results, errors) + if err != nil { + err = errors[0] + info = results[0] + } } - o.setMetaData(&mediaItemResult.MediaItem) + + o.setMetaData(info) // Add upload to internal storage if pattern.isUpload { diff --git a/backend/hasher/hasher.go b/backend/hasher/hasher.go index e80daedee6a35..3428b4dc2c0d1 100644 --- a/backend/hasher/hasher.go +++ b/backend/hasher/hasher.go @@ -166,6 +166,7 @@ func NewFs(ctx context.Context, fsname, rpath string, cmap configmap.Mapper) (fs ReadMetadata: true, WriteMetadata: true, UserMetadata: true, + PartialUploads: true, } f.features = stubFeatures.Fill(ctx, f).Mask(ctx, f.Fs).WrapsFs(f, f.Fs) diff --git a/backend/hasher/hasher_test.go b/backend/hasher/hasher_test.go index 23feb9b96ca7f..f17303ecc16a2 100644 --- a/backend/hasher/hasher_test.go +++ b/backend/hasher/hasher_test.go @@ -23,6 +23,7 @@ func TestIntegration(t *testing.T) { NilObject: (*hasher.Object)(nil), UnimplementableFsMethods: []string{ "OpenWriterAt", + "OpenChunkWriter", }, UnimplementableObjectMethods: []string{}, } diff --git a/backend/hdfs/fs.go b/backend/hdfs/fs.go index 7d48ffed60ea5..dfe98bbd47bab 100644 --- a/backend/hdfs/fs.go +++ b/backend/hdfs/fs.go @@ -21,6 +21,7 @@ import ( "github.com/rclone/rclone/fs/config/configmap" "github.com/rclone/rclone/fs/config/configstruct" "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/pacer" ) // Fs represents a HDFS server @@ -31,8 +32,15 @@ type Fs struct { opt Options // options for this backend ci *fs.ConfigInfo // global config client *hdfs.Client + pacer *fs.Pacer // pacer for API calls } +const ( + minSleep = 20 * time.Millisecond + maxSleep = 10 * time.Second + decayConstant = 2 // bigger for slower decay, exponential +) + // copy-paste from https://github.com/colinmarc/hdfs/blob/master/cmd/hdfs/kerberos.go func getKerberosClient() (*krb.Client, error) { configPath := os.Getenv("KRB5_CONFIG") @@ -85,7 +93,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } options := hdfs.ClientOptions{ - Addresses: []string{opt.Namenode}, + Addresses: opt.Namenode, UseDatanodeHostname: false, } @@ -114,6 +122,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e opt: *opt, ci: fs.GetConfig(ctx), client: client, + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), } f.features = (&fs.Features{ diff --git a/backend/hdfs/hdfs.go b/backend/hdfs/hdfs.go index c07c0d7e2bc89..312aa1e5cc255 100644 --- a/backend/hdfs/hdfs.go +++ b/backend/hdfs/hdfs.go @@ -19,9 +19,11 @@ func init() { Description: "Hadoop distributed file system", NewFs: NewFs, Options: []fs.Option{{ - Name: "namenode", - Help: "Hadoop name node and port.\n\nE.g. \"namenode:8020\" to connect to host namenode at port 8020.", - Required: true, + Name: "namenode", + Help: "Hadoop name nodes and ports.\n\nE.g. \"namenode-1:8020,namenode-2:8020,...\" to connect to host namenodes at port 8020.", + Required: true, + Sensitive: true, + Default: fs.CommaSepList{}, }, { Name: "username", Help: "Hadoop user name.", @@ -29,6 +31,7 @@ func init() { Value: "root", Help: "Connect to hdfs as root.", }}, + Sensitive: true, }, { Name: "service_principal_name", Help: `Kerberos service principal name for the namenode. @@ -36,15 +39,16 @@ func init() { Enables KERBEROS authentication. Specifies the Service Principal Name (SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'.`, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "data_transfer_protection", Help: `Kerberos data transfer protection: authentication|integrity|privacy. Specifies whether or not authentication, data signature integrity -checks, and wire encryption is required when communicating the the -datanodes. Possible values are 'authentication', 'integrity' and -'privacy'. Used only with KERBEROS enabled.`, +checks, and wire encryption are required when communicating with +the datanodes. Possible values are 'authentication', 'integrity' +and 'privacy'. Used only with KERBEROS enabled.`, Examples: []fs.OptionExample{{ Value: "privacy", Help: "Ensure authentication, integrity and encryption enabled.", @@ -62,7 +66,7 @@ datanodes. Possible values are 'authentication', 'integrity' and // Options for this backend type Options struct { - Namenode string `config:"namenode"` + Namenode fs.CommaSepList `config:"namenode"` Username string `config:"username"` ServicePrincipalName string `config:"service_principal_name"` DataTransferProtection string `config:"data_transfer_protection"` diff --git a/backend/hdfs/object.go b/backend/hdfs/object.go index 976bc7f02ea9c..a2c2c10878c2a 100644 --- a/backend/hdfs/object.go +++ b/backend/hdfs/object.go @@ -5,10 +5,12 @@ package hdfs import ( "context" + "errors" "io" "path" "time" + "github.com/colinmarc/hdfs/v2" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/lib/readers" @@ -106,7 +108,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update object func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { - realpath := o.fs.realpath(src.Remote()) + realpath := o.fs.realpath(o.remote) dirname := path.Dir(realpath) fs.Debugf(o.fs, "update [%s]", realpath) @@ -141,7 +143,23 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return err } - err = out.Close() + // If the datanodes have acknowledged all writes but not yet + // to the namenode, FileWriter.Close can return ErrReplicating + // (wrapped in an os.PathError). This indicates that all data + // has been written, but the lease is still open for the file. + // + // It is safe in this case to either ignore the error (and let + // the lease expire on its own) or to call Close multiple + // times until it completes without an error. The Java client, + // for context, always chooses to retry, with exponential + // backoff. + err = o.fs.pacer.Call(func() (bool, error) { + err := out.Close() + if err == nil { + return false, nil + } + return errors.Is(err, hdfs.ErrReplicating), err + }) if err != nil { cleanup() return err diff --git a/backend/hidrive/helpers.go b/backend/hidrive/helpers.go index 7b925e1b34722..b7a52225793b4 100644 --- a/backend/hidrive/helpers.go +++ b/backend/hidrive/helpers.go @@ -294,15 +294,6 @@ func (f *Fs) copyOrMove(ctx context.Context, isDirectory bool, operationType Cop return &result, nil } -// copyDirectory moves the directory at the source-path to the destination-path and -// returns the resulting api-object if successful. -// -// The operation will only be successful -// if the parent-directory of the destination-path exists. -func (f *Fs) copyDirectory(ctx context.Context, source string, destination string, onExist OnExistAction) (*api.HiDriveObject, error) { - return f.copyOrMove(ctx, true, CopyOriginalPreserveModTime, source, destination, onExist) -} - // moveDirectory moves the directory at the source-path to the destination-path and // returns the resulting api-object if successful. // diff --git a/backend/hidrive/hidrive.go b/backend/hidrive/hidrive.go index 5004b81910a9e..500e6f7cfc96c 100644 --- a/backend/hidrive/hidrive.go +++ b/backend/hidrive/hidrive.go @@ -2,7 +2,7 @@ package hidrive // FIXME HiDrive only supports file or folder names of 255 characters or less. -// Operations that create files oder folder with longer names will throw a HTTP error: +// Operations that create files or folders with longer names will throw an HTTP error: // - 422 Unprocessable Entity // A more graceful way for rclone to handle this may be desirable. @@ -338,7 +338,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e return nil, fmt.Errorf("could not access root-prefix: %w", err) } if item.Type != api.HiDriveObjectTypeDirectory { - return nil, errors.New("The root-prefix needs to point to a valid directory or be empty") + return nil, errors.New("the root-prefix needs to point to a valid directory or be empty") } } diff --git a/backend/http/http.go b/backend/http/http.go index 518ea411cd8d7..862376d4f284e 100644 --- a/backend/http/http.go +++ b/backend/http/http.go @@ -36,6 +36,7 @@ func init() { Name: "http", Description: "HTTP", NewFs: NewFs, + CommandHelp: commandHelp, Options: []fs.Option{{ Name: "url", Help: "URL of HTTP host to connect to.\n\nE.g. \"https://example.com\", or \"https://user:pass@example.com\" to use a username and password.", @@ -210,18 +211,10 @@ func getFsEndpoint(ctx context.Context, client *http.Client, url string, opt *Op return createFileResult() } -// NewFs creates a new Fs object from the name and root. It connects to -// the host specified in the config file. -func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { - // Parse config into Options struct - opt := new(Options) - err := configstruct.Set(m, opt) - if err != nil { - return nil, err - } - +// Make the http connection with opt +func (f *Fs) httpConnection(ctx context.Context, opt *Options) (isFile bool, err error) { if len(opt.Headers)%2 != 0 { - return nil, errors.New("odd number of headers supplied") + return false, errors.New("odd number of headers supplied") } if !strings.HasSuffix(opt.Endpoint, "/") { @@ -231,11 +224,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e // Parse the endpoint and stick the root onto it base, err := url.Parse(opt.Endpoint) if err != nil { - return nil, err + return false, err } - u, err := rest.URLJoin(base, rest.URLPathEscape(root)) + u, err := rest.URLJoin(base, rest.URLPathEscape(f.root)) if err != nil { - return nil, err + return false, err } client := fshttp.NewClient(ctx) @@ -243,24 +236,44 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e endpoint, isFile := getFsEndpoint(ctx, client, u.String(), opt) fs.Debugf(nil, "Root: %s", endpoint) u, err = url.Parse(endpoint) + if err != nil { + return false, err + } + + // Update f with the new parameters + f.httpClient = client + f.endpoint = u + f.endpointURL = u.String() + return isFile, nil +} + +// NewFs creates a new Fs object from the name and root. It connects to +// the host specified in the config file. +func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { + // Parse config into Options struct + opt := new(Options) + err := configstruct.Set(m, opt) if err != nil { return nil, err } ci := fs.GetConfig(ctx) f := &Fs{ - name: name, - root: root, - opt: *opt, - ci: ci, - httpClient: client, - endpoint: u, - endpointURL: u.String(), + name: name, + root: root, + opt: *opt, + ci: ci, } f.features = (&fs.Features{ CanHaveEmptyDirectories: true, }).Fill(ctx, f) + // Make the http connection + isFile, err := f.httpConnection(ctx, opt) + if err != nil { + return nil, err + } + if isFile { // return an error with an fs which points to the parent return f, fs.ErrorIsFile @@ -495,7 +508,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e add(file) case fs.ErrorNotAFile: // ...found a directory not a file - add(fs.NewDir(remote, timeUnset)) + add(fs.NewDir(remote, time.Time{})) default: fs.Debugf(remote, "skipping because of error: %v", err) } @@ -507,7 +520,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e name = strings.TrimRight(name, "/") remote := path.Join(dir, name) if isDir { - add(fs.NewDir(remote, timeUnset)) + add(fs.NewDir(remote, time.Time{})) } else { in <- remote } @@ -685,10 +698,66 @@ func (o *Object) MimeType(ctx context.Context) string { return o.contentType } +var commandHelp = []fs.CommandHelp{{ + Name: "set", + Short: "Set command for updating the config parameters.", + Long: `This set command can be used to update the config parameters +for a running http backend. + +Usage Examples: + + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com + +The option keys are named as they are in the config file. + +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn't return anything. +`, +}} + +// Command the backend to run a named command +// +// The command run is name +// args may be used to read arguments from +// opts may be used to read optional arguments from +// +// The result should be capable of being JSON encoded +// If it is a string or a []string it will be shown to the user +// otherwise it will be JSON encoded and shown to the user like that +func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error) { + switch name { + case "set": + newOpt := f.opt + err := configstruct.Set(configmap.Simple(opt), &newOpt) + if err != nil { + return nil, fmt.Errorf("reading config: %w", err) + } + _, err = f.httpConnection(ctx, &newOpt) + if err != nil { + return nil, fmt.Errorf("updating session: %w", err) + } + f.opt = newOpt + keys := []string{} + for k := range opt { + keys = append(keys, k) + } + fs.Logf(f, "Updated config values: %s", strings.Join(keys, ", ")) + return nil, nil + default: + return nil, fs.ErrorCommandNotFound + } +} + // Check the interfaces are satisfied var ( _ fs.Fs = &Fs{} _ fs.PutStreamer = &Fs{} _ fs.Object = &Object{} _ fs.MimeTyper = &Object{} + _ fs.Commander = &Fs{} ) diff --git a/backend/imagekit/client/client.go b/backend/imagekit/client/client.go new file mode 100644 index 0000000000000..2b10c669d047d --- /dev/null +++ b/backend/imagekit/client/client.go @@ -0,0 +1,66 @@ +// Package client provides a client for interacting with the ImageKit API. +package client + +import ( + "context" + "fmt" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/fshttp" + "github.com/rclone/rclone/lib/rest" +) + +// ImageKit main struct +type ImageKit struct { + Prefix string + UploadPrefix string + Timeout int64 + UploadTimeout int64 + PrivateKey string + PublicKey string + URLEndpoint string + HTTPClient *rest.Client +} + +// NewParams is a struct to define parameters to imagekit +type NewParams struct { + PrivateKey string + PublicKey string + URLEndpoint string +} + +// New returns ImageKit object from environment variables +func New(ctx context.Context, params NewParams) (*ImageKit, error) { + + privateKey := params.PrivateKey + publicKey := params.PublicKey + endpointURL := params.URLEndpoint + + switch { + case privateKey == "": + return nil, fmt.Errorf("ImageKit.io URL endpoint is required") + case publicKey == "": + return nil, fmt.Errorf("ImageKit.io public key is required") + case endpointURL == "": + return nil, fmt.Errorf("ImageKit.io private key is required") + } + + cliCtx, cliCfg := fs.AddConfig(ctx) + + cliCfg.UserAgent = "rclone/imagekit" + client := rest.NewClient(fshttp.NewClient(cliCtx)) + + client.SetUserPass(privateKey, "") + client.SetHeader("Accept", "application/json") + + return &ImageKit{ + Prefix: "https://api.imagekit.io/v2", + UploadPrefix: "https://upload.imagekit.io/api/v2", + Timeout: 60, + UploadTimeout: 3600, + PrivateKey: params.PrivateKey, + PublicKey: params.PublicKey, + URLEndpoint: params.URLEndpoint, + HTTPClient: client, + }, nil +} diff --git a/backend/imagekit/client/media.go b/backend/imagekit/client/media.go new file mode 100644 index 0000000000000..d495b713b152e --- /dev/null +++ b/backend/imagekit/client/media.go @@ -0,0 +1,252 @@ +package client + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/url" + "time" + + "github.com/rclone/rclone/lib/rest" + "gopkg.in/validator.v2" +) + +// FilesOrFolderParam struct is a parameter type to ListFiles() function to search / list media library files. +type FilesOrFolderParam struct { + Path string `json:"path,omitempty"` + Limit int `json:"limit,omitempty"` + Skip int `json:"skip,omitempty"` + SearchQuery string `json:"searchQuery,omitempty"` +} + +// AITag represents an AI tag for a media library file. +type AITag struct { + Name string `json:"name"` + Confidence float32 `json:"confidence"` + Source string `json:"source"` +} + +// File represents media library File details. +type File struct { + FileID string `json:"fileId"` + Name string `json:"name"` + FilePath string `json:"filePath"` + Type string `json:"type"` + VersionInfo map[string]string `json:"versionInfo"` + IsPrivateFile *bool `json:"isPrivateFile"` + CustomCoordinates *string `json:"customCoordinates"` + URL string `json:"url"` + Thumbnail string `json:"thumbnail"` + FileType string `json:"fileType"` + Mime string `json:"mime"` + Height int `json:"height"` + Width int `json:"Width"` + Size uint64 `json:"size"` + HasAlpha bool `json:"hasAlpha"` + CustomMetadata map[string]any `json:"customMetadata,omitempty"` + EmbeddedMetadata map[string]any `json:"embeddedMetadata"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + Tags []string `json:"tags"` + AITags []AITag `json:"AITags"` +} + +// Folder represents media library Folder details. +type Folder struct { + *File + FolderPath string `json:"folderPath"` +} + +// CreateFolderParam represents parameter to create folder api +type CreateFolderParam struct { + FolderName string `validate:"nonzero" json:"folderName"` + ParentFolderPath string `validate:"nonzero" json:"parentFolderPath"` +} + +// DeleteFolderParam represents parameter to delete folder api +type DeleteFolderParam struct { + FolderPath string `validate:"nonzero" json:"folderPath"` +} + +// MoveFolderParam represents parameter to move folder api +type MoveFolderParam struct { + SourceFolderPath string `validate:"nonzero" json:"sourceFolderPath"` + DestinationPath string `validate:"nonzero" json:"destinationPath"` +} + +// JobIDResponse respresents response struct with JobID for folder operations +type JobIDResponse struct { + JobID string `json:"jobId"` +} + +// JobStatus represents response Data to job status api +type JobStatus struct { + JobID string `json:"jobId"` + Type string `json:"type"` + Status string `json:"status"` +} + +// File represents media library File details. +func (ik *ImageKit) File(ctx context.Context, fileID string) (*http.Response, *File, error) { + data := &File{} + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: fmt.Sprintf("/files/%s/details", fileID), + RootURL: ik.Prefix, + IgnoreStatus: true, + }, nil, data) + + return response, data, err +} + +// Files retrieves media library files. Filter options can be supplied as FilesOrFolderParam. +func (ik *ImageKit) Files(ctx context.Context, params FilesOrFolderParam, includeVersion bool) (*http.Response, *[]File, error) { + var SearchQuery = `type = "file"` + + if includeVersion { + SearchQuery = `type IN ["file", "file-version"]` + } + if params.SearchQuery != "" { + SearchQuery = params.SearchQuery + } + + parameters := url.Values{} + + parameters.Set("skip", fmt.Sprintf("%d", params.Skip)) + parameters.Set("limit", fmt.Sprintf("%d", params.Limit)) + parameters.Set("path", params.Path) + parameters.Set("searchQuery", SearchQuery) + + data := &[]File{} + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: "/files", + RootURL: ik.Prefix, + Parameters: parameters, + }, nil, data) + + return response, data, err +} + +// DeleteFile removes file by FileID from media library +func (ik *ImageKit) DeleteFile(ctx context.Context, fileID string) (*http.Response, error) { + var err error + + if fileID == "" { + return nil, errors.New("fileID can not be empty") + } + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "DELETE", + Path: fmt.Sprintf("/files/%s", fileID), + RootURL: ik.Prefix, + NoResponse: true, + }, nil, nil) + + return response, err +} + +// Folders retrieves media library files. Filter options can be supplied as FilesOrFolderParam. +func (ik *ImageKit) Folders(ctx context.Context, params FilesOrFolderParam) (*http.Response, *[]Folder, error) { + var SearchQuery = `type = "folder"` + + if params.SearchQuery != "" { + SearchQuery = params.SearchQuery + } + + parameters := url.Values{} + + parameters.Set("skip", fmt.Sprintf("%d", params.Skip)) + parameters.Set("limit", fmt.Sprintf("%d", params.Limit)) + parameters.Set("path", params.Path) + parameters.Set("searchQuery", SearchQuery) + + data := &[]Folder{} + + resp, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: "/files", + RootURL: ik.Prefix, + Parameters: parameters, + }, nil, data) + + if err != nil { + return resp, data, err + } + + return resp, data, err +} + +// CreateFolder creates a new folder in media library +func (ik *ImageKit) CreateFolder(ctx context.Context, param CreateFolderParam) (*http.Response, error) { + var err error + + if err = validator.Validate(¶m); err != nil { + return nil, err + } + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "POST", + Path: "/folder", + RootURL: ik.Prefix, + NoResponse: true, + }, param, nil) + + return response, err +} + +// DeleteFolder removes the folder from media library +func (ik *ImageKit) DeleteFolder(ctx context.Context, param DeleteFolderParam) (*http.Response, error) { + var err error + + if err = validator.Validate(¶m); err != nil { + return nil, err + } + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "DELETE", + Path: "/folder", + RootURL: ik.Prefix, + NoResponse: true, + }, param, nil) + + return response, err +} + +// MoveFolder moves given folder to new path in media library +func (ik *ImageKit) MoveFolder(ctx context.Context, param MoveFolderParam) (*http.Response, *JobIDResponse, error) { + var err error + var response = &JobIDResponse{} + + if err = validator.Validate(¶m); err != nil { + return nil, nil, err + } + + resp, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "PUT", + Path: "bulkJobs/moveFolder", + RootURL: ik.Prefix, + }, param, response) + + return resp, response, err +} + +// BulkJobStatus retrieves the status of a bulk job by job ID. +func (ik *ImageKit) BulkJobStatus(ctx context.Context, jobID string) (*http.Response, *JobStatus, error) { + var err error + var response = &JobStatus{} + + if jobID == "" { + return nil, nil, errors.New("jobId can not be blank") + } + + resp, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: "bulkJobs/" + jobID, + RootURL: ik.Prefix, + }, nil, response) + + return resp, response, err +} diff --git a/backend/imagekit/client/upload.go b/backend/imagekit/client/upload.go new file mode 100644 index 0000000000000..7964f8c460349 --- /dev/null +++ b/backend/imagekit/client/upload.go @@ -0,0 +1,96 @@ +package client + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/rclone/rclone/lib/rest" +) + +// UploadParam defines upload parameters +type UploadParam struct { + FileName string `json:"fileName"` + Folder string `json:"folder,omitempty"` // default value: / + Tags string `json:"tags,omitempty"` + IsPrivateFile *bool `json:"isPrivateFile,omitempty"` // default: false +} + +// UploadResult defines the response structure for the upload API +type UploadResult struct { + FileID string `json:"fileId"` + Name string `json:"name"` + URL string `json:"url"` + ThumbnailURL string `json:"thumbnailUrl"` + Height int `json:"height"` + Width int `json:"Width"` + Size uint64 `json:"size"` + FilePath string `json:"filePath"` + AITags []map[string]any `json:"AITags"` + VersionInfo map[string]string `json:"versionInfo"` +} + +// Upload uploads an asset to a imagekit account. +// +// The asset can be: +// - the actual data (io.Reader) +// - the Data URI (Base64 encoded), max ~60 MB (62,910,000 chars) +// - the remote FTP, HTTP or HTTPS URL address of an existing file +// +// https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload +func (ik *ImageKit) Upload(ctx context.Context, file io.Reader, param UploadParam) (*http.Response, *UploadResult, error) { + var err error + + if param.FileName == "" { + return nil, nil, errors.New("Upload: Filename is required") + } + + // Initialize URL values + formParams := url.Values{} + + formParams.Add("useUniqueFileName", fmt.Sprint(false)) + + // Add individual fields to URL values + if param.FileName != "" { + formParams.Add("fileName", param.FileName) + } + + if param.Tags != "" { + formParams.Add("tags", param.Tags) + } + + if param.Folder != "" { + formParams.Add("folder", param.Folder) + } + + if param.IsPrivateFile != nil { + formParams.Add("isPrivateFile", fmt.Sprintf("%v", *param.IsPrivateFile)) + } + + response := &UploadResult{} + + formReader, contentType, _, err := rest.MultipartUpload(ctx, file, formParams, "file", param.FileName) + + if err != nil { + return nil, nil, fmt.Errorf("failed to make multipart upload: %w", err) + } + + opts := rest.Opts{ + Method: "POST", + Path: "/files/upload", + RootURL: ik.UploadPrefix, + Body: formReader, + ContentType: contentType, + } + + resp, err := ik.HTTPClient.CallJSON(ctx, &opts, nil, response) + + if err != nil { + return resp, response, err + } + + return resp, response, err +} diff --git a/backend/imagekit/client/url.go b/backend/imagekit/client/url.go new file mode 100644 index 0000000000000..4589c525ddc67 --- /dev/null +++ b/backend/imagekit/client/url.go @@ -0,0 +1,72 @@ +package client + +import ( + "crypto/hmac" + "crypto/sha1" + "encoding/hex" + "fmt" + neturl "net/url" + "strconv" + "strings" + "time" +) + +// URLParam represents parameters for generating url +type URLParam struct { + Path string + Src string + URLEndpoint string + Signed bool + ExpireSeconds int64 + QueryParameters map[string]string +} + +// URL generates url from URLParam +func (ik *ImageKit) URL(params URLParam) (string, error) { + var resultURL string + var url *neturl.URL + var err error + var endpoint = params.URLEndpoint + + if endpoint == "" { + endpoint = ik.URLEndpoint + } + + endpoint = strings.TrimRight(endpoint, "/") + "/" + + if params.QueryParameters == nil { + params.QueryParameters = make(map[string]string) + } + + if url, err = neturl.Parse(params.Src); err != nil { + return "", err + } + + query := url.Query() + + for k, v := range params.QueryParameters { + query.Set(k, v) + } + url.RawQuery = query.Encode() + resultURL = url.String() + + if params.Signed { + now := time.Now().Unix() + + var expires = strconv.FormatInt(now+params.ExpireSeconds, 10) + var path = strings.Replace(resultURL, endpoint, "", 1) + + path = path + expires + mac := hmac.New(sha1.New, []byte(ik.PrivateKey)) + mac.Write([]byte(path)) + signature := hex.EncodeToString(mac.Sum(nil)) + + if strings.Contains(resultURL, "?") { + resultURL = resultURL + "&" + fmt.Sprintf("ik-t=%s&ik-s=%s", expires, signature) + } else { + resultURL = resultURL + "?" + fmt.Sprintf("ik-t=%s&ik-s=%s", expires, signature) + } + } + + return resultURL, nil +} diff --git a/backend/imagekit/imagekit.go b/backend/imagekit/imagekit.go new file mode 100644 index 0000000000000..02b35bb941f4b --- /dev/null +++ b/backend/imagekit/imagekit.go @@ -0,0 +1,828 @@ +// Package imagekit provides an interface to the ImageKit.io media library. +package imagekit + +import ( + "context" + "errors" + "fmt" + "io" + "math" + "net/http" + "path" + "strconv" + "strings" + "time" + + "github.com/rclone/rclone/backend/imagekit/client" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/readers" + "github.com/rclone/rclone/lib/version" +) + +const ( + minSleep = 1 * time.Millisecond + maxSleep = 100 * time.Millisecond + decayConstant = 2 +) + +var systemMetadataInfo = map[string]fs.MetadataHelp{ + "btime": { + Help: "Time of file birth (creation) read from Last-Modified header", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999999999Z07:00", + ReadOnly: true, + }, + "size": { + Help: "Size of the object in bytes", + Type: "int64", + ReadOnly: true, + }, + "file-type": { + Help: "Type of the file", + Type: "string", + Example: "image", + ReadOnly: true, + }, + "height": { + Help: "Height of the image or video in pixels", + Type: "int", + ReadOnly: true, + }, + "width": { + Help: "Width of the image or video in pixels", + Type: "int", + ReadOnly: true, + }, + "has-alpha": { + Help: "Whether the image has alpha channel or not", + Type: "bool", + ReadOnly: true, + }, + "tags": { + Help: "Tags associated with the file", + Type: "string", + Example: "tag1,tag2", + ReadOnly: true, + }, + "google-tags": { + Help: "AI generated tags by Google Cloud Vision associated with the image", + Type: "string", + Example: "tag1,tag2", + ReadOnly: true, + }, + "aws-tags": { + Help: "AI generated tags by AWS Rekognition associated with the image", + Type: "string", + Example: "tag1,tag2", + ReadOnly: true, + }, + "is-private-file": { + Help: "Whether the file is private or not", + Type: "bool", + ReadOnly: true, + }, + "custom-coordinates": { + Help: "Custom coordinates of the file", + Type: "string", + Example: "0,0,100,100", + ReadOnly: true, + }, +} + +// Register with Fs +func init() { + fs.Register(&fs.RegInfo{ + Name: "imagekit", + Description: "ImageKit.io", + NewFs: NewFs, + MetadataInfo: &fs.MetadataInfo{ + System: systemMetadataInfo, + Help: `Any metadata supported by the underlying remote is read and written.`, + }, + Options: []fs.Option{ + { + Name: "endpoint", + Help: "You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)", + Required: true, + }, + { + Name: "public_key", + Help: "You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)", + Required: true, + Sensitive: true, + }, + { + Name: "private_key", + Help: "You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)", + Required: true, + Sensitive: true, + }, + { + Name: "only_signed", + Help: "If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true.", + Default: false, + Advanced: true, + }, + { + Name: "versions", + Help: "Include old versions in directory listings.", + Default: false, + Advanced: true, + }, + { + Name: "upload_tags", + Help: "Tags to add to the uploaded files, e.g. \"tag1,tag2\".", + Default: "", + Advanced: true, + }, + { + Name: config.ConfigEncoding, + Help: config.ConfigEncodingHelp, + Advanced: true, + Default: (encoder.EncodeZero | + encoder.EncodeSlash | + encoder.EncodeQuestion | + encoder.EncodeHashPercent | + encoder.EncodeCtl | + encoder.EncodeDel | + encoder.EncodeDot | + encoder.EncodeDoubleQuote | + encoder.EncodePercent | + encoder.EncodeBackSlash | + encoder.EncodeDollar | + encoder.EncodeLtGt | + encoder.EncodeSquareBracket | + encoder.EncodeInvalidUtf8), + }, + }, + }) +} + +// Options defines the configuration for this backend +type Options struct { + Endpoint string `config:"endpoint"` + PublicKey string `config:"public_key"` + PrivateKey string `config:"private_key"` + OnlySigned bool `config:"only_signed"` + Versions bool `config:"versions"` + Enc encoder.MultiEncoder `config:"encoding"` +} + +// Fs represents a remote to ImageKit +type Fs struct { + name string // name of remote + root string // root path + opt Options // parsed options + features *fs.Features // optional features + ik *client.ImageKit // ImageKit client + pacer *fs.Pacer // pacer for API calls +} + +// Object describes a ImageKit file +type Object struct { + fs *Fs // The Fs this object is part of + remote string // The remote path + filePath string // The path to the file + contentType string // The content type of the object if known - may be "" + timestamp time.Time // The timestamp of the object if known - may be zero + file client.File // The media file if known - may be nil + versionID string // If present this points to an object version +} + +// NewFs constructs an Fs from the path, container:path +func NewFs(ctx context.Context, name string, root string, m configmap.Mapper) (fs.Fs, error) { + opt := new(Options) + err := configstruct.Set(m, opt) + + if err != nil { + return nil, err + } + + ik, err := client.New(ctx, client.NewParams{ + URLEndpoint: opt.Endpoint, + PublicKey: opt.PublicKey, + PrivateKey: opt.PrivateKey, + }) + + if err != nil { + return nil, err + } + + f := &Fs{ + name: name, + opt: *opt, + ik: ik, + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + } + + f.root = path.Join("/", root) + + f.features = (&fs.Features{ + CaseInsensitive: false, + DuplicateFiles: false, + ReadMimeType: true, + WriteMimeType: false, + CanHaveEmptyDirectories: true, + BucketBased: false, + ServerSideAcrossConfigs: false, + IsLocal: false, + SlowHash: true, + ReadMetadata: true, + WriteMetadata: false, + UserMetadata: false, + FilterAware: true, + PartialUploads: false, + NoMultiThreading: false, + }).Fill(ctx, f) + + if f.root != "/" { + + r := f.root + + folderPath := f.EncodePath(r[:strings.LastIndex(r, "/")+1]) + fileName := f.EncodeFileName(r[strings.LastIndex(r, "/")+1:]) + + file := f.getFileByName(ctx, folderPath, fileName) + + if file != nil { + newRoot := path.Dir(f.root) + f.root = newRoot + return f, fs.ErrorIsFile + } + + } + return f, nil +} + +// Name of the remote (as passed into NewFs) +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return strings.TrimLeft(f.root, "/") +} + +// String returns a description of the FS +func (f *Fs) String() string { + return fmt.Sprintf("FS imagekit: %s", f.root) +} + +// Precision of the ModTimes in this Fs +func (f *Fs) Precision() time.Duration { + return fs.ModTimeNotSupported +} + +// Hashes returns the supported hash types of the filesystem. +func (f *Fs) Hashes() hash.Set { + return hash.NewHashSet() +} + +// Features returns the optional features of this Fs. +func (f *Fs) Features() *fs.Features { + return f.features +} + +// List the objects and directories in dir into entries. The +// entries can be returned in any order but should be for a +// complete directory. +// +// dir should be "" to list the root, and should not have +// trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { + + remote := path.Join(f.root, dir) + + remote = f.EncodePath(remote) + + if remote != "/" { + parentFolderPath, folderName := path.Split(remote) + folderExists, err := f.getFolderByName(ctx, parentFolderPath, folderName) + + if err != nil { + return make(fs.DirEntries, 0), err + } + + if folderExists == nil { + return make(fs.DirEntries, 0), fs.ErrorDirNotFound + } + } + + folders, folderError := f.getFolders(ctx, remote) + + if folderError != nil { + return make(fs.DirEntries, 0), folderError + } + + files, fileError := f.getFiles(ctx, remote, f.opt.Versions) + + if fileError != nil { + return make(fs.DirEntries, 0), fileError + } + + res := make([]fs.DirEntry, 0, len(folders)+len(files)) + + for _, folder := range folders { + folderPath := f.DecodePath(strings.TrimLeft(strings.Replace(folder.FolderPath, f.EncodePath(f.root), "", 1), "/")) + res = append(res, fs.NewDir(folderPath, folder.UpdatedAt)) + } + + for _, file := range files { + res = append(res, f.newObject(ctx, remote, file)) + } + + return res, nil +} + +func (f *Fs) newObject(ctx context.Context, remote string, file client.File) *Object { + remoteFile := strings.TrimLeft(strings.Replace(file.FilePath, f.EncodePath(f.root), "", 1), "/") + + folderPath, fileName := path.Split(remoteFile) + + folderPath = f.DecodePath(folderPath) + fileName = f.DecodeFileName(fileName) + + remoteFile = path.Join(folderPath, fileName) + + if file.Type == "file-version" { + remoteFile = version.Add(remoteFile, file.UpdatedAt) + + return &Object{ + fs: f, + remote: remoteFile, + filePath: file.FilePath, + contentType: file.Mime, + timestamp: file.UpdatedAt, + file: file, + versionID: file.VersionInfo["id"], + } + } + + return &Object{ + fs: f, + remote: remoteFile, + filePath: file.FilePath, + contentType: file.Mime, + timestamp: file.UpdatedAt, + file: file, + } +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error ErrorObjectNotFound. +// +// If remote points to a directory then it should return +// ErrorIsDir if possible without doing any extra work, +// otherwise ErrorObjectNotFound. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + r := path.Join(f.root, remote) + + folderPath, fileName := path.Split(r) + + folderPath = f.EncodePath(folderPath) + fileName = f.EncodeFileName(fileName) + + isFolder, err := f.getFolderByName(ctx, folderPath, fileName) + + if err != nil { + return nil, err + } + + if isFolder != nil { + return nil, fs.ErrorIsDir + } + + file := f.getFileByName(ctx, folderPath, fileName) + + if file == nil { + return nil, fs.ErrorObjectNotFound + } + + return f.newObject(ctx, r, *file), nil +} + +// Put in to the remote path with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Put should either +// return an error or upload it properly (rather than e.g. calling panic). +// +// May create the object even if it returns an error - if so +// will return the object and the error, otherwise will return +// nil and the error +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + return uploadFile(ctx, f, in, src.Remote(), options...) +} + +// Mkdir makes the directory (container, bucket) +// +// Shouldn't return an error if it already exists +func (f *Fs) Mkdir(ctx context.Context, dir string) (err error) { + remote := path.Join(f.root, dir) + parentFolderPath, folderName := path.Split(remote) + + parentFolderPath = f.EncodePath(parentFolderPath) + folderName = f.EncodeFileName(folderName) + + err = f.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = f.ik.CreateFolder(ctx, client.CreateFolderParam{ + ParentFolderPath: parentFolderPath, + FolderName: folderName, + }) + + return f.shouldRetry(ctx, res, err) + }) + + return err +} + +// Rmdir removes the directory (container, bucket) if empty +// +// Return an error if it doesn't exist or isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) (err error) { + + entries, err := f.List(ctx, dir) + + if err != nil { + return err + } + + if len(entries) > 0 { + return errors.New("directory is not empty") + } + + err = f.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = f.ik.DeleteFolder(ctx, client.DeleteFolderParam{ + FolderPath: f.EncodePath(path.Join(f.root, dir)), + }) + + if res.StatusCode == http.StatusNotFound { + return false, fs.ErrorDirNotFound + } + + return f.shouldRetry(ctx, res, err) + }) + + return err +} + +// Purge deletes all the files and the container +// +// Optional interface: Only implement this if you have a way of +// deleting all the files quicker than just running Remove() on the +// result of List() +func (f *Fs) Purge(ctx context.Context, dir string) (err error) { + + remote := path.Join(f.root, dir) + + err = f.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = f.ik.DeleteFolder(ctx, client.DeleteFolderParam{ + FolderPath: f.EncodePath(remote), + }) + + if res.StatusCode == http.StatusNotFound { + return false, fs.ErrorDirNotFound + } + + return f.shouldRetry(ctx, res, err) + }) + + return err +} + +// PublicLink generates a public link to the remote path (usually readable by anyone) +func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error) { + + duration := time.Duration(math.Abs(float64(expire))) + + expireSeconds := duration.Seconds() + + fileRemote := path.Join(f.root, remote) + + folderPath, fileName := path.Split(fileRemote) + folderPath = f.EncodePath(folderPath) + fileName = f.EncodeFileName(fileName) + + file := f.getFileByName(ctx, folderPath, fileName) + + if file == nil { + return "", fs.ErrorObjectNotFound + } + + // Pacer not needed as this doesn't use the API + url, err := f.ik.URL(client.URLParam{ + Src: file.URL, + Signed: *file.IsPrivateFile || f.opt.OnlySigned, + ExpireSeconds: int64(expireSeconds), + QueryParameters: map[string]string{ + "updatedAt": file.UpdatedAt.String(), + }, + }) + + if err != nil { + return "", err + } + + return url, nil +} + +// Fs returns read only access to the Fs that this object is part of +func (o *Object) Fs() fs.Info { + return o.fs +} + +// Hash returns the selected checksum of the file +// If no checksum is available it returns "" +func (o *Object) Hash(ctx context.Context, ty hash.Type) (string, error) { + return "", hash.ErrUnsupported +} + +// Storable says whether this object can be stored +func (o *Object) Storable() bool { + return true +} + +// String returns a description of the Object +func (o *Object) String() string { + if o == nil { + return "" + } + return o.file.Name +} + +// Remote returns the remote path +func (o *Object) Remote() string { + return o.remote +} + +// ModTime returns the modification date of the file +// It should return a best guess if one isn't available +func (o *Object) ModTime(context.Context) time.Time { + return o.file.UpdatedAt +} + +// Size returns the size of the file +func (o *Object) Size() int64 { + return int64(o.file.Size) +} + +// MimeType returns the MIME type of the file +func (o *Object) MimeType(context.Context) string { + return o.contentType +} + +// Open opens the file for read. Call Close() on the returned io.ReadCloser +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + // Offset and Count for range download + var offset int64 + var count int64 + + fs.FixRangeOption(options, -1) + partialContent := false + for _, option := range options { + switch x := option.(type) { + case *fs.RangeOption: + offset, count = x.Decode(-1) + partialContent = true + case *fs.SeekOption: + offset = x.Offset + partialContent = true + default: + if option.Mandatory() { + fs.Logf(o, "Unsupported mandatory option: %v", option) + } + } + } + + // Pacer not needed as this doesn't use the API + url, err := o.fs.ik.URL(client.URLParam{ + Src: o.file.URL, + Signed: *o.file.IsPrivateFile || o.fs.opt.OnlySigned, + QueryParameters: map[string]string{ + "tr": "orig-true", + "updatedAt": o.file.UpdatedAt.String(), + }, + }) + + if err != nil { + return nil, err + } + + client := &http.Client{} + req, _ := http.NewRequest("GET", url, nil) + req.Header.Set("Range", fmt.Sprintf("bytes=%d-%d", offset, offset+count-1)) + resp, err := client.Do(req) + + if err != nil { + return nil, err + } + + end := resp.ContentLength + + if partialContent && resp.StatusCode == http.StatusOK { + skip := offset + + if offset < 0 { + skip = end + offset + 1 + } + + _, err = io.CopyN(io.Discard, resp.Body, skip) + if err != nil { + if resp != nil { + _ = resp.Body.Close() + } + return nil, err + } + + return readers.NewLimitedReadCloser(resp.Body, end-skip), nil + } + + return resp.Body, nil +} + +// Update in to the object with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either +// return an error or update the object properly (rather than e.g. calling panic). +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + + srcRemote := o.Remote() + + remote := path.Join(o.fs.root, srcRemote) + folderPath, fileName := path.Split(remote) + + UseUniqueFileName := new(bool) + *UseUniqueFileName = false + + var resp *client.UploadResult + + err = o.fs.pacer.Call(func() (bool, error) { + var res *http.Response + res, resp, err = o.fs.ik.Upload(ctx, in, client.UploadParam{ + FileName: fileName, + Folder: folderPath, + IsPrivateFile: o.file.IsPrivateFile, + }) + + return o.fs.shouldRetry(ctx, res, err) + }) + + if err != nil { + return err + } + + fileID := resp.FileID + + _, file, err := o.fs.ik.File(ctx, fileID) + + if err != nil { + return err + } + + o.file = *file + + return nil +} + +// Remove this object +func (o *Object) Remove(ctx context.Context) (err error) { + err = o.fs.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = o.fs.ik.DeleteFile(ctx, o.file.FileID) + + return o.fs.shouldRetry(ctx, res, err) + }) + + return err +} + +// SetModTime sets the metadata on the object to set the modification date +func (o *Object) SetModTime(ctx context.Context, t time.Time) error { + return fs.ErrorCantSetModTime +} + +func uploadFile(ctx context.Context, f *Fs, in io.Reader, srcRemote string, options ...fs.OpenOption) (fs.Object, error) { + remote := path.Join(f.root, srcRemote) + folderPath, fileName := path.Split(remote) + + folderPath = f.EncodePath(folderPath) + fileName = f.EncodeFileName(fileName) + + UseUniqueFileName := new(bool) + *UseUniqueFileName = false + + err := f.pacer.Call(func() (bool, error) { + var res *http.Response + var err error + res, _, err = f.ik.Upload(ctx, in, client.UploadParam{ + FileName: fileName, + Folder: folderPath, + IsPrivateFile: &f.opt.OnlySigned, + }) + + return f.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil, err + } + + return f.NewObject(ctx, srcRemote) +} + +// Metadata returns the metadata for the object +func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) { + + metadata.Set("btime", o.file.CreatedAt.Format(time.RFC3339)) + metadata.Set("size", strconv.FormatUint(o.file.Size, 10)) + metadata.Set("file-type", o.file.FileType) + metadata.Set("height", strconv.Itoa(o.file.Height)) + metadata.Set("width", strconv.Itoa(o.file.Width)) + metadata.Set("has-alpha", strconv.FormatBool(o.file.HasAlpha)) + + for k, v := range o.file.EmbeddedMetadata { + metadata.Set(k, fmt.Sprint(v)) + } + + if o.file.Tags != nil { + metadata.Set("tags", strings.Join(o.file.Tags, ",")) + } + + if o.file.CustomCoordinates != nil { + metadata.Set("custom-coordinates", *o.file.CustomCoordinates) + } + + if o.file.IsPrivateFile != nil { + metadata.Set("is-private-file", strconv.FormatBool(*o.file.IsPrivateFile)) + } + + if o.file.AITags != nil { + googleTags := []string{} + awsTags := []string{} + + for _, tag := range o.file.AITags { + if tag.Source == "google-auto-tagging" { + googleTags = append(googleTags, tag.Name) + } else if tag.Source == "aws-auto-tagging" { + awsTags = append(awsTags, tag.Name) + } + } + + if len(googleTags) > 0 { + metadata.Set("google-tags", strings.Join(googleTags, ",")) + } + + if len(awsTags) > 0 { + metadata.Set("aws-tags", strings.Join(awsTags, ",")) + } + } + + return metadata, nil +} + +// Copy src to this remote using server-side move operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantMove +func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + return nil, fs.ErrorCantMove + } + + file, err := srcObj.Open(ctx) + + if err != nil { + return nil, err + } + + return uploadFile(ctx, f, file, remote) +} + +// Check the interfaces are satisfied. +var ( + _ fs.Fs = &Fs{} + _ fs.Purger = &Fs{} + _ fs.PublicLinker = &Fs{} + _ fs.Object = &Object{} + _ fs.Copier = &Fs{} +) diff --git a/backend/imagekit/imagekit_test.go b/backend/imagekit/imagekit_test.go new file mode 100644 index 0000000000000..686976322e116 --- /dev/null +++ b/backend/imagekit/imagekit_test.go @@ -0,0 +1,18 @@ +package imagekit + +import ( + "testing" + + "github.com/rclone/rclone/fstest" + "github.com/rclone/rclone/fstest/fstests" +) + +func TestIntegration(t *testing.T) { + debug := true + fstest.Verbose = &debug + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestImageKit:", + NilObject: (*Object)(nil), + SkipFsCheckWrap: true, + }) +} diff --git a/backend/imagekit/util.go b/backend/imagekit/util.go new file mode 100644 index 0000000000000..fea67f3ac1c14 --- /dev/null +++ b/backend/imagekit/util.go @@ -0,0 +1,193 @@ +package imagekit + +import ( + "context" + "fmt" + "net/http" + "strconv" + "time" + + "github.com/rclone/rclone/backend/imagekit/client" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/fserrors" + "github.com/rclone/rclone/lib/pacer" +) + +func (f *Fs) getFiles(ctx context.Context, path string, includeVersions bool) (files []client.File, err error) { + + files = make([]client.File, 0) + + var hasMore = true + + for hasMore { + err = f.pacer.Call(func() (bool, error) { + var data *[]client.File + var res *http.Response + res, data, err = f.ik.Files(ctx, client.FilesOrFolderParam{ + Skip: len(files), + Limit: 100, + Path: path, + }, includeVersions) + + hasMore = !(len(*data) == 0 || len(*data) < 100) + + if len(*data) > 0 { + files = append(files, *data...) + } + + return f.shouldRetry(ctx, res, err) + }) + } + + if err != nil { + return make([]client.File, 0), err + } + + return files, nil +} + +func (f *Fs) getFolders(ctx context.Context, path string) (folders []client.Folder, err error) { + + folders = make([]client.Folder, 0) + + var hasMore = true + + for hasMore { + err = f.pacer.Call(func() (bool, error) { + var data *[]client.Folder + var res *http.Response + res, data, err = f.ik.Folders(ctx, client.FilesOrFolderParam{ + Skip: len(folders), + Limit: 100, + Path: path, + }) + + hasMore = !(len(*data) == 0 || len(*data) < 100) + + if len(*data) > 0 { + folders = append(folders, *data...) + } + + return f.shouldRetry(ctx, res, err) + }) + } + + if err != nil { + return make([]client.Folder, 0), err + } + + return folders, nil +} + +func (f *Fs) getFileByName(ctx context.Context, path string, name string) (file *client.File) { + + err := f.pacer.Call(func() (bool, error) { + res, data, err := f.ik.Files(ctx, client.FilesOrFolderParam{ + Limit: 1, + Path: path, + SearchQuery: fmt.Sprintf(`type = "file" AND name = %s`, strconv.Quote(name)), + }, false) + + if len(*data) == 0 { + file = nil + } else { + file = &(*data)[0] + } + + return f.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil + } + + return file +} + +func (f *Fs) getFolderByName(ctx context.Context, path string, name string) (folder *client.Folder, err error) { + err = f.pacer.Call(func() (bool, error) { + res, data, err := f.ik.Folders(ctx, client.FilesOrFolderParam{ + Limit: 1, + Path: path, + SearchQuery: fmt.Sprintf(`type = "folder" AND name = %s`, strconv.Quote(name)), + }) + + if len(*data) == 0 { + folder = nil + } else { + folder = &(*data)[0] + } + + return f.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil, err + } + + return folder, nil +} + +// retryErrorCodes is a slice of error codes that we will retry +var retryErrorCodes = []int{ + 401, // Unauthorized (e.g. "Token has expired") + 408, // Request Timeout + 429, // Rate exceeded. + 500, // Get occasional 500 Internal Server Error + 503, // Service Unavailable + 504, // Gateway Time-out +} + +func shouldRetryHTTP(resp *http.Response, retryErrorCodes []int) bool { + if resp == nil { + return false + } + for _, e := range retryErrorCodes { + if resp.StatusCode == e { + return true + } + } + return false +} + +func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) { + if fserrors.ContextError(ctx, &err) { + return false, err + } + + if resp != nil && (resp.StatusCode == 429 || resp.StatusCode == 503) { + var retryAfter = 1 + retryAfterString := resp.Header.Get("X-RateLimit-Reset") + if retryAfterString != "" { + var err error + retryAfter, err = strconv.Atoi(retryAfterString) + if err != nil { + fs.Errorf(f, "Malformed %s header %q: %v", "X-RateLimit-Reset", retryAfterString, err) + } + } + + return true, pacer.RetryAfterError(err, time.Duration(retryAfter)*time.Millisecond) + } + + return fserrors.ShouldRetry(err) || shouldRetryHTTP(resp, retryErrorCodes), err +} + +// EncodePath encapsulates the logic for encoding a path +func (f *Fs) EncodePath(str string) string { + return f.opt.Enc.FromStandardPath(str) +} + +// DecodePath encapsulates the logic for decoding a path +func (f *Fs) DecodePath(str string) string { + return f.opt.Enc.ToStandardPath(str) +} + +// EncodeFileName encapsulates the logic for encoding a file name +func (f *Fs) EncodeFileName(str string) string { + return f.opt.Enc.FromStandardName(str) +} + +// DecodeFileName encapsulates the logic for decoding a file name +func (f *Fs) DecodeFileName(str string) string { + return f.opt.Enc.ToStandardName(str) +} diff --git a/backend/internetarchive/internetarchive.go b/backend/internetarchive/internetarchive.go index 4c1dc7f829a43..8718401ec8b47 100644 --- a/backend/internetarchive/internetarchive.go +++ b/backend/internetarchive/internetarchive.go @@ -133,11 +133,13 @@ Owner is able to add custom keys. Metadata feature grabs all the keys including }, Options: []fs.Option{{ - Name: "access_key_id", - Help: "IAS3 Access Key.\n\nLeave blank for anonymous access.\nYou can find one here: https://archive.org/account/s3.php", + Name: "access_key_id", + Help: "IAS3 Access Key.\n\nLeave blank for anonymous access.\nYou can find one here: https://archive.org/account/s3.php", + Sensitive: true, }, { - Name: "secret_access_key", - Help: "IAS3 Secret Key (password).\n\nLeave blank for anonymous access.", + Name: "secret_access_key", + Help: "IAS3 Secret Key (password).\n\nLeave blank for anonymous access.", + Sensitive: true, }, { // their official client (https://github.com/jjjake/internetarchive) hardcodes following the two Name: "endpoint", @@ -800,7 +802,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op headers["x-archive-size-hint"] = fmt.Sprintf("%d", size) } var mdata fs.Metadata - mdata, err = fs.GetMetadataOptions(ctx, src, options) + mdata, err = fs.GetMetadataOptions(ctx, o.fs, src, options) if err == nil && mdata != nil { for mk, mv := range mdata { mk = strings.ToLower(mk) diff --git a/backend/jottacloud/api/types.go b/backend/jottacloud/api/types.go index 8daf0f7ad35b4..6d192bd4ecd66 100644 --- a/backend/jottacloud/api/types.go +++ b/backend/jottacloud/api/types.go @@ -395,7 +395,7 @@ type JottaFile struct { State string `xml:"currentRevision>state"` CreatedAt JottaTime `xml:"currentRevision>created"` ModifiedAt JottaTime `xml:"currentRevision>modified"` - Updated JottaTime `xml:"currentRevision>updated"` + UpdatedAt JottaTime `xml:"currentRevision>updated"` Size int64 `xml:"currentRevision>size"` MimeType string `xml:"currentRevision>mime"` MD5 string `xml:"currentRevision>md5"` diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go index 6eb76d1ef00f5..e9176f5b05b55 100644 --- a/backend/jottacloud/jottacloud.go +++ b/backend/jottacloud/jottacloud.go @@ -67,13 +67,21 @@ const ( legacyEncryptedClientSecret = "Vp8eAv7eVElMnQwN-kgU9cbhgApNDaMqWdlDi5qFydlQoji4JBxrGMF2" legacyConfigVersion = 0 - teliaCloudTokenURL = "https://cloud-auth.telia.se/auth/realms/telia_se/protocol/openid-connect/token" - teliaCloudAuthURL = "https://cloud-auth.telia.se/auth/realms/telia_se/protocol/openid-connect/auth" - teliaCloudClientID = "desktop" + teliaseCloudTokenURL = "https://cloud-auth.telia.se/auth/realms/telia_se/protocol/openid-connect/token" + teliaseCloudAuthURL = "https://cloud-auth.telia.se/auth/realms/telia_se/protocol/openid-connect/auth" + teliaseCloudClientID = "desktop" + + telianoCloudTokenURL = "https://sky-auth.telia.no/auth/realms/get/protocol/openid-connect/token" + telianoCloudAuthURL = "https://sky-auth.telia.no/auth/realms/get/protocol/openid-connect/auth" + telianoCloudClientID = "desktop" tele2CloudTokenURL = "https://mittcloud-auth.tele2.se/auth/realms/comhem/protocol/openid-connect/token" tele2CloudAuthURL = "https://mittcloud-auth.tele2.se/auth/realms/comhem/protocol/openid-connect/auth" tele2CloudClientID = "desktop" + + onlimeCloudTokenURL = "https://cloud-auth.onlime.dk/auth/realms/onlime_wl/protocol/openid-connect/token" + onlimeCloudAuthURL = "https://cloud-auth.onlime.dk/auth/realms/onlime_wl/protocol/openid-connect/auth" + onlimeCloudClientID = "desktop" ) // Register with Fs @@ -84,7 +92,34 @@ func init() { Description: "Jottacloud", NewFs: NewFs, Config: Config, - Options: []fs.Option{{ + MetadataInfo: &fs.MetadataInfo{ + Help: `Jottacloud has limited support for metadata, currently an extended set of timestamps.`, + System: map[string]fs.MetadataHelp{ + "btime": { + Help: "Time of file birth (creation), read from rclone metadata", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999999999Z07:00", + }, + "mtime": { + Help: "Time of last modification, read from rclone metadata", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999999999Z07:00", + }, + "utime": { + Help: "Time of last upload, when current revision was created, generated by backend", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999999999Z07:00", + ReadOnly: true, + }, + "content-type": { + Help: "MIME type, also known as media type", + Type: "string", + Example: "text/plain", + ReadOnly: true, + }, + }, + }, + Options: append(oauthutil.SharedOptions, []fs.Option{{ Name: "md5_memory_limit", Help: "Files bigger than this will be cached on disk to calculate the MD5 if required.", Default: fs.SizeSuffix(10 * 1024 * 1024), @@ -119,7 +154,7 @@ func init() { Default: (encoder.Display | encoder.EncodeWin | // :?"*<>| encoder.EncodeInvalidUtf8), - }}, + }}...), }) } @@ -134,11 +169,17 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf Value: "legacy", Help: "Legacy authentication.\nThis is only required for certain whitelabel versions of Jottacloud and not recommended for normal users.", }, { - Value: "telia", - Help: "Telia Cloud authentication.\nUse this if you are using Telia Cloud.", + Value: "telia_se", + Help: "Telia Cloud authentication.\nUse this if you are using Telia Cloud (Sweden).", + }, { + Value: "telia_no", + Help: "Telia Sky authentication.\nUse this if you are using Telia Sky (Norway).", }, { Value: "tele2", Help: "Tele2 Cloud authentication.\nUse this if you are using Tele2 Cloud.", + }, { + Value: "onlime", + Help: "Onlime Cloud authentication.\nUse this if you are using Onlime Cloud.", }}) case "auth_type_done": // Jump to next state according to config chosen @@ -231,17 +272,32 @@ machines.`) return nil, fmt.Errorf("error while saving token: %w", err) } return fs.ConfigGoto("choose_device") - case "telia": // telia cloud config + case "telia_se": // telia_se cloud config m.Set("configVersion", fmt.Sprint(configVersion)) - m.Set(configClientID, teliaCloudClientID) - m.Set(configTokenURL, teliaCloudTokenURL) + m.Set(configClientID, teliaseCloudClientID) + m.Set(configTokenURL, teliaseCloudTokenURL) return oauthutil.ConfigOut("choose_device", &oauthutil.Options{ OAuth2Config: &oauth2.Config{ Endpoint: oauth2.Endpoint{ - AuthURL: teliaCloudAuthURL, - TokenURL: teliaCloudTokenURL, + AuthURL: teliaseCloudAuthURL, + TokenURL: teliaseCloudTokenURL, }, - ClientID: teliaCloudClientID, + ClientID: teliaseCloudClientID, + Scopes: []string{"openid", "jotta-default", "offline_access"}, + RedirectURL: oauthutil.RedirectLocalhostURL, + }, + }) + case "telia_no": // telia_no cloud config + m.Set("configVersion", fmt.Sprint(configVersion)) + m.Set(configClientID, telianoCloudClientID) + m.Set(configTokenURL, telianoCloudTokenURL) + return oauthutil.ConfigOut("choose_device", &oauthutil.Options{ + OAuth2Config: &oauth2.Config{ + Endpoint: oauth2.Endpoint{ + AuthURL: telianoCloudAuthURL, + TokenURL: telianoCloudTokenURL, + }, + ClientID: telianoCloudClientID, Scopes: []string{"openid", "jotta-default", "offline_access"}, RedirectURL: oauthutil.RedirectLocalhostURL, }, @@ -261,6 +317,21 @@ machines.`) RedirectURL: oauthutil.RedirectLocalhostURL, }, }) + case "onlime": // onlime cloud config + m.Set("configVersion", fmt.Sprint(configVersion)) + m.Set(configClientID, onlimeCloudClientID) + m.Set(configTokenURL, onlimeCloudTokenURL) + return oauthutil.ConfigOut("choose_device", &oauthutil.Options{ + OAuth2Config: &oauth2.Config{ + Endpoint: oauth2.Endpoint{ + AuthURL: onlimeCloudAuthURL, + TokenURL: onlimeCloudTokenURL, + }, + ClientID: onlimeCloudClientID, + Scopes: []string{"openid", "jotta-default", "offline_access"}, + RedirectURL: oauthutil.RedirectLocalhostURL, + }, + }) case "choose_device": return fs.ConfigConfirm("choose_device_query", false, "config_non_standard", `Use a non-standard device/mountpoint? Choosing no, the default, will let you access the storage used for the archive @@ -453,7 +524,9 @@ type Object struct { remote string hasMetaData bool size int64 + createTime time.Time modTime time.Time + updateTime time.Time md5 string mimeType string } @@ -928,6 +1001,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e CanHaveEmptyDirectories: true, ReadMimeType: true, WriteMimeType: false, + ReadMetadata: true, + WriteMetadata: true, + UserMetadata: false, }).Fill(ctx, f) f.jfsSrv.SetErrorHandler(errorHandler) if opt.TrashedOnly { // we cannot support showing Trashed Files when using ListR right now @@ -1114,6 +1190,7 @@ func parseListRStream(ctx context.Context, r io.Reader, filesystem *Fs, callback remote: filesystem.opt.Enc.ToStandardPath(path.Join(f.Path, f.Name)), size: f.Size, md5: f.Checksum, + createTime: time.Time(f.Created), modTime: time.Time(f.Modified), }) } @@ -1343,7 +1420,7 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // is currently in trash, but can be made to match, it will be // restored. Returns ErrorObjectNotFound if upload will be necessary // to get a matching remote file. -func (f *Fs) createOrUpdate(ctx context.Context, file string, modTime time.Time, size int64, md5 string) (info *api.JottaFile, err error) { +func (f *Fs) createOrUpdate(ctx context.Context, file string, createTime time.Time, modTime time.Time, size int64, md5 string) (info *api.JottaFile, err error) { opts := rest.Opts{ Method: "POST", Path: f.filePath(file), @@ -1353,11 +1430,10 @@ func (f *Fs) createOrUpdate(ctx context.Context, file string, modTime time.Time, opts.Parameters.Set("cphash", "true") - fileDate := api.JottaTime(modTime).String() opts.ExtraHeaders["JSize"] = strconv.FormatInt(size, 10) opts.ExtraHeaders["JMd5"] = md5 - opts.ExtraHeaders["JCreated"] = fileDate - opts.ExtraHeaders["JModified"] = fileDate + opts.ExtraHeaders["JCreated"] = api.JottaTime(createTime).String() + opts.ExtraHeaders["JModified"] = api.JottaTime(modTime).String() var resp *http.Response err = f.pacer.Call(func() (bool, error) { @@ -1420,7 +1496,7 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // if destination was a trashed file then after a successful copy the copied file is still in trash (bug in api?) if err == nil && bool(info.Deleted) && !f.opt.TrashedOnly && info.State == "COMPLETED" { fs.Debugf(src, "Server-side copied to trashed destination, restoring") - info, err = f.createOrUpdate(ctx, remote, srcObj.modTime, srcObj.size, srcObj.md5) + info, err = f.createOrUpdate(ctx, remote, srcObj.createTime, srcObj.modTime, srcObj.size, srcObj.md5) } if err != nil { @@ -1683,7 +1759,9 @@ func (o *Object) setMetaData(info *api.JottaFile) (err error) { o.size = info.Size o.md5 = info.MD5 o.mimeType = info.MimeType + o.createTime = time.Time(info.CreatedAt) o.modTime = time.Time(info.ModifiedAt) + o.updateTime = time.Time(info.UpdatedAt) return nil } @@ -1728,7 +1806,7 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { // (note that if size/md5 does not match, the file content will // also be modified if deduplication is possible, i.e. it is // important to use correct/latest values) - _, err = o.fs.createOrUpdate(ctx, o.remote, modTime, o.size, o.md5) + _, err = o.fs.createOrUpdate(ctx, o.remote, o.createTime, modTime, o.size, o.md5) if err != nil { if err == fs.ErrorObjectNotFound { // file was modified (size/md5 changed) between readMetaData and createOrUpdate? @@ -1838,12 +1916,12 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if err == nil { // if the object exists delete it err = o.remove(ctx, true) - if err != nil { + if err != nil && err != fs.ErrorObjectNotFound { + // if delete failed then report that, unless it was because the file did not exist after all return fmt.Errorf("failed to remove old object: %w", err) } - } - // if the object does not exist we can just continue but if the error is something different we should report that - if err != fs.ErrorObjectNotFound { + } else if err != fs.ErrorObjectNotFound { + // if the object does not exist we can just continue but if the error is something different we should report that return err } } @@ -1865,6 +1943,37 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op // Wrap the accounting back onto the stream in = wrap(in) } + // Fetch metadata if --metadata is in use + meta, err := fs.GetMetadataOptions(ctx, o.fs, src, options) + if err != nil { + return fmt.Errorf("failed to read metadata from source object: %w", err) + } + var createdTime string + var modTime string + if meta != nil { + if v, ok := meta["btime"]; ok { + t, err := time.Parse(time.RFC3339Nano, v) // metadata stores RFC3339Nano timestamps + if err != nil { + fs.Debugf(o, "failed to parse metadata btime: %q: %v", v, err) + } else { + createdTime = api.Rfc3339Time(t).String() // jottacloud api wants RFC3339 timestamps + } + } + if v, ok := meta["mtime"]; ok { + t, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + fs.Debugf(o, "failed to parse metadata mtime: %q: %v", v, err) + } else { + modTime = api.Rfc3339Time(t).String() + } + } + } + if modTime == "" { // prefer mtime in meta as Modified time, fallback to source ModTime + modTime = api.Rfc3339Time(src.ModTime(ctx)).String() + } + if createdTime == "" { // if no Created time set same as Modified + createdTime = modTime + } // use the api to allocate the file first and get resume / deduplication info var resp *http.Response @@ -1874,13 +1983,12 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op Options: options, ExtraHeaders: make(map[string]string), } - fileDate := api.Rfc3339Time(src.ModTime(ctx)).String() // the allocate request var request = api.AllocateFileRequest{ Bytes: size, - Created: fileDate, - Modified: fileDate, + Created: createdTime, + Modified: modTime, Md5: md5String, Path: o.fs.allocatePathRaw(o.remote, true), } @@ -1895,7 +2003,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return err } - // If the file state is INCOMPLETE and CORRUPT, try to upload a then + // If the file state is INCOMPLETE and CORRUPT, we must upload it. + // Else, if the file state is COMPLETE, we don't need to upload it because + // the content is already there, possibly it was created with deduplication, + // and also any metadata changes are already performed by the allocate request. if response.State != "COMPLETED" { // how much do we still have to upload? remainingBytes := size - response.ResumePos @@ -1919,22 +2030,18 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } // send the remaining bytes - resp, err = o.fs.apiSrv.CallJSON(ctx, &opts, nil, &result) + _, err = o.fs.apiSrv.CallJSON(ctx, &opts, nil, &result) if err != nil { return err } - // finally update the meta data - o.hasMetaData = true - o.size = result.Bytes - o.md5 = result.Md5 - o.modTime = time.Unix(result.Modified/1000, 0) - } else { - // If the file state is COMPLETE we don't need to upload it because the file was already found but we still ned to update our metadata - return o.readMetaData(ctx, true) + // Upload response contains main metadata properties (size, md5 and modTime) + // which could be set back to the object, but it does not contain the + // necessary information to set the createTime and updateTime properties, + // so must therefore perform a read instead. } - - return nil + // in any case we must update the object meta data + return o.readMetaData(ctx, true) } func (o *Object) remove(ctx context.Context, hard bool) error { @@ -1951,10 +2058,17 @@ func (o *Object) remove(ctx context.Context, hard bool) error { opts.Parameters.Set("dl", "true") } - return o.fs.pacer.Call(func() (bool, error) { + err := o.fs.pacer.Call(func() (bool, error) { resp, err := o.fs.jfsSrv.CallXML(ctx, &opts, nil, nil) return shouldRetry(ctx, resp, err) }) + if apiErr, ok := err.(*api.Error); ok { + // attempting to hard delete will fail if path does not exist, but standard delete will succeed + if apiErr.StatusCode == http.StatusNotFound { + return fs.ErrorObjectNotFound + } + } + return err } // Remove an object @@ -1962,6 +2076,22 @@ func (o *Object) Remove(ctx context.Context) error { return o.remove(ctx, o.fs.opt.HardDelete) } +// Metadata returns metadata for an object +// +// It should return nil if there is no Metadata +func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) { + err = o.readMetaData(ctx, false) + if err != nil { + fs.Logf(o, "Failed to read metadata: %v", err) + return nil, err + } + metadata.Set("btime", o.createTime.Format(time.RFC3339Nano)) // metadata timestamps should be RFC3339Nano + metadata.Set("mtime", o.modTime.Format(time.RFC3339Nano)) + metadata.Set("utime", o.updateTime.Format(time.RFC3339Nano)) + metadata.Set("content-type", o.mimeType) + return metadata, nil +} + // Check the interfaces are satisfied var ( _ fs.Fs = (*Fs)(nil) @@ -1976,4 +2106,5 @@ var ( _ fs.CleanUpper = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.MimeTyper = (*Object)(nil) + _ fs.Metadataer = (*Object)(nil) ) diff --git a/backend/jottacloud/jottacloud_internal_test.go b/backend/jottacloud/jottacloud_internal_test.go index b2b11758af585..f77a3f291cbdf 100644 --- a/backend/jottacloud/jottacloud_internal_test.go +++ b/backend/jottacloud/jottacloud_internal_test.go @@ -1,11 +1,17 @@ package jottacloud import ( + "context" "crypto/md5" "fmt" "io" "testing" + "time" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fstest" + "github.com/rclone/rclone/fstest/fstests" + "github.com/rclone/rclone/lib/random" "github.com/rclone/rclone/lib/readers" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -40,3 +46,48 @@ func TestReadMD5(t *testing.T) { }) } } + +func (f *Fs) InternalTestMetadata(t *testing.T) { + ctx := context.Background() + contents := random.String(1000) + + item := fstest.NewItem("test-metadata", contents, fstest.Time("2001-05-06T04:05:06.499999999Z")) + utime := time.Now() + metadata := fs.Metadata{ + "btime": "2009-05-06T04:05:06.499999999Z", + "mtime": "2010-06-07T08:09:07.599999999Z", + //"utime" - read-only + //"content-type" - read-only + } + obj := fstests.PutTestContentsMetadata(ctx, t, f, &item, contents, true, "text/html", metadata) + defer func() { + assert.NoError(t, obj.Remove(ctx)) + }() + o := obj.(*Object) + gotMetadata, err := o.Metadata(ctx) + require.NoError(t, err) + for k, v := range metadata { + got := gotMetadata[k] + switch k { + case "btime": + assert.True(t, fstest.Time(v).Truncate(f.Precision()).Equal(fstest.Time(got)), fmt.Sprintf("btime not equal want %v got %v", v, got)) + case "mtime": + assert.True(t, fstest.Time(v).Truncate(f.Precision()).Equal(fstest.Time(got)), fmt.Sprintf("btime not equal want %v got %v", v, got)) + case "utime": + gotUtime := fstest.Time(got) + dt := gotUtime.Sub(utime) + assert.True(t, dt < time.Minute && dt > -time.Minute, fmt.Sprintf("utime more than 1 minute out want %v got %v delta %v", utime, gotUtime, dt)) + assert.True(t, fstest.Time(v).Equal(fstest.Time(got))) + case "content-type": + assert.True(t, o.MimeType(ctx) == got) + default: + assert.Equal(t, v, got, k) + } + } +} + +func (f *Fs) InternalTest(t *testing.T) { + t.Run("Metadata", f.InternalTestMetadata) +} + +var _ fstests.InternalTester = (*Fs)(nil) diff --git a/backend/koofr/koofr.go b/backend/koofr/koofr.go index 54513f0c1da48..e71fb41685dca 100644 --- a/backend/koofr/koofr.go +++ b/backend/koofr/koofr.go @@ -61,9 +61,10 @@ func init() { Default: true, Advanced: true, }, { - Name: "user", - Help: "Your user name.", - Required: true, + Name: "user", + Help: "Your user name.", + Required: true, + Sensitive: true, }, { Name: "password", Help: "Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password).", @@ -376,7 +377,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e for i, file := range files { remote := path.Join(dir, f.opt.Enc.ToStandardName(file.Name)) if file.Type == "dir" { - entries[i] = fs.NewDir(remote, time.Unix(0, 0)) + entries[i] = fs.NewDir(remote, time.Time{}) } else { entries[i] = &Object{ fs: f, diff --git a/backend/linkbox/linkbox.go b/backend/linkbox/linkbox.go new file mode 100644 index 0000000000000..75445ea72820d --- /dev/null +++ b/backend/linkbox/linkbox.go @@ -0,0 +1,897 @@ +// Package linkbox provides an interface to the linkbox.to Cloud storage system. +// +// API docs: https://www.linkbox.to/api-docs +package linkbox + +/* + Extras + - PublicLink - NO - sharing doesn't share the actual file, only a page with it on + - Move - YES - have Move and Rename file APIs so is possible + - MoveDir - NO - probably not possible - have Move but no Rename +*/ + +import ( + "bytes" + "context" + "crypto/md5" + "fmt" + "io" + "net/http" + "net/url" + "path" + "regexp" + "strconv" + "strings" + "time" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/fserrors" + "github.com/rclone/rclone/fs/fshttp" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/dircache" + "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/rest" +) + +const ( + maxEntitiesPerPage = 1024 + minSleep = 200 * time.Millisecond + maxSleep = 2 * time.Second + pacerBurst = 1 + linkboxAPIURL = "https://www.linkbox.to/api/open/" + rootID = "0" // ID of root directory +) + +func init() { + fsi := &fs.RegInfo{ + Name: "linkbox", + Description: "Linkbox", + NewFs: NewFs, + Options: []fs.Option{{ + Name: "token", + Help: "Token from https://www.linkbox.to/admin/account", + Sensitive: true, + Required: true, + }}, + } + fs.Register(fsi) +} + +// Options defines the configuration for this backend +type Options struct { + Token string `config:"token"` +} + +// Fs stores the interface to the remote Linkbox files +type Fs struct { + name string + root string + opt Options // options for this backend + features *fs.Features // optional features + ci *fs.ConfigInfo // global config + srv *rest.Client // the connection to the server + dirCache *dircache.DirCache // Map of directory path to directory id + pacer *fs.Pacer +} + +// Object is a remote object that has been stat'd (so it exists, but is not necessarily open for reading) +type Object struct { + fs *Fs + remote string + size int64 + modTime time.Time + contentType string + fullURL string + dirID int64 + itemID string // and these IDs are for files + id int64 // these IDs appear to apply to directories + isDir bool +} + +// NewFs creates a new Fs object from the name and root. It connects to +// the host specified in the config file. +func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { + root = strings.Trim(root, "/") + // Parse config into Options struct + + opt := new(Options) + err := configstruct.Set(m, opt) + if err != nil { + return nil, err + } + + ci := fs.GetConfig(ctx) + + f := &Fs{ + name: name, + opt: *opt, + root: root, + ci: ci, + srv: rest.NewClient(fshttp.NewClient(ctx)), + + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep))), + } + f.dirCache = dircache.New(root, rootID, f) + + f.features = (&fs.Features{ + CanHaveEmptyDirectories: true, + CaseInsensitive: true, + }).Fill(ctx, f) + + // Find the current root + err = f.dirCache.FindRoot(ctx, false) + if err != nil { + // Assume it is a file + newRoot, remote := dircache.SplitPath(root) + tempF := *f + tempF.dirCache = dircache.New(newRoot, rootID, &tempF) + tempF.root = newRoot + // Make new Fs which is the parent + err = tempF.dirCache.FindRoot(ctx, false) + if err != nil { + // No root so return old f + return f, nil + } + _, err := tempF.NewObject(ctx, remote) + if err != nil { + if err == fs.ErrorObjectNotFound { + // File doesn't exist so return old f + return f, nil + } + return nil, err + } + f.features.Fill(ctx, &tempF) + // XXX: update the old f here instead of returning tempF, since + // `features` were already filled with functions having *f as a receiver. + // See https://github.com/rclone/rclone/issues/2182 + f.dirCache = tempF.dirCache + f.root = tempF.root + // return an error with an fs which points to the parent + return f, fs.ErrorIsFile + } + return f, nil +} + +type entity struct { + Type string `json:"type"` + Name string `json:"name"` + URL string `json:"url"` + Ctime int64 `json:"ctime"` + Size int64 `json:"size"` + ID int64 `json:"id"` + Pid int64 `json:"pid"` + ItemID string `json:"item_id"` +} + +// Return true if the entity is a directory +func (e *entity) isDir() bool { + return e.Type == "dir" || e.Type == "sdir" +} + +type data struct { + Entities []entity `json:"list"` +} +type fileSearchRes struct { + response + SearchData data `json:"data"` +} + +// Set an object info from an entity +func (o *Object) set(e *entity) { + o.modTime = time.Unix(e.Ctime, 0) + o.contentType = e.Type + o.size = e.Size + o.fullURL = e.URL + o.isDir = e.isDir() + o.id = e.ID + o.itemID = e.ItemID + o.dirID = e.Pid +} + +// Call linkbox with the query in opts and return result +// +// This will be checked for error and an error will be returned if Status != 1 +func getUnmarshaledResponse(ctx context.Context, f *Fs, opts *rest.Opts, result interface{}) error { + err := f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, opts, nil, &result) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return err + } + responser := result.(responser) + if responser.IsError() { + return responser + } + return nil +} + +// list the objects into the function supplied +// +// If directories is set it only sends directories +// User function to process a File item from listAll +// +// Should return true to finish processing +type listAllFn func(*entity) bool + +// Search is a bit fussy about which characters match +// +// If the name doesn't match this then do an dir list instead +var searchOK = regexp.MustCompile(`^[a-zA-Z0-9_ .]+$`) + +// Lists the directory required calling the user function on each item found +// +// If the user fn ever returns true then it early exits with found = true +// +// If you set name then search ignores dirID. name is a substring +// search also so name="dir" matches "sub dir" also. This filters it +// down so it only returns items in dirID +func (f *Fs) listAll(ctx context.Context, dirID string, name string, fn listAllFn) (found bool, err error) { + var ( + pageNumber = 0 + numberOfEntities = maxEntitiesPerPage + ) + name = strings.TrimSpace(name) // search doesn't like spaces + if !searchOK.MatchString(name) { + // If name isn't good then do an unbounded search + name = "" + } +OUTER: + for numberOfEntities == maxEntitiesPerPage { + pageNumber++ + opts := &rest.Opts{ + Method: "GET", + RootURL: linkboxAPIURL, + Path: "file_search", + Parameters: url.Values{ + "token": {f.opt.Token}, + "name": {name}, + "pid": {dirID}, + "pageNo": {itoa(pageNumber)}, + "pageSize": {itoa64(maxEntitiesPerPage)}, + }, + } + + var responseResult fileSearchRes + err = getUnmarshaledResponse(ctx, f, opts, &responseResult) + if err != nil { + return false, fmt.Errorf("getting files failed: %w", err) + + } + + numberOfEntities = len(responseResult.SearchData.Entities) + + for _, entity := range responseResult.SearchData.Entities { + if itoa64(entity.Pid) != dirID { + // when name != "" this returns from all directories, so ignore not this one + continue + } + if fn(&entity) { + found = true + break OUTER + } + } + if pageNumber > 100000 { + return false, fmt.Errorf("too many results") + } + } + return found, nil +} + +// Turn 64 bit int to string +func itoa64(i int64) string { + return strconv.FormatInt(i, 10) +} + +// Turn int to string +func itoa(i int) string { + return itoa64(int64(i)) +} + +func splitDirAndName(remote string) (dir string, name string) { + lastSlashPosition := strings.LastIndex(remote, "/") + if lastSlashPosition == -1 { + dir = "" + name = remote + } else { + dir = remote[:lastSlashPosition] + name = remote[lastSlashPosition+1:] + } + + // fs.Debugf(nil, "splitDirAndName remote = {%s}, dir = {%s}, name = {%s}", remote, dir, name) + + return dir, name +} + +// FindLeaf finds a directory of name leaf in the folder with ID directoryID +func (f *Fs) FindLeaf(ctx context.Context, directoryID, leaf string) (directoryIDOut string, found bool, err error) { + // Find the leaf in directoryID + found, err = f.listAll(ctx, directoryID, leaf, func(entity *entity) bool { + if entity.isDir() && strings.EqualFold(entity.Name, leaf) { + directoryIDOut = itoa64(entity.ID) + return true + } + return false + }) + return directoryIDOut, found, err +} + +// Returned from "folder_create" +type folderCreateRes struct { + response + Data struct { + DirID int64 `json:"dirId"` + } `json:"data"` +} + +// CreateDir makes a directory with dirID as parent and name leaf +func (f *Fs) CreateDir(ctx context.Context, dirID, leaf string) (newID string, err error) { + // fs.Debugf(f, "CreateDir(%q, %q)\n", dirID, leaf) + opts := &rest.Opts{ + Method: "GET", + RootURL: linkboxAPIURL, + Path: "folder_create", + Parameters: url.Values{ + "token": {f.opt.Token}, + "name": {leaf}, + "pid": {dirID}, + "isShare": {"0"}, + "canInvite": {"1"}, + "canShare": {"1"}, + "withBodyImg": {"1"}, + "desc": {""}, + }, + } + + response := folderCreateRes{} + err = getUnmarshaledResponse(ctx, f, opts, &response) + if err != nil { + // response status 1501 means that directory already exists + if response.Status == 1501 { + return newID, fmt.Errorf("couldn't find already created directory: %w", fs.ErrorDirNotFound) + } + return newID, fmt.Errorf("CreateDir failed: %w", err) + + } + if response.Data.DirID == 0 { + return newID, fmt.Errorf("API returned 0 for ID of newly created directory") + } + return itoa64(response.Data.DirID), nil +} + +// List the objects and directories in dir into entries. The +// entries can be returned in any order but should be for a +// complete directory. +// +// dir should be "" to list the root, and should not have +// trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { + // fs.Debugf(f, "List method dir = {%s}", dir) + directoryID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return nil, err + } + _, err = f.listAll(ctx, directoryID, "", func(entity *entity) bool { + remote := path.Join(dir, entity.Name) + if entity.isDir() { + id := itoa64(entity.ID) + modTime := time.Unix(entity.Ctime, 0) + d := fs.NewDir(remote, modTime).SetID(id).SetParentID(itoa64(entity.Pid)) + entries = append(entries, d) + // cache the directory ID for later lookups + f.dirCache.Put(remote, id) + } else { + o := &Object{ + fs: f, + remote: remote, + } + o.set(entity) + entries = append(entries, o) + } + return false + }) + if err != nil { + return nil, err + } + return entries, nil +} + +// get an entity with leaf from dirID +func getEntity(ctx context.Context, f *Fs, leaf string, directoryID string, token string) (*entity, error) { + var result *entity + var resultErr = fs.ErrorObjectNotFound + _, err := f.listAll(ctx, directoryID, leaf, func(entity *entity) bool { + if strings.EqualFold(entity.Name, leaf) { + // fs.Debugf(f, "getObject found entity.Name {%s} name {%s}", entity.Name, name) + if entity.isDir() { + result = nil + resultErr = fs.ErrorIsDir + } else { + result = entity + resultErr = nil + } + return true + } + return false + }) + if err != nil { + return nil, err + } + return result, resultErr +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error ErrorObjectNotFound. +// +// If remote points to a directory then it should return +// ErrorIsDir if possible without doing any extra work, +// otherwise ErrorObjectNotFound. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + leaf, dirID, err := f.dirCache.FindPath(ctx, remote, false) + if err != nil { + if err == fs.ErrorDirNotFound { + return nil, fs.ErrorObjectNotFound + } + return nil, err + } + + entity, err := getEntity(ctx, f, leaf, dirID, f.opt.Token) + if err != nil { + return nil, err + } + o := &Object{ + fs: f, + remote: remote, + } + o.set(entity) + return o, nil +} + +// Mkdir makes the directory (container, bucket) +// +// Shouldn't return an error if it already exists +func (f *Fs) Mkdir(ctx context.Context, dir string) error { + _, err := f.dirCache.FindDir(ctx, dir, true) + return err +} + +func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) error { + if check { + entries, err := f.List(ctx, dir) + if err != nil { + return err + } + if len(entries) != 0 { + return fs.ErrorDirectoryNotEmpty + } + } + + directoryID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return err + } + opts := &rest.Opts{ + Method: "GET", + RootURL: linkboxAPIURL, + Path: "folder_del", + Parameters: url.Values{ + "token": {f.opt.Token}, + "dirIds": {directoryID}, + }, + } + + response := response{} + err = getUnmarshaledResponse(ctx, f, opts, &response) + if err != nil { + // Linkbox has some odd error returns here + if response.Status == 403 || response.Status == 500 { + return fs.ErrorDirNotFound + } + return fmt.Errorf("purge error: %w", err) + } + + f.dirCache.FlushDir(dir) + if err != nil { + return err + } + return nil +} + +// Rmdir removes the directory (container, bucket) if empty +// +// Return an error if it doesn't exist or isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) error { + return f.purgeCheck(ctx, dir, true) +} + +// SetModTime sets modTime on a particular file +func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { + return fs.ErrorCantSetModTime +} + +// Open opens the file for read. Call Close() on the returned io.ReadCloser +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + var res *http.Response + downloadURL := o.fullURL + if downloadURL == "" { + _, name := splitDirAndName(o.Remote()) + newObject, err := getEntity(ctx, o.fs, name, itoa64(o.dirID), o.fs.opt.Token) + if err != nil { + return nil, err + } + if newObject == nil { + // fs.Debugf(o.fs, "Open entity is empty: name = {%s}", name) + return nil, fs.ErrorObjectNotFound + } + + downloadURL = newObject.URL + } + + opts := &rest.Opts{ + Method: "GET", + RootURL: downloadURL, + Options: options, + } + + err := o.fs.pacer.Call(func() (bool, error) { + var err error + res, err = o.fs.srv.Call(ctx, opts) + return o.fs.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil, fmt.Errorf("Open failed: %w", err) + } + + return res.Body, nil +} + +// Update in to the object with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either +// return an error or update the object properly (rather than e.g. calling panic). +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + size := src.Size() + if size == 0 { + return fs.ErrorCantUploadEmptyFiles + } else if size < 0 { + return fmt.Errorf("can't upload files of unknown length") + } + + remote := o.Remote() + + // remove the file if it exists + if o.itemID != "" { + fs.Debugf(o, "Update: removing old file") + err = o.Remove(ctx) + if err != nil { + fs.Errorf(o, "Update: failed to remove existing file: %v", err) + } + o.itemID = "" + } else { + tmpObject, err := o.fs.NewObject(ctx, remote) + if err == nil { + fs.Debugf(o, "Update: removing old file") + err = tmpObject.Remove(ctx) + if err != nil { + fs.Errorf(o, "Update: failed to remove existing file: %v", err) + } + } + } + + first10m := io.LimitReader(in, 10_485_760) + first10mBytes, err := io.ReadAll(first10m) + if err != nil { + return fmt.Errorf("Update err in reading file: %w", err) + } + + // get upload authorization (step 1) + opts := &rest.Opts{ + Method: "GET", + RootURL: linkboxAPIURL, + Path: "get_upload_url", + Options: options, + Parameters: url.Values{ + "token": {o.fs.opt.Token}, + "fileMd5ofPre10m": {fmt.Sprintf("%x", md5.Sum(first10mBytes))}, + "fileSize": {itoa64(size)}, + }, + } + + getFirstStepResult := getUploadURLResponse{} + err = getUnmarshaledResponse(ctx, o.fs, opts, &getFirstStepResult) + if err != nil { + if getFirstStepResult.Status != 600 { + return fmt.Errorf("Update err in unmarshaling response: %w", err) + } + } + + switch getFirstStepResult.Status { + case 1: + // upload file using link from first step + var res *http.Response + + file := io.MultiReader(bytes.NewReader(first10mBytes), in) + + opts := &rest.Opts{ + Method: "PUT", + RootURL: getFirstStepResult.Data.SignURL, + Options: options, + Body: file, + ContentLength: &size, + } + + err = o.fs.pacer.CallNoRetry(func() (bool, error) { + res, err = o.fs.srv.Call(ctx, opts) + return o.fs.shouldRetry(ctx, res, err) + }) + + if err != nil { + return fmt.Errorf("update err in uploading file: %w", err) + } + + _, err = io.ReadAll(res.Body) + if err != nil { + return fmt.Errorf("update err in reading response: %w", err) + } + + case 600: + // Status means that we don't need to upload file + // We need only to make second step + default: + return fmt.Errorf("got unexpected message from Linkbox: %s", getFirstStepResult.Message) + } + + leaf, dirID, err := o.fs.dirCache.FindPath(ctx, remote, false) + if err != nil { + return err + } + + // create file item at Linkbox (second step) + opts = &rest.Opts{ + Method: "GET", + RootURL: linkboxAPIURL, + Path: "folder_upload_file", + Options: options, + Parameters: url.Values{ + "token": {o.fs.opt.Token}, + "fileMd5ofPre10m": {fmt.Sprintf("%x", md5.Sum(first10mBytes))}, + "fileSize": {itoa64(size)}, + "pid": {dirID}, + "diyName": {leaf}, + }, + } + + getSecondStepResult := getUploadURLResponse{} + err = getUnmarshaledResponse(ctx, o.fs, opts, &getSecondStepResult) + if err != nil { + return fmt.Errorf("Update second step failed: %w", err) + } + + // Try a few times to read the object after upload for eventual consistency + const maxTries = 10 + var sleepTime = 100 * time.Millisecond + var entity *entity + for try := 1; try <= maxTries; try++ { + entity, err = getEntity(ctx, o.fs, leaf, dirID, o.fs.opt.Token) + if err == nil { + break + } + if err != fs.ErrorObjectNotFound { + return fmt.Errorf("Update failed to read object: %w", err) + } + fs.Debugf(o, "Trying to read object after upload: try again in %v (%d/%d)", sleepTime, try, maxTries) + time.Sleep(sleepTime) + sleepTime *= 2 + } + if err != nil { + return err + } + o.set(entity) + return nil +} + +// Remove this object +func (o *Object) Remove(ctx context.Context) error { + opts := &rest.Opts{ + Method: "GET", + RootURL: linkboxAPIURL, + Path: "file_del", + Parameters: url.Values{ + "token": {o.fs.opt.Token}, + "itemIds": {o.itemID}, + }, + } + requestResult := getUploadURLResponse{} + err := getUnmarshaledResponse(ctx, o.fs, opts, &requestResult) + if err != nil { + return fmt.Errorf("could not Remove: %w", err) + + } + return nil +} + +// ModTime returns the modification time of the remote http file +func (o *Object) ModTime(ctx context.Context) time.Time { + return o.modTime +} + +// Remote the name of the remote HTTP file, relative to the fs root +func (o *Object) Remote() string { + return o.remote +} + +// Size returns the size in bytes of the remote http file +func (o *Object) Size() int64 { + return o.size +} + +// String returns the URL to the remote HTTP file +func (o *Object) String() string { + if o == nil { + return "" + } + return o.remote +} + +// Fs is the filesystem this remote http file object is located within +func (o *Object) Fs() fs.Info { + return o.fs +} + +// Hash returns "" since HTTP (in Go or OpenSSH) doesn't support remote calculation of hashes +func (o *Object) Hash(ctx context.Context, r hash.Type) (string, error) { + return "", hash.ErrUnsupported +} + +// Storable returns whether the remote http file is a regular file +// (not a directory, symbolic link, block device, character device, named pipe, etc.) +func (o *Object) Storable() bool { + return true +} + +// Features returns the optional features of this Fs +// Info provides a read only interface to information about a filesystem. +func (f *Fs) Features() *fs.Features { + return f.features +} + +// Name of the remote (as passed into NewFs) +// Name returns the configured name of the file system +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return f.root +} + +// String returns a description of the FS +func (f *Fs) String() string { + return fmt.Sprintf("Linkbox root '%s'", f.root) +} + +// Precision of the ModTimes in this Fs +func (f *Fs) Precision() time.Duration { + return fs.ModTimeNotSupported +} + +// Hashes returns hash.HashNone to indicate remote hashing is unavailable +// Returns the supported hash types of the filesystem +func (f *Fs) Hashes() hash.Set { + return hash.Set(hash.None) +} + +/* + { + "data": { + "signUrl": "http://xx -- Then CURL PUT your file with sign url " + }, + "msg": "please use this url to upload (PUT method)", + "status": 1 + } +*/ + +// All messages have these items +type response struct { + Message string `json:"msg"` + Status int `json:"status"` +} + +// IsError returns whether response represents an error +func (r *response) IsError() bool { + return r.Status != 1 +} + +// Error returns the error state of this response +func (r *response) Error() string { + return fmt.Sprintf("Linkbox error %d: %s", r.Status, r.Message) +} + +// responser is interface covering the response so we can use it when it is embedded. +type responser interface { + IsError() bool + Error() string +} + +type getUploadURLData struct { + SignURL string `json:"signUrl"` +} + +type getUploadURLResponse struct { + response + Data getUploadURLData `json:"data"` +} + +// Put in to the remote path with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Put should either +// return an error or upload it properly (rather than e.g. calling panic). +// +// May create the object even if it returns an error - if so +// will return the object and the error, otherwise will return +// nil and the error +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + o := &Object{ + fs: f, + remote: src.Remote(), + size: src.Size(), + } + dir, _ := splitDirAndName(src.Remote()) + err := f.Mkdir(ctx, dir) + if err != nil { + return nil, err + } + err = o.Update(ctx, in, src, options...) + return o, err +} + +// Purge all files in the directory specified +// +// Implement this if you have a way of deleting all the files +// quicker than just running Remove() on the result of List() +// +// Return an error if it doesn't exist +func (f *Fs) Purge(ctx context.Context, dir string) error { + return f.purgeCheck(ctx, dir, false) +} + +// retryErrorCodes is a slice of error codes that we will retry +var retryErrorCodes = []int{ + 429, // Too Many Requests. + 500, // Internal Server Error + 502, // Bad Gateway + 503, // Service Unavailable + 504, // Gateway Timeout + 509, // Bandwidth Limit Exceeded +} + +// shouldRetry determines whether a given err rates being retried +func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) { + if fserrors.ContextError(ctx, &err) { + return false, err + } + return fserrors.ShouldRetry(err) || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), err +} + +// DirCacheFlush resets the directory cache - used in testing as an +// optional interface +func (f *Fs) DirCacheFlush() { + f.dirCache.ResetRoot() +} + +// Check the interfaces are satisfied +var ( + _ fs.Fs = &Fs{} + _ fs.Purger = &Fs{} + _ fs.DirCacheFlusher = &Fs{} + _ fs.Object = &Object{} +) diff --git a/backend/linkbox/linkbox_test.go b/backend/linkbox/linkbox_test.go new file mode 100644 index 0000000000000..aa03c79ca763b --- /dev/null +++ b/backend/linkbox/linkbox_test.go @@ -0,0 +1,17 @@ +// Test Linkbox filesystem interface +package linkbox_test + +import ( + "testing" + + "github.com/rclone/rclone/backend/linkbox" + "github.com/rclone/rclone/fstest/fstests" +) + +// TestIntegration runs integration tests against the remote +func TestIntegration(t *testing.T) { + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestLinkbox:", + NilObject: (*linkbox.Object)(nil), + }) +} diff --git a/backend/local/local.go b/backend/local/local.go index 48f646bced808..c444267f150a9 100644 --- a/backend/local/local.go +++ b/backend/local/local.go @@ -13,6 +13,7 @@ import ( "runtime" "strings" "sync" + "sync/atomic" "time" "unicode/utf8" @@ -145,6 +146,11 @@ time we: - Only checksum the size that stat gave - Don't update the stat info for the file +**NB** do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. `, Default: false, Advanced: true, @@ -243,7 +249,7 @@ type Fs struct { precision time.Duration // precision of local filesystem warnedMu sync.Mutex // used for locking access to 'warned'. warned map[string]struct{} // whether we have warned about this string - xattrSupported int32 // whether xattrs are supported (atomic access) + xattrSupported atomic.Int32 // whether xattrs are supported // do os.Lstat or os.Stat lstat func(name string) (os.FileInfo, error) @@ -266,7 +272,10 @@ type Object struct { // ------------------------------------------------------------ -var errLinksAndCopyLinks = errors.New("can't use -l/--links with -L/--copy-links") +var ( + errLinksAndCopyLinks = errors.New("can't use -l/--links with -L/--copy-links") + errLinksNeedsSuffix = errors.New("need \"" + linkSuffix + "\" suffix to refer to symlink when using -l/--links") +) // NewFs constructs an Fs from the path func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { @@ -288,7 +297,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e lstat: os.Lstat, } if xattrSupported { - f.xattrSupported = 1 + f.xattrSupported.Store(1) } f.root = cleanRootPath(root, f.opt.NoUNC, f.opt.Enc) f.features = (&fs.Features{ @@ -300,6 +309,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e WriteMetadata: true, UserMetadata: xattrSupported, // can only R/W general purpose metadata if xattrs are supported FilterAware: true, + PartialUploads: true, }).Fill(ctx, f) if opt.FollowSymlinks { f.lstat = os.Stat @@ -310,7 +320,16 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e if err == nil { f.dev = readDevice(fi, f.opt.OneFileSystem) } + // Check to see if this is a .rclonelink if not found + hasLinkSuffix := strings.HasSuffix(f.root, linkSuffix) + if hasLinkSuffix && opt.TranslateSymlinks && os.IsNotExist(err) { + fi, err = f.lstat(strings.TrimSuffix(f.root, linkSuffix)) + } if err == nil && f.isRegular(fi.Mode()) { + // Handle the odd case, that a symlink was specified by name without the link suffix + if !hasLinkSuffix && opt.TranslateSymlinks && fi.Mode()&os.ModeSymlink != 0 { + return nil, errLinksNeedsSuffix + } // It is a file, so use the parent as the root f.root = filepath.Dir(f.root) // return an error with an fs which points to the parent @@ -503,7 +522,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e continue } } - err = fmt.Errorf("failed to read directory %q: %w", namepath, fierr) + fierr = fmt.Errorf("failed to get info about directory entry %q: %w", namepath, fierr) fs.Errorf(dir, "%v", fierr) _ = accounting.Stats(ctx).Error(fserrors.NoRetryError(fierr)) // fail the sync continue @@ -540,11 +559,6 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e } mode = fi.Mode() } - // Don't include non directory if not included - // we leave directory filtering to the layer above - if useFilter && !fi.IsDir() && !filter.IncludeRemote(newRemote) { - continue - } if fi.IsDir() { // Ignore directories which are symlinks. These are junction points under windows which // are kind of a souped up symlink. Unix doesn't have directories which are symlinks. @@ -557,6 +571,11 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e if f.opt.TranslateSymlinks && fi.Mode()&os.ModeSymlink != 0 { newRemote += linkSuffix } + // Don't include non directory if not included + // we leave directory filtering to the layer above + if useFilter && !filter.IncludeRemote(newRemote) { + continue + } fso, err := f.newObjectWithInfo(newRemote, fi) if err != nil { return nil, err @@ -628,7 +647,13 @@ func (f *Fs) Mkdir(ctx context.Context, dir string) error { // // If it isn't empty it will return an error func (f *Fs) Rmdir(ctx context.Context, dir string) error { - return os.Remove(f.localPath(dir)) + localPath := f.localPath(dir) + if fi, err := os.Stat(localPath); err != nil { + return err + } else if !fi.IsDir() { + return fs.ErrorIsFile + } + return os.Remove(localPath) } // Precision of the file system @@ -1103,6 +1128,12 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read } } + // Update the file info before we start reading + err = o.lstat() + if err != nil { + return nil, err + } + // If not checking updated then limit to current size. This means if // file is being extended, readers will read a o.Size() bytes rather // than the new size making for a consistent upload. @@ -1267,7 +1298,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } // Fetch and set metadata if --metadata is in use - meta, err := fs.GetMetadataOptions(ctx, src, options) + meta, err := fs.GetMetadataOptions(ctx, o.fs, src, options) if err != nil { return fmt.Errorf("failed to read metadata from source object: %w", err) } diff --git a/backend/local/local_internal_test.go b/backend/local/local_internal_test.go index 0fa78cd9f0d3b..06e47bed227b6 100644 --- a/backend/local/local_internal_test.go +++ b/backend/local/local_internal_test.go @@ -19,6 +19,7 @@ import ( "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/object" + "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/lib/file" "github.com/rclone/rclone/lib/readers" @@ -146,6 +147,20 @@ func TestSymlink(t *testing.T) { _, err = r.Flocal.NewObject(ctx, "symlink2.txt") require.Equal(t, fs.ErrorObjectNotFound, err) + // Check that NewFs works with the suffixed version and --links + f2, err := NewFs(ctx, "local", filepath.Join(dir, "symlink2.txt"+linkSuffix), configmap.Simple{ + "links": "true", + }) + require.Equal(t, fs.ErrorIsFile, err) + require.Equal(t, dir, f2.(*Fs).root) + + // Check that NewFs doesn't see the non suffixed version with --links + f2, err = NewFs(ctx, "local", filepath.Join(dir, "symlink2.txt"), configmap.Simple{ + "links": "true", + }) + require.Equal(t, errLinksNeedsSuffix, err) + require.Nil(t, f2) + // Check reading the object in, err := o.Open(ctx) require.NoError(t, err) @@ -397,7 +412,7 @@ func TestFilter(t *testing.T) { require.Equal(t, "[included]", fmt.Sprint(entries)) } -func TestFilterSymlink(t *testing.T) { +func testFilterSymlink(t *testing.T, copyLinks bool) { ctx := context.Background() r := fstest.NewRun(t) defer r.Finalise() @@ -411,15 +426,23 @@ func TestFilterSymlink(t *testing.T) { require.NoError(t, os.Symlink("included.dir", filepath.Join(r.LocalName, "included.dir.link"))) require.NoError(t, os.Symlink("dangling", filepath.Join(r.LocalName, "dangling.link"))) - // Set fs into "-L" mode - f.opt.FollowSymlinks = true - f.opt.TranslateSymlinks = false - f.lstat = os.Stat - - // Set fs into "-l" mode - // f.opt.FollowSymlinks = false - // f.opt.TranslateSymlinks = true - // f.lstat = os.Lstat + defer func() { + // Reset -L/-l mode + f.opt.FollowSymlinks = false + f.opt.TranslateSymlinks = false + f.lstat = os.Lstat + }() + if copyLinks { + // Set fs into "-L" mode + f.opt.FollowSymlinks = true + f.opt.TranslateSymlinks = false + f.lstat = os.Stat + } else { + // Set fs into "-l" mode + f.opt.FollowSymlinks = false + f.opt.TranslateSymlinks = true + f.lstat = os.Lstat + } // Check set up for filtering assert.True(t, f.Features().FilterAware) @@ -431,21 +454,35 @@ func TestFilterSymlink(t *testing.T) { // Add a filter ctx, fi := filter.AddConfig(ctx) require.NoError(t, fi.AddRule("+ included.file")) - require.NoError(t, fi.AddRule("+ included.file.link")) require.NoError(t, fi.AddRule("+ included.dir/**")) - require.NoError(t, fi.AddRule("+ included.dir.link/**")) + if copyLinks { + require.NoError(t, fi.AddRule("+ included.file.link")) + require.NoError(t, fi.AddRule("+ included.dir.link/**")) + } else { + require.NoError(t, fi.AddRule("+ included.file.link.rclonelink")) + require.NoError(t, fi.AddRule("+ included.dir.link.rclonelink")) + } require.NoError(t, fi.AddRule("- *")) // Check listing without use filter flag entries, err := f.List(ctx, "") require.NoError(t, err) - // Check 1 global errors one for each dangling symlink - assert.Equal(t, int64(1), accounting.Stats(ctx).GetErrors(), "global errors found") + if copyLinks { + // Check 1 global errors one for each dangling symlink + assert.Equal(t, int64(1), accounting.Stats(ctx).GetErrors(), "global errors found") + } else { + // Check 0 global errors as dangling symlink copied properly + assert.Equal(t, int64(0), accounting.Stats(ctx).GetErrors(), "global errors found") + } accounting.Stats(ctx).ResetErrors() sort.Sort(entries) - require.Equal(t, "[included.dir included.dir.link included.file included.file.link]", fmt.Sprint(entries)) + if copyLinks { + require.Equal(t, "[included.dir included.dir.link included.file included.file.link]", fmt.Sprint(entries)) + } else { + require.Equal(t, "[dangling.link.rclonelink included.dir included.dir.link.rclonelink included.file included.file.link.rclonelink]", fmt.Sprint(entries)) + } // Add user filter flag ctx = filter.SetUseFilter(ctx, true) @@ -456,7 +493,11 @@ func TestFilterSymlink(t *testing.T) { assert.Equal(t, int64(0), accounting.Stats(ctx).GetErrors(), "global errors found") sort.Sort(entries) - require.Equal(t, "[included.dir included.dir.link included.file included.file.link]", fmt.Sprint(entries)) + if copyLinks { + require.Equal(t, "[included.dir included.dir.link included.file included.file.link]", fmt.Sprint(entries)) + } else { + require.Equal(t, "[included.dir included.dir.link.rclonelink included.file included.file.link.rclonelink]", fmt.Sprint(entries)) + } // Check listing through a symlink still works entries, err = f.List(ctx, "included.dir") @@ -466,3 +507,51 @@ func TestFilterSymlink(t *testing.T) { sort.Sort(entries) require.Equal(t, "[included.dir/included.sub.file]", fmt.Sprint(entries)) } + +func TestFilterSymlinkCopyLinks(t *testing.T) { + testFilterSymlink(t, true) +} + +func TestFilterSymlinkLinks(t *testing.T) { + testFilterSymlink(t, false) +} + +func TestCopySymlink(t *testing.T) { + ctx := context.Background() + r := fstest.NewRun(t) + defer r.Finalise() + when := time.Now() + f := r.Flocal.(*Fs) + + // Create a file and a symlink to it + r.WriteFile("src/file.txt", "hello world", when) + require.NoError(t, os.Symlink("file.txt", filepath.Join(r.LocalName, "src", "link.txt"))) + defer func() { + // Reset -L/-l mode + f.opt.FollowSymlinks = false + f.opt.TranslateSymlinks = false + f.lstat = os.Lstat + }() + + // Set fs into "-l/--links" mode + f.opt.FollowSymlinks = false + f.opt.TranslateSymlinks = true + f.lstat = os.Lstat + + // Create dst + require.NoError(t, f.Mkdir(ctx, "dst")) + + // Do copy from src into dst + src, err := f.NewObject(ctx, "src/link.txt.rclonelink") + require.NoError(t, err) + require.NotNil(t, src) + dst, err := operations.Copy(ctx, f, nil, "dst/link.txt.rclonelink", src) + require.NoError(t, err) + require.NotNil(t, dst) + + // Test that we made a symlink and it has the right contents + dstPath := filepath.Join(r.LocalName, "dst", "link.txt") + linkContents, err := os.Readlink(dstPath) + require.NoError(t, err) + assert.Equal(t, "file.txt", linkContents) +} diff --git a/backend/local/metadata_linux.go b/backend/local/metadata_linux.go index b274148e713c5..47294adbaecfa 100644 --- a/backend/local/metadata_linux.go +++ b/backend/local/metadata_linux.go @@ -5,6 +5,7 @@ package local import ( "fmt" + "runtime" "sync" "time" @@ -23,7 +24,7 @@ func (o *Object) readMetadataFromFile(m *fs.Metadata) (err error) { // Check statx() is available as it was only introduced in kernel 4.11 // If not, fall back to fstatat() which was introduced in 2.6.16 which is guaranteed for all Go versions var stat unix.Statx_t - if unix.Statx(unix.AT_FDCWD, ".", 0, unix.STATX_ALL, &stat) != unix.ENOSYS { + if runtime.GOOS != "android" && unix.Statx(unix.AT_FDCWD, ".", 0, unix.STATX_ALL, &stat) != unix.ENOSYS { readMetadataFromFileFn = readMetadataFromFileStatx } else { readMetadataFromFileFn = readMetadataFromFileFstatat @@ -91,7 +92,7 @@ func readMetadataFromFileFstatat(o *Object, m *fs.Metadata) (err error) { // The types of t.Sec and t.Nsec vary from int32 to int64 on // different Linux architectures so we need to cast them to // int64 here and hence need to quiet the linter about - // unecessary casts. + // unnecessary casts. // // nolint: unconvert m.Set(key, time.Unix(int64(t.Sec), int64(t.Nsec)).Format(metadataTimeFormat)) diff --git a/backend/local/xattr.go b/backend/local/xattr.go index 81e86d8a569f0..fec0e4e7beb84 100644 --- a/backend/local/xattr.go +++ b/backend/local/xattr.go @@ -6,7 +6,6 @@ package local import ( "fmt" "strings" - "sync/atomic" "syscall" "github.com/pkg/xattr" @@ -28,7 +27,7 @@ func (f *Fs) xattrIsNotSupported(err error) bool { // Xattrs not supported can be ENOTSUP or ENOATTR or EINVAL (on Solaris) if xattrErr.Err == syscall.EINVAL || xattrErr.Err == syscall.ENOTSUP || xattrErr.Err == xattr.ENOATTR { // Show xattrs not supported - if atomic.CompareAndSwapInt32(&f.xattrSupported, 1, 0) { + if f.xattrSupported.CompareAndSwap(1, 0) { fs.Errorf(f, "xattrs not supported - disabling: %v", err) } return true @@ -41,7 +40,7 @@ func (f *Fs) xattrIsNotSupported(err error) bool { // It doesn't return any attributes owned by this backend in // metadataKeys func (o *Object) getXattr() (metadata fs.Metadata, err error) { - if !xattrSupported || atomic.LoadInt32(&o.fs.xattrSupported) == 0 { + if !xattrSupported || o.fs.xattrSupported.Load() == 0 { return nil, nil } var list []string @@ -90,7 +89,7 @@ func (o *Object) getXattr() (metadata fs.Metadata, err error) { // // It doesn't set any attributes owned by this backend in metadataKeys func (o *Object) setXattr(metadata fs.Metadata) (err error) { - if !xattrSupported || atomic.LoadInt32(&o.fs.xattrSupported) == 0 { + if !xattrSupported || o.fs.xattrSupported.Load() == 0 { return nil } for k, value := range metadata { diff --git a/backend/mailru/mailru.go b/backend/mailru/mailru.go index 28fafe7021da9..b1cb6e775dfcc 100644 --- a/backend/mailru/mailru.go +++ b/backend/mailru/mailru.go @@ -85,10 +85,11 @@ func init() { Name: "mailru", Description: "Mail.ru Cloud", NewFs: NewFs, - Options: []fs.Option{{ - Name: "user", - Help: "User name (usually email).", - Required: true, + Options: append(oauthutil.SharedOptions, []fs.Option{{ + Name: "user", + Help: "User name (usually email).", + Required: true, + Sensitive: true, }, { Name: "pass", Help: `Password. @@ -213,7 +214,7 @@ Supported quirks: atomicmkdir binlist unknowndirs`, encoder.EncodeWin | // :?"*<>| encoder.EncodeBackSlash | encoder.EncodeInvalidUtf8), - }}, + }}...), }) } diff --git a/backend/mega/mega.go b/backend/mega/mega.go index d9a218eee302c..6f974b779da76 100644 --- a/backend/mega/mega.go +++ b/backend/mega/mega.go @@ -58,9 +58,10 @@ func init() { Description: "Mega", NewFs: NewFs, Options: []fs.Option{{ - Name: "user", - Help: "User name.", - Required: true, + Name: "user", + Help: "User name.", + Required: true, + Sensitive: true, }, { Name: "pass", Help: "Password.", @@ -90,7 +91,7 @@ permanently delete objects instead.`, MEGA uses plain text HTTP connections by default. Some ISPs throttle HTTP connections, this causes transfers to become very slow. Enabling this will force MEGA to use HTTPS for all transfers. -HTTPS is normally not necesary since all data is already encrypted anyway. +HTTPS is normally not necessary since all data is already encrypted anyway. Enabling it will increase CPU usage and add network overhead.`, Default: false, Advanced: true, @@ -205,7 +206,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } ci := fs.GetConfig(ctx) - // cache *mega.Mega on username so we can re-use and share + // cache *mega.Mega on username so we can reuse and share // them between remotes. They are expensive to make as they // contain all the objects and sharing the objects makes the // move code easier as we don't have to worry about mixing diff --git a/backend/netstorage/netstorage.go b/backend/netstorage/netstorage.go index 20a6401ab7d2a..d5a0e9c6bc0f5 100755 --- a/backend/netstorage/netstorage.go +++ b/backend/netstorage/netstorage.go @@ -65,11 +65,13 @@ HTTP is provided primarily for debugging purposes.`, Help: `Domain+path of NetStorage host to connect to. Format should be ` + "`/`", - Required: true, + Required: true, + Sensitive: true, }, { - Name: "account", - Help: "Set the NetStorage account name", - Required: true, + Name: "account", + Help: "Set the NetStorage account name", + Required: true, + Sensitive: true, }, { Name: "secret", Help: `Set the NetStorage account secret/G2O key for authentication. @@ -819,6 +821,8 @@ func (f *Fs) getAuth(req *http.Request) error { // Set Authorization header dataHeader := generateDataHeader(f) path := req.URL.RequestURI() + //lint:ignore SA1008 false positive when running staticcheck, the header name is according to docs even if not canonical + //nolint:staticcheck // Don't include staticcheck when running golangci-lint to avoid SA1008 actionHeader := req.Header["X-Akamai-ACS-Action"][0] fs.Debugf(nil, "NetStorage API %s call %s for path %q", req.Method, actionHeader, path) req.Header.Set("X-Akamai-ACS-Auth-Data", dataHeader) diff --git a/backend/onedrive/api/types.go b/backend/onedrive/api/types.go index 469fd75021faf..c8e7a5fd110a6 100644 --- a/backend/onedrive/api/types.go +++ b/backend/onedrive/api/types.go @@ -99,6 +99,16 @@ type ItemReference struct { DriveType string `json:"driveType"` // Type of the drive, Read-Only } +// GetID returns a normalized ID of the item +// If DriveID is known it will be prefixed to the ID with # separator +// Can be parsed using onedrive.parseNormalizedID(normalizedID) +func (i *ItemReference) GetID() string { + if !strings.Contains(i.ID, "#") { + return i.DriveID + "#" + i.ID + } + return i.ID +} + // RemoteItemFacet groups data needed to reference a OneDrive remote item type RemoteItemFacet struct { ID string `json:"id"` // The unique identifier of the item within the remote Drive. Read-only. @@ -185,8 +195,8 @@ type Item struct { Deleted *DeletedFacet `json:"deleted"` // Information about the deleted state of the item. Read-only. } -// ViewDeltaResponse is the response to the view delta method -type ViewDeltaResponse struct { +// DeltaResponse is the response to the view delta method +type DeltaResponse struct { Value []Item `json:"value"` // An array of Item objects which have been created, modified, or deleted. NextLink string `json:"@odata.nextLink"` // A URL to retrieve the next available page of changes. DeltaLink string `json:"@odata.deltaLink"` // A URL returned instead of @odata.nextLink after all current changes have been returned. Used to read the next set of changes in the future. @@ -438,3 +448,27 @@ type Version struct { type VersionsResponse struct { Versions []Version `json:"value"` } + +// DriveResource is returned from /me/drive +type DriveResource struct { + DriveID string `json:"id"` + DriveName string `json:"name"` + DriveType string `json:"driveType"` +} + +// DrivesResponse is returned from /sites/{siteID}/drives", +type DrivesResponse struct { + Drives []DriveResource `json:"value"` +} + +// SiteResource is part of the response from from "/sites/root:" +type SiteResource struct { + SiteID string `json:"id"` + SiteName string `json:"displayName"` + SiteURL string `json:"webUrl"` +} + +// SiteResponse is returned from "/sites/root:" +type SiteResponse struct { + Sites []SiteResource `json:"value"` +} diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index f0fe628f64c85..fbbdcac474cdd 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -131,10 +131,11 @@ Note that the chunks will be buffered into memory.`, Default: defaultChunkSize, Advanced: true, }, { - Name: "drive_id", - Help: "The ID of the drive to use.", - Default: "", - Advanced: true, + Name: "drive_id", + Help: "The ID of the drive to use.", + Default: "", + Advanced: true, + Sensitive: true, }, { Name: "drive_type", Help: "The type of the drive (" + driveTypePersonal + " | " + driveTypeBusiness + " | " + driveTypeSharepoint + ").", @@ -148,7 +149,8 @@ This isn't normally needed, but in special circumstances you might know the folder ID that you wish to access but not be able to get there through a path traversal. `, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "access_scopes", Help: `Set scopes to be requested by rclone. @@ -196,7 +198,9 @@ listing, set this option.`, }, { Name: "server_side_across_configs", Default: false, - Help: `Allow server-side operations (e.g. copy) to work across different onedrive configs. + Help: `Deprecated: use --server-side-across-configs instead. + +Allow server-side operations (e.g. copy) to work across different onedrive configs. This will only work if you are copying between two OneDrive *Personal* drives AND the files to copy are already shared between them. In other cases, rclone will @@ -258,14 +262,15 @@ this flag there. At the time of writing this only works with OneDrive personal paid accounts. `, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "hash_type", Default: "auto", Help: `Specify the hash in use for the backend. This specifies the hash type in use. If set to "auto" it will use the -default hash which is is QuickXorHash. +default hash which is QuickXorHash. Before rclone 1.62 an SHA1 hash was used by default for Onedrive Personal. For 1.62 and later the default is to use a QuickXorHash for @@ -301,6 +306,55 @@ rclone. Help: "None - don't use any hashes", }}, Advanced: true, + }, { + Name: "av_override", + Default: false, + Help: `Allows download of files the server thinks has a virus. + +The onedrive/sharepoint server may check files uploaded with an Anti +Virus checker. If it detects any potential viruses or malware it will +block download of the file. + +In this case you will see a message like this + + server reports this file is infected with a virus - use --onedrive-av-override to download anyway: Infected (name of virus): 403 Forbidden: + +If you are 100% sure you want to download this file anyway then use +the --onedrive-av-override flag, or av_override = true in the config +file. +`, + Advanced: true, + }, { + Name: "delta", + Default: false, + Help: strings.ReplaceAll(`If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise |ListR| +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the |root/directory| in |onedrive:root/directory|) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone |rc vfs/refresh|. +`, "|", "`"), + Advanced: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -348,28 +402,6 @@ rclone. }) } -type driveResource struct { - DriveID string `json:"id"` - DriveName string `json:"name"` - DriveType string `json:"driveType"` -} -type drivesResponse struct { - Drives []driveResource `json:"value"` -} - -type siteResource struct { - SiteID string `json:"id"` - SiteName string `json:"displayName"` - SiteURL string `json:"webUrl"` -} -type siteResponse struct { - Sites []siteResource `json:"value"` -} -type deltaResponse struct { - DeltaLink string `json:"@odata.deltaLink"` - Value []api.Item `json:"value"` -} - // Get the region and graphURL from the config func getRegionURL(m configmap.Mapper) (region, graphURL string) { region, _ = m.Get("region") @@ -396,7 +428,7 @@ func chooseDrive(ctx context.Context, name string, m configmap.Mapper, srv *rest RootURL: graphURL, Path: "/sites/root:" + opt.relativePath, } - site := siteResource{} + site := api.SiteResource{} _, err := srv.CallJSON(ctx, &opt.opts, nil, &site) if err != nil { return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available site by relative path: %v", err)) @@ -413,7 +445,7 @@ func chooseDrive(ctx context.Context, name string, m configmap.Mapper, srv *rest } } - drives := drivesResponse{} + drives := api.DrivesResponse{} // We don't have the final ID yet? // query Microsoft Graph @@ -426,7 +458,7 @@ func chooseDrive(ctx context.Context, name string, m configmap.Mapper, srv *rest // Also call /me/drive as sometimes /me/drives doesn't return it #4068 if opt.opts.Path == "/me/drives" { opt.opts.Path = "/me/drive" - meDrive := driveResource{} + meDrive := api.DriveResource{} _, err := srv.CallJSON(ctx, &opt.opts, nil, &meDrive) if err != nil { return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available drives: %v", err)) @@ -445,7 +477,7 @@ func chooseDrive(ctx context.Context, name string, m configmap.Mapper, srv *rest } } } else { - drives.Drives = append(drives.Drives, driveResource{ + drives.Drives = append(drives.Drives, api.DriveResource{ DriveID: opt.finalDriveID, DriveName: "Chosen Drive ID", DriveType: "drive", @@ -549,15 +581,18 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf case "url": return fs.ConfigInput("url_end", "config_site_url", `Site URL -Example: "https://contoso.sharepoint.com/sites/mysite" or "mysite" +Examples: +- "mysite" +- "https://XXX.sharepoint.com/sites/mysite" +- "https://XXX.sharepoint.com/teams/ID" `) case "url_end": siteURL := config.Result - re := regexp.MustCompile(`https://.*\.sharepoint\.com/sites/(.*)`) + re := regexp.MustCompile(`https://.*\.sharepoint\.com(/.*)`) match := re.FindStringSubmatch(siteURL) if len(match) == 2 { return chooseDrive(ctx, name, m, srv, chooseDriveOpt{ - relativePath: "/sites/" + match[1], + relativePath: match[1], }) } return chooseDrive(ctx, name, m, srv, chooseDriveOpt{ @@ -579,7 +614,7 @@ Example: "https://contoso.sharepoint.com/sites/mysite" or "mysite" Path: "/sites?search=" + searchTerm, } - sites := siteResponse{} + sites := api.SiteResponse{} _, err := srv.CallJSON(ctx, &opts, nil, &sites) if err != nil { return fs.ConfigError("choose_type", fmt.Sprintf("Failed to query available sites: %v", err)) @@ -640,6 +675,8 @@ type Options struct { LinkType string `config:"link_type"` LinkPassword string `config:"link_password"` HashType string `config:"hash_type"` + AVOverride bool `config:"av_override"` + Delta bool `config:"delta"` Enc encoder.MultiEncoder `config:"encoding"` } @@ -971,6 +1008,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e f.dirCache = dircache.New(root, rootID, f) + // ListR only supported if delta set + if !f.opt.Delta { + f.features.ListR = nil + } + // Find the current root err = f.dirCache.FindRoot(ctx, false) if err != nil { @@ -1090,32 +1132,29 @@ func (f *Fs) CreateDir(ctx context.Context, dirID, leaf string) (newID string, e // If directories is set it only sends directories // User function to process a File item from listAll // -// Should return true to finish processing -type listAllFn func(*api.Item) bool +// If an error is returned then processing stops +type listAllFn func(*api.Item) error // Lists the directory required calling the user function on each item found // // If the user fn ever returns true then it early exits with found = true -func (f *Fs) listAll(ctx context.Context, dirID string, directoriesOnly bool, filesOnly bool, fn listAllFn) (found bool, err error) { - // Top parameter asks for bigger pages of data - // https://dev.onedrive.com/odata/optional-query-parameters.htm - opts := f.newOptsCall(dirID, "GET", fmt.Sprintf("/children?$top=%d", f.opt.ListChunk)) -OUTER: +// +// This listing function works on both normal listings and delta listings +func (f *Fs) _listAll(ctx context.Context, dirID string, directoriesOnly bool, filesOnly bool, fn listAllFn, opts *rest.Opts, result any, pValue *[]api.Item, pNextLink *string) (err error) { for { - var result api.ListChildrenResponse var resp *http.Response err = f.pacer.Call(func() (bool, error) { - resp, err = f.srv.CallJSON(ctx, &opts, nil, &result) + resp, err = f.srv.CallJSON(ctx, opts, nil, result) return shouldRetry(ctx, resp, err) }) if err != nil { - return found, fmt.Errorf("couldn't list files: %w", err) + return fmt.Errorf("couldn't list files: %w", err) } - if len(result.Value) == 0 { + if len(*pValue) == 0 { break } - for i := range result.Value { - item := &result.Value[i] + for i := range *pValue { + item := &(*pValue)[i] isFolder := item.GetFolder() != nil if isFolder { if filesOnly { @@ -1130,18 +1169,60 @@ OUTER: continue } item.Name = f.opt.Enc.ToStandardName(item.GetName()) - if fn(item) { - found = true - break OUTER + err = fn(item) + if err != nil { + return err } } - if result.NextLink == "" { + if *pNextLink == "" { break } opts.Path = "" - opts.RootURL = result.NextLink + opts.Parameters = nil + opts.RootURL = *pNextLink + // reset results + *pNextLink = "" + *pValue = nil } - return + return nil +} + +// Lists the directory required calling the user function on each item found +// +// If the user fn ever returns true then it early exits with found = true +func (f *Fs) listAll(ctx context.Context, dirID string, directoriesOnly bool, filesOnly bool, fn listAllFn) (err error) { + // Top parameter asks for bigger pages of data + // https://dev.onedrive.com/odata/optional-query-parameters.htm + opts := f.newOptsCall(dirID, "GET", fmt.Sprintf("/children?$top=%d", f.opt.ListChunk)) + var result api.ListChildrenResponse + return f._listAll(ctx, dirID, directoriesOnly, filesOnly, fn, &opts, &result, &result.Value, &result.NextLink) +} + +// Convert a list item into a DirEntry +// +// Can return nil for an item which should be skipped +func (f *Fs) itemToDirEntry(ctx context.Context, dir string, info *api.Item) (entry fs.DirEntry, err error) { + if !f.opt.ExposeOneNoteFiles && info.GetPackageType() == api.PackageTypeOneNote { + fs.Debugf(info.Name, "OneNote file not shown in directory listing") + return nil, nil + } + remote := path.Join(dir, info.GetName()) + folder := info.GetFolder() + if folder != nil { + // cache the directory ID for later lookups + id := info.GetID() + f.dirCache.Put(remote, id) + d := fs.NewDir(remote, time.Time(info.GetLastModifiedDateTime())).SetID(id) + d.SetItems(folder.ChildCount) + entry = d + } else { + o, err := f.newObjectWithInfo(ctx, remote, info) + if err != nil { + return nil, err + } + entry = o + } + return entry, nil } // List the objects and directories in dir into entries. The @@ -1158,41 +1239,137 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e if err != nil { return nil, err } - var iErr error - _, err = f.listAll(ctx, directoryID, false, false, func(info *api.Item) bool { - if !f.opt.ExposeOneNoteFiles && info.GetPackageType() == api.PackageTypeOneNote { - fs.Debugf(info.Name, "OneNote file not shown in directory listing") - return false - } - - remote := path.Join(dir, info.GetName()) - folder := info.GetFolder() - if folder != nil { - // cache the directory ID for later lookups - id := info.GetID() - f.dirCache.Put(remote, id) - d := fs.NewDir(remote, time.Time(info.GetLastModifiedDateTime())).SetID(id) - d.SetItems(folder.ChildCount) - entries = append(entries, d) - } else { - o, err := f.newObjectWithInfo(ctx, remote, info) - if err != nil { - iErr = err - return true - } - entries = append(entries, o) + err = f.listAll(ctx, directoryID, false, false, func(info *api.Item) error { + entry, err := f.itemToDirEntry(ctx, dir, info) + if err == nil { + entries = append(entries, entry) } - return false + return err }) if err != nil { return nil, err } - if iErr != nil { - return nil, iErr - } return entries, nil } +// ListR lists the objects and directories of the Fs starting +// from dir recursively into out. +// +// dir should be "" to start from the root, and should not +// have trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +// +// It should call callback for each tranche of entries read. +// These need not be returned in any particular order. If +// callback returns an error then the listing will stop +// immediately. +// +// Don't implement this unless you have a more efficient way +// of listing recursively than doing a directory traversal. +func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) (err error) { + // Make sure this ID is in the directory cache + directoryID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return err + } + + // ListR only works at the root of a onedrive, not on a folder + // So we have to filter things outside of the root which is + // inefficient. + + list := walk.NewListRHelper(callback) + + // list a folder conventionally - used for shared folders + var listFolder func(dir string) error + listFolder = func(dir string) error { + entries, err := f.List(ctx, dir) + if err != nil { + return err + } + for _, entry := range entries { + err = list.Add(entry) + if err != nil { + return err + } + if _, isDir := entry.(fs.Directory); isDir { + err = listFolder(entry.Remote()) + if err != nil { + return err + } + } + } + return nil + } + + // This code relies on the fact that directories are sent before their children. This isn't + // mentioned in the docs though, so maybe it shouldn't be relied on. + seen := map[string]struct{}{} + fn := func(info *api.Item) error { + var parentPath string + var ok bool + id := info.GetID() + // The API can produce duplicates, so skip them + if _, found := seen[id]; found { + return nil + } + seen[id] = struct{}{} + // Skip the root directory + if id == directoryID { + return nil + } + // Skip deleted items + if info.Deleted != nil { + return nil + } + dirID := info.GetParentReference().GetID() + // Skip files that don't have their parent directory + // cached as they are outside the root. + parentPath, ok = f.dirCache.GetInv(dirID) + if !ok { + return nil + } + // Skip files not under the root directory + remote := path.Join(parentPath, info.GetName()) + if dir != "" && !strings.HasPrefix(remote, dir+"/") { + return nil + } + entry, err := f.itemToDirEntry(ctx, parentPath, info) + if err != nil { + return err + } + err = list.Add(entry) + if err != nil { + return err + } + // If this is a shared folder, we'll need list it too + if info.RemoteItem != nil && info.RemoteItem.Folder != nil { + fs.Debugf(remote, "Listing shared directory") + return listFolder(remote) + } + return nil + } + + opts := rest.Opts{ + Method: "GET", + Path: "/root/delta", + Parameters: map[string][]string{ + // "token": {token}, + "$top": {fmt.Sprintf("%d", f.opt.ListChunk)}, + }, + } + + var result api.DeltaResponse + err = f._listAll(ctx, "", false, false, fn, &opts, &result, &result.Value, &result.NextLink) + if err != nil { + return err + } + + return list.Flush() + +} + // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // @@ -1261,15 +1438,12 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) error { } if check { // check to see if there are any items - found, err := f.listAll(ctx, rootID, false, false, func(item *api.Item) bool { - return true + err := f.listAll(ctx, rootID, false, false, func(item *api.Item) error { + return fs.ErrorDirectoryNotEmpty }) if err != nil { return err } - if found { - return fs.ErrorDirectoryNotEmpty - } } err = f.deleteObject(ctx, rootID) if err != nil { @@ -1724,6 +1898,10 @@ func (f *Fs) CleanUp(ctx context.Context) error { token := make(chan struct{}, f.ci.Checkers) var wg sync.WaitGroup err := walk.Walk(ctx, f, "", true, -1, func(path string, entries fs.DirEntries, err error) error { + if err != nil { + fs.Errorf(f, "Failed to list %q: %v", path, err) + return nil + } err = entries.ForObjectError(func(obj fs.Object) error { o, ok := obj.(*Object) if !ok { @@ -1962,12 +2140,20 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read var resp *http.Response opts := o.fs.newOptsCall(o.id, "GET", "/content") opts.Options = options + if o.fs.opt.AVOverride { + opts.Parameters = url.Values{"AVOverride": {"1"}} + } err = o.fs.pacer.Call(func() (bool, error) { resp, err = o.fs.srv.Call(ctx, &opts) return shouldRetry(ctx, resp, err) }) if err != nil { + if resp != nil { + if virus := resp.Header.Get("X-Virus-Infected"); virus != "" { + err = fmt.Errorf("server reports this file is infected with a virus - use --onedrive-av-override to download anyway: %s: %w", virus, err) + } + } return nil, err } @@ -2442,7 +2628,7 @@ func (f *Fs) changeNotifyStartPageToken(ctx context.Context) (nextDeltaToken str return } -func (f *Fs) changeNotifyNextChange(ctx context.Context, token string) (delta deltaResponse, err error) { +func (f *Fs) changeNotifyNextChange(ctx context.Context, token string) (delta api.DeltaResponse, err error) { opts := f.buildDriveDeltaOpts(token) _, err = f.srv.CallJSON(ctx, &opts, nil, &delta) @@ -2561,6 +2747,7 @@ var ( _ fs.Abouter = (*Fs)(nil) _ fs.PublicLinker = (*Fs)(nil) _ fs.CleanUpper = (*Fs)(nil) + _ fs.ListRer = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.MimeTyper = &Object{} _ fs.IDer = &Object{} diff --git a/backend/onedrive/quickxorhash/quickxorhash.go b/backend/onedrive/quickxorhash/quickxorhash.go index 242d704f1635d..a8fa3d7f047b8 100644 --- a/backend/onedrive/quickxorhash/quickxorhash.go +++ b/backend/onedrive/quickxorhash/quickxorhash.go @@ -61,7 +61,7 @@ func New() hash.Hash { func (q *quickXorHash) Write(p []byte) (n int, err error) { var i int // fill last remain - lastRemain := int(q.size) % dataSize + lastRemain := q.size % dataSize if lastRemain != 0 { i += xorBytes(q.data[lastRemain:], p) } diff --git a/backend/opendrive/opendrive.go b/backend/opendrive/opendrive.go index 037372e1357ed..0b0ee2e9d85d0 100644 --- a/backend/opendrive/opendrive.go +++ b/backend/opendrive/opendrive.go @@ -42,9 +42,10 @@ func init() { Description: "OpenDrive", NewFs: NewFs, Options: []fs.Option{{ - Name: "username", - Help: "Username.", - Required: true, + Name: "username", + Help: "Username.", + Required: true, + Sensitive: true, }, { Name: "password", Help: "Password.", @@ -766,6 +767,17 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e return f.shouldRetry(ctx, resp, err) }) if err != nil { + if apiError, ok := err.(*Error); ok { + // Work around a bug maybe in opendrive or maybe in rclone. + // + // We should know whether the folder exists or not by the call to + // FindDir above so exactly why it is not found here is a mystery. + // + // This manifests as a failure in fs/sync TestSyncOverlapWithFilter + if apiError.Info.Message == "Folder is already deleted" { + return fs.DirEntries{}, nil + } + } return nil, fmt.Errorf("failed to get folder list: %w", err) } diff --git a/backend/oracleobjectstorage/byok.go b/backend/oracleobjectstorage/byok.go index 099476a7d4561..450705d1d8097 100644 --- a/backend/oracleobjectstorage/byok.go +++ b/backend/oracleobjectstorage/byok.go @@ -13,7 +13,6 @@ import ( "github.com/oracle/oci-go-sdk/v65/common" "github.com/oracle/oci-go-sdk/v65/objectstorage" - "github.com/oracle/oci-go-sdk/v65/objectstorage/transfer" ) const ( @@ -128,18 +127,3 @@ func useBYOKCopyObject(fs *Fs, request *objectstorage.CopyObjectRequest) { request.OpcSseCustomerKeySha256 = common.String(fs.opt.SSECustomerKeySha256) } } - -func useBYOKUpload(fs *Fs, request *transfer.UploadRequest) { - if fs.opt.SSEKMSKeyID != "" { - request.OpcSseKmsKeyId = common.String(fs.opt.SSEKMSKeyID) - } - if fs.opt.SSECustomerAlgorithm != "" { - request.OpcSseCustomerAlgorithm = common.String(fs.opt.SSECustomerAlgorithm) - } - if fs.opt.SSECustomerKey != "" { - request.OpcSseCustomerKey = common.String(fs.opt.SSECustomerKey) - } - if fs.opt.SSECustomerKeySha256 != "" { - request.OpcSseCustomerKeySha256 = common.String(fs.opt.SSECustomerKeySha256) - } -} diff --git a/backend/oracleobjectstorage/command.go b/backend/oracleobjectstorage/command.go index 5297309715a88..4be61e3e5f9a6 100644 --- a/backend/oracleobjectstorage/command.go +++ b/backend/oracleobjectstorage/command.go @@ -6,6 +6,7 @@ package oracleobjectstorage import ( "context" "fmt" + "sort" "strings" "time" @@ -196,6 +197,32 @@ func (f *Fs) listMultipartUploadsAll(ctx context.Context) (uploadsMap map[string // for "dir" and it returns "dirKey" func (f *Fs) listMultipartUploads(ctx context.Context, bucketName, directory string) ( uploads []*objectstorage.MultipartUpload, err error) { + return f.listMultipartUploadsObject(ctx, bucketName, directory, false) +} + +// listMultipartUploads finds first outstanding multipart uploads for (bucket, key) +// +// Note that rather lazily we treat key as a prefix, so it matches +// directories and objects. This could surprise the user if they ask +// for "dir" and it returns "dirKey" +func (f *Fs) findLatestMultipartUpload(ctx context.Context, bucketName, directory string) ( + uploads []*objectstorage.MultipartUpload, err error) { + pastUploads, err := f.listMultipartUploadsObject(ctx, bucketName, directory, true) + if err != nil { + return nil, err + } + + if len(pastUploads) > 0 { + sort.Slice(pastUploads, func(i, j int) bool { + return pastUploads[i].TimeCreated.After(pastUploads[j].TimeCreated.Time) + }) + return pastUploads[:1], nil + } + return nil, err +} + +func (f *Fs) listMultipartUploadsObject(ctx context.Context, bucketName, directory string, exact bool) ( + uploads []*objectstorage.MultipartUpload, err error) { uploads = []*objectstorage.MultipartUpload{} req := objectstorage.ListMultipartUploadsRequest{ @@ -217,7 +244,13 @@ func (f *Fs) listMultipartUploads(ctx context.Context, bucketName, directory str if directory != "" && item.Object != nil && !strings.HasPrefix(*item.Object, directory) { continue } - uploads = append(uploads, &response.Items[index]) + if exact { + if *item.Object == directory { + uploads = append(uploads, &response.Items[index]) + } + } else { + uploads = append(uploads, &response.Items[index]) + } } if response.OpcNextPage == nil { break @@ -226,3 +259,34 @@ func (f *Fs) listMultipartUploads(ctx context.Context, bucketName, directory str } return uploads, nil } + +func (f *Fs) listMultipartUploadParts(ctx context.Context, bucketName, bucketPath string, uploadID string) ( + uploadedParts map[int]objectstorage.MultipartUploadPartSummary, err error) { + uploadedParts = make(map[int]objectstorage.MultipartUploadPartSummary) + req := objectstorage.ListMultipartUploadPartsRequest{ + NamespaceName: common.String(f.opt.Namespace), + BucketName: common.String(bucketName), + ObjectName: common.String(bucketPath), + UploadId: common.String(uploadID), + Limit: common.Int(1000), + } + + var response objectstorage.ListMultipartUploadPartsResponse + for { + err = f.pacer.Call(func() (bool, error) { + response, err = f.srv.ListMultipartUploadParts(ctx, req) + return shouldRetry(ctx, response.HTTPResponse(), err) + }) + if err != nil { + return uploadedParts, err + } + for _, item := range response.Items { + uploadedParts[*item.PartNumber] = item + } + if response.OpcNextPage == nil { + break + } + req.Page = response.OpcNextPage + } + return uploadedParts, nil +} diff --git a/backend/oracleobjectstorage/multipart.go b/backend/oracleobjectstorage/multipart.go new file mode 100644 index 0000000000000..d57a9092a68bc --- /dev/null +++ b/backend/oracleobjectstorage/multipart.go @@ -0,0 +1,441 @@ +//go:build !plan9 && !solaris && !js +// +build !plan9,!solaris,!js + +package oracleobjectstorage + +import ( + "context" + "crypto/md5" + "encoding/base64" + "encoding/hex" + "fmt" + "io" + "strings" + "sync" + "time" + + "github.com/ncw/swift/v2" + "github.com/rclone/rclone/lib/multipart" + "github.com/rclone/rclone/lib/pool" + "golang.org/x/net/http/httpguts" + + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/objectstorage" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/chunksize" + "github.com/rclone/rclone/fs/hash" +) + +var warnStreamUpload sync.Once + +// Info needed for an upload +type uploadInfo struct { + req *objectstorage.PutObjectRequest + md5sumHex string +} + +type objectChunkWriter struct { + chunkSize int64 + size int64 + f *Fs + bucket *string + key *string + uploadID *string + partsToCommit []objectstorage.CommitMultipartUploadPartDetails + partsToCommitMu sync.Mutex + existingParts map[int]objectstorage.MultipartUploadPartSummary + eTag string + md5sMu sync.Mutex + md5s []byte + ui uploadInfo + o *Object +} + +func (o *Object) uploadMultipart(ctx context.Context, src fs.ObjectInfo, in io.Reader, options ...fs.OpenOption) error { + _, err := multipart.UploadMultipart(ctx, src, in, multipart.UploadMultipartOptions{ + Open: o.fs, + OpenOptions: options, + }) + return err +} + +// OpenChunkWriter returns the chunk size and a ChunkWriter +// +// Pass in the remote and the src object +// You can also use options to hint at the desired chunk size +func (f *Fs) OpenChunkWriter( + ctx context.Context, + remote string, + src fs.ObjectInfo, + options ...fs.OpenOption) (info fs.ChunkWriterInfo, writer fs.ChunkWriter, err error) { + // Temporary Object under construction + o := &Object{ + fs: f, + remote: remote, + } + ui, err := o.prepareUpload(ctx, src, options) + if err != nil { + return info, nil, fmt.Errorf("failed to prepare upload: %w", err) + } + + uploadParts := f.opt.MaxUploadParts + if uploadParts < 1 { + uploadParts = 1 + } else if uploadParts > maxUploadParts { + uploadParts = maxUploadParts + } + size := src.Size() + + // calculate size of parts + chunkSize := f.opt.ChunkSize + + // size can be -1 here meaning we don't know the size of the incoming file. We use ChunkSize + // buffers here (default 5 MiB). With a maximum number of parts (10,000) this will be a file of + // 48 GiB which seems like a not too unreasonable limit. + if size == -1 { + warnStreamUpload.Do(func() { + fs.Logf(f, "Streaming uploads using chunk size %v will have maximum file size of %v", + f.opt.ChunkSize, fs.SizeSuffix(int64(chunkSize)*int64(uploadParts))) + }) + } else { + chunkSize = chunksize.Calculator(src, size, uploadParts, chunkSize) + } + + uploadID, existingParts, err := o.createMultipartUpload(ctx, ui.req) + if err != nil { + return info, nil, fmt.Errorf("create multipart upload request failed: %w", err) + } + bucketName, bucketPath := o.split() + chunkWriter := &objectChunkWriter{ + chunkSize: int64(chunkSize), + size: size, + f: f, + bucket: &bucketName, + key: &bucketPath, + uploadID: &uploadID, + existingParts: existingParts, + ui: ui, + o: o, + } + info = fs.ChunkWriterInfo{ + ChunkSize: int64(chunkSize), + Concurrency: o.fs.opt.UploadConcurrency, + LeavePartsOnError: o.fs.opt.LeavePartsOnError, + } + fs.Debugf(o, "open chunk writer: started multipart upload: %v", uploadID) + return info, chunkWriter, err +} + +// WriteChunk will write chunk number with reader bytes, where chunk number >= 0 +func (w *objectChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (bytesWritten int64, err error) { + if chunkNumber < 0 { + err := fmt.Errorf("invalid chunk number provided: %v", chunkNumber) + return -1, err + } + // Only account after the checksum reads have been done + if do, ok := reader.(pool.DelayAccountinger); ok { + // To figure out this number, do a transfer and if the accounted size is 0 or a + // multiple of what it should be, increase or decrease this number. + do.DelayAccounting(2) + } + m := md5.New() + currentChunkSize, err := io.Copy(m, reader) + if err != nil { + return -1, err + } + // If no data read, don't write the chunk + if currentChunkSize == 0 { + return 0, nil + } + md5sumBinary := m.Sum([]byte{}) + w.addMd5(&md5sumBinary, int64(chunkNumber)) + md5sum := base64.StdEncoding.EncodeToString(md5sumBinary[:]) + + // Object storage requires 1 <= PartNumber <= 10000 + ossPartNumber := chunkNumber + 1 + if existing, ok := w.existingParts[ossPartNumber]; ok { + if md5sum == *existing.Md5 { + fs.Debugf(w.o, "matched uploaded part found, part num %d, skipping part, md5=%v", *existing.PartNumber, md5sum) + w.addCompletedPart(existing.PartNumber, existing.Etag) + return currentChunkSize, nil + } + } + req := objectstorage.UploadPartRequest{ + NamespaceName: common.String(w.f.opt.Namespace), + BucketName: w.bucket, + ObjectName: w.key, + UploadId: w.uploadID, + UploadPartNum: common.Int(ossPartNumber), + ContentLength: common.Int64(currentChunkSize), + ContentMD5: common.String(md5sum), + } + w.o.applyPartUploadOptions(w.ui.req, &req) + var resp objectstorage.UploadPartResponse + err = w.f.pacer.Call(func() (bool, error) { + // req.UploadPartBody = io.NopCloser(bytes.NewReader(buf)) + // rewind the reader on retry and after reading md5 + _, err = reader.Seek(0, io.SeekStart) + if err != nil { + return false, err + } + req.UploadPartBody = io.NopCloser(reader) + resp, err = w.f.srv.UploadPart(ctx, req) + if err != nil { + if ossPartNumber <= 8 { + return shouldRetry(ctx, resp.HTTPResponse(), err) + } + // retry all chunks once have done the first few + return true, err + } + return false, err + }) + if err != nil { + fs.Errorf(w.o, "multipart upload failed to upload part:%d err: %v", ossPartNumber, err) + return -1, fmt.Errorf("multipart upload failed to upload part: %w", err) + } + w.addCompletedPart(&ossPartNumber, resp.ETag) + return currentChunkSize, err + +} + +// add a part number and etag to the completed parts +func (w *objectChunkWriter) addCompletedPart(partNum *int, eTag *string) { + w.partsToCommitMu.Lock() + defer w.partsToCommitMu.Unlock() + w.partsToCommit = append(w.partsToCommit, objectstorage.CommitMultipartUploadPartDetails{ + PartNum: partNum, + Etag: eTag, + }) +} + +func (w *objectChunkWriter) Close(ctx context.Context) (err error) { + req := objectstorage.CommitMultipartUploadRequest{ + NamespaceName: common.String(w.f.opt.Namespace), + BucketName: w.bucket, + ObjectName: w.key, + UploadId: w.uploadID, + } + req.PartsToCommit = w.partsToCommit + var resp objectstorage.CommitMultipartUploadResponse + err = w.f.pacer.Call(func() (bool, error) { + resp, err = w.f.srv.CommitMultipartUpload(ctx, req) + // if multipart is corrupted, we will abort the uploadId + if isMultiPartUploadCorrupted(err) { + fs.Debugf(w.o, "multipart uploadId %v is corrupted, aborting...", *w.uploadID) + _ = w.Abort(ctx) + return false, err + } + return shouldRetry(ctx, resp.HTTPResponse(), err) + }) + if err != nil { + return err + } + w.eTag = *resp.ETag + hashOfHashes := md5.Sum(w.md5s) + wantMultipartMd5 := fmt.Sprintf("%s-%d", base64.StdEncoding.EncodeToString(hashOfHashes[:]), len(w.partsToCommit)) + gotMultipartMd5 := *resp.OpcMultipartMd5 + if wantMultipartMd5 != gotMultipartMd5 { + fs.Errorf(w.o, "multipart upload corrupted: multipart md5 differ: expecting %s but got %s", wantMultipartMd5, gotMultipartMd5) + return fmt.Errorf("multipart upload corrupted: md5 differ: expecting %s but got %s", wantMultipartMd5, gotMultipartMd5) + } + fs.Debugf(w.o, "multipart upload %v md5 matched: expecting %s and got %s", *w.uploadID, wantMultipartMd5, gotMultipartMd5) + return nil +} + +func isMultiPartUploadCorrupted(err error) bool { + if err == nil { + return false + } + // Check if this oci-err object, and if it is multipart commit error + if ociError, ok := err.(common.ServiceError); ok { + // If it is a timeout then we want to retry that + if ociError.GetCode() == "InvalidUploadPart" { + return true + } + } + return false +} + +func (w *objectChunkWriter) Abort(ctx context.Context) error { + fs.Debugf(w.o, "Cancelling multipart upload") + err := w.o.fs.abortMultiPartUpload( + ctx, + w.bucket, + w.key, + w.uploadID) + if err != nil { + fs.Debugf(w.o, "Failed to cancel multipart upload: %v", err) + } else { + fs.Debugf(w.o, "canceled and aborted multipart upload: %v", *w.uploadID) + } + return err +} + +// addMd5 adds a binary md5 to the md5 calculated so far +func (w *objectChunkWriter) addMd5(md5binary *[]byte, chunkNumber int64) { + w.md5sMu.Lock() + defer w.md5sMu.Unlock() + start := chunkNumber * md5.Size + end := start + md5.Size + if extend := end - int64(len(w.md5s)); extend > 0 { + w.md5s = append(w.md5s, make([]byte, extend)...) + } + copy(w.md5s[start:end], (*md5binary)[:]) +} + +func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options []fs.OpenOption) (ui uploadInfo, err error) { + bucket, bucketPath := o.split() + + ui.req = &objectstorage.PutObjectRequest{ + NamespaceName: common.String(o.fs.opt.Namespace), + BucketName: common.String(bucket), + ObjectName: common.String(bucketPath), + } + + // Set the mtime in the metadata + modTime := src.ModTime(ctx) + // Fetch metadata if --metadata is in use + meta, err := fs.GetMetadataOptions(ctx, o.fs, src, options) + if err != nil { + return ui, fmt.Errorf("failed to read metadata from source object: %w", err) + } + ui.req.OpcMeta = make(map[string]string, len(meta)+2) + // merge metadata into request and user metadata + for k, v := range meta { + pv := common.String(v) + k = strings.ToLower(k) + switch k { + case "cache-control": + ui.req.CacheControl = pv + case "content-disposition": + ui.req.ContentDisposition = pv + case "content-encoding": + ui.req.ContentEncoding = pv + case "content-language": + ui.req.ContentLanguage = pv + case "content-type": + ui.req.ContentType = pv + case "tier": + // ignore + case "mtime": + // mtime in meta overrides source ModTime + metaModTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + fs.Debugf(o, "failed to parse metadata %s: %q: %v", k, v, err) + } else { + modTime = metaModTime + } + case "btime": + // write as metadata since we can't set it + ui.req.OpcMeta[k] = v + default: + ui.req.OpcMeta[k] = v + } + } + + // Set the mtime in the metadata + ui.req.OpcMeta[metaMtime] = swift.TimeToFloatString(modTime) + + // read the md5sum if available + // - for non-multipart + // - so we can add a ContentMD5 + // - so we can add the md5sum in the metadata as metaMD5Hash if using SSE/SSE-C + // - for multipart provided checksums aren't disabled + // - so we can add the md5sum in the metadata as metaMD5Hash + size := src.Size() + isMultipart := size < 0 || size >= int64(o.fs.opt.UploadCutoff) + var md5sumBase64 string + if !isMultipart || !o.fs.opt.DisableChecksum { + ui.md5sumHex, err = src.Hash(ctx, hash.MD5) + if err == nil && matchMd5.MatchString(ui.md5sumHex) { + hashBytes, err := hex.DecodeString(ui.md5sumHex) + if err == nil { + md5sumBase64 = base64.StdEncoding.EncodeToString(hashBytes) + if isMultipart && !o.fs.opt.DisableChecksum { + // Set the md5sum as metadata on the object if + // - a multipart upload + // - the ETag is not an MD5, e.g. when using SSE/SSE-C + // provided checksums aren't disabled + ui.req.OpcMeta[metaMD5Hash] = md5sumBase64 + } + } + } + } + // Set the content type if it isn't set already + if ui.req.ContentType == nil { + ui.req.ContentType = common.String(fs.MimeType(ctx, src)) + } + if size >= 0 { + ui.req.ContentLength = common.Int64(size) + } + if md5sumBase64 != "" { + ui.req.ContentMD5 = &md5sumBase64 + } + o.applyPutOptions(ui.req, options...) + useBYOKPutObject(o.fs, ui.req) + if o.fs.opt.StorageTier != "" { + storageTier, ok := objectstorage.GetMappingPutObjectStorageTierEnum(o.fs.opt.StorageTier) + if !ok { + return ui, fmt.Errorf("not a valid storage tier: %v", o.fs.opt.StorageTier) + } + ui.req.StorageTier = storageTier + } + // Check metadata keys and values are valid + for key, value := range ui.req.OpcMeta { + if !httpguts.ValidHeaderFieldName(key) { + fs.Errorf(o, "Dropping invalid metadata key %q", key) + delete(ui.req.OpcMeta, key) + } else if value == "" { + fs.Errorf(o, "Dropping nil metadata value for key %q", key) + delete(ui.req.OpcMeta, key) + } else if !httpguts.ValidHeaderFieldValue(value) { + fs.Errorf(o, "Dropping invalid metadata value %q for key %q", value, key) + delete(ui.req.OpcMeta, key) + } + } + return ui, nil +} + +func (o *Object) createMultipartUpload(ctx context.Context, putReq *objectstorage.PutObjectRequest) ( + uploadID string, existingParts map[int]objectstorage.MultipartUploadPartSummary, err error) { + bucketName, bucketPath := o.split() + f := o.fs + if f.opt.AttemptResumeUpload { + fs.Debugf(o, "attempting to resume upload for %v (if any)", o.remote) + resumeUploads, err := o.fs.findLatestMultipartUpload(ctx, bucketName, bucketPath) + if err == nil && len(resumeUploads) > 0 { + uploadID = *resumeUploads[0].UploadId + existingParts, err = f.listMultipartUploadParts(ctx, bucketName, bucketPath, uploadID) + if err == nil { + fs.Debugf(o, "resuming with existing upload id: %v", uploadID) + return uploadID, existingParts, err + } + } + } + req := objectstorage.CreateMultipartUploadRequest{ + NamespaceName: common.String(o.fs.opt.Namespace), + BucketName: common.String(bucketName), + } + req.Object = common.String(bucketPath) + if o.fs.opt.StorageTier != "" { + storageTier, ok := objectstorage.GetMappingStorageTierEnum(o.fs.opt.StorageTier) + if !ok { + return "", nil, fmt.Errorf("not a valid storage tier: %v", o.fs.opt.StorageTier) + } + req.StorageTier = storageTier + } + o.applyMultipartUploadOptions(putReq, &req) + + var resp objectstorage.CreateMultipartUploadResponse + err = o.fs.pacer.Call(func() (bool, error) { + resp, err = o.fs.srv.CreateMultipartUpload(ctx, req) + return shouldRetry(ctx, resp.HTTPResponse(), err) + }) + if err != nil { + return "", existingParts, err + } + existingParts = make(map[int]objectstorage.MultipartUploadPartSummary) + uploadID = *resp.UploadId + fs.Debugf(o, "created new upload id: %v", uploadID) + return uploadID, existingParts, err +} diff --git a/backend/oracleobjectstorage/object.go b/backend/oracleobjectstorage/object.go index e82ac295e97d6..ad390eaa0f429 100644 --- a/backend/oracleobjectstorage/object.go +++ b/backend/oracleobjectstorage/object.go @@ -4,12 +4,14 @@ package oracleobjectstorage import ( + "bytes" "context" "encoding/base64" "encoding/hex" "fmt" "io" "net/http" + "os" "regexp" "strconv" "strings" @@ -18,10 +20,8 @@ import ( "github.com/ncw/swift/v2" "github.com/oracle/oci-go-sdk/v65/common" "github.com/oracle/oci-go-sdk/v65/objectstorage" - "github.com/oracle/oci-go-sdk/v65/objectstorage/transfer" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/hash" - "github.com/rclone/rclone/lib/atexit" ) // ------------------------------------------------------------ @@ -367,9 +367,28 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadClo return resp.HTTPResponse().Body, nil } +func isZeroLength(streamReader io.Reader) bool { + switch v := streamReader.(type) { + case *bytes.Buffer: + return v.Len() == 0 + case *bytes.Reader: + return v.Len() == 0 + case *strings.Reader: + return v.Len() == 0 + case *os.File: + fi, err := v.Stat() + if err != nil { + return false + } + return fi.Size() == 0 + default: + return false + } +} + // Update an object if it has changed func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { - bucketName, bucketPath := o.split() + bucketName, _ := o.split() err = o.fs.makeBucket(ctx, bucketName) if err != nil { return err @@ -377,142 +396,24 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op // determine if we like upload single or multipart. size := src.Size() - multipart := size >= int64(o.fs.opt.UploadCutoff) - - // Set the mtime in the metadata - modTime := src.ModTime(ctx) - metadata := map[string]string{ - metaMtime: swift.TimeToFloatString(modTime), - } - - // read the md5sum if available - // - for non-multipart - // - so we can add a ContentMD5 - // - so we can add the md5sum in the metadata as metaMD5Hash if using SSE/SSE-C - // - for multipart provided checksums aren't disabled - // - so we can add the md5sum in the metadata as metaMD5Hash - var md5sumBase64 string - var md5sumHex string - if !multipart || !o.fs.opt.DisableChecksum { - md5sumHex, err = src.Hash(ctx, hash.MD5) - if err == nil && matchMd5.MatchString(md5sumHex) { - hashBytes, err := hex.DecodeString(md5sumHex) - if err == nil { - md5sumBase64 = base64.StdEncoding.EncodeToString(hashBytes) - if multipart && !o.fs.opt.DisableChecksum { - // Set the md5sum as metadata on the object if - // - a multipart upload - // - the ETag is not an MD5, e.g. when using SSE/SSE-C - // provided checksums aren't disabled - metadata[metaMD5Hash] = md5sumBase64 - } - } - } + multipart := size < 0 || size >= int64(o.fs.opt.UploadCutoff) + if isZeroLength(in) { + multipart = false } - // Guess the content type - mimeType := fs.MimeType(ctx, src) - if multipart { - chunkSize := int64(o.fs.opt.ChunkSize) - uploadRequest := transfer.UploadRequest{ - NamespaceName: common.String(o.fs.opt.Namespace), - BucketName: common.String(bucketName), - ObjectName: common.String(bucketPath), - ContentType: common.String(mimeType), - PartSize: common.Int64(chunkSize), - AllowMultipartUploads: common.Bool(true), - AllowParrallelUploads: common.Bool(true), - ObjectStorageClient: o.fs.srv, - EnableMultipartChecksumVerification: common.Bool(!o.fs.opt.DisableChecksum), - NumberOfGoroutines: common.Int(o.fs.opt.UploadConcurrency), - Metadata: metadataWithOpcPrefix(metadata), - } - if o.fs.opt.StorageTier != "" { - storageTier, ok := objectstorage.GetMappingPutObjectStorageTierEnum(o.fs.opt.StorageTier) - if !ok { - return fmt.Errorf("not a valid storage tier: %v", o.fs.opt.StorageTier) - } - uploadRequest.StorageTier = storageTier - } - o.applyMultiPutOptions(&uploadRequest, options...) - useBYOKUpload(o.fs, &uploadRequest) - uploadStreamRequest := transfer.UploadStreamRequest{ - UploadRequest: uploadRequest, - StreamReader: in, - } - uploadMgr := transfer.NewUploadManager() - var uploadID = "" - - defer atexit.OnError(&err, func() { - if uploadID == "" { - return - } - if o.fs.opt.LeavePartsOnError { - return - } - fs.Debugf(o, "Cancelling multipart upload") - errCancel := o.fs.abortMultiPartUpload( - context.Background(), - bucketName, - bucketPath, - uploadID) - if errCancel != nil { - fs.Debugf(o, "Failed to cancel multipart upload: %v", errCancel) - } - })() - - err = o.fs.pacer.Call(func() (bool, error) { - uploadResponse, err := uploadMgr.UploadStream(ctx, uploadStreamRequest) - var httpResponse *http.Response - if err == nil { - if uploadResponse.Type == transfer.MultipartUpload { - if uploadResponse.MultipartUploadResponse != nil { - httpResponse = uploadResponse.MultipartUploadResponse.HTTPResponse() - } - } else { - if uploadResponse.SinglepartUploadResponse != nil { - httpResponse = uploadResponse.SinglepartUploadResponse.HTTPResponse() - } - } - } - if err != nil { - uploadID := "" - if uploadResponse.MultipartUploadResponse != nil && uploadResponse.MultipartUploadResponse.UploadID != nil { - uploadID = *uploadResponse.MultipartUploadResponse.UploadID - fs.Debugf(o, "multipart streaming upload failed, aborting uploadID: %v, may retry", uploadID) - _ = o.fs.abortMultiPartUpload(ctx, bucketName, bucketPath, uploadID) - } - } - return shouldRetry(ctx, httpResponse, err) - }) + err = o.uploadMultipart(ctx, src, in, options...) if err != nil { - fs.Errorf(o, "multipart streaming upload failed %v", err) return err } } else { - req := objectstorage.PutObjectRequest{ - NamespaceName: common.String(o.fs.opt.Namespace), - BucketName: common.String(bucketName), - ObjectName: common.String(bucketPath), - ContentType: common.String(mimeType), - PutObjectBody: io.NopCloser(in), - OpcMeta: metadata, - } - if size >= 0 { - req.ContentLength = common.Int64(size) - } - if o.fs.opt.StorageTier != "" { - storageTier, ok := objectstorage.GetMappingPutObjectStorageTierEnum(o.fs.opt.StorageTier) - if !ok { - return fmt.Errorf("not a valid storage tier: %v", o.fs.opt.StorageTier) - } - req.StorageTier = storageTier + ui, err := o.prepareUpload(ctx, src, options) + if err != nil { + return fmt.Errorf("failed to prepare upload: %w", err) } - o.applyPutOptions(&req, options...) - useBYOKPutObject(o.fs, &req) var resp objectstorage.PutObjectResponse - err = o.fs.pacer.Call(func() (bool, error) { - resp, err = o.fs.srv.PutObject(ctx, req) + err = o.fs.pacer.CallNoRetry(func() (bool, error) { + ui.req.PutObjectBody = io.NopCloser(in) + resp, err = o.fs.srv.PutObject(ctx, *ui.req) return shouldRetry(ctx, resp.HTTPResponse(), err) }) if err != nil { @@ -591,28 +492,24 @@ func (o *Object) applyGetObjectOptions(req *objectstorage.GetObjectRequest, opti } } -func (o *Object) applyMultiPutOptions(req *transfer.UploadRequest, options ...fs.OpenOption) { - // Apply upload options - for _, option := range options { - key, value := option.Header() - lowerKey := strings.ToLower(key) - switch lowerKey { - case "": - // ignore - case "content-encoding": - req.ContentEncoding = common.String(value) - case "content-language": - req.ContentLanguage = common.String(value) - case "content-type": - req.ContentType = common.String(value) - default: - if strings.HasPrefix(lowerKey, ociMetaPrefix) { - req.Metadata[lowerKey] = value - } else { - fs.Errorf(o, "Don't know how to set key %q on upload", key) - } - } - } +func (o *Object) applyMultipartUploadOptions(putReq *objectstorage.PutObjectRequest, req *objectstorage.CreateMultipartUploadRequest) { + req.ContentType = putReq.ContentType + req.ContentLanguage = putReq.ContentLanguage + req.ContentEncoding = putReq.ContentEncoding + req.ContentDisposition = putReq.ContentDisposition + req.CacheControl = putReq.CacheControl + req.Metadata = metadataWithOpcPrefix(putReq.OpcMeta) + req.OpcSseCustomerAlgorithm = putReq.OpcSseCustomerAlgorithm + req.OpcSseCustomerKey = putReq.OpcSseCustomerKey + req.OpcSseCustomerKeySha256 = putReq.OpcSseCustomerKeySha256 + req.OpcSseKmsKeyId = putReq.OpcSseKmsKeyId +} + +func (o *Object) applyPartUploadOptions(putReq *objectstorage.PutObjectRequest, req *objectstorage.UploadPartRequest) { + req.OpcSseCustomerAlgorithm = putReq.OpcSseCustomerAlgorithm + req.OpcSseCustomerKey = putReq.OpcSseCustomerKey + req.OpcSseCustomerKeySha256 = putReq.OpcSseCustomerKeySha256 + req.OpcSseKmsKeyId = putReq.OpcSseKmsKeyId } func metadataWithOpcPrefix(src map[string]string) map[string]string { diff --git a/backend/oracleobjectstorage/options.go b/backend/oracleobjectstorage/options.go index 9baf06e356ced..3eeb6899e68c2 100644 --- a/backend/oracleobjectstorage/options.go +++ b/backend/oracleobjectstorage/options.go @@ -13,9 +13,10 @@ import ( const ( maxSizeForCopy = 4768 * 1024 * 1024 - minChunkSize = fs.SizeSuffix(1024 * 1024 * 5) - defaultUploadCutoff = fs.SizeSuffix(200 * 1024 * 1024) + maxUploadParts = 10000 defaultUploadConcurrency = 10 + minChunkSize = fs.SizeSuffix(5 * 1024 * 1024) + defaultUploadCutoff = fs.SizeSuffix(200 * 1024 * 1024) maxUploadCutoff = fs.SizeSuffix(5 * 1024 * 1024 * 1024) minSleep = 10 * time.Millisecond defaultCopyTimeoutDuration = fs.Duration(time.Minute) @@ -55,12 +56,14 @@ type Options struct { ConfigProfile string `config:"config_profile"` UploadCutoff fs.SizeSuffix `config:"upload_cutoff"` ChunkSize fs.SizeSuffix `config:"chunk_size"` + MaxUploadParts int `config:"max_upload_parts"` UploadConcurrency int `config:"upload_concurrency"` DisableChecksum bool `config:"disable_checksum"` CopyCutoff fs.SizeSuffix `config:"copy_cutoff"` CopyTimeout fs.Duration `config:"copy_timeout"` StorageTier string `config:"storage_tier"` LeavePartsOnError bool `config:"leave_parts_on_error"` + AttemptResumeUpload bool `config:"attempt_resume_upload"` NoCheckBucket bool `config:"no_check_bucket"` SSEKMSKeyID string `config:"sse_kms_key_id"` SSECustomerAlgorithm string `config:"sse_customer_algorithm"` @@ -92,14 +95,16 @@ func newOptions() []fs.Option { Help: noAuthHelpText, }}, }, { - Name: "namespace", - Help: "Object storage namespace", - Required: true, + Name: "namespace", + Help: "Object storage namespace", + Required: true, + Sensitive: true, }, { - Name: "compartment", - Help: "Object storage compartment OCID", - Provider: "!no_auth", - Required: true, + Name: "compartment", + Help: "Object storage compartment OCID", + Provider: "!no_auth", + Required: true, + Sensitive: true, }, { Name: "region", Help: "Object storage Region", @@ -155,9 +160,8 @@ The minimum is 0 and the maximum is 5 GiB.`, Help: `Chunk size to use for uploading. When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads -using this chunk size. +size (e.g. from "rclone rcat" or uploaded with "rclone mount" they will be uploaded +as multipart uploads using this chunk size. Note that "upload_concurrency" chunks of this size are buffered in memory per transfer. @@ -179,6 +183,20 @@ statistics displayed with "-P" flag. `, Default: minChunkSize, Advanced: true, + }, { + Name: "max_upload_parts", + Help: `Maximum number of parts in a multipart upload. + +This option defines the maximum number of multipart chunks to use +when doing a multipart upload. + +OCI has max parts limit of 10,000 chunks. + +Rclone will automatically increase the chunk size when uploading a +large file of a known size to stay below this number of chunks limit. +`, + Default: maxUploadParts, + Advanced: true, }, { Name: "upload_concurrency", Help: `Concurrency for multipart uploads. @@ -236,12 +254,24 @@ to start uploading.`, encoder.EncodeDot, }, { Name: "leave_parts_on_error", - Help: `If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. + Help: `If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery. It should be set to true for resuming uploads across different sessions. WARNING: Storing parts of an incomplete multipart upload counts towards space usage on object storage and will add additional costs if not cleaned up. +`, + Default: false, + Advanced: true, + }, { + Name: "attempt_resume_upload", + Help: `If true attempt to resume previously started multipart upload for the object. +This will be helpful to speed up multipart transfers by resuming uploads from past session. + +WARNING: If chunk size differs in resumed session from past incomplete session, then the resumed multipart upload is +aborted and a new multipart upload is started with the new chunk size. + +The flag leave_parts_on_error must be true to resume and optimize to skip parts that were already uploaded successfully. `, Default: false, Advanced: true, @@ -289,7 +319,7 @@ Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/using }}, }, { Name: "sse_kms_key_id", - Help: `if using using your own master key in vault, this header specifies the + Help: `if using your own master key in vault, this header specifies the OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed.`, diff --git a/backend/oracleobjectstorage/oracleobjectstorage.go b/backend/oracleobjectstorage/oracleobjectstorage.go index a0de006b86213..2133ebc09dec4 100644 --- a/backend/oracleobjectstorage/oracleobjectstorage.go +++ b/backend/oracleobjectstorage/oracleobjectstorage.go @@ -138,6 +138,14 @@ func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { return } +func (f *Fs) setCopyCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + err = checkUploadChunkSize(cs) + if err == nil { + old, f.opt.CopyCutoff = f.opt.CopyCutoff, cs + } + return +} + // ------------------------------------------------------------ // Implement backed that represents a remote object storage server // Fs is the interface a cloud storage system must provide @@ -318,7 +326,6 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck remote := *object.Name remote = f.opt.Enc.ToStandardPath(remote) if !strings.HasPrefix(remote, prefix) { - // fs.Debugf(f, "Odd name received %v", object.Name) continue } remote = remote[len(prefix):] @@ -558,15 +565,15 @@ func (f *Fs) Rmdir(ctx context.Context, dir string) error { }) } -func (f *Fs) abortMultiPartUpload(ctx context.Context, bucketName, bucketPath, uploadID string) (err error) { - if uploadID == "" { +func (f *Fs) abortMultiPartUpload(ctx context.Context, bucketName, bucketPath, uploadID *string) (err error) { + if uploadID == nil || *uploadID == "" { return nil } request := objectstorage.AbortMultipartUploadRequest{ NamespaceName: common.String(f.opt.Namespace), - BucketName: common.String(bucketName), - ObjectName: common.String(bucketPath), - UploadId: common.String(uploadID), + BucketName: bucketName, + ObjectName: bucketPath, + UploadId: uploadID, } err = f.pacer.Call(func() (bool, error) { resp, err := f.srv.AbortMultipartUpload(ctx, request) @@ -589,12 +596,7 @@ func (f *Fs) cleanUpBucket(ctx context.Context, bucket string, maxAge time.Durat if operations.SkipDestructive(ctx, what, "remove pending upload") { continue } - ignoreErr := f.abortMultiPartUpload(ctx, *upload.Bucket, *upload.Object, *upload.UploadId) - if ignoreErr != nil { - // fs.Debugf(f, "ignoring error %s", ignoreErr) - } - } else { - // fs.Debugf(f, "ignoring %s", what) + _ = f.abortMultiPartUpload(ctx, upload.Bucket, upload.Object, upload.UploadId) } } else { fs.Infof(f, "MultipartUpload doesn't have sufficient details to abort.") @@ -689,12 +691,13 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( // Check the interfaces are satisfied var ( - _ fs.Fs = &Fs{} - _ fs.Copier = &Fs{} - _ fs.PutStreamer = &Fs{} - _ fs.ListRer = &Fs{} - _ fs.Commander = &Fs{} - _ fs.CleanUpper = &Fs{} + _ fs.Fs = &Fs{} + _ fs.Copier = &Fs{} + _ fs.PutStreamer = &Fs{} + _ fs.ListRer = &Fs{} + _ fs.Commander = &Fs{} + _ fs.CleanUpper = &Fs{} + _ fs.OpenChunkWriter = &Fs{} _ fs.Object = &Object{} _ fs.MimeTyper = &Object{} diff --git a/backend/oracleobjectstorage/oracleobjectstorage_test.go b/backend/oracleobjectstorage/oracleobjectstorage_test.go index 479da7b5ba9f7..daccfaeed1cf5 100644 --- a/backend/oracleobjectstorage/oracleobjectstorage_test.go +++ b/backend/oracleobjectstorage/oracleobjectstorage_test.go @@ -30,4 +30,12 @@ func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadCutoff(cs) } -var _ fstests.SetUploadChunkSizer = (*Fs)(nil) +func (f *Fs) SetCopyCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setCopyCutoff(cs) +} + +var ( + _ fstests.SetUploadChunkSizer = (*Fs)(nil) + _ fstests.SetUploadCutoffer = (*Fs)(nil) + _ fstests.SetCopyCutoffer = (*Fs)(nil) +) diff --git a/backend/pcloud/pcloud.go b/backend/pcloud/pcloud.go index 726d9ee8bd3fc..9d6256b1ac7d9 100644 --- a/backend/pcloud/pcloud.go +++ b/backend/pcloud/pcloud.go @@ -110,10 +110,11 @@ func init() { encoder.EncodeBackSlash | encoder.EncodeInvalidUtf8), }, { - Name: "root_folder_id", - Help: "Fill in for rclone to use a non root folder as its starting point.", - Default: "d0", - Advanced: true, + Name: "root_folder_id", + Help: "Fill in for rclone to use a non root folder as its starting point.", + Default: "d0", + Advanced: true, + Sensitive: true, }, { Name: "hostname", Help: `Hostname to connect to. @@ -138,7 +139,8 @@ with rclone authorize. This is only required when you want to use the cleanup command. Due to a bug in the pcloud API the required API does not support OAuth authentication so we have to rely on user password authentication for it.`, - Advanced: true, + Advanced: true, + Sensitive: true, }, { Name: "password", Help: "Your pcloud password.", diff --git a/backend/pikpak/api/types.go b/backend/pikpak/api/types.go new file mode 100644 index 0000000000000..fab6951eb1b2c --- /dev/null +++ b/backend/pikpak/api/types.go @@ -0,0 +1,536 @@ +// Package api has type definitions for pikpak +// +// Manually obtained from the API responses using Browse Dev. Tool and https://mholt.github.io/json-to-go/ +package api + +import ( + "fmt" + "reflect" + "strconv" + "time" +) + +const ( + // "2022-09-17T14:31:06.056+08:00" + timeFormat = `"` + time.RFC3339 + `"` +) + +// Time represents date and time information for the pikpak API, by using RFC3339 +type Time time.Time + +// MarshalJSON turns a Time into JSON (in UTC) +func (t *Time) MarshalJSON() (out []byte, err error) { + timeString := (*time.Time)(t).Format(timeFormat) + return []byte(timeString), nil +} + +// UnmarshalJSON turns JSON into a Time +func (t *Time) UnmarshalJSON(data []byte) error { + if string(data) == "null" || string(data) == `""` { + return nil + } + newT, err := time.Parse(timeFormat, string(data)) + if err != nil { + return err + } + *t = Time(newT) + return nil +} + +// Types of things in Item +const ( + KindOfFolder = "drive#folder" + KindOfFile = "drive#file" + KindOfFileList = "drive#fileList" + KindOfResumable = "drive#resumable" + KindOfForm = "drive#form" + ThumbnailSizeS = "SIZE_SMALL" + ThumbnailSizeM = "SIZE_MEDIUM" + ThumbnailSizeL = "SIZE_LARGE" + PhaseTypeComplete = "PHASE_TYPE_COMPLETE" + PhaseTypeRunning = "PHASE_TYPE_RUNNING" + PhaseTypeError = "PHASE_TYPE_ERROR" + PhaseTypePending = "PHASE_TYPE_PENDING" + UploadTypeForm = "UPLOAD_TYPE_FORM" + UploadTypeResumable = "UPLOAD_TYPE_RESUMABLE" + ListLimit = 100 +) + +// ------------------------------------------------------------ + +// Error details api error from pikpak +type Error struct { + Reason string `json:"error"` // short description of the reason, e.g. "file_name_empty" "invalid_request" + Code int `json:"error_code"` + URL string `json:"error_url,omitempty"` + Message string `json:"error_description,omitempty"` + // can have either of `error_details` or `details`` + ErrorDetails []*ErrorDetails `json:"error_details,omitempty"` + Details []*ErrorDetails `json:"details,omitempty"` +} + +// ErrorDetails contains further details of api error +type ErrorDetails struct { + Type string `json:"@type,omitempty"` + Reason string `json:"reason,omitempty"` + Domain string `json:"domain,omitempty"` + Metadata struct { + } `json:"metadata,omitempty"` // TODO: undiscovered yet + Locale string `json:"locale,omitempty"` // e.g. "en" + Message string `json:"message,omitempty"` + StackEntries []interface{} `json:"stack_entries,omitempty"` // TODO: undiscovered yet + Detail string `json:"detail,omitempty"` +} + +// Error returns a string for the error and satisfies the error interface +func (e *Error) Error() string { + out := fmt.Sprintf("Error %q (%d)", e.Reason, e.Code) + if e.Message != "" { + out += ": " + e.Message + } + return out +} + +// Check Error satisfies the error interface +var _ error = (*Error)(nil) + +// ------------------------------------------------------------ + +// Filters contains parameters for filters when listing. +// +// possible operators +// * in: a list of comma-separated string +// * eq: "true" or "false" +// * gt or lt: time format string, e.g. "2023-01-28T10:56:49.757+08:00" +type Filters struct { + Phase map[string]string `json:"phase,omitempty"` // "in" or "eq" + Trashed map[string]bool `json:"trashed,omitempty"` // "eq" + Kind map[string]string `json:"kind,omitempty"` // "eq" + Starred map[string]bool `json:"starred,omitempty"` // "eq" + ModifiedTime map[string]string `json:"modified_time,omitempty"` // "gt" or "lt" +} + +// Set sets filter values using field name, operator and corresponding value +func (f *Filters) Set(field, operator, value string) { + if value == "" { + // UNSET for empty values + return + } + r := reflect.ValueOf(f) + fd := reflect.Indirect(r).FieldByName(field) + if v, err := strconv.ParseBool(value); err == nil { + fd.Set(reflect.ValueOf(map[string]bool{operator: v})) + } else { + fd.Set(reflect.ValueOf(map[string]string{operator: value})) + } +} + +// ------------------------------------------------------------ +// Common Elements + +// Link contains a download URL for opening files +type Link struct { + URL string `json:"url"` + Token string `json:"token"` + Expire Time `json:"expire"` + Type string `json:"type,omitempty"` +} + +// Valid reports whether l is non-nil, has an URL, and is not expired. +func (l *Link) Valid() bool { + return l != nil && l.URL != "" && time.Now().Add(10*time.Second).Before(time.Time(l.Expire)) +} + +// URL is a basic form of URL +type URL struct { + Kind string `json:"kind,omitempty"` // e.g. "upload#url" + URL string `json:"url,omitempty"` +} + +// ------------------------------------------------------------ +// Base Elements + +// FileList contains a list of File elements +type FileList struct { + Kind string `json:"kind,omitempty"` // drive#fileList + Files []*File `json:"files,omitempty"` + NextPageToken string `json:"next_page_token"` + Version string `json:"version,omitempty"` + VersionOutdated bool `json:"version_outdated,omitempty"` +} + +// File is a basic element representing a single file object +// +// There are two types of download links, +// 1) one from File.WebContentLink or File.Links.ApplicationOctetStream.URL and +// 2) the other from File.Medias[].Link.URL. +// Empirically, 2) is less restrictive to multiple concurrent range-requests +// for a single file, i.e. supports for higher `--multi-thread-streams=N`. +// However, it is not generally applicable as it is only for meadia. +type File struct { + Apps []*FileApp `json:"apps,omitempty"` + Audit *FileAudit `json:"audit,omitempty"` + Collection string `json:"collection,omitempty"` // TODO + CreatedTime Time `json:"created_time,omitempty"` + DeleteTime Time `json:"delete_time,omitempty"` + FileCategory string `json:"file_category,omitempty"` + FileExtension string `json:"file_extension,omitempty"` + FolderType string `json:"folder_type,omitempty"` + Hash string `json:"hash,omitempty"` // sha1 but NOT a valid file hash. looks like a torrent hash + IconLink string `json:"icon_link,omitempty"` + ID string `json:"id,omitempty"` + Kind string `json:"kind,omitempty"` // "drive#file" + Links *FileLinks `json:"links,omitempty"` + Md5Checksum string `json:"md5_checksum,omitempty"` + Medias []*Media `json:"medias,omitempty"` + MimeType string `json:"mime_type,omitempty"` + ModifiedTime Time `json:"modified_time,omitempty"` // updated when renamed or moved + Name string `json:"name,omitempty"` + OriginalFileIndex int `json:"original_file_index,omitempty"` // TODO + OriginalURL string `json:"original_url,omitempty"` + Params *FileParams `json:"params,omitempty"` + ParentID string `json:"parent_id,omitempty"` + Phase string `json:"phase,omitempty"` + Revision int `json:"revision,omitempty,string"` + Size int64 `json:"size,omitempty,string"` + SortName string `json:"sort_name,omitempty"` + Space string `json:"space,omitempty"` + SpellName []interface{} `json:"spell_name,omitempty"` // TODO maybe list of something? + Starred bool `json:"starred,omitempty"` + ThumbnailLink string `json:"thumbnail_link,omitempty"` + Trashed bool `json:"trashed,omitempty"` + UserID string `json:"user_id,omitempty"` + UserModifiedTime Time `json:"user_modified_time,omitempty"` + WebContentLink string `json:"web_content_link,omitempty"` + Writable bool `json:"writable,omitempty"` +} + +// FileLinks includes links to file at backend +type FileLinks struct { + ApplicationOctetStream *Link `json:"application/octet-stream,omitempty"` +} + +// FileAudit contains audit information for the file +type FileAudit struct { + Status string `json:"status,omitempty"` // "STATUS_OK" + Message string `json:"message,omitempty"` + Title string `json:"title,omitempty"` +} + +// Media contains info about supported version of media, e.g. original, transcoded, etc +type Media struct { + MediaID string `json:"media_id,omitempty"` + MediaName string `json:"media_name,omitempty"` + Video struct { + Height int `json:"height,omitempty"` + Width int `json:"width,omitempty"` + Duration int64 `json:"duration,omitempty"` + BitRate int `json:"bit_rate,omitempty"` + FrameRate int `json:"frame_rate,omitempty"` + VideoCodec string `json:"video_codec,omitempty"` // "h264", "hevc" + AudioCodec string `json:"audio_codec,omitempty"` // "pcm_bluray", "aac" + VideoType string `json:"video_type,omitempty"` // "mpegts" + HdrType string `json:"hdr_type,omitempty"` + } `json:"video,omitempty"` + Link *Link `json:"link,omitempty"` + NeedMoreQuota bool `json:"need_more_quota,omitempty"` + VipTypes []interface{} `json:"vip_types,omitempty"` // TODO maybe list of something? + RedirectLink string `json:"redirect_link,omitempty"` + IconLink string `json:"icon_link,omitempty"` + IsDefault bool `json:"is_default,omitempty"` + Priority int `json:"priority,omitempty"` + IsOrigin bool `json:"is_origin,omitempty"` + ResolutionName string `json:"resolution_name,omitempty"` + IsVisible bool `json:"is_visible,omitempty"` + Category string `json:"category,omitempty"` +} + +// FileParams includes parameters for instant open +type FileParams struct { + Duration int64 `json:"duration,omitempty,string"` // in seconds + Height int `json:"height,omitempty,string"` + Platform string `json:"platform,omitempty"` // "Upload" + PlatformIcon string `json:"platform_icon,omitempty"` + URL string `json:"url,omitempty"` + Width int `json:"width,omitempty,string"` +} + +// FileApp includes parameters for instant open +type FileApp struct { + ID string `json:"id,omitempty"` // "decompress" for rar files + Name string `json:"name,omitempty"` // decompress" for rar files + Access []interface{} `json:"access,omitempty"` + Link string `json:"link,omitempty"` // "https://mypikpak.com/drive/decompression/{File.Id}?gcid={File.Hash}\u0026wv-style=topbar%3Ahide" + RedirectLink string `json:"redirect_link,omitempty"` + VipTypes []interface{} `json:"vip_types,omitempty"` + NeedMoreQuota bool `json:"need_more_quota,omitempty"` + IconLink string `json:"icon_link,omitempty"` + IsDefault bool `json:"is_default,omitempty"` + Params struct { + } `json:"params,omitempty"` // TODO + CategoryIds []interface{} `json:"category_ids,omitempty"` + AdSceneType int `json:"ad_scene_type,omitempty"` + Space string `json:"space,omitempty"` + Links struct { + } `json:"links,omitempty"` // TODO +} + +// ------------------------------------------------------------ + +// TaskList contains a list of Task elements +type TaskList struct { + Tasks []*Task `json:"tasks,omitempty"` // "drive#task" + NextPageToken string `json:"next_page_token"` + ExpiresIn int `json:"expires_in,omitempty"` +} + +// Task is a basic element representing a single task such as offline download and upload +type Task struct { + Kind string `json:"kind,omitempty"` // "drive#task" + ID string `json:"id,omitempty"` // task id? + Name string `json:"name,omitempty"` // torrent name? + Type string `json:"type,omitempty"` // "offline" + UserID string `json:"user_id,omitempty"` + Statuses []interface{} `json:"statuses,omitempty"` // TODO + StatusSize int `json:"status_size,omitempty"` // TODO + Params *TaskParams `json:"params,omitempty"` // TODO + FileID string `json:"file_id,omitempty"` + FileName string `json:"file_name,omitempty"` + FileSize string `json:"file_size,omitempty"` + Message string `json:"message,omitempty"` // e.g. "Saving" + CreatedTime Time `json:"created_time,omitempty"` + UpdatedTime Time `json:"updated_time,omitempty"` + ThirdTaskID string `json:"third_task_id,omitempty"` // TODO + Phase string `json:"phase,omitempty"` // e.g. "PHASE_TYPE_RUNNING" + Progress int `json:"progress,omitempty"` + IconLink string `json:"icon_link,omitempty"` + Callback string `json:"callback,omitempty"` + ReferenceResource interface{} `json:"reference_resource,omitempty"` // TODO + Space string `json:"space,omitempty"` +} + +// TaskParams includes parameters informing status of Task +type TaskParams struct { + Age string `json:"age,omitempty"` + PredictSpeed string `json:"predict_speed,omitempty"` + PredictType string `json:"predict_type,omitempty"` + URL string `json:"url,omitempty"` +} + +// Form contains parameters for upload by multipart/form-data +type Form struct { + Headers struct{} `json:"headers"` + Kind string `json:"kind"` // "drive#form" + Method string `json:"method"` // "POST" + MultiParts struct { + OSSAccessKeyID string `json:"OSSAccessKeyId"` + Signature string `json:"Signature"` + Callback string `json:"callback"` + Key string `json:"key"` + Policy string `json:"policy"` + XUserData string `json:"x:user_data"` + } `json:"multi_parts"` + URL string `json:"url"` +} + +// Resumable contains parameters for upload by resumable +type Resumable struct { + Kind string `json:"kind,omitempty"` // "drive#resumable" + Provider string `json:"provider,omitempty"` // e.g. "PROVIDER_ALIYUN" + Params *ResumableParams `json:"params,omitempty"` +} + +// ResumableParams specifies resumable paramegers +type ResumableParams struct { + AccessKeyID string `json:"access_key_id,omitempty"` + AccessKeySecret string `json:"access_key_secret,omitempty"` + Bucket string `json:"bucket,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + Expiration Time `json:"expiration,omitempty"` + Key string `json:"key,omitempty"` + SecurityToken string `json:"security_token,omitempty"` +} + +// FileInArchive is a basic element in archive +type FileInArchive struct { + Index int `json:"index,omitempty"` + Filename string `json:"filename,omitempty"` + Filesize string `json:"filesize,omitempty"` + MimeType string `json:"mime_type,omitempty"` + Gcid string `json:"gcid,omitempty"` + Kind string `json:"kind,omitempty"` + IconLink string `json:"icon_link,omitempty"` + Path string `json:"path,omitempty"` +} + +// ------------------------------------------------------------ + +// NewFile is a response to RequestNewFile +type NewFile struct { + File *File `json:"file,omitempty"` + Form *Form `json:"form,omitempty"` + Resumable *Resumable `json:"resumable,omitempty"` + Task *Task `json:"task,omitempty"` // null in this case + UploadType string `json:"upload_type,omitempty"` // "UPLOAD_TYPE_FORM" or "UPLOAD_TYPE_RESUMABLE" +} + +// NewTask is a response to RequestNewTask +type NewTask struct { + UploadType string `json:"upload_type,omitempty"` // "UPLOAD_TYPE_URL" + File *File `json:"file,omitempty"` // null in this case + Task *Task `json:"task,omitempty"` + URL *URL `json:"url,omitempty"` // {"kind": "upload#url"} +} + +// About informs drive status +type About struct { + Kind string `json:"kind,omitempty"` // "drive#about" + Quota *Quota `json:"quota,omitempty"` + ExpiresAt string `json:"expires_at,omitempty"` + Quotas struct { + } `json:"quotas,omitempty"` // maybe []*Quota? +} + +// Quota informs drive quota +type Quota struct { + Kind string `json:"kind,omitempty"` // "drive#quota" + Limit int64 `json:"limit,omitempty,string"` // limit in bytes + Usage int64 `json:"usage,omitempty,string"` // bytes in use + UsageInTrash int64 `json:"usage_in_trash,omitempty,string"` // bytes in trash but this seems not working + PlayTimesLimit string `json:"play_times_limit,omitempty"` // maybe in seconds + PlayTimesUsage string `json:"play_times_usage,omitempty"` // maybe in seconds +} + +// Share is a response to RequestShare +// +// used in PublicLink() +type Share struct { + ShareID string `json:"share_id,omitempty"` + ShareURL string `json:"share_url,omitempty"` + PassCode string `json:"pass_code,omitempty"` + ShareText string `json:"share_text,omitempty"` +} + +// User contains user account information +// +// GET https://user.mypikpak.com/v1/user/me +type User struct { + Sub string `json:"sub,omitempty"` // userid for internal use + Name string `json:"name,omitempty"` // Username + Picture string `json:"picture,omitempty"` // URL to Avatar image + Email string `json:"email,omitempty"` // redacted email address + Providers *[]UserProvider `json:"providers,omitempty"` // OAuth provider + PhoneNumber string `json:"phone_number,omitempty"` + Password string `json:"password,omitempty"` // "SET" if configured + Status string `json:"status,omitempty"` // "ACTIVE" + CreatedAt Time `json:"created_at,omitempty"` + PasswordUpdatedAt Time `json:"password_updated_at,omitempty"` +} + +// UserProvider details third-party authentication +type UserProvider struct { + ID string `json:"id,omitempty"` // e.g. "google.com" + ProviderUserID string `json:"provider_user_id,omitempty"` + Name string `json:"name,omitempty"` // username +} + +// VIP includes subscription details about premium account +// +// GET https://api-drive.mypikpak.com/drive/v1/privilege/vip +type VIP struct { + Result string `json:"result,omitempty"` // "ACCEPTED" + Message string `json:"message,omitempty"` + RedirectURI string `json:"redirect_uri,omitempty"` + Data struct { + Expire Time `json:"expire,omitempty"` + Status string `json:"status,omitempty"` // "invalid" or "ok" + Type string `json:"type,omitempty"` // "novip" or "platinum" + UserID string `json:"user_id,omitempty"` // same as User.Sub + } `json:"data,omitempty"` +} + +// DecompressResult is a response to RequestDecompress +type DecompressResult struct { + Status string `json:"status,omitempty"` // "OK" + StatusText string `json:"status_text,omitempty"` + TaskID string `json:"task_id,omitempty"` // same as File.Id + FilesNum int `json:"files_num,omitempty"` // number of files in archive + RedirectLink string `json:"redirect_link,omitempty"` +} + +// ------------------------------------------------------------ + +// RequestShare is to request for file share +type RequestShare struct { + FileIds []string `json:"file_ids,omitempty"` + ShareTo string `json:"share_to,omitempty"` // "publiclink", + ExpirationDays int `json:"expiration_days,omitempty"` // -1 = 'forever' + PassCodeOption string `json:"pass_code_option,omitempty"` // "NOT_REQUIRED" +} + +// RequestBatch is to request for batch actions +type RequestBatch struct { + Ids []string `json:"ids,omitempty"` + To map[string]string `json:"to,omitempty"` +} + +// RequestNewFile is to request for creating a new `drive#folder` or `drive#file` +type RequestNewFile struct { + // always required + Kind string `json:"kind"` // "drive#folder" or "drive#file" + Name string `json:"name"` + ParentID string `json:"parent_id"` + FolderType string `json:"folder_type"` + // only when uploading a new file + Hash string `json:"hash,omitempty"` // sha1sum + Resumable map[string]string `json:"resumable,omitempty"` // {"provider": "PROVIDER_ALIYUN"} + Size int64 `json:"size,omitempty"` + UploadType string `json:"upload_type,omitempty"` // "UPLOAD_TYPE_FORM" or "UPLOAD_TYPE_RESUMABLE" +} + +// RequestNewTask is to request for creating a new task like offline downloads +// +// Name and ParentID can be left empty. +type RequestNewTask struct { + Kind string `json:"kind,omitempty"` // "drive#file" + Name string `json:"name,omitempty"` + ParentID string `json:"parent_id,omitempty"` + UploadType string `json:"upload_type,omitempty"` // "UPLOAD_TYPE_URL" + URL *URL `json:"url,omitempty"` // {"url": downloadUrl} + FolderType string `json:"folder_type,omitempty"` // "" if parent_id else "DOWNLOAD" +} + +// RequestDecompress is to request for decompress of archive files +type RequestDecompress struct { + Gcid string `json:"gcid,omitempty"` // same as File.Hash + Password string `json:"password,omitempty"` // "" + FileID string `json:"file_id,omitempty"` + Files []*FileInArchive `json:"files,omitempty"` // can request selected files to be decompressed + DefaultParent bool `json:"default_parent,omitempty"` +} + +// ------------------------------------------------------------ + +// NOT implemented YET + +// RequestArchiveFileList is to request for a list of files in archive +// +// POST https://api-drive.mypikpak.com/decompress/v1/list +type RequestArchiveFileList struct { + Gcid string `json:"gcid,omitempty"` // same as api.File.Hash + Path string `json:"path,omitempty"` // "" by default + Password string `json:"password,omitempty"` // "" by default + FileID string `json:"file_id,omitempty"` +} + +// ArchiveFileList is a response to RequestArchiveFileList +type ArchiveFileList struct { + Status string `json:"status,omitempty"` // "OK" + StatusText string `json:"status_text,omitempty"` // "" + TaskID string `json:"task_id,omitempty"` // "" + CurrentPath string `json:"current_path,omitempty"` // "" + Title string `json:"title,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + Gcid string `json:"gcid,omitempty"` // same as File.Hash + Files []*FileInArchive `json:"files,omitempty"` +} diff --git a/backend/pikpak/helper.go b/backend/pikpak/helper.go new file mode 100644 index 0000000000000..fed140b9807e3 --- /dev/null +++ b/backend/pikpak/helper.go @@ -0,0 +1,253 @@ +package pikpak + +import ( + "bytes" + "context" + "crypto/sha1" + "encoding/hex" + "errors" + "fmt" + "io" + "net/http" + "os" + + "github.com/rclone/rclone/backend/pikpak/api" + "github.com/rclone/rclone/lib/rest" +) + +// Globals +const ( + cachePrefix = "rclone-pikpak-sha1sum-" +) + +// requestDecompress requests decompress of compressed files +func (f *Fs) requestDecompress(ctx context.Context, file *api.File, password string) (info *api.DecompressResult, err error) { + req := &api.RequestDecompress{ + Gcid: file.Hash, + Password: password, + FileID: file.ID, + Files: []*api.FileInArchive{}, + DefaultParent: true, + } + opts := rest.Opts{ + Method: "POST", + Path: "/decompress/v1/decompress", + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, &req, &info) + return f.shouldRetry(ctx, resp, err) + }) + return +} + +// getUserInfo gets UserInfo from API +func (f *Fs) getUserInfo(ctx context.Context) (info *api.User, err error) { + opts := rest.Opts{ + Method: "GET", + RootURL: "https://user.mypikpak.com/v1/user/me", + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, nil, &info) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to get userinfo: %w", err) + } + return +} + +// getVIPInfo gets VIPInfo from API +func (f *Fs) getVIPInfo(ctx context.Context) (info *api.VIP, err error) { + opts := rest.Opts{ + Method: "GET", + RootURL: "https://api-drive.mypikpak.com/drive/v1/privilege/vip", + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, nil, &info) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to get vip info: %w", err) + } + return +} + +// requestBatchAction requests batch actions to API +// +// action can be one of batch{Copy,Delete,Trash,Untrash} +func (f *Fs) requestBatchAction(ctx context.Context, action string, req *api.RequestBatch) (err error) { + opts := rest.Opts{ + Method: "POST", + Path: "/drive/v1/files:" + action, + NoResponse: true, // Only returns `{"task_id":""} + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, &req, nil) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return fmt.Errorf("batch action %q failed: %w", action, err) + } + return nil +} + +// requestNewTask requests a new api.NewTask and returns api.Task +func (f *Fs) requestNewTask(ctx context.Context, req *api.RequestNewTask) (info *api.Task, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "/drive/v1/files", + } + var newTask api.NewTask + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, &req, &newTask) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, err + } + return newTask.Task, nil +} + +// requestNewFile requests a new api.NewFile and returns api.File +func (f *Fs) requestNewFile(ctx context.Context, req *api.RequestNewFile) (info *api.NewFile, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "/drive/v1/files", + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, &req, &info) + return f.shouldRetry(ctx, resp, err) + }) + return +} + +// getFile gets api.File from API for the ID passed +// and returns rich information containing additional fields below +// * web_content_link +// * thumbnail_link +// * links +// * medias +func (f *Fs) getFile(ctx context.Context, ID string) (info *api.File, err error) { + opts := rest.Opts{ + Method: "GET", + Path: "/drive/v1/files/" + ID, + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, nil, &info) + if err == nil && info.Phase != api.PhaseTypeComplete { + // could be pending right after file is created/uploaded. + return true, errors.New("not PHASE_TYPE_COMPLETE") + } + return f.shouldRetry(ctx, resp, err) + }) + return +} + +// patchFile updates attributes of the file by ID +// +// currently known patchable fields are +// * name +func (f *Fs) patchFile(ctx context.Context, ID string, req *api.File) (info *api.File, err error) { + opts := rest.Opts{ + Method: "PATCH", + Path: "/drive/v1/files/" + ID, + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, &req, &info) + return f.shouldRetry(ctx, resp, err) + }) + return +} + +// getAbout gets drive#quota information from server +func (f *Fs) getAbout(ctx context.Context) (info *api.About, err error) { + opts := rest.Opts{ + Method: "GET", + Path: "/drive/v1/about", + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, nil, &info) + return f.shouldRetry(ctx, resp, err) + }) + return +} + +// requestShare returns information about ssharable links +func (f *Fs) requestShare(ctx context.Context, req *api.RequestShare) (info *api.Share, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "/drive/v1/share", + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, &req, &info) + return f.shouldRetry(ctx, resp, err) + }) + return +} + +// Read the sha1 of in returning a reader which will read the same contents +// +// The cleanup function should be called when out is finished with +// regardless of whether this function returned an error or not. +func readSHA1(in io.Reader, size, threshold int64) (sha1sum string, out io.Reader, cleanup func(), err error) { + // we need an SHA1 + hash := sha1.New() + // use the teeReader to write to the local file AND calculate the SHA1 while doing so + teeReader := io.TeeReader(in, hash) + + // nothing to clean up by default + cleanup = func() {} + + // don't cache small files on disk to reduce wear of the disk + if size > threshold { + var tempFile *os.File + + // create the cache file + tempFile, err = os.CreateTemp("", cachePrefix) + if err != nil { + return + } + + _ = os.Remove(tempFile.Name()) // Delete the file - may not work on Windows + + // clean up the file after we are done downloading + cleanup = func() { + // the file should normally already be close, but just to make sure + _ = tempFile.Close() + _ = os.Remove(tempFile.Name()) // delete the cache file after we are done - may be deleted already + } + + // copy the ENTIRE file to disc and calculate the SHA1 in the process + if _, err = io.Copy(tempFile, teeReader); err != nil { + return + } + // jump to the start of the local file so we can pass it along + if _, err = tempFile.Seek(0, 0); err != nil { + return + } + + // replace the already read source with a reader of our cached file + out = tempFile + } else { + // that's a small file, just read it into memory + var inData []byte + inData, err = io.ReadAll(teeReader) + if err != nil { + return + } + + // set the reader to our read memory block + out = bytes.NewReader(inData) + } + return hex.EncodeToString(hash.Sum(nil)), out, cleanup, nil +} diff --git a/backend/pikpak/pikpak.go b/backend/pikpak/pikpak.go new file mode 100644 index 0000000000000..7cd5c11178e51 --- /dev/null +++ b/backend/pikpak/pikpak.go @@ -0,0 +1,1718 @@ +// Package pikpak provides an interface to the PikPak +package pikpak + +// ------------------------------------------------------------ +// NOTE +// ------------------------------------------------------------ + +// md5sum is not always available, sometimes given empty. + +// sha1sum used for upload differs from the one with official apps. + +// Trashed files are not restored to the original location when using `batchUntrash` + +// Can't stream without `--vfs-cache-mode=full` + +// ------------------------------------------------------------ +// TODO +// ------------------------------------------------------------ + +// * List() with options starred-only +// * uploadByResumable() with configurable chunk-size +// * user-configurable list chunk +// * backend command: untrash, iscached +// * api(event,task) + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "math" + "net/http" + "net/url" + "path" + "reflect" + "strconv" + "strings" + "sync" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3/s3manager" + "github.com/rclone/rclone/backend/pikpak/api" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/config" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/config/obscure" + "github.com/rclone/rclone/fs/fserrors" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/dircache" + "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/oauthutil" + "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/random" + "github.com/rclone/rclone/lib/rest" + "golang.org/x/oauth2" +) + +// Constants +const ( + rcloneClientID = "YNxT9w7GMdWvEOKa" + rcloneEncryptedClientSecret = "aqrmB6M1YJ1DWCBxVxFSjFo7wzWEky494YMmkqgAl1do1WKOe2E" + minSleep = 10 * time.Millisecond + maxSleep = 2 * time.Second + decayConstant = 2 // bigger for slower decay, exponential + rootURL = "https://api-drive.mypikpak.com" +) + +// Globals +var ( + // Description of how to auth for this app + oauthConfig = &oauth2.Config{ + Scopes: nil, + Endpoint: oauth2.Endpoint{ + AuthURL: "https://user.mypikpak.com/v1/auth/signin", + TokenURL: "https://user.mypikpak.com/v1/auth/token", + AuthStyle: oauth2.AuthStyleInParams, + }, + ClientID: rcloneClientID, + ClientSecret: obscure.MustReveal(rcloneEncryptedClientSecret), + RedirectURL: oauthutil.RedirectURL, + } +) + +// Returns OAuthOptions modified for pikpak +func pikpakOAuthOptions() []fs.Option { + opts := []fs.Option{} + for _, opt := range oauthutil.SharedOptions { + if opt.Name == config.ConfigClientID { + opt.Advanced = true + } else if opt.Name == config.ConfigClientSecret { + opt.Advanced = true + } + opts = append(opts, opt) + } + return opts +} + +// pikpakAutorize retrieves OAuth token using user/pass and save it to rclone.conf +func pikpakAuthorize(ctx context.Context, opt *Options, name string, m configmap.Mapper) error { + // override default client id/secret + if id, ok := m.Get("client_id"); ok && id != "" { + oauthConfig.ClientID = id + } + if secret, ok := m.Get("client_secret"); ok && secret != "" { + oauthConfig.ClientSecret = secret + } + pass, err := obscure.Reveal(opt.Password) + if err != nil { + return fmt.Errorf("failed to decode password - did you obscure it?: %w", err) + } + t, err := oauthConfig.PasswordCredentialsToken(ctx, opt.Username, pass) + if err != nil { + return fmt.Errorf("failed to retrieve token using username/password: %w", err) + } + return oauthutil.PutToken(name, m, t, false) +} + +// Register with Fs +func init() { + fs.Register(&fs.RegInfo{ + Name: "pikpak", + Description: "PikPak", + NewFs: NewFs, + CommandHelp: commandHelp, + Config: func(ctx context.Context, name string, m configmap.Mapper, config fs.ConfigIn) (*fs.ConfigOut, error) { + // Parse config into Options struct + opt := new(Options) + err := configstruct.Set(m, opt) + if err != nil { + return nil, fmt.Errorf("couldn't parse config into struct: %w", err) + } + + switch config.State { + case "": + // Check token exists + if _, err := oauthutil.GetToken(name, m); err != nil { + return fs.ConfigGoto("authorize") + } + return fs.ConfigConfirm("authorize_ok", false, "consent_to_authorize", "Re-authorize for new token?") + case "authorize_ok": + if config.Result == "false" { + return nil, nil + } + return fs.ConfigGoto("authorize") + case "authorize": + if err := pikpakAuthorize(ctx, opt, name, m); err != nil { + return nil, err + } + return nil, nil + } + return nil, fmt.Errorf("unknown state %q", config.State) + }, + Options: append(pikpakOAuthOptions(), []fs.Option{{ + Name: "user", + Help: "Pikpak username.", + Required: true, + Sensitive: true, + }, { + Name: "pass", + Help: "Pikpak password.", + Required: true, + IsPassword: true, + }, { + Name: "root_folder_id", + Help: `ID of the root folder. +Leave blank normally. + +Fill in for rclone to use a non root folder as its starting point. +`, + Advanced: true, + Sensitive: true, + }, { + Name: "use_trash", + Default: true, + Help: "Send files to the trash instead of deleting permanently.\n\nDefaults to true, namely sending files to the trash.\nUse `--pikpak-use-trash=false` to delete files permanently instead.", + Advanced: true, + }, { + Name: "trashed_only", + Default: false, + Help: "Only show files that are in the trash.\n\nThis will show trashed files in their original directory structure.", + Advanced: true, + }, { + Name: "hash_memory_limit", + Help: "Files bigger than this will be cached on disk to calculate hash if required.", + Default: fs.SizeSuffix(10 * 1024 * 1024), + Advanced: true, + }, { + Name: config.ConfigEncoding, + Help: config.ConfigEncodingHelp, + Advanced: true, + Default: (encoder.EncodeCtl | + encoder.EncodeDot | + encoder.EncodeBackSlash | + encoder.EncodeSlash | + encoder.EncodeDoubleQuote | + encoder.EncodeAsterisk | + encoder.EncodeColon | + encoder.EncodeLtGt | + encoder.EncodeQuestion | + encoder.EncodePipe | + encoder.EncodeLeftSpace | + encoder.EncodeRightSpace | + encoder.EncodeRightPeriod | + encoder.EncodeInvalidUtf8), + }}...), + }) +} + +// Options defines the configuration for this backend +type Options struct { + Username string `config:"user"` + Password string `config:"pass"` + RootFolderID string `config:"root_folder_id"` + UseTrash bool `config:"use_trash"` + TrashedOnly bool `config:"trashed_only"` + HashMemoryThreshold fs.SizeSuffix `config:"hash_memory_limit"` + Enc encoder.MultiEncoder `config:"encoding"` +} + +// Fs represents a remote pikpak +type Fs struct { + name string // name of this remote + root string // the path we are working on + opt Options // parsed options + features *fs.Features // optional features + rst *rest.Client // the connection to the server + dirCache *dircache.DirCache // Map of directory path to directory id + pacer *fs.Pacer // pacer for API calls + rootFolderID string // the id of the root folder + client *http.Client // authorized client + m configmap.Mapper + tokenMu *sync.Mutex // when renewing tokens +} + +// Object describes a pikpak object +type Object struct { + fs *Fs // what this object is part of + remote string // The remote path + hasMetaData bool // whether info below has been set + id string // ID of the object + size int64 // size of the object + modTime time.Time // modification time of the object + mimeType string // The object MIME type + parent string // ID of the parent directories + md5sum string // md5sum of the object + link *api.Link // link to download the object + linkMu *sync.Mutex +} + +// ------------------------------------------------------------ + +// Name of the remote (as passed into NewFs) +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return f.root +} + +// String converts this Fs to a string +func (f *Fs) String() string { + return fmt.Sprintf("PikPak root '%s'", f.root) +} + +// Features returns the optional features of this Fs +func (f *Fs) Features() *fs.Features { + return f.features +} + +// Precision return the precision of this Fs +func (f *Fs) Precision() time.Duration { + return fs.ModTimeNotSupported + // meaning that the modification times from the backend shouldn't be used for syncing + // as they can't be set. +} + +// DirCacheFlush resets the directory cache - used in testing as an +// optional interface +func (f *Fs) DirCacheFlush() { + f.dirCache.ResetRoot() +} + +// Hashes returns the supported hash sets. +func (f *Fs) Hashes() hash.Set { + return hash.Set(hash.MD5) +} + +// parsePath parses a remote path +func parsePath(path string) (root string) { + root = strings.Trim(path, "/") + return +} + +// parentIDForRequest returns ParentId for api requests +func parentIDForRequest(dirID string) string { + if dirID == "root" { + return "" + } + return dirID +} + +// retryErrorCodes is a slice of error codes that we will retry +var retryErrorCodes = []int{ + 429, // Too Many Requests. + 500, // Internal Server Error + 502, // Bad Gateway + 503, // Service Unavailable + 504, // Gateway Timeout + 509, // Bandwidth Limit Exceeded +} + +// reAuthorize re-authorize oAuth token during runtime +func (f *Fs) reAuthorize(ctx context.Context) (err error) { + f.tokenMu.Lock() + defer f.tokenMu.Unlock() + + if err := pikpakAuthorize(ctx, &f.opt, f.name, f.m); err != nil { + return err + } + return f.newClientWithPacer(ctx) +} + +// shouldRetry returns a boolean as to whether this resp and err +// deserve to be retried. It returns the err as a convenience +func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) { + if fserrors.ContextError(ctx, &err) { + return false, err + } + if err == nil { + return false, nil + } + if fserrors.ShouldRetry(err) { + return true, err + } + authRetry := false + + // traceback to possible api.Error wrapped in err, and re-authorize if necessary + // "unauthenticated" (16): when access_token is invalid, but should be handled by oauthutil + var terr *oauth2.RetrieveError + if errors.As(err, &terr) { + apiErr := new(api.Error) + if err := json.Unmarshal(terr.Body, apiErr); err == nil { + if apiErr.Reason == "invalid_grant" { + // "invalid_grant" (4126): The refresh token is incorrect or expired // + // Invalid refresh token. It may have been refreshed by another process. + authRetry = true + } + } + } + // Once err was processed by maybeWrapOAuthError() in lib/oauthutil, + // the above code is no longer sufficient to handle the 'invalid_grant' error. + if strings.Contains(err.Error(), "invalid_grant") { + authRetry = true + } + + if authRetry { + if authErr := f.reAuthorize(ctx); authErr != nil { + return false, fserrors.FatalError(authErr) + } + } + + switch apiErr := err.(type) { + case *api.Error: + if apiErr.Reason == "file_rename_uncompleted" { + // "file_rename_uncompleted" (9): Renaming uncompleted file or folder is not supported + // This error occurs when you attempt to rename objects + // right after some server-side changes, e.g. DirMove, Move, Copy + return true, err + } else if apiErr.Reason == "file_duplicated_name" { + // "file_duplicated_name" (3): File name cannot be repeated + // This error may occur when attempting to rename temp object (newly uploaded) + // right after the old one is removed. + return true, err + } else if apiErr.Reason == "task_daily_create_limit_vip" { + // "task_daily_create_limit_vip" (11): Sorry, you have submitted too many tasks and have exceeded the current processing capacity, please try again tomorrow + return false, fserrors.FatalError(err) + } else if apiErr.Reason == "file_space_not_enough" { + // "file_space_not_enough" (8): Storage space is not enough + return false, fserrors.FatalError(err) + } + } + + return authRetry || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), err +} + +// errorHandler parses a non 2xx error response into an error +func errorHandler(resp *http.Response) error { + // Decode error response + errResponse := new(api.Error) + err := rest.DecodeJSON(resp, &errResponse) + if err != nil { + fs.Debugf(nil, "Couldn't decode error response: %v", err) + } + if errResponse.Reason == "" { + errResponse.Reason = resp.Status + } + if errResponse.Code == 0 { + errResponse.Code = resp.StatusCode + } + return errResponse +} + +// newClientWithPacer sets a new http/rest client with a pacer to Fs +func (f *Fs) newClientWithPacer(ctx context.Context) (err error) { + f.client, _, err = oauthutil.NewClient(ctx, f.name, f.m, oauthConfig) + if err != nil { + return fmt.Errorf("failed to create oauth client: %w", err) + } + f.rst = rest.NewClient(f.client).SetRoot(rootURL).SetErrorHandler(errorHandler) + f.pacer = fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))) + return nil +} + +// newFs partially constructs Fs from the path +// +// It constructs a valid Fs but doesn't attempt to figure out whether +// it is a file or a directory. +func newFs(ctx context.Context, name, path string, m configmap.Mapper) (*Fs, error) { + // Parse config into Options struct + opt := new(Options) + if err := configstruct.Set(m, opt); err != nil { + return nil, err + } + + root := parsePath(path) + + f := &Fs{ + name: name, + root: root, + opt: *opt, + m: m, + tokenMu: new(sync.Mutex), + } + f.features = (&fs.Features{ + ReadMimeType: true, // can read the mime type of objects + CanHaveEmptyDirectories: true, // can have empty directories + NoMultiThreading: true, // can't have multiple threads downloading + }).Fill(ctx, f) + + if err := f.newClientWithPacer(ctx); err != nil { + return nil, err + } + + return f, nil +} + +// NewFs constructs an Fs from the path, container:path +func NewFs(ctx context.Context, name, path string, m configmap.Mapper) (fs.Fs, error) { + f, err := newFs(ctx, name, path, m) + if err != nil { + return nil, err + } + + // Set the root folder ID + if f.opt.RootFolderID != "" { + // use root_folder ID if set + f.rootFolderID = f.opt.RootFolderID + } else { + // pseudo-root + f.rootFolderID = "root" + } + + f.dirCache = dircache.New(f.root, f.rootFolderID, f) + + // Find the current root + err = f.dirCache.FindRoot(ctx, false) + if err != nil { + // Assume it is a file + newRoot, remote := dircache.SplitPath(f.root) + tempF := *f + tempF.dirCache = dircache.New(newRoot, f.rootFolderID, &tempF) + tempF.root = newRoot + // Make new Fs which is the parent + err = tempF.dirCache.FindRoot(ctx, false) + if err != nil { + // No root so return old f + return f, nil + } + _, err := tempF.NewObject(ctx, remote) + if err != nil { + if err == fs.ErrorObjectNotFound { + // File doesn't exist so return old f + return f, nil + } + return nil, err + } + f.features.Fill(ctx, &tempF) + // XXX: update the old f here instead of returning tempF, since + // `features` were already filled with functions having *f as a receiver. + // See https://github.com/rclone/rclone/issues/2182 + f.dirCache = tempF.dirCache + f.root = tempF.root + // return an error with an fs which points to the parent + return f, fs.ErrorIsFile + } + return f, nil +} + +// readMetaDataForPath reads the metadata from the path +func (f *Fs) readMetaDataForPath(ctx context.Context, path string) (info *api.File, err error) { + leaf, dirID, err := f.dirCache.FindPath(ctx, path, false) + if err != nil { + if err == fs.ErrorDirNotFound { + return nil, fs.ErrorObjectNotFound + } + return nil, err + } + + // checking whether fileObj with name of leaf exists in dirID + trashed := "false" + if f.opt.TrashedOnly { + trashed = "true" + } + found, err := f.listAll(ctx, dirID, api.KindOfFile, trashed, func(item *api.File) bool { + if item.Name == leaf { + info = item + return true + } + return false + }) + if err != nil { + return nil, err + } + if !found { + return nil, fs.ErrorObjectNotFound + } + return info, nil +} + +// Return an Object from a path +// +// If it can't be found it returns the error fs.ErrorObjectNotFound. +func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *api.File) (fs.Object, error) { + o := &Object{ + fs: f, + remote: remote, + linkMu: new(sync.Mutex), + } + var err error + if info != nil { + err = o.setMetaData(info) + } else { + err = o.readMetaData(ctx) // reads info and meta, returning an error + } + if err != nil { + return nil, err + } + return o, nil +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error fs.ErrorObjectNotFound. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + return f.newObjectWithInfo(ctx, remote, nil) +} + +// FindLeaf finds a directory of name leaf in the folder with ID pathID +func (f *Fs) FindLeaf(ctx context.Context, pathID, leaf string) (pathIDOut string, found bool, err error) { + // Find the leaf in pathID + trashed := "false" + if f.opt.TrashedOnly { + // still need to list folders + trashed = "" + } + found, err = f.listAll(ctx, pathID, api.KindOfFolder, trashed, func(item *api.File) bool { + if item.Name == leaf { + pathIDOut = item.ID + return true + } + return false + }) + return pathIDOut, found, err +} + +// list the objects into the function supplied +// +// If directories is set it only sends directories +// User function to process a File item from listAll +// +// Should return true to finish processing +type listAllFn func(*api.File) bool + +// Lists the directory required calling the user function on each item found +// +// If the user fn ever returns true then it early exits with found = true +func (f *Fs) listAll(ctx context.Context, dirID, kind, trashed string, fn listAllFn) (found bool, err error) { + // Url Parameters + params := url.Values{} + params.Set("thumbnail_size", api.ThumbnailSizeM) + params.Set("limit", strconv.Itoa(api.ListLimit)) + params.Set("with_audit", strconv.FormatBool(true)) + if parentID := parentIDForRequest(dirID); parentID != "" { + params.Set("parent_id", parentID) + } + + // Construct filter string + filters := &api.Filters{} + filters.Set("Phase", "eq", api.PhaseTypeComplete) + filters.Set("Trashed", "eq", trashed) + filters.Set("Kind", "eq", kind) + if filterStr, err := json.Marshal(filters); err == nil { + params.Set("filters", string(filterStr)) + } + // fs.Debugf(f, "list params: %v", params) + + opts := rest.Opts{ + Method: "GET", + Path: "/drive/v1/files", + Parameters: params, + } + + pageToken := "" +OUTER: + for { + opts.Parameters.Set("page_token", pageToken) + + var info api.FileList + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.CallJSON(ctx, &opts, nil, &info) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return found, fmt.Errorf("couldn't list files: %w", err) + } + if len(info.Files) == 0 { + break + } + for _, item := range info.Files { + item.Name = f.opt.Enc.ToStandardName(item.Name) + if fn(item) { + found = true + break OUTER + } + } + if info.NextPageToken == "" { + break + } + pageToken = info.NextPageToken + } + return +} + +// itemToDirEntry converts a api.File to an fs.DirEntry. +// When the api.File cannot be represented as an fs.DirEntry +// (nil, nil) is returned. +func (f *Fs) itemToDirEntry(ctx context.Context, remote string, item *api.File) (entry fs.DirEntry, err error) { + switch { + case item.Kind == api.KindOfFolder: + // cache the directory ID for later lookups + f.dirCache.Put(remote, item.ID) + d := fs.NewDir(remote, time.Time(item.ModifiedTime)).SetID(item.ID) + if item.ParentID == "" { + d.SetParentID("root") + } else { + d.SetParentID(item.ParentID) + } + return d, nil + case f.opt.TrashedOnly && !item.Trashed: + // ignore object + default: + entry, err = f.newObjectWithInfo(ctx, remote, item) + if err == fs.ErrorObjectNotFound { + return nil, nil + } + return entry, err + } + return nil, nil +} + +// List the objects and directories in dir into entries. The +// entries can be returned in any order but should be for a +// complete directory. +// +// dir should be "" to list the root, and should not have +// trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { + // fs.Debugf(f, "List(%q)\n", dir) + dirID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return nil, err + } + var iErr error + trashed := "false" + if f.opt.TrashedOnly { + // still need to list folders + trashed = "" + } + _, err = f.listAll(ctx, dirID, "", trashed, func(item *api.File) bool { + entry, err := f.itemToDirEntry(ctx, path.Join(dir, item.Name), item) + if err != nil { + iErr = err + return true + } + if entry != nil { + entries = append(entries, entry) + } + return false + }) + if err != nil { + return nil, err + } + if iErr != nil { + return nil, iErr + } + return entries, nil +} + +// CreateDir makes a directory with pathID as parent and name leaf +func (f *Fs) CreateDir(ctx context.Context, pathID, leaf string) (newID string, err error) { + // fs.Debugf(f, "CreateDir(%q, %q)\n", pathID, leaf) + req := api.RequestNewFile{ + Name: f.opt.Enc.FromStandardName(leaf), + Kind: api.KindOfFolder, + ParentID: parentIDForRequest(pathID), + } + info, err := f.requestNewFile(ctx, &req) + if err != nil { + return "", err + } + return info.File.ID, nil +} + +// Mkdir creates the container if it doesn't exist +func (f *Fs) Mkdir(ctx context.Context, dir string) error { + _, err := f.dirCache.FindDir(ctx, dir, true) + return err +} + +// About gets quota information +func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { + info, err := f.getAbout(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get drive quota: %w", err) + } + q := info.Quota + usage = &fs.Usage{ + Used: fs.NewUsageValue(q.Usage), // bytes in use + // Trashed: fs.NewUsageValue(q.UsageInTrash), // bytes in trash but this seems not working + } + if q.Limit > 0 { + usage.Total = fs.NewUsageValue(q.Limit) // quota of bytes that can be used + usage.Free = fs.NewUsageValue(q.Limit - q.Usage) // bytes which can be uploaded before reaching the quota + } + return usage, nil +} + +// PublicLink adds a "readable by anyone with link" permission on the given file or folder. +func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error) { + id, err := f.dirCache.FindDir(ctx, remote, false) + if err == nil { + fs.Debugf(f, "attempting to share directory '%s'", remote) + } else { + fs.Debugf(f, "attempting to share single file '%s'", remote) + o, err := f.NewObject(ctx, remote) + if err != nil { + return "", err + } + id = o.(*Object).id + } + expiry := -1 + if expire < fs.DurationOff { + expiry = int(math.Ceil(time.Duration(expire).Hours() / 24)) + } + req := api.RequestShare{ + FileIds: []string{id}, + ShareTo: "publiclink", + ExpirationDays: expiry, + PassCodeOption: "NOT_REQUIRED", + } + info, err := f.requestShare(ctx, &req) + if err != nil { + return "", err + } + return info.ShareURL, err +} + +// delete a file or directory by ID w/o using trash +func (f *Fs) deleteObjects(ctx context.Context, IDs []string, useTrash bool) (err error) { + if len(IDs) == 0 { + return nil + } + action := "batchDelete" + if useTrash { + action = "batchTrash" + } + req := api.RequestBatch{ + Ids: IDs, + } + if err := f.requestBatchAction(ctx, action, &req); err != nil { + return fmt.Errorf("delete object failed: %w", err) + } + return nil +} + +// purgeCheck removes the root directory, if check is set then it +// refuses to do so if it has anything in +func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) error { + root := path.Join(f.root, dir) + if root == "" { + return errors.New("can't purge root directory") + } + rootID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return err + } + + var trashedFiles = false + if check { + found, err := f.listAll(ctx, rootID, "", "", func(item *api.File) bool { + if !item.Trashed { + fs.Debugf(dir, "Rmdir: contains file: %q", item.Name) + return true + } + fs.Debugf(dir, "Rmdir: contains trashed file: %q", item.Name) + trashedFiles = true + return false + }) + if err != nil { + return err + } + if found { + return fs.ErrorDirectoryNotEmpty + } + } + if root != "" { + // trash the directory if it had trashed files + // in or the user wants to trash, otherwise + // delete it. + err = f.deleteObjects(ctx, []string{rootID}, trashedFiles || f.opt.UseTrash) + if err != nil { + return err + } + } else if check { + return errors.New("can't purge root directory") + } + f.dirCache.FlushDir(dir) + if err != nil { + return err + } + return nil +} + +// Rmdir deletes the root folder +// +// Returns an error if it isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) error { + return f.purgeCheck(ctx, dir, true) +} + +// Purge deletes all the files and the container +// +// Optional interface: Only implement this if you have a way of +// deleting all the files quicker than just running Remove() on the +// result of List() +func (f *Fs) Purge(ctx context.Context, dir string) error { + return f.purgeCheck(ctx, dir, false) +} + +// CleanUp empties the trash +func (f *Fs) CleanUp(ctx context.Context) (err error) { + opts := rest.Opts{ + Method: "PATCH", + Path: "/drive/v1/files/trash:empty", + NoResponse: true, // Only returns `{"task_id":""} + } + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.rst.Call(ctx, &opts) + return f.shouldRetry(ctx, resp, err) + }) + if err != nil { + return fmt.Errorf("couldn't empty trash: %w", err) + } + return nil +} + +// Move the object +func (f *Fs) moveObjects(ctx context.Context, IDs []string, dirID string) (err error) { + if len(IDs) == 0 { + return nil + } + req := api.RequestBatch{ + Ids: IDs, + To: map[string]string{"parent_id": parentIDForRequest(dirID)}, + } + if err := f.requestBatchAction(ctx, "batchMove", &req); err != nil { + return fmt.Errorf("move object failed: %w", err) + } + return nil +} + +// renames the object +func (f *Fs) renameObject(ctx context.Context, ID, newName string) (info *api.File, err error) { + req := api.File{ + Name: f.opt.Enc.FromStandardName(newName), + } + info, err = f.patchFile(ctx, ID, &req) + if err != nil { + return nil, fmt.Errorf("rename object failed: %w", err) + } + return +} + +// DirMove moves src, srcRemote to this remote at dstRemote +// using server-side move operations. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantDirMove +// +// If destination exists then return fs.ErrorDirExists +func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error { + srcFs, ok := src.(*Fs) + if !ok { + fs.Debugf(srcFs, "Can't move directory - not same remote type") + return fs.ErrorCantDirMove + } + + srcID, srcParentID, srcLeaf, dstParentID, dstLeaf, err := f.dirCache.DirMove(ctx, srcFs.dirCache, srcFs.root, srcRemote, f.root, dstRemote) + if err != nil { + return err + } + + if srcParentID != dstParentID { + // Do the move + err = f.moveObjects(ctx, []string{srcID}, dstParentID) + if err != nil { + return fmt.Errorf("couldn't dir move: %w", err) + } + } + + // Can't copy and change name in one step so we have to check if we have + // the correct name after copy + if srcLeaf != dstLeaf { + _, err = f.renameObject(ctx, srcID, dstLeaf) + if err != nil { + return fmt.Errorf("dirmove: couldn't rename moved dir: %w", err) + } + } + srcFs.dirCache.FlushDir(srcRemote) + return nil +} + +// Creates from the parameters passed in a half finished Object which +// must have setMetaData called on it +// +// Returns the object, leaf, dirID and error. +// +// Used to create new objects +func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, dirID string, err error) { + // Create the directory for the object if it doesn't exist + leaf, dirID, err = f.dirCache.FindPath(ctx, remote, true) + if err != nil { + return + } + // Temporary Object under construction + o = &Object{ + fs: f, + remote: remote, + size: size, + modTime: modTime, + linkMu: new(sync.Mutex), + } + return o, leaf, dirID, nil +} + +// Move src to this remote using server-side move operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantMove +func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't move - not same remote type") + return nil, fs.ErrorCantMove + } + err := srcObj.readMetaData(ctx) + if err != nil { + return nil, err + } + + srcLeaf, srcParentID, err := srcObj.fs.dirCache.FindPath(ctx, srcObj.remote, false) + if err != nil { + return nil, err + } + + // Create temporary object + dstObj, dstLeaf, dstParentID, err := f.createObject(ctx, remote, srcObj.modTime, srcObj.size) + if err != nil { + return nil, err + } + + if srcParentID != dstParentID { + // Do the move + if err = f.moveObjects(ctx, []string{srcObj.id}, dstParentID); err != nil { + return nil, err + } + } + dstObj.id = srcObj.id + + var info *api.File + if srcLeaf != dstLeaf { + // Rename + info, err = f.renameObject(ctx, srcObj.id, dstLeaf) + if err != nil { + return nil, fmt.Errorf("move: couldn't rename moved file: %w", err) + } + } else { + // Update info + info, err = f.getFile(ctx, dstObj.id) + if err != nil { + return nil, fmt.Errorf("move: couldn't update moved file: %w", err) + } + } + return dstObj, dstObj.setMetaData(info) +} + +// copy objects +func (f *Fs) copyObjects(ctx context.Context, IDs []string, dirID string) (err error) { + if len(IDs) == 0 { + return nil + } + req := api.RequestBatch{ + Ids: IDs, + To: map[string]string{"parent_id": parentIDForRequest(dirID)}, + } + if err := f.requestBatchAction(ctx, "batchCopy", &req); err != nil { + return fmt.Errorf("copy object failed: %w", err) + } + return nil +} + +// Copy src to this remote using server side copy operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantCopy +func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't copy - not same remote type") + return nil, fs.ErrorCantCopy + } + err := srcObj.readMetaData(ctx) + if err != nil { + return nil, err + } + + // Create temporary object + dstObj, dstLeaf, dstParentID, err := f.createObject(ctx, remote, srcObj.modTime, srcObj.size) + if err != nil { + return nil, err + } + if srcObj.parent == dstParentID { + // api restriction + fs.Debugf(src, "Can't copy - same parent") + return nil, fs.ErrorCantCopy + } + // Copy the object + if err := f.copyObjects(ctx, []string{srcObj.id}, dstParentID); err != nil { + return nil, fmt.Errorf("couldn't copy file: %w", err) + } + + // Can't copy and change name in one step so we have to check if we have + // the correct name after copy + srcLeaf, _, err := srcObj.fs.dirCache.FindPath(ctx, srcObj.remote, false) + if err != nil { + return nil, err + } + + if srcLeaf != dstLeaf { + // Rename + info, err := f.renameObject(ctx, dstObj.id, dstLeaf) + if err != nil { + return nil, fmt.Errorf("copy: couldn't rename copied file: %w", err) + } + err = dstObj.setMetaData(info) + if err != nil { + return nil, err + } + } else { + // Update info + err = dstObj.readMetaData(ctx) + if err != nil { + return nil, fmt.Errorf("copy: couldn't locate copied file: %w", err) + } + } + return dstObj, nil +} + +func (f *Fs) uploadByForm(ctx context.Context, in io.Reader, name string, size int64, form *api.Form, options ...fs.OpenOption) (err error) { + // struct to map. transferring values from MultParts to url parameter + params := url.Values{} + iVal := reflect.ValueOf(&form.MultiParts).Elem() + iTyp := iVal.Type() + for i := 0; i < iVal.NumField(); i++ { + params.Set(iTyp.Field(i).Tag.Get("json"), iVal.Field(i).String()) + } + formReader, contentType, overhead, err := rest.MultipartUpload(ctx, in, params, "file", name) + if err != nil { + return fmt.Errorf("failed to make multipart upload: %w", err) + } + + contentLength := overhead + size + opts := rest.Opts{ + Method: form.Method, + RootURL: form.URL, + Body: formReader, + ContentType: contentType, + ContentLength: &contentLength, + Options: options, + TransferEncoding: []string{"identity"}, + NoResponse: true, + } + + var resp *http.Response + err = f.pacer.CallNoRetry(func() (bool, error) { + resp, err = f.rst.Call(ctx, &opts) + return f.shouldRetry(ctx, resp, err) + }) + return +} + +func (f *Fs) uploadByResumable(ctx context.Context, in io.Reader, resumable *api.Resumable, options ...fs.OpenOption) (err error) { + p := resumable.Params + endpoint := strings.Join(strings.Split(p.Endpoint, ".")[1:], ".") // "mypikpak.com" + + cfg := &aws.Config{ + Credentials: credentials.NewStaticCredentials(p.AccessKeyID, p.AccessKeySecret, p.SecurityToken), + Region: aws.String("pikpak"), + Endpoint: &endpoint, + } + sess, err := session.NewSession(cfg) + if err != nil { + return + } + + uploader := s3manager.NewUploader(sess) + // Upload input parameters + uParams := &s3manager.UploadInput{ + Bucket: &p.Bucket, + Key: &p.Key, + Body: in, + } + // Perform upload with options different than the those in the Uploader. + _, err = uploader.UploadWithContext(ctx, uParams, func(u *s3manager.Uploader) { + // TODO can be user-configurable + u.PartSize = 10 * 1024 * 1024 // 10MB part size + }) + return +} + +func (f *Fs) upload(ctx context.Context, in io.Reader, leaf, dirID, sha1Str string, size int64, options ...fs.OpenOption) (*api.File, error) { + // determine upload type + uploadType := api.UploadTypeResumable + if size >= 0 && size < int64(5*fs.Mebi) { + uploadType = api.UploadTypeForm + } + + // request upload ticket to API + req := api.RequestNewFile{ + Kind: api.KindOfFile, + Name: f.opt.Enc.FromStandardName(leaf), + ParentID: parentIDForRequest(dirID), + FolderType: "NORMAL", + Size: size, + Hash: strings.ToUpper(sha1Str), + UploadType: uploadType, + } + if uploadType == api.UploadTypeResumable { + req.Resumable = map[string]string{"provider": "PROVIDER_ALIYUN"} + } + newfile, err := f.requestNewFile(ctx, &req) + if err != nil { + return nil, fmt.Errorf("failed to create a new file: %w", err) + } + if newfile.File == nil { + return nil, fmt.Errorf("invalid response: %+v", newfile) + } else if newfile.File.Phase == api.PhaseTypeComplete { + // early return; in case of zero-byte objects + return newfile.File, nil + } + + if uploadType == api.UploadTypeForm && newfile.Form != nil { + err = f.uploadByForm(ctx, in, req.Name, size, newfile.Form, options...) + } else if uploadType == api.UploadTypeResumable && newfile.Resumable != nil { + err = f.uploadByResumable(ctx, in, newfile.Resumable, options...) + } else { + return nil, fmt.Errorf("unable to proceed upload: %+v", newfile) + } + + if err != nil { + return nil, fmt.Errorf("failed to upload: %w", err) + } + // refresh uploaded file info + // Compared to `newfile.File` this upgrades several fields... + // audit, links, modified_time, phase, revision, and web_content_link + return f.getFile(ctx, newfile.File.ID) +} + +// Put the object +// +// Copy the reader in to the new object which is returned. +// +// The new object may have been created if an error is returned +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + existingObj, err := f.NewObject(ctx, src.Remote()) + switch err { + case nil: + return existingObj, existingObj.Update(ctx, in, src, options...) + case fs.ErrorObjectNotFound: + // Not found so create it + newObj := &Object{ + fs: f, + remote: src.Remote(), + linkMu: new(sync.Mutex), + } + return newObj, newObj.upload(ctx, in, src, false, options...) + default: + return nil, err + } +} + +// UserInfo fetches info about the current user +func (f *Fs) UserInfo(ctx context.Context) (userInfo map[string]string, err error) { + user, err := f.getUserInfo(ctx) + if err != nil { + return nil, err + } + userInfo = map[string]string{ + "Id": user.Sub, + "Username": user.Name, + "Email": user.Email, + "PhoneNumber": user.PhoneNumber, + "Password": user.Password, + "Status": user.Status, + "CreatedAt": time.Time(user.CreatedAt).String(), + "PasswordUpdatedAt": time.Time(user.PasswordUpdatedAt).String(), + } + if vip, err := f.getVIPInfo(ctx); err == nil && vip.Result == "ACCEPTED" { + userInfo["VIPExpiresAt"] = time.Time(vip.Data.Expire).String() + userInfo["VIPStatus"] = vip.Data.Status + userInfo["VIPType"] = vip.Data.Type + } + return userInfo, nil +} + +// ------------------------------------------------------------ + +// add offline download task for url +func (f *Fs) addURL(ctx context.Context, url, path string) (*api.Task, error) { + req := api.RequestNewTask{ + Kind: api.KindOfFile, + UploadType: "UPLOAD_TYPE_URL", + URL: &api.URL{ + URL: url, + }, + FolderType: "DOWNLOAD", + } + if parentID, err := f.dirCache.FindDir(ctx, path, false); err == nil { + req.ParentID = parentIDForRequest(parentID) + req.FolderType = "" + } + return f.requestNewTask(ctx, &req) +} + +type decompressDirResult struct { + Decompressed int + SourceDeleted int + Errors int +} + +func (r decompressDirResult) Error() string { + return fmt.Sprintf("%d error(s) while decompressing - see log", r.Errors) +} + +// decompress file/files in a directory of an ID +func (f *Fs) decompressDir(ctx context.Context, filename, id, password string, srcDelete bool) (r decompressDirResult, err error) { + _, err = f.listAll(ctx, id, api.KindOfFile, "false", func(item *api.File) bool { + if item.MimeType == "application/zip" || item.MimeType == "application/x-7z-compressed" || item.MimeType == "application/x-rar-compressed" { + if filename == "" || filename == item.Name { + res, err := f.requestDecompress(ctx, item, password) + if err != nil { + err = fmt.Errorf("unexpected error while requesting decompress of %q: %w", item.Name, err) + r.Errors++ + fs.Errorf(f, "%v", err) + } else if res.Status != "OK" { + r.Errors++ + fs.Errorf(f, "%q: %d files: %s", item.Name, res.FilesNum, res.Status) + } else { + r.Decompressed++ + fs.Infof(f, "%q: %d files: %s", item.Name, res.FilesNum, res.Status) + if srcDelete { + derr := f.deleteObjects(ctx, []string{item.ID}, f.opt.UseTrash) + if derr != nil { + derr = fmt.Errorf("failed to delete %q: %w", item.Name, derr) + r.Errors++ + fs.Errorf(f, "%v", derr) + } else { + r.SourceDeleted++ + } + } + } + } + } + return false + }) + if err != nil { + err = fmt.Errorf("couldn't list files to decompress: %w", err) + r.Errors++ + fs.Errorf(f, "%v", err) + } + if r.Errors != 0 { + return r, r + } + return r, nil +} + +var commandHelp = []fs.CommandHelp{{ + Name: "addurl", + Short: "Add offline download task for url", + Long: `This command adds offline download task for url. + +Usage: + + rclone backend addurl pikpak:dirpath url + +Downloads will be stored in 'dirpath'. If 'dirpath' is invalid, +download will fallback to default 'My Pack' folder. +`, +}, { + Name: "decompress", + Short: "Request decompress of a file/files in a folder", + Long: `This command requests decompress of file/files in a folder. + +Usage: + + rclone backend decompress pikpak:dirpath {filename} -o password=password + rclone backend decompress pikpak:dirpath {filename} -o delete-src-file + +An optional argument 'filename' can be specified for a file located in +'pikpak:dirpath'. You may want to pass '-o password=password' for a +password-protected files. Also, pass '-o delete-src-file' to delete +source files after decompression finished. + +Result: + + { + "Decompressed": 17, + "SourceDeleted": 0, + "Errors": 0 + } +`, +}} + +// Command the backend to run a named command +// +// The command run is name +// args may be used to read arguments from +// opts may be used to read optional arguments from +// +// The result should be capable of being JSON encoded +// If it is a string or a []string it will be shown to the user +// otherwise it will be JSON encoded and shown to the user like that +func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error) { + switch name { + case "addurl": + if len(arg) != 1 { + return nil, errors.New("need exactly 1 argument") + } + return f.addURL(ctx, arg[0], "") + case "decompress": + filename := "" + if len(arg) > 0 { + filename = arg[0] + } + id, err := f.dirCache.FindDir(ctx, "", false) + if err != nil { + return nil, fmt.Errorf("failed to get an ID of dirpath: %w", err) + } + password := "" + if pass, ok := opt["password"]; ok { + password = pass + } + _, srcDelete := opt["delete-src-file"] + return f.decompressDir(ctx, filename, id, password, srcDelete) + default: + return nil, fs.ErrorCommandNotFound + } +} + +// ------------------------------------------------------------ + +// parseFileID gets fid parameter from url query +func parseFileID(s string) string { + if u, err := url.Parse(s); err == nil { + if q, err := url.ParseQuery(u.RawQuery); err == nil { + return q.Get("fid") + } + } + return "" +} + +// setMetaData sets the metadata from info +func (o *Object) setMetaData(info *api.File) (err error) { + if info.Kind == api.KindOfFolder { + return fs.ErrorIsDir + } + if info.Kind != api.KindOfFile { + return fmt.Errorf("%q is %q: %w", o.remote, info.Kind, fs.ErrorNotAFile) + } + o.hasMetaData = true + o.id = info.ID + o.size = info.Size + o.modTime = time.Time(info.ModifiedTime) + o.mimeType = info.MimeType + if info.ParentID == "" { + o.parent = "root" + } else { + o.parent = info.ParentID + } + o.md5sum = info.Md5Checksum + if info.Links.ApplicationOctetStream != nil { + o.link = info.Links.ApplicationOctetStream + if fid := parseFileID(o.link.URL); fid != "" { + for mid, media := range info.Medias { + if media.Link == nil { + continue + } + if mfid := parseFileID(media.Link.URL); fid == mfid { + fs.Debugf(o, "Using a media link from Medias[%d]", mid) + o.link = media.Link + break + } + } + } + } + return nil +} + +// setMetaDataWithLink ensures a link for opening an object +func (o *Object) setMetaDataWithLink(ctx context.Context) error { + o.linkMu.Lock() + defer o.linkMu.Unlock() + + // check if the current link is valid + if o.link.Valid() { + return nil + } + + // fetch download link with retry scheme + // 1 initial attempt and 2 retries are reasonable based on empirical analysis + retries := 2 + for i := 1; i <= retries+1; i++ { + info, err := o.fs.getFile(ctx, o.id) + if err != nil { + return fmt.Errorf("can't fetch download link: %w", err) + } + if err = o.setMetaData(info); err == nil && o.link.Valid() { + return nil + } + if i <= retries { + time.Sleep(time.Duration(200*i) * time.Millisecond) + } + } + return errors.New("can't download - no link to download") +} + +// readMetaData gets the metadata if it hasn't already been fetched +// +// it also sets the info +func (o *Object) readMetaData(ctx context.Context) (err error) { + if o.hasMetaData { + return nil + } + info, err := o.fs.readMetaDataForPath(ctx, o.remote) + if err != nil { + return err + } + return o.setMetaData(info) +} + +// Fs returns the parent Fs +func (o *Object) Fs() fs.Info { + return o.fs +} + +// Return a string version +func (o *Object) String() string { + if o == nil { + return "" + } + return o.remote +} + +// Remote returns the remote path +func (o *Object) Remote() string { + return o.remote +} + +// Hash returns the Md5sum of an object returning a lowercase hex string +func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { + if t != hash.MD5 { + return "", hash.ErrUnsupported + } + if o.md5sum == "" { + return "", nil + } + return strings.ToLower(o.md5sum), nil +} + +// Size returns the size of an object in bytes +func (o *Object) Size() int64 { + err := o.readMetaData(context.TODO()) + if err != nil { + fs.Logf(o, "Failed to read metadata: %v", err) + return 0 + } + return o.size +} + +// MimeType of an Object if known, "" otherwise +func (o *Object) MimeType(ctx context.Context) string { + return o.mimeType +} + +// ID returns the ID of the Object if known, or "" if not +func (o *Object) ID() string { + return o.id +} + +// ParentID returns the ID of the Object parent if known, or "" if not +func (o *Object) ParentID() string { + return o.parent +} + +// ModTime returns the modification time of the object +func (o *Object) ModTime(ctx context.Context) time.Time { + err := o.readMetaData(ctx) + if err != nil { + fs.Logf(o, "Failed to read metadata: %v", err) + return time.Now() + } + return o.modTime +} + +// SetModTime sets the modification time of the local fs object +func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { + return fs.ErrorCantSetModTime +} + +// Storable returns a boolean showing whether this object storable +func (o *Object) Storable() bool { + return true +} + +// Remove an object +func (o *Object) Remove(ctx context.Context) error { + return o.fs.deleteObjects(ctx, []string{o.id}, o.fs.opt.UseTrash) +} + +// httpResponse gets an http.Response object for the object +// using the url and method passed in +func (o *Object) httpResponse(ctx context.Context, url, method string, options []fs.OpenOption) (res *http.Response, err error) { + if url == "" { + return nil, errors.New("forbidden to download - check sharing permission") + } + req, err := http.NewRequestWithContext(ctx, method, url, nil) + if err != nil { + return nil, err + } + fs.FixRangeOption(options, o.size) + fs.OpenOptionAddHTTPHeaders(req.Header, options) + if o.size == 0 { + // Don't supply range requests for 0 length objects as they always fail + delete(req.Header, "Range") + } + err = o.fs.pacer.Call(func() (bool, error) { + res, err = o.fs.client.Do(req) + return o.fs.shouldRetry(ctx, res, err) + }) + if err != nil { + return nil, err + } + return res, nil +} + +// open a url for reading +func (o *Object) open(ctx context.Context, url string, options ...fs.OpenOption) (in io.ReadCloser, err error) { + res, err := o.httpResponse(ctx, url, "GET", options) + if err != nil { + return nil, fmt.Errorf("open file failed: %w", err) + } + return res.Body, nil +} + +// Open an object for read +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) { + if o.id == "" { + return nil, errors.New("can't download - no id") + } + if o.size == 0 { + // zero-byte objects may have no download link + return io.NopCloser(bytes.NewBuffer([]byte(nil))), nil + } + if err = o.setMetaDataWithLink(ctx); err != nil { + return nil, err + } + return o.open(ctx, o.link.URL, options...) +} + +// Update the object with the contents of the io.Reader, modTime and size +// +// If existing is set then it updates the object rather than creating a new one. +// +// The new object may have been created if an error is returned +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + return o.upload(ctx, in, src, true, options...) +} + +// upload uploads the object with or without using a temporary file name +func (o *Object) upload(ctx context.Context, in io.Reader, src fs.ObjectInfo, withTemp bool, options ...fs.OpenOption) (err error) { + size := src.Size() + remote := o.Remote() + + // Create the directory for the object if it doesn't exist + leaf, dirID, err := o.fs.dirCache.FindPath(ctx, remote, true) + if err != nil { + return err + } + + // Calculate sha1sum; grabbed from package jottacloud + hashStr, err := src.Hash(ctx, hash.SHA1) + if err != nil || hashStr == "" { + // unwrap the accounting from the input, we use wrap to put it + // back on after the buffering + var wrap accounting.WrapFn + in, wrap = accounting.UnWrap(in) + var cleanup func() + hashStr, in, cleanup, err = readSHA1(in, size, int64(o.fs.opt.HashMemoryThreshold)) + defer cleanup() + if err != nil { + return fmt.Errorf("failed to calculate SHA1: %w", err) + } + // Wrap the accounting back onto the stream + in = wrap(in) + } + + if !withTemp { + info, err := o.fs.upload(ctx, in, leaf, dirID, hashStr, size, options...) + if err != nil { + return err + } + return o.setMetaData(info) + } + + // We have to fall back to upload + rename + tempName := "rcloneTemp" + random.String(8) + info, err := o.fs.upload(ctx, in, tempName, dirID, hashStr, size, options...) + if err != nil { + return err + } + + // upload was successful, need to delete old object before rename + if err = o.Remove(ctx); err != nil { + return fmt.Errorf("failed to remove old object: %w", err) + } + + // rename also updates metadata + if info, err = o.fs.renameObject(ctx, info.ID, leaf); err != nil { + return fmt.Errorf("failed to rename temp object: %w", err) + } + return o.setMetaData(info) +} + +// Check the interfaces are satisfied +var ( + // _ fs.ListRer = (*Fs)(nil) + // _ fs.ChangeNotifier = (*Fs)(nil) + // _ fs.PutStreamer = (*Fs)(nil) + _ fs.Fs = (*Fs)(nil) + _ fs.Purger = (*Fs)(nil) + _ fs.CleanUpper = (*Fs)(nil) + _ fs.Copier = (*Fs)(nil) + _ fs.Mover = (*Fs)(nil) + _ fs.DirMover = (*Fs)(nil) + _ fs.Commander = (*Fs)(nil) + _ fs.DirCacheFlusher = (*Fs)(nil) + _ fs.PublicLinker = (*Fs)(nil) + _ fs.Abouter = (*Fs)(nil) + _ fs.UserInfoer = (*Fs)(nil) + _ fs.Object = (*Object)(nil) + _ fs.MimeTyper = (*Object)(nil) + _ fs.IDer = (*Object)(nil) + _ fs.ParentIDer = (*Object)(nil) +) diff --git a/backend/pikpak/pikpak_test.go b/backend/pikpak/pikpak_test.go new file mode 100644 index 0000000000000..cbc97589e6515 --- /dev/null +++ b/backend/pikpak/pikpak_test.go @@ -0,0 +1,17 @@ +// Test PikPak filesystem interface +package pikpak_test + +import ( + "testing" + + "github.com/rclone/rclone/backend/pikpak" + "github.com/rclone/rclone/fstest/fstests" +) + +// TestIntegration runs integration tests against the remote +func TestIntegration(t *testing.T) { + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestPikPak:", + NilObject: (*pikpak.Object)(nil), + }) +} diff --git a/backend/premiumizeme/premiumizeme.go b/backend/premiumizeme/premiumizeme.go index 8f3aa1ce8c377..4adaa5af285cf 100644 --- a/backend/premiumizeme/premiumizeme.go +++ b/backend/premiumizeme/premiumizeme.go @@ -82,14 +82,15 @@ func init() { OAuth2Config: oauthConfig, }) }, - Options: []fs.Option{{ + Options: append(oauthutil.SharedOptions, []fs.Option{{ Name: "api_key", Help: `API Key. This is not normally used - use oauth instead. `, - Hide: fs.OptionHideBoth, - Default: "", + Hide: fs.OptionHideBoth, + Default: "", + Sensitive: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -99,7 +100,7 @@ This is not normally used - use oauth instead. encoder.EncodeBackSlash | encoder.EncodeDoubleQuote | encoder.EncodeInvalidUtf8), - }}, + }}...), }) } diff --git a/backend/protondrive/protondrive.go b/backend/protondrive/protondrive.go new file mode 100644 index 0000000000000..d82575aa6b7e7 --- /dev/null +++ b/backend/protondrive/protondrive.go @@ -0,0 +1,1114 @@ +// Package protondrive implements the Proton Drive backend +package protondrive + +import ( + "context" + "errors" + "fmt" + "io" + "path" + "strings" + "time" + + protonDriveAPI "github.com/henrybear327/Proton-API-Bridge" + "github.com/henrybear327/go-proton-api" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/config/obscure" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/dircache" + "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/readers" +) + +/* +- dirCache operates on relative path to root +- path sanitization + - rule of thumb: sanitize before use, but store things as-is + - the paths cached in dirCache are after sanitizing + - the remote/dir passed in aren't, and are stored as-is +*/ + +const ( + minSleep = 10 * time.Millisecond + maxSleep = 2 * time.Second + decayConstant = 2 // bigger for slower decay, exponential + + clientUIDKey = "client_uid" + clientAccessTokenKey = "client_access_token" + clientRefreshTokenKey = "client_refresh_token" + clientSaltedKeyPassKey = "client_salted_key_pass" +) + +var ( + errCanNotUploadFileWithUnknownSize = errors.New("proton Drive can't upload files with unknown size") + errCanNotPurgeRootDirectory = errors.New("can't purge root directory") + + // for the auth/deauth handler + _mapper configmap.Mapper + _saltedKeyPass string +) + +// Register with Fs +func init() { + fs.Register(&fs.RegInfo{ + Name: "protondrive", + Description: "Proton Drive", + NewFs: NewFs, + Options: []fs.Option{{ + Name: "username", + Help: `The username of your proton account`, + Required: true, + }, { + Name: "password", + Help: "The password of your proton account.", + Required: true, + IsPassword: true, + }, { + Name: "mailbox_password", + Help: `The mailbox password of your two-password proton account. + +For more information regarding the mailbox password, please check the +following official knowledge base article: +https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password +`, + IsPassword: true, + Advanced: true, + }, { + Name: "2fa", + Help: `The 2FA code + +The value can also be provided with --protondrive-2fa=000000 + +The 2FA code of your proton drive account if the account is set up with +two-factor authentication`, + Required: false, + }, { + Name: clientUIDKey, + Help: "Client uid key (internal use only)", + Required: false, + Advanced: true, + Sensitive: true, + Hide: fs.OptionHideBoth, + }, { + Name: clientAccessTokenKey, + Help: "Client access token key (internal use only)", + Required: false, + Advanced: true, + Sensitive: true, + Hide: fs.OptionHideBoth, + }, { + Name: clientRefreshTokenKey, + Help: "Client refresh token key (internal use only)", + Required: false, + Advanced: true, + Sensitive: true, + Hide: fs.OptionHideBoth, + }, { + Name: clientSaltedKeyPassKey, + Help: "Client salted key pass key (internal use only)", + Required: false, + Advanced: true, + Sensitive: true, + Hide: fs.OptionHideBoth, + }, { + Name: config.ConfigEncoding, + Help: config.ConfigEncodingHelp, + Advanced: true, + Default: (encoder.Base | + encoder.EncodeInvalidUtf8 | + encoder.EncodeLeftSpace | + encoder.EncodeRightSpace), + }, { + Name: "original_file_size", + Help: `Return the file size before encryption + +The size of the encrypted file will be different from (bigger than) the +original file size. Unless there is a reason to return the file size +after encryption is performed, otherwise, set this option to true, as +features like Open() which will need to be supplied with original content +size, will fail to operate properly`, + Advanced: true, + Default: true, + }, { + Name: "app_version", + Help: `The app version string + +The app version string indicates the client that is currently performing +the API request. This information is required and will be sent with every +API request.`, + Advanced: true, + Default: "macos-drive@1.0.0-alpha.1+rclone", + }, { + Name: "replace_existing_draft", + Help: `Create a new revision when filename conflict is detected + +When a file upload is cancelled or failed before completion, a draft will be +created and the subsequent upload of the same file to the same location will be +reported as a conflict. + +The value can also be set by --protondrive-replace-existing-draft=true + +If the option is set to true, the draft will be replaced and then the upload +operation will restart. If there are other clients also uploading at the same +file location at the same time, the behavior is currently unknown. Need to set +to true for integration tests. +If the option is set to false, an error "a draft exist - usually this means a +file is being uploaded at another client, or, there was a failed upload attempt" +will be returned, and no upload will happen.`, + Advanced: true, + Default: false, + }, { + Name: "enable_caching", + Help: `Caches the files and folders metadata to reduce API calls + +Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, +as the current implementation doesn't update or clear the cache when there are +external changes. + +The files and folders on ProtonDrive are represented as links with keyrings, +which can be cached to improve performance and be friendly to the API server. + +The cache is currently built for the case when the rclone is the only instance +performing operations to the mount point. The event system, which is the proton +API system that provides visibility of what has changed on the drive, is yet +to be implemented, so updates from other clients won’t be reflected in the +cache. Thus, if there are concurrent clients accessing the same mount point, +then we might have a problem with caching the stale data.`, + Advanced: true, + Default: true, + }}, + }) +} + +// Options defines the configuration for this backend +type Options struct { + Username string `config:"username"` + Password string `config:"password"` + MailboxPassword string `config:"mailbox_password"` + TwoFA string `config:"2fa"` + + // advanced + Enc encoder.MultiEncoder `config:"encoding"` + ReportOriginalSize bool `config:"original_file_size"` + AppVersion string `config:"app_version"` + ReplaceExistingDraft bool `config:"replace_existing_draft"` + EnableCaching bool `config:"enable_caching"` +} + +// Fs represents a remote proton drive +type Fs struct { + name string // name of this remote + // Notice that for ProtonDrive, it's attached under rootLink (usually /root) + root string // the path we are working on. + opt Options // parsed config options + ci *fs.ConfigInfo // global config + features *fs.Features // optional features + pacer *fs.Pacer // pacer for API calls + dirCache *dircache.DirCache // Map of directory path to directory id + protonDrive *protonDriveAPI.ProtonDrive // the Proton API bridging library +} + +// Object describes an object +type Object struct { + fs *Fs // what this object is part of + remote string // The remote path (relative to the fs.root) + size int64 // size of the object (on server, after encryption) + originalSize *int64 // size of the object (after decryption) + digests *string // object original content + blockSizes []int64 // the block sizes of the encrypted file + modTime time.Time // modification time of the object + createdTime time.Time // creation time of the object + id string // ID of the object + mimetype string // mimetype of the file + + link *proton.Link // link data on proton server +} + +// shouldRetry returns a boolean as to whether this err deserves to be +// retried. It returns the err as a convenience +func shouldRetry(ctx context.Context, err error) (bool, error) { + return false, err +} + +//------------------------------------------------------------------------------ + +// Name of the remote (as passed into NewFs) +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return f.root +} + +// String converts this Fs to a string +func (f *Fs) String() string { + return fmt.Sprintf("proton drive root link ID '%s'", f.root) +} + +// Features returns the optional features of this Fs +func (f *Fs) Features() *fs.Features { + return f.features +} + +// run all the dir/remote through this +func (f *Fs) sanitizePath(_path string) string { + _path = path.Clean(_path) + if _path == "." || _path == "/" { + return "" + } + + return f.opt.Enc.FromStandardPath(_path) +} + +func getConfigMap(m configmap.Mapper) (uid, accessToken, refreshToken, saltedKeyPass string, ok bool) { + if accessToken, ok = m.Get(clientAccessTokenKey); !ok { + return + } + + if uid, ok = m.Get(clientUIDKey); !ok { + return + } + + if refreshToken, ok = m.Get(clientRefreshTokenKey); !ok { + return + } + + if saltedKeyPass, ok = m.Get(clientSaltedKeyPassKey); !ok { + return + } + _saltedKeyPass = saltedKeyPass + + return +} + +func setConfigMap(m configmap.Mapper, uid, accessToken, refreshToken, saltedKeyPass string) { + m.Set(clientUIDKey, uid) + m.Set(clientAccessTokenKey, accessToken) + m.Set(clientRefreshTokenKey, refreshToken) + m.Set(clientSaltedKeyPassKey, saltedKeyPass) + _saltedKeyPass = saltedKeyPass +} + +func clearConfigMap(m configmap.Mapper) { + setConfigMap(m, "", "", "", "") + _saltedKeyPass = "" +} + +func authHandler(auth proton.Auth) { + // fs.Debugf("authHandler called") + setConfigMap(_mapper, auth.UID, auth.AccessToken, auth.RefreshToken, _saltedKeyPass) +} + +func deAuthHandler() { + // fs.Debugf("deAuthHandler called") + clearConfigMap(_mapper) +} + +func newProtonDrive(ctx context.Context, f *Fs, opt *Options, m configmap.Mapper) (*protonDriveAPI.ProtonDrive, error) { + config := protonDriveAPI.NewDefaultConfig() + config.AppVersion = opt.AppVersion + config.UserAgent = f.ci.UserAgent // opt.UserAgent + + config.ReplaceExistingDraft = opt.ReplaceExistingDraft + config.EnableCaching = opt.EnableCaching + + // let's see if we have the cached access credential + uid, accessToken, refreshToken, saltedKeyPass, hasUseReusableLoginCredentials := getConfigMap(m) + _saltedKeyPass = saltedKeyPass + + if hasUseReusableLoginCredentials { + fs.Debugf(f, "Has cached credentials") + config.UseReusableLogin = true + + config.ReusableCredential.UID = uid + config.ReusableCredential.AccessToken = accessToken + config.ReusableCredential.RefreshToken = refreshToken + config.ReusableCredential.SaltedKeyPass = saltedKeyPass + + protonDrive /* credential will be nil since access credentials are passed in */, _, err := protonDriveAPI.NewProtonDrive(ctx, config, authHandler, deAuthHandler) + if err != nil { + fs.Debugf(f, "Cached credential doesn't work, clearing and using the fallback login method") + // clear the access token on failure + clearConfigMap(m) + + fs.Debugf(f, "couldn't initialize a new proton drive instance using cached credentials: %v", err) + // we fallback to username+password login -> don't throw an error here + // return nil, fmt.Errorf("couldn't initialize a new proton drive instance: %w", err) + } else { + fs.Debugf(f, "Used cached credential to initialize the ProtonDrive API") + return protonDrive, nil + } + } + + // if not, let's try to log the user in using username and password (and 2FA if required) + fs.Debugf(f, "Using username and password to log in") + config.UseReusableLogin = false + config.FirstLoginCredential.Username = opt.Username + config.FirstLoginCredential.Password = opt.Password + config.FirstLoginCredential.MailboxPassword = opt.MailboxPassword + config.FirstLoginCredential.TwoFA = opt.TwoFA + protonDrive, auth, err := protonDriveAPI.NewProtonDrive(ctx, config, authHandler, deAuthHandler) + if err != nil { + return nil, fmt.Errorf("couldn't initialize a new proton drive instance: %w", err) + } + + fs.Debugf(f, "Used username and password to initialize the ProtonDrive API") + setConfigMap(m, auth.UID, auth.AccessToken, auth.RefreshToken, auth.SaltedKeyPass) + + return protonDrive, nil +} + +// NewFs constructs an Fs from the path, container:path +func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { + // pacer is not used in NewFs() + _mapper = m + + // Parse config into Options struct + opt := new(Options) + err := configstruct.Set(m, opt) + if err != nil { + return nil, err + } + if opt.Password != "" { + var err error + opt.Password, err = obscure.Reveal(opt.Password) + if err != nil { + return nil, fmt.Errorf("couldn't decrypt password: %w", err) + } + } + + if opt.MailboxPassword != "" { + var err error + opt.MailboxPassword, err = obscure.Reveal(opt.MailboxPassword) + if err != nil { + return nil, fmt.Errorf("couldn't decrypt mailbox password: %w", err) + } + } + + ci := fs.GetConfig(ctx) + + root = strings.Trim(root, "/") + + f := &Fs{ + name: name, + root: root, + opt: *opt, + ci: ci, + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + } + + f.features = (&fs.Features{ + ReadMimeType: true, + CanHaveEmptyDirectories: true, + /* can't have multiple threads downloading + The raw file is split into equally-sized (currently 4MB, but it might change in the future, say to 8MB, 16MB, etc.) blocks, except the last one which might be smaller than 4MB. + Each block is encrypted separately, where the size and sha1 after the encryption is performed on the block is added to the metadata of the block, but the original block size and sha1 is not in the metadata. + We can make assumption and implement the chunker, but for now, we would rather be safe about it, and let the block being concurrently downloaded and decrypted in the background, to speed up the download operation! + */ + NoMultiThreading: true, + }).Fill(ctx, f) + + protonDrive, err := newProtonDrive(ctx, f, opt, m) + if err != nil { + return nil, err + } + f.protonDrive = protonDrive + + root = f.sanitizePath(root) + f.dirCache = dircache.New( + root, /* root folder path */ + protonDrive.MainShare.LinkID, /* real root ID is the root folder, since we can't go past this folder */ + f, + ) + err = f.dirCache.FindRoot(ctx, false) + if err != nil { + // if the root directory is not found, the initialization will still work + // but if it's other kinds of error, then we raise it + if err != fs.ErrorDirNotFound { + return nil, fmt.Errorf("couldn't initialize a new root remote: %w", err) + } + + // Assume it is a file (taken and modified from box.go) + newRoot, remote := dircache.SplitPath(root) + tempF := *f + tempF.dirCache = dircache.New(newRoot, protonDrive.MainShare.LinkID, &tempF) + tempF.root = newRoot + // Make new Fs which is the parent + err = tempF.dirCache.FindRoot(ctx, false) + if err != nil { + // No root so return old f + return f, nil + } + _, err := tempF.newObjectWithLink(ctx, remote, nil) + if err != nil { + if err == fs.ErrorObjectNotFound { + // File doesn't exist so return old f + return f, nil + } + return nil, err + } + f.features.Fill(ctx, &tempF) + // XXX: update the old f here instead of returning tempF, since + // `features` were already filled with functions having *f as a receiver. + // See https://github.com/rclone/rclone/issues/2182 + f.dirCache = tempF.dirCache + f.root = tempF.root + // return an error with an fs which points to the parent + return f, fs.ErrorIsFile + } + + return f, nil +} + +//------------------------------------------------------------------------------ + +// CleanUp deletes all files currently in trash +func (f *Fs) CleanUp(ctx context.Context) error { + return f.pacer.Call(func() (bool, error) { + err := f.protonDrive.EmptyTrash(ctx) + return shouldRetry(ctx, err) + }) +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error ErrorObjectNotFound. +// +// If remote points to a directory then it should return +// ErrorIsDir if possible without doing any extra work, +// otherwise ErrorObjectNotFound. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + return f.newObjectWithLink(ctx, remote, nil) +} + +func (f *Fs) getObjectLink(ctx context.Context, remote string) (*proton.Link, error) { + // attempt to locate the file + leaf, folderLinkID, err := f.dirCache.FindPath(ctx, f.sanitizePath(remote), false) + if err != nil { + if err == fs.ErrorDirNotFound { + // parent folder of the file not found, we for sure can't find the file + return nil, fs.ErrorObjectNotFound + } + // other error has occurred + return nil, err + } + + var link *proton.Link + if err = f.pacer.Call(func() (bool, error) { + link, err = f.protonDrive.SearchByNameInActiveFolderByID(ctx, folderLinkID, leaf, true, false, proton.LinkStateActive) + return shouldRetry(ctx, err) + }); err != nil { + return nil, err + } + if link == nil { // both link and err are nil, file not found + return nil, fs.ErrorObjectNotFound + } + + return link, nil +} + +// readMetaDataForRemote reads the metadata from the remote +func (f *Fs) readMetaDataForRemote(ctx context.Context, remote string, _link *proton.Link) (*proton.Link, *protonDriveAPI.FileSystemAttrs, error) { + link, err := f.getObjectLink(ctx, remote) + if err != nil { + return nil, nil, err + } + + var fileSystemAttrs *protonDriveAPI.FileSystemAttrs + if err = f.pacer.Call(func() (bool, error) { + fileSystemAttrs, err = f.protonDrive.GetActiveRevisionAttrs(ctx, link) + return shouldRetry(ctx, err) + }); err != nil { + return nil, nil, err + } + + return link, fileSystemAttrs, nil +} + +// readMetaData gets the metadata if it hasn't already been fetched +// +// it also sets the info +func (o *Object) readMetaData(ctx context.Context, link *proton.Link) (err error) { + if o.link != nil { + return nil + } + + link, fileSystemAttrs, err := o.fs.readMetaDataForRemote(ctx, o.remote, link) + if err != nil { + return err + } + + o.id = link.LinkID + o.size = link.Size + o.modTime = time.Unix(link.ModifyTime, 0) + o.createdTime = time.Unix(link.CreateTime, 0) + o.mimetype = link.MIMEType + o.link = link + + if fileSystemAttrs != nil { + o.modTime = fileSystemAttrs.ModificationTime + o.originalSize = &fileSystemAttrs.Size + o.blockSizes = fileSystemAttrs.BlockSizes + o.digests = &fileSystemAttrs.Digests + } + + return nil +} + +// Return an Object from a path +// +// If it can't be found it returns the error fs.ErrorObjectNotFound. +func (f *Fs) newObjectWithLink(ctx context.Context, remote string, link *proton.Link) (fs.Object, error) { + o := &Object{ + fs: f, + remote: remote, + } + + err := o.readMetaData(ctx, link) + if err != nil { + return nil, err + } + return o, nil +} + +// List the objects and directories in dir into entries. The +// entries can be returned in any order but should be for a +// complete directory. +// +// dir should be "" to list the root, and should not have +// trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +// Notice that this function is expensive since everything on proton is encrypted +// So having a remote with 10k files, during operations like sync, might take a while and lots of bandwidth! +func (f *Fs) List(ctx context.Context, dir string) (fs.DirEntries, error) { + folderLinkID, err := f.dirCache.FindDir(ctx, f.sanitizePath(dir), false) // will handle ErrDirNotFound here + if err != nil { + return nil, err + } + + var foldersAndFiles []*protonDriveAPI.ProtonDirectoryData + if err = f.pacer.Call(func() (bool, error) { + foldersAndFiles, err = f.protonDrive.ListDirectory(ctx, folderLinkID) + return shouldRetry(ctx, err) + }); err != nil { + return nil, err + } + + entries := make(fs.DirEntries, 0) + for i := range foldersAndFiles { + remote := path.Join(dir, f.opt.Enc.ToStandardName(foldersAndFiles[i].Name)) + + if foldersAndFiles[i].IsFolder { + f.dirCache.Put(remote, foldersAndFiles[i].Link.LinkID) + d := fs.NewDir(remote, time.Unix(foldersAndFiles[i].Link.ModifyTime, 0)).SetID(foldersAndFiles[i].Link.LinkID) + entries = append(entries, d) + } else { + obj, err := f.newObjectWithLink(ctx, remote, foldersAndFiles[i].Link) + if err != nil { + return nil, err + } + entries = append(entries, obj) + } + } + + return entries, nil +} + +// FindLeaf finds a directory of name leaf in the folder with ID pathID +// +// This should be implemented by the backend and will be called by the +// dircache package when appropriate. +func (f *Fs) FindLeaf(ctx context.Context, pathID, leaf string) (string, bool, error) { + /* f.opt.Enc.FromStandardName(leaf) not required since the DirCache only process sanitized path */ + + var link *proton.Link + var err error + if err = f.pacer.Call(func() (bool, error) { + link, err = f.protonDrive.SearchByNameInActiveFolderByID(ctx, pathID, leaf, false, true, proton.LinkStateActive) + return shouldRetry(ctx, err) + }); err != nil { + return "", false, err + } + if link == nil { + return "", false, nil + } + + return link.LinkID, true, nil +} + +// CreateDir makes a directory with pathID as parent and name leaf +// +// This should be implemented by the backend and will be called by the +// dircache package when appropriate. +func (f *Fs) CreateDir(ctx context.Context, pathID, leaf string) (string, error) { + /* f.opt.Enc.FromStandardName(leaf) not required since the DirCache only process sanitized path */ + + var newID string + var err error + if err = f.pacer.Call(func() (bool, error) { + newID, err = f.protonDrive.CreateNewFolderByID(ctx, pathID, leaf) + return shouldRetry(ctx, err) + }); err != nil { + return "", err + } + + return newID, err +} + +// Put in to the remote path with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Put should either +// return an error or upload it properly (rather than e.g. calling panic). +// +// May create the object even if it returns an error - if so +// will return the object and the error, otherwise will return +// nil and the error +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + size := src.Size() + if size < 0 { + return nil, errCanNotUploadFileWithUnknownSize + } + + existingObj, err := f.NewObject(ctx, src.Remote()) + switch err { + case nil: + // object is found, we add an revision to it + return existingObj, existingObj.Update(ctx, in, src, options...) + case fs.ErrorObjectNotFound: + // object not found, so we need to create it + remote := src.Remote() + size := src.Size() + modTime := src.ModTime(ctx) + + obj, err := f.createObject(ctx, remote, modTime, size) + if err != nil { + return nil, err + } + return obj, obj.Update(ctx, in, src, options...) + default: + // real error caught + return nil, err + } +} + +// Creates from the parameters passed in a half finished Object which +// must have setMetaData called on it +// +// Returns the object, leaf, directoryID and error. +// +// Used to create new objects +func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (*Object, error) { + // ˇ-------ˇ filename + // e.g. /root/a/b/c/test.txt + // ^~~~~~~~~~~^ dirPath + + // Create the directory for the object if it doesn't exist + _, _, err := f.dirCache.FindPath(ctx, f.sanitizePath(remote), true) + if err != nil { + return nil, err + } + + // Temporary Object under construction + obj := &Object{ + fs: f, + remote: remote, + size: size, + originalSize: nil, + id: "", + modTime: modTime, + mimetype: "", + link: nil, + } + return obj, nil +} + +// Mkdir makes the directory (container, bucket) +// +// Shouldn't return an error if it already exists +func (f *Fs) Mkdir(ctx context.Context, dir string) error { + _, err := f.dirCache.FindDir(ctx, f.sanitizePath(dir), true) + return err +} + +// Rmdir removes the directory (container, bucket) if empty +// +// Return an error if it doesn't exist or isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) error { + folderLinkID, err := f.dirCache.FindDir(ctx, f.sanitizePath(dir), false) + if err == fs.ErrorDirNotFound { + return fmt.Errorf("[Rmdir] cannot find LinkID for dir %s (%s)", dir, f.sanitizePath(dir)) + } else if err != nil { + return err + } + + if err = f.pacer.Call(func() (bool, error) { + err = f.protonDrive.MoveFolderToTrashByID(ctx, folderLinkID, true) + return shouldRetry(ctx, err) + }); err != nil { + return err + } + + f.dirCache.FlushDir(f.sanitizePath(dir)) + return nil +} + +// Precision of the ModTimes in this Fs +func (f *Fs) Precision() time.Duration { + return time.Second +} + +// DirCacheFlush an optional interface to flush internal directory cache +// DirCacheFlush resets the directory cache - used in testing +// as an optional interface +func (f *Fs) DirCacheFlush() { + f.dirCache.ResetRoot() + f.protonDrive.ClearCache() +} + +// Hashes returns the supported hash types of the filesystem +func (f *Fs) Hashes() hash.Set { + return hash.Set(hash.SHA1) +} + +// About gets quota information +func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { + var user *proton.User + var err error + if err = f.pacer.Call(func() (bool, error) { + user, err = f.protonDrive.About(ctx) + return shouldRetry(ctx, err) + }); err != nil { + return nil, err + } + + total := user.MaxSpace + used := user.UsedSpace + free := total - used + + usage := &fs.Usage{ + Total: &total, + Used: &used, + Free: &free, + } + + return usage, nil +} + +// ------------------------------------------------------------ + +// Fs returns the parent Fs +func (o *Object) Fs() fs.Info { + return o.fs +} + +// Return a string version +func (o *Object) String() string { + if o == nil { + return "" + } + return o.remote +} + +// Remote returns the remote path +func (o *Object) Remote() string { + return o.remote +} + +// Hash returns the hashes of an object +func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { + if t != hash.SHA1 { + return "", hash.ErrUnsupported + } + + if o.digests != nil { + return *o.digests, nil + } + + // sha1 not cached: we fetch and try to obtain the sha1 of the link + fileSystemAttrs, err := o.fs.protonDrive.GetActiveRevisionAttrsByID(ctx, o.ID()) + if err != nil { + return "", err + } + + if fileSystemAttrs == nil || fileSystemAttrs.Digests == "" { + fs.Debugf(o, "file sha1 digest missing") + return "", nil + } + return fileSystemAttrs.Digests, nil +} + +// Size returns the size of an object in bytes +func (o *Object) Size() int64 { + if o.fs.opt.ReportOriginalSize { + // if ReportOriginalSize is set, we will generate an error when the original size failed to be parsed + // this is crucial as features like Open() will need to use the proper size to operate the seek/range operator + if o.originalSize != nil { + return *o.originalSize + } + + fs.Debugf(o, "Original file size missing") + } + return o.size +} + +// ModTime returns the modification time of the object +// +// It attempts to read the objects mtime and if that isn't present the +// LastModified returned in the http headers +func (o *Object) ModTime(ctx context.Context) time.Time { + return o.modTime +} + +// SetModTime sets the modification time of the local fs object +func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { + return fs.ErrorCantSetModTime +} + +// Storable returns a boolean showing whether this object storable +func (o *Object) Storable() bool { + return true +} + +// Open opens the file for read. Call Close() on the returned io.ReadCloser +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + fs.FixRangeOption(options, *o.originalSize) + var offset, limit int64 = 0, -1 + for _, option := range options { // if the caller passes in nil for options, it will become array of nil + switch x := option.(type) { + case *fs.SeekOption: + offset = x.Offset + case *fs.RangeOption: + offset, limit = x.Decode(o.Size()) + default: + if option.Mandatory() { + fs.Logf(o, "Unsupported mandatory option: %v", option) + } + } + } + + // download and decrypt the file + var reader io.ReadCloser + var fileSystemAttrs *protonDriveAPI.FileSystemAttrs + var sizeOnServer int64 + var err error + if err = o.fs.pacer.Call(func() (bool, error) { + reader, sizeOnServer, fileSystemAttrs, err = o.fs.protonDrive.DownloadFileByID(ctx, o.id, offset) + return shouldRetry(ctx, err) + }); err != nil { + return nil, err + } + + if fileSystemAttrs != nil { + o.originalSize = &fileSystemAttrs.Size + o.modTime = fileSystemAttrs.ModificationTime + o.digests = &fileSystemAttrs.Digests + o.blockSizes = fileSystemAttrs.BlockSizes + } else { + fs.Debugf(o, "fileSystemAttrs is nil: using fallback size, and now digests and blocksizes available") + o.originalSize = &sizeOnServer + o.size = sizeOnServer + o.digests = nil + o.blockSizes = nil + } + + retReader := io.NopCloser(reader) // the NewLimitedReadCloser will deal with the limit + + // deal with limit + return readers.NewLimitedReadCloser(retReader, limit), nil +} + +// Update in to the object with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either +// return an error or update the object properly (rather than e.g. calling panic). +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { + size := src.Size() + if size < 0 { + return errCanNotUploadFileWithUnknownSize + } + + remote := o.Remote() + leaf, folderLinkID, err := o.fs.dirCache.FindPath(ctx, o.fs.sanitizePath(remote), true) + if err != nil { + return err + } + + modTime := src.ModTime(ctx) + var linkID string + var fileSystemAttrs *proton.RevisionXAttrCommon + if err = o.fs.pacer.Call(func() (bool, error) { + linkID, fileSystemAttrs, err = o.fs.protonDrive.UploadFileByReader(ctx, folderLinkID, leaf, modTime, in, 0) + return shouldRetry(ctx, err) + }); err != nil { + return err + } + + var sha1Hash string + if val, ok := fileSystemAttrs.Digests["SHA1"]; ok { + sha1Hash = val + } else { + sha1Hash = "" + } + + o.id = linkID + o.originalSize = &fileSystemAttrs.Size + o.modTime = modTime + o.blockSizes = fileSystemAttrs.BlockSizes + o.digests = &sha1Hash + + return nil +} + +// Remove an object +func (o *Object) Remove(ctx context.Context) error { + return o.fs.pacer.Call(func() (bool, error) { + err := o.fs.protonDrive.MoveFileToTrashByID(ctx, o.id) + return shouldRetry(ctx, err) + }) +} + +// ID returns the ID of the Object if known, or "" if not +func (o *Object) ID() string { + return o.id +} + +// Purge all files in the directory specified +// +// Implement this if you have a way of deleting all the files +// quicker than just running Remove() on the result of List() +// +// Return an error if it doesn't exist +func (f *Fs) Purge(ctx context.Context, dir string) error { + root := path.Join(f.root, dir) + if root == "" { + // we can't remove the root directory, but we can list the directory and delete every folder and file in here + return errCanNotPurgeRootDirectory + } + + folderLinkID, err := f.dirCache.FindDir(ctx, f.sanitizePath(dir), false) + if err != nil { + return err + } + + if err = f.pacer.Call(func() (bool, error) { + err = f.protonDrive.MoveFolderToTrashByID(ctx, folderLinkID, false) + return shouldRetry(ctx, err) + }); err != nil { + return err + } + + f.dirCache.FlushDir(dir) + return nil +} + +// MimeType of an Object if known, "" otherwise +func (o *Object) MimeType(ctx context.Context) string { + return o.mimetype +} + +// Disconnect the current user +func (f *Fs) Disconnect(ctx context.Context) error { + return f.pacer.Call(func() (bool, error) { + err := f.protonDrive.Logout(ctx) + return shouldRetry(ctx, err) + }) +} + +// Move src to this remote using server-side move operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantMove +func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't move - not same remote type") + return nil, fs.ErrorCantMove + } + + // check if the remote (dst) exists + _, err := f.NewObject(ctx, remote) + if err != nil { + if err != fs.ErrorObjectNotFound { + return nil, err + } + // object is indeed not found + } else { + // object at the dst exists + return nil, fs.ErrorCantMove + } + + // attempt the move + dstLeaf, dstDirectoryID, err := f.dirCache.FindPath(ctx, f.sanitizePath(remote), true) + if err != nil { + return nil, err + } + if err = f.pacer.Call(func() (bool, error) { + err = f.protonDrive.MoveFileByID(ctx, srcObj.id, dstDirectoryID, dstLeaf) + return shouldRetry(ctx, err) + }); err != nil { + return nil, err + } + + f.dirCache.FlushDir(f.sanitizePath(src.Remote())) + + return f.NewObject(ctx, remote) +} + +// DirMove moves src, srcRemote to this remote at dstRemote +// using server-side move operations. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantDirMove +// +// If destination exists then return fs.ErrorDirExists +func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error { + srcFs, ok := src.(*Fs) + if !ok { + fs.Debugf(srcFs, "Can't move directory - not same remote type") + return fs.ErrorCantDirMove + } + + srcID, _, _, dstDirectoryID, dstLeaf, err := f.dirCache.DirMove(ctx, srcFs.dirCache, f.sanitizePath(srcFs.root), f.sanitizePath(srcRemote), f.sanitizePath(f.root), f.sanitizePath(dstRemote)) + if err != nil { + return err + } + + if err = f.pacer.Call(func() (bool, error) { + err = f.protonDrive.MoveFolderByID(ctx, srcID, dstDirectoryID, dstLeaf) + return shouldRetry(ctx, err) + }); err != nil { + return err + } + + srcFs.dirCache.FlushDir(f.sanitizePath(srcRemote)) + + return nil +} + +// Check the interfaces are satisfied +var ( + _ fs.Fs = (*Fs)(nil) + _ fs.Mover = (*Fs)(nil) + _ fs.DirMover = (*Fs)(nil) + _ fs.DirCacheFlusher = (*Fs)(nil) + _ fs.Abouter = (*Fs)(nil) + _ fs.Object = (*Object)(nil) + _ fs.MimeTyper = (*Object)(nil) + _ fs.IDer = (*Object)(nil) +) diff --git a/backend/protondrive/protondrive_test.go b/backend/protondrive/protondrive_test.go new file mode 100644 index 0000000000000..86aa0c0750115 --- /dev/null +++ b/backend/protondrive/protondrive_test.go @@ -0,0 +1,16 @@ +package protondrive_test + +import ( + "testing" + + "github.com/rclone/rclone/backend/protondrive" + "github.com/rclone/rclone/fstest/fstests" +) + +// TestIntegration runs integration tests against the remote +func TestIntegration(t *testing.T) { + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestProtonDrive:", + NilObject: (*protondrive.Object)(nil), + }) +} diff --git a/backend/putio/fs.go b/backend/putio/fs.go index cbcda547f7475..cc21cac00b912 100644 --- a/backend/putio/fs.go +++ b/backend/putio/fs.go @@ -23,6 +23,7 @@ import ( "github.com/rclone/rclone/lib/dircache" "github.com/rclone/rclone/lib/oauthutil" "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/random" "github.com/rclone/rclone/lib/readers" ) @@ -252,9 +253,12 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // This will create a duplicate if we upload a new file without // checking to see if there is one already - use Put() for that. func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (o fs.Object, err error) { + return f.putUnchecked(ctx, in, src, src.Remote(), options...) +} + +func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, remote string, options ...fs.OpenOption) (o fs.Object, err error) { // defer log.Trace(f, "src=%+v", src)("o=%+v, err=%v", &o, &err) size := src.Size() - remote := src.Remote() leaf, directoryID, err := f.dirCache.FindPath(ctx, remote, true) if err != nil { return nil, err @@ -540,24 +544,59 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (o fs.Objec if err != nil { return nil, err } + modTime := src.ModTime(ctx) + var resp struct { + File putio.File `json:"file"` + } + // For some unknown reason the API sometimes returns the name + // already exists unless we upload to a temporary name and + // rename + // + // {"error_id":null,"error_message":"Name already exist","error_type":"NAME_ALREADY_EXIST","error_uri":"http://api.put.io/v2/docs","extra":{},"status":"ERROR","status_code":400} + suffix := "." + random.String(8) err = f.pacer.Call(func() (bool, error) { params := url.Values{} params.Set("file_id", strconv.FormatInt(srcObj.file.ID, 10)) params.Set("parent_id", directoryID) - params.Set("name", f.opt.Enc.FromStandardName(leaf)) + params.Set("name", f.opt.Enc.FromStandardName(leaf+suffix)) + req, err := f.client.NewRequest(ctx, "POST", "/v2/files/copy", strings.NewReader(params.Encode())) if err != nil { return false, err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") // fs.Debugf(f, "copying file (%d) to parent_id: %s", srcObj.file.ID, directoryID) - _, err = f.client.Do(req, nil) + _, err = f.client.Do(req, &resp) return shouldRetry(ctx, err) }) if err != nil { return nil, err } - return f.NewObject(ctx, remote) + err = f.pacer.Call(func() (bool, error) { + params := url.Values{} + params.Set("file_id", strconv.FormatInt(resp.File.ID, 10)) + params.Set("name", f.opt.Enc.FromStandardName(leaf)) + + req, err := f.client.NewRequest(ctx, "POST", "/v2/files/rename", strings.NewReader(params.Encode())) + if err != nil { + return false, err + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + _, err = f.client.Do(req, &resp) + return shouldRetry(ctx, err) + }) + if err != nil { + return nil, err + } + o, err = f.newObjectWithInfo(ctx, remote, resp.File) + if err != nil { + return nil, err + } + err = o.SetModTime(ctx, modTime) + if err != nil { + return nil, err + } + return o, nil } // Move src to this remote using server-side move operations. @@ -579,6 +618,7 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (o fs.Objec if err != nil { return nil, err } + modTime := src.ModTime(ctx) err = f.pacer.Call(func() (bool, error) { params := url.Values{} params.Set("file_id", strconv.FormatInt(srcObj.file.ID, 10)) @@ -596,7 +636,15 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (o fs.Objec if err != nil { return nil, err } - return f.NewObject(ctx, remote) + o, err = f.NewObject(ctx, remote) + if err != nil { + return nil, err + } + err = o.SetModTime(ctx, modTime) + if err != nil { + return nil, err + } + return o, nil } // DirMove moves src, srcRemote to this remote at dstRemote diff --git a/backend/putio/object.go b/backend/putio/object.go index bd03982caf7c8..86edb008febc2 100644 --- a/backend/putio/object.go +++ b/backend/putio/object.go @@ -275,7 +275,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if err != nil { return err } - newObj, err := o.fs.PutUnchecked(ctx, in, src, options...) + newObj, err := o.fs.putUnchecked(ctx, in, src, o.remote, options...) if err != nil { return err } diff --git a/backend/putio/putio.go b/backend/putio/putio.go index 6923641666d46..a12be5f9b6906 100644 --- a/backend/putio/putio.go +++ b/backend/putio/putio.go @@ -67,7 +67,7 @@ func init() { NoOffline: true, }) }, - Options: []fs.Option{{ + Options: append(oauthutil.SharedOptions, []fs.Option{{ Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, Advanced: true, @@ -77,7 +77,7 @@ func init() { Default: (encoder.Display | encoder.EncodeBackSlash | encoder.EncodeInvalidUtf8), - }}, + }}...), }) } diff --git a/backend/qingstor/qingstor.go b/backend/qingstor/qingstor.go index a3d0bd639341d..9f3a2a0164fbb 100644 --- a/backend/qingstor/qingstor.go +++ b/backend/qingstor/qingstor.go @@ -49,11 +49,13 @@ func init() { Help: "Get QingStor credentials from the environment (env vars or IAM).", }}, }, { - Name: "access_key_id", - Help: "QingStor Access Key ID.\n\nLeave blank for anonymous access or runtime credentials.", + Name: "access_key_id", + Help: "QingStor Access Key ID.\n\nLeave blank for anonymous access or runtime credentials.", + Sensitive: true, }, { - Name: "secret_access_key", - Help: "QingStor Secret Access Key (password).\n\nLeave blank for anonymous access or runtime credentials.", + Name: "secret_access_key", + Help: "QingStor Secret Access Key (password).\n\nLeave blank for anonymous access or runtime credentials.", + Sensitive: true, }, { Name: "endpoint", Help: "Enter an endpoint URL to connection QingStor API.\n\nLeave blank will use the default value \"https://qingstor.com:443\".", diff --git a/backend/quatrix/api/types.go b/backend/quatrix/api/types.go new file mode 100644 index 0000000000000..0a55f5e60883a --- /dev/null +++ b/backend/quatrix/api/types.go @@ -0,0 +1,182 @@ +// Package api provides types used by the Quatrix API. +package api + +import ( + "strconv" + "time" +) + +// OverwriteMode is a conflict resolve mode during copy or move. Files with conflicting names will be overwritten +const OverwriteMode = "overwrite" + +// ProfileInfo is a profile info about quota +type ProfileInfo struct { + UserUsed int64 `json:"user_used"` + UserLimit int64 `json:"user_limit"` + AccUsed int64 `json:"acc_used"` + AccLimit int64 `json:"acc_limit"` +} + +// IDList is a general object that contains list of ids +type IDList struct { + IDs []string `json:"ids"` +} + +// DeleteParams is the request to delete object +type DeleteParams struct { + IDs []string `json:"ids"` + DeletePermanently bool `json:"delete_permanently"` +} + +// FileInfoParams is the request to get object's (file or directory) info +type FileInfoParams struct { + ParentID string `json:"parent_id,omitempty"` + Path string `json:"path"` +} + +// FileInfo is the response to get object's (file or directory) info +type FileInfo struct { + FileID string `json:"file_id"` + ParentID string `json:"parent_id"` + Src string `json:"src"` + Type string `json:"type"` +} + +// IsFile returns true if object is a file +// false otherwise +func (fi *FileInfo) IsFile() bool { + if fi == nil { + return false + } + + return fi.Type == "F" +} + +// IsDir returns true if object is a directory +// false otherwise +func (fi *FileInfo) IsDir() bool { + if fi == nil { + return false + } + + return fi.Type == "D" || fi.Type == "S" || fi.Type == "T" +} + +// CreateDirParams is the request to create a directory +type CreateDirParams struct { + Target string `json:"target,omitempty"` + Name string `json:"name"` + Resolve bool `json:"resolve"` +} + +// File represent metadata about object in Quatrix (file or directory) +type File struct { + ID string `json:"id"` + Created JSONTime `json:"created"` + Modified JSONTime `json:"modified"` + Name string `json:"name"` + ParentID string `json:"parent_id"` + Size int64 `json:"size"` + ModifiedMS JSONTime `json:"modified_ms"` + Type string `json:"type"` + Operations int `json:"operations"` + SubType string `json:"sub_type"` + Content []File `json:"content"` +} + +// IsFile returns true if object is a file +// false otherwise +func (f *File) IsFile() bool { + if f == nil { + return false + } + + return f.Type == "F" +} + +// IsDir returns true if object is a directory +// false otherwise +func (f *File) IsDir() bool { + if f == nil { + return false + } + + return f.Type == "D" || f.Type == "S" || f.Type == "T" +} + +// SetMTimeParams is the request to set modification time for object +type SetMTimeParams struct { + ID string `json:"id,omitempty"` + MTime JSONTime `json:"mtime"` +} + +// JSONTime provides methods to marshal/unmarshal time.Time as Unix time +type JSONTime time.Time + +// MarshalJSON returns time representation in Unix time +func (u JSONTime) MarshalJSON() ([]byte, error) { + return []byte(strconv.FormatFloat(float64(time.Time(u).UTC().UnixNano())/1e9, 'f', 6, 64)), nil +} + +// UnmarshalJSON sets time from Unix time representation +func (u *JSONTime) UnmarshalJSON(data []byte) error { + f, err := strconv.ParseFloat(string(data), 64) + if err != nil { + return err + } + + t := JSONTime(time.Unix(0, int64(f*1e9))) + *u = t + + return nil +} + +// String returns Unix time representation of time as string +func (u JSONTime) String() string { + return strconv.FormatInt(time.Time(u).UTC().Unix(), 10) +} + +// DownloadLinkResponse is the response to download-link request +type DownloadLinkResponse struct { + ID string `json:"id"` +} + +// UploadLinkParams is the request to get upload-link +type UploadLinkParams struct { + Name string `json:"name"` + ParentID string `json:"parent_id"` + Resolve bool `json:"resolve"` +} + +// UploadLinkResponse is the response to upload-link request +type UploadLinkResponse struct { + Name string `json:"name"` + FileID string `json:"file_id"` + ParentID string `json:"parent_id"` + UploadKey string `json:"upload_key"` +} + +// UploadFinalizeResponse is the response to finalize file method +type UploadFinalizeResponse struct { + FileID string `json:"id"` + ParentID string `json:"parent_id"` + Modified int64 `json:"modified"` + FileSize int64 `json:"size"` +} + +// FileModifyParams is the request to get modify file link +type FileModifyParams struct { + ID string `json:"id"` + Truncate int64 `json:"truncate"` +} + +// FileCopyMoveOneParams is the request to do server-side copy and move +// can be used for file or directory +type FileCopyMoveOneParams struct { + ID string `json:"file_id"` + Target string `json:"target_id"` + Name string `json:"name"` + MTime JSONTime `json:"mtime"` + Resolve bool `json:"resolve"` + ResolveMode string `json:"resolve_mode"` +} diff --git a/backend/quatrix/quatrix.go b/backend/quatrix/quatrix.go new file mode 100644 index 0000000000000..dab1f5f7763a3 --- /dev/null +++ b/backend/quatrix/quatrix.go @@ -0,0 +1,1256 @@ +// Package quatrix provides an interface to the Quatrix by Maytech +// object storage system. +package quatrix + +// FIXME Quatrix only supports file names of 255 characters or less. Names +// that will not be supported are those that contain non-printable +// ascii, / or \, names with trailing spaces, and the special names +// “.” and “..”. + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strconv" + "strings" + "time" + + "github.com/rclone/rclone/backend/quatrix/api" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/fserrors" + "github.com/rclone/rclone/fs/fshttp" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/dircache" + "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/multipart" + "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/rest" +) + +const ( + minSleep = 10 * time.Millisecond + maxSleep = 2 * time.Second + decayConstant = 2 // bigger for slower decay, exponential + rootURL = "https://%s/api/1.0/" + uploadURL = "https://%s/upload/chunked/" + + unlimitedUserQuota = -1 +) + +func init() { + fs.Register(&fs.RegInfo{ + Name: "quatrix", + Description: "Quatrix by Maytech", + NewFs: NewFs, + Options: fs.Options{ + { + Name: "api_key", + Help: "API key for accessing Quatrix account", + Required: true, + Sensitive: true, + }, + { + Name: "host", + Help: "Host name of Quatrix account", + Required: true, + }, + { + Name: config.ConfigEncoding, + Help: config.ConfigEncodingHelp, + Advanced: true, + Default: encoder.Standard | + encoder.EncodeBackSlash | + encoder.EncodeInvalidUtf8, + }, + { + Name: "effective_upload_time", + Help: "Wanted upload time for one chunk", + Advanced: true, + Default: "4s", + }, + { + Name: "minimal_chunk_size", + Help: "The minimal size for one chunk", + Advanced: true, + Default: fs.SizeSuffix(10_000_000), + }, + { + Name: "maximal_summary_chunk_size", + Help: "The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size'", + Advanced: true, + Default: fs.SizeSuffix(100_000_000), + }, + { + Name: "hard_delete", + Help: "Delete files permanently rather than putting them into the trash.", + Advanced: true, + Default: false, + }, + }, + }) +} + +// Options defines the configuration for Quatrix backend +type Options struct { + APIKey string `config:"api_key"` + Host string `config:"host"` + Enc encoder.MultiEncoder `config:"encoding"` + EffectiveUploadTime fs.Duration `config:"effective_upload_time"` + MinimalChunkSize fs.SizeSuffix `config:"minimal_chunk_size"` + MaximalSummaryChunkSize fs.SizeSuffix `config:"maximal_summary_chunk_size"` + HardDelete bool `config:"hard_delete"` +} + +// Fs represents remote Quatrix fs +type Fs struct { + name string + root string + description string + features *fs.Features + opt Options + ci *fs.ConfigInfo + srv *rest.Client // the connection to the quatrix server + pacer *fs.Pacer // pacer for API calls + dirCache *dircache.DirCache + uploadMemoryManager *UploadMemoryManager +} + +// Object describes a quatrix object +type Object struct { + fs *Fs + remote string + size int64 + modTime time.Time + id string + hasMetaData bool + obType string +} + +// trimPath trims redundant slashes from quatrix 'url' +func trimPath(path string) (root string) { + root = strings.Trim(path, "/") + return +} + +// retryErrorCodes is a slice of error codes that we will retry +var retryErrorCodes = []int{ + 429, // Too Many Requests. + 500, // Internal Server Error + 502, // Bad Gateway + 503, // Service Unavailable + 504, // Gateway Timeout + 509, // Bandwidth Limit Exceeded +} + +// shouldRetry returns a boolean as to whether this resp and err +// deserve to be retried. It returns the err as a convenience +func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) { + if fserrors.ContextError(ctx, &err) { + return false, err + } + + return fserrors.ShouldRetry(err) || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), err +} + +// NewFs constructs an Fs from the path, container:path +func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { + // Parse config into Options struct + opt := new(Options) + + err := configstruct.Set(m, opt) + if err != nil { + return nil, err + } + + // http client + client := fshttp.NewClient(ctx) + + // since transport is a global variable that is initialized only once (due to sync.Once) + // we need to reset it to have correct transport per each client (with proper values extracted from rclone config) + client.Transport = fshttp.NewTransportCustom(ctx, nil) + + root = trimPath(root) + + ci := fs.GetConfig(ctx) + + f := &Fs{ + name: name, + description: "Quatrix FS for account " + opt.Host, + root: root, + opt: *opt, + ci: ci, + srv: rest.NewClient(client).SetRoot(fmt.Sprintf(rootURL, opt.Host)), + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + } + + f.features = (&fs.Features{ + CaseInsensitive: false, + CanHaveEmptyDirectories: true, + PartialUploads: true, + }).Fill(ctx, f) + + if f.opt.APIKey != "" { + f.srv.SetHeader("Authorization", "Bearer "+f.opt.APIKey) + } + + f.uploadMemoryManager = NewUploadMemoryManager(f.ci, &f.opt) + + // get quatrix root(home) id + rootID, found, err := f.fileID(ctx, "", "") + if err != nil { + return nil, err + } + + if !found { + return nil, errors.New("root not found") + } + + f.dirCache = dircache.New(root, rootID.FileID, f) + + err = f.dirCache.FindRoot(ctx, false) + if err != nil { + fileID, found, err := f.fileID(ctx, "", root) + if err != nil { + return nil, fmt.Errorf("find root %s: %w", root, err) + } + + if !found { + return f, nil + } + + if fileID.IsFile() { + root, _ = dircache.SplitPath(root) + f.dirCache = dircache.New(root, rootID.FileID, f) + + return f, fs.ErrorIsFile + } + } + + return f, nil +} + +// fileID gets id, parent and type of path in given parentID +func (f *Fs) fileID(ctx context.Context, parentID, path string) (result *api.FileInfo, found bool, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "file/id", + IgnoreStatus: true, + } + + payload := api.FileInfoParams{ + Path: f.opt.Enc.FromStandardPath(path), + ParentID: parentID, + } + + result = &api.FileInfo{} + + err = f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, payload, result) + if resp != nil && resp.StatusCode == http.StatusNotFound { + return false, nil + } + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, false, fmt.Errorf("failed to get file id: %w", err) + } + + if result.FileID == "" { + return nil, false, nil + } + + return result, true, nil +} + +// FindLeaf finds a directory of name leaf in the folder with ID pathID +func (f *Fs) FindLeaf(ctx context.Context, pathID, leaf string) (folderID string, found bool, err error) { + result, found, err := f.fileID(ctx, pathID, leaf) + if err != nil { + return "", false, fmt.Errorf("find leaf: %w", err) + } + + if !found { + return "", false, nil + } + + if result.IsFile() { + return "", false, nil + } + + return result.FileID, true, nil +} + +// createDir creates directory in pathID with name leaf +// +// resolve - if true will resolve name conflict on server side, if false - will return error if object with this name exists +func (f *Fs) createDir(ctx context.Context, pathID, leaf string, resolve bool) (newDir *api.File, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "file/makedir", + } + + payload := api.CreateDirParams{ + Name: f.opt.Enc.FromStandardName(leaf), + Target: pathID, + Resolve: resolve, + } + + newDir = &api.File{} + + err = f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, payload, newDir) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to create directory: %w", err) + } + + return +} + +// CreateDir makes a directory with pathID as parent and name leaf +func (f *Fs) CreateDir(ctx context.Context, pathID, leaf string) (dirID string, err error) { + dir, err := f.createDir(ctx, pathID, leaf, false) + if err != nil { + return "", err + } + + return dir.ID, nil +} + +// Name of the remote (as passed into NewFs) +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return f.root +} + +// String converts this Fs to a string +func (f *Fs) String() string { + return f.description +} + +// Precision return the precision of this Fs +func (f *Fs) Precision() time.Duration { + return time.Microsecond +} + +// Hashes returns the supported hash sets. +func (f *Fs) Hashes() hash.Set { + return 0 +} + +// Features returns the optional features of this Fs +func (f *Fs) Features() *fs.Features { + return f.features +} + +// List the objects and directories in dir into entries. The +// entries can be returned in any order but should be for a +// complete directory. +// +// dir should be "" to list the root, and should not have +// trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { + directoryID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return nil, err + } + + folder, err := f.metadata(ctx, directoryID, true) + if err != nil { + return nil, err + } + + for _, file := range folder.Content { + remote := path.Join(dir, f.opt.Enc.ToStandardName(file.Name)) + if file.IsDir() { + f.dirCache.Put(remote, file.ID) + + d := fs.NewDir(remote, time.Time(file.Modified)).SetID(file.ID).SetItems(file.Size) + // FIXME more info from dir? + entries = append(entries, d) + } else { + o := &Object{ + fs: f, + remote: remote, + } + + err = o.setMetaData(&file) + if err != nil { + fs.Debugf(file, "failed to set object metadata: %s", err) + } + + entries = append(entries, o) + } + } + + return entries, nil +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error fs.ErrorObjectNotFound. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + return f.newObjectWithInfo(ctx, remote, nil) +} + +// Creates from the parameters passed in a half finished Object which +// must have setMetaData called on it +// +// Returns the object, leaf, directoryID and error. +// +// Used to create new objects +func (f *Fs) createObject(ctx context.Context, remote string) (o *Object, leaf string, directoryID string, err error) { + // Create the directory for the object if it doesn't exist + leaf, directoryID, err = f.dirCache.FindPath(ctx, remote, true) + if err != nil { + return + } + // Temporary Object under construction + o = &Object{ + fs: f, + remote: remote, + } + return o, leaf, directoryID, nil +} + +// Put the object into the container +// +// Copy the reader in to the new object which is returned. +// +// The new object may have been created if an error is returned +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + remote := src.Remote() + size := src.Size() + mtime := src.ModTime(ctx) + + o := &Object{ + fs: f, + remote: remote, + size: size, + modTime: mtime, + } + + return o, o.Update(ctx, in, src, options...) +} + +func (f *Fs) rootSlash() string { + if f.root == "" { + return f.root + } + return f.root + "/" +} + +func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *api.File) (fs.Object, error) { + o := &Object{ + fs: f, + remote: remote, + } + var err error + if info != nil { + // Set info + err = o.setMetaData(info) + } else { + err = o.readMetaData(ctx) // reads info and meta, returning an error + } + if err != nil { + return nil, err + } + return o, nil +} + +// setMetaData sets the metadata from info +func (o *Object) setMetaData(info *api.File) (err error) { + if info.IsDir() { + fs.Debugf(o, "%q is %q", o.remote, info.Type) + return fs.ErrorIsDir + } + + if !info.IsFile() { + fs.Debugf(o, "%q is %q", o.remote, info.Type) + return fmt.Errorf("%q is %q: %w", o.remote, info.Type, fs.ErrorNotAFile) + } + + o.size = info.Size + o.modTime = time.Time(info.ModifiedMS) + o.id = info.ID + o.hasMetaData = true + o.obType = info.Type + + return nil +} + +func (o *Object) readMetaData(ctx context.Context) (err error) { + if o.hasMetaData { + return nil + } + + leaf, directoryID, err := o.fs.dirCache.FindPath(ctx, o.remote, false) + if err != nil { + if err == fs.ErrorDirNotFound { + return fs.ErrorObjectNotFound + } + return err + } + + file, found, err := o.fs.fileID(ctx, directoryID, leaf) + if err != nil { + return fmt.Errorf("read metadata: fileID: %w", err) + } + + if !found { + fs.Debugf(nil, "object not found: remote %s: directory %s: leaf %s", o.remote, directoryID, leaf) + return fs.ErrorObjectNotFound + } + + result, err := o.fs.metadata(ctx, file.FileID, false) + if err != nil { + return fmt.Errorf("get file metadata: %w", err) + } + + return o.setMetaData(result) +} + +// Mkdir creates the container if it doesn't exist +func (f *Fs) Mkdir(ctx context.Context, dir string) error { + _, err := f.dirCache.FindDir(ctx, dir, true) + return err +} + +// Rmdir deletes the root folder +// +// Returns an error if it isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) error { + return f.purgeCheck(ctx, dir, true) +} + +// DirCacheFlush resets the directory cache - used in testing as an +// optional interface +func (f *Fs) DirCacheFlush() { + f.dirCache.ResetRoot() +} + +func (f *Fs) metadata(ctx context.Context, id string, withContent bool) (result *api.File, err error) { + parameters := url.Values{} + if !withContent { + parameters.Add("content", "0") + } + + opts := rest.Opts{ + Method: "GET", + Path: path.Join("file/metadata", id), + Parameters: parameters, + } + + result = &api.File{} + + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, nil, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return nil, fs.ErrorObjectNotFound + } + + return nil, fmt.Errorf("failed to get file metadata: %w", err) + } + + return result, nil +} + +func (f *Fs) setMTime(ctx context.Context, id string, t time.Time) (result *api.File, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "file/metadata", + } + + params := &api.SetMTimeParams{ + ID: id, + MTime: api.JSONTime(t), + } + + result = &api.File{} + + var resp *http.Response + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, params, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return nil, fs.ErrorObjectNotFound + } + + return nil, fmt.Errorf("failed to set file metadata: %w", err) + } + + return result, nil +} + +func (f *Fs) deleteObject(ctx context.Context, id string) error { + payload := &api.DeleteParams{ + IDs: []string{id}, + DeletePermanently: f.opt.HardDelete, + } + + result := &api.IDList{} + + opts := rest.Opts{ + Method: "POST", + Path: "file/delete", + } + + err := f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, payload, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return err + } + + for _, removedID := range result.IDs { + if removedID == id { + return nil + } + } + + return fmt.Errorf("file %s was not deleted successfully", id) +} + +func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) error { + root := path.Join(f.root, dir) + if root == "" { + return errors.New("can't purge root directory") + } + + rootID, err := f.dirCache.FindDir(ctx, dir, false) + if err != nil { + return err + } + + if check { + file, err := f.metadata(ctx, rootID, false) + if err != nil { + return err + } + + if file.IsFile() { + return fs.ErrorIsFile + } + + if file.Size != 0 { + return fs.ErrorDirectoryNotEmpty + } + } + + err = f.deleteObject(ctx, rootID) + if err != nil { + return err + } + + f.dirCache.FlushDir(dir) + + return nil +} + +// Purge deletes all the files in the directory +// +// Optional interface: Only implement this if you have a way of +// deleting all the files quicker than just running Remove() on the +// result of List() +func (f *Fs) Purge(ctx context.Context, dir string) error { + return f.purgeCheck(ctx, dir, false) +} + +// Copy src to this remote using server-side copy operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantCopy +func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't copy - not same remote type") + return nil, fs.ErrorCantCopy + } + + if srcObj.fs == f { + srcPath := srcObj.rootPath() + dstPath := f.rootPath(remote) + if srcPath == dstPath { + return nil, fmt.Errorf("can't copy %q -> %q as they are same", srcPath, dstPath) + } + } + + err := srcObj.readMetaData(ctx) + if err != nil { + fs.Debugf(srcObj, "read metadata for %s: %s", srcObj.rootPath(), err) + return nil, err + } + + _, _, err = srcObj.fs.dirCache.FindPath(ctx, srcObj.remote, false) + if err != nil { + return nil, err + } + + dstObj, dstLeaf, directoryID, err := f.createObject(ctx, remote) + if err != nil { + fs.Debugf(srcObj, "create empty object for %s: %s", dstObj.rootPath(), err) + return nil, err + } + + opts := rest.Opts{ + Method: "POST", + Path: "file/copyone", + } + + params := &api.FileCopyMoveOneParams{ + ID: srcObj.id, + Target: directoryID, + Resolve: true, + MTime: api.JSONTime(srcObj.ModTime(ctx)), + Name: dstLeaf, + ResolveMode: api.OverwriteMode, + } + + result := &api.File{} + + var resp *http.Response + + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, params, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return nil, fs.ErrorObjectNotFound + } + + return nil, fmt.Errorf("failed to copy: %w", err) + } + + err = dstObj.setMetaData(result) + if err != nil { + return nil, err + } + + return dstObj, nil +} + +// Move src to this remote using server-side move operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantMove +func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't move - not same remote type") + return nil, fs.ErrorCantMove + } + + _, _, err := srcObj.fs.dirCache.FindPath(ctx, srcObj.remote, false) + if err != nil { + return nil, err + } + + // Create temporary object + dstObj, dstLeaf, directoryID, err := f.createObject(ctx, remote) + if err != nil { + return nil, err + } + + opts := rest.Opts{ + Method: "POST", + Path: "file/moveone", + } + + params := &api.FileCopyMoveOneParams{ + ID: srcObj.id, + Target: directoryID, + Resolve: true, + MTime: api.JSONTime(srcObj.ModTime(ctx)), + Name: dstLeaf, + ResolveMode: api.OverwriteMode, + } + + var resp *http.Response + result := &api.File{} + + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, params, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return nil, fs.ErrorObjectNotFound + } + + return nil, fmt.Errorf("failed to move: %w", err) + } + + err = dstObj.setMetaData(result) + if err != nil { + return nil, err + } + + return dstObj, nil +} + +// DirMove moves src, srcRemote to this remote at dstRemote +// using server-side move operations. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantDirMove +// +// If destination exists then return fs.ErrorDirExists +func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error { + srcFs, ok := src.(*Fs) + if !ok { + fs.Debugf(srcFs, "Can't move directory - not same remote type") + return fs.ErrorCantDirMove + } + + srcID, _, _, dstDirectoryID, dstLeaf, err := f.dirCache.DirMove(ctx, srcFs.dirCache, srcFs.root, srcRemote, f.root, dstRemote) + if err != nil { + return err + } + + srcInfo, err := f.metadata(ctx, srcID, false) + if err != nil { + return err + } + + opts := rest.Opts{ + Method: "POST", + Path: "file/moveone", + } + + params := &api.FileCopyMoveOneParams{ + ID: srcID, + Target: dstDirectoryID, + Resolve: false, + MTime: srcInfo.ModifiedMS, + Name: dstLeaf, + } + + var resp *http.Response + result := &api.File{} + + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, params, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return fs.ErrorObjectNotFound + } + + return fmt.Errorf("failed to move dir: %w", err) + } + + srcFs.dirCache.FlushDir(srcRemote) + + return nil +} + +// About gets quota information +func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { + opts := rest.Opts{ + Method: "GET", + Path: "profile/info", + } + var ( + user api.ProfileInfo + resp *http.Response + ) + + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, nil, &user) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to read profile info: %w", err) + } + + free := user.AccLimit - user.UserUsed + + if user.UserLimit > unlimitedUserQuota { + free = user.UserLimit - user.UserUsed + } + + usage = &fs.Usage{ + Used: fs.NewUsageValue(user.UserUsed), // bytes in use + Total: fs.NewUsageValue(user.AccLimit), // bytes total + Free: fs.NewUsageValue(free), // bytes free + } + + return usage, nil +} + +// Fs return the parent Fs +func (o *Object) Fs() fs.Info { + return o.fs +} + +// String returns object remote path +func (o *Object) String() string { + if o == nil { + return "" + } + return o.remote +} + +// Remote returns the remote path +func (o *Object) Remote() string { + return o.remote +} + +// rootPath returns a path for use in server given a remote +func (f *Fs) rootPath(remote string) string { + return f.rootSlash() + remote +} + +// rootPath returns a path for use in local functions +func (o *Object) rootPath() string { + return o.fs.rootPath(o.remote) +} + +// Size returns the size of an object in bytes +func (o *Object) Size() int64 { + err := o.readMetaData(context.TODO()) + if err != nil { + fs.Logf(o, "Failed to read metadata: %v", err) + return 0 + } + + return o.size +} + +// ModTime returns the modification time of the object +func (o *Object) ModTime(ctx context.Context) time.Time { + err := o.readMetaData(ctx) + if err != nil { + fs.Logf(o, "Failed to read metadata: %v", err) + return time.Now() + } + + return o.modTime +} + +// Storable returns a boolean showing whether this object storable +func (o *Object) Storable() bool { + return true +} + +// ID returns the ID of the Object if known, or "" if not +func (o *Object) ID() string { + return o.id +} + +// Hash returns the SHA-1 of an object. Not supported yet. +func (o *Object) Hash(ctx context.Context, ty hash.Type) (string, error) { + return "", nil +} + +// Remove an object +func (o *Object) Remove(ctx context.Context) error { + err := o.fs.deleteObject(ctx, o.id) + if err != nil { + return err + } + + if o.obType != "F" { + o.fs.dirCache.FlushDir(o.remote) + } + + return nil +} + +// Open an object for read +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) { + if o.id == "" { + return nil, errors.New("can't download - no id") + } + + linkID, err := o.fs.downloadLink(ctx, o.id) + if err != nil { + return nil, err + } + + fs.FixRangeOption(options, o.size) + + opts := rest.Opts{ + Method: "GET", + Path: "/file/download/" + linkID, + Options: options, + } + + var resp *http.Response + + err = o.fs.pacer.Call(func() (bool, error) { + resp, err = o.fs.srv.Call(ctx, &opts) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, err + } + return resp.Body, err +} + +func (f *Fs) downloadLink(ctx context.Context, id string) (linkID string, err error) { + linkParams := &api.IDList{ + IDs: []string{id}, + } + opts := rest.Opts{ + Method: "POST", + Path: "file/download-link", + } + + var resp *http.Response + link := &api.DownloadLinkResponse{} + + err = f.pacer.Call(func() (bool, error) { + resp, err = f.srv.CallJSON(ctx, &opts, linkParams, &link) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return "", err + } + return link.ID, nil +} + +// SetModTime sets the modification time of the local fs object +func (o *Object) SetModTime(ctx context.Context, t time.Time) error { + file, err := o.fs.setMTime(ctx, o.id, t) + if err != nil { + return fmt.Errorf("set mtime: %w", err) + } + + return o.setMetaData(file) +} + +// Update the object with the contents of the io.Reader, modTime and size +// +// The new object may have been created if an error is returned +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + size := src.Size() + modTime := src.ModTime(ctx) + remote := o.Remote() + + // Create the directory for the object if it doesn't exist + leaf, directoryID, err := o.fs.dirCache.FindPath(ctx, remote, true) + if err != nil { + return err + } + + uploadSession, err := o.uploadSession(ctx, directoryID, leaf) + if err != nil { + return fmt.Errorf("object update: %w", err) + } + + o.id = uploadSession.FileID + + defer func() { + if err == nil { + return + } + + deleteErr := o.fs.deleteObject(ctx, o.id) + if deleteErr != nil { + fs.Logf(o.remote, "remove: %s", deleteErr) + } + }() + + return o.dynamicUpload(ctx, size, modTime, in, uploadSession, options...) +} + +// dynamicUpload uploads object in chunks, which are being dynamically recalculated on each iteration +// depending on upload speed in order to make upload faster +func (o *Object) dynamicUpload(ctx context.Context, size int64, modTime time.Time, in io.Reader, + uploadSession *api.UploadLinkResponse, options ...fs.OpenOption) error { + var ( + speed float64 + localChunk int64 + ) + + defer o.fs.uploadMemoryManager.Return(o.id) + + for offset := int64(0); offset < size; offset += localChunk { + localChunk = o.fs.uploadMemoryManager.Consume(o.id, size-offset, speed) + + rw := multipart.NewRW() + + _, err := io.CopyN(rw, in, localChunk) + if err != nil { + return fmt.Errorf("read chunk with offset %d size %d: %w", offset, localChunk, err) + } + + start := time.Now() + + err = o.upload(ctx, uploadSession.UploadKey, rw, size, offset, localChunk, options...) + if err != nil { + return fmt.Errorf("upload chunk with offset %d size %d: %w", offset, localChunk, err) + } + + speed = float64(localChunk) / (float64(time.Since(start)) / 1e9) + } + + o.fs.uploadMemoryManager.Return(o.id) + + finalizeResult, err := o.finalize(ctx, uploadSession.UploadKey, modTime) + if err != nil { + return fmt.Errorf("upload %s finalize: %w", uploadSession.UploadKey, err) + } + + if size >= 0 && finalizeResult.FileSize != size { + return fmt.Errorf("expected size %d, got %d", size, finalizeResult.FileSize) + } + + o.size = size + o.modTime = modTime + + return nil +} + +func (f *Fs) uploadLink(ctx context.Context, parentID, name string) (upload *api.UploadLinkResponse, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "upload/link", + } + + payload := api.UploadLinkParams{ + Name: name, + ParentID: parentID, + Resolve: false, + } + + err = f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, &payload, &upload) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to get upload link: %w", err) + } + + return upload, nil +} + +func (f *Fs) modifyLink(ctx context.Context, fileID string) (upload *api.UploadLinkResponse, err error) { + opts := rest.Opts{ + Method: "POST", + Path: "file/modify", + } + + payload := api.FileModifyParams{ + ID: fileID, + Truncate: 0, + } + + err = f.pacer.Call(func() (bool, error) { + resp, err := f.srv.CallJSON(ctx, &opts, &payload, &upload) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to get modify link: %w", err) + } + + return upload, nil +} + +func (o *Object) uploadSession(ctx context.Context, parentID, name string) (upload *api.UploadLinkResponse, err error) { + encName := o.fs.opt.Enc.FromStandardName(name) + fileID, found, err := o.fs.fileID(ctx, parentID, encName) + if err != nil { + return nil, fmt.Errorf("get file_id: %w", err) + } + + if found { + return o.fs.modifyLink(ctx, fileID.FileID) + } + + return o.fs.uploadLink(ctx, parentID, encName) +} + +func (o *Object) upload(ctx context.Context, uploadKey string, chunk io.Reader, fullSize int64, offset int64, chunkSize int64, options ...fs.OpenOption) (err error) { + opts := rest.Opts{ + Method: "POST", + RootURL: fmt.Sprintf(uploadURL, o.fs.opt.Host) + uploadKey, + Body: chunk, + ContentRange: fmt.Sprintf("bytes %d-%d/%d", offset, offset+chunkSize, fullSize), + Options: options, + } + + var fileID string + + err = o.fs.pacer.Call(func() (bool, error) { + resp, err := o.fs.srv.CallJSON(ctx, &opts, nil, &fileID) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return fmt.Errorf("failed to get upload chunk: %w", err) + } + + return nil +} + +func (o *Object) finalize(ctx context.Context, uploadKey string, mtime time.Time) (result *api.UploadFinalizeResponse, err error) { + queryParams := url.Values{} + queryParams.Add("mtime", strconv.FormatFloat(float64(mtime.UTC().UnixNano())/1e9, 'f', 6, 64)) + + opts := rest.Opts{ + Method: "GET", + Path: path.Join("upload/finalize", uploadKey), + Parameters: queryParams, + } + + result = &api.UploadFinalizeResponse{} + + err = o.fs.pacer.Call(func() (bool, error) { + resp, err := o.fs.srv.CallJSON(ctx, &opts, nil, result) + return shouldRetry(ctx, resp, err) + }) + if err != nil { + return nil, fmt.Errorf("failed to finalize: %w", err) + } + + return result, nil +} + +// Check the interfaces are satisfied +var ( + _ fs.Fs = (*Fs)(nil) + _ fs.Purger = (*Fs)(nil) + _ fs.Copier = (*Fs)(nil) + _ fs.Abouter = (*Fs)(nil) + _ fs.Mover = (*Fs)(nil) + _ fs.DirMover = (*Fs)(nil) + _ dircache.DirCacher = (*Fs)(nil) + _ fs.DirCacheFlusher = (*Fs)(nil) + _ fs.Object = (*Object)(nil) + _ fs.IDer = (*Object)(nil) +) diff --git a/backend/quatrix/quatrix_test.go b/backend/quatrix/quatrix_test.go new file mode 100644 index 0000000000000..c9759f1880487 --- /dev/null +++ b/backend/quatrix/quatrix_test.go @@ -0,0 +1,17 @@ +// Test Quatrix filesystem interface +package quatrix_test + +import ( + "testing" + + "github.com/rclone/rclone/backend/quatrix" + "github.com/rclone/rclone/fstest/fstests" +) + +// TestIntegration runs integration tests against the remote +func TestIntegration(t *testing.T) { + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestQuatrix:", + NilObject: (*quatrix.Object)(nil), + }) +} diff --git a/backend/quatrix/upload_memory.go b/backend/quatrix/upload_memory.go new file mode 100644 index 0000000000000..615b785409019 --- /dev/null +++ b/backend/quatrix/upload_memory.go @@ -0,0 +1,108 @@ +package quatrix + +import ( + "sync" + "time" + + "github.com/rclone/rclone/fs" +) + +// UploadMemoryManager dynamically calculates every chunk size for the transfer and increases or decreases it +// depending on the upload speed. This makes general upload time smaller, because transfers that are faster +// does not have to wait for the slower ones until they finish upload. +type UploadMemoryManager struct { + m sync.Mutex + useDynamicSize bool + shared int64 + reserved int64 + effectiveTime time.Duration + fileUsage map[string]int64 +} + +// NewUploadMemoryManager is a constructor for UploadMemoryManager +func NewUploadMemoryManager(ci *fs.ConfigInfo, opt *Options) *UploadMemoryManager { + useDynamicSize := true + + sharedMemory := int64(opt.MaximalSummaryChunkSize) - int64(opt.MinimalChunkSize)*int64(ci.Transfers) + if sharedMemory <= 0 { + sharedMemory = 0 + useDynamicSize = false + } + + return &UploadMemoryManager{ + useDynamicSize: useDynamicSize, + shared: sharedMemory, + reserved: int64(opt.MinimalChunkSize), + effectiveTime: time.Duration(opt.EffectiveUploadTime), + fileUsage: map[string]int64{}, + } +} + +// Consume -- decide amount of memory to consume +func (u *UploadMemoryManager) Consume(fileID string, neededMemory int64, speed float64) int64 { + if !u.useDynamicSize { + if neededMemory < u.reserved { + return neededMemory + } + + return u.reserved + } + + u.m.Lock() + defer u.m.Unlock() + + borrowed, found := u.fileUsage[fileID] + if found { + u.shared += borrowed + borrowed = 0 + } + + defer func() { u.fileUsage[fileID] = borrowed }() + + effectiveChunkSize := int64(speed * u.effectiveTime.Seconds()) + + if effectiveChunkSize < u.reserved { + effectiveChunkSize = u.reserved + } + + if neededMemory < effectiveChunkSize { + effectiveChunkSize = neededMemory + } + + if effectiveChunkSize <= u.reserved { + return effectiveChunkSize + } + + toBorrow := effectiveChunkSize - u.reserved + + if toBorrow <= u.shared { + u.shared -= toBorrow + borrowed = toBorrow + + return effectiveChunkSize + } + + borrowed = u.shared + u.shared = 0 + + return borrowed + u.reserved +} + +// Return returns consumed memory for the previous chunk upload to the memory pool +func (u *UploadMemoryManager) Return(fileID string) { + if !u.useDynamicSize { + return + } + + u.m.Lock() + defer u.m.Unlock() + + borrowed, found := u.fileUsage[fileID] + if !found { + return + } + + u.shared += borrowed + + delete(u.fileUsage, fileID) +} diff --git a/backend/s3/s3.go b/backend/s3/s3.go index d269b017c3cc3..8f690b38dc1f8 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -1,4 +1,4 @@ -// Package s3 provides an interface to Amazon S3 oject storage +// Package s3 provides an interface to Amazon S3 object storage package s3 //go:generate go run gen_setfrom.go -o setfrom.go @@ -15,6 +15,7 @@ import ( "errors" "fmt" "io" + "math" "net/http" "net/url" "path" @@ -53,20 +54,144 @@ import ( "github.com/rclone/rclone/lib/atexit" "github.com/rclone/rclone/lib/bucket" "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/multipart" "github.com/rclone/rclone/lib/pacer" "github.com/rclone/rclone/lib/pool" "github.com/rclone/rclone/lib/readers" "github.com/rclone/rclone/lib/rest" "github.com/rclone/rclone/lib/version" "golang.org/x/net/http/httpguts" - "golang.org/x/sync/errgroup" ) +// The S3 providers +// +// Please keep these in alphabetical order, but with AWS first and +// Other last. +// +// NB if you add a new provider here, then add it in the setQuirks +// function and set the correct quirks. Test the quirks are correct by +// running the integration tests "go test -v -remote NewS3Provider:". +// +// See https://github.com/rclone/rclone/blob/master/CONTRIBUTING.md#adding-a-new-s3-provider +// for full information about how to add a new s3 provider. +var providerOption = fs.Option{ + Name: fs.ConfigProvider, + Help: "Choose your S3 provider.", + Examples: []fs.OptionExample{{ + Value: "AWS", + Help: "Amazon Web Services (AWS) S3", + }, { + Value: "Alibaba", + Help: "Alibaba Cloud Object Storage System (OSS) formerly Aliyun", + }, { + Value: "ArvanCloud", + Help: "Arvan Cloud Object Storage (AOS)", + }, { + Value: "Ceph", + Help: "Ceph Object Storage", + }, { + Value: "ChinaMobile", + Help: "China Mobile Ecloud Elastic Object Storage (EOS)", + }, { + Value: "Cloudflare", + Help: "Cloudflare R2 Storage", + }, { + Value: "DigitalOcean", + Help: "DigitalOcean Spaces", + }, { + Value: "Dreamhost", + Help: "Dreamhost DreamObjects", + }, { + Value: "GCS", + Help: "Google Cloud Storage", + }, { + Value: "HuaweiOBS", + Help: "Huawei Object Storage Service", + }, { + Value: "IBMCOS", + Help: "IBM COS S3", + }, { + Value: "IDrive", + Help: "IDrive e2", + }, { + Value: "IONOS", + Help: "IONOS Cloud", + }, { + Value: "LyveCloud", + Help: "Seagate Lyve Cloud", + }, { + Value: "Leviia", + Help: "Leviia Object Storage", + }, { + Value: "Liara", + Help: "Liara Object Storage", + }, { + Value: "Linode", + Help: "Linode Object Storage", + }, { + Value: "Minio", + Help: "Minio Object Storage", + }, { + Value: "Netease", + Help: "Netease Object Storage (NOS)", + }, { + Value: "Petabox", + Help: "Petabox Object Storage", + }, { + Value: "RackCorp", + Help: "RackCorp Object Storage", + }, { + Value: "Rclone", + Help: "Rclone S3 Server", + }, { + Value: "Scaleway", + Help: "Scaleway Object Storage", + }, { + Value: "SeaweedFS", + Help: "SeaweedFS S3", + }, { + Value: "StackPath", + Help: "StackPath Object Storage", + }, { + Value: "Storj", + Help: "Storj (S3 Compatible Gateway)", + }, { + Value: "Synology", + Help: "Synology C2 Object Storage", + }, { + Value: "TencentCOS", + Help: "Tencent Cloud Object Storage (COS)", + }, { + Value: "Wasabi", + Help: "Wasabi Object Storage", + }, { + Value: "Qiniu", + Help: "Qiniu Object Storage (Kodo)", + }, { + Value: "Other", + Help: "Any other S3 compatible provider", + }}, +} + +var providersList string + // Register with Fs func init() { + var s strings.Builder + for i, provider := range providerOption.Examples { + if provider.Value == "Other" { + _, _ = s.WriteString(" and others") + } else { + if i != 0 { + _, _ = s.WriteString(", ") + } + _, _ = s.WriteString(provider.Value) + } + } + providersList = s.String() fs.Register(&fs.RegInfo{ Name: "s3", - Description: "Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi", + Description: "Amazon S3 Compliant Storage Providers including " + providersList, NewFs: NewFs, CommandHelp: commandHelp, Config: func(ctx context.Context, name string, m configmap.Mapper, config fs.ConfigIn) (*fs.ConfigOut, error) { @@ -80,88 +205,7 @@ func init() { System: systemMetadataInfo, Help: `User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case.`, }, - Options: []fs.Option{{ - Name: fs.ConfigProvider, - Help: "Choose your S3 provider.", - // NB if you add a new provider here, then add it in the - // setQuirks function and set the correct quirks - Examples: []fs.OptionExample{{ - Value: "AWS", - Help: "Amazon Web Services (AWS) S3", - }, { - Value: "Alibaba", - Help: "Alibaba Cloud Object Storage System (OSS) formerly Aliyun", - }, { - Value: "Ceph", - Help: "Ceph Object Storage", - }, { - Value: "ChinaMobile", - Help: "China Mobile Ecloud Elastic Object Storage (EOS)", - }, { - Value: "Cloudflare", - Help: "Cloudflare R2 Storage", - }, { - Value: "ArvanCloud", - Help: "Arvan Cloud Object Storage (AOS)", - }, { - Value: "DigitalOcean", - Help: "DigitalOcean Spaces", - }, { - Value: "Dreamhost", - Help: "Dreamhost DreamObjects", - }, { - Value: "HuaweiOBS", - Help: "Huawei Object Storage Service", - }, { - Value: "IBMCOS", - Help: "IBM COS S3", - }, { - Value: "IDrive", - Help: "IDrive e2", - }, { - Value: "IONOS", - Help: "IONOS Cloud", - }, { - Value: "LyveCloud", - Help: "Seagate Lyve Cloud", - }, { - Value: "Liara", - Help: "Liara Object Storage", - }, { - Value: "Minio", - Help: "Minio Object Storage", - }, { - Value: "Netease", - Help: "Netease Object Storage (NOS)", - }, { - Value: "RackCorp", - Help: "RackCorp Object Storage", - }, { - Value: "Scaleway", - Help: "Scaleway Object Storage", - }, { - Value: "SeaweedFS", - Help: "SeaweedFS S3", - }, { - Value: "StackPath", - Help: "StackPath Object Storage", - }, { - Value: "Storj", - Help: "Storj (S3 Compatible Gateway)", - }, { - Value: "TencentCOS", - Help: "Tencent Cloud Object Storage (COS)", - }, { - Value: "Wasabi", - Help: "Wasabi Object Storage", - }, { - Value: "Qiniu", - Help: "Qiniu Object Storage (Kodo)", - }, { - Value: "Other", - Help: "Any other S3 compatible provider", - }}, - }, { + Options: []fs.Option{providerOption, { Name: "env_auth", Help: "Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).\n\nOnly applies if access_key_id and secret_access_key is blank.", Default: false, @@ -173,11 +217,13 @@ func init() { Help: "Get AWS credentials from the environment (env vars or IAM).", }}, }, { - Name: "access_key_id", - Help: "AWS Access Key ID.\n\nLeave blank for anonymous access or runtime credentials.", + Name: "access_key_id", + Help: "AWS Access Key ID.\n\nLeave blank for anonymous access or runtime credentials.", + Sensitive: true, }, { - Name: "secret_access_key", - Help: "AWS Secret Access Key (password).\n\nLeave blank for anonymous access or runtime credentials.", + Name: "secret_access_key", + Help: "AWS Secret Access Key (password).\n\nLeave blank for anonymous access or runtime credentials.", + Sensitive: true, }, { // References: // 1. https://docs.aws.amazon.com/general/latest/gr/rande.html @@ -437,10 +483,50 @@ func init() { Value: "eu-south-2", Help: "Logrono, Spain", }}, + }, { + Name: "region", + Help: "Region where your bucket will be created and your data stored.\n", + Provider: "Petabox", + Examples: []fs.OptionExample{{ + Value: "us-east-1", + Help: "US East (N. Virginia)", + }, { + Value: "eu-central-1", + Help: "Europe (Frankfurt)", + }, { + Value: "ap-southeast-1", + Help: "Asia Pacific (Singapore)", + }, { + Value: "me-south-1", + Help: "Middle East (Bahrain)", + }, { + Value: "sa-east-1", + Help: "South America (São Paulo)", + }}, + }, { + Name: "region", + Help: "Region where your data stored.\n", + Provider: "Synology", + Examples: []fs.OptionExample{{ + Value: "eu-001", + Help: "Europe Region 1", + }, { + Value: "eu-002", + Help: "Europe Region 2", + }, { + Value: "us-001", + Help: "US Region 1", + }, { + Value: "us-002", + Help: "US Region 2", + }, { + Value: "tw-001", + Help: "Asia (Taiwan)", + }}, }, { Name: "region", Help: "Region to connect to.\n\nLeave blank if you are using an S3 clone and you don't have a region.", - Provider: "!AWS,Alibaba,ChinaMobile,Cloudflare,IONOS,ArvanCloud,Liara,Qiniu,RackCorp,Scaleway,Storj,TencentCOS,HuaweiOBS,IDrive", + Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Linode,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive", Examples: []fs.OptionExample{{ Value: "", Help: "Use this if unsure.\nWill use v4 signatures and an empty region.", @@ -549,15 +635,15 @@ func init() { Help: "Anhui China (Huainan)", }}, }, { - // ArvanCloud endpoints: https://www.arvancloud.com/en/products/cloud-storage + // ArvanCloud endpoints: https://www.arvancloud.ir/en/products/cloud-storage Name: "endpoint", Help: "Endpoint for Arvan Cloud Object Storage (AOS) API.", Provider: "ArvanCloud", Examples: []fs.OptionExample{{ - Value: "s3.ir-thr-at1.arvanstorage.com", - Help: "The default endpoint - a good choice if you are unsure.\nTehran Iran (Asiatech)", + Value: "s3.ir-thr-at1.arvanstorage.ir", + Help: "The default endpoint - a good choice if you are unsure.\nTehran Iran (Simin)", }, { - Value: "s3.ir-tbz-sh1.arvanstorage.com", + Value: "s3.ir-tbz-sh1.arvanstorage.ir", Help: "Tabriz Iran (Shahriar)", }}, }, { @@ -765,6 +851,39 @@ func init() { Value: "s3-eu-south-2.ionoscloud.com", Help: "Logrono, Spain", }}, + }, { + Name: "endpoint", + Help: "Endpoint for Petabox S3 Object Storage.\n\nSpecify the endpoint from the same region.", + Provider: "Petabox", + Required: true, + Examples: []fs.OptionExample{{ + Value: "s3.petabox.io", + Help: "US East (N. Virginia)", + }, { + Value: "s3.us-east-1.petabox.io", + Help: "US East (N. Virginia)", + }, { + Value: "s3.eu-central-1.petabox.io", + Help: "Europe (Frankfurt)", + }, { + Value: "s3.ap-southeast-1.petabox.io", + Help: "Asia Pacific (Singapore)", + }, { + Value: "s3.me-south-1.petabox.io", + Help: "Middle East (Bahrain)", + }, { + Value: "s3.sa-east-1.petabox.io", + Help: "South America (São Paulo)", + }}, + }, { + // Leviia endpoints: https://www.leviia.com/object-storage/ + Name: "endpoint", + Help: "Endpoint for Leviia Object Storage API.", + Provider: "Leviia", + Examples: []fs.OptionExample{{ + Value: "s3.leviia.com", + Help: "The default endpoint\nLeviia", + }}, }, { // Liara endpoints: https://liara.ir/landing/object-storage Name: "endpoint", @@ -774,6 +893,42 @@ func init() { Value: "storage.iran.liara.space", Help: "The default endpoint\nIran", }}, + }, { + // Linode endpoints: https://www.linode.com/docs/products/storage/object-storage/guides/urls/#cluster-url-s3-endpoint + Name: "endpoint", + Help: "Endpoint for Linode Object Storage API.", + Provider: "Linode", + Examples: []fs.OptionExample{{ + Value: "us-southeast-1.linodeobjects.com", + Help: "Atlanta, GA (USA), us-southeast-1", + }, { + Value: "us-ord-1.linodeobjects.com", + Help: "Chicago, IL (USA), us-ord-1", + }, { + Value: "eu-central-1.linodeobjects.com", + Help: "Frankfurt (Germany), eu-central-1", + }, { + Value: "it-mil-1.linodeobjects.com", + Help: "Milan (Italy), it-mil-1", + }, { + Value: "us-east-1.linodeobjects.com", + Help: "Newark, NJ (USA), us-east-1", + }, { + Value: "fr-par-1.linodeobjects.com", + Help: "Paris (France), fr-par-1", + }, { + Value: "us-sea-1.linodeobjects.com", + Help: "Seattle, WA (USA), us-sea-1", + }, { + Value: "ap-south-1.linodeobjects.com", + Help: "Singapore ap-south-1", + }, { + Value: "se-sto-1.linodeobjects.com", + Help: "Stockholm (Sweden), se-sto-1", + }, { + Value: "us-iad-1.linodeobjects.com", + Help: "Washington, DC, (USA), us-iad-1", + }}, }, { // oss endpoints: https://help.aliyun.com/document_detail/31837.html Name: "endpoint", @@ -934,6 +1089,14 @@ func init() { Value: "s3.eu-central-1.stackpathstorage.com", Help: "EU Endpoint", }}, + }, { + Name: "endpoint", + Help: "Endpoint for Google Cloud Storage.", + Provider: "GCS", + Examples: []fs.OptionExample{{ + Value: "https://storage.googleapis.com", + Help: "Google Cloud Storage endpoint", + }}, }, { Name: "endpoint", Help: "Endpoint for Storj Gateway.", @@ -942,6 +1105,26 @@ func init() { Value: "gateway.storjshare.io", Help: "Global Hosted Gateway", }}, + }, { + Name: "endpoint", + Help: "Endpoint for Synology C2 Object Storage API.", + Provider: "Synology", + Examples: []fs.OptionExample{{ + Value: "eu-001.s3.synologyc2.net", + Help: "EU Endpoint 1", + }, { + Value: "eu-002.s3.synologyc2.net", + Help: "EU Endpoint 2", + }, { + Value: "us-001.s3.synologyc2.net", + Help: "US Endpoint 1", + }, { + Value: "us-002.s3.synologyc2.net", + Help: "US Endpoint 2", + }, { + Value: "tw-001.s3.synologyc2.net", + Help: "TW Endpoint 1", + }}, }, { // cos endpoints: https://intl.cloud.tencent.com/document/product/436/6224 Name: "endpoint", @@ -1098,7 +1281,7 @@ func init() { }, { Name: "endpoint", Help: "Endpoint for S3 API.\n\nRequired when using an S3 clone.", - Provider: "!AWS,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,Liara,ArvanCloud,Scaleway,StackPath,Storj,RackCorp,Qiniu", + Provider: "!AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Linode,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox", Examples: []fs.OptionExample{{ Value: "objects-us-east-1.dream.io", Help: "Dream Objects endpoint", @@ -1200,8 +1383,12 @@ func init() { Help: "Liara Iran endpoint", Provider: "Liara", }, { - Value: "s3.ir-thr-at1.arvanstorage.com", - Help: "ArvanCloud Tehran Iran (Asiatech) endpoint", + Value: "s3.ir-thr-at1.arvanstorage.ir", + Help: "ArvanCloud Tehran Iran (Simin) endpoint", + Provider: "ArvanCloud", + }, { + Value: "s3.ir-tbz-sh1.arvanstorage.ir", + Help: "ArvanCloud Tabriz Iran (Shahriar) endpoint", Provider: "ArvanCloud", }}, }, { @@ -1385,7 +1572,7 @@ func init() { Provider: "ArvanCloud", Examples: []fs.OptionExample{{ Value: "ir-thr-at1", - Help: "Tehran Iran (Asiatech)", + Help: "Tehran Iran (Simin)", }, { Value: "ir-tbz-sh1", Help: "Tabriz Iran (Shahriar)", @@ -1582,7 +1769,7 @@ func init() { }, { Name: "location_constraint", Help: "Location constraint - must be set to match the Region.\n\nLeave blank if not sure. Used when creating buckets only.", - Provider: "!AWS,Alibaba,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Liara,ArvanCloud,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS", + Provider: "!AWS,Alibaba,ArvanCloud,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Leviia,Liara,Linode,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS,Petabox", }, { Name: "acl", Help: `Canned ACL used when creating buckets and storing or copying objects. @@ -1597,7 +1784,7 @@ doesn't copy the ACL from the source but rather writes a fresh one. If the acl is an empty string then no X-Amz-Acl: header is added and the default (private) will be used. `, - Provider: "!Storj,Cloudflare", + Provider: "!Storj,Synology,Cloudflare", Examples: []fs.OptionExample{{ Value: "default", Help: "Owner gets Full_CONTROL.\nNo one else has access rights (default).", @@ -1713,6 +1900,7 @@ header is added and the default (private) will be used. Value: "arn:aws:kms:us-east-1:*", Help: "arn:aws:kms:*", }}, + Sensitive: true, }, { Name: "sse_customer_key", Help: `To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data. @@ -1724,6 +1912,7 @@ Alternatively you can provide --sse-customer-key-base64.`, Value: "", Help: "None", }}, + Sensitive: true, }, { Name: "sse_customer_key_base64", Help: `If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data. @@ -1735,6 +1924,7 @@ Alternatively you can provide --sse-customer-key.`, Value: "", Help: "None", }}, + Sensitive: true, }, { Name: "sse_customer_key_md5", Help: `If using SSE-C you may provide the secret encryption key MD5 checksum (optional). @@ -1747,6 +1937,7 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke Value: "", Help: "None", }}, + Sensitive: true, }, { Name: "storage_class", Help: "The storage class to use when storing new objects in S3.", @@ -1825,7 +2016,7 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke Help: "Standard storage class", }}, }, { - // Mapping from here: https://www.arvancloud.com/en/products/cloud-storage + // Mapping from here: https://www.arvancloud.ir/en/products/cloud-storage Name: "storage_class", Help: "The storage class to use when storing new objects in ArvanCloud.", Provider: "ArvanCloud", @@ -1852,7 +2043,7 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke Help: "Infrequent access storage mode", }}, }, { - // Mapping from here: https://www.scaleway.com/en/docs/object-storage-glacier/#-Scaleway-Storage-Classes + // Mapping from here: https://www.scaleway.com/en/docs/storage/object/quickstart/ Name: "storage_class", Help: "The storage class to use when storing new objects in S3.", Provider: "Scaleway", @@ -1861,10 +2052,13 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke Help: "Default.", }, { Value: "STANDARD", - Help: "The Standard class for any upload.\nSuitable for on-demand content like streaming or CDN.", + Help: "The Standard class for any upload.\nSuitable for on-demand content like streaming or CDN.\nAvailable in all regions.", }, { Value: "GLACIER", - Help: "Archived storage.\nPrices are lower, but it needs to be restored first to be accessed.", + Help: "Archived storage.\nPrices are lower, but it needs to be restored first to be accessed.\nAvailable in FR-PAR and NL-AMS regions.", + }, { + Value: "ONEZONE_IA", + Help: "One Zone - Infrequent Access.\nA good choice for storing secondary backup copies or easily re-creatable data.\nAvailable in the FR-PAR region only.", }}, }, { // Mapping from here: https://developer.qiniu.com/kodo/5906/storage-type @@ -1985,9 +2179,10 @@ If empty it will default to the environment variable "AWS_PROFILE" or `, Advanced: true, }, { - Name: "session_token", - Help: "An AWS session token.", - Advanced: true, + Name: "session_token", + Help: "An AWS session token.", + Advanced: true, + Sensitive: true, }, { Name: "upload_concurrency", Help: `Concurrency for multipart uploads. @@ -2152,17 +2347,16 @@ very small even with this flag. encoder.EncodeDot, }, { Name: "memory_pool_flush_time", - Default: memoryPoolFlushTime, + Default: fs.Duration(time.Minute), Advanced: true, - Help: `How often internal memory buffer pools will be flushed. - -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool.`, + Hide: fs.OptionHideBoth, + Help: `How often internal memory buffer pools will be flushed. (no longer used)`, }, { Name: "memory_pool_use_mmap", - Default: memoryPoolUseMmap, + Default: false, Advanced: true, - Help: `Whether to use mmap buffers in internal memory pool.`, + Hide: fs.OptionHideBoth, + Help: `Whether to use mmap buffers in internal memory pool. (no longer used)`, }, { Name: "disable_http2", Default: false, @@ -2182,6 +2376,15 @@ See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rcl This is usually set to a CloudFront CDN URL as AWS S3 offers cheaper egress for data downloaded through the CloudFront network.`, Advanced: true, + }, { + Name: "directory_markers", + Default: false, + Advanced: true, + Help: `Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. +`, }, { Name: "use_multipart_etag", Help: `Whether to use ETag in multipart uploads for verification @@ -2258,6 +2461,24 @@ will decompress the object on the fly. If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here. +`, "|", "`"), + Default: fs.Tristate{}, + Advanced: true, + }, { + Name: "use_accept_encoding_gzip", + Help: strings.ReplaceAll(`Whether to send |Accept-Encoding: gzip| header. + +By default, rclone will append |Accept-Encoding: gzip| to the request to download +compressed objects whenever possible. + +However some providers such as Google Cloud Storage may alter the HTTP headers, breaking +the signature of the request. + +A symptom of this would be receiving errors like + + SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. + +In this case, you might want to try disabling this option. `, "|", "`"), Default: fs.Tristate{}, Advanced: true, @@ -2271,6 +2492,45 @@ rclone's choice here. Help: "Endpoint for STS.\n\nLeave blank if using AWS to use the default endpoint for the region.", Provider: "AWS", Advanced: true, + }, { + Name: "use_already_exists", + Help: strings.ReplaceAll(`Set if rclone should report BucketAlreadyExists errors on bucket creation. + +At some point during the evolution of the s3 protocol, AWS started +returning an |AlreadyOwnedByYou| error when attempting to create a +bucket that the user already owned, rather than a +|BucketAlreadyExists| error. + +Unfortunately exactly what has been implemented by s3 clones is a +little inconsistent, some return |AlreadyOwnedByYou|, some return +|BucketAlreadyExists| and some return no error at all. + +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless +|--s3-no-check-bucket| is used). + +If rclone knows the provider can return |AlreadyOwnedByYou| or returns +no error then it can report |BucketAlreadyExists| errors when the user +attempts to create a bucket not owned by them. Otherwise rclone +ignores the |BucketAlreadyExists| error which can lead to confusion. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. +`, "|", "`"), + Default: fs.Tristate{}, + Advanced: true, + }, { + Name: "use_multipart_uploads", + Help: `Set if rclone should use multipart uploads. + +You can change this if you want to disable the use of multipart uploads. +This shouldn't be necessary in normal operation. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. +`, + Default: fs.Tristate{}, + Advanced: true, }, }}) } @@ -2286,10 +2546,7 @@ const ( minChunkSize = fs.SizeSuffix(1024 * 1024 * 5) defaultUploadCutoff = fs.SizeSuffix(200 * 1024 * 1024) maxUploadCutoff = fs.SizeSuffix(5 * 1024 * 1024 * 1024) - minSleep = 10 * time.Millisecond // In case of error, start at 10ms sleep. - - memoryPoolFlushTime = fs.Duration(time.Minute) // flush the cached buffers after this long - memoryPoolUseMmap = false + minSleep = 10 * time.Millisecond // In case of error, start at 10ms sleep. maxExpireDuration = fs.Duration(7 * 24 * time.Hour) // max expiry is 1 week ) @@ -2389,17 +2646,19 @@ type Options struct { NoHead bool `config:"no_head"` NoHeadObject bool `config:"no_head_object"` Enc encoder.MultiEncoder `config:"encoding"` - MemoryPoolFlushTime fs.Duration `config:"memory_pool_flush_time"` - MemoryPoolUseMmap bool `config:"memory_pool_use_mmap"` DisableHTTP2 bool `config:"disable_http2"` DownloadURL string `config:"download_url"` + DirectoryMarkers bool `config:"directory_markers"` UseMultipartEtag fs.Tristate `config:"use_multipart_etag"` UsePresignedRequest bool `config:"use_presigned_request"` Versions bool `config:"versions"` VersionAt fs.Time `config:"version_at"` Decompress bool `config:"decompress"` MightGzip fs.Tristate `config:"might_gzip"` + UseAcceptEncodingGzip fs.Tristate `config:"use_accept_encoding_gzip"` NoSystemMetadata bool `config:"no_system_metadata"` + UseAlreadyExists fs.Tristate `config:"use_already_exists"` + UseMultipartUploads fs.Tristate `config:"use_multipart_uploads"` } // Fs represents a remote s3 server @@ -2418,7 +2677,6 @@ type Fs struct { pacer *fs.Pacer // To pace the API calls srv *http.Client // a plain http client srvRest *rest.Client // the rest connection to the server - pool *pool.Pool // memory pool etagIsNotMD5 bool // if set ETags are not MD5s versioningMu sync.Mutex versioning fs.Tristate // if set bucket is using versions @@ -2655,6 +2913,7 @@ func s3Connection(ctx context.Context, opt *Options, client *http.Client) (*s3.S case v.AccessKeyID == "" && v.SecretAccessKey == "": // if no access key/secret and iam is explicitly disabled then fall back to anon interaction cred = credentials.AnonymousCredentials + fs.Debugf(nil, "Using anonymous credentials - did you mean to set env_auth=true?") case v.AccessKeyID == "": return nil, nil, errors.New("access_key_id not found") case v.SecretAccessKey == "": @@ -2745,13 +3004,23 @@ func checkUploadCutoff(cs fs.SizeSuffix) error { } func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { - err = checkUploadCutoff(cs) + if f.opt.Provider != "Rclone" { + err = checkUploadCutoff(cs) + } if err == nil { old, f.opt.UploadCutoff = f.opt.UploadCutoff, cs } return } +func (f *Fs) setCopyCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + err = checkUploadChunkSize(cs) + if err == nil { + old, f.opt.CopyCutoff = f.opt.CopyCutoff, cs + } + return +} + // setEndpointValueForIDriveE2 gets user region endpoint against the Access Key details by calling the API func setEndpointValueForIDriveE2(m configmap.Mapper) (err error) { value, ok := m.Get(fs.ConfigProvider) @@ -2788,14 +3057,19 @@ func setEndpointValueForIDriveE2(m configmap.Mapper) (err error) { // There should be no testing against opt.Provider anywhere in the // code except in here to localise the setting of the quirks. // -// These should be differences from AWS S3 +// Run the integration tests to check you have the quirks correct. +// +// go test -v -remote NewS3Provider: func setQuirks(opt *Options) { var ( - listObjectsV2 = true - virtualHostStyle = true - urlEncodeListings = true - useMultipartEtag = true - mightGzip = true // assume all providers might gzip until proven otherwise + listObjectsV2 = true // Always use ListObjectsV2 instead of ListObjects + virtualHostStyle = true // Use bucket.provider.com instead of putting the bucket in the URL + urlEncodeListings = true // URL encode the listings to help with control characters + useMultipartEtag = true // Set if Etags for multpart uploads are compatible with AWS + useAcceptEncodingGzip = true // Set Accept-Encoding: gzip + mightGzip = true // assume all providers might use content encoding gzip until proven otherwise + useAlreadyExists = true // Set if provider returns AlreadyOwnedByYou or no error if you try to remake your own bucket + useMultipartUploads = true // Set if provider supports multipart uploads ) switch opt.Provider { case "AWS": @@ -2803,18 +3077,22 @@ func setQuirks(opt *Options) { mightGzip = false // Never auto gzips objects case "Alibaba": useMultipartEtag = false // Alibaba seems to calculate multipart Etags differently from AWS + useAlreadyExists = true // returns 200 OK case "HuaweiOBS": // Huawei OBS PFS is not support listObjectV2, and if turn on the urlEncodeListing, marker will not work and keep list same page forever. urlEncodeListings = false listObjectsV2 = false + useAlreadyExists = false // untested case "Ceph": listObjectsV2 = false virtualHostStyle = false urlEncodeListings = false + useAlreadyExists = false // untested case "ChinaMobile": listObjectsV2 = false virtualHostStyle = false urlEncodeListings = false + useAlreadyExists = false // untested case "Cloudflare": virtualHostStyle = false useMultipartEtag = false // currently multipart Etags are random @@ -2822,75 +3100,111 @@ func setQuirks(opt *Options) { listObjectsV2 = false virtualHostStyle = false urlEncodeListings = false + useAlreadyExists = false // untested case "DigitalOcean": urlEncodeListings = false + useAlreadyExists = false // untested case "Dreamhost": urlEncodeListings = false + useAlreadyExists = false // untested case "IBMCOS": listObjectsV2 = false // untested virtualHostStyle = false urlEncodeListings = false useMultipartEtag = false // untested + useAlreadyExists = false // returns BucketAlreadyExists case "IDrive": virtualHostStyle = false + useAlreadyExists = false // untested case "IONOS": // listObjectsV2 supported - https://api.ionos.com/docs/s3/#Basic-Operations-get-Bucket-list-type-2 virtualHostStyle = false urlEncodeListings = false + useAlreadyExists = false // untested + case "Petabox": + useAlreadyExists = false // untested case "Liara": virtualHostStyle = false urlEncodeListings = false useMultipartEtag = false + useAlreadyExists = false // untested + case "Linode": + useAlreadyExists = true // returns 200 OK case "LyveCloud": useMultipartEtag = false // LyveCloud seems to calculate multipart Etags differently from AWS + useAlreadyExists = false // untested case "Minio": virtualHostStyle = false case "Netease": listObjectsV2 = false // untested urlEncodeListings = false useMultipartEtag = false // untested + useAlreadyExists = false // untested case "RackCorp": // No quirks useMultipartEtag = false // untested + useAlreadyExists = false // untested + case "Rclone": + listObjectsV2 = true + urlEncodeListings = true + virtualHostStyle = false + useMultipartEtag = false + useAlreadyExists = false + // useMultipartUploads = false - set this manually case "Scaleway": // Scaleway can only have 1000 parts in an upload if opt.MaxUploadParts > 1000 { opt.MaxUploadParts = 1000 } urlEncodeListings = false + useAlreadyExists = false // untested case "SeaweedFS": listObjectsV2 = false // untested virtualHostStyle = false urlEncodeListings = false useMultipartEtag = false // untested + useAlreadyExists = false // untested case "StackPath": listObjectsV2 = false // untested virtualHostStyle = false urlEncodeListings = false + useAlreadyExists = false // untested case "Storj": // Force chunk size to >= 64 MiB if opt.ChunkSize < 64*fs.Mebi { opt.ChunkSize = 64 * fs.Mebi } + useAlreadyExists = false // returns BucketAlreadyExists + case "Synology": + useMultipartEtag = false + useAlreadyExists = false // untested case "TencentCOS": listObjectsV2 = false // untested useMultipartEtag = false // untested + useAlreadyExists = false // untested case "Wasabi": - // No quirks + useAlreadyExists = true // returns 200 OK + case "Leviia": + useAlreadyExists = false // untested case "Qiniu": useMultipartEtag = false urlEncodeListings = false - case "Other": - listObjectsV2 = false virtualHostStyle = false - urlEncodeListings = false - useMultipartEtag = false + useAlreadyExists = false // untested + case "GCS": + // Google break request Signature by mutating accept-encoding HTTP header + // https://github.com/rclone/rclone/issues/6670 + useAcceptEncodingGzip = false + useAlreadyExists = true // returns BucketNameUnavailable instead of BucketAlreadyExists but good enough! default: fs.Logf("s3", "s3 provider %q not known - please set correctly", opt.Provider) + fallthrough + case "Other": listObjectsV2 = false virtualHostStyle = false urlEncodeListings = false useMultipartEtag = false + useAlreadyExists = false } // Path Style vs Virtual Host style @@ -2924,6 +3238,28 @@ func setQuirks(opt *Options) { opt.MightGzip.Valid = true opt.MightGzip.Value = mightGzip } + + // set UseAcceptEncodingGzip if not manually set + if !opt.UseAcceptEncodingGzip.Valid { + opt.UseAcceptEncodingGzip.Valid = true + opt.UseAcceptEncodingGzip.Value = useAcceptEncodingGzip + } + + // Has the provider got AlreadyOwnedByYou error? + if !opt.UseAlreadyExists.Valid { + opt.UseAlreadyExists.Valid = true + opt.UseAlreadyExists.Value = useAlreadyExists + } + + // Set the correct use multipart uploads if not manually set + if !opt.UseMultipartUploads.Valid { + opt.UseMultipartUploads.Valid = true + opt.UseMultipartUploads.Value = useMultipartUploads + } + if !opt.UseMultipartUploads.Value { + opt.UploadCutoff = math.MaxInt64 + } + } // setRoot changes the root of the Fs @@ -2957,7 +3293,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e return nil, fmt.Errorf("s3: upload cutoff: %w", err) } if opt.Versions && opt.VersionAt.IsSet() { - return nil, errors.New("s3: cant use --s3-versions and --s3-version-at at the same time") + return nil, errors.New("s3: can't use --s3-versions and --s3-version-at at the same time") } if opt.BucketACL == "" { opt.BucketACL = opt.ACL @@ -3001,12 +3337,6 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e cache: bucket.NewCache(), srv: srv, srvRest: rest.NewClient(fshttp.NewClient(ctx)), - pool: pool.New( - time.Duration(opt.MemoryPoolFlushTime), - int(opt.ChunkSize), - opt.UploadConcurrency*ci.Transfers, - opt.MemoryPoolUseMmap, - ), } if opt.ServerSideEncryption == "aws:kms" || opt.SSECustomerAlgorithm != "" { // From: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html @@ -3038,7 +3368,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e if opt.Provider == "IDrive" { f.features.SetTier = false } + if opt.DirectoryMarkers { + f.features.CanHaveEmptyDirectories = true + } // f.listMultipartUploads() + if !opt.UseMultipartUploads.Value { + fs.Debugf(f, "Disabling multipart uploads") + f.features.OpenChunkWriter = nil + } if f.rootBucket != "" && f.rootDirectory != "" && !opt.NoHeadObject && !strings.HasSuffix(root, "/") { // Check to see if the (bucket,directory) is actually an existing file @@ -3078,6 +3415,7 @@ func (f *Fs) getMetaDataListing(ctx context.Context, wantRemote string) (info *s err = f.list(ctx, listOpt{ bucket: bucket, directory: bucketPath, + prefix: f.rootDirectory, recurse: true, withVersions: f.opt.Versions, findFile: true, @@ -3393,6 +3731,9 @@ func (ls *versionsList) List(ctx context.Context) (resp *s3.ListObjectsV2Output, // Set up the request for next time ls.req.KeyMarker = respVersions.NextKeyMarker ls.req.VersionIdMarker = respVersions.NextVersionIdMarker + if aws.BoolValue(respVersions.IsTruncated) && ls.req.KeyMarker == nil { + return nil, nil, errors.New("s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker") + } // If we are URL encoding then must decode the marker if ls.req.KeyMarker != nil && ls.req.EncodingType != nil { @@ -3478,15 +3819,16 @@ type listOpt struct { findFile bool // if set, it will look for files called (bucket, directory) versionAt fs.Time // if set only show versions <= this time noSkipMarkers bool // if set return dir marker objects + restoreStatus bool // if set return restore status in listing too } // list lists the objects into the function supplied with the opt // supplied. func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { + if opt.prefix != "" { + opt.prefix += "/" + } if !opt.findFile { - if opt.prefix != "" { - opt.prefix += "/" - } if opt.directory != "" { opt.directory += "/" } @@ -3517,6 +3859,10 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { Prefix: &opt.directory, MaxKeys: &f.opt.ListChunk, } + if opt.restoreStatus { + restoreStatus := "RestoreStatus" + req.OptionalObjectAttributes = []*string{&restoreStatus} + } if f.opt.RequesterPays { req.RequestPayer = aws.String(s3.RequestPayerRequester) } @@ -3529,6 +3875,7 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { default: listBucket = f.newV2List(&req) } + foundItems := 0 for { var resp *s3.ListObjectsV2Output var err error @@ -3570,6 +3917,7 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { return err } if !opt.recurse { + foundItems += len(resp.CommonPrefixes) for _, commonPrefix := range resp.CommonPrefixes { if commonPrefix.Prefix == nil { fs.Logf(f, "Nil common prefix received") @@ -3602,6 +3950,7 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { } } } + foundItems += len(resp.Contents) for i, object := range resp.Contents { remote := aws.StringValue(object.Key) if urlEncodeListings { @@ -3616,19 +3965,31 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { fs.Logf(f, "Odd name received %q", remote) continue } + isDirectory := (remote == "" || strings.HasSuffix(remote, "/")) && object.Size != nil && *object.Size == 0 + // is this a directory marker? + if isDirectory { + if opt.noSkipMarkers { + // process directory markers as files + isDirectory = false + } else { + // Don't insert the root directory + if remote == opt.directory { + continue + } + } + } remote = remote[len(opt.prefix):] - isDirectory := remote == "" || strings.HasSuffix(remote, "/") + if isDirectory { + // process directory markers as directories + remote = strings.TrimRight(remote, "/") + } if opt.addBucket { remote = bucket.Join(opt.bucket, remote) } - // is this a directory marker? - if isDirectory && object.Size != nil && *object.Size == 0 && !opt.noSkipMarkers { - continue // skip directory marker - } if versionIDs != nil { - err = fn(remote, object, versionIDs[i], false) + err = fn(remote, object, versionIDs[i], isDirectory) } else { - err = fn(remote, object, nil, false) + err = fn(remote, object, nil, isDirectory) } if err != nil { if err == errEndList { @@ -3641,6 +4002,20 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error { break } } + if f.opt.DirectoryMarkers && foundItems == 0 && opt.directory != "" { + // Determine whether the directory exists or not by whether it has a marker + req := s3.HeadObjectInput{ + Bucket: &opt.bucket, + Key: &opt.directory, + } + _, err := f.headObject(ctx, &req) + if err != nil { + if err == fs.ErrorObjectNotFound { + return fs.ErrorDirNotFound + } + return err + } + } return nil } @@ -3831,10 +4206,70 @@ func (f *Fs) bucketExists(ctx context.Context, bucket string) (bool, error) { return false, err } +// Create directory marker file and parents +func (f *Fs) createDirectoryMarker(ctx context.Context, bucket, dir string) error { + if !f.opt.DirectoryMarkers || bucket == "" { + return nil + } + + // Object to be uploaded + o := &Object{ + fs: f, + meta: map[string]string{ + metaMtime: swift.TimeToFloatString(time.Now()), + }, + } + + for { + _, bucketPath := f.split(dir) + // Don't create the directory marker if it is the bucket or at the very root + if bucketPath == "" { + break + } + o.remote = dir + "/" + + // Check to see if object already exists + _, err := o.headObject(ctx) + if err == nil { + return nil + } + + // Upload it if not + fs.Debugf(o, "Creating directory marker") + content := io.Reader(strings.NewReader("")) + err = o.Update(ctx, content, o) + if err != nil { + return fmt.Errorf("creating directory marker failed: %w", err) + } + + // Now check parent directory exists + dir = path.Dir(dir) + if dir == "/" || dir == "." { + break + } + } + + return nil +} + // Mkdir creates the bucket if it doesn't exist func (f *Fs) Mkdir(ctx context.Context, dir string) error { bucket, _ := f.split(dir) - return f.makeBucket(ctx, bucket) + e := f.makeBucket(ctx, bucket) + if e != nil { + return e + } + return f.createDirectoryMarker(ctx, bucket, dir) +} + +// mkdirParent creates the parent bucket/directory if it doesn't exist +func (f *Fs) mkdirParent(ctx context.Context, remote string) error { + remote = strings.TrimRight(remote, "/") + dir := path.Dir(remote) + if dir == "/" || dir == "." { + dir = "" + } + return f.Mkdir(ctx, dir) } // makeBucket creates the bucket if it doesn't exist @@ -3860,8 +4295,17 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) error { fs.Infof(f, "Bucket %q created with ACL %q", bucket, f.opt.BucketACL) } if awsErr, ok := err.(awserr.Error); ok { - if code := awsErr.Code(); code == "BucketAlreadyOwnedByYou" || code == "BucketAlreadyExists" { + switch awsErr.Code() { + case "BucketAlreadyOwnedByYou": err = nil + case "BucketAlreadyExists", "BucketNameUnavailable": + if f.opt.UseAlreadyExists.Value { + // We can trust BucketAlreadyExists to mean not owned by us, so make it non retriable + err = fserrors.NoRetryError(err) + } else { + // We can't trust BucketAlreadyExists to mean not owned by us, so ignore it + err = nil + } } } return err @@ -3875,6 +4319,18 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) error { // Returns an error if it isn't empty func (f *Fs) Rmdir(ctx context.Context, dir string) error { bucket, directory := f.split(dir) + // Remove directory marker file + if f.opt.DirectoryMarkers && bucket != "" && dir != "" { + o := &Object{ + fs: f, + remote: dir + "/", + } + fs.Debugf(o, "Removing directory marker") + err := o.Remove(ctx) + if err != nil { + return fmt.Errorf("removing directory marker failed: %w", err) + } + } if bucket == "" || directory != "" { return nil } @@ -4073,7 +4529,7 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, return nil, errNotWithVersionAt } dstBucket, dstPath := f.split(remote) - err := f.makeBucket(ctx, dstBucket) + err := f.mkdirParent(ctx, remote) if err != nil { return nil, err } @@ -4098,19 +4554,6 @@ func (f *Fs) Hashes() hash.Set { return hash.Set(hash.MD5) } -func (f *Fs) getMemoryPool(size int64) *pool.Pool { - if size == int64(f.opt.ChunkSize) { - return f.pool - } - - return pool.New( - time.Duration(f.opt.MemoryPoolFlushTime), - int(size), - f.opt.UploadConcurrency*f.ci.Transfers, - f.opt.MemoryPoolUseMmap, - ) -} - // PublicLink generates a public link to the remote path (usually readable by anyone) func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (link string, err error) { if strings.HasSuffix(remote, "/") { @@ -4143,17 +4586,17 @@ to normal storage. Usage Examples: - rclone backend restore s3:bucket/path/to/object [-o priority=PRIORITY] [-o lifetime=DAYS] - rclone backend restore s3:bucket/path/to/directory [-o priority=PRIORITY] [-o lifetime=DAYS] - rclone backend restore s3:bucket [-o priority=PRIORITY] [-o lifetime=DAYS] + rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags - rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard + rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 All the objects shown will be marked for restore, then - rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard + rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 It returns a list of status dictionaries with Remote and Status keys. The Status will be OK if it was successful or an error message @@ -4162,11 +4605,11 @@ if not. [ { "Status": "OK", - "Path": "test.txt" + "Remote": "test.txt" }, { "Status": "OK", - "Path": "test/file4.txt" + "Remote": "test/file4.txt" } ] @@ -4176,6 +4619,46 @@ if not. "lifetime": "Lifetime of the active copy in days", "description": "The optional description for the job.", }, +}, { + Name: "restore-status", + Short: "Show the restore status for objects being restored from GLACIER to normal storage", + Long: `This command can be used to show the status for objects being restored from GLACIER +to normal storage. + +Usage Examples: + + rclone backend restore-status s3:bucket/path/to/object + rclone backend restore-status s3:bucket/path/to/directory + rclone backend restore-status -o all s3:bucket/path/to/directory + +This command does not obey the filters. + +It returns a list of status dictionaries. + + [ + { + "Remote": "file.txt", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": true, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "GLACIER" + }, + { + "Remote": "test.pdf", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": false, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "DEEP_ARCHIVE" + } + ] +`, + Opts: map[string]string{ + "all": "if set then show all objects, not just ones with restore status", + }, }, { Name: "list-multipart-uploads", Short: "List the unfinished multipart uploads", @@ -4253,6 +4736,26 @@ supplied. It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning has been enabled the status can't be set back to "Unversioned". `, +}, { + Name: "set", + Short: "Set command for updating the config parameters.", + Long: `This set command can be used to update the config parameters +for a running s3 backend. + +Usage Examples: + + rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X + +The option keys are named as they are in the config file. + +This rebuilds the connection to the s3 backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn't return anything. +`, }} // Command the backend to run a named command @@ -4332,6 +4835,9 @@ func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[str return out, err } return out, nil + case "restore-status": + _, all := opt["all"] + return f.restoreStatus(ctx, all) case "list-multipart-uploads": return f.listMultipartUploadsAll(ctx) case "cleanup": @@ -4347,11 +4853,77 @@ func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[str return nil, f.CleanUpHidden(ctx) case "versioning": return f.setGetVersioning(ctx, arg...) + case "set": + newOpt := f.opt + err := configstruct.Set(configmap.Simple(opt), &newOpt) + if err != nil { + return nil, fmt.Errorf("reading config: %w", err) + } + c, ses, err := s3Connection(f.ctx, &newOpt, f.srv) + if err != nil { + return nil, fmt.Errorf("updating session: %w", err) + } + f.c = c + f.ses = ses + f.opt = newOpt + keys := []string{} + for k := range opt { + keys = append(keys, k) + } + fs.Logf(f, "Updated config values: %s", strings.Join(keys, ", ")) + return nil, nil default: return nil, fs.ErrorCommandNotFound } } +// Returned from "restore-status" +type restoreStatusOut struct { + Remote string + VersionID *string + RestoreStatus *s3.RestoreStatus + StorageClass *string +} + +// Recursively enumerate the current fs to find objects with a restore status +func (f *Fs) restoreStatus(ctx context.Context, all bool) (out []restoreStatusOut, err error) { + fs.Debugf(f, "all = %v", all) + bucket, directory := f.split("") + out = []restoreStatusOut{} + err = f.list(ctx, listOpt{ + bucket: bucket, + directory: directory, + prefix: f.rootDirectory, + addBucket: f.rootBucket == "", + recurse: true, + withVersions: f.opt.Versions, + versionAt: f.opt.VersionAt, + restoreStatus: true, + }, func(remote string, object *s3.Object, versionID *string, isDirectory bool) error { + entry, err := f.itemToDirEntry(ctx, remote, object, versionID, isDirectory) + if err != nil { + return err + } + if entry != nil { + if o, ok := entry.(*Object); ok && (all || object.RestoreStatus != nil) { + out = append(out, restoreStatusOut{ + Remote: o.remote, + VersionID: o.versionID, + RestoreStatus: object.RestoreStatus, + StorageClass: object.StorageClass, + }) + } + } + return nil + }) + if err != nil { + return nil, err + } + // bucket must be present if listing succeeded + f.cache.MarkOK(bucket) + return out, nil +} + // listMultipartUploads lists all outstanding multipart uploads for (bucket, key) // // Note that rather lazily we treat key as a prefix so it matches @@ -4581,6 +5153,10 @@ func (f *Fs) purge(ctx context.Context, dir string, oldOnly bool) error { if isDirectory { return nil } + // If the root is a dirmarker it will have lost its trailing / + if remote == "" { + remote = "/" + } oi, err := f.newObjectWithInfo(ctx, remote, object, versionID) if err != nil { fs.Errorf(object, "Can't create object %+v", err) @@ -4700,22 +5276,26 @@ func (o *Object) headObject(ctx context.Context) (resp *s3.HeadObjectOutput, err Key: &bucketPath, VersionId: o.versionID, } - if o.fs.opt.RequesterPays { + return o.fs.headObject(ctx, &req) +} + +func (f *Fs) headObject(ctx context.Context, req *s3.HeadObjectInput) (resp *s3.HeadObjectOutput, err error) { + if f.opt.RequesterPays { req.RequestPayer = aws.String(s3.RequestPayerRequester) } - if o.fs.opt.SSECustomerAlgorithm != "" { - req.SSECustomerAlgorithm = &o.fs.opt.SSECustomerAlgorithm + if f.opt.SSECustomerAlgorithm != "" { + req.SSECustomerAlgorithm = &f.opt.SSECustomerAlgorithm } - if o.fs.opt.SSECustomerKey != "" { - req.SSECustomerKey = &o.fs.opt.SSECustomerKey + if f.opt.SSECustomerKey != "" { + req.SSECustomerKey = &f.opt.SSECustomerKey } - if o.fs.opt.SSECustomerKeyMD5 != "" { - req.SSECustomerKeyMD5 = &o.fs.opt.SSECustomerKeyMD5 + if f.opt.SSECustomerKeyMD5 != "" { + req.SSECustomerKeyMD5 = &f.opt.SSECustomerKeyMD5 } - err = o.fs.pacer.Call(func() (bool, error) { + err = f.pacer.Call(func() (bool, error) { var err error - resp, err = o.fs.c.HeadObjectWithContext(ctx, &req) - return o.fs.shouldRetry(ctx, err) + resp, err = f.c.HeadObjectWithContext(ctx, req) + return f.shouldRetry(ctx, err) }) if err != nil { if awsErr, ok := err.(awserr.RequestFailure); ok { @@ -4725,7 +5305,9 @@ func (o *Object) headObject(ctx context.Context) (resp *s3.HeadObjectOutput, err } return nil, err } - o.fs.cache.MarkOK(bucket) + if req.Bucket != nil { + f.cache.MarkOK(*req.Bucket) + } return resp, nil } @@ -4962,7 +5544,9 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Override the automatic decompression in the transport to // download compressed files as-is - httpReq.HTTPRequest.Header.Set("Accept-Encoding", "gzip") + if o.fs.opt.UseAcceptEncodingGzip.Value { + httpReq.HTTPRequest.Header.Set("Accept-Encoding", "gzip") + } for _, option := range options { switch option.(type) { @@ -5030,15 +5614,43 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read var warnStreamUpload sync.Once -func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, size int64, in io.Reader) (wantETag, gotETag string, versionID *string, err error) { - f := o.fs +// state of ChunkWriter +type s3ChunkWriter struct { + chunkSize int64 + size int64 + f *Fs + bucket *string + key *string + uploadID *string + multiPartUploadInput *s3.CreateMultipartUploadInput + completedPartsMu sync.Mutex + completedParts []*s3.CompletedPart + eTag string + versionID string + md5sMu sync.Mutex + md5s []byte + ui uploadInfo + o *Object +} - // make concurrency machinery - concurrency := f.opt.UploadConcurrency - if concurrency < 1 { - concurrency = 1 +// OpenChunkWriter returns the chunk size and a ChunkWriter +// +// Pass in the remote and the src object +// You can also use options to hint at the desired chunk size +func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectInfo, options ...fs.OpenOption) (info fs.ChunkWriterInfo, writer fs.ChunkWriter, err error) { + // Temporary Object under construction + o := &Object{ + fs: f, + remote: remote, + } + ui, err := o.prepareUpload(ctx, src, options) + if err != nil { + return info, nil, fmt.Errorf("failed to prepare upload: %w", err) } - tokens := pacer.NewTokenDispenser(concurrency) + + //structs.SetFrom(&mReq, req) + var mReq s3.CreateMultipartUploadInput + setFrom_s3CreateMultipartUploadInput_s3PutObjectInput(&mReq, ui.req) uploadParts := f.opt.MaxUploadParts if uploadParts < 1 { @@ -5046,9 +5658,10 @@ func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, si } else if uploadParts > maxUploadParts { uploadParts = maxUploadParts } + size := src.Size() // calculate size of parts - partSize := f.opt.ChunkSize + chunkSize := f.opt.ChunkSize // size can be -1 here meaning we don't know the size of the incoming file. We use ChunkSize // buffers here (default 5 MiB). With a maximum number of parts (10,000) this will be a file of @@ -5056,185 +5669,204 @@ func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, si if size == -1 { warnStreamUpload.Do(func() { fs.Logf(f, "Streaming uploads using chunk size %v will have maximum file size of %v", - f.opt.ChunkSize, fs.SizeSuffix(int64(partSize)*int64(uploadParts))) + f.opt.ChunkSize, fs.SizeSuffix(int64(chunkSize)*int64(uploadParts))) }) } else { - partSize = chunksize.Calculator(o, size, uploadParts, f.opt.ChunkSize) + chunkSize = chunksize.Calculator(src, size, uploadParts, chunkSize) } - memPool := f.getMemoryPool(int64(partSize)) - - var mReq s3.CreateMultipartUploadInput - //structs.SetFrom(&mReq, req) - setFrom_s3CreateMultipartUploadInput_s3PutObjectInput(&mReq, req) - var cout *s3.CreateMultipartUploadOutput + var mOut *s3.CreateMultipartUploadOutput err = f.pacer.Call(func() (bool, error) { - var err error - cout, err = f.c.CreateMultipartUploadWithContext(ctx, &mReq) + mOut, err = f.c.CreateMultipartUploadWithContext(ctx, &mReq) return f.shouldRetry(ctx, err) }) if err != nil { - return wantETag, gotETag, nil, fmt.Errorf("multipart upload failed to initialise: %w", err) - } - uid := cout.UploadId - - defer atexit.OnError(&err, func() { - if o.fs.opt.LeavePartsOnError { - return - } - fs.Debugf(o, "Cancelling multipart upload") - errCancel := f.pacer.Call(func() (bool, error) { - _, err := f.c.AbortMultipartUploadWithContext(context.Background(), &s3.AbortMultipartUploadInput{ - Bucket: req.Bucket, - Key: req.Key, - UploadId: uid, - RequestPayer: req.RequestPayer, - }) - return f.shouldRetry(ctx, err) - }) - if errCancel != nil { - fs.Debugf(o, "Failed to cancel multipart upload: %v", errCancel) - } - })() + return info, nil, fmt.Errorf("create multipart upload failed: %w", err) + } + + chunkWriter := &s3ChunkWriter{ + chunkSize: int64(chunkSize), + size: size, + f: f, + bucket: mOut.Bucket, + key: mOut.Key, + uploadID: mOut.UploadId, + multiPartUploadInput: &mReq, + completedParts: make([]*s3.CompletedPart, 0), + ui: ui, + o: o, + } + info = fs.ChunkWriterInfo{ + ChunkSize: int64(chunkSize), + Concurrency: o.fs.opt.UploadConcurrency, + LeavePartsOnError: o.fs.opt.LeavePartsOnError, + } + fs.Debugf(o, "open chunk writer: started multipart upload: %v", *mOut.UploadId) + return info, chunkWriter, err +} - var ( - g, gCtx = errgroup.WithContext(ctx) - finished = false - partsMu sync.Mutex // to protect parts - parts []*s3.CompletedPart - off int64 - md5sMu sync.Mutex - md5s []byte - ) +// add a part number and etag to the completed parts +func (w *s3ChunkWriter) addCompletedPart(partNum *int64, eTag *string) { + w.completedPartsMu.Lock() + defer w.completedPartsMu.Unlock() + w.completedParts = append(w.completedParts, &s3.CompletedPart{ + PartNumber: partNum, + ETag: eTag, + }) +} - addMd5 := func(md5binary *[md5.Size]byte, partNum int64) { - md5sMu.Lock() - defer md5sMu.Unlock() - start := partNum * md5.Size - end := start + md5.Size - if extend := end - int64(len(md5s)); extend > 0 { - md5s = append(md5s, make([]byte, extend)...) - } - copy(md5s[start:end], (*md5binary)[:]) +// addMd5 adds a binary md5 to the md5 calculated so far +func (w *s3ChunkWriter) addMd5(md5binary *[]byte, chunkNumber int64) { + w.md5sMu.Lock() + defer w.md5sMu.Unlock() + start := chunkNumber * md5.Size + end := start + md5.Size + if extend := end - int64(len(w.md5s)); extend > 0 { + w.md5s = append(w.md5s, make([]byte, extend)...) } + copy(w.md5s[start:end], (*md5binary)[:]) +} - for partNum := int64(1); !finished; partNum++ { - // Get a block of memory from the pool and token which limits concurrency. - tokens.Get() - buf := memPool.Get() - - free := func() { - // return the memory and token - memPool.Put(buf) - tokens.Put() - } +// WriteChunk will write chunk number with reader bytes, where chunk number >= 0 +func (w *s3ChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (int64, error) { + if chunkNumber < 0 { + err := fmt.Errorf("invalid chunk number provided: %v", chunkNumber) + return -1, err + } + // Only account after the checksum reads have been done + if do, ok := reader.(pool.DelayAccountinger); ok { + // To figure out this number, do a transfer and if the accounted size is 0 or a + // multiple of what it should be, increase or decrease this number. + do.DelayAccounting(3) + } - // Fail fast, in case an errgroup managed function returns an error - // gCtx is cancelled. There is no point in uploading all the other parts. - if gCtx.Err() != nil { - free() - break + // create checksum of buffer for integrity checking + // currently there is no way to calculate the md5 without reading the chunk a 2nd time (1st read is in uploadMultipart) + // possible in AWS SDK v2 with trailers? + m := md5.New() + currentChunkSize, err := io.Copy(m, reader) + if err != nil { + return -1, err + } + // If no data read and not the first chunk, don't write the chunk + if currentChunkSize == 0 && chunkNumber != 0 { + return 0, nil + } + md5sumBinary := m.Sum([]byte{}) + w.addMd5(&md5sumBinary, int64(chunkNumber)) + md5sum := base64.StdEncoding.EncodeToString(md5sumBinary[:]) + + // S3 requires 1 <= PartNumber <= 10000 + s3PartNumber := aws.Int64(int64(chunkNumber + 1)) + uploadPartReq := &s3.UploadPartInput{ + Body: reader, + Bucket: w.bucket, + Key: w.key, + PartNumber: s3PartNumber, + UploadId: w.uploadID, + ContentMD5: &md5sum, + ContentLength: aws.Int64(currentChunkSize), + RequestPayer: w.multiPartUploadInput.RequestPayer, + SSECustomerAlgorithm: w.multiPartUploadInput.SSECustomerAlgorithm, + SSECustomerKey: w.multiPartUploadInput.SSECustomerKey, + SSECustomerKeyMD5: w.multiPartUploadInput.SSECustomerKeyMD5, + } + var uout *s3.UploadPartOutput + err = w.f.pacer.Call(func() (bool, error) { + // rewind the reader on retry and after reading md5 + _, err = reader.Seek(0, io.SeekStart) + if err != nil { + return false, err } - - // Read the chunk - var n int - n, err = readers.ReadFill(in, buf) // this can never return 0, nil - if err == io.EOF { - if n == 0 && partNum != 1 { // end if no data and if not first chunk - free() - break + uout, err = w.f.c.UploadPartWithContext(ctx, uploadPartReq) + if err != nil { + if chunkNumber <= 8 { + return w.f.shouldRetry(ctx, err) } - finished = true - } else if err != nil { - free() - return wantETag, gotETag, nil, fmt.Errorf("multipart upload failed to read source: %w", err) + // retry all chunks once have done the first few + return true, err } - buf = buf[:n] - - partNum := partNum - fs.Debugf(o, "multipart upload starting chunk %d size %v offset %v/%v", partNum, fs.SizeSuffix(n), fs.SizeSuffix(off), fs.SizeSuffix(size)) - off += int64(n) - g.Go(func() (err error) { - defer free() - partLength := int64(len(buf)) + return false, nil + }) + if err != nil { + return -1, fmt.Errorf("failed to upload chunk %d with %v bytes: %w", chunkNumber+1, currentChunkSize, err) + } - // create checksum of buffer for integrity checking - md5sumBinary := md5.Sum(buf) - addMd5(&md5sumBinary, partNum-1) - md5sum := base64.StdEncoding.EncodeToString(md5sumBinary[:]) + w.addCompletedPart(s3PartNumber, uout.ETag) - err = f.pacer.Call(func() (bool, error) { - uploadPartReq := &s3.UploadPartInput{ - Body: bytes.NewReader(buf), - Bucket: req.Bucket, - Key: req.Key, - PartNumber: &partNum, - UploadId: uid, - ContentMD5: &md5sum, - ContentLength: &partLength, - RequestPayer: req.RequestPayer, - SSECustomerAlgorithm: req.SSECustomerAlgorithm, - SSECustomerKey: req.SSECustomerKey, - SSECustomerKeyMD5: req.SSECustomerKeyMD5, - } - uout, err := f.c.UploadPartWithContext(gCtx, uploadPartReq) - if err != nil { - if partNum <= int64(concurrency) { - return f.shouldRetry(ctx, err) - } - // retry all chunks once have done the first batch - return true, err - } - partsMu.Lock() - parts = append(parts, &s3.CompletedPart{ - PartNumber: &partNum, - ETag: uout.ETag, - }) - partsMu.Unlock() + fs.Debugf(w.o, "multipart upload wrote chunk %d with %v bytes and etag %v", chunkNumber+1, currentChunkSize, *uout.ETag) + return currentChunkSize, err +} - return false, nil - }) - if err != nil { - return fmt.Errorf("multipart upload failed to upload part: %w", err) - } - return nil +// Abort the multipart upload +func (w *s3ChunkWriter) Abort(ctx context.Context) error { + err := w.f.pacer.Call(func() (bool, error) { + _, err := w.f.c.AbortMultipartUploadWithContext(context.Background(), &s3.AbortMultipartUploadInput{ + Bucket: w.bucket, + Key: w.key, + UploadId: w.uploadID, + RequestPayer: w.multiPartUploadInput.RequestPayer, }) - } - err = g.Wait() + return w.f.shouldRetry(ctx, err) + }) if err != nil { - return wantETag, gotETag, nil, err + return fmt.Errorf("failed to abort multipart upload %q: %w", *w.uploadID, err) } + fs.Debugf(w.o, "multipart upload %q aborted", *w.uploadID) + return err +} +// Close and finalise the multipart upload +func (w *s3ChunkWriter) Close(ctx context.Context) (err error) { // sort the completed parts by part number - sort.Slice(parts, func(i, j int) bool { - return *parts[i].PartNumber < *parts[j].PartNumber + sort.Slice(w.completedParts, func(i, j int) bool { + return *w.completedParts[i].PartNumber < *w.completedParts[j].PartNumber }) - var resp *s3.CompleteMultipartUploadOutput - err = f.pacer.Call(func() (bool, error) { - resp, err = f.c.CompleteMultipartUploadWithContext(ctx, &s3.CompleteMultipartUploadInput{ - Bucket: req.Bucket, - Key: req.Key, + err = w.f.pacer.Call(func() (bool, error) { + resp, err = w.f.c.CompleteMultipartUploadWithContext(ctx, &s3.CompleteMultipartUploadInput{ + Bucket: w.bucket, + Key: w.key, MultipartUpload: &s3.CompletedMultipartUpload{ - Parts: parts, + Parts: w.completedParts, }, - RequestPayer: req.RequestPayer, - UploadId: uid, + RequestPayer: w.multiPartUploadInput.RequestPayer, + UploadId: w.uploadID, }) - return f.shouldRetry(ctx, err) + return w.f.shouldRetry(ctx, err) }) if err != nil { - return wantETag, gotETag, nil, fmt.Errorf("multipart upload failed to finalise: %w", err) + return fmt.Errorf("failed to complete multipart upload %q: %w", *w.uploadID, err) } - hashOfHashes := md5.Sum(md5s) - wantETag = fmt.Sprintf("%s-%d", hex.EncodeToString(hashOfHashes[:]), len(parts)) if resp != nil { if resp.ETag != nil { - gotETag = *resp.ETag + w.eTag = *resp.ETag } - versionID = resp.VersionId + if resp.VersionId != nil { + w.versionID = *resp.VersionId + } + } + fs.Debugf(w.o, "multipart upload %q finished", *w.uploadID) + return err +} + +func (o *Object) uploadMultipart(ctx context.Context, src fs.ObjectInfo, in io.Reader, options ...fs.OpenOption) (wantETag, gotETag string, versionID *string, ui uploadInfo, err error) { + chunkWriter, err := multipart.UploadMultipart(ctx, src, in, multipart.UploadMultipartOptions{ + Open: o.fs, + OpenOptions: options, + }) + if err != nil { + return wantETag, gotETag, versionID, ui, err } - return wantETag, gotETag, versionID, nil + + var s3cw *s3ChunkWriter = chunkWriter.(*s3ChunkWriter) + gotETag = s3cw.eTag + versionID = aws.String(s3cw.versionID) + + hashOfHashes := md5.Sum(s3cw.md5s) + wantETag = fmt.Sprintf("%s-%d", hex.EncodeToString(hashOfHashes[:]), len(s3cw.completedParts)) + + return wantETag, gotETag, versionID, s3cw.ui, nil } // unWrapAwsError unwraps AWS errors, looking for a non AWS error @@ -5364,54 +5996,57 @@ func (o *Object) uploadSinglepartPresignedRequest(ctx context.Context, req *s3.P return etag, lastModified, versionID, nil } -// Update the Object from in with modTime and size -func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { - if o.fs.opt.VersionAt.IsSet() { - return errNotWithVersionAt - } +// Info needed for an upload +type uploadInfo struct { + req *s3.PutObjectInput + md5sumHex string +} + +// Prepare object for being uploaded +func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options []fs.OpenOption) (ui uploadInfo, err error) { bucket, bucketPath := o.split() - err := o.fs.makeBucket(ctx, bucket) - if err != nil { - return err + // Create parent dir/bucket if not saving directory marker + if !strings.HasSuffix(o.remote, "/") { + err := o.fs.mkdirParent(ctx, o.remote) + if err != nil { + return ui, err + } } modTime := src.ModTime(ctx) - size := src.Size() - - multipart := size < 0 || size >= int64(o.fs.opt.UploadCutoff) - req := s3.PutObjectInput{ + ui.req = &s3.PutObjectInput{ Bucket: &bucket, ACL: stringPointerOrNil(o.fs.opt.ACL), Key: &bucketPath, } // Fetch metadata if --metadata is in use - meta, err := fs.GetMetadataOptions(ctx, src, options) + meta, err := fs.GetMetadataOptions(ctx, o.fs, src, options) if err != nil { - return fmt.Errorf("failed to read metadata from source object: %w", err) + return ui, fmt.Errorf("failed to read metadata from source object: %w", err) } - req.Metadata = make(map[string]*string, len(meta)+2) + ui.req.Metadata = make(map[string]*string, len(meta)+2) // merge metadata into request and user metadata for k, v := range meta { pv := aws.String(v) k = strings.ToLower(k) if o.fs.opt.NoSystemMetadata { - req.Metadata[k] = pv + ui.req.Metadata[k] = pv continue } switch k { case "cache-control": - req.CacheControl = pv + ui.req.CacheControl = pv case "content-disposition": - req.ContentDisposition = pv + ui.req.ContentDisposition = pv case "content-encoding": - req.ContentEncoding = pv + ui.req.ContentEncoding = pv case "content-language": - req.ContentLanguage = pv + ui.req.ContentLanguage = pv case "content-type": - req.ContentType = pv + ui.req.ContentType = pv case "x-amz-tagging": - req.Tagging = pv + ui.req.Tagging = pv case "tier": // ignore case "mtime": @@ -5424,14 +6059,14 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } case "btime": // write as metadata since we can't set it - req.Metadata[k] = pv + ui.req.Metadata[k] = pv default: - req.Metadata[k] = pv + ui.req.Metadata[k] = pv } } // Set the mtime in the meta data - req.Metadata[metaMtime] = aws.String(swift.TimeToFloatString(modTime)) + ui.req.Metadata[metaMtime] = aws.String(swift.TimeToFloatString(modTime)) // read the md5sum if available // - for non multipart @@ -5440,11 +6075,12 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op // - for multipart provided checksums aren't disabled // - so we can add the md5sum in the metadata as metaMD5Hash var md5sumBase64 string - var md5sumHex string + size := src.Size() + multipart := size < 0 || size >= int64(o.fs.opt.UploadCutoff) if !multipart || !o.fs.opt.DisableChecksum { - md5sumHex, err = src.Hash(ctx, hash.MD5) - if err == nil && matchMd5.MatchString(md5sumHex) { - hashBytes, err := hex.DecodeString(md5sumHex) + ui.md5sumHex, err = src.Hash(ctx, hash.MD5) + if err == nil && matchMd5.MatchString(ui.md5sumHex) { + hashBytes, err := hex.DecodeString(ui.md5sumHex) if err == nil { md5sumBase64 = base64.StdEncoding.EncodeToString(hashBytes) if (multipart || o.fs.etagIsNotMD5) && !o.fs.opt.DisableChecksum { @@ -5452,42 +6088,42 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op // - a multipart upload // - the Etag is not an MD5, eg when using SSE/SSE-C // provided checksums aren't disabled - req.Metadata[metaMD5Hash] = &md5sumBase64 + ui.req.Metadata[metaMD5Hash] = &md5sumBase64 } } } } - // Set the content type it it isn't set already - if req.ContentType == nil { - req.ContentType = aws.String(fs.MimeType(ctx, src)) + // Set the content type if it isn't set already + if ui.req.ContentType == nil { + ui.req.ContentType = aws.String(fs.MimeType(ctx, src)) } if size >= 0 { - req.ContentLength = &size + ui.req.ContentLength = &size } if md5sumBase64 != "" { - req.ContentMD5 = &md5sumBase64 + ui.req.ContentMD5 = &md5sumBase64 } if o.fs.opt.RequesterPays { - req.RequestPayer = aws.String(s3.RequestPayerRequester) + ui.req.RequestPayer = aws.String(s3.RequestPayerRequester) } if o.fs.opt.ServerSideEncryption != "" { - req.ServerSideEncryption = &o.fs.opt.ServerSideEncryption + ui.req.ServerSideEncryption = &o.fs.opt.ServerSideEncryption } if o.fs.opt.SSECustomerAlgorithm != "" { - req.SSECustomerAlgorithm = &o.fs.opt.SSECustomerAlgorithm + ui.req.SSECustomerAlgorithm = &o.fs.opt.SSECustomerAlgorithm } if o.fs.opt.SSECustomerKey != "" { - req.SSECustomerKey = &o.fs.opt.SSECustomerKey + ui.req.SSECustomerKey = &o.fs.opt.SSECustomerKey } if o.fs.opt.SSECustomerKeyMD5 != "" { - req.SSECustomerKeyMD5 = &o.fs.opt.SSECustomerKeyMD5 + ui.req.SSECustomerKeyMD5 = &o.fs.opt.SSECustomerKeyMD5 } if o.fs.opt.SSEKMSKeyID != "" { - req.SSEKMSKeyId = &o.fs.opt.SSEKMSKeyID + ui.req.SSEKMSKeyId = &o.fs.opt.SSEKMSKeyID } if o.fs.opt.StorageClass != "" { - req.StorageClass = &o.fs.opt.StorageClass + ui.req.StorageClass = &o.fs.opt.StorageClass } // Apply upload options for _, option := range options { @@ -5497,22 +6133,22 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op case "": // ignore case "cache-control": - req.CacheControl = aws.String(value) + ui.req.CacheControl = aws.String(value) case "content-disposition": - req.ContentDisposition = aws.String(value) + ui.req.ContentDisposition = aws.String(value) case "content-encoding": - req.ContentEncoding = aws.String(value) + ui.req.ContentEncoding = aws.String(value) case "content-language": - req.ContentLanguage = aws.String(value) + ui.req.ContentLanguage = aws.String(value) case "content-type": - req.ContentType = aws.String(value) + ui.req.ContentType = aws.String(value) case "x-amz-tagging": - req.Tagging = aws.String(value) + ui.req.Tagging = aws.String(value) default: const amzMetaPrefix = "x-amz-meta-" if strings.HasPrefix(lowerKey, amzMetaPrefix) { metaKey := lowerKey[len(amzMetaPrefix):] - req.Metadata[metaKey] = aws.String(value) + ui.req.Metadata[metaKey] = aws.String(value) } else { fs.Errorf(o, "Don't know how to set key %q on upload", key) } @@ -5520,30 +6156,48 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } // Check metadata keys and values are valid - for key, value := range req.Metadata { + for key, value := range ui.req.Metadata { if !httpguts.ValidHeaderFieldName(key) { fs.Errorf(o, "Dropping invalid metadata key %q", key) - delete(req.Metadata, key) + delete(ui.req.Metadata, key) } else if value == nil { fs.Errorf(o, "Dropping nil metadata value for key %q", key) - delete(req.Metadata, key) + delete(ui.req.Metadata, key) } else if !httpguts.ValidHeaderFieldValue(*value) { fs.Errorf(o, "Dropping invalid metadata value %q for key %q", *value, key) - delete(req.Metadata, key) + delete(ui.req.Metadata, key) } } + return ui, nil +} + +// Update the Object from in with modTime and size +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { + if o.fs.opt.VersionAt.IsSet() { + return errNotWithVersionAt + } + size := src.Size() + multipart := size < 0 || size >= int64(o.fs.opt.UploadCutoff) + var wantETag string // Multipart upload Etag to check var gotETag string // Etag we got from the upload var lastModified time.Time // Time we got from the upload var versionID *string // versionID we got from the upload + var err error + var ui uploadInfo if multipart { - wantETag, gotETag, versionID, err = o.uploadMultipart(ctx, &req, size, in) + wantETag, gotETag, versionID, ui, err = o.uploadMultipart(ctx, src, in, options...) } else { + ui, err = o.prepareUpload(ctx, src, options) + if err != nil { + return fmt.Errorf("failed to prepare upload: %w", err) + } + if o.fs.opt.UsePresignedRequest { - gotETag, lastModified, versionID, err = o.uploadSinglepartPresignedRequest(ctx, &req, size, in) + gotETag, lastModified, versionID, err = o.uploadSinglepartPresignedRequest(ctx, ui.req, size, in) } else { - gotETag, lastModified, versionID, err = o.uploadSinglepartPutObject(ctx, &req, size, in) + gotETag, lastModified, versionID, err = o.uploadSinglepartPutObject(ctx, ui.req, size, in) } } if err != nil { @@ -5563,8 +6217,8 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if o.fs.opt.NoHead && size >= 0 { head = new(s3.HeadObjectOutput) //structs.SetFrom(head, &req) - setFrom_s3HeadObjectOutput_s3PutObjectInput(head, &req) - head.ETag = &md5sumHex // doesn't matter quotes are missing + setFrom_s3HeadObjectOutput_s3PutObjectInput(head, ui.req) + head.ETag = &ui.md5sumHex // doesn't matter quotes are missing head.ContentLength = &size // We get etag back from single and multipart upload so fill it in here if gotETag != "" { @@ -5695,23 +6349,24 @@ func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) setMetadata("content-disposition", o.contentDisposition) setMetadata("content-encoding", o.contentEncoding) setMetadata("content-language", o.contentLanguage) - setMetadata("tier", o.storageClass) + metadata["tier"] = o.GetTier() return metadata, nil } // Check the interfaces are satisfied var ( - _ fs.Fs = &Fs{} - _ fs.Purger = &Fs{} - _ fs.Copier = &Fs{} - _ fs.PutStreamer = &Fs{} - _ fs.ListRer = &Fs{} - _ fs.Commander = &Fs{} - _ fs.CleanUpper = &Fs{} - _ fs.Object = &Object{} - _ fs.MimeTyper = &Object{} - _ fs.GetTierer = &Object{} - _ fs.SetTierer = &Object{} - _ fs.Metadataer = &Object{} + _ fs.Fs = &Fs{} + _ fs.Purger = &Fs{} + _ fs.Copier = &Fs{} + _ fs.PutStreamer = &Fs{} + _ fs.ListRer = &Fs{} + _ fs.Commander = &Fs{} + _ fs.CleanUpper = &Fs{} + _ fs.OpenChunkWriter = &Fs{} + _ fs.Object = &Object{} + _ fs.MimeTyper = &Object{} + _ fs.GetTierer = &Object{} + _ fs.SetTierer = &Object{} + _ fs.Metadataer = &Object{} ) diff --git a/backend/s3/s3_internal_test.go b/backend/s3/s3_internal_test.go index 9d22ca69bef42..4e34b1c27db7f 100644 --- a/backend/s3/s3_internal_test.go +++ b/backend/s3/s3_internal_test.go @@ -6,15 +6,20 @@ import ( "context" "crypto/md5" "fmt" + "path" + "strings" "testing" "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/s3" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/cache" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/fstest/fstests" + "github.com/rclone/rclone/lib/bucket" "github.com/rclone/rclone/lib/random" "github.com/rclone/rclone/lib/version" "github.com/stretchr/testify/assert" @@ -250,7 +255,8 @@ func (f *Fs) InternalTestVersions(t *testing.T) { time.Sleep(2 * time.Second) // Create an object - const fileName = "test-versions.txt" + const dirName = "versions" + const fileName = dirName + "/" + "test-versions.txt" contents := random.String(100) item := fstest.NewItem(fileName, contents, fstest.Time("2001-05-06T04:05:06.499999999Z")) obj := fstests.PutTestContents(ctx, t, f, &item, contents, true) @@ -280,11 +286,12 @@ func (f *Fs) InternalTestVersions(t *testing.T) { }() // Read the contents - entries, err := f.List(ctx, "") + entries, err := f.List(ctx, dirName) require.NoError(t, err) tests := 0 var fileNameVersion string for _, entry := range entries { + t.Log(entry) remote := entry.Remote() if remote == fileName { t.Run("ReadCurrent", func(t *testing.T) { @@ -309,6 +316,23 @@ func (f *Fs) InternalTestVersions(t *testing.T) { require.NotNil(t, o) assert.Equal(t, int64(100), o.Size(), o.Remote()) }) + + // Check we can make a NewFs from that object with a version suffix + t.Run("NewFs", func(t *testing.T) { + newPath := bucket.Join(fs.ConfigStringFull(f), fileNameVersion) + // Make sure --s3-versions is set in the config of the new remote + fs.Debugf(nil, "oldPath = %q", newPath) + lastColon := strings.LastIndex(newPath, ":") + require.True(t, lastColon >= 0) + newPath = newPath[:lastColon] + ",versions" + newPath[lastColon:] + fs.Debugf(nil, "newPath = %q", newPath) + fNew, err := cache.Get(ctx, newPath) + // This should return pointing to a file + require.Equal(t, fs.ErrorIsFile, err) + require.NotNil(t, fNew) + // With the directory the directory above + assert.Equal(t, dirName, path.Base(fs.ConfigStringFull(fNew))) + }) }) t.Run("VersionAt", func(t *testing.T) { @@ -370,6 +394,41 @@ func (f *Fs) InternalTestVersions(t *testing.T) { } }) + t.Run("Mkdir", func(t *testing.T) { + // Test what happens when we create a bucket we already own and see whether the + // quirk is set correctly + req := s3.CreateBucketInput{ + Bucket: &f.rootBucket, + ACL: stringPointerOrNil(f.opt.BucketACL), + } + if f.opt.LocationConstraint != "" { + req.CreateBucketConfiguration = &s3.CreateBucketConfiguration{ + LocationConstraint: &f.opt.LocationConstraint, + } + } + err := f.pacer.Call(func() (bool, error) { + _, err := f.c.CreateBucketWithContext(ctx, &req) + return f.shouldRetry(ctx, err) + }) + var errString string + if err == nil { + errString = "No Error" + } else if awsErr, ok := err.(awserr.Error); ok { + errString = awsErr.Code() + } else { + assert.Fail(t, "Unknown error %T %v", err, err) + } + t.Logf("Creating a bucket we already have created returned code: %s", errString) + switch errString { + case "BucketAlreadyExists": + assert.False(t, f.opt.UseAlreadyExists.Value, "Need to clear UseAlreadyExists quirk") + case "No Error", "BucketAlreadyOwnedByYou": + assert.True(t, f.opt.UseAlreadyExists.Value, "Need to set UseAlreadyExists quirk") + default: + assert.Fail(t, "Unknown error string %q", errString) + } + }) + t.Run("Cleanup", func(t *testing.T) { require.NoError(t, f.CleanUpHidden(ctx)) items := append([]fstest.Item{newItem}, fstests.InternalTestFiles...) diff --git a/backend/s3/s3_test.go b/backend/s3/s3_test.go index e226878a505c8..3415bebf2eef9 100644 --- a/backend/s3/s3_test.go +++ b/backend/s3/s3_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/fstest/fstests" ) @@ -20,6 +21,24 @@ func TestIntegration(t *testing.T) { }) } +func TestIntegration2(t *testing.T) { + if *fstest.RemoteName != "" { + t.Skip("skipping as -remote is set") + } + name := "TestS3" + fstests.Run(t, &fstests.Opt{ + RemoteName: name + ":", + NilObject: (*Object)(nil), + TiersToTest: []string{"STANDARD", "STANDARD_IA"}, + ChunkedUpload: fstests.ChunkedUploadConfig{ + MinChunkSize: minChunkSize, + }, + ExtraConfig: []fstests.ExtraConfigItem{ + {Name: name, Key: "directory_markers", Value: "true"}, + }, + }) +} + func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadChunkSize(cs) } @@ -28,4 +47,12 @@ func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadCutoff(cs) } -var _ fstests.SetUploadChunkSizer = (*Fs)(nil) +func (f *Fs) SetCopyCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setCopyCutoff(cs) +} + +var ( + _ fstests.SetUploadChunkSizer = (*Fs)(nil) + _ fstests.SetUploadCutoffer = (*Fs)(nil) + _ fstests.SetCopyCutoffer = (*Fs)(nil) +) diff --git a/backend/s3/v2sign.go b/backend/s3/v2sign.go index d31cbeb714340..12e41f0b6226c 100644 --- a/backend/s3/v2sign.go +++ b/backend/s3/v2sign.go @@ -14,6 +14,7 @@ import ( // URL parameters that need to be added to the signature var s3ParamsToSign = map[string]struct{}{ + "delete": {}, "acl": {}, "location": {}, "logging": {}, diff --git a/backend/seafile/renew_test.go b/backend/seafile/renew_test.go index 610f553fdd872..845693e44cc4e 100644 --- a/backend/seafile/renew_test.go +++ b/backend/seafile/renew_test.go @@ -17,17 +17,17 @@ func TestShouldAllowShutdownTwice(t *testing.T) { } func TestRenewalInTimeLimit(t *testing.T) { - var count int64 + var count atomic.Int64 renew := NewRenew(100*time.Millisecond, func() error { - atomic.AddInt64(&count, 1) + count.Add(1) return nil }) time.Sleep(time.Second) renew.Shutdown() // there's no guarantee the CI agent can handle a simple goroutine - renewCount := atomic.LoadInt64(&count) + renewCount := count.Load() t.Logf("renew count = %d", renewCount) assert.Greater(t, renewCount, int64(0)) assert.Less(t, renewCount, int64(11)) diff --git a/backend/seafile/seafile.go b/backend/seafile/seafile.go index 58dfd79c21fad..3fa3e317a5a79 100644 --- a/backend/seafile/seafile.go +++ b/backend/seafile/seafile.go @@ -67,15 +67,18 @@ func init() { Value: "https://cloud.seafile.com/", Help: "Connect to cloud.seafile.com.", }}, + Sensitive: true, }, { - Name: configUser, - Help: "User name (usually email address).", - Required: true, + Name: configUser, + Help: "User name (usually email address).", + Required: true, + Sensitive: true, }, { // Password is not required, it will be left blank for 2FA Name: configPassword, Help: "Password.", IsPassword: true, + Sensitive: true, }, { Name: config2FA, Help: "Two-factor authentication ('true' if the account has 2FA enabled).", @@ -87,6 +90,7 @@ func init() { Name: configLibraryKey, Help: "Library password (for encrypted libraries only).\n\nLeave blank if you pass it through the command line.", IsPassword: true, + Sensitive: true, }, { Name: configCreateLibrary, Help: "Should rclone create a library if it doesn't exist.", @@ -94,9 +98,10 @@ func init() { Default: false, }, { // Keep the authentication token after entering the 2FA code - Name: configAuthToken, - Help: "Authentication token.", - Hide: fs.OptionHideBoth, + Name: configAuthToken, + Help: "Authentication token.", + Hide: fs.OptionHideBoth, + Sensitive: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, diff --git a/backend/seafile/webapi.go b/backend/seafile/webapi.go index cf3e77bda55e7..d3ebe3fde0dad 100644 --- a/backend/seafile/webapi.go +++ b/backend/seafile/webapi.go @@ -953,11 +953,9 @@ func (f *Fs) emptyLibraryTrash(ctx context.Context, libraryID string) error { return nil } -// === API v2 from the official documentation, but that have been replaced by the much better v2.1 (undocumented as of Apr 2020) -// === getDirectoryEntriesAPIv2 is needed to keep compatibility with seafile v6, -// === the others can probably be removed after the API v2.1 is documented - func (f *Fs) getDirectoryEntriesAPIv2(ctx context.Context, libraryID, dirPath string) ([]api.DirEntry, error) { + // API v2 from the official documentation, but that have been replaced by the much better v2.1 (undocumented as of Apr 2020) + // getDirectoryEntriesAPIv2 is needed to keep compatibility with seafile v6. // API Documentation // https://download.seafile.com/published/web-api/v2.1/directories.md#user-content-List%20Items%20in%20Directory if libraryID == "" { @@ -1001,95 +999,3 @@ func (f *Fs) getDirectoryEntriesAPIv2(ctx context.Context, libraryID, dirPath st } return result, nil } - -func (f *Fs) copyFileAPIv2(ctx context.Context, srcLibraryID, srcPath, dstLibraryID, dstPath string) (*api.FileInfo, error) { - // API Documentation - // https://download.seafile.com/published/web-api/v2.1/file.md#user-content-Copy%20File - if srcLibraryID == "" || dstLibraryID == "" { - return nil, errors.New("libraryID and/or file path argument(s) missing") - } - srcPath = path.Join("/", srcPath) - dstPath = path.Join("/", dstPath) - - // Older API does not seem to accept JSON input here either - postParameters := url.Values{ - "operation": {"copy"}, - "dst_repo": {dstLibraryID}, - "dst_dir": {f.opt.Enc.FromStandardPath(dstPath)}, - } - opts := rest.Opts{ - Method: "POST", - Path: APIv20 + srcLibraryID + "/file/", - Parameters: url.Values{"p": {f.opt.Enc.FromStandardPath(srcPath)}}, - ContentType: "application/x-www-form-urlencoded", - Body: bytes.NewBuffer([]byte(postParameters.Encode())), - } - result := &api.FileInfo{} - var resp *http.Response - var err error - err = f.pacer.Call(func() (bool, error) { - resp, err = f.srv.Call(ctx, &opts) - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - if resp != nil { - if resp.StatusCode == 401 || resp.StatusCode == 403 { - return nil, fs.ErrorPermissionDenied - } - } - return nil, fmt.Errorf("failed to copy file %s:'%s' to %s:'%s': %w", srcLibraryID, srcPath, dstLibraryID, dstPath, err) - } - err = rest.DecodeJSON(resp, &result) - if err != nil { - return nil, err - } - return f.decodeFileInfo(result), nil -} - -func (f *Fs) renameFileAPIv2(ctx context.Context, libraryID, filePath, newname string) error { - // API Documentation - // https://download.seafile.com/published/web-api/v2.1/file.md#user-content-Rename%20File - if libraryID == "" || newname == "" { - return errors.New("libraryID and/or file path argument(s) missing") - } - filePath = path.Join("/", filePath) - - // No luck with JSON input with the older api2 - postParameters := url.Values{ - "operation": {"rename"}, - "reloaddir": {"true"}, // This is an undocumented trick to avoid an http code 301 response (found in https://github.com/haiwen/seahub/blob/master/seahub/api2/views.py) - "newname": {f.opt.Enc.FromStandardName(newname)}, - } - - opts := rest.Opts{ - Method: "POST", - Path: APIv20 + libraryID + "/file/", - Parameters: url.Values{"p": {f.opt.Enc.FromStandardPath(filePath)}}, - ContentType: "application/x-www-form-urlencoded", - Body: bytes.NewBuffer([]byte(postParameters.Encode())), - NoRedirect: true, - NoResponse: true, - } - var resp *http.Response - var err error - err = f.pacer.Call(func() (bool, error) { - resp, err = f.srv.Call(ctx, &opts) - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - if resp != nil { - if resp.StatusCode == 301 { - // This is the normal response from the server - return nil - } - if resp.StatusCode == 401 || resp.StatusCode == 403 { - return fs.ErrorPermissionDenied - } - if resp.StatusCode == 404 { - return fs.ErrorObjectNotFound - } - } - return fmt.Errorf("failed to rename file: %w", err) - } - return nil -} diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index c998180c7c6e0..4508d780be3c2 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + iofs "io/fs" "os" "path" "regexp" @@ -26,7 +27,6 @@ import ( "github.com/rclone/rclone/fs/config/configmap" "github.com/rclone/rclone/fs/config/configstruct" "github.com/rclone/rclone/fs/config/obscure" - "github.com/rclone/rclone/fs/fshttp" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/lib/env" "github.com/rclone/rclone/lib/pacer" @@ -58,13 +58,15 @@ func init() { Description: "SSH/SFTP", NewFs: NewFs, Options: []fs.Option{{ - Name: "host", - Help: "SSH host to connect to.\n\nE.g. \"example.com\".", - Required: true, + Name: "host", + Help: "SSH host to connect to.\n\nE.g. \"example.com\".", + Required: true, + Sensitive: true, }, { - Name: "user", - Help: "SSH username.", - Default: currentUser, + Name: "user", + Help: "SSH username.", + Default: currentUser, + Sensitive: true, }, { Name: "port", Help: "SSH port number.", @@ -74,8 +76,9 @@ func init() { Help: "SSH password, leave blank to use ssh-agent.", IsPassword: true, }, { - Name: "key_pem", - Help: "Raw PEM-encoded private key.\n\nIf specified, will override key_file parameter.", + Name: "key_pem", + Help: "Raw PEM-encoded private key.\n\nIf specified, will override key_file parameter.", + Sensitive: true, }, { Name: "key_file", Help: "Path to PEM-encoded private key file.\n\nLeave blank or set key-use-agent to use ssh-agent." + env.ShellExpandHelp, @@ -86,6 +89,7 @@ func init() { Only PEM encrypted key files (old OpenSSH format) are supported. Encrypted keys in the new OpenSSH format can't be used.`, IsPassword: true, + Sensitive: true, }, { Name: "pubkey_file", Help: `Optional path to public key file. @@ -164,7 +168,19 @@ E.g. if shared folders can be found in directories representing volumes: E.g. if home directory can be found in a shared folder called "home": - rclone sync /home/local/directory remote:/home/directory --sftp-path-override /volume1/homes/USER/directory`, + rclone sync /home/local/directory remote:/home/directory --sftp-path-override /volume1/homes/USER/directory + +To specify only the path to the SFTP remote's root, and allow rclone to add any relative subpaths automatically (including unwrapping/decrypting remotes as necessary), add the '@' character to the beginning of the path. + +E.g. the first example above could be rewritten as: + + rclone sync /home/local/directory remote:/directory --sftp-path-override @/volume2 + +Note that when using this method with Synology "home" folders, the full "/homes/USER" path should be specified instead of "/home". + +E.g. the second example above should be rewritten as: + + rclone sync /home/local/directory remote:/homes/USER/directory --sftp-path-override @/volume1`, Advanced: true, }, { Name: "set_modtime", @@ -216,7 +232,16 @@ E.g. if home directory can be found in a shared folder called "home": Default: "", Help: `Specifies the path or command to run a sftp server on the remote host. -The subsystem option is ignored when server_command is defined.`, +The subsystem option is ignored when server_command is defined. + +If adding server_command to the configuration file please note that +it should not be enclosed in quotes, since that will make rclone fail. + +A working example is: + + [remote_name] + type = sftp + server_command = sudo /usr/libexec/openssh/sftp-server`, Advanced: true, }, { Name: "use_fstat", @@ -323,7 +348,7 @@ Pass multiple variables space separated, eg VAR1=value VAR2=value -and pass variables with spaces in in quotes, eg +and pass variables with spaces in quotes, eg "VAR3=value with space" "VAR4=value with space" VAR5=nospacehere @@ -369,6 +394,81 @@ Example: umac-64-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-256-etm@openssh.com `, Advanced: true, + }, { + Name: "host_key_algorithms", + Default: fs.SpaceSepList{}, + Help: `Space separated list of host key algorithms, ordered by preference. + +At least one must match with server configuration. This can be checked for example using ssh -Q HostKeyAlgorithms. + +Note: This can affect the outcome of key negotiation with the server even if server host key validation is not enabled. + +Example: + + ssh-ed25519 ssh-rsa ssh-dss +`, + Advanced: true, + }, { + Name: "ssh", + Default: fs.SpaceSepList{}, + Help: `Path and arguments to external ssh binary. + +Normally rclone will use its internal ssh library to connect to the +SFTP server. However it does not implement all possible ssh options so +it may be desirable to use an external ssh binary. + +Rclone ignores all the internal config if you use this option and +expects you to configure the ssh binary with the user/host/port and +any other options you need. + +**Important** The ssh command must log in without asking for a +password so needs to be configured with keys or certificates. + +Rclone will run the command supplied either with the additional +arguments "-s sftp" to access the SFTP subsystem or with commands such +as "md5sum /path/to/file" appended to read checksums. + +Any arguments with spaces in should be surrounded by "double quotes". + +An example setting might be: + + ssh -o ServerAliveInterval=20 user@example.com + +Note that when using an external ssh binary rclone makes a new ssh +connection for every hash it calculates. +`, + }, { + Name: "socks_proxy", + Default: "", + Help: `Socks 5 proxy host. + +Supports the format user:pass@host:port, user@host:port, host:port. + +Example: + + myUser:myPass@localhost:9005 + `, + Advanced: true, + }, { + Name: "copy_is_hardlink", + Default: false, + Help: `Set to enable server side copies using hardlinks. + +The SFTP protocol does not define a copy command so normally server +side copies are not allowed with the sftp backend. + +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. These +will be implemented by doing a hardlink from the source to the +destination. + +Not all sftp servers support this. + +Note that hardlinking two files together will use no additional space +as the source and the destination will be the same file. + +This feature may be useful backups made with --copy-dest.`, + Advanced: true, }}, } fs.Register(fsi) @@ -407,6 +507,10 @@ type Options struct { Ciphers fs.SpaceSepList `config:"ciphers"` KeyExchange fs.SpaceSepList `config:"key_exchange"` MACs fs.SpaceSepList `config:"macs"` + HostKeyAlgorithms fs.SpaceSepList `config:"host_key_algorithms"` + SSH fs.SpaceSepList `config:"ssh"` + SocksProxy string `config:"socks_proxy"` + CopyIsHardlink bool `config:"copy_is_hardlink"` } // Fs stores the interface to the remote SFTP files @@ -429,7 +533,7 @@ type Fs struct { drain *time.Timer // used to drain the pool when we stop using the connections pacer *fs.Pacer // pacer for operations savedpswd string - sessions int32 // count in use sessions + sessions atomic.Int32 // count in use sessions } // Object is a remote SFTP file that has been stat'd (so it exists, but is not necessarily open for reading) @@ -443,41 +547,16 @@ type Object struct { sha1sum *string // Cached SHA1 checksum } -// dial starts a client connection to the given SSH server. It is a -// convenience function that connects to the given network address, -// initiates the SSH handshake, and then sets up a Client. -func (f *Fs) dial(ctx context.Context, network, addr string, sshConfig *ssh.ClientConfig) (*ssh.Client, error) { - dialer := fshttp.NewDialer(ctx) - conn, err := dialer.Dial(network, addr) - if err != nil { - return nil, err - } - c, chans, reqs, err := ssh.NewClientConn(conn, addr, sshConfig) - if err != nil { - return nil, err - } - fs.Debugf(f, "New connection %s->%s to %q", c.LocalAddr(), c.RemoteAddr(), c.ServerVersion()) - return ssh.NewClient(c, chans, reqs), nil -} - // conn encapsulates an ssh client and corresponding sftp client type conn struct { - sshClient *ssh.Client + sshClient sshClient sftpClient *sftp.Client err chan error } // Wait for connection to close func (c *conn) wait() { - c.err <- c.sshClient.Conn.Wait() -} - -// Send a keepalive over the ssh connection -func (c *conn) sendKeepAlive() { - _, _, err := c.sshClient.SendRequest("keepalive@openssh.com", true, nil) - if err != nil { - fs.Debugf(nil, "Failed to send keep alive: %v", err) - } + c.err <- c.sshClient.Wait() } // Send keepalives every interval over the ssh connection until done is closed @@ -489,7 +568,7 @@ func (c *conn) sendKeepAlives(interval time.Duration) (done chan struct{}) { for { select { case <-t.C: - c.sendKeepAlive() + c.sshClient.SendKeepAlive() case <-done: return } @@ -522,17 +601,17 @@ func (c *conn) closed() error { // // Call removeSession() when done func (f *Fs) addSession() { - atomic.AddInt32(&f.sessions, 1) + f.sessions.Add(1) } // Show the ssh session is no longer in use func (f *Fs) removeSession() { - atomic.AddInt32(&f.sessions, -1) + f.sessions.Add(-1) } // getSessions shows whether there are any sessions in use func (f *Fs) getSessions() int32 { - return atomic.LoadInt32(&f.sessions) + return f.sessions.Load() } // Open a new connection to the SFTP server. @@ -541,7 +620,11 @@ func (f *Fs) sftpConnection(ctx context.Context) (c *conn, err error) { c = &conn{ err: make(chan error, 1), } - c.sshClient, err = f.dial(ctx, "tcp", f.opt.Host+":"+f.opt.Port, f.config) + if len(f.opt.SSH) == 0 { + c.sshClient, err = f.newSSHClientInternal(ctx, "tcp", f.opt.Host+":"+f.opt.Port, f.config) + } else { + c.sshClient, err = f.newSSHClientExternal() + } if err != nil { return nil, fmt.Errorf("couldn't connect SSH: %w", err) } @@ -555,7 +638,7 @@ func (f *Fs) sftpConnection(ctx context.Context) (c *conn, err error) { } // Set any environment variables on the ssh.Session -func (f *Fs) setEnv(s *ssh.Session) error { +func (f *Fs) setEnv(s sshSession) error { for _, env := range f.opt.SetEnv { equal := strings.IndexRune(env, '=') if equal < 0 { @@ -572,8 +655,8 @@ func (f *Fs) setEnv(s *ssh.Session) error { // Creates a new SFTP client on conn, using the specified subsystem // or sftp server, and zero or more option functions -func (f *Fs) newSftpClient(conn *ssh.Client, opts ...sftp.ClientOption) (*sftp.Client, error) { - s, err := conn.NewSession() +func (f *Fs) newSftpClient(client sshClient, opts ...sftp.ClientOption) (*sftp.Client, error) { + s, err := client.NewSession() if err != nil { return nil, err } @@ -646,6 +729,9 @@ func (f *Fs) getSftpConnection(ctx context.Context) (c *conn, err error) { // Getwd request func (f *Fs) putSftpConnection(pc **conn, err error) { c := *pc + if !c.sshClient.CanReuse() { + return + } *pc = nil if err != nil { // work out if this is an expected error @@ -724,6 +810,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e if err != nil { return nil, err } + if len(opt.SSH) != 0 && ((opt.User != currentUser && opt.User != "") || opt.Host != "" || (opt.Port != "22" && opt.Port != "")) { + fs.Logf(name, "--sftp-ssh is in use - ignoring user/host/port from config - set in the parameters to --sftp-ssh (remove them from the config to silence this warning)") + } + if opt.User == "" { opt.User = currentUser } @@ -739,6 +829,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e ClientVersion: "SSH-2.0-" + f.ci.UserAgent, } + if len(opt.HostKeyAlgorithms) != 0 { + sshConfig.HostKeyAlgorithms = []string(opt.HostKeyAlgorithms) + } + if opt.KnownHostsFile != "" { hostcallback, err := knownhosts.New(env.ShellExpand(opt.KnownHostsFile)) if err != nil { @@ -772,7 +866,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e pubkeyFile := env.ShellExpand(opt.PubKeyFile) //keyPem := env.ShellExpand(opt.KeyPem) // Add ssh agent-auth if no password or file or key PEM specified - if (opt.Pass == "" && keyFile == "" && !opt.AskPassword && opt.KeyPem == "") || opt.KeyUseAgent { + if (len(opt.SSH) == 0 && opt.Pass == "" && keyFile == "" && !opt.AskPassword && opt.KeyPem == "") || opt.KeyUseAgent { sshAgentClient, _, err := sshagent.New() if err != nil { return nil, fmt.Errorf("couldn't connect to ssh-agent: %w", err) @@ -782,10 +876,32 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e return nil, fmt.Errorf("couldn't read ssh agent signers: %w", err) } if keyFile != "" { + // If `opt.KeyUseAgent` is false, then it's expected that `opt.KeyFile` contains the private key + // and `${opt.KeyFile}.pub` contains the public key. + // + // If `opt.KeyUseAgent` is true, then it's expected that `opt.KeyFile` contains the public key. + // This is how it works with openssh; the `IdentityFile` in openssh config points to the public key. + // It's not necessary to specify the public key explicitly when using ssh-agent, since openssh and rclone + // will try all the keys they find in the ssh-agent until they find one that works. But just like + // `IdentityFile` is used in openssh config to limit the search to one specific key, so does + // `opt.KeyFile` in rclone config limit the search to that specific key. + // + // However, previous versions of rclone would always expect to find the public key in + // `${opt.KeyFile}.pub` even if `opt.KeyUseAgent` was true. So for the sake of backward compatibility + // we still first attempt to read the public key from `${opt.KeyFile}.pub`. But if it fails with + // an `fs.ErrNotExist` then we also try to read the public key from `opt.KeyFile`. pubBytes, err := os.ReadFile(keyFile + ".pub") if err != nil { - return nil, fmt.Errorf("failed to read public key file: %w", err) + if errors.Is(err, iofs.ErrNotExist) && opt.KeyUseAgent { + pubBytes, err = os.ReadFile(keyFile) + if err != nil { + return nil, fmt.Errorf("failed to read public key file: %w", err) + } + } else { + return nil, fmt.Errorf("failed to read public key file: %w", err) + } } + pub, _, _, _, err := ssh.ParseAuthorizedKey(pubBytes) if err != nil { return nil, fmt.Errorf("failed to parse public key file: %w", err) @@ -807,8 +923,8 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } } - // Load key file if specified - if keyFile != "" || opt.KeyPem != "" { + // Load key file as a private key, if specified. This is only needed when not using an ssh agent. + if (keyFile != "" && !opt.KeyUseAgent) || opt.KeyPem != "" { var key []byte if opt.KeyPem == "" { key, err = os.ReadFile(keyFile) @@ -919,7 +1035,7 @@ func (f *Fs) keyboardInteractiveReponse(user, instruction string, questions []st // save it so on reconnection we give back the previous string. // This removes the ability to let the user correct a mistaken entry, // but means that reconnects are transparent. -// We'll re-use config.Pass for this, 'cos we know it's not been +// We'll reuse config.Pass for this, 'cos we know it's not been // specified. func (f *Fs) getPass() (string, error) { for f.savedpswd == "" { @@ -952,7 +1068,12 @@ func NewFsWithConnection(ctx context.Context, f *Fs, name string, root string, m f.features = (&fs.Features{ CanHaveEmptyDirectories: true, SlowHash: true, + PartialUploads: true, }).Fill(ctx, f) + if !opt.CopyIsHardlink { + // Disable server side copy unless --sftp-copy-is-hardlink is set + f.features.Copy = nil + } // Make a connection and pool it to return errors early c, err := f.getSftpConnection(ctx) if err != nil { @@ -969,8 +1090,8 @@ func NewFsWithConnection(ctx context.Context, f *Fs, name string, root string, m fs.Debugf(f, "Failed to get shell session for shell type detection command: %v", err) } else { var stdout, stderr bytes.Buffer - session.Stdout = &stdout - session.Stderr = &stderr + session.SetStdout(&stdout) + session.SetStderr(&stderr) shellCmd := "echo ${ShellId}%ComSpec%" fs.Debugf(f, "Running shell type detection remote command: %s", shellCmd) err = session.Run(shellCmd) @@ -1023,7 +1144,7 @@ func NewFsWithConnection(ctx context.Context, f *Fs, name string, root string, m } } f.putSftpConnection(&c, err) - if root != "" { + if root != "" && !strings.HasSuffix(root, "/") { // Check to see if the root is actually an existing file, // and if so change the filesystem root to its parent directory. oldAbsRoot := f.absRoot @@ -1126,13 +1247,6 @@ func (f *Fs) dirExists(ctx context.Context, dir string) (bool, error) { // found. func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { root := path.Join(f.absRoot, dir) - ok, err := f.dirExists(ctx, root) - if err != nil { - return nil, fmt.Errorf("List failed: %w", err) - } - if !ok { - return nil, fs.ErrorDirNotFound - } sftpDir := root if sftpDir == "" { sftpDir = "." @@ -1144,6 +1258,9 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e infos, err := c.sftpClient.ReadDir(sftpDir) f.putSftpConnection(&c, err) if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, fs.ErrorDirNotFound + } return nil, fmt.Errorf("error listing %q: %w", dir, err) } for _, info := range infos { @@ -1287,10 +1404,17 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, if err != nil { return nil, fmt.Errorf("Move: %w", err) } - err = c.sftpClient.Rename( - srcObj.path(), - path.Join(f.absRoot, remote), - ) + srcPath, dstPath := srcObj.path(), path.Join(f.absRoot, remote) + if _, ok := c.sftpClient.HasExtension("posix-rename@openssh.com"); ok { + err = c.sftpClient.PosixRename(srcPath, dstPath) + } else { + // If haven't got PosixRename then remove source first before renaming + err = c.sftpClient.Remove(dstPath) + if err != nil && !errors.Is(err, iofs.ErrNotExist) { + fs.Errorf(f, "Move: Failed to remove existing file %q: %v", dstPath, err) + } + err = c.sftpClient.Rename(srcPath, dstPath) + } f.putSftpConnection(&c, err) if err != nil { return nil, fmt.Errorf("Move Rename failed: %w", err) @@ -1302,6 +1426,43 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, return dstObj, nil } +// Copy server side copies a remote sftp file object using hardlinks +func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + if !f.opt.CopyIsHardlink { + return nil, fs.ErrorCantCopy + } + srcObj, ok := src.(*Object) + if !ok { + fs.Debugf(src, "Can't copy - not same remote type") + return nil, fs.ErrorCantCopy + } + err := f.mkParentDir(ctx, remote) + if err != nil { + return nil, fmt.Errorf("Copy mkParentDir failed: %w", err) + } + c, err := f.getSftpConnection(ctx) + if err != nil { + return nil, fmt.Errorf("Copy: %w", err) + } + srcPath, dstPath := srcObj.path(), path.Join(f.absRoot, remote) + err = c.sftpClient.Link(srcPath, dstPath) + f.putSftpConnection(&c, err) + if err != nil { + if sftpErr, ok := err.(*sftp.StatusError); ok { + if sftpErr.FxCode() == sftp.ErrSSHFxOpUnsupported { + // Remote doesn't support Link + return nil, fs.ErrorCantCopy + } + } + return nil, fmt.Errorf("Copy failed: %w", err) + } + dstObj, err := f.NewObject(ctx, remote) + if err != nil { + return nil, fmt.Errorf("Copy NewObject failed: %w", err) + } + return dstObj, nil +} + // DirMove moves src, srcRemote to this remote at dstRemote // using server-side move operations. // @@ -1377,8 +1538,8 @@ func (f *Fs) run(ctx context.Context, cmd string) ([]byte, error) { }() var stdout, stderr bytes.Buffer - session.Stdout = &stdout - session.Stderr = &stderr + session.SetStdout(&stdout) + session.SetStderr(&stderr) fs.Debugf(f, "Running remote command: %s", cmd) err = session.Run(cmd) @@ -1503,7 +1664,7 @@ func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { fs.Debugf(f, "About path %q", aboutPath) vfsStats, err = c.sftpClient.StatVFS(aboutPath) } - f.putSftpConnection(&c, err) // Return to pool asap, if running shell command below it will be re-used + f.putSftpConnection(&c, err) // Return to pool asap, if running shell command below it will be reused if vfsStats != nil { total := vfsStats.TotalSpace() free := vfsStats.FreeSpace() @@ -1685,6 +1846,9 @@ func (f *Fs) remotePath(remote string) string { func (f *Fs) remoteShellPath(remote string) string { if f.opt.PathOverride != "" { shellPath := path.Join(f.opt.PathOverride, remote) + if f.opt.PathOverride[0] == '@' { + shellPath = path.Join(strings.TrimPrefix(f.opt.PathOverride, "@"), f.absRoot, remote) + } fs.Debugf(f, "Shell path redirected to %q with option path_override", shellPath) return shellPath } @@ -1942,9 +2106,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if err != nil { return fmt.Errorf("Update: %w", err) } + // Hang on to the connection for the whole upload so it doesn't get reused while we are uploading file, err := c.sftpClient.OpenFile(o.path(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC) - o.fs.putSftpConnection(&c, err) if err != nil { + o.fs.putSftpConnection(&c, err) return fmt.Errorf("Update Create failed: %w", err) } // remove the file if upload failed @@ -1964,14 +2129,18 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } _, err = file.ReadFrom(&sizeReader{Reader: in, size: src.Size()}) if err != nil { + o.fs.putSftpConnection(&c, err) remove() return fmt.Errorf("Update ReadFrom failed: %w", err) } err = file.Close() if err != nil { + o.fs.putSftpConnection(&c, err) remove() return fmt.Errorf("Update Close failed: %w", err) } + // Release connection only when upload has finished so we don't upload multiple files on the same connection + o.fs.putSftpConnection(&c, err) // Set the mod time - this stats the object if o.fs.opt.SetModTime == true err = o.SetModTime(ctx, src.ModTime(ctx)) @@ -2013,6 +2182,7 @@ var ( _ fs.Fs = &Fs{} _ fs.PutStreamer = &Fs{} _ fs.Mover = &Fs{} + _ fs.Copier = &Fs{} _ fs.DirMover = &Fs{} _ fs.Abouter = &Fs{} _ fs.Shutdowner = &Fs{} diff --git a/backend/sftp/sftp_test.go b/backend/sftp/sftp_test.go index 89a2679221328..c5ee136a5ba6a 100644 --- a/backend/sftp/sftp_test.go +++ b/backend/sftp/sftp_test.go @@ -30,3 +30,13 @@ func TestIntegration2(t *testing.T) { NilObject: (*sftp.Object)(nil), }) } + +func TestIntegration3(t *testing.T) { + if *fstest.RemoteName != "" { + t.Skip("skipping as -remote is set") + } + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestSFTPRcloneSSH:", + NilObject: (*sftp.Object)(nil), + }) +} diff --git a/backend/sftp/ssh.go b/backend/sftp/ssh.go new file mode 100644 index 0000000000000..4c6e65aca0e19 --- /dev/null +++ b/backend/sftp/ssh.go @@ -0,0 +1,73 @@ +//go:build !plan9 +// +build !plan9 + +package sftp + +import "io" + +// Interfaces for ssh client and session implemented in ssh_internal.go and ssh_external.go + +// An interface for an ssh client to abstract over internal ssh library and external binary +type sshClient interface { + // Wait blocks until the connection has shut down, and returns the + // error causing the shutdown. + Wait() error + + // SendKeepAlive sends a keepalive message to keep the connection open + SendKeepAlive() + + // Close the connection + Close() error + + // NewSession opens a new sshSession for this sshClient. (A + // session is a remote execution of a program.) + NewSession() (sshSession, error) + + // CanReuse indicates if this client can be reused + CanReuse() bool +} + +// An interface for an ssh session to abstract over internal ssh library and external binary +type sshSession interface { + // Setenv sets an environment variable that will be applied to any + // command executed by Shell or Run. + Setenv(name, value string) error + + // Start runs cmd on the remote host. Typically, the remote + // server passes cmd to the shell for interpretation. + // A Session only accepts one call to Run, Start or Shell. + Start(cmd string) error + + // StdinPipe returns a pipe that will be connected to the + // remote command's standard input when the command starts. + StdinPipe() (io.WriteCloser, error) + + // StdoutPipe returns a pipe that will be connected to the + // remote command's standard output when the command starts. + // There is a fixed amount of buffering that is shared between + // stdout and stderr streams. If the StdoutPipe reader is + // not serviced fast enough it may eventually cause the + // remote command to block. + StdoutPipe() (io.Reader, error) + + // RequestSubsystem requests the association of a subsystem + // with the session on the remote host. A subsystem is a + // predefined command that runs in the background when the ssh + // session is initiated + RequestSubsystem(subsystem string) error + + // Run runs cmd on the remote host. Typically, the remote + // server passes cmd to the shell for interpretation. + // A Session only accepts one call to Run, Start, Shell, Output, + // or CombinedOutput. + Run(cmd string) error + + // Close the session + Close() error + + // Set the stdout + SetStdout(io.Writer) + + // Set the stderr + SetStderr(io.Writer) +} diff --git a/backend/sftp/ssh_external.go b/backend/sftp/ssh_external.go new file mode 100644 index 0000000000000..0ac5e6539f794 --- /dev/null +++ b/backend/sftp/ssh_external.go @@ -0,0 +1,223 @@ +//go:build !plan9 +// +build !plan9 + +package sftp + +import ( + "context" + "errors" + "fmt" + "io" + "os/exec" + "strings" + + "github.com/rclone/rclone/fs" +) + +// Implement the sshClient interface for external ssh programs +type sshClientExternal struct { + f *Fs + session *sshSessionExternal +} + +func (f *Fs) newSSHClientExternal() (sshClient, error) { + return &sshClientExternal{f: f}, nil +} + +// Wait for connection to close +func (s *sshClientExternal) Wait() error { + if s.session == nil { + return nil + } + return s.session.Wait() +} + +// Send a keepalive over the ssh connection +func (s *sshClientExternal) SendKeepAlive() { + // Up to the user to configure -o ServerAliveInterval=20 on their ssh connections +} + +// Close the connection +func (s *sshClientExternal) Close() error { + if s.session == nil { + return nil + } + return s.session.Close() +} + +// NewSession makes a new external SSH connection +func (s *sshClientExternal) NewSession() (sshSession, error) { + session := s.f.newSSHSessionExternal() + if s.session == nil { + fs.Debugf(s.f, "ssh external: creating additional session") + } + return session, nil +} + +// CanReuse indicates if this client can be reused +func (s *sshClientExternal) CanReuse() bool { + if s.session == nil { + return true + } + exited := s.session.exited() + canReuse := !exited && s.session.runningSFTP + // fs.Debugf(s.f, "ssh external: CanReuse %v, exited=%v runningSFTP=%v", canReuse, exited, s.session.runningSFTP) + return canReuse +} + +// Check interfaces +var _ sshClient = &sshClientExternal{} + +// implement the sshSession interface for external ssh binary +type sshSessionExternal struct { + f *Fs + cmd *exec.Cmd + cancel func() + startCalled bool + runningSFTP bool +} + +func (f *Fs) newSSHSessionExternal() *sshSessionExternal { + s := &sshSessionExternal{ + f: f, + } + + // Make a cancellation function for this to call in Close() + ctx, cancel := context.WithCancel(context.Background()) + s.cancel = cancel + + // Connect to a remote host and request the sftp subsystem via + // the 'ssh' command. This assumes that passwordless login is + // correctly configured. + ssh := append([]string(nil), s.f.opt.SSH...) + s.cmd = exec.CommandContext(ctx, ssh[0], ssh[1:]...) + + // Allow the command a short time only to shut down + // FIXME enable when we get rid of go1.19 + // s.cmd.WaitDelay = time.Second + + return s +} + +// Setenv sets an environment variable that will be applied to any +// command executed by Shell or Run. +func (s *sshSessionExternal) Setenv(name, value string) error { + return errors.New("ssh external: can't set environment variables") +} + +const requestSubsystem = "***Subsystem***:" + +// Start runs cmd on the remote host. Typically, the remote +// server passes cmd to the shell for interpretation. +// A Session only accepts one call to Run, Start or Shell. +func (s *sshSessionExternal) Start(cmd string) error { + if s.startCalled { + return errors.New("internal error: ssh external: command already running") + } + s.startCalled = true + + // Adjust the args + if strings.HasPrefix(cmd, requestSubsystem) { + s.cmd.Args = append(s.cmd.Args, "-s", cmd[len(requestSubsystem):]) + s.runningSFTP = true + } else { + s.cmd.Args = append(s.cmd.Args, cmd) + s.runningSFTP = false + } + + fs.Debugf(s.f, "ssh external: running: %v", fs.SpaceSepList(s.cmd.Args)) + + // start the process + err := s.cmd.Start() + if err != nil { + return fmt.Errorf("ssh external: start process: %w", err) + } + + return nil +} + +// RequestSubsystem requests the association of a subsystem +// with the session on the remote host. A subsystem is a +// predefined command that runs in the background when the ssh +// session is initiated +func (s *sshSessionExternal) RequestSubsystem(subsystem string) error { + return s.Start(requestSubsystem + subsystem) +} + +// StdinPipe returns a pipe that will be connected to the +// remote command's standard input when the command starts. +func (s *sshSessionExternal) StdinPipe() (io.WriteCloser, error) { + rd, err := s.cmd.StdinPipe() + if err != nil { + return nil, fmt.Errorf("ssh external: stdin pipe: %w", err) + } + return rd, nil +} + +// StdoutPipe returns a pipe that will be connected to the +// remote command's standard output when the command starts. +// There is a fixed amount of buffering that is shared between +// stdout and stderr streams. If the StdoutPipe reader is +// not serviced fast enough it may eventually cause the +// remote command to block. +func (s *sshSessionExternal) StdoutPipe() (io.Reader, error) { + wr, err := s.cmd.StdoutPipe() + if err != nil { + return nil, fmt.Errorf("ssh external: stdout pipe: %w", err) + } + return wr, nil +} + +// Return whether the command has finished or not +func (s *sshSessionExternal) exited() bool { + return s.cmd.ProcessState != nil +} + +// Wait for the command to exit +func (s *sshSessionExternal) Wait() error { + if s.exited() { + return nil + } + err := s.cmd.Wait() + if err == nil { + fs.Debugf(s.f, "ssh external: command exited OK") + } else { + fs.Debugf(s.f, "ssh external: command exited with error: %v", err) + } + return err +} + +// Run runs cmd on the remote host. Typically, the remote +// server passes cmd to the shell for interpretation. +// A Session only accepts one call to Run, Start, Shell, Output, +// or CombinedOutput. +func (s *sshSessionExternal) Run(cmd string) error { + err := s.Start(cmd) + if err != nil { + return err + } + return s.Wait() +} + +// Close the external ssh +func (s *sshSessionExternal) Close() error { + fs.Debugf(s.f, "ssh external: close") + // Cancel the context which kills the process + s.cancel() + // Wait for it to finish + _ = s.Wait() + return nil +} + +// Set the stdout +func (s *sshSessionExternal) SetStdout(wr io.Writer) { + s.cmd.Stdout = wr +} + +// Set the stderr +func (s *sshSessionExternal) SetStderr(wr io.Writer) { + s.cmd.Stderr = wr +} + +// Check interfaces +var _ sshSession = &sshSessionExternal{} diff --git a/backend/sftp/ssh_internal.go b/backend/sftp/ssh_internal.go new file mode 100644 index 0000000000000..2352601e3d2ef --- /dev/null +++ b/backend/sftp/ssh_internal.go @@ -0,0 +1,101 @@ +//go:build !plan9 +// +build !plan9 + +package sftp + +import ( + "context" + "io" + "net" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/fshttp" + "github.com/rclone/rclone/lib/proxy" + "golang.org/x/crypto/ssh" +) + +// Internal ssh connections with "golang.org/x/crypto/ssh" + +type sshClientInternal struct { + srv *ssh.Client +} + +// newSSHClientInternal starts a client connection to the given SSH server. It is a +// convenience function that connects to the given network address, +// initiates the SSH handshake, and then sets up a Client. +func (f *Fs) newSSHClientInternal(ctx context.Context, network, addr string, sshConfig *ssh.ClientConfig) (sshClient, error) { + + baseDialer := fshttp.NewDialer(ctx) + var ( + conn net.Conn + err error + ) + if f.opt.SocksProxy != "" { + conn, err = proxy.SOCKS5Dial(network, addr, f.opt.SocksProxy, baseDialer) + } else { + conn, err = baseDialer.Dial(network, addr) + } + if err != nil { + return nil, err + } + c, chans, reqs, err := ssh.NewClientConn(conn, addr, sshConfig) + if err != nil { + return nil, err + } + fs.Debugf(f, "New connection %s->%s to %q", c.LocalAddr(), c.RemoteAddr(), c.ServerVersion()) + srv := ssh.NewClient(c, chans, reqs) + return sshClientInternal{srv}, nil +} + +// Wait for connection to close +func (s sshClientInternal) Wait() error { + return s.srv.Conn.Wait() +} + +// Send a keepalive over the ssh connection +func (s sshClientInternal) SendKeepAlive() { + _, _, err := s.srv.SendRequest("keepalive@openssh.com", true, nil) + if err != nil { + fs.Debugf(nil, "Failed to send keep alive: %v", err) + } +} + +// Close the connection +func (s sshClientInternal) Close() error { + return s.srv.Close() +} + +// CanReuse indicates if this client can be reused +func (s sshClientInternal) CanReuse() bool { + return true +} + +// Check interfaces +var _ sshClient = sshClientInternal{} + +// Thin wrapper for *ssh.Session to implement sshSession interface +type sshSessionInternal struct { + *ssh.Session +} + +// Set the stdout +func (s sshSessionInternal) SetStdout(wr io.Writer) { + s.Session.Stdout = wr +} + +// Set the stderr +func (s sshSessionInternal) SetStderr(wr io.Writer) { + s.Session.Stderr = wr +} + +// NewSession makes an sshSession from an sshClient +func (s sshClientInternal) NewSession() (sshSession, error) { + session, err := s.srv.NewSession() + if err != nil { + return nil, err + } + return sshSessionInternal{Session: session}, nil +} + +// Check interfaces +var _ sshSession = sshSessionInternal{} diff --git a/backend/sharefile/sharefile.go b/backend/sharefile/sharefile.go index 11bbefa6a85c5..92e6180104918 100644 --- a/backend/sharefile/sharefile.go +++ b/backend/sharefile/sharefile.go @@ -155,7 +155,7 @@ func init() { CheckAuth: checkAuth, }) }, - Options: []fs.Option{{ + Options: append(oauthutil.SharedOptions, []fs.Option{{ Name: "upload_cutoff", Help: "Cutoff for switching to multipart upload.", Default: defaultUploadCutoff, @@ -182,6 +182,7 @@ standard values here or any folder ID (long hex number ID).`, Value: "top", Help: "Access the home, favorites, and shared folders as well as the connectors.", }}, + Sensitive: true, }, { Name: "chunk_size", Default: defaultChunkSize, @@ -216,7 +217,7 @@ be set manually to something like: https://XXX.sharefile.com encoder.EncodeLeftSpace | encoder.EncodeLeftPeriod | encoder.EncodeInvalidUtf8), - }}, + }}...), }) } @@ -775,8 +776,13 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . } } -// PutStream uploads to the remote path with the modTime given of indeterminate size -func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { +// FIXMEPutStream uploads to the remote path with the modTime given of indeterminate size +// +// PutStream no longer appears to work - the streamed uploads need the +// size specified at the start otherwise we get this error: +// +// upload failed: file size does not match (-2) +func (f *Fs) FIXMEPutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { return f.Put(ctx, in, src, options...) } @@ -1453,12 +1459,12 @@ func (o *Object) ID() string { // Check the interfaces are satisfied var ( - _ fs.Fs = (*Fs)(nil) - _ fs.Purger = (*Fs)(nil) - _ fs.Mover = (*Fs)(nil) - _ fs.DirMover = (*Fs)(nil) - _ fs.Copier = (*Fs)(nil) - _ fs.PutStreamer = (*Fs)(nil) + _ fs.Fs = (*Fs)(nil) + _ fs.Purger = (*Fs)(nil) + _ fs.Mover = (*Fs)(nil) + _ fs.DirMover = (*Fs)(nil) + _ fs.Copier = (*Fs)(nil) + // _ fs.PutStreamer = (*Fs)(nil) _ fs.DirCacheFlusher = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.IDer = (*Object)(nil) diff --git a/backend/sia/sia.go b/backend/sia/sia.go index b86faae61d59a..5d6c92f2d61f9 100644 --- a/backend/sia/sia.go +++ b/backend/sia/sia.go @@ -45,7 +45,8 @@ func init() { Note that siad must run with --disable-api-security to open API port for other hosts (not recommended). Keep default if Sia daemon runs on localhost.`, - Default: "http://127.0.0.1:9980", + Default: "http://127.0.0.1:9980", + Sensitive: true, }, { Name: "api_password", Help: `Sia Daemon API Password. diff --git a/backend/smb/connpool.go b/backend/smb/connpool.go index 7ac5803905947..a34e84f291d73 100644 --- a/backend/smb/connpool.go +++ b/backend/smb/connpool.go @@ -4,10 +4,9 @@ import ( "context" "fmt" "net" - "sync/atomic" "time" - smb2 "github.com/hirochachacha/go-smb2" + smb2 "github.com/cloudsoda/go-smb2" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/config/obscure" @@ -89,26 +88,26 @@ func (c *conn) closed() bool { // // Call removeSession() when done func (f *Fs) addSession() { - atomic.AddInt32(&f.sessions, 1) + f.sessions.Add(1) } // Show the SMB session is no longer in use func (f *Fs) removeSession() { - atomic.AddInt32(&f.sessions, -1) + f.sessions.Add(-1) } // getSessions shows whether there are any sessions in use func (f *Fs) getSessions() int32 { - return atomic.LoadInt32(&f.sessions) + return f.sessions.Load() } // Open a new connection to the SMB server. func (f *Fs) newConnection(ctx context.Context, share string) (c *conn, err error) { // As we are pooling these connections we need to decouple // them from the current context - ctx = context.Background() + bgCtx := context.Background() - c, err = f.dial(ctx, "tcp", f.opt.Host+":"+f.opt.Port) + c, err = f.dial(bgCtx, "tcp", f.opt.Host+":"+f.opt.Port) if err != nil { return nil, fmt.Errorf("couldn't connect SMB: %w", err) } @@ -119,7 +118,7 @@ func (f *Fs) newConnection(ctx context.Context, share string) (c *conn, err erro _ = c.smbSession.Logoff() return nil, fmt.Errorf("couldn't initialize SMB: %w", err) } - c.smbShare = c.smbShare.WithContext(ctx) + c.smbShare = c.smbShare.WithContext(bgCtx) } return c, nil } diff --git a/backend/smb/smb.go b/backend/smb/smb.go index e3fa0e6661a06..37ac065545a64 100644 --- a/backend/smb/smb.go +++ b/backend/smb/smb.go @@ -9,6 +9,7 @@ import ( "path" "strings" "sync" + "sync/atomic" "time" "github.com/rclone/rclone/fs" @@ -41,13 +42,15 @@ func init() { NewFs: NewFs, Options: []fs.Option{{ - Name: "host", - Help: "SMB server hostname to connect to.\n\nE.g. \"example.com\".", - Required: true, + Name: "host", + Help: "SMB server hostname to connect to.\n\nE.g. \"example.com\".", + Required: true, + Sensitive: true, }, { - Name: "user", - Help: "SMB username.", - Default: currentUser, + Name: "user", + Help: "SMB username.", + Default: currentUser, + Sensitive: true, }, { Name: "port", Help: "SMB port number.", @@ -57,9 +60,10 @@ func init() { Help: "SMB password.", IsPassword: true, }, { - Name: "domain", - Help: "Domain name for NTLM authentication.", - Default: "WORKGROUP", + Name: "domain", + Help: "Domain name for NTLM authentication.", + Default: "WORKGROUP", + Sensitive: true, }, { Name: "spn", Help: `Service principal name. @@ -71,6 +75,7 @@ authentication, and it often needs to be set for clusters. For example: Leave blank if not sure. `, + Sensitive: true, }, { Name: "idle_timeout", Default: fs.Duration(60 * time.Second), @@ -136,7 +141,7 @@ type Fs struct { features *fs.Features // optional features pacer *fs.Pacer // pacer for operations - sessions int32 + sessions atomic.Int32 poolMu sync.Mutex pool []*conn drain *time.Timer // used to drain the pool when we stop using the connections @@ -172,6 +177,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e CaseInsensitive: opt.CaseInsensitive, CanHaveEmptyDirectories: true, BucketBased: true, + PartialUploads: true, }).Fill(ctx, f) f.pacer = fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))) @@ -447,7 +453,8 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e func (f *Fs) About(ctx context.Context) (_ *fs.Usage, err error) { share, dir := f.split("/") if share == "" { - return nil, fs.ErrorListBucketRequired + // Just return empty info rather than an error if called on the root + return &fs.Usage{}, nil } dir = f.toSambaPath(dir) @@ -470,6 +477,45 @@ func (f *Fs) About(ctx context.Context) (_ *fs.Usage, err error) { return usage, nil } +// OpenWriterAt opens with a handle for random access writes +// +// Pass in the remote desired and the size if known. +// +// It truncates any existing object +func (f *Fs) OpenWriterAt(ctx context.Context, remote string, size int64) (fs.WriterAtCloser, error) { + var err error + o := &Object{ + fs: f, + remote: remote, + } + share, filename := o.split() + if share == "" || filename == "" { + return nil, fs.ErrorIsDir + } + + err = o.fs.ensureDirectory(ctx, share, filename) + if err != nil { + return nil, fmt.Errorf("failed to make parent directories: %w", err) + } + + filename = o.fs.toSambaPath(filename) + + o.fs.addSession() // Show session in use + defer o.fs.removeSession() + + cn, err := o.fs.getConnection(ctx, share) + if err != nil { + return nil, err + } + + fl, err := cn.smbShare.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644) + if err != nil { + return nil, fmt.Errorf("failed to open: %w", err) + } + + return fl, nil +} + // Shutdown the backend, closing any background tasks and any // cached connections. func (f *Fs) Shutdown(ctx context.Context) error { diff --git a/backend/storj/fs.go b/backend/storj/fs.go index cd36db6f221ff..1200c40d6466f 100644 --- a/backend/storj/fs.go +++ b/backend/storj/fs.go @@ -98,9 +98,10 @@ func init() { }, }}, { - Name: "access_grant", - Help: "Access grant.", - Provider: "existing", + Name: "access_grant", + Help: "Access grant.", + Provider: "existing", + Sensitive: true, }, { Name: "satellite_address", @@ -120,14 +121,16 @@ func init() { }, }, { - Name: "api_key", - Help: "API key.", - Provider: newProvider, + Name: "api_key", + Help: "API key.", + Provider: newProvider, + Sensitive: true, }, { - Name: "passphrase", - Help: "Encryption passphrase.\n\nTo access existing objects enter passphrase used for uploading.", - Provider: newProvider, + Name: "passphrase", + Help: "Encryption passphrase.\n\nTo access existing objects enter passphrase used for uploading.", + Provider: newProvider, + Sensitive: true, }, }, }) @@ -528,7 +531,11 @@ func (f *Fs) NewObject(ctx context.Context, relative string) (_ fs.Object, err e // May create the object even if it returns an error - if so will return the // object and the error, otherwise will return nil and the error func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (_ fs.Object, err error) { - fs.Debugf(f, "cp input ./%s # %+v %d", src.Remote(), options, src.Size()) + return f.put(ctx, in, src, src.Remote(), options...) +} + +func (f *Fs) put(ctx context.Context, in io.Reader, src fs.ObjectInfo, remote string, options ...fs.OpenOption) (_ fs.Object, err error) { + fs.Debugf(f, "cp input ./%s # %+v %d", remote, options, src.Size()) // Reject options we don't support. for _, option := range options { @@ -539,7 +546,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . } } - bucketName, bucketPath := f.absolute(src.Remote()) + bucketName, bucketPath := f.absolute(remote) upload, err := f.project.UploadObject(ctx, bucketName, bucketPath, nil) if err != nil { @@ -549,7 +556,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . if err != nil { aerr := upload.Abort() if aerr != nil && !errors.Is(aerr, uplink.ErrUploadDone) { - fs.Errorf(f, "cp input ./%s %+v: %+v", src.Remote(), options, aerr) + fs.Errorf(f, "cp input ./%s %+v: %+v", remote, options, aerr) } } }() @@ -574,7 +581,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . } err = fserrors.RetryError(err) - fs.Errorf(f, "cp input ./%s %+v: %+v\n", src.Remote(), options, err) + fs.Errorf(f, "cp input ./%s %+v: %+v\n", remote, options, err) return nil, err } @@ -589,11 +596,19 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . return nil, err } err = fserrors.RetryError(errors.New("bucket was not available, now created, the upload must be retried")) + } else if errors.Is(err, uplink.ErrTooManyRequests) { + // Storj has a rate limit of 1 per second of uploading to the same file. + // This produces ErrTooManyRequests here, so we wait 1 second and retry. + // + // See: https://github.com/storj/uplink/issues/149 + fs.Debugf(f, "uploading too fast - sleeping for 1 second: %v", err) + time.Sleep(time.Second) + err = fserrors.RetryError(err) } return nil, err } - return newObjectFromUplink(f, src.Remote(), upload.Info()), nil + return newObjectFromUplink(f, remote, upload.Info()), nil } // PutStream uploads to the remote path with the modTime given of indeterminate diff --git a/backend/storj/object.go b/backend/storj/object.go index 9bb6e67cc4a3a..ea85026afd5ea 100644 --- a/backend/storj/object.go +++ b/backend/storj/object.go @@ -176,9 +176,9 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (_ io.ReadC // But for unknown-sized objects (indicated by src.Size() == -1), Upload should either // return an error or update the object properly (rather than e.g. calling panic). func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { - fs.Debugf(o, "cp input ./%s %+v", src.Remote(), options) + fs.Debugf(o, "cp input ./%s %+v", o.Remote(), options) - oNew, err := o.fs.Put(ctx, in, src, options...) + oNew, err := o.fs.put(ctx, in, src, o.Remote(), options...) if err == nil { *o = *(oNew.(*Object)) diff --git a/backend/sugarsync/sugarsync.go b/backend/sugarsync/sugarsync.go index 1676c09492ea6..da51436433a82 100644 --- a/backend/sugarsync/sugarsync.go +++ b/backend/sugarsync/sugarsync.go @@ -132,42 +132,50 @@ func init() { } return nil, fmt.Errorf("unknown state %q", config.State) }, Options: []fs.Option{{ - Name: "app_id", - Help: "Sugarsync App ID.\n\nLeave blank to use rclone's.", + Name: "app_id", + Help: "Sugarsync App ID.\n\nLeave blank to use rclone's.", + Sensitive: true, }, { - Name: "access_key_id", - Help: "Sugarsync Access Key ID.\n\nLeave blank to use rclone's.", + Name: "access_key_id", + Help: "Sugarsync Access Key ID.\n\nLeave blank to use rclone's.", + Sensitive: true, }, { - Name: "private_access_key", - Help: "Sugarsync Private Access Key.\n\nLeave blank to use rclone's.", + Name: "private_access_key", + Help: "Sugarsync Private Access Key.\n\nLeave blank to use rclone's.", + Sensitive: true, }, { Name: "hard_delete", Help: "Permanently delete files if true\notherwise put them in the deleted files.", Default: false, }, { - Name: "refresh_token", - Help: "Sugarsync refresh token.\n\nLeave blank normally, will be auto configured by rclone.", - Advanced: true, + Name: "refresh_token", + Help: "Sugarsync refresh token.\n\nLeave blank normally, will be auto configured by rclone.", + Advanced: true, + Sensitive: true, }, { - Name: "authorization", - Help: "Sugarsync authorization.\n\nLeave blank normally, will be auto configured by rclone.", - Advanced: true, + Name: "authorization", + Help: "Sugarsync authorization.\n\nLeave blank normally, will be auto configured by rclone.", + Advanced: true, + Sensitive: true, }, { Name: "authorization_expiry", Help: "Sugarsync authorization expiry.\n\nLeave blank normally, will be auto configured by rclone.", Advanced: true, }, { - Name: "user", - Help: "Sugarsync user.\n\nLeave blank normally, will be auto configured by rclone.", - Advanced: true, + Name: "user", + Help: "Sugarsync user.\n\nLeave blank normally, will be auto configured by rclone.", + Advanced: true, + Sensitive: true, }, { - Name: "root_id", - Help: "Sugarsync root id.\n\nLeave blank normally, will be auto configured by rclone.", - Advanced: true, + Name: "root_id", + Help: "Sugarsync root id.\n\nLeave blank normally, will be auto configured by rclone.", + Advanced: true, + Sensitive: true, }, { - Name: "deleted_id", - Help: "Sugarsync deleted folder id.\n\nLeave blank normally, will be auto configured by rclone.", - Advanced: true, + Name: "deleted_id", + Help: "Sugarsync deleted folder id.\n\nLeave blank normally, will be auto configured by rclone.", + Advanced: true, + Sensitive: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, diff --git a/backend/swift/swift.go b/backend/swift/swift.go index 9ee5c76128d82..6fbd740ec0c3a 100644 --- a/backend/swift/swift.go +++ b/backend/swift/swift.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io" - "net/url" "path" "strconv" "strings" @@ -101,7 +100,7 @@ but other operations such as Remove and Copy will fail. func init() { fs.Register(&fs.RegInfo{ Name: "swift", - Description: "OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)", + Description: "OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)", NewFs: NewFs, Options: append([]fs.Option{{ Name: "env_auth", @@ -117,11 +116,13 @@ func init() { }, }, }, { - Name: "user", - Help: "User name to log in (OS_USERNAME).", + Name: "user", + Help: "User name to log in (OS_USERNAME).", + Sensitive: true, }, { - Name: "key", - Help: "API key or password (OS_PASSWORD).", + Name: "key", + Help: "API key or password (OS_PASSWORD).", + Sensitive: true, }, { Name: "auth", Help: "Authentication URL for server (OS_AUTH_URL).", @@ -143,22 +144,30 @@ func init() { }, { Value: "https://auth.cloud.ovh.net/v3", Help: "OVH", + }, { + Value: "https://authenticate.ain.net", + Help: "Blomp Cloud Storage", }}, }, { - Name: "user_id", - Help: "User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID).", + Name: "user_id", + Help: "User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID).", + Sensitive: true, }, { - Name: "domain", - Help: "User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)", + Name: "domain", + Help: "User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME)", + Sensitive: true, }, { - Name: "tenant", - Help: "Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME).", + Name: "tenant", + Help: "Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME).", + Sensitive: true, }, { - Name: "tenant_id", - Help: "Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID).", + Name: "tenant_id", + Help: "Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID).", + Sensitive: true, }, { - Name: "tenant_domain", - Help: "Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME).", + Name: "tenant_domain", + Help: "Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME).", + Sensitive: true, }, { Name: "region", Help: "Region name - optional (OS_REGION_NAME).", @@ -166,17 +175,21 @@ func init() { Name: "storage_url", Help: "Storage URL - optional (OS_STORAGE_URL).", }, { - Name: "auth_token", - Help: "Auth Token from alternate authentication - optional (OS_AUTH_TOKEN).", + Name: "auth_token", + Help: "Auth Token from alternate authentication - optional (OS_AUTH_TOKEN).", + Sensitive: true, }, { - Name: "application_credential_id", - Help: "Application Credential ID (OS_APPLICATION_CREDENTIAL_ID).", + Name: "application_credential_id", + Help: "Application Credential ID (OS_APPLICATION_CREDENTIAL_ID).", + Sensitive: true, }, { - Name: "application_credential_name", - Help: "Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME).", + Name: "application_credential_name", + Help: "Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME).", + Sensitive: true, }, { - Name: "application_credential_secret", - Help: "Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET).", + Name: "application_credential_secret", + Help: "Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET).", + Sensitive: true, }, { Name: "auth_version", Help: "AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION).", @@ -548,7 +561,7 @@ func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *swift.O // returned as 0 bytes in the listing. Correct this here by // making sure we read the full metadata for all 0 byte files. // We don't read the metadata for directory marker objects. - if info != nil && info.Bytes == 0 && info.ContentType != "application/directory" { + if info != nil && info.Bytes == 0 && info.ContentType != "application/directory" && !o.fs.opt.NoLargeObjects { err := o.readMetaData(ctx) // reads info and headers, returning an error if err == fs.ErrorObjectNotFound { // We have a dangling large object here so just return the original metadata @@ -1328,23 +1341,6 @@ func (o *Object) removeSegmentsLargeObject(ctx context.Context, containerSegment return nil } -func (o *Object) getSegmentsDlo(ctx context.Context) (segmentsContainer string, prefix string, err error) { - if err = o.readMetaData(ctx); err != nil { - return - } - dirManifest := o.headers["X-Object-Manifest"] - dirManifest, err = url.PathUnescape(dirManifest) - if err != nil { - return - } - delimiter := strings.Index(dirManifest, "/") - if len(dirManifest) == 0 || delimiter < 0 { - err = errors.New("missing or wrong structure of manifest of Dynamic large object") - return - } - return dirManifest[:delimiter], dirManifest[delimiter+1:], nil -} - // urlEncode encodes a string so that it is a valid URL // // We don't use any of Go's standard methods as we need `/` not @@ -1576,6 +1572,10 @@ func (o *Object) Remove(ctx context.Context) (err error) { // Remove file/manifest first err = o.fs.pacer.Call(func() (bool, error) { err = o.fs.c.ObjectDelete(ctx, container, containerPath) + if err == swift.ObjectNotFound { + fs.Errorf(o, "Dangling object - ignoring: %v", err) + err = nil + } return shouldRetry(ctx, err) }) if err != nil { diff --git a/backend/union/entry.go b/backend/union/entry.go index d794d62262ea7..24ec2f5184f6f 100644 --- a/backend/union/entry.go +++ b/backend/union/entry.go @@ -17,8 +17,9 @@ import ( // This is a wrapped object which returns the Union Fs as its parent type Object struct { *upstream.Object - fs *Fs // what this object is part of - co []upstream.Entry + fs *Fs // what this object is part of + co []upstream.Entry + writebackMu sync.Mutex } // Directory describes a union Directory @@ -34,6 +35,13 @@ type entry interface { candidates() []upstream.Entry } +// Update o with the contents of newO excluding the lock +func (o *Object) update(newO *Object) { + o.Object = newO.Object + o.fs = newO.fs + o.co = newO.co +} + // UnWrapUpstream returns the upstream Object that this Object is wrapping func (o *Object) UnWrapUpstream() *upstream.Object { return o.Object @@ -67,7 +75,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return err } // Update current object - *o = *newO.(*Object) + o.update(newO.(*Object)) return nil } else if err != nil { return err @@ -175,6 +183,25 @@ func (o *Object) SetTier(tier string) error { return do.SetTier(tier) } +// Open opens the file for read. Call Close() on the returned io.ReadCloser +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + // Need some sort of locking to prevent multiple downloads + o.writebackMu.Lock() + defer o.writebackMu.Unlock() + + // FIXME what if correct object is already in o.co + + newObj, err := o.Object.Writeback(ctx) + if err != nil { + return nil, err + } + if newObj != nil { + o.Object = newObj + o.co = append(o.co, newObj) // FIXME should this append or overwrite or update? + } + return o.Object.Object.Open(ctx, options...) +} + // ModTime returns the modification date of the directory // It returns the latest ModTime of all candidates func (d *Directory) ModTime(ctx context.Context) (t time.Time) { diff --git a/backend/union/errors.go b/backend/union/errors.go index 46259b5956d00..ddfd2866d876d 100644 --- a/backend/union/errors.go +++ b/backend/union/errors.go @@ -49,8 +49,7 @@ func (e Errors) Error() string { if len(e) == 0 { buf.WriteString("no error") - } - if len(e) == 1 { + } else if len(e) == 1 { buf.WriteString("1 error: ") } else { fmt.Fprintf(&buf, "%d errors: ", len(e)) @@ -61,8 +60,17 @@ func (e Errors) Error() string { buf.WriteString("; ") } - buf.WriteString(err.Error()) + if err != nil { + buf.WriteString(err.Error()) + } else { + buf.WriteString("nil error") + } } return buf.String() } + +// Unwrap returns the wrapped errors +func (e Errors) Unwrap() []error { + return e +} diff --git a/backend/union/errors_test.go b/backend/union/errors_test.go new file mode 100644 index 0000000000000..3d79a69b061d7 --- /dev/null +++ b/backend/union/errors_test.go @@ -0,0 +1,94 @@ +//go:build go1.20 +// +build go1.20 + +package union + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/assert" +) + +var ( + err1 = errors.New("Error 1") + err2 = errors.New("Error 2") + err3 = errors.New("Error 3") +) + +func TestErrorsMap(t *testing.T) { + es := Errors{ + nil, + err1, + err2, + } + want := Errors{ + err2, + } + got := es.Map(func(e error) error { + if e == err1 { + return nil + } + return e + }) + assert.Equal(t, want, got) +} + +func TestErrorsFilterNil(t *testing.T) { + es := Errors{ + nil, + err1, + nil, + err2, + nil, + } + want := Errors{ + err1, + err2, + } + got := es.FilterNil() + assert.Equal(t, want, got) +} + +func TestErrorsErr(t *testing.T) { + // Check not all nil case + es := Errors{ + nil, + err1, + nil, + err2, + nil, + } + want := Errors{ + err1, + err2, + } + got := es.Err() + + // Check all nil case + assert.Equal(t, want, got) + es = Errors{ + nil, + nil, + nil, + } + assert.Nil(t, es.Err()) +} + +func TestErrorsError(t *testing.T) { + assert.Equal(t, "no error", Errors{}.Error()) + assert.Equal(t, "1 error: Error 1", Errors{err1}.Error()) + assert.Equal(t, "1 error: nil error", Errors{nil}.Error()) + assert.Equal(t, "2 errors: Error 1; Error 2", Errors{err1, err2}.Error()) +} + +func TestErrorsUnwrap(t *testing.T) { + es := Errors{ + err1, + err2, + } + assert.Equal(t, []error{err1, err2}, es.Unwrap()) + assert.True(t, errors.Is(es, err1)) + assert.True(t, errors.Is(es, err2)) + assert.False(t, errors.Is(es, err3)) +} diff --git a/backend/union/policy/policy.go b/backend/union/policy/policy.go index d784c8e29c9cb..cc7623a4d7d51 100644 --- a/backend/union/policy/policy.go +++ b/backend/union/policy/policy.go @@ -3,7 +3,6 @@ package policy import ( "context" "fmt" - "math/rand" "path" "strings" "time" @@ -109,9 +108,7 @@ func findEntry(ctx context.Context, f fs.Fs, remote string) fs.DirEntry { if err != nil { return nil } - // random modtime for root - randomNow := time.Unix(time.Now().Unix()-rand.Int63n(10000), 0) - return fs.NewDir("", randomNow) + return fs.NewDir("", time.Time{}) } found := false for _, e := range entries { diff --git a/backend/union/union.go b/backend/union/union.go index aeb0aeca63df1..eeaed8f31b727 100644 --- a/backend/union/union.go +++ b/backend/union/union.go @@ -756,14 +756,6 @@ func (f *Fs) create(ctx context.Context, path string) ([]*upstream.Fs, error) { return f.createPolicy.Create(ctx, f.upstreams, path) } -func (f *Fs) createEntries(entries ...upstream.Entry) ([]upstream.Entry, error) { - return f.createPolicy.CreateEntries(entries...) -} - -func (f *Fs) search(ctx context.Context, path string) (*upstream.Fs, error) { - return f.searchPolicy.Search(ctx, f.upstreams, path) -} - func (f *Fs) searchEntries(entries ...upstream.Entry) (upstream.Entry, error) { return f.searchPolicy.SearchEntries(entries...) } @@ -809,6 +801,24 @@ func (f *Fs) Shutdown(ctx context.Context) error { return errs.Err() } +// CleanUp the trash in the Fs +// +// Implement this if you have a way of emptying the trash or +// otherwise cleaning up old versions of files. +func (f *Fs) CleanUp(ctx context.Context) error { + errs := Errors(make([]error, len(f.upstreams))) + multithread(len(f.upstreams), func(i int) { + u := f.upstreams[i] + if do := u.Features().CleanUp; do != nil { + err := do(ctx) + if err != nil { + errs[i] = fmt.Errorf("%s: %w", u.Name(), err) + } + } + }) + return errs.Err() +} + // NewFs constructs an Fs from the path. // // The returned Fs is the actual Fs, referenced by remote in the config @@ -867,6 +877,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e opt: *opt, upstreams: usedUpstreams, } + err = upstream.Prepare(f.upstreams) + if err != nil { + return nil, err + } f.actionPolicy, err = policy.Get(opt.ActionPolicy) if err != nil { return nil, err @@ -892,6 +906,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e ReadMetadata: true, WriteMetadata: true, UserMetadata: true, + PartialUploads: true, }).Fill(ctx, f) canMove, slowHash := true, false for _, f := range upstreams { @@ -922,6 +937,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } } + // show that we wrap other backends + features.Overlay = true + f.features = features // Get common intersection of hashes @@ -968,4 +986,5 @@ var ( _ fs.Abouter = (*Fs)(nil) _ fs.ListRer = (*Fs)(nil) _ fs.Shutdowner = (*Fs)(nil) + _ fs.CleanUpper = (*Fs)(nil) ) diff --git a/backend/union/union_test.go b/backend/union/union_test.go index f5a9948f61d4f..b9f4e24e2d393 100644 --- a/backend/union/union_test.go +++ b/backend/union/union_test.go @@ -11,6 +11,11 @@ import ( "github.com/rclone/rclone/fstest/fstests" ) +var ( + unimplementableFsMethods = []string{"UnWrap", "WrapFs", "SetWrapper", "UserInfo", "Disconnect", "PublicLink", "PutUnchecked", "MergeDirs", "OpenWriterAt", "OpenChunkWriter"} + unimplementableObjectMethods = []string{} +) + // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { if *fstest.RemoteName == "" { @@ -18,8 +23,8 @@ func TestIntegration(t *testing.T) { } fstests.Run(t, &fstests.Opt{ RemoteName: *fstest.RemoteName, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, }) } @@ -39,8 +44,8 @@ func TestStandard(t *testing.T) { {Name: name, Key: "create_policy", Value: "epmfs"}, {Name: name, Key: "search_policy", Value: "ff"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, QuickTestOK: true, }) } @@ -61,8 +66,8 @@ func TestRO(t *testing.T) { {Name: name, Key: "create_policy", Value: "epmfs"}, {Name: name, Key: "search_policy", Value: "ff"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, QuickTestOK: true, }) } @@ -83,8 +88,8 @@ func TestNC(t *testing.T) { {Name: name, Key: "create_policy", Value: "epmfs"}, {Name: name, Key: "search_policy", Value: "ff"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, QuickTestOK: true, }) } @@ -105,8 +110,8 @@ func TestPolicy1(t *testing.T) { {Name: name, Key: "create_policy", Value: "lus"}, {Name: name, Key: "search_policy", Value: "all"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, QuickTestOK: true, }) } @@ -127,8 +132,8 @@ func TestPolicy2(t *testing.T) { {Name: name, Key: "create_policy", Value: "rand"}, {Name: name, Key: "search_policy", Value: "ff"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, QuickTestOK: true, }) } @@ -149,8 +154,8 @@ func TestPolicy3(t *testing.T) { {Name: name, Key: "create_policy", Value: "all"}, {Name: name, Key: "search_policy", Value: "all"}, }, - UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, - UnimplementableObjectMethods: []string{"MimeType"}, + UnimplementableFsMethods: unimplementableFsMethods, + UnimplementableObjectMethods: unimplementableObjectMethods, QuickTestOK: true, }) } diff --git a/backend/union/upstream/upstream.go b/backend/union/upstream/upstream.go index 119eb7bb04b31..07bd732d9e2fe 100644 --- a/backend/union/upstream/upstream.go +++ b/backend/union/upstream/upstream.go @@ -16,6 +16,7 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/cache" "github.com/rclone/rclone/fs/fspath" + "github.com/rclone/rclone/fs/operations" ) var ( @@ -25,10 +26,6 @@ var ( // Fs is a wrap of any fs and its configs type Fs struct { - // In order to ensure memory alignment on 32-bit architectures - // when this field is accessed through sync/atomic functions, - // it must be the first entry in the struct - cacheExpiry int64 // usage cache expiry time fs.Fs RootFs fs.Fs RootPath string @@ -37,9 +34,12 @@ type Fs struct { creatable bool usage *fs.Usage // Cache the usage cacheTime time.Duration // cache duration + cacheExpiry atomic.Int64 // usage cache expiry time cacheMutex sync.RWMutex cacheOnce sync.Once cacheUpdate bool // if the cache is updating + writeback bool // writeback to this upstream + writebackFs *Fs // if non zero, writeback to this upstream } // Directory describes a wrapped Directory @@ -73,14 +73,14 @@ func New(ctx context.Context, remote, root string, opt *common.Options) (*Fs, er return nil, err } f := &Fs{ - RootPath: strings.TrimRight(root, "/"), - Opt: opt, - writable: true, - creatable: true, - cacheExpiry: time.Now().Unix(), - cacheTime: time.Duration(opt.CacheTime) * time.Second, - usage: &fs.Usage{}, - } + RootPath: strings.TrimRight(root, "/"), + Opt: opt, + writable: true, + creatable: true, + cacheTime: time.Duration(opt.CacheTime) * time.Second, + usage: &fs.Usage{}, + } + f.cacheExpiry.Store(time.Now().Unix()) if strings.HasSuffix(fsPath, ":ro") { f.writable = false f.creatable = false @@ -89,6 +89,9 @@ func New(ctx context.Context, remote, root string, opt *common.Options) (*Fs, er f.writable = true f.creatable = false fsPath = fsPath[0 : len(fsPath)-3] + } else if strings.HasSuffix(fsPath, ":writeback") { + f.writeback = true + fsPath = fsPath[0 : len(fsPath)-len(":writeback")] } remote = configName + fsPath rFs, err := cache.Get(ctx, remote) @@ -106,6 +109,29 @@ func New(ctx context.Context, remote, root string, opt *common.Options) (*Fs, er return f, err } +// Prepare the configured upstreams as a group +func Prepare(fses []*Fs) error { + writebacks := 0 + var writebackFs *Fs + for _, f := range fses { + if f.writeback { + writebackFs = f + writebacks++ + } + } + if writebacks == 0 { + return nil + } else if writebacks > 1 { + return fmt.Errorf("can only have 1 :writeback not %d", writebacks) + } + for _, f := range fses { + if !f.writeback { + f.writebackFs = writebackFs + } + } + return nil +} + // WrapDirectory wraps an fs.Directory to include the info // of the upstream Fs func (f *Fs) WrapDirectory(e fs.Directory) *Directory { @@ -296,9 +322,31 @@ func (o *Object) Metadata(ctx context.Context) (fs.Metadata, error) { return do.Metadata(ctx) } +// Writeback writes the object back and returns a new object +// +// If it returns nil, nil then the original object is OK +func (o *Object) Writeback(ctx context.Context) (*Object, error) { + if o.f.writebackFs == nil { + return nil, nil + } + newObj, err := operations.Copy(ctx, o.f.writebackFs.Fs, nil, o.Object.Remote(), o.Object) + if err != nil { + return nil, err + } + // newObj could be nil here + if newObj == nil { + fs.Errorf(o, "nil Object returned from operations.Copy") + return nil, nil + } + return &Object{ + Object: newObj, + f: o.f, + }, err +} + // About gets quota information from the Fs func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { - if atomic.LoadInt64(&f.cacheExpiry) <= time.Now().Unix() { + if f.cacheExpiry.Load() <= time.Now().Unix() { err := f.updateUsage() if err != nil { return nil, ErrUsageFieldNotSupported @@ -313,7 +361,7 @@ func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { // // This is returned as 0..math.MaxInt64-1 leaving math.MaxInt64 as a sentinel func (f *Fs) GetFreeSpace() (int64, error) { - if atomic.LoadInt64(&f.cacheExpiry) <= time.Now().Unix() { + if f.cacheExpiry.Load() <= time.Now().Unix() { err := f.updateUsage() if err != nil { return math.MaxInt64 - 1, ErrUsageFieldNotSupported @@ -331,7 +379,7 @@ func (f *Fs) GetFreeSpace() (int64, error) { // // This is returned as 0..math.MaxInt64-1 leaving math.MaxInt64 as a sentinel func (f *Fs) GetUsedSpace() (int64, error) { - if atomic.LoadInt64(&f.cacheExpiry) <= time.Now().Unix() { + if f.cacheExpiry.Load() <= time.Now().Unix() { err := f.updateUsage() if err != nil { return 0, ErrUsageFieldNotSupported @@ -347,7 +395,7 @@ func (f *Fs) GetUsedSpace() (int64, error) { // GetNumObjects get the number of objects of the fs func (f *Fs) GetNumObjects() (int64, error) { - if atomic.LoadInt64(&f.cacheExpiry) <= time.Now().Unix() { + if f.cacheExpiry.Load() <= time.Now().Unix() { err := f.updateUsage() if err != nil { return 0, ErrUsageFieldNotSupported @@ -402,7 +450,7 @@ func (f *Fs) updateUsageCore(lock bool) error { defer f.cacheMutex.Unlock() } // Store usage - atomic.StoreInt64(&f.cacheExpiry, time.Now().Add(f.cacheTime).Unix()) + f.cacheExpiry.Store(time.Now().Add(f.cacheTime).Unix()) f.usage = usage return nil } diff --git a/backend/uptobox/uptobox.go b/backend/uptobox/uptobox.go index c13d0ac9ed52f..1db823ef45877 100644 --- a/backend/uptobox/uptobox.go +++ b/backend/uptobox/uptobox.go @@ -43,8 +43,14 @@ func init() { Description: "Uptobox", NewFs: NewFs, Options: []fs.Option{{ - Help: "Your access token.\n\nGet it from https://uptobox.com/my_account.", - Name: "access_token", + Help: "Your access token.\n\nGet it from https://uptobox.com/my_account.", + Name: "access_token", + Sensitive: true, + }, { + Help: "Set to make uploaded files private", + Name: "private", + Advanced: true, + Default: false, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -63,6 +69,7 @@ func init() { // Options defines the configuration for this backend type Options struct { AccessToken string `config:"access_token"` + Private bool `config:"private"` Enc encoder.MultiEncoder `config:"encoding"` } @@ -75,6 +82,7 @@ type Fs struct { srv *rest.Client pacer *fs.Pacer IDRegexp *regexp.Regexp + public string // "0" to make objects private } // Object represents an Uptobox object @@ -211,10 +219,13 @@ func NewFs(ctx context.Context, name string, root string, config configmap.Mappe CanHaveEmptyDirectories: true, ReadMimeType: false, }).Fill(ctx, f) + if f.opt.Private { + f.public = "0" + } client := fshttp.NewClient(ctx) f.srv = rest.NewClient(client).SetRoot(apiBaseURL) - f.IDRegexp = regexp.MustCompile(`https://uptobox\.com/([a-zA-Z0-9]+)`) + f.IDRegexp = regexp.MustCompile(`^https://uptobox\.com/([a-zA-Z0-9]+)`) _, err = f.readMetaDataForPath(ctx, f.dirPath(""), &api.MetadataRequestOptions{Limit: 10}) if err != nil { @@ -472,11 +483,11 @@ func (f *Fs) updateFileInformation(ctx context.Context, update *api.UpdateFileIn return err } -func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size int64, options ...fs.OpenOption) (fs.Object, error) { +func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size int64, options ...fs.OpenOption) error { if size > int64(200e9) { // max size 200GB - return nil, errors.New("file too big, can't upload") + return errors.New("file too big, can't upload") } else if size == 0 { - return nil, fs.ErrorCantUploadEmptyFiles + return fs.ErrorCantUploadEmptyFiles } // yes it does take 4 requests if we're uploading to root and 6+ if we're uploading to any subdir :( @@ -494,19 +505,19 @@ func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size return shouldRetry(ctx, resp, err) }) if err != nil { - return nil, err + return err } if info.StatusCode != 0 { - return nil, fmt.Errorf("putUnchecked api error: %d - %s", info.StatusCode, info.Message) + return fmt.Errorf("putUnchecked api error: %d - %s", info.StatusCode, info.Message) } // we need to have a safe name for the upload to work tmpName := "rcloneTemp" + random.String(8) upload, err := f.uploadFile(ctx, in, size, tmpName, info.Data.UploadLink, options...) if err != nil { - return nil, err + return err } if len(upload.Files) != 1 { - return nil, errors.New("upload unexpected response") + return errors.New("upload unexpected response") } match := f.IDRegexp.FindStringSubmatch(upload.Files[0].URL) @@ -521,23 +532,27 @@ func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size // this might need some more error handling. if any of the following requests fail // we'll leave an orphaned temporary file floating around somewhere // they rarely fail though - return nil, err + return err } err = f.move(ctx, fullBase, match[1]) if err != nil { - return nil, err + return err } } // rename file to final name - err = f.updateFileInformation(ctx, &api.UpdateFileInformation{Token: f.opt.AccessToken, FileCode: match[1], NewName: f.opt.Enc.FromStandardName(leaf)}) + err = f.updateFileInformation(ctx, &api.UpdateFileInformation{ + Token: f.opt.AccessToken, + FileCode: match[1], + NewName: f.opt.Enc.FromStandardName(leaf), + Public: f.public, + }) if err != nil { - return nil, err + return err } - // finally fetch the file object. - return f.NewObject(ctx, remote) + return nil } // Put in to the remote path with the modTime given of the given size @@ -567,7 +582,11 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // This will create a duplicate if we upload a new file without // checking to see if there is one already - use Put() for that. func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { - return f.putUnchecked(ctx, in, src.Remote(), src.Size(), options...) + err := f.putUnchecked(ctx, in, src.Remote(), src.Size(), options...) + if err != nil { + return nil, err + } + return f.NewObject(ctx, src.Remote()) } // CreateDir dir creates a directory with the given parent path @@ -660,7 +679,7 @@ func (f *Fs) Rmdir(ctx context.Context, dir string) error { if err != nil { return err } - if info.Data.CurrentFolder.FileCount > 0 { + if len(info.Data.Folders) > 0 || len(info.Data.Files) > 0 { return fs.ErrorDirectoryNotEmpty } @@ -696,7 +715,12 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, // rename to final name if we need to if needRename { - err := f.updateFileInformation(ctx, &api.UpdateFileInformation{Token: f.opt.AccessToken, FileCode: srcObj.code, NewName: f.opt.Enc.FromStandardName(dstLeaf)}) + err := f.updateFileInformation(ctx, &api.UpdateFileInformation{ + Token: f.opt.AccessToken, + FileCode: srcObj.code, + NewName: f.opt.Enc.FromStandardName(dstLeaf), + Public: f.public, + }) if err != nil { return nil, fmt.Errorf("move: failed final rename: %w", err) } @@ -888,7 +912,12 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, } if needRename { - err := f.updateFileInformation(ctx, &api.UpdateFileInformation{Token: f.opt.AccessToken, FileCode: newObj.(*Object).code, NewName: f.opt.Enc.FromStandardName(dstLeaf)}) + err := f.updateFileInformation(ctx, &api.UpdateFileInformation{ + Token: f.opt.AccessToken, + FileCode: newObj.(*Object).code, + NewName: f.opt.Enc.FromStandardName(dstLeaf), + Public: f.public, + }) if err != nil { return nil, fmt.Errorf("copy: failed final rename: %w", err) } @@ -923,7 +952,8 @@ func (o *Object) Remote() string { // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { - return time.Now() + ci := fs.GetConfig(ctx) + return time.Time(ci.DefaultTime) } // Size returns the size of an object in bytes @@ -1000,7 +1030,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op } // upload with new size but old name - info, err := o.fs.putUnchecked(ctx, in, o.Remote(), src.Size(), options...) + err := o.fs.putUnchecked(ctx, in, o.Remote(), src.Size(), options...) if err != nil { return err } @@ -1011,6 +1041,12 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return fmt.Errorf("failed to remove old version: %w", err) } + // Fetch new object after deleting the duplicate + info, err := o.fs.NewObject(ctx, o.Remote()) + if err != nil { + return err + } + // Replace guts of old object with new one *o = *info.(*Object) diff --git a/backend/webdav/api/types.go b/backend/webdav/api/types.go index 7d36f058ab5ed..50feae10647df 100644 --- a/backend/webdav/api/types.go +++ b/backend/webdav/api/types.go @@ -75,6 +75,7 @@ type Prop struct { Size int64 `xml:"DAV: prop>getcontentlength,omitempty"` Modified Time `xml:"DAV: prop>getlastmodified,omitempty"` Checksums []string `xml:"prop>checksums>checksum,omitempty"` + MESha1Hex *string `xml:"ME: prop>sha1hex,omitempty"` // Fastmail-specific sha1 checksum } // Parse a status of the form "HTTP/1.1 200 OK" or "HTTP/1.1 200" @@ -102,22 +103,26 @@ func (p *Prop) StatusOK() bool { // Hashes returns a map of all checksums - may be nil func (p *Prop) Hashes() (hashes map[hash.Type]string) { - if len(p.Checksums) == 0 { - return nil - } - hashes = make(map[hash.Type]string) - for _, checksums := range p.Checksums { - checksums = strings.ToLower(checksums) - for _, checksum := range strings.Split(checksums, " ") { - switch { - case strings.HasPrefix(checksum, "sha1:"): - hashes[hash.SHA1] = checksum[5:] - case strings.HasPrefix(checksum, "md5:"): - hashes[hash.MD5] = checksum[4:] + if len(p.Checksums) > 0 { + hashes = make(map[hash.Type]string) + for _, checksums := range p.Checksums { + checksums = strings.ToLower(checksums) + for _, checksum := range strings.Split(checksums, " ") { + switch { + case strings.HasPrefix(checksum, "sha1:"): + hashes[hash.SHA1] = checksum[5:] + case strings.HasPrefix(checksum, "md5:"): + hashes[hash.MD5] = checksum[4:] + } } } + return hashes + } else if p.MESha1Hex != nil { + hashes = make(map[hash.Type]string) + hashes[hash.SHA1] = *p.MESha1Hex + return hashes } - return hashes + return nil } // PropValue is a tagged name and value diff --git a/backend/webdav/chunking.go b/backend/webdav/chunking.go new file mode 100644 index 0000000000000..4cea798389f73 --- /dev/null +++ b/backend/webdav/chunking.go @@ -0,0 +1,214 @@ +package webdav + +/* + chunked update for Nextcloud + see https://docs.nextcloud.com/server/20/developer_manual/client_apis/WebDAV/chunking.html +*/ + +import ( + "context" + "crypto/md5" + "encoding/hex" + "errors" + "fmt" + "io" + "net/http" + "path" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/lib/readers" + "github.com/rclone/rclone/lib/rest" +) + +func (f *Fs) shouldRetryChunkMerge(ctx context.Context, resp *http.Response, err error) (bool, error) { + // Not found. Can be returned by NextCloud when merging chunks of an upload. + if resp != nil && resp.StatusCode == 404 { + return true, err + } + + // 423 LOCKED + if resp != nil && resp.StatusCode == 423 { + return false, fmt.Errorf("merging the uploaded chunks failed with 423 LOCKED. This usually happens when the chunks merging is still in progress on NextCloud, but it may also indicate a failed transfer: %w", err) + } + + return f.shouldRetry(ctx, resp, err) +} + +// set the chunk size for testing +func (f *Fs) setUploadChunkSize(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + old, f.opt.ChunkSize = f.opt.ChunkSize, cs + return +} + +func (o *Object) getChunksUploadDir() (string, error) { + hasher := md5.New() + _, err := hasher.Write([]byte(o.filePath())) + if err != nil { + return "", fmt.Errorf("chunked upload couldn't hash URL: %w", err) + } + uploadDir := "rclone-chunked-upload-" + hex.EncodeToString(hasher.Sum(nil)) + return uploadDir, nil +} + +func (f *Fs) getChunksUploadURL() (string, error) { + submatch := nextCloudURLRegex.FindStringSubmatch(f.endpointURL) + if submatch == nil { + return "", errors.New("the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USER endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME") + } + + baseURL, user := submatch[1], submatch[2] + chunksUploadURL := fmt.Sprintf("%s/dav/uploads/%s/", baseURL, user) + + return chunksUploadURL, nil +} + +func (o *Object) shouldUseChunkedUpload(src fs.ObjectInfo) bool { + return o.fs.canChunk && o.fs.opt.ChunkSize > 0 && src.Size() > int64(o.fs.opt.ChunkSize) +} + +func (o *Object) updateChunked(ctx context.Context, in0 io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + var uploadDir string + + // see https://docs.nextcloud.com/server/24/developer_manual/client_apis/WebDAV/chunking.html#starting-a-chunked-upload + uploadDir, err = o.createChunksUploadDirectory(ctx) + if err != nil { + return err + } + + partObj := &Object{ + fs: o.fs, + } + + // see https://docs.nextcloud.com/server/24/developer_manual/client_apis/WebDAV/chunking.html#uploading-chunks + err = o.uploadChunks(ctx, in0, src.Size(), partObj, uploadDir, options) + if err != nil { + return err + } + + // see https://docs.nextcloud.com/server/24/developer_manual/client_apis/WebDAV/chunking.html#assembling-the-chunks + err = o.mergeChunks(ctx, uploadDir, options, src) + if err != nil { + return err + } + + return nil +} + +func (o *Object) uploadChunks(ctx context.Context, in0 io.Reader, size int64, partObj *Object, uploadDir string, options []fs.OpenOption) error { + chunkSize := int64(partObj.fs.opt.ChunkSize) + + // TODO: upload chunks in parallel for faster transfer speeds + for offset := int64(0); offset < size; offset += chunkSize { + if err := ctx.Err(); err != nil { + return err + } + + contentLength := chunkSize + + // Last chunk may be smaller + if size-offset < contentLength { + contentLength = size - offset + } + + endOffset := offset + contentLength - 1 + + partObj.remote = fmt.Sprintf("%s/%015d-%015d", uploadDir, offset, endOffset) + // Enable low-level HTTP 2 retries. + // 2022-04-28 15:59:06 ERROR : stuff/video.avi: Failed to copy: uploading chunk failed: Put "https://censored.com/remote.php/dav/uploads/Admin/rclone-chunked-upload-censored/000006113198080-000006123683840": http2: Transport: cannot retry err [http2: Transport received Server's graceful shutdown GOAWAY] after Request.Body was written; define Request.GetBody to avoid this error + + buf := make([]byte, chunkSize) + in := readers.NewRepeatableLimitReaderBuffer(in0, buf, chunkSize) + + getBody := func() (io.ReadCloser, error) { + // RepeatableReader{} plays well with accounting so rewinding doesn't make the progress buggy + if _, err := in.Seek(0, io.SeekStart); err != nil { + return nil, err + } + + return io.NopCloser(in), nil + } + + err := partObj.updateSimple(ctx, in, getBody, partObj.remote, contentLength, "application/x-www-form-urlencoded", nil, o.fs.chunksUploadURL, options...) + if err != nil { + return fmt.Errorf("uploading chunk failed: %w", err) + } + } + return nil +} + +func (o *Object) createChunksUploadDirectory(ctx context.Context) (string, error) { + uploadDir, err := o.getChunksUploadDir() + if err != nil { + return uploadDir, err + } + + err = o.purgeUploadedChunks(ctx, uploadDir) + if err != nil { + return "", fmt.Errorf("chunked upload couldn't purge upload directory: %w", err) + } + + opts := rest.Opts{ + Method: "MKCOL", + Path: uploadDir + "/", + NoResponse: true, + RootURL: o.fs.chunksUploadURL, + } + err = o.fs.pacer.CallNoRetry(func() (bool, error) { + resp, err := o.fs.srv.Call(ctx, &opts) + return o.fs.shouldRetry(ctx, resp, err) + }) + if err != nil { + return "", fmt.Errorf("making upload directory failed: %w", err) + } + return uploadDir, err +} + +func (o *Object) mergeChunks(ctx context.Context, uploadDir string, options []fs.OpenOption, src fs.ObjectInfo) error { + var resp *http.Response + + // see https://docs.nextcloud.com/server/24/developer_manual/client_apis/WebDAV/chunking.html?highlight=chunk#assembling-the-chunks + opts := rest.Opts{ + Method: "MOVE", + Path: path.Join(uploadDir, ".file"), + NoResponse: true, + Options: options, + RootURL: o.fs.chunksUploadURL, + } + destinationURL, err := rest.URLJoin(o.fs.endpoint, o.filePath()) + if err != nil { + return fmt.Errorf("finalize chunked upload couldn't join URL: %w", err) + } + opts.ExtraHeaders = o.extraHeaders(ctx, src) + opts.ExtraHeaders["Destination"] = destinationURL.String() + err = o.fs.pacer.Call(func() (bool, error) { + resp, err = o.fs.srv.Call(ctx, &opts) + return o.fs.shouldRetryChunkMerge(ctx, resp, err) + }) + if err != nil { + return fmt.Errorf("finalize chunked upload failed, destinationURL: \"%s\": %w", destinationURL, err) + } + return err +} + +func (o *Object) purgeUploadedChunks(ctx context.Context, uploadDir string) error { + // clean the upload directory if it exists (this means that a previous try didn't clean up properly). + opts := rest.Opts{ + Method: "DELETE", + Path: uploadDir + "/", + NoResponse: true, + RootURL: o.fs.chunksUploadURL, + } + + err := o.fs.pacer.Call(func() (bool, error) { + resp, err := o.fs.srv.CallXML(ctx, &opts, nil, nil) + + // directory doesn't exist, no need to purge + if resp != nil && resp.StatusCode == http.StatusNotFound { + return false, nil + } + + return o.fs.shouldRetry(ctx, resp, err) + }) + + return err +} diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index 371d5f71dfac4..e8f83f66a4a67 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -19,6 +19,7 @@ import ( "net/url" "os/exec" "path" + "regexp" "strconv" "strings" "sync" @@ -42,7 +43,7 @@ import ( ) const ( - minSleep = 10 * time.Millisecond + minSleep = fs.Duration(10 * time.Millisecond) maxSleep = 2 * time.Second decayConstant = 2 // bigger for slower decay, exponential defaultDepth = "1" // depth for PROPFIND @@ -76,6 +77,9 @@ func init() { Name: "vendor", Help: "Name of the WebDAV site/service/software you are using.", Examples: []fs.OptionExample{{ + Value: "fastmail", + Help: "Fastmail Files", + }, { Value: "nextcloud", Help: "Nextcloud", }, { @@ -87,20 +91,25 @@ func init() { }, { Value: "sharepoint-ntlm", Help: "Sharepoint with NTLM authentication, usually self-hosted or on-premises", + }, { + Value: "rclone", + Help: "rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol", }, { Value: "other", Help: "Other site/service or software", }}, }, { - Name: "user", - Help: "User name.\n\nIn case NTLM authentication is used, the username should be in the format 'Domain\\User'.", + Name: "user", + Help: "User name.\n\nIn case NTLM authentication is used, the username should be in the format 'Domain\\User'.", + Sensitive: true, }, { Name: "pass", Help: "Password.", IsPassword: true, }, { - Name: "bearer_token", - Help: "Bearer token instead of user/pass (e.g. a Macaroon).", + Name: "bearer_token", + Help: "Bearer token instead of user/pass (e.g. a Macaroon).", + Sensitive: true, }, { Name: "bearer_token_command", Help: "Command to run to get a bearer token.", @@ -124,6 +133,22 @@ You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"' `, Default: fs.CommaSepList{}, Advanced: true, + }, { + Name: "pacer_min_sleep", + Help: "Minimum time to sleep between API calls.", + Default: minSleep, + Advanced: true, + }, { + Name: "nextcloud_chunk_size", + Help: `Nextcloud upload chunk size. + +We recommend configuring your NextCloud instance to increase the max chunk size to 1 GB for better upload performances. +See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#adjust-chunk-size-on-nextcloud-side + +Set to 0 to disable chunked uploading. +`, + Advanced: true, + Default: 10 * fs.Mebi, // Default NextCloud `max_chunk_size` is `10 MiB`. See https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/apps/files/lib/App.php#L57 }}, }) } @@ -138,6 +163,8 @@ type Options struct { BearerTokenCommand string `config:"bearer_token_command"` Enc encoder.MultiEncoder `config:"encoding"` Headers fs.CommaSepList `config:"headers"` + PacerMinSleep fs.Duration `config:"pacer_min_sleep"` + ChunkSize fs.SizeSuffix `config:"nextcloud_chunk_size"` } // Fs represents a remote webdav @@ -153,11 +180,15 @@ type Fs struct { precision time.Duration // mod time precision canStream bool // set if can stream useOCMtime bool // set if can use X-OC-Mtime + propsetMtime bool // set if can use propset retryWithZeroDepth bool // some vendors (sharepoint) won't list files when Depth is 1 (our default) checkBeforePurge bool // enables extra check that directory to purge really exists - hasMD5 bool // set if can use owncloud style checksums for MD5 - hasSHA1 bool // set if can use owncloud style checksums for SHA1 + hasOCMD5 bool // set if can use owncloud style checksums for MD5 + hasOCSHA1 bool // set if can use owncloud style checksums for SHA1 + hasMESHA1 bool // set if can use fastmail style checksums for SHA1 ntlmAuthMu sync.Mutex // mutex to serialize NTLM auth roundtrips + chunksUploadURL string // upload URL for nextcloud chunked + canChunk bool // set if nextcloud and nextcloud_chunk_size is set } // Object describes a webdav object @@ -278,7 +309,7 @@ func (f *Fs) readMetaDataForPath(ctx context.Context, path string, depth string) }, NoRedirect: true, } - if f.hasMD5 || f.hasSHA1 { + if f.hasOCMD5 || f.hasOCSHA1 { opts.Body = bytes.NewBuffer(owncloudProps) } var result api.Multistatus @@ -411,7 +442,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e opt: *opt, endpoint: u, endpointURL: u.String(), - pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(opt.PacerMinSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), precision: fs.ModTimeNotSupported, } @@ -543,19 +574,42 @@ func (f *Fs) fetchAndSetBearerToken() error { return nil } +// The WebDAV url can optionally be suffixed with a path. This suffix needs to be ignored for determining the temporary upload directory of chunks. +var nextCloudURLRegex = regexp.MustCompile(`^(.*)/dav/files/([^/]+)`) + // setQuirks adjusts the Fs for the vendor passed in func (f *Fs) setQuirks(ctx context.Context, vendor string) error { switch vendor { + case "fastmail": + f.canStream = true + f.precision = time.Second + f.useOCMtime = true + f.hasMESHA1 = true case "owncloud": f.canStream = true f.precision = time.Second f.useOCMtime = true - f.hasMD5 = true - f.hasSHA1 = true + f.propsetMtime = true + f.hasOCMD5 = true + f.hasOCSHA1 = true case "nextcloud": f.precision = time.Second f.useOCMtime = true - f.hasSHA1 = true + f.propsetMtime = true + f.hasOCSHA1 = true + f.canChunk = true + + if f.opt.ChunkSize == 0 { + fs.Logf(nil, "Chunked uploads are disabled because nextcloud_chunk_size is set to 0") + } else { + chunksUploadURL, err := f.getChunksUploadURL() + if err != nil { + return err + } + + f.chunksUploadURL = chunksUploadURL + fs.Logf(nil, "Chunks temporary upload directory: %s", f.chunksUploadURL) + } case "sharepoint": // To mount sharepoint, two Cookies are required // They have to be set instead of BasicAuth @@ -593,6 +647,10 @@ func (f *Fs) setQuirks(ctx context.Context, vendor string) error { // so we must perform an extra check to detect this // condition and return a proper error code. f.checkBeforePurge = true + case "rclone": + f.canStream = true + f.precision = time.Second + f.useOCMtime = true case "other": default: fs.Debugf(f, "Unknown vendor %q", vendor) @@ -667,7 +725,7 @@ func (f *Fs) listAll(ctx context.Context, dir string, directoriesOnly bool, file "Depth": depth, }, } - if f.hasMD5 || f.hasSHA1 { + if f.hasOCMD5 || f.hasOCSHA1 { opts.Body = bytes.NewBuffer(owncloudProps) } var result api.Multistatus @@ -996,7 +1054,7 @@ func (f *Fs) copyOrMove(ctx context.Context, src fs.Object, remote string, metho dstPath := f.filePath(remote) err := f.mkParentDir(ctx, dstPath) if err != nil { - return nil, fmt.Errorf("Copy mkParentDir failed: %w", err) + return nil, fmt.Errorf("copy mkParentDir failed: %w", err) } destinationURL, err := rest.URLJoin(f.endpoint, dstPath) if err != nil { @@ -1009,7 +1067,7 @@ func (f *Fs) copyOrMove(ctx context.Context, src fs.Object, remote string, metho NoResponse: true, ExtraHeaders: map[string]string{ "Destination": destinationURL.String(), - "Overwrite": "F", + "Overwrite": "T", }, } if f.useOCMtime { @@ -1021,11 +1079,18 @@ func (f *Fs) copyOrMove(ctx context.Context, src fs.Object, remote string, metho return srcFs.shouldRetry(ctx, resp, err) }) if err != nil { - return nil, fmt.Errorf("Copy call failed: %w", err) + return nil, fmt.Errorf("copy call failed: %w", err) } dstObj, err := f.NewObject(ctx, remote) if err != nil { - return nil, fmt.Errorf("Copy NewObject failed: %w", err) + return nil, fmt.Errorf("copy NewObject failed: %w", err) + } + if f.useOCMtime && resp.Header.Get("X-OC-Mtime") != "accepted" && f.propsetMtime { + fs.Debugf(dstObj, "Setting modtime after copy to %v", src.ModTime(ctx)) + err = dstObj.SetModTime(ctx, src.ModTime(ctx)) + if err != nil { + return nil, fmt.Errorf("failed to set modtime: %w", err) + } } return dstObj, nil } @@ -1109,7 +1174,7 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string NoResponse: true, ExtraHeaders: map[string]string{ "Destination": addSlash(destinationURL.String()), - "Overwrite": "F", + "Overwrite": "T", }, } // Direct the MOVE/COPY to the source server @@ -1126,10 +1191,10 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string // Hashes returns the supported hash sets. func (f *Fs) Hashes() hash.Set { hashes := hash.Set(hash.None) - if f.hasMD5 { + if f.hasOCMD5 { hashes.Add(hash.MD5) } - if f.hasSHA1 { + if f.hasOCSHA1 || f.hasMESHA1 { hashes.Add(hash.SHA1) } return hashes @@ -1197,10 +1262,10 @@ func (o *Object) Remote() string { // Hash returns the SHA1 or MD5 of an object returning a lowercase hex string func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { - if t == hash.MD5 && o.fs.hasMD5 { + if t == hash.MD5 && o.fs.hasOCMD5 { return o.md5, nil } - if t == hash.SHA1 && o.fs.hasSHA1 { + if t == hash.SHA1 && (o.fs.hasOCSHA1 || o.fs.hasMESHA1) { return o.sha1, nil } return "", hash.ErrUnsupported @@ -1222,12 +1287,12 @@ func (o *Object) setMetaData(info *api.Prop) (err error) { o.hasMetaData = true o.size = info.Size o.modTime = time.Time(info.Modified) - if o.fs.hasMD5 || o.fs.hasSHA1 { + if o.fs.hasOCMD5 || o.fs.hasOCSHA1 || o.fs.hasMESHA1 { hashes := info.Hashes() - if o.fs.hasSHA1 { + if o.fs.hasOCSHA1 || o.fs.hasMESHA1 { o.sha1 = hashes[hash.SHA1] } - if o.fs.hasMD5 { + if o.fs.hasOCMD5 { o.md5 = hashes[hash.MD5] } } @@ -1261,8 +1326,53 @@ func (o *Object) ModTime(ctx context.Context) time.Time { return o.modTime } +// Set modified time using propset +// +// /ocm/remote.php/webdav/office/wir.jpgHTTP/1.1 200 OK +var owncloudPropset = ` + + + + %d + + + +` + // SetModTime sets the modification time of the local fs object func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { + if o.fs.propsetMtime { + opts := rest.Opts{ + Method: "PROPPATCH", + Path: o.filePath(), + NoRedirect: true, + Body: strings.NewReader(fmt.Sprintf(owncloudPropset, modTime.Unix())), + } + var result api.Multistatus + var resp *http.Response + var err error + err = o.fs.pacer.Call(func() (bool, error) { + resp, err = o.fs.srv.CallXML(ctx, &opts, nil, &result) + return o.fs.shouldRetry(ctx, resp, err) + }) + if err != nil { + if apiErr, ok := err.(*api.Error); ok { + // does not exist + if apiErr.StatusCode == http.StatusNotFound { + return fs.ErrorObjectNotFound + } + } + return fmt.Errorf("couldn't set modified time: %w", err) + } + // FIXME check if response is valid + if len(result.Responses) == 1 && result.Responses[0].Props.StatusOK() { + // update cached modtime + o.modTime = modTime + return nil + } + // fallback + return fs.ErrorCantSetModTime + } return fs.ErrorCantSetModTime } @@ -1304,36 +1414,72 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op return fmt.Errorf("Update mkParentDir failed: %w", err) } - size := src.Size() - var resp *http.Response - opts := rest.Opts{ - Method: "PUT", - Path: o.filePath(), - Body: in, - NoResponse: true, - ContentLength: &size, // FIXME this isn't necessary with owncloud - See https://github.com/nextcloud/nextcloud-snap/issues/365 - ContentType: fs.MimeType(ctx, src), - Options: options, + if o.shouldUseChunkedUpload(src) { + fs.Debugf(src, "Update will use the chunked upload strategy") + err = o.updateChunked(ctx, in, src, options...) + if err != nil { + return err + } + } else { + fs.Debugf(src, "Update will use the normal upload strategy (no chunks)") + contentType := fs.MimeType(ctx, src) + filePath := o.filePath() + extraHeaders := o.extraHeaders(ctx, src) + // TODO: define getBody() to enable low-level HTTP/2 retries + err = o.updateSimple(ctx, in, nil, filePath, src.Size(), contentType, extraHeaders, o.fs.endpointURL, options...) + if err != nil { + return err + } } - if o.fs.useOCMtime || o.fs.hasMD5 || o.fs.hasSHA1 { - opts.ExtraHeaders = map[string]string{} + + // read metadata from remote + o.hasMetaData = false + return o.readMetaData(ctx) +} + +func (o *Object) extraHeaders(ctx context.Context, src fs.ObjectInfo) map[string]string { + extraHeaders := map[string]string{} + if o.fs.useOCMtime || o.fs.hasOCMD5 || o.fs.hasOCSHA1 { if o.fs.useOCMtime { - opts.ExtraHeaders["X-OC-Mtime"] = fmt.Sprintf("%d", src.ModTime(ctx).Unix()) + extraHeaders["X-OC-Mtime"] = fmt.Sprintf("%d", src.ModTime(ctx).Unix()) } // Set one upload checksum // Owncloud uses one checksum only to check the upload and stores its own SHA1 and MD5 // Nextcloud stores the checksum you supply (SHA1 or MD5) but only stores one - if o.fs.hasSHA1 { + if o.fs.hasOCSHA1 { if sha1, _ := src.Hash(ctx, hash.SHA1); sha1 != "" { - opts.ExtraHeaders["OC-Checksum"] = "SHA1:" + sha1 + extraHeaders["OC-Checksum"] = "SHA1:" + sha1 } } - if o.fs.hasMD5 && opts.ExtraHeaders["OC-Checksum"] == "" { + if o.fs.hasOCMD5 && extraHeaders["OC-Checksum"] == "" { if md5, _ := src.Hash(ctx, hash.MD5); md5 != "" { - opts.ExtraHeaders["OC-Checksum"] = "MD5:" + md5 + extraHeaders["OC-Checksum"] = "MD5:" + md5 } } } + return extraHeaders +} + +// Standard update in one request (no chunks) +func (o *Object) updateSimple(ctx context.Context, body io.Reader, getBody func() (io.ReadCloser, error), filePath string, size int64, contentType string, extraHeaders map[string]string, rootURL string, options ...fs.OpenOption) (err error) { + var resp *http.Response + + if extraHeaders == nil { + extraHeaders = map[string]string{} + } + + opts := rest.Opts{ + Method: "PUT", + Path: filePath, + GetBody: getBody, + Body: body, + NoResponse: true, + ContentLength: &size, // FIXME this isn't necessary with owncloud - See https://github.com/nextcloud/nextcloud-snap/issues/365 + ContentType: contentType, + Options: options, + ExtraHeaders: extraHeaders, + RootURL: rootURL, + } err = o.fs.pacer.CallNoRetry(func() (bool, error) { resp, err = o.fs.srv.Call(ctx, &opts) return o.fs.shouldRetry(ctx, resp, err) @@ -1349,9 +1495,8 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op _ = o.Remove(ctx) return err } - // read metadata from remote - o.hasMetaData = false - return o.readMetaData(ctx) + return nil + } // Remove an object diff --git a/backend/webdav/webdav_test.go b/backend/webdav/webdav_test.go index e23176afe3f6e..1949a41c60fc7 100644 --- a/backend/webdav/webdav_test.go +++ b/backend/webdav/webdav_test.go @@ -1,10 +1,10 @@ // Test Webdav filesystem interface -package webdav_test +package webdav import ( "testing" - "github.com/rclone/rclone/backend/webdav" + "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/fstest/fstests" ) @@ -13,7 +13,10 @@ import ( func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ RemoteName: "TestWebdavNextcloud:", - NilObject: (*webdav.Object)(nil), + NilObject: (*Object)(nil), + ChunkedUpload: fstests.ChunkedUploadConfig{ + MinChunkSize: 1 * fs.Mebi, + }, }) } @@ -24,7 +27,10 @@ func TestIntegration2(t *testing.T) { } fstests.Run(t, &fstests.Opt{ RemoteName: "TestWebdavOwncloud:", - NilObject: (*webdav.Object)(nil), + NilObject: (*Object)(nil), + ChunkedUpload: fstests.ChunkedUploadConfig{ + Skip: true, + }, }) } @@ -35,7 +41,10 @@ func TestIntegration3(t *testing.T) { } fstests.Run(t, &fstests.Opt{ RemoteName: "TestWebdavRclone:", - NilObject: (*webdav.Object)(nil), + NilObject: (*Object)(nil), + ChunkedUpload: fstests.ChunkedUploadConfig{ + Skip: true, + }, }) } @@ -46,6 +55,10 @@ func TestIntegration4(t *testing.T) { } fstests.Run(t, &fstests.Opt{ RemoteName: "TestWebdavNTLM:", - NilObject: (*webdav.Object)(nil), + NilObject: (*Object)(nil), }) } + +func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setUploadChunkSize(cs) +} diff --git a/backend/yandex/yandex.go b/backend/yandex/yandex.go index a643a7771265d..806c5f91595eb 100644 --- a/backend/yandex/yandex.go +++ b/backend/yandex/yandex.go @@ -1100,7 +1100,7 @@ func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeT NoResponse: true, } - err = o.fs.pacer.Call(func() (bool, error) { + err = o.fs.pacer.CallNoRetry(func() (bool, error) { resp, err = o.fs.srv.Call(ctx, &opts) return shouldRetry(ctx, resp, err) }) diff --git a/backend/zoho/zoho.go b/backend/zoho/zoho.go index f9fc6eb6b8629..f8ea5755c8dfc 100644 --- a/backend/zoho/zoho.go +++ b/backend/zoho/zoho.go @@ -17,7 +17,6 @@ import ( "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/pacer" "github.com/rclone/rclone/lib/random" - "github.com/rclone/rclone/lib/readers" "github.com/rclone/rclone/backend/zoho/api" "github.com/rclone/rclone/fs" @@ -331,15 +330,6 @@ func parsePath(path string) (root string) { return } -func (f *Fs) splitPath(remote string) (directory, leaf string) { - directory, leaf = dircache.SplitPath(remote) - if f.root != "" { - // Adds the root folder to the path to get a full path - directory = path.Join(f.root, directory) - } - return -} - // readMetaDataForPath reads the metadata from the path func (f *Fs) readMetaDataForPath(ctx context.Context, path string) (info *api.Item, err error) { // defer fs.Trace(f, "path=%q", path)("info=%+v, err=%v", &info, &err) @@ -1178,31 +1168,8 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read if o.id == "" { return nil, errors.New("can't download - no id") } - var start, end int64 = 0, o.size - partialContent := false - for _, option := range options { - switch x := option.(type) { - case *fs.SeekOption: - start = x.Offset - partialContent = true - case *fs.RangeOption: - if x.Start >= 0 { - start = x.Start - if x.End > 0 && x.End < o.size { - end = x.End + 1 - } - } else { - // {-1, 20} should load the last 20 characters [len-20:len] - start = o.size - x.End - } - partialContent = true - default: - if option.Mandatory() { - fs.Logf(nil, "Unsupported mandatory option: %v", option) - } - } - } var resp *http.Response + fs.FixRangeOption(options, o.size) opts := rest.Opts{ Method: "GET", Path: "/download/" + o.id, @@ -1215,20 +1182,6 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read if err != nil { return nil, err } - if partialContent && resp.StatusCode == 200 { - if start > 0 { - // We need to read and discard the beginning of the data... - _, err = io.CopyN(io.Discard, resp.Body, start) - if err != nil { - if resp != nil { - _ = resp.Body.Close() - } - return nil, err - } - } - // ... and return a limited reader for the remaining of the data - return readers.NewLimitedReadCloser(resp.Body, end-start), nil - } return resp.Body, nil } diff --git a/bin/.ignore-emails b/bin/.ignore-emails index b88a3e1c29f5d..14cbc62fc8089 100644 --- a/bin/.ignore-emails +++ b/bin/.ignore-emails @@ -6,3 +6,7 @@ + + + + diff --git a/bin/cross-compile.go b/bin/cross-compile.go index f7915d7ce2ded..f0a02336fa260 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -6,7 +6,6 @@ package main import ( - "encoding/json" "flag" "fmt" "log" @@ -21,23 +20,21 @@ import ( "sync" "text/template" "time" - - "github.com/coreos/go-semver/semver" ) var ( // Flags - debug = flag.Bool("d", false, "Print commands instead of running them.") - parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel.") + debug = flag.Bool("d", false, "Print commands instead of running them") + parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel") copyAs = flag.String("release", "", "Make copies of the releases with this name") gitLog = flag.String("git-log", "", "git log to include as well") include = flag.String("include", "^.*$", "os/arch regexp to include") exclude = flag.String("exclude", "^$", "os/arch regexp to exclude") cgo = flag.Bool("cgo", false, "Use cgo for the build") - noClean = flag.Bool("no-clean", false, "Don't clean the build directory before running.") + noClean = flag.Bool("no-clean", false, "Don't clean the build directory before running") tags = flag.String("tags", "", "Space separated list of build tags") buildmode = flag.String("buildmode", "", "Passed to go build -buildmode flag") - compileOnly = flag.Bool("compile-only", false, "Just build the binary, not the zip.") + compileOnly = flag.Bool("compile-only", false, "Just build the binary, not the zip") extraEnv = flag.String("env", "", "comma separated list of VAR=VALUE env vars to set") macOSSDK = flag.String("macos-sdk", "", "macOS SDK to use") macOSArch = flag.String("macos-arch", "", "macOS arch to use") @@ -140,21 +137,21 @@ func chdir(dir string) { func substitute(inFile, outFile string, data interface{}) { t, err := template.ParseFiles(inFile) if err != nil { - log.Fatalf("Failed to read template file %q: %v %v", inFile, err) + log.Fatalf("Failed to read template file %q: %v", inFile, err) } out, err := os.Create(outFile) if err != nil { - log.Fatalf("Failed to create output file %q: %v %v", outFile, err) + log.Fatalf("Failed to create output file %q: %v", outFile, err) } defer func() { err := out.Close() if err != nil { - log.Fatalf("Failed to close output file %q: %v %v", outFile, err) + log.Fatalf("Failed to close output file %q: %v", outFile, err) } }() err = t.Execute(out, data) if err != nil { - log.Fatalf("Failed to substitute template file %q: %v %v", inFile, err) + log.Fatalf("Failed to substitute template file %q: %v", inFile, err) } } @@ -202,101 +199,6 @@ func buildDebAndRpm(dir, version, goarch string) []string { return artifacts } -// generate system object (syso) file to be picked up by a following go build for embedding icon and version info resources into windows executable -func buildWindowsResourceSyso(goarch string, versionTag string) string { - type M map[string]interface{} - version := strings.TrimPrefix(versionTag, "v") - semanticVersion := semver.New(version) - - // Build json input to goversioninfo utility - bs, err := json.Marshal(M{ - "FixedFileInfo": M{ - "FileVersion": M{ - "Major": semanticVersion.Major, - "Minor": semanticVersion.Minor, - "Patch": semanticVersion.Patch, - }, - "ProductVersion": M{ - "Major": semanticVersion.Major, - "Minor": semanticVersion.Minor, - "Patch": semanticVersion.Patch, - }, - }, - "StringFileInfo": M{ - "CompanyName": "https://rclone.org", - "ProductName": "Rclone", - "FileDescription": "Rsync for cloud storage", - "InternalName": "rclone", - "OriginalFilename": "rclone.exe", - "LegalCopyright": "The Rclone Authors", - "FileVersion": version, - "ProductVersion": version, - }, - "IconPath": "../graphics/logo/ico/logo_symbol_color.ico", - }) - if err != nil { - log.Printf("Failed to build version info json: %v", err) - return "" - } - - // Write json to temporary file that will only be used by the goversioninfo command executed below. - jsonPath, err := filepath.Abs("versioninfo_windows_" + goarch + ".json") // Appending goos and goarch as suffix to avoid any race conditions - if err != nil { - log.Printf("Failed to resolve path: %v", err) - return "" - } - err = os.WriteFile(jsonPath, bs, 0644) - if err != nil { - log.Printf("Failed to write %s: %v", jsonPath, err) - return "" - } - defer func() { - if err := os.Remove(jsonPath); err != nil { - if !os.IsNotExist(err) { - log.Printf("Warning: Couldn't remove generated %s: %v. Please remove it manually.", jsonPath, err) - } - } - }() - - // Execute goversioninfo utility using the json file as input. - // It will produce a system object (syso) file that a following go build should pick up. - sysoPath, err := filepath.Abs("../resource_windows_" + goarch + ".syso") // Appending goos and goarch as suffix to avoid any race conditions, and also it is recognized by go build and avoids any builds for other systems considering it - if err != nil { - log.Printf("Failed to resolve path: %v", err) - return "" - } - args := []string{ - "goversioninfo", - "-o", - sysoPath, - } - if strings.Contains(goarch, "64") { - args = append(args, "-64") // Make the syso a 64-bit coff file - } - if strings.Contains(goarch, "arm") { - args = append(args, "-arm") // Make the syso an arm binary - } - args = append(args, jsonPath) - err = runEnv(args, nil) - if err != nil { - return "" - } - - return sysoPath -} - -// delete generated system object (syso) resource file -func cleanupResourceSyso(sysoFilePath string) { - if sysoFilePath == "" { - return - } - if err := os.Remove(sysoFilePath); err != nil { - if !os.IsNotExist(err) { - log.Printf("Warning: Couldn't remove generated %s: %v. Please remove it manually.", sysoFilePath, err) - } - } -} - // Trip a version suffix off the arch if present func stripVersion(goarch string) string { i := strings.Index(goarch, "-") @@ -315,17 +217,41 @@ func runOut(command ...string) string { return strings.TrimSpace(string(out)) } +// Generate Windows resource system object file (.syso), which can be picked +// up by the following go build for embedding version information and icon +// resources into the executable. +func generateResourceWindows(version, arch string) func() { + sysoPath := fmt.Sprintf("../resource_windows_%s.syso", arch) // Use explicit destination filename, even though it should be same as default, so that we are sure we have the correct reference to it + if err := os.Remove(sysoPath); !os.IsNotExist(err) { + // Note: This one we choose to treat as fatal, to avoid any risk of picking up an old .syso file without noticing. + log.Fatalf("Failed to remove existing Windows %s resource system object file %s: %v", arch, sysoPath, err) + } + args := []string{"go", "run", "../bin/resource_windows.go", "-arch", arch, "-version", version, "-syso", sysoPath} + if err := runEnv(args, nil); err != nil { + log.Printf("Warning: Couldn't generate Windows %s resource system object file, binaries will not have version information or icon embedded", arch) + return nil + } + if _, err := os.Stat(sysoPath); err != nil { + log.Printf("Warning: Couldn't find generated Windows %s resource system object file, binaries will not have version information or icon embedded", arch) + return nil + } + return func() { + if err := os.Remove(sysoPath); err != nil && !os.IsNotExist(err) { + log.Printf("Warning: Couldn't remove generated Windows %s resource system object file %s: %v. Please remove it manually.", arch, sysoPath, err) + } + } +} + // build the binary in dir returning success or failure func compileArch(version, goos, goarch, dir string) bool { log.Printf("Compiling %s/%s into %s", goos, goarch, dir) + goarchBase := stripVersion(goarch) output := filepath.Join(dir, "rclone") if goos == "windows" { output += ".exe" - sysoPath := buildWindowsResourceSyso(goarch, version) - if sysoPath == "" { - log.Printf("Warning: Windows binaries will not have file information embedded") + if cleanupFn := generateResourceWindows(version, goarchBase); cleanupFn != nil { + defer cleanupFn() } - defer cleanupResourceSyso(sysoPath) } err := os.MkdirAll(dir, 0777) if err != nil { @@ -348,7 +274,7 @@ func compileArch(version, goos, goarch, dir string) bool { ) env := []string{ "GOOS=" + goos, - "GOARCH=" + stripVersion(goarch), + "GOARCH=" + goarchBase, } if *extraEnv != "" { env = append(env, strings.Split(*extraEnv, ",")...) diff --git a/bin/make_manual.py b/bin/make_manual.py index 4fa6fe59e5e84..94d3da215cf7f 100755 --- a/bin/make_manual.py +++ b/bin/make_manual.py @@ -25,6 +25,7 @@ "flags.md", "docker.md", "bisync.md", + "release_signing.md", # Keep these alphabetical by full name "fichier.md", @@ -49,23 +50,30 @@ "hdfs.md", "hidrive.md", "http.md", + "imagekit.md", "internetarchive.md", "jottacloud.md", "koofr.md", + "linkbox.md", "mailru.md", "mega.md", "memory.md", "netstorage.md", "azureblob.md", + "azurefiles.md", "onedrive.md", "opendrive.md", "oracleobjectstorage.md", "qingstor.md", + "quatrix.md", "sia.md", "swift.md", "pcloud.md", + "pikpak.md", "premiumizeme.md", + "protondrive.md", "putio.md", + "protondrive.md", "seafile.md", "sftp.md", "smb.md", @@ -113,7 +121,7 @@ ignore_docs = [ "downloads.md", "privacy.md", - "donate.md", + "sponsor.md", ] def read_doc(doc): diff --git a/bin/resource_windows.go b/bin/resource_windows.go new file mode 100644 index 0000000000000..2f74ad36342d0 --- /dev/null +++ b/bin/resource_windows.go @@ -0,0 +1,122 @@ +// Utility program to generate Rclone-specific Windows resource system object +// file (.syso), that can be picked up by a following go build for embedding +// version information and icon resources into a rclone binary. +// +// Run it with "go generate", or "go run" to be able to customize with +// command-line flags. Note that this program is intended to be run directly +// from its original location in the source tree: Default paths are absolute +// within the current source tree, which is convenient because it makes it +// oblivious to the working directory, and it gives identical result whether +// run by "go generate" or "go run", but it will not make sense if this +// program's source is moved out from the source tree. +// +// Can be used for rclone.exe (default), and other binaries such as +// librclone.dll (must be specified with flag -binary). +// + +//go:generate go run resource_windows.go +//go:build tools +// +build tools + +package main + +import ( + "flag" + "fmt" + "log" + "path" + "runtime" + "strings" + + "github.com/coreos/go-semver/semver" + "github.com/josephspurrier/goversioninfo" + "github.com/rclone/rclone/fs" +) + +func main() { + // Get path of directory containing the current source file to use for absolute path references within the code tree (as described above) + projectDir := "" + _, sourceFile, _, ok := runtime.Caller(0) + if ok { + projectDir = path.Dir(path.Dir(sourceFile)) // Root of the current project working directory + } + + // Define flags + binary := flag.String("binary", "rclone.exe", `The name of the binary to generate resource for, e.g. "rclone.exe" or "librclone.dll"`) + arch := flag.String("arch", runtime.GOARCH, `Architecture of resource file, or the target GOARCH, "386", "amd64", "arm", or "arm64"`) + version := flag.String("version", fs.Version, "Version number or tag name") + icon := flag.String("icon", path.Join(projectDir, "graphics/logo/ico/logo_symbol_color.ico"), "Path to icon file to embed in an .exe binary") + dir := flag.String("dir", projectDir, "Path to output directory where to write the resulting system object file (.syso), with a default name according to -arch (resource_windows_.syso), only considered if not -syso is specified") + syso := flag.String("syso", "", "Path to output resource system object file (.syso) to be created/overwritten, ignores -dir") + + // Parse command-line flags + flag.Parse() + + // Handle default value for -file which depends on optional -dir and -arch + if *syso == "" { + // Use default filename, which includes target GOOS (hardcoded "windows") + // and GOARCH (from argument -arch) as suffix, to avoid any race conditions, + // and also this will be recognized by go build when it is consuming the + // .syso file and will only be used for builds with matching os/arch. + *syso = path.Join(*dir, fmt.Sprintf("resource_windows_%s.syso", *arch)) + } + + // Parse version/tag string argument as a SemVer + stringVersion := strings.TrimPrefix(*version, "v") + semanticVersion, err := semver.NewVersion(stringVersion) + if err != nil { + log.Fatalf("Invalid version number: %v", err) + } + + // Extract binary extension + binaryExt := path.Ext(*binary) + + // Create the version info configuration container + vi := &goversioninfo.VersionInfo{} + + // FixedFileInfo + vi.FixedFileInfo.FileOS = "040004" // VOS_NT_WINDOWS32 + if strings.EqualFold(binaryExt, ".exe") { + vi.FixedFileInfo.FileType = "01" // VFT_APP + } else if strings.EqualFold(binaryExt, ".dll") { + vi.FixedFileInfo.FileType = "02" // VFT_DLL + } else { + log.Fatalf("Specified binary must have extension .exe or .dll") + } + // FixedFileInfo.FileVersion + vi.FixedFileInfo.FileVersion.Major = int(semanticVersion.Major) + vi.FixedFileInfo.FileVersion.Minor = int(semanticVersion.Minor) + vi.FixedFileInfo.FileVersion.Patch = int(semanticVersion.Patch) + vi.FixedFileInfo.FileVersion.Build = 0 + // FixedFileInfo.ProductVersion + vi.FixedFileInfo.ProductVersion.Major = int(semanticVersion.Major) + vi.FixedFileInfo.ProductVersion.Minor = int(semanticVersion.Minor) + vi.FixedFileInfo.ProductVersion.Patch = int(semanticVersion.Patch) + vi.FixedFileInfo.ProductVersion.Build = 0 + + // StringFileInfo + vi.StringFileInfo.CompanyName = "https://rclone.org" + vi.StringFileInfo.ProductName = "Rclone" + vi.StringFileInfo.FileDescription = "Rclone" + vi.StringFileInfo.InternalName = (*binary)[:len(*binary)-len(binaryExt)] + vi.StringFileInfo.OriginalFilename = *binary + vi.StringFileInfo.LegalCopyright = "The Rclone Authors" + vi.StringFileInfo.FileVersion = stringVersion + vi.StringFileInfo.ProductVersion = stringVersion + + // Icon (only relevant for .exe, not .dll) + if *icon != "" && strings.EqualFold(binaryExt, ".exe") { + vi.IconPath = *icon + } + + // Build native structures from the configuration data + vi.Build() + + // Write the native structures as binary data to a buffer + vi.Walk() + + // Write the binary data buffer to file + if err := vi.WriteSyso(*syso, *arch); err != nil { + log.Fatalf(`Failed to generate Windows %s resource system object file for %v with path "%v": %v`, *arch, *binary, *syso, err) + } +} diff --git a/bin/test_metadata_mapper.py b/bin/test_metadata_mapper.py new file mode 100755 index 0000000000000..6a99ee49a8aa2 --- /dev/null +++ b/bin/test_metadata_mapper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +""" +A demo metadata mapper +""" + +import sys +import json + +def main(): + i = json.load(sys.stdin) + # Add tag to description + metadata = i["Metadata"] + if "description" in metadata: + metadata["description"] += " [migrated from domain1]" + else: + metadata["description"] = "[migrated from domain1]" + # Modify owner + if "owner" in metadata: + metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com") + o = { "Metadata": metadata } + json.dump(o, sys.stdout, indent="\t") + +if __name__ == "__main__": + main() diff --git a/bin/update-authors.py b/bin/update-authors.py index effedb091dc20..b422c16a6da6e 100755 --- a/bin/update-authors.py +++ b/bin/update-authors.py @@ -27,6 +27,7 @@ def add_email(name, email): subprocess.check_call(["git", "commit", "-m", "Add %s to contributors" % name, AUTHORS]) def main(): + # Add emails from authors out = subprocess.check_output(["git", "log", '--reverse', '--format=%an|%ae', "master"]) out = out.decode("utf-8") @@ -43,5 +44,23 @@ def main(): previous.add(email) add_email(name, email) + # Add emails from Co-authored-by: lines + out = subprocess.check_output(["git", "log", '-i', '--grep', 'Co-authored-by:', "master"]) + out = out.decode("utf-8") + co_authored_by = re.compile(r"(?i)Co-authored-by:\s+(.*?)\s+<([^>]+)>$") + + for line in out.split("\n"): + line = line.strip() + m = co_authored_by.search(line) + if not m: + continue + name, email = m.group(1), m.group(2) + name = name.strip() + email = email.strip() + if email in previous: + continue + previous.add(email) + add_email(name, email) + if __name__ == "__main__": main() diff --git a/cmd/about/about.go b/cmd/about/about.go index 6d3afc91de882..611cd5cbc6009 100644 --- a/cmd/about/about.go +++ b/cmd/about/about.go @@ -22,8 +22,8 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &jsonOutput, "json", "", false, "Format output as JSON") - flags.BoolVarP(cmdFlags, &fullOutput, "full", "", false, "Full numbers instead of human-readable") + flags.BoolVarP(cmdFlags, &jsonOutput, "json", "", false, "Format output as JSON", "") + flags.BoolVarP(cmdFlags, &fullOutput, "full", "", false, "Full numbers instead of human-readable", "") } // printValue formats uv to be output @@ -95,6 +95,7 @@ see complete list in [documentation](https://rclone.org/overview/#optional-featu `, Annotations: map[string]string{ "versionIntroduced": "v1.41", + // "groups": "", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/all/all.go b/cmd/all/all.go index 569d1821ea1b5..5fb87ed16317c 100644 --- a/cmd/all/all.go +++ b/cmd/all/all.go @@ -40,6 +40,7 @@ import ( _ "github.com/rclone/rclone/cmd/move" _ "github.com/rclone/rclone/cmd/moveto" _ "github.com/rclone/rclone/cmd/ncdu" + _ "github.com/rclone/rclone/cmd/nfsmount" _ "github.com/rclone/rclone/cmd/obscure" _ "github.com/rclone/rclone/cmd/purge" _ "github.com/rclone/rclone/cmd/rc" diff --git a/cmd/authorize/authorize.go b/cmd/authorize/authorize.go index 5d946880accc0..1804485c1d81b 100644 --- a/cmd/authorize/authorize.go +++ b/cmd/authorize/authorize.go @@ -18,8 +18,8 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &noAutoBrowser, "auth-no-open-browser", "", false, "Do not automatically open auth link in default browser") - flags.StringVarP(cmdFlags, &template, "template", "", "", "The path to a custom Go template for generating HTML responses") + flags.BoolVarP(cmdFlags, &noAutoBrowser, "auth-no-open-browser", "", false, "Do not automatically open auth link in default browser", "") + flags.StringVarP(cmdFlags, &template, "template", "", "", "The path to a custom Go template for generating HTML responses", "") } var commandDefinition = &cobra.Command{ @@ -36,6 +36,7 @@ link in default browser automatically. Use --template to generate HTML output via a custom Go template. If a blank string is provided as an argument to this flag, the default template is used.`, Annotations: map[string]string{ "versionIntroduced": "v1.27", + // "groups": "", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(1, 3, command, args) diff --git a/cmd/backend/backend.go b/cmd/backend/backend.go index 67d499923698e..3de8fa6f0e9d6 100644 --- a/cmd/backend/backend.go +++ b/cmd/backend/backend.go @@ -24,8 +24,8 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.StringArrayVarP(cmdFlags, &options, "option", "o", options, "Option in the form name=value or name") - flags.BoolVarP(cmdFlags, &useJSON, "json", "", useJSON, "Always output in JSON format") + flags.StringArrayVarP(cmdFlags, &options, "option", "o", options, "Option in the form name=value or name", "") + flags.BoolVarP(cmdFlags, &useJSON, "json", "", useJSON, "Always output in JSON format", "") } var commandDefinition = &cobra.Command{ @@ -60,6 +60,7 @@ Note to run these commands on a running backend then see `, Annotations: map[string]string{ "versionIntroduced": "v1.52", + "groups": "Important", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(2, 1e6, command, args) @@ -98,8 +99,14 @@ Note to run these commands on a running backend then see out, err = doCommand(context.Background(), name, arg, opt) } if err != nil { + if err == fs.ErrorCommandNotFound { + extra := "" + if f.Features().Overlay { + extra = " (try the underlying remote)" + } + return fmt.Errorf("%q %w%s", name, err, extra) + } return fmt.Errorf("command %q failed: %w", name, err) - } // Output the result writeJSON := false diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 11299f012e686..55e98a19eaad8 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -614,6 +614,8 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { opt.DryRun = true case "force": opt.Force = true + case "create-empty-src-dirs": + opt.CreateEmptySrcDirs = true case "remove-empty-dirs": opt.RemoveEmptyDirs = true case "check-sync-only": @@ -824,8 +826,9 @@ func touchFiles(ctx context.Context, dateStr string, f fs.Fs, dir, glob string) err = nil buf := new(bytes.Buffer) size := obj.Size() + separator := "" if size > 0 { - err = operations.Cat(ctx, f, buf, 0, size) + err = operations.Cat(ctx, f, buf, 0, size, []byte(separator)) } info := object.NewStaticObjectInfo(remote, date, size, true, nil, f) if err == nil { @@ -1162,6 +1165,10 @@ func (b *bisyncTest) newReplacer(mangle bool) *strings.Replacer { b.workDir + slash, "{workdir/}", b.path1, "{path1/}", b.path2, "{path2/}", + "//?/" + strings.TrimSuffix(strings.Replace(b.path1, slash, "/", -1), "/"), "{path1}", // fix windows-specific issue + "//?/" + strings.TrimSuffix(strings.Replace(b.path2, slash, "/", -1), "/"), "{path2}", + strings.TrimSuffix(b.path1, slash), "{path1}", // ensure it's still recognized without trailing slash + strings.TrimSuffix(b.path2, slash), "{path2}", b.sessionName, "{session}", } if fixSlash { diff --git a/cmd/bisync/cmd.go b/cmd/bisync/cmd.go index 6f7c8fc151634..1a48660354188 100644 --- a/cmd/bisync/cmd.go +++ b/cmd/bisync/cmd.go @@ -27,18 +27,21 @@ import ( // Options keep bisync options type Options struct { - Resync bool - CheckAccess bool - CheckFilename string - CheckSync CheckSyncMode - RemoveEmptyDirs bool - MaxDelete int // percentage from 0 to 100 - Force bool - FiltersFile string - Workdir string - DryRun bool - NoCleanup bool - SaveQueues bool // save extra debugging files (test only flag) + Resync bool + CheckAccess bool + CheckFilename string + CheckSync CheckSyncMode + CreateEmptySrcDirs bool + RemoveEmptyDirs bool + MaxDelete int // percentage from 0 to 100 + Force bool + FiltersFile string + Workdir string + DryRun bool + NoCleanup bool + SaveQueues bool // save extra debugging files (test only flag) + IgnoreListingChecksum bool + Resilient bool } // Default values @@ -98,16 +101,19 @@ var Opt Options func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &Opt.Resync, "resync", "1", Opt.Resync, "Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.") - flags.BoolVarP(cmdFlags, &Opt.CheckAccess, "check-access", "", Opt.CheckAccess, makeHelp("Ensure expected {CHECKFILE} files are found on both Path1 and Path2 filesystems, else abort.")) - flags.StringVarP(cmdFlags, &Opt.CheckFilename, "check-filename", "", Opt.CheckFilename, makeHelp("Filename for --check-access (default: {CHECKFILE})")) - flags.BoolVarP(cmdFlags, &Opt.Force, "force", "", Opt.Force, "Bypass --max-delete safety check and run the sync. Consider using with --verbose") - flags.FVarP(cmdFlags, &Opt.CheckSync, "check-sync", "", "Controls comparison of final listings: true|false|only (default: true)") - flags.BoolVarP(cmdFlags, &Opt.RemoveEmptyDirs, "remove-empty-dirs", "", Opt.RemoveEmptyDirs, "Remove empty directories at the final cleanup step.") - flags.StringVarP(cmdFlags, &Opt.FiltersFile, "filters-file", "", Opt.FiltersFile, "Read filtering patterns from a file") - flags.StringVarP(cmdFlags, &Opt.Workdir, "workdir", "", Opt.Workdir, makeHelp("Use custom working dir - useful for testing. (default: {WORKDIR})")) - flags.BoolVarP(cmdFlags, &tzLocal, "localtime", "", tzLocal, "Use local time in listings (default: UTC)") - flags.BoolVarP(cmdFlags, &Opt.NoCleanup, "no-cleanup", "", Opt.NoCleanup, "Retain working files (useful for troubleshooting and testing).") + flags.BoolVarP(cmdFlags, &Opt.Resync, "resync", "1", Opt.Resync, "Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.", "") + flags.BoolVarP(cmdFlags, &Opt.CheckAccess, "check-access", "", Opt.CheckAccess, makeHelp("Ensure expected {CHECKFILE} files are found on both Path1 and Path2 filesystems, else abort."), "") + flags.StringVarP(cmdFlags, &Opt.CheckFilename, "check-filename", "", Opt.CheckFilename, makeHelp("Filename for --check-access (default: {CHECKFILE})"), "") + flags.BoolVarP(cmdFlags, &Opt.Force, "force", "", Opt.Force, "Bypass --max-delete safety check and run the sync. Consider using with --verbose", "") + flags.FVarP(cmdFlags, &Opt.CheckSync, "check-sync", "", "Controls comparison of final listings: true|false|only (default: true)", "") + flags.BoolVarP(cmdFlags, &Opt.CreateEmptySrcDirs, "create-empty-src-dirs", "", Opt.CreateEmptySrcDirs, "Sync creation and deletion of empty directories. (Not compatible with --remove-empty-dirs)", "") + flags.BoolVarP(cmdFlags, &Opt.RemoveEmptyDirs, "remove-empty-dirs", "", Opt.RemoveEmptyDirs, "Remove ALL empty directories at the final cleanup step.", "") + flags.StringVarP(cmdFlags, &Opt.FiltersFile, "filters-file", "", Opt.FiltersFile, "Read filtering patterns from a file", "") + flags.StringVarP(cmdFlags, &Opt.Workdir, "workdir", "", Opt.Workdir, makeHelp("Use custom working dir - useful for testing. (default: {WORKDIR})"), "") + flags.BoolVarP(cmdFlags, &tzLocal, "localtime", "", tzLocal, "Use local time in listings (default: UTC)", "") + flags.BoolVarP(cmdFlags, &Opt.NoCleanup, "no-cleanup", "", Opt.NoCleanup, "Retain working files (useful for troubleshooting and testing).", "") + flags.BoolVarP(cmdFlags, &Opt.IgnoreListingChecksum, "ignore-listing-checksum", "", Opt.IgnoreListingChecksum, "Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks)", "") + flags.BoolVarP(cmdFlags, &Opt.Resilient, "resilient", "", Opt.Resilient, "Allow future runs to retry after certain less-serious errors, instead of requiring --resync. Use at your own risk!", "") } // bisync command definition @@ -117,6 +123,7 @@ var commandDefinition = &cobra.Command{ Long: longHelp, Annotations: map[string]string{ "versionIntroduced": "v1.58", + "groups": "Filter,Copy,Important", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(2, 2, command, args) @@ -128,7 +135,6 @@ var commandDefinition = &cobra.Command{ ctx := context.Background() opt := Opt opt.applyContext(ctx) - if tzLocal { TZ = time.Local } @@ -210,9 +216,13 @@ func (opt *Options) applyFilters(ctx context.Context) (context.Context, error) { } if opt.Resync { - fs.Infof(nil, "Storing filters file hash to %s", hashFile) - if err := os.WriteFile(hashFile, []byte(gotHash), bilib.PermSecure); err != nil { - return ctx, err + if opt.DryRun { + fs.Infof(nil, "Skipped storing filters file hash to %s as --dry-run is set", hashFile) + } else { + fs.Infof(nil, "Storing filters file hash to %s", hashFile) + if err := os.WriteFile(hashFile, []byte(gotHash), bilib.PermSecure); err != nil { + return ctx, err + } } } diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index d1dee1a1d1bf4..ccd43edbe7fc9 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -3,13 +3,18 @@ package bisync import ( + "bytes" "context" "fmt" "path/filepath" "sort" + "strings" "github.com/rclone/rclone/cmd/bisync/bilib" + "github.com/rclone/rclone/cmd/check" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" ) @@ -90,6 +95,47 @@ func (ds *deltaSet) printStats() { ds.msg, nAll, nNew, nNewer, nOlder, nDeleted) } +// check potential conflicts (to avoid renaming if already identical) +func (b *bisyncRun) checkconflicts(ctxCheck context.Context, filterCheck *filter.Filter, fs1, fs2 fs.Fs) (bilib.Names, error) { + matches := bilib.Names{} + if filterCheck.HaveFilesFrom() { + fs.Debugf(nil, "There are potential conflicts to check.") + + opt, close, checkopterr := check.GetCheckOpt(b.fs1, b.fs2) + if checkopterr != nil { + b.critical = true + b.retryable = true + fs.Debugf(nil, "GetCheckOpt error: %v", checkopterr) + return matches, checkopterr + } + defer close() + + opt.Match = new(bytes.Buffer) + + // TODO: consider using custom CheckFn to act like cryptcheck, if either fs is a crypt remote and -c has been passed + // note that cryptCheck() is not currently exported + + fs.Infof(nil, "Checking potential conflicts...") + check := operations.Check(ctxCheck, opt) + fs.Infof(nil, "Finished checking the potential conflicts. %s", check) + + //reset error count, because we don't want to count check errors as bisync errors + accounting.Stats(ctxCheck).ResetErrors() + + //return the list of identical files to check against later + if len(fmt.Sprint(opt.Match)) > 0 { + matches = bilib.ToNames(strings.Split(fmt.Sprint(opt.Match), "\n")) + } + if matches.NotEmpty() { + fs.Debugf(nil, "The following potential conflicts were determined to be identical. %v", matches) + } else { + fs.Debugf(nil, "None of the conflicts were determined to be identical.") + } + + } + return matches, nil +} + // findDeltas func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing, newListing, msg string) (ds *deltaSet, err error) { var old, now *fileList @@ -183,6 +229,52 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change ctxMove := b.opt.setDryRun(ctx) + // efficient isDir check + // we load the listing just once and store only the dirs + dirs1, dirs1Err := b.listDirsOnly(1) + if dirs1Err != nil { + b.critical = true + b.retryable = true + fs.Debugf(nil, "Error generating dirsonly list for path1: %v", dirs1Err) + return + } + + dirs2, dirs2Err := b.listDirsOnly(2) + if dirs2Err != nil { + b.critical = true + b.retryable = true + fs.Debugf(nil, "Error generating dirsonly list for path2: %v", dirs2Err) + return + } + + // build a list of only the "deltaOther"s so we don't have to check more files than necessary + // this is essentially the same as running rclone check with a --files-from filter, then exempting the --match results from being renamed + // we therefore avoid having to list the same directory more than once. + + // we are intentionally overriding DryRun here because we need to perform the check, even during a dry run, or the results would be inaccurate. + // check is a read-only operation by its nature, so it's already "dry" in that sense. + ctxNew, ciCheck := fs.AddConfig(ctx) + ciCheck.DryRun = false + + ctxCheck, filterCheck := filter.AddConfig(ctxNew) + + for _, file := range ds1.sort() { + d1 := ds1.deltas[file] + if d1.is(deltaOther) { + d2 := ds2.deltas[file] + if d2.is(deltaOther) { + if err := filterCheck.AddFile(file); err != nil { + fs.Debugf(nil, "Non-critical error adding file to list of potential conflicts to check: %s", err) + } else { + fs.Debugf(nil, "Added file to list of potential conflicts to check: %s", file) + } + } + } + } + + //if there are potential conflicts to check, check them all here (outside the loop) in one fell swoop + matches, err := b.checkconflicts(ctxCheck, filterCheck, b.fs1, b.fs2) + for _, file := range ds1.sort() { p1 := path1 + file p2 := path2 + file @@ -199,22 +291,34 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change handled.Add(file) } else if d2.is(deltaOther) { b.indent("!WARNING", file, "New or changed in both paths") - b.indent("!Path1", p1+"..path1", "Renaming Path1 copy") - if err = operations.MoveFile(ctxMove, b.fs1, b.fs1, file+"..path1", file); err != nil { - err = fmt.Errorf("path1 rename failed for %s: %w", p1, err) - b.critical = true - return - } - b.indent("!Path1", p2+"..path1", "Queue copy to Path2") - copy1to2.Add(file + "..path1") - b.indent("!Path2", p2+"..path2", "Renaming Path2 copy") - if err = operations.MoveFile(ctxMove, b.fs2, b.fs2, file+"..path2", file); err != nil { - err = fmt.Errorf("path2 rename failed for %s: %w", file, err) - return + //if files are identical, leave them alone instead of renaming + if dirs1.has(file) && dirs2.has(file) { + fs.Debugf(nil, "This is a directory, not a file. Skipping equality check and will not rename: %s", file) + } else { + equal := matches.Has(file) + if equal { + fs.Infof(nil, "Files are equal! Skipping: %s", file) + } else { + fs.Debugf(nil, "Files are NOT equal: %s", file) + b.indent("!Path1", p1+"..path1", "Renaming Path1 copy") + if err = operations.MoveFile(ctxMove, b.fs1, b.fs1, file+"..path1", file); err != nil { + err = fmt.Errorf("path1 rename failed for %s: %w", p1, err) + b.critical = true + return + } + b.indent("!Path1", p2+"..path1", "Queue copy to Path2") + copy1to2.Add(file + "..path1") + + b.indent("!Path2", p2+"..path2", "Renaming Path2 copy") + if err = operations.MoveFile(ctxMove, b.fs2, b.fs2, file+"..path2", file); err != nil { + err = fmt.Errorf("path2 rename failed for %s: %w", file, err) + return + } + b.indent("!Path2", p1+"..path2", "Queue copy to Path1") + copy2to1.Add(file + "..path2") + } } - b.indent("!Path2", p1+"..path2", "Queue copy to Path1") - copy2to1.Add(file + "..path2") handled.Add(file) } } else { @@ -258,6 +362,9 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if err != nil { return } + + //copy empty dirs from path2 to path1 (if --create-empty-src-dirs) + b.syncEmptyDirs(ctx, b.fs1, copy2to1, dirs2, "make") } if copy1to2.NotEmpty() { @@ -267,6 +374,9 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if err != nil { return } + + //copy empty dirs from path1 to path2 (if --create-empty-src-dirs) + b.syncEmptyDirs(ctx, b.fs2, copy1to2, dirs1, "make") } if delete1.NotEmpty() { @@ -276,6 +386,9 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if err != nil { return } + + //propagate deletions of empty dirs from path2 to path1 (if --create-empty-src-dirs) + b.syncEmptyDirs(ctx, b.fs1, delete1, dirs1, "remove") } if delete2.NotEmpty() { @@ -285,6 +398,9 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if err != nil { return } + + //propagate deletions of empty dirs from path1 to path2 (if --create-empty-src-dirs) + b.syncEmptyDirs(ctx, b.fs2, delete2, dirs2, "remove") } return diff --git a/cmd/bisync/help.go b/cmd/bisync/help.go index 14e6f78663d31..84e78ab9d9b37 100644 --- a/cmd/bisync/help.go +++ b/cmd/bisync/help.go @@ -27,11 +27,16 @@ var rcHelp = makeHelp(`This takes the following parameters - checkFilename - file name for checkAccess (default: {CHECKFILE}) - maxDelete - abort sync if percentage of deleted files is above this threshold (default: {MAXDELETE}) -- force - maxDelete safety check and run the sync +- force - Bypass maxDelete safety check and run the sync - checkSync - |true| by default, |false| disables comparison of final listings, |only| will skip sync, only compare listings from the last run +- createEmptySrcDirs - Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) - removeEmptyDirs - remove empty directories at the final cleanup step - filtersFile - read filtering patterns from a file +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. + Use at your own risk! - workdir - server directory for history files (default: {WORKDIR}) - noCleanup - retain working files diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 066b927e81843..b2edb7ec948f2 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -43,10 +43,11 @@ var tzLocal = false // fileInfo describes a file type fileInfo struct { - size int64 - time time.Time - hash string - id string + size int64 + time time.Time + hash string + id string + flags string } // fileList represents a listing @@ -76,17 +77,18 @@ func (ls *fileList) get(file string) *fileInfo { return ls.info[file] } -func (ls *fileList) put(file string, size int64, time time.Time, hash, id string) { +func (ls *fileList) put(file string, size int64, time time.Time, hash, id string, flags string) { fi := ls.get(file) if fi != nil { fi.size = size fi.time = time } else { fi = &fileInfo{ - size: size, - time: time, - hash: hash, - id: id, + size: size, + time: time, + hash: hash, + id: id, + flags: flags, } ls.info[file] = fi ls.list = append(ls.list, file) @@ -152,7 +154,11 @@ func (ls *fileList) save(ctx context.Context, listing string) error { id = "-" } - flags := "-" + flags := fi.flags + if flags == "" { + flags = "-" + } + _, err = fmt.Fprintf(file, lineFormat, flags, fi.size, hash, id, time, remote) if err != nil { _ = file.Close() @@ -217,7 +223,7 @@ func (b *bisyncRun) loadListing(listing string) (*fileList, error) { } } - if flags != "-" || id != "-" || sizeErr != nil || timeErr != nil || hashErr != nil || nameErr != nil { + if (flags != "-" && flags != "d") || id != "-" || sizeErr != nil || timeErr != nil || hashErr != nil || nameErr != nil { fs.Logf(listing, "Ignoring incorrect line: %q", line) continue } @@ -229,7 +235,7 @@ func (b *bisyncRun) loadListing(listing string) (*fileList, error) { } } - ls.put(nameVal, sizeVal, timeVal.In(TZ), hashVal, id) + ls.put(nameVal, sizeVal, timeVal.In(TZ), hashVal, id, flags) } return ls, nil @@ -253,15 +259,20 @@ func (b *bisyncRun) makeListing(ctx context.Context, f fs.Fs, listing string) (l ci := fs.GetConfig(ctx) depth := ci.MaxDepth hashType := hash.None - if !ci.IgnoreChecksum { - // Currently bisync just honors --ignore-checksum + if !b.opt.IgnoreListingChecksum { + // Currently bisync just honors --ignore-listing-checksum + // (note that this is different from --ignore-checksum) // TODO add full support for checksums and related flags hashType = f.Hashes().GetOne() } ls = newFileList() ls.hash = hashType var lock sync.Mutex - err = walk.ListR(ctx, f, "", false, depth, walk.ListObjects, func(entries fs.DirEntries) error { + listType := walk.ListObjects + if b.opt.CreateEmptySrcDirs { + listType = walk.ListAll + } + err = walk.ListR(ctx, f, "", false, depth, listType, func(entries fs.DirEntries) error { var firstErr error entries.ForObject(func(o fs.Object) { //tr := accounting.Stats(ctx).NewCheckingTransfer(o) // TODO @@ -276,12 +287,27 @@ func (b *bisyncRun) makeListing(ctx context.Context, f fs.Fs, listing string) (l } } time := o.ModTime(ctx).In(TZ) - id := "" // TODO + id := "" // TODO + flags := "-" // "-" for a file and "d" for a directory lock.Lock() - ls.put(o.Remote(), o.Size(), time, hashVal, id) + ls.put(o.Remote(), o.Size(), time, hashVal, id, flags) lock.Unlock() //tr.Done(ctx, nil) // TODO }) + if b.opt.CreateEmptySrcDirs { + entries.ForDir(func(o fs.Directory) { + var ( + hashVal string + ) + time := o.ModTime(ctx).In(TZ) + id := "" // TODO + flags := "d" // "-" for a file and "d" for a directory + lock.Lock() + //record size as 0 instead of -1, so bisync doesn't think it's a google doc + ls.put(o.Remote(), 0, time, hashVal, id, flags) + lock.Unlock() + }) + } return firstErr }) if err == nil { @@ -300,5 +326,53 @@ func (b *bisyncRun) checkListing(ls *fileList, listing, msg string) error { } fs.Errorf(nil, "Empty %s listing. Cannot sync to an empty directory: %s", msg, listing) b.critical = true + b.retryable = true return fmt.Errorf("empty %s listing: %s", msg, listing) } + +// listingNum should be 1 for path1 or 2 for path2 +func (b *bisyncRun) loadListingNum(listingNum int) (*fileList, error) { + listingpath := b.basePath + ".path1.lst-new" + if listingNum == 2 { + listingpath = b.basePath + ".path2.lst-new" + } + + if b.opt.DryRun { + listingpath = strings.Replace(listingpath, ".lst-", ".lst-dry-", 1) + } + + fs.Debugf(nil, "loading listing for path %d at: %s", listingNum, listingpath) + return b.loadListing(listingpath) +} + +func (b *bisyncRun) listDirsOnly(listingNum int) (*fileList, error) { + var fulllisting *fileList + var dirsonly = newFileList() + var err error + + if !b.opt.CreateEmptySrcDirs { + return dirsonly, err + } + + fulllisting, err = b.loadListingNum(listingNum) + + if err != nil { + b.critical = true + b.retryable = true + fs.Debugf(nil, "Error loading listing to generate dirsonly list: %v", err) + return dirsonly, err + } + + for _, obj := range fulllisting.list { + info := fulllisting.get(obj) + + if info.flags == "d" { + fs.Debugf(nil, "found a dir: %s", obj) + dirsonly.put(obj, info.size, info.time, info.hash, info.id, info.flags) + } else { + fs.Debugf(nil, "not a dir: %s", obj) + } + } + + return dirsonly, err +} diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 85b1e43d17182..250437e626b41 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -25,13 +25,14 @@ var ErrBisyncAborted = errors.New("bisync aborted") // bisyncRun keeps bisync runtime state type bisyncRun struct { - fs1 fs.Fs - fs2 fs.Fs - abort bool - critical bool - basePath string - workDir string - opt *Options + fs1 fs.Fs + fs2 fs.Fs + abort bool + critical bool + retryable bool + basePath string + workDir string + opt *Options } // Bisync handles lock file, performs bisync run and checks exit status @@ -123,14 +124,19 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { } if b.critical { - if bilib.FileExists(listing1) { - _ = os.Rename(listing1, listing1+"-err") - } - if bilib.FileExists(listing2) { - _ = os.Rename(listing2, listing2+"-err") + if b.retryable && b.opt.Resilient { + fs.Errorf(nil, "Bisync critical error: %v", err) + fs.Errorf(nil, "Bisync aborted. Error is retryable without --resync due to --resilient mode.") + } else { + if bilib.FileExists(listing1) { + _ = os.Rename(listing1, listing1+"-err") + } + if bilib.FileExists(listing2) { + _ = os.Rename(listing2, listing2+"-err") + } + fs.Errorf(nil, "Bisync critical error: %v", err) + fs.Errorf(nil, "Bisync aborted. Must run --resync to recover.") } - fs.Errorf(nil, "Bisync critical error: %v", err) - fs.Errorf(nil, "Bisync aborted. Must run --resync to recover.") return ErrBisyncAborted } if b.abort { @@ -152,6 +158,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( fs.Infof(nil, "Validating listings for Path1 %s vs Path2 %s", quotePath(path1), quotePath(path2)) if err = b.checkSync(listing1, listing2); err != nil { b.critical = true + b.retryable = true } return err } @@ -176,6 +183,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( var fctx context.Context if fctx, err = b.opt.applyFilters(octx); err != nil { b.critical = true + b.retryable = true return } @@ -188,6 +196,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( if !bilib.FileExists(listing1) || !bilib.FileExists(listing2) { // On prior critical error abort, the prior listings are renamed to .lst-err to lock out further runs b.critical = true + b.retryable = true return errors.New("cannot find prior Path1 or Path2 listings, likely due to critical error on prior run") } @@ -215,6 +224,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( err = b.checkAccess(ds1.checkFiles, ds2.checkFiles) if err != nil { b.critical = true + b.retryable = true return } } @@ -255,6 +265,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( changes1, changes2, err = b.applyDeltas(octx, ds1, ds2) if err != nil { b.critical = true + // b.retryable = true // not sure about this one return err } } @@ -283,6 +294,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( } if err != nil { b.critical = true + b.retryable = true return err } @@ -310,6 +322,7 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( } if err != nil { b.critical = true + b.retryable = true return err } } @@ -341,6 +354,39 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string return err } + // Check access health on the Path1 and Path2 filesystems + // enforce even though this is --resync + if b.opt.CheckAccess { + fs.Infof(nil, "Checking access health") + + ds1 := &deltaSet{ + checkFiles: bilib.Names{}, + } + + ds2 := &deltaSet{ + checkFiles: bilib.Names{}, + } + + for _, file := range filesNow1.list { + if filepath.Base(file) == b.opt.CheckFilename { + ds1.checkFiles.Add(file) + } + } + + for _, file := range filesNow2.list { + if filepath.Base(file) == b.opt.CheckFilename { + ds2.checkFiles.Add(file) + } + } + + err = b.checkAccess(ds1.checkFiles, ds2.checkFiles) + if err != nil { + b.critical = true + b.retryable = true + return err + } + } + copy2to1 := []string{} for _, file := range filesNow2.list { if !filesNow1.has(file) { @@ -367,11 +413,34 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string // prevent overwriting Google Doc files (their size is -1) filterSync.Opt.MinSize = 0 } - if err = sync.Sync(ctxSync, b.fs2, b.fs1, false); err != nil { + if err = sync.CopyDir(ctxSync, b.fs2, b.fs1, b.opt.CreateEmptySrcDirs); err != nil { b.critical = true return err } + if b.opt.CreateEmptySrcDirs { + // copy Path2 back to Path1, for empty dirs + // the fastCopy above cannot include directories, because it relies on --files-from for filtering, + // so instead we'll copy them here, relying on fctx for our filtering. + + // This preserves the original resync order for backward compatibility. It is essentially: + // rclone copy Path2 Path1 --ignore-existing + // rclone copy Path1 Path2 --create-empty-src-dirs + // rclone copy Path2 Path1 --create-empty-src-dirs + + // although if we were starting from scratch, it might be cleaner and faster to just do: + // rclone copy Path2 Path1 --create-empty-src-dirs + // rclone copy Path1 Path2 --create-empty-src-dirs + + fs.Infof(nil, "Resynching Path2 to Path1 (for empty dirs)") + + //note copy (not sync) and dst comes before src + if err = sync.CopyDir(ctxSync, b.fs1, b.fs2, b.opt.CreateEmptySrcDirs); err != nil { + b.critical = true + return err + } + } + fs.Infof(nil, "Resync updating listings") if _, err = b.makeListing(fctx, b.fs1, listing1); err != nil { b.critical = true diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index 08bb208621e45..701c8a922309b 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -3,6 +3,7 @@ package bisync import ( "context" "fmt" + "sort" "github.com/rclone/rclone/cmd/bisync/bilib" "github.com/rclone/rclone/fs" @@ -23,7 +24,7 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. } } - return sync.CopyDir(ctxCopy, fdst, fsrc, false) + return sync.CopyDir(ctxCopy, fdst, fsrc, b.opt.CreateEmptySrcDirs) } func (b *bisyncRun) fastDelete(ctx context.Context, f fs.Fs, files bilib.Names, queueName string) error { @@ -32,7 +33,14 @@ func (b *bisyncRun) fastDelete(ctx context.Context, f fs.Fs, files bilib.Names, } transfers := fs.GetConfig(ctx).Transfers - ctxRun := b.opt.setDryRun(ctx) + + ctxRun, filterDelete := filter.AddConfig(b.opt.setDryRun(ctx)) + + for _, file := range files.ToList() { + if err := filterDelete.AddFile(file); err != nil { + return err + } + } objChan := make(fs.ObjectsChan, transfers) errChan := make(chan error, 1) @@ -53,6 +61,36 @@ func (b *bisyncRun) fastDelete(ctx context.Context, f fs.Fs, files bilib.Names, return err } +// operation should be "make" or "remove" +func (b *bisyncRun) syncEmptyDirs(ctx context.Context, dst fs.Fs, candidates bilib.Names, dirsList *fileList, operation string) { + if b.opt.CreateEmptySrcDirs && (!b.opt.Resync || operation == "make") { + + candidatesList := candidates.ToList() + if operation == "remove" { + // reverse the sort order to ensure we remove subdirs before parent dirs + sort.Sort(sort.Reverse(sort.StringSlice(candidatesList))) + } + + for _, s := range candidatesList { + var direrr error + if dirsList.has(s) { //make sure it's a dir, not a file + if operation == "remove" { + //note: we need to use Rmdirs instead of Rmdir because directories will fail to delete if they have other empty dirs inside of them. + direrr = operations.Rmdirs(ctx, dst, s, false) + } else if operation == "make" { + direrr = operations.Mkdir(ctx, dst, s) + } else { + direrr = fmt.Errorf("invalid operation. Expected 'make' or 'remove', received '%q'", operation) + } + + if direrr != nil { + fs.Debugf(nil, "Error syncing directory: %v", direrr) + } + } + } + } +} + func (b *bisyncRun) saveQueue(files bilib.Names, jobName string) error { if !b.opt.SaveQueues { return nil diff --git a/cmd/bisync/rc.go b/cmd/bisync/rc.go index 04f723f038c18..550be5e381343 100644 --- a/cmd/bisync/rc.go +++ b/cmd/bisync/rc.go @@ -26,6 +26,7 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if dryRun, err := in.GetBool("dryRun"); err == nil { ci.DryRun = dryRun + opt.DryRun = dryRun } else if rc.NotErrParamNotFound(err) { return nil, err } @@ -34,7 +35,7 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if maxDelete < 0 || maxDelete > 100 { return nil, rc.NewErrParamInvalid(errors.New("maxDelete must be a percentage between 0 and 100")) } - ci.MaxDelete = maxDelete + opt.MaxDelete = int(maxDelete) } else if rc.NotErrParamNotFound(err) { return nil, err } @@ -48,12 +49,21 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if opt.Force, err = in.GetBool("force"); rc.NotErrParamNotFound(err) { return } + if opt.CreateEmptySrcDirs, err = in.GetBool("createEmptySrcDirs"); rc.NotErrParamNotFound(err) { + return + } if opt.RemoveEmptyDirs, err = in.GetBool("removeEmptyDirs"); rc.NotErrParamNotFound(err) { return } if opt.NoCleanup, err = in.GetBool("noCleanup"); rc.NotErrParamNotFound(err) { return } + if opt.IgnoreListingChecksum, err = in.GetBool("ignoreListingChecksum"); rc.NotErrParamNotFound(err) { + return + } + if opt.Resilient, err = in.GetBool("resilient"); rc.NotErrParamNotFound(err) { + return + } if opt.CheckFilename, err = in.GetString("checkFilename"); rc.NotErrParamNotFound(err) { return @@ -69,6 +79,9 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if rc.NotErrParamNotFound(err) { return nil, err } + if checkSync == "" { + checkSync = "true" + } if err := opt.CheckSync.Set(checkSync); err != nil { return nil, err } diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst index 49142c3e6da8e..ddb01f4a77fe2 100644 --- a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst @@ -4,7 +4,7 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-new index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst index 49142c3e6da8e..ddb01f4a77fe2 100644 --- a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst @@ -4,7 +4,7 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-new index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.log index 1b314688d11db..222b297587298 100644 --- a/cmd/bisync/testdata/test_changes/golden/test.log +++ b/cmd/bisync/testdata/test_changes/golden/test.log @@ -68,6 +68,11 @@ INFO : - Path2 File was deleted - file7.txt INFO : - Path2 File was deleted - file8.txt INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file5.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt INFO : - Path2 Queue delete - {path2/}file4.txt diff --git a/cmd/bisync/testdata/test_changes/modfiles/file5L.txt b/cmd/bisync/testdata/test_changes/modfiles/file5L.txt index 464147f09c0c8..43ceff1dbe273 100644 --- a/cmd/bisync/testdata/test_changes/modfiles/file5L.txt +++ b/cmd/bisync/testdata/test_changes/modfiles/file5L.txt @@ -1 +1 @@ -This file is newer +This file is newer and not equal to 5R diff --git a/cmd/bisync/testdata/test_changes/modfiles/file5R.txt b/cmd/bisync/testdata/test_changes/modfiles/file5R.txt index 464147f09c0c8..a928fcf1382e0 100644 --- a/cmd/bisync/testdata/test_changes/modfiles/file5R.txt +++ b/cmd/bisync/testdata/test_changes/modfiles/file5R.txt @@ -1 +1 @@ -This file is newer +This file is newer and not equal to 5L diff --git a/cmd/bisync/testdata/test_check_access_filters/scenario.txt b/cmd/bisync/testdata/test_check_access_filters/scenario.txt index 46948a468fcf5..f29806ba6424d 100644 --- a/cmd/bisync/testdata/test_check_access_filters/scenario.txt +++ b/cmd/bisync/testdata/test_check_access_filters/scenario.txt @@ -3,8 +3,8 @@ test check-access-filters # NOTE: Include Other tests may result in listing diffs due to rclone processing order change. False fail. # # Tests are done in two phases: -# - EXCLUDE OTHER tests check that RCLONE_TEST files are only found in the explicity included directories -# - INCLUDE OTHER tesss check that RCLONE_TEST files are found in all directories not explicity excluded +# - EXCLUDE OTHER tests check that RCLONE_TEST files are only found in the explicitly included directories +# - INCLUDE OTHER tesss check that RCLONE_TEST files are found in all directories not explicitly excluded # # Each phase checks that: # - missing RCLONE_TEST files in don't care directories don't cause failures diff --git a/cmd/bisync/testdata/test_check_filename/golden/test.log b/cmd/bisync/testdata/test_check_filename/golden/test.log index 78d0555ac098d..d008b934d731a 100644 --- a/cmd/bisync/testdata/test_check_filename/golden/test.log +++ b/cmd/bisync/testdata/test_check_filename/golden/test.log @@ -39,10 +39,12 @@ Bisync error: bisync aborted (10) : move-listings path2-missing (11) : test 3. put the remote subdir .chk_file back, run resync. -(12) : copy-file {path1/}subdir/.chk_file {path2/} +(12) : copy-file {path1/}subdir/.chk_file {path2/}subdir/ (13) : bisync check-access resync check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 +INFO : Checking access health +INFO : Found 2 matching ".chk_file" files on both paths INFO : Resynching Path1 to Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_filename/scenario.txt b/cmd/bisync/testdata/test_check_filename/scenario.txt index 3d0b0ab49ba67..d20a3ee4820c7 100644 --- a/cmd/bisync/testdata/test_check_filename/scenario.txt +++ b/cmd/bisync/testdata/test_check_filename/scenario.txt @@ -20,7 +20,7 @@ bisync check-access check-filename=.chk_file move-listings path2-missing test 3. put the remote subdir .chk_file back, run resync. -copy-file {path1/}subdir/.chk_file {path2/} +copy-file {path1/}subdir/.chk_file {path2/}subdir/ bisync check-access resync check-filename=.chk_file test 4. run sync with check-access. should pass. diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..4f985e416e189 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1 @@ +"subdir" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.delete2.que b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.delete2.que new file mode 100644 index 0000000000000..4f985e416e189 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.delete2.que @@ -0,0 +1 @@ +"subdir" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst new file mode 100644 index 0000000000000..5d46d406910a8 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst @@ -0,0 +1,7 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-new new file mode 100644 index 0000000000000..5d46d406910a8 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -0,0 +1,7 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst new file mode 100644 index 0000000000000..5d46d406910a8 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst @@ -0,0 +1,7 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-new new file mode 100644 index 0000000000000..5d46d406910a8 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -0,0 +1,7 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que new file mode 100644 index 0000000000000..4f985e416e189 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que @@ -0,0 +1 @@ +"subdir" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log new file mode 100644 index 0000000000000..b8799524a97eb --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log @@ -0,0 +1,142 @@ +(01) : test createemptysrcdirs + + +(02) : test initial bisync +(03) : touch-glob 2001-01-02 {datadir/} placeholder.txt +(04) : copy-as {datadir/}placeholder.txt {path1/} file1.txt +(05) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +(06) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +(07) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +(08) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +(09) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +(10) : bisync resync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + +(11) : test 1. Create an empty dir on Path1 by creating subdir/placeholder.txt and then deleting the placeholder +(12) : copy-as {datadir/}placeholder.txt {path1/} subdir/placeholder.txt +(13) : touch-glob 2001-01-02 {path1/} subdir +(14) : delete-file {path1/}subdir/placeholder.txt + +(15) : test 2. Run bisync without --create-empty-src-dirs +(16) : bisync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : Path2 checking for diffs +INFO : No changes found +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(17) : test 3. Confirm the subdir exists only on Path1 and not Path2 +(18) : list-dirs {path1/} +subdir/ +(19) : list-dirs {path2/} + +(20) : test 4.Run bisync WITH --create-empty-src-dirs +(21) : bisync create-empty-src-dirs +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File is new - subdir +INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - {path2/}subdir +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(22) : test 5. Confirm the subdir exists on both paths +(23) : list-dirs {path1/} +subdir/ +(24) : list-dirs {path2/} +subdir/ + +(25) : test 6. Delete the empty dir on Path1 using purge-children (and also add files so the path isn't empty) +(26) : purge-children {path1/} +(27) : copy-as {datadir/}placeholder.txt {path1/} file1.txt +(28) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +(29) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +(30) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +(31) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +(32) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt + +(33) : test 7. Run bisync without --create-empty-src-dirs +(34) : bisync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File was deleted - RCLONE_TEST +INFO : - Path1 File was deleted - subdir +INFO : Path1: 2 changes: 0 new, 0 newer, 0 older, 2 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File was deleted - subdir +INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted +INFO : Applying changes +INFO : - Path2 Queue delete - {path2/}RCLONE_TEST +INFO : - Do queued deletes on - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(35) : test 8. Confirm the subdir exists only on Path2 and not Path1 +(36) : list-dirs {path1/} +(37) : list-dirs {path2/} +subdir/ + +(38) : test 9. Reset, do the delete again, and run bisync WITH --create-empty-src-dirs +(39) : bisync resync create-empty-src-dirs +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : - Path2 Resync will copy to Path1 - subdir +INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : Resynching Path1 to Path2 +INFO : Resynching Path2 to Path1 (for empty dirs) +INFO : Resync updating listings +INFO : Bisync successful +(40) : list-dirs {path1/} +subdir/ +(41) : list-dirs {path2/} +subdir/ + +(42) : purge-children {path1/} +(43) : copy-as {datadir/}placeholder.txt {path1/} file1.txt +(44) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +(45) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +(46) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +(47) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +(48) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +(49) : list-dirs {path1/} +(50) : list-dirs {path2/} +subdir/ + +(51) : bisync create-empty-src-dirs +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File was deleted - subdir +INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted +INFO : Path2 checking for diffs +INFO : Applying changes +INFO : - Path2 Queue delete - {path2/}subdir +INFO : - Do queued deletes on - Path2 +INFO : subdir: Removing directory +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(52) : test 10. Confirm the subdir has been removed on both paths +(53) : list-dirs {path1/} +(54) : list-dirs {path2/} + +(55) : test 11. bisync again (because if we leave subdir in listings, test will fail due to mismatched modtime) +(56) : bisync create-empty-src-dirs +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : Path2 checking for diffs +INFO : No changes found +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/RCLONE_TEST b/cmd/bisync/testdata/test_createemptysrcdirs/initial/RCLONE_TEST new file mode 100644 index 0000000000000..d8ca97c2a4dbe --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/initial/RCLONE_TEST @@ -0,0 +1 @@ +This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete. diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy1.txt b/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy2.txt b/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy2.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy3.txt b/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy3.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy4.txt b/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy4.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy5.txt b/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.copy5.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.txt b/cmd/bisync/testdata/test_createemptysrcdirs/initial/file1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/modfiles/placeholder.txt b/cmd/bisync/testdata/test_createemptysrcdirs/modfiles/placeholder.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/scenario.txt b/cmd/bisync/testdata/test_createemptysrcdirs/scenario.txt new file mode 100644 index 0000000000000..8b39ae2b598db --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/scenario.txt @@ -0,0 +1,87 @@ +test createemptysrcdirs +# Test the --create-empty-src-dirs logic. +# Should behave the same way as rclone sync. +# Without this flag, empty directories created/deleted on one side are NOT created/deleted on the other side +# With this flag, empty directories created/deleted on one side are created/deleted on the other side; the result should be an exact mirror. +# +# Placeholders are necessary to ensure that git does not lose our empty folders +# After the initial setup sync: +# 1. Create an empty dir on Path1 by creating subdir/placeholder.txt and then deleting the placeholder +# 2. Run bisync without --create-empty-src-dirs +# 3. Confirm the subdir exists only on Path1 and not Path2 +# 4. Run bisync WITH --create-empty-src-dirs +# 5. Confirm the subdir exists on both paths +# 6. Delete the empty dir on Path1 using purge-children (and also add files so the path isn't empty) +# 7. Run bisync without --create-empty-src-dirs +# 8. Confirm the subdir exists only on Path2 and not Path1 +# 9. Reset, do the delete again, and run bisync WITH --create-empty-src-dirs +# 10. Confirm the subdir has been removed on both paths + +test initial bisync +touch-glob 2001-01-02 {datadir/} placeholder.txt +copy-as {datadir/}placeholder.txt {path1/} file1.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +bisync resync + +test 1. Create an empty dir on Path1 by creating subdir/placeholder.txt and then deleting the placeholder +copy-as {datadir/}placeholder.txt {path1/} subdir/placeholder.txt +touch-glob 2001-01-02 {path1/} subdir +delete-file {path1/}subdir/placeholder.txt + +test 2. Run bisync without --create-empty-src-dirs +bisync + +test 3. Confirm the subdir exists only on Path1 and not Path2 +list-dirs {path1/} +list-dirs {path2/} + +test 4.Run bisync WITH --create-empty-src-dirs +bisync create-empty-src-dirs + +test 5. Confirm the subdir exists on both paths +list-dirs {path1/} +list-dirs {path2/} + +test 6. Delete the empty dir on Path1 using purge-children (and also add files so the path isn't empty) +purge-children {path1/} +copy-as {datadir/}placeholder.txt {path1/} file1.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt + +test 7. Run bisync without --create-empty-src-dirs +bisync + +test 8. Confirm the subdir exists only on Path2 and not Path1 +list-dirs {path1/} +list-dirs {path2/} + +test 9. Reset, do the delete again, and run bisync WITH --create-empty-src-dirs +bisync resync create-empty-src-dirs +list-dirs {path1/} +list-dirs {path2/} + +purge-children {path1/} +copy-as {datadir/}placeholder.txt {path1/} file1.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +list-dirs {path1/} +list-dirs {path2/} + +bisync create-empty-src-dirs + +test 10. Confirm the subdir has been removed on both paths +list-dirs {path1/} +list-dirs {path2/} + +test 11. bisync again (because if we leave subdir in listings, test will fail due to mismatched modtime) +bisync create-empty-src-dirs \ No newline at end of file diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst index 49142c3e6da8e..ddb01f4a77fe2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst @@ -4,7 +4,7 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-new index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst index 49142c3e6da8e..ddb01f4a77fe2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst @@ -4,7 +4,7 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-new index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-new index 239afb58ceead..8ea562aab97d2 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" - 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-new index 377ac6a2ac033..ba1b8daab2073 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-new @@ -4,5 +4,5 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.log index 2efdb1f8162bb..13bd9654aa21d 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/test.log +++ b/cmd/bisync/testdata/test_dry_run/golden/test.log @@ -54,13 +54,10 @@ NOTICE: file4.txt: Skipped copy as --dry-run is set (size 0) NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19) INFO : Resynching Path1 to Path2 NOTICE: file1.txt: Skipped copy as --dry-run is set (size 0) -NOTICE: file10.txt: Skipped delete as --dry-run is set (size 19) NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13) NOTICE: file3.txt: Skipped copy as --dry-run is set (size 0) -NOTICE: file4.txt: Skipped delete as --dry-run is set (size 0) -NOTICE: file5.txt: Skipped copy (or update modification time) as --dry-run is set (size 19) -NOTICE: file6.txt: Skipped delete as --dry-run is set (size 19) +NOTICE: file5.txt: Skipped copy (or update modification time) as --dry-run is set (size 39) NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19) INFO : Resync updating listings INFO : Bisync successful @@ -86,15 +83,20 @@ INFO : - Path2 File was deleted - file3.txt INFO : - Path2 File was deleted - file7.txt INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file5.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt INFO : - Path2 Queue delete - {path2/}file4.txt NOTICE: - WARNING New or changed in both paths - file5.txt NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 -NOTICE: file5.txt: Skipped move as --dry-run is set (size 19) +NOTICE: file5.txt: Skipped move as --dry-run is set (size 39) NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 -NOTICE: file5.txt: Skipped move as --dry-run is set (size 19) +NOTICE: file5.txt: Skipped move as --dry-run is set (size 39) NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt @@ -137,6 +139,11 @@ INFO : - Path2 File was deleted - file3.txt INFO : - Path2 File was deleted - file7.txt INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file5.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt INFO : - Path2 Queue delete - {path2/}file4.txt diff --git a/cmd/bisync/testdata/test_dry_run/modfiles/file5L.txt b/cmd/bisync/testdata/test_dry_run/modfiles/file5L.txt index 464147f09c0c8..43ceff1dbe273 100644 --- a/cmd/bisync/testdata/test_dry_run/modfiles/file5L.txt +++ b/cmd/bisync/testdata/test_dry_run/modfiles/file5L.txt @@ -1 +1 @@ -This file is newer +This file is newer and not equal to 5R diff --git a/cmd/bisync/testdata/test_dry_run/modfiles/file5R.txt b/cmd/bisync/testdata/test_dry_run/modfiles/file5R.txt index 464147f09c0c8..a928fcf1382e0 100644 --- a/cmd/bisync/testdata/test_dry_run/modfiles/file5R.txt +++ b/cmd/bisync/testdata/test_dry_run/modfiles/file5R.txt @@ -1 +1 @@ -This file is newer +This file is newer and not equal to 5L diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..d988a5ab11a82 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1 @@ +"file1.txt..path1" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy2to1.que new file mode 100644 index 0000000000000..7f99cd1cee80d --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -0,0 +1 @@ +"file1.txt..path2" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst new file mode 100644 index 0000000000000..8ef63fed892be --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 33 md5:ea683c03f780b76a62405456b08ae6fd - 2001-03-04T00:00:00.000000000+0000 "file1.txt..path1" +- 33 md5:2b4975bb20f7be674e66d78570ba2fb1 - 2001-01-02T00:00:00.000000000+0000 "file1.txt..path2" +- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-new new file mode 100644 index 0000000000000..eb2bbe4cfef4d --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -0,0 +1,4 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 33 md5:ea683c03f780b76a62405456b08ae6fd - 2001-03-04T00:00:00.000000000+0000 "file1.txt" +- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst new file mode 100644 index 0000000000000..8ef63fed892be --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 33 md5:ea683c03f780b76a62405456b08ae6fd - 2001-03-04T00:00:00.000000000+0000 "file1.txt..path1" +- 33 md5:2b4975bb20f7be674e66d78570ba2fb1 - 2001-01-02T00:00:00.000000000+0000 "file1.txt..path2" +- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-new new file mode 100644 index 0000000000000..8bea8b8450cc9 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -0,0 +1,4 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 33 md5:2b4975bb20f7be674e66d78570ba2fb1 - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" diff --git a/cmd/bisync/testdata/test_equal/golden/test.log b/cmd/bisync/testdata/test_equal/golden/test.log new file mode 100644 index 0000000000000..34cffc03748b1 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/test.log @@ -0,0 +1,52 @@ +(01) : test equal + + +(02) : test initial bisync +(03) : bisync resync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + +(04) : test changed on both paths and NOT identical - file1 (file1R, file1L) +(05) : touch-glob 2001-01-02 {datadir/} file1R.txt +(06) : copy-as {datadir/}file1R.txt {path2/} file1.txt +(07) : touch-glob 2001-03-04 {datadir/} file1L.txt +(08) : copy-as {datadir/}file1L.txt {path1/} file1.txt + +(09) : test changed on both paths and identical - file2 +(10) : touch-glob 2001-01-02 {datadir/} file2.txt +(11) : copy-as {datadir/}file2.txt {path1/} file2.txt +(12) : copy-as {datadir/}file2.txt {path2/} file2.txt + +(13) : test bisync run +(14) : bisync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File is newer - file1.txt +INFO : - Path1 File is newer - file2.txt +INFO : Path1: 2 changes: 0 new, 2 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file2.txt +INFO : Path2: 2 changes: 0 new, 2 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file1.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: Local file system at {path2}: 1 matching files +INFO : Finished checking the potential conflicts. 1 differences found +NOTICE: - WARNING New or changed in both paths - file1.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file1.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file1.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file1.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file1.txt..path2 +NOTICE: - WARNING New or changed in both paths - file2.txt +INFO : Files are equal! Skipping: file2.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_equal/initial/RCLONE_TEST b/cmd/bisync/testdata/test_equal/initial/RCLONE_TEST new file mode 100644 index 0000000000000..d8ca97c2a4dbe --- /dev/null +++ b/cmd/bisync/testdata/test_equal/initial/RCLONE_TEST @@ -0,0 +1 @@ +This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete. diff --git a/cmd/bisync/testdata/test_equal/initial/file1.txt b/cmd/bisync/testdata/test_equal/initial/file1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_equal/initial/file2.txt b/cmd/bisync/testdata/test_equal/initial/file2.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_equal/modfiles/file1L.txt b/cmd/bisync/testdata/test_equal/modfiles/file1L.txt new file mode 100644 index 0000000000000..6906ccb095ef8 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/modfiles/file1L.txt @@ -0,0 +1 @@ +This file is NOT identical to 1R diff --git a/cmd/bisync/testdata/test_equal/modfiles/file1R.txt b/cmd/bisync/testdata/test_equal/modfiles/file1R.txt new file mode 100644 index 0000000000000..e49d06a949b6d --- /dev/null +++ b/cmd/bisync/testdata/test_equal/modfiles/file1R.txt @@ -0,0 +1 @@ +This file is NOT identical to 1L diff --git a/cmd/bisync/testdata/test_equal/modfiles/file2.txt b/cmd/bisync/testdata/test_equal/modfiles/file2.txt new file mode 100644 index 0000000000000..2ee5fc1eea273 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/modfiles/file2.txt @@ -0,0 +1 @@ +This file is identical on both sides diff --git a/cmd/bisync/testdata/test_equal/scenario.txt b/cmd/bisync/testdata/test_equal/scenario.txt new file mode 100644 index 0000000000000..86fd26aca150c --- /dev/null +++ b/cmd/bisync/testdata/test_equal/scenario.txt @@ -0,0 +1,22 @@ +test equal +# Check that changed files on both sides are renamed ONLY if not-identical +# See: https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides +# - Changed on Path2 and on Path1, and NOT identical file1 (file1r, file1l) +# - Changed on Path2 and on Path1, and identical file2 + +test initial bisync +bisync resync + +test changed on both paths and NOT identical - file1 (file1R, file1L) +touch-glob 2001-01-02 {datadir/} file1R.txt +copy-as {datadir/}file1R.txt {path2/} file1.txt +touch-glob 2001-03-04 {datadir/} file1L.txt +copy-as {datadir/}file1L.txt {path1/} file1.txt + +test changed on both paths and identical - file2 +touch-glob 2001-01-02 {datadir/} file2.txt +copy-as {datadir/}file2.txt {path1/} file2.txt +copy-as {datadir/}file2.txt {path2/} file2.txt + +test bisync run +bisync diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst index 60009c3fc0fab..2d9313ea4b557 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst @@ -12,7 +12,7 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/file_with_測試_.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2" +- 42 md5:40b811fb5009223b6da573f169619d8e - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2" - 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/mañana_funcionará.txt" diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst index 60009c3fc0fab..2d9313ea4b557 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst @@ -12,7 +12,7 @@ - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/file_with_測試_.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2" +- 42 md5:40b811fb5009223b6da573f169619d8e - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2" - 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/mañana_funcionará.txt" diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-new index 5f3e1c9f19c81..850de84a6433b 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -8,7 +8,7 @@ - 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir with␊white space.txt/file2 with␊white space.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt" +- 42 md5:40b811fb5009223b6da573f169619d8e - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt" - 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "Русский.txt" diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.log index 9aef610022431..5a7f6412ac9b6 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log +++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log @@ -12,30 +12,31 @@ INFO : Bisync successful (04) : test place a newer files on both paths (05) : touch-glob 2001-01-02 {datadir/} file1.txt -(06) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt -(07) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt -(08) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt -(09) : copy-as {datadir/}file1.txt {path2/} Русский.txt -(10) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt -(11) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt -(12) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt -(13) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt -(14) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt -(15) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt -(16) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} +(06) : touch-glob 2001-01-02 {datadir/} file2.txt +(07) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt +(08) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt +(09) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt +(10) : copy-as {datadir/}file1.txt {path2/} Русский.txt +(11) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt +(12) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt +(13) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt +(14) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt +(15) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt +(16) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt +(17) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} -(17) : test place a new file on both paths -(18) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt -(19) : touch-glob 2001-01-03 {datadir/} file1.txt -(20) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +(18) : test place a new file on both paths +(19) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +(20) : touch-glob 2001-01-03 {datadir/} file1.txt +(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt -(21) : test delete files on both paths -(22) : delete-file {path2/}filename_contains_ࢺ_.txt -(23) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt -(24) : delete-file {path1/}Русский.txt +(22) : test delete files on both paths +(23) : delete-file {path2/}filename_contains_ࢺ_.txt +(24) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt +(25) : delete-file {path1/}Русский.txt -(25) : test bisync run -(26) : bisync +(26) : test bisync run +(27) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : - Path1 File is new - file1_with white space.txt @@ -58,6 +59,11 @@ INFO : - Path2 File was deleted - filename_contains_ࢺ_. INFO : - Path2 File was deleted - subdir_with_ࢺ_/filename_contains_ě_.txt INFO : Path2: 9 changes: 5 new, 2 newer, 0 older, 2 deleted INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt: sizes differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file1_with white space.txt INFO : - Path1 Queue copy to Path2 - {path2/}filename_contains_ࢺ_p1m.txt INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/file_with_測試_.txt diff --git a/cmd/bisync/testdata/test_extended_filenames/modfiles/file2.txt b/cmd/bisync/testdata/test_extended_filenames/modfiles/file2.txt new file mode 100644 index 0000000000000..76f450b352469 --- /dev/null +++ b/cmd/bisync/testdata/test_extended_filenames/modfiles/file2.txt @@ -0,0 +1 @@ +This file is newer and not equal to file1 diff --git a/cmd/bisync/testdata/test_extended_filenames/scenario.txt b/cmd/bisync/testdata/test_extended_filenames/scenario.txt index 7c722720a7675..774f5db8f5153 100644 --- a/cmd/bisync/testdata/test_extended_filenames/scenario.txt +++ b/cmd/bisync/testdata/test_extended_filenames/scenario.txt @@ -16,6 +16,7 @@ bisync resync test place a newer files on both paths # force specific modification time since file time is lost through git touch-glob 2001-01-02 {datadir/} file1.txt +touch-glob 2001-01-02 {datadir/} file2.txt copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt @@ -29,7 +30,7 @@ copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} test place a new file on both paths -copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt touch-glob 2001-01-03 {datadir/} file1.txt copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry new file mode 100644 index 0000000000000..84468462625ab --- /dev/null +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new new file mode 100644 index 0000000000000..84468462625ab --- /dev/null +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry new file mode 100644 index 0000000000000..84468462625ab --- /dev/null +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new new file mode 100644 index 0000000000000..84468462625ab --- /dev/null +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log index 606e06ef7dba6..ab50cf9cfc446 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log @@ -58,3 +58,21 @@ INFO : Using filters file {workdir/}filtersfile.txt ERROR : Bisync critical error: filters file has changed (must run --resync): {workdir/}filtersfile.txt ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted + +(18) : test 8. run with filters-file and resync and dry-run. should do the dry-run but still cause next non-resync run to abort. +(19) : bisync filters-file={workdir/}filtersfile.txt resync dry-run +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Using filters file {workdir/}filtersfile.txt +INFO : Skipped storing filters file hash to {workdir/}filtersfile.txt.md5 as --dry-run is set +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + +(20) : test 9. run with filters-file alone. should abort. +(21) : bisync filters-file={workdir/}filtersfile.txt +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Using filters file {workdir/}filtersfile.txt +ERROR : Bisync critical error: filters file has changed (must run --resync): {workdir/}filtersfile.txt +ERROR : Bisync aborted. Must run --resync to recover. +Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_filtersfile_checks/scenario.txt b/cmd/bisync/testdata/test_filtersfile_checks/scenario.txt index 0cb206cef6e48..fa8054799967c 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/scenario.txt +++ b/cmd/bisync/testdata/test_filtersfile_checks/scenario.txt @@ -34,3 +34,9 @@ copy-as {datadir/}filtersfile2.txt {workdir/} filtersfile.txt test 7. run with filters-file alone. should abort. bisync filters-file={workdir/}filtersfile.txt + +test 8. run with filters-file and resync and dry-run. should do the dry-run but still cause next non-resync run to abort. +bisync filters-file={workdir/}filtersfile.txt resync dry-run + +test 9. run with filters-file alone. should abort. +bisync filters-file={workdir/}filtersfile.txt \ No newline at end of file diff --git a/cmd/cat/cat.go b/cmd/cat/cat.go index 03ed4e6e39ebc..dc8d789be7922 100644 --- a/cmd/cat/cat.go +++ b/cmd/cat/cat.go @@ -16,21 +16,23 @@ import ( // Globals var ( - head = int64(0) - tail = int64(0) - offset = int64(0) - count = int64(-1) - discard = false + head = int64(0) + tail = int64(0) + offset = int64(0) + count = int64(-1) + discard = false + separator = string("") ) func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.Int64VarP(cmdFlags, &head, "head", "", head, "Only print the first N characters") - flags.Int64VarP(cmdFlags, &tail, "tail", "", tail, "Only print the last N characters") - flags.Int64VarP(cmdFlags, &offset, "offset", "", offset, "Start printing at offset N (or from end if -ve)") - flags.Int64VarP(cmdFlags, &count, "count", "", count, "Only print N characters") - flags.BoolVarP(cmdFlags, &discard, "discard", "", discard, "Discard the output instead of printing") + flags.Int64VarP(cmdFlags, &head, "head", "", head, "Only print the first N characters", "") + flags.Int64VarP(cmdFlags, &tail, "tail", "", tail, "Only print the last N characters", "") + flags.Int64VarP(cmdFlags, &offset, "offset", "", offset, "Start printing at offset N (or from end if -ve)", "") + flags.Int64VarP(cmdFlags, &count, "count", "", count, "Only print N characters", "") + flags.BoolVarP(cmdFlags, &discard, "discard", "", discard, "Discard the output instead of printing", "") + flags.StringVarP(cmdFlags, &separator, "separator", "", separator, "Separator to use between objects when printing multiple files", "") } var commandDefinition = &cobra.Command{ @@ -56,9 +58,22 @@ Use the |--head| flag to print characters only at the start, |--tail| for the end and |--offset| and |--count| to print a section in the middle. Note that if offset is negative it will count from the end, so |--offset -1 --count 1| is equivalent to |--tail 1|. + +Use the |--separator| flag to print a separator value between files. Be sure to +shell-escape special characters. For example, to print a newline between +files, use: + +* bash: + + rclone --include "*.txt" --separator $'\n' cat remote:path/to/dir + +* powershell: + + rclone --include "*.txt" --separator "|n" cat remote:path/to/dir `, "|", "`"), Annotations: map[string]string{ "versionIntroduced": "v1.33", + "groups": "Filter,Listing", }, Run: func(command *cobra.Command, args []string) { usedOffset := offset != 0 || count >= 0 @@ -82,7 +97,7 @@ Note that if offset is negative it will count from the end, so w = io.Discard } cmd.Run(false, false, command, func() error { - return operations.Cat(context.Background(), fsrc, w, offset, count) + return operations.Cat(context.Background(), fsrc, w, offset, count, []byte(separator)) }) }, } diff --git a/cmd/check/check.go b/cmd/check/check.go index 3c126e176275b..9217eee7d678f 100644 --- a/cmd/check/check.go +++ b/cmd/check/check.go @@ -33,20 +33,20 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &download, "download", "", download, "Check by downloading rather than with hash") - flags.StringVarP(cmdFlags, &checkFileHashType, "checkfile", "C", checkFileHashType, "Treat source:path as a SUM file with hashes of given type") + flags.BoolVarP(cmdFlags, &download, "download", "", download, "Check by downloading rather than with hash", "") + flags.StringVarP(cmdFlags, &checkFileHashType, "checkfile", "C", checkFileHashType, "Treat source:path as a SUM file with hashes of given type", "") AddFlags(cmdFlags) } // AddFlags adds the check flags to the cmdFlags command func AddFlags(cmdFlags *pflag.FlagSet) { - flags.BoolVarP(cmdFlags, &oneway, "one-way", "", oneway, "Check one way only, source files must exist on remote") - flags.StringVarP(cmdFlags, &combined, "combined", "", combined, "Make a combined report of changes to this file") - flags.StringVarP(cmdFlags, &missingOnSrc, "missing-on-src", "", missingOnSrc, "Report all files missing from the source to this file") - flags.StringVarP(cmdFlags, &missingOnDst, "missing-on-dst", "", missingOnDst, "Report all files missing from the destination to this file") - flags.StringVarP(cmdFlags, &match, "match", "", match, "Report all matching files to this file") - flags.StringVarP(cmdFlags, &differ, "differ", "", differ, "Report all non-matching files to this file") - flags.StringVarP(cmdFlags, &errFile, "error", "", errFile, "Report all files with errors (hashing or reading) to this file") + flags.BoolVarP(cmdFlags, &oneway, "one-way", "", oneway, "Check one way only, source files must exist on remote", "") + flags.StringVarP(cmdFlags, &combined, "combined", "", combined, "Make a combined report of changes to this file", "") + flags.StringVarP(cmdFlags, &missingOnSrc, "missing-on-src", "", missingOnSrc, "Report all files missing from the source to this file", "") + flags.StringVarP(cmdFlags, &missingOnDst, "missing-on-dst", "", missingOnDst, "Report all files missing from the destination to this file", "") + flags.StringVarP(cmdFlags, &match, "match", "", match, "Report all matching files to this file", "") + flags.StringVarP(cmdFlags, &differ, "differ", "", differ, "Report all non-matching files to this file", "") + flags.StringVarP(cmdFlags, &errFile, "error", "", errFile, "Report all files with errors (hashing or reading) to this file", "") } // FlagsHelp describes the flags for the help @@ -72,6 +72,9 @@ you what happened to it. These are reminiscent of diff files. - |+ path| means path was missing on the destination, so only in the source - |* path| means path was present in source and destination but different. - |! path| means there was an error reading or hashing the source or dest. + +The default number of parallel checks is 8. See the [--checkers=N](/docs/#checkers-n) +option for more information. `, "|", "`") // GetCheckOpt gets the options corresponding to the check flags @@ -142,7 +145,7 @@ match. It doesn't alter the source or destination. For the [crypt](/crypt/) remote there is a dedicated command, [cryptcheck](/commands/rclone_cryptcheck/), that are able to check -the checksums of the crypted files. +the checksums of the encrypted files. If you supply the |--size-only| flag, it will only compare the sizes not the hashes as well. Use this for a quick check. @@ -155,6 +158,9 @@ to check all the data. If you supply the |--checkfile HASH| flag with a valid hash name, the |source:path| must point to a text file in the SUM format. `, "|", "`") + FlagsHelp, + Annotations: map[string]string{ + "groups": "Filter,Listing,Check", + }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(2, 2, command, args) var ( diff --git a/cmd/checksum/checksum.go b/cmd/checksum/checksum.go index 4dee6611c3020..16b83429e84ec 100644 --- a/cmd/checksum/checksum.go +++ b/cmd/checksum/checksum.go @@ -19,26 +19,30 @@ var download = false func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &download, "download", "", download, "Check by hashing the contents") + flags.BoolVarP(cmdFlags, &download, "download", "", download, "Check by hashing the contents", "") check.AddFlags(cmdFlags) } var commandDefinition = &cobra.Command{ - Use: "checksum sumfile src:path", - Short: `Checks the files in the source against a SUM file.`, + Use: "checksum sumfile dst:path", + Short: `Checks the files in the destination against a SUM file.`, Long: strings.ReplaceAll(` -Checks that hashsums of source files match the SUM file. +Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system. -If you supply the |--download| flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for remotes +The sumfile is treated as the source and the dst:path is treated as +the destination for the purposes of the output. + +If you supply the |--download| flag, it will download the data from the remote +and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. Note that hash values in the SUM file are treated as case insensitive. `, "|", "`") + check.FlagsHelp, Annotations: map[string]string{ "versionIntroduced": "v1.56", + "groups": "Filter,Listing", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(3, 3, command, args) diff --git a/cmd/cleanup/cleanup.go b/cmd/cleanup/cleanup.go index d23f0cb91bd17..0b6687e3b6af1 100644 --- a/cmd/cleanup/cleanup.go +++ b/cmd/cleanup/cleanup.go @@ -22,6 +22,7 @@ versions. Not supported by all remotes. `, Annotations: map[string]string{ "versionIntroduced": "v1.31", + "groups": "Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/cmd.go b/cmd/cmd.go index 73fe98a2d1102..7043995f02b27 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -1,6 +1,6 @@ // Package cmd implements the rclone command // -// It is in a sub package so it's internals can be re-used elsewhere +// It is in a sub package so it's internals can be reused elsewhere package cmd // FIXME only attach the remote flags when using a remote??? @@ -35,6 +35,7 @@ import ( fslog "github.com/rclone/rclone/fs/log" "github.com/rclone/rclone/fs/rc/rcflags" "github.com/rclone/rclone/fs/rc/rcserver" + fssync "github.com/rclone/rclone/fs/sync" "github.com/rclone/rclone/lib/atexit" "github.com/rclone/rclone/lib/buildinfo" "github.com/rclone/rclone/lib/exitcode" @@ -47,13 +48,13 @@ import ( // Globals var ( // Flags - cpuProfile = flags.StringP("cpuprofile", "", "", "Write cpu profile to file") - memProfile = flags.StringP("memprofile", "", "", "Write memory profile to file") - statsInterval = flags.DurationP("stats", "", time.Minute*1, "Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable)") - dataRateUnit = flags.StringP("stats-unit", "", "bytes", "Show data rate in stats as either 'bits' or 'bytes' per second") + cpuProfile = flags.StringP("cpuprofile", "", "", "Write cpu profile to file", "Debugging") + memProfile = flags.StringP("memprofile", "", "", "Write memory profile to file", "Debugging") + statsInterval = flags.DurationP("stats", "", time.Minute*1, "Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable)", "Logging") + dataRateUnit = flags.StringP("stats-unit", "", "bytes", "Show data rate in stats as either 'bits' or 'bytes' per second", "Logging") version bool - retries = flags.IntP("retries", "", 3, "Retry operations this many times if they fail") - retriesInterval = flags.DurationP("retries-sleep", "", 0, "Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable)") + retries = flags.IntP("retries", "", 3, "Retry operations this many times if they fail", "Config") + retriesInterval = flags.DurationP("retries-sleep", "", 0, "Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable)", "Config") // Errors errorCommandNotFound = errors.New("command not found") errorUncategorized = errors.New("uncategorized error") @@ -501,6 +502,8 @@ func resolveExitCode(err error) { os.Exit(exitcode.UncategorizedError) case errors.Is(err, accounting.ErrorMaxTransferLimitReached): os.Exit(exitcode.TransferExceeded) + case errors.Is(err, fssync.ErrorMaxDurationReached): + os.Exit(exitcode.DurationExceeded) case fserrors.ShouldRetry(err): os.Exit(exitcode.RetryError) case fserrors.IsNoRetryError(err), fserrors.IsNoLowLevelRetryError(err): diff --git a/cmd/cmount/fs.go b/cmd/cmount/fs.go index a60bd833642b0..4ba22ea304618 100644 --- a/cmd/cmount/fs.go +++ b/cmd/cmount/fs.go @@ -30,7 +30,7 @@ type FS struct { ready chan (struct{}) mu sync.Mutex // to protect the below handles []vfs.Handle - destroyed int32 // read/write with sync/atomic + destroyed atomic.Int32 } // NewFS makes a new FS @@ -190,7 +190,7 @@ func (fsys *FS) Init() { // Destroy call). func (fsys *FS) Destroy() { defer log.Trace(fsys.f, "")("") - atomic.StoreInt32(&fsys.destroyed, 1) + fsys.destroyed.Store(1) } // Getattr reads the attributes for path diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go index 2b7b5d19edf47..f6d86bdb5c5d9 100644 --- a/cmd/cmount/mount.go +++ b/cmd/cmount/mount.go @@ -13,7 +13,6 @@ import ( "os" "runtime" "strings" - "sync/atomic" "time" "github.com/rclone/rclone/cmd/mountlib" @@ -26,7 +25,7 @@ import ( func init() { name := "cmount" - cmountOnly := ProvidedBy(runtime.GOOS) + cmountOnly := runtime.GOOS != "linux" // rclone mount only works for linux if cmountOnly { name = "mount" } @@ -160,7 +159,11 @@ func mount(VFS *vfs.VFS, mountPath string, opt *mountlib.Options) (<-chan error, fsys := NewFS(VFS) host := fuse.NewFileSystemHost(fsys) host.SetCapReaddirPlus(true) // only works on Windows - host.SetCapCaseInsensitive(f.Features().CaseInsensitive) + if opt.CaseInsensitive.Valid { + host.SetCapCaseInsensitive(opt.CaseInsensitive.Value) + } else { + host.SetCapCaseInsensitive(f.Features().CaseInsensitive) + } // Create options options := mountOptions(VFS, opt.DeviceName, mountpoint, opt) @@ -188,7 +191,7 @@ func mount(VFS *vfs.VFS, mountPath string, opt *mountlib.Options) (<-chan error, // Shutdown the VFS fsys.VFS.Shutdown() var umountOK bool - if atomic.LoadInt32(&fsys.destroyed) != 0 { + if fsys.destroyed.Load() != 0 { fs.Debugf(nil, "Not calling host.Unmount as mount already Destroyed") umountOK = true } else if atexit.Signalled() { diff --git a/cmd/cmount/mount_brew.go b/cmd/cmount/mount_brew.go index 964c0b234967b..7f368ccab0a02 100644 --- a/cmd/cmount/mount_brew.go +++ b/cmd/cmount/mount_brew.go @@ -28,7 +28,7 @@ func init() { // returns an error, and an error channel for the serve process to // report an error when fusermount is called. func mount(_ *vfs.VFS, _ string, _ *mountlib.Options) (<-chan error, func() error, error) { - return nil, nil, errors.New("mount is not supported on MacOS when installed via Homebrew. " + - "Please install the binaries available at https://rclone." + - "org/downloads/ instead if you want to use the mount command") + return nil, nil, errors.New("rclone mount is not supported on MacOS when rclone is installed via Homebrew. " + + "Please install the rclone binaries available at https://rclone.org/downloads/ " + + "instead if you want to use the rclone mount command") } diff --git a/cmd/cmount/mount_test.go b/cmd/cmount/mount_test.go index 7c9c852f6538c..8da6116e26d2a 100644 --- a/cmd/cmount/mount_test.go +++ b/cmd/cmount/mount_test.go @@ -15,6 +15,7 @@ import ( "testing" "github.com/rclone/rclone/fstest/testy" + "github.com/rclone/rclone/vfs/vfscommon" "github.com/rclone/rclone/vfs/vfstest" ) @@ -23,5 +24,5 @@ func TestMount(t *testing.T) { if runtime.GOOS == "darwin" { testy.SkipUnreliable(t) } - vfstest.RunTests(t, false, mount) + vfstest.RunTests(t, false, vfscommon.CacheModeOff, true, mount) } diff --git a/cmd/config/config.go b/cmd/config/config.go index e3b916aad904c..9fca8a758fac6 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -26,6 +26,7 @@ func init() { configCommand.AddCommand(configTouchCommand) configCommand.AddCommand(configPathsCommand) configCommand.AddCommand(configShowCommand) + configCommand.AddCommand(configRedactedCommand) configCommand.AddCommand(configDumpCommand) configCommand.AddCommand(configProvidersCommand) configCommand.AddCommand(configCreateCommand) @@ -60,7 +61,10 @@ var configEditCommand = &cobra.Command{ Annotations: map[string]string{ "versionIntroduced": "v1.39", }, - Run: configCommand.Run, + RunE: func(command *cobra.Command, args []string) error { + cmd.CheckArgs(0, 0, command, args) + return config.EditConfig(context.Background()) + }, } var configFileCommand = &cobra.Command{ @@ -118,6 +122,35 @@ var configShowCommand = &cobra.Command{ }, } +var configRedactedCommand = &cobra.Command{ + Use: "redacted []", + Short: `Print redacted (decrypted) config file, or the redacted config for a single remote.`, + Long: `This prints a redacted copy of the config file, either the +whole config file or for a given remote. + +The config file will be redacted by replacing all passwords and other +sensitive info with XXX. + +This makes the config file suitable for posting online for support. + +It should be double checked before posting as the redaction may not be perfect. + +`, + Annotations: map[string]string{ + "versionIntroduced": "v1.64", + }, + Run: func(command *cobra.Command, args []string) { + cmd.CheckArgs(0, 1, command, args) + if len(args) == 0 { + config.ShowRedactedConfig() + } else { + name := strings.TrimRight(args[0], ":") + config.ShowRedactedRemote(name) + } + fmt.Println("### Double check the config for sensitive info before posting publicly") + }, +} + var configDumpCommand = &cobra.Command{ Use: "dump", Short: `Dump the config file as JSON.`, @@ -288,13 +321,13 @@ func doConfig(name string, in rc.Params, do func(config.UpdateRemoteOpt) (*fs.Co func init() { for _, cmdFlags := range []*pflag.FlagSet{configCreateCommand.Flags(), configUpdateCommand.Flags()} { - flags.BoolVarP(cmdFlags, &updateRemoteOpt.Obscure, "obscure", "", false, "Force any passwords to be obscured") - flags.BoolVarP(cmdFlags, &updateRemoteOpt.NoObscure, "no-obscure", "", false, "Force any passwords not to be obscured") - flags.BoolVarP(cmdFlags, &updateRemoteOpt.NonInteractive, "non-interactive", "", false, "Don't interact with user and return questions") - flags.BoolVarP(cmdFlags, &updateRemoteOpt.Continue, "continue", "", false, "Continue the configuration process with an answer") - flags.BoolVarP(cmdFlags, &updateRemoteOpt.All, "all", "", false, "Ask the full set of config questions") - flags.StringVarP(cmdFlags, &updateRemoteOpt.State, "state", "", "", "State - use with --continue") - flags.StringVarP(cmdFlags, &updateRemoteOpt.Result, "result", "", "", "Result - use with --continue") + flags.BoolVarP(cmdFlags, &updateRemoteOpt.Obscure, "obscure", "", false, "Force any passwords to be obscured", "Config") + flags.BoolVarP(cmdFlags, &updateRemoteOpt.NoObscure, "no-obscure", "", false, "Force any passwords not to be obscured", "Config") + flags.BoolVarP(cmdFlags, &updateRemoteOpt.NonInteractive, "non-interactive", "", false, "Don't interact with user and return questions", "Config") + flags.BoolVarP(cmdFlags, &updateRemoteOpt.Continue, "continue", "", false, "Continue the configuration process with an answer", "Config") + flags.BoolVarP(cmdFlags, &updateRemoteOpt.All, "all", "", false, "Ask the full set of config questions", "Config") + flags.StringVarP(cmdFlags, &updateRemoteOpt.State, "state", "", "", "State - use with --continue", "Config") + flags.StringVarP(cmdFlags, &updateRemoteOpt.Result, "result", "", "", "Result - use with --continue", "Config") } } @@ -450,7 +483,7 @@ var ( ) func init() { - flags.BoolVarP(configUserInfoCommand.Flags(), &jsonOutput, "json", "", false, "Format output as JSON") + flags.BoolVarP(configUserInfoCommand.Flags(), &jsonOutput, "json", "", false, "Format output as JSON", "") } var configUserInfoCommand = &cobra.Command{ diff --git a/cmd/copy/copy.go b/cmd/copy/copy.go index c6e42a70ea9bd..745811de46e2a 100644 --- a/cmd/copy/copy.go +++ b/cmd/copy/copy.go @@ -19,7 +19,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after copy") + flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after copy", "") } var commandDefinition = &cobra.Command{ @@ -83,6 +83,9 @@ recently very efficiently like this: **Note**: Use the |--dry-run| or the |--interactive|/|-i| flag to test without copying anything. `, "|", "`"), + Annotations: map[string]string{ + "groups": "Copy,Filter,Listing,Important", + }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) diff --git a/cmd/copyto/copyto.go b/cmd/copyto/copyto.go index 337a80b3aaa42..27efcc0beaea9 100644 --- a/cmd/copyto/copyto.go +++ b/cmd/copyto/copyto.go @@ -48,6 +48,7 @@ the destination. `, Annotations: map[string]string{ "versionIntroduced": "v1.35", + "groups": "Copy,Filter,Listing,Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) diff --git a/cmd/copyurl/copyurl.go b/cmd/copyurl/copyurl.go index 9b9063861a355..b5df8c88f0c5f 100644 --- a/cmd/copyurl/copyurl.go +++ b/cmd/copyurl/copyurl.go @@ -25,11 +25,11 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &autoFilename, "auto-filename", "a", autoFilename, "Get the file name from the URL and use it for destination file path") - flags.BoolVarP(cmdFlags, &headerFilename, "header-filename", "", headerFilename, "Get the file name from the Content-Disposition header") - flags.BoolVarP(cmdFlags, &printFilename, "print-filename", "p", printFilename, "Print the resulting name from --auto-filename") - flags.BoolVarP(cmdFlags, &noClobber, "no-clobber", "", noClobber, "Prevent overwriting file with same name") - flags.BoolVarP(cmdFlags, &stdout, "stdout", "", stdout, "Write the output to stdout rather than a file") + flags.BoolVarP(cmdFlags, &autoFilename, "auto-filename", "a", autoFilename, "Get the file name from the URL and use it for destination file path", "") + flags.BoolVarP(cmdFlags, &headerFilename, "header-filename", "", headerFilename, "Get the file name from the Content-Disposition header", "") + flags.BoolVarP(cmdFlags, &printFilename, "print-filename", "p", printFilename, "Print the resulting name from --auto-filename", "") + flags.BoolVarP(cmdFlags, &noClobber, "no-clobber", "", noClobber, "Prevent overwriting file with same name", "") + flags.BoolVarP(cmdFlags, &stdout, "stdout", "", stdout, "Write the output to stdout rather than a file", "") } var commandDefinition = &cobra.Command{ @@ -53,6 +53,7 @@ will cause the output to be written to standard output. `, Annotations: map[string]string{ "versionIntroduced": "v1.43", + "groups": "Important", }, RunE: func(command *cobra.Command, args []string) (err error) { cmd.CheckArgs(1, 2, command, args) diff --git a/cmd/cryptcheck/cryptcheck.go b/cmd/cryptcheck/cryptcheck.go index 481c4cecec9ee..e26e1b89e880a 100644 --- a/cmd/cryptcheck/cryptcheck.go +++ b/cmd/cryptcheck/cryptcheck.go @@ -22,11 +22,11 @@ func init() { var commandDefinition = &cobra.Command{ Use: "cryptcheck remote:path cryptedremote:path", - Short: `Cryptcheck checks the integrity of a crypted remote.`, + Short: `Cryptcheck checks the integrity of an encrypted remote.`, Long: ` rclone cryptcheck checks a remote against a [crypted](/crypt/) remote. This is the equivalent of running rclone [check](/commands/rclone_check/), -but able to check the checksums of the crypted remote. +but able to check the checksums of the encrypted remote. For it to work the underlying remote of the cryptedremote must support some kind of checksum. @@ -49,6 +49,7 @@ After it has run it will log the status of the encryptedremote:. ` + check.FlagsHelp, Annotations: map[string]string{ "versionIntroduced": "v1.36", + "groups": "Filter,Listing,Check", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) @@ -59,7 +60,7 @@ After it has run it will log the status of the encryptedremote:. }, } -// cryptCheck checks the integrity of a crypted remote +// cryptCheck checks the integrity of an encrypted remote func cryptCheck(ctx context.Context, fdst, fsrc fs.Fs) error { // Check to see fcrypt is a crypt fcrypt, ok := fdst.(*crypt.Fs) diff --git a/cmd/cryptdecode/cryptdecode.go b/cmd/cryptdecode/cryptdecode.go index a657bb0c59be7..745e710029fda 100644 --- a/cmd/cryptdecode/cryptdecode.go +++ b/cmd/cryptdecode/cryptdecode.go @@ -20,7 +20,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &Reverse, "reverse", "", Reverse, "Reverse cryptdecode, encrypts filenames") + flags.BoolVarP(cmdFlags, &Reverse, "reverse", "", Reverse, "Reverse cryptdecode, encrypts filenames", "") } var commandDefinition = &cobra.Command{ diff --git a/cmd/dedupe/dedupe.go b/cmd/dedupe/dedupe.go index b56d62d9f4095..a62a07ab69a79 100644 --- a/cmd/dedupe/dedupe.go +++ b/cmd/dedupe/dedupe.go @@ -20,8 +20,8 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlag := commandDefinition.Flags() - flags.FVarP(cmdFlag, &dedupeMode, "dedupe-mode", "", "Dedupe mode interactive|skip|first|newest|oldest|largest|smallest|rename") - flags.BoolVarP(cmdFlag, &byHash, "by-hash", "", false, "Find identical hashes rather than names") + flags.FVarP(cmdFlag, &dedupeMode, "dedupe-mode", "", "Dedupe mode interactive|skip|first|newest|oldest|largest|smallest|rename", "") + flags.BoolVarP(cmdFlag, &byHash, "by-hash", "", false, "Find identical hashes rather than names", "") } var commandDefinition = &cobra.Command{ @@ -137,6 +137,7 @@ Or `, Annotations: map[string]string{ "versionIntroduced": "v1.27", + "groups": "Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 2, command, args) diff --git a/cmd/delete/delete.go b/cmd/delete/delete.go index 4dcc69ddd3b3c..32c93a8758073 100644 --- a/cmd/delete/delete.go +++ b/cmd/delete/delete.go @@ -18,7 +18,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &rmdirs, "rmdirs", "", rmdirs, "rmdirs removes empty directories but leaves root intact") + flags.BoolVarP(cmdFlags, &rmdirs, "rmdirs", "", rmdirs, "rmdirs removes empty directories but leaves root intact", "") } var commandDefinition = &cobra.Command{ @@ -55,6 +55,7 @@ delete all files bigger than 100 MiB. `, "|", "`"), Annotations: map[string]string{ "versionIntroduced": "v1.27", + "groups": "Important,Filter,Listing", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/deletefile/deletefile.go b/cmd/deletefile/deletefile.go index 6311b3ddfc7e3..1d6d26c2f81b2 100644 --- a/cmd/deletefile/deletefile.go +++ b/cmd/deletefile/deletefile.go @@ -25,6 +25,7 @@ it will always be removed. `, Annotations: map[string]string{ "versionIntroduced": "v1.42", + "groups": "Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/genautocomplete/genautocomplete.go b/cmd/genautocomplete/genautocomplete.go index c1408d9f7615a..029b381d3e638 100644 --- a/cmd/genautocomplete/genautocomplete.go +++ b/cmd/genautocomplete/genautocomplete.go @@ -11,7 +11,7 @@ func init() { } var completionDefinition = &cobra.Command{ - Use: "genautocomplete [shell]", + Use: "completion [shell]", Short: `Output completion script for a given shell.`, Long: ` Generates a shell completion script for rclone. @@ -20,4 +20,5 @@ Run with ` + "`--help`" + ` to list the supported shells. Annotations: map[string]string{ "versionIntroduced": "v1.33", }, + Aliases: []string{"genautocomplete"}, } diff --git a/cmd/genautocomplete/genautocomplete_powershell.go b/cmd/genautocomplete/genautocomplete_powershell.go new file mode 100644 index 0000000000000..84e1ea16b2579 --- /dev/null +++ b/cmd/genautocomplete/genautocomplete_powershell.go @@ -0,0 +1,44 @@ +package genautocomplete + +import ( + "log" + "os" + + "github.com/rclone/rclone/cmd" + "github.com/spf13/cobra" +) + +func init() { + completionDefinition.AddCommand(powershellCommandDefinition) +} + +var powershellCommandDefinition = &cobra.Command{ + Use: "powershell [output_file]", + Short: `Output powershell completion script for rclone.`, + Long: ` +Generate the autocompletion script for powershell. + +To load completions in your current shell session: + + rclone completion powershell | Out-String | Invoke-Expression + +To load completions for every new session, add the output of the above command +to your powershell profile. + +If output_file is "-" or missing, then the output will be written to stdout. +`, + Run: func(command *cobra.Command, args []string) { + cmd.CheckArgs(0, 1, command, args) + if len(args) == 0 || (len(args) > 0 && args[0] == "-") { + err := cmd.Root.GenPowerShellCompletion(os.Stdout) + if err != nil { + log.Fatal(err) + } + return + } + err := cmd.Root.GenPowerShellCompletionFile(args[0]) + if err != nil { + log.Fatal(err) + } + }, +} diff --git a/cmd/gendocs/gendocs.go b/cmd/gendocs/gendocs.go index 83c54846d44a8..c80b75374f0e6 100644 --- a/cmd/gendocs/gendocs.go +++ b/cmd/gendocs/gendocs.go @@ -3,6 +3,7 @@ package gendocs import ( "bytes" + "fmt" "log" "os" "path" @@ -13,10 +14,10 @@ import ( "time" "github.com/rclone/rclone/cmd" + "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/lib/file" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" - "github.com/spf13/pflag" ) func init() { @@ -88,6 +89,7 @@ rclone.org website.`, Annotations map[string]string } var commands = map[string]commandDetails{} + var aliases []string var addCommandDetails func(root *cobra.Command) addCommandDetails = func(root *cobra.Command) { name := strings.ReplaceAll(root.CommandPath(), " ", "_") + ".md" @@ -95,6 +97,7 @@ rclone.org website.`, Short: root.Short, Annotations: root.Annotations, } + aliases = append(aliases, root.Aliases...) for _, c := range root.Commands() { addCommandDetails(c) } @@ -126,10 +129,6 @@ rclone.org website.`, return "/commands/" + strings.ToLower(base) + "/" } - // Hide all of the root entries flags - cmd.Root.Flags().VisitAll(func(flag *pflag.Flag) { - flag.Hidden = true - }) err = doc.GenMarkdownTreeCustom(cmd.Root, out, prepender, linkHandler) if err != nil { return err @@ -143,15 +142,50 @@ rclone.org website.`, return err } if !info.IsDir() { + name := filepath.Base(path) + cmd, ok := commands[name] + if !ok { + // Avoid man pages which are for aliases. This is a bit messy! + for _, alias := range aliases { + if strings.Contains(name, alias) { + return nil + } + } + return fmt.Errorf("didn't find command for %q", name) + } b, err := os.ReadFile(path) if err != nil { return err } doc := string(b) - doc = strings.Replace(doc, "\n### SEE ALSO", ` + + var out strings.Builder + if groupsString := cmd.Annotations["groups"]; groupsString != "" { + groups := flags.All.Include(groupsString) + for _, group := range groups.Groups { + if group.Flags.HasFlags() { + _, _ = fmt.Fprintf(&out, "\n### %s Options\n\n", group.Name) + _, _ = fmt.Fprintf(&out, "%s\n\n", group.Help) + _, _ = fmt.Fprintln(&out, "```") + _, _ = out.WriteString(group.Flags.FlagUsages()) + _, _ = fmt.Fprintln(&out, "```") + } + } + } + _, _ = out.WriteString(` See the [global flags page](/flags/) for global options not listed here. -### SEE ALSO`, 1) +`) + + startCut := strings.Index(doc, `### Options inherited from parent commands`) + endCut := strings.Index(doc, `## SEE ALSO`) + if startCut < 0 || endCut < 0 { + if name == "rclone.md" { + return nil + } + return fmt.Errorf("internal error: failed to find cut points: startCut = %d, endCut = %d", startCut, endCut) + } + doc = doc[:startCut] + out.String() + doc[endCut:] // outdent all the titles by one doc = outdentTitle.ReplaceAllString(doc, `$1`) err = os.WriteFile(path, []byte(doc), 0777) diff --git a/cmd/hashsum/hashsum.go b/cmd/hashsum/hashsum.go index 6e39cf7ce82a4..098483499ac56 100644 --- a/cmd/hashsum/hashsum.go +++ b/cmd/hashsum/hashsum.go @@ -31,10 +31,10 @@ func init() { // AddHashsumFlags is a convenience function to add the command flags OutputBase64 and DownloadFlag to hashsum, md5sum, sha1sum func AddHashsumFlags(cmdFlags *pflag.FlagSet) { - flags.BoolVarP(cmdFlags, &OutputBase64, "base64", "", OutputBase64, "Output base64 encoded hashsum") - flags.StringVarP(cmdFlags, &HashsumOutfile, "output-file", "", HashsumOutfile, "Output hashsums to a file rather than the terminal") - flags.StringVarP(cmdFlags, &ChecksumFile, "checkfile", "C", ChecksumFile, "Validate hashes against a given SUM file instead of printing them") - flags.BoolVarP(cmdFlags, &DownloadFlag, "download", "", DownloadFlag, "Download the file and hash it locally; if this flag is not specified, the hash is requested from the remote") + flags.BoolVarP(cmdFlags, &OutputBase64, "base64", "", OutputBase64, "Output base64 encoded hashsum", "") + flags.StringVarP(cmdFlags, &HashsumOutfile, "output-file", "", HashsumOutfile, "Output hashsums to a file rather than the terminal", "") + flags.StringVarP(cmdFlags, &ChecksumFile, "checkfile", "C", ChecksumFile, "Validate hashes against a given SUM file instead of printing them", "") + flags.BoolVarP(cmdFlags, &DownloadFlag, "download", "", DownloadFlag, "Download the file and hash it locally; if this flag is not specified, the hash is requested from the remote", "") } // GetHashsumOutput opens and closes the output file when using the output-file flag @@ -82,7 +82,7 @@ func CreateFromStdinArg(ht hash.Type, args []string, startArg int) (bool, error) } var commandDefinition = &cobra.Command{ - Use: "hashsum remote:path", + Use: "hashsum [ remote:path]", Short: `Produces a hashsum file for all the objects in the path.`, Long: ` Produces a hash file for all the objects in the path using the hash @@ -114,6 +114,7 @@ Note that hash names are case insensitive and values are output in lower case. `, Annotations: map[string]string{ "versionIntroduced": "v1.41", + "groups": "Filter,Listing", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(0, 2, command, args) diff --git a/cmd/help.go b/cmd/help.go index ecc34b63ea490..ef43a1c0ffadb 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -11,6 +11,7 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config/configflags" + "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/fs/filter/filterflags" "github.com/rclone/rclone/fs/log/logflags" "github.com/rclone/rclone/fs/rc/rcflags" @@ -113,7 +114,7 @@ var helpFlags = &cobra.Command{ Short: "Show the global flags for rclone", Run: func(command *cobra.Command, args []string) { if len(args) > 0 { - re, err := regexp.Compile(args[0]) + re, err := regexp.Compile(`(?i)` + args[0]) if err != nil { log.Fatalf("Failed to compile flags regexp: %v", err) } @@ -181,7 +182,7 @@ func setupRootCommand(rootCmd *cobra.Command) { Root.Flags().BoolVarP(&version, "version", "V", false, "Print the version number") cobra.AddTemplateFunc("showGlobalFlags", func(cmd *cobra.Command) bool { - return cmd.CalledAs() == "flags" + return cmd.CalledAs() == "flags" || cmd.Annotations["groups"] != "" }) cobra.AddTemplateFunc("showCommands", func(cmd *cobra.Command) bool { return cmd.CalledAs() != "flags" @@ -191,15 +192,21 @@ func setupRootCommand(rootCmd *cobra.Command) { // "rclone help" (which shows the global help) return cmd.CalledAs() != "rclone" && cmd.CalledAs() != "" }) - cobra.AddTemplateFunc("backendFlags", func(cmd *cobra.Command, include bool) *pflag.FlagSet { - backendFlagSet := pflag.NewFlagSet("Backend Flags", pflag.ExitOnError) + cobra.AddTemplateFunc("flagGroups", func(cmd *cobra.Command) []*flags.Group { + // Add the backend flags and check all flags + backendGroup := flags.All.NewGroup("Backend", "Backend only flags. These can be set in the config file also.") + allRegistered := flags.All.AllRegistered() cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { - matched := flagsRe == nil || flagsRe.MatchString(flag.Name) - if _, ok := backendFlags[flag.Name]; matched && ok == include { - backendFlagSet.AddFlag(flag) + if _, ok := backendFlags[flag.Name]; ok { + backendGroup.Add(flag) + } else if _, ok := allRegistered[flag]; ok { + // flag is in a group already + } else { + fs.Errorf(nil, "Flag --%s is unknown", flag.Name) } }) - return backendFlagSet + groups := flags.All.Filter(flagsRe).Include(cmd.Annotations["groups"]) + return groups.Groups }) rootCmd.SetUsageTemplate(usageTemplate) // rootCmd.SetHelpTemplate(helpTemplate) @@ -233,11 +240,13 @@ Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "he Flags: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if and (showGlobalFlags .) .HasAvailableInheritedFlags}} -Global Flags: -{{(backendFlags . false).FlagUsages | trimTrailingWhitespaces}} +{{ range flagGroups . }}{{ if .Flags.HasFlags }} +# {{ .Name }} Flags + +{{ .Help }} -Backend Flags: -{{(backendFlags . true).FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} +{{ .Flags.FlagUsages | trimTrailingWhitespaces}} +{{ end }}{{ end }} Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}} @@ -255,24 +264,18 @@ description: "Rclone Global Flags" # Global Flags This describes the global flags available to every rclone command -split into two groups, non backend and backend flags. +split into groups. -## Non Backend Flags +{{ range flagGroups . }}{{ if .Flags.HasFlags }} +## {{ .Name }} -These flags are available for every command. +{{ .Help }} ` + "```" + ` -{{(backendFlags . false).FlagUsages | trimTrailingWhitespaces}} +{{ .Flags.FlagUsages | trimTrailingWhitespaces}} ` + "```" + ` -## Backend Flags - -These flags are available for every command. They control the backends -and may be set in the config file. - -` + "```" + ` -{{(backendFlags . true).FlagUsages | trimTrailingWhitespaces}} -` + "```" + ` +{{ end }}{{ end }} ` // show all the backends @@ -306,6 +309,7 @@ func showBackend(name string) { if _, doneAlready := done[opt.Name]; doneAlready { continue } + done[opt.Name] = struct{}{} if opt.Advanced { advancedOptions = append(advancedOptions, opt) } else { diff --git a/cmd/link/link.go b/cmd/link/link.go index 380e5a46b0782..8b591373ffc36 100644 --- a/cmd/link/link.go +++ b/cmd/link/link.go @@ -20,8 +20,8 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.FVarP(cmdFlags, &expire, "expire", "", "The amount of time that the link will be valid") - flags.BoolVarP(cmdFlags, &unlink, "unlink", "", unlink, "Remove existing public link to file/folder") + flags.FVarP(cmdFlags, &expire, "expire", "", "The amount of time that the link will be valid", "") + flags.BoolVarP(cmdFlags, &unlink, "unlink", "", unlink, "Remove existing public link to file/folder", "") } var commandDefinition = &cobra.Command{ diff --git a/cmd/listremotes/listremotes.go b/cmd/listremotes/listremotes.go index e473fcb212888..6f63ba26b5856 100644 --- a/cmd/listremotes/listremotes.go +++ b/cmd/listremotes/listremotes.go @@ -19,12 +19,12 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &listLong, "long", "", listLong, "Show the type as well as names") + flags.BoolVarP(cmdFlags, &listLong, "long", "", listLong, "Show the type as well as names", "") } var commandDefinition = &cobra.Command{ Use: "listremotes", - Short: `List all the remotes in the config file.`, + Short: `List all the remotes in the config file and defined in environment variables.`, Long: ` rclone listremotes lists all the available remotes from the config file. diff --git a/cmd/ls/ls.go b/cmd/ls/ls.go index 334b12f8e8ecc..313744005ab0b 100644 --- a/cmd/ls/ls.go +++ b/cmd/ls/ls.go @@ -31,6 +31,9 @@ Eg 37600 fubuwic ` + lshelp.Help, + Annotations: map[string]string{ + "groups": "Filter,Listing", + }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) fsrc := cmd.NewFsSrc(args) diff --git a/cmd/lsd/lsd.go b/cmd/lsd/lsd.go index 8d79266fb6985..62180761038e6 100644 --- a/cmd/lsd/lsd.go +++ b/cmd/lsd/lsd.go @@ -20,7 +20,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing") + flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing", "") } var commandDefinition = &cobra.Command{ @@ -49,6 +49,9 @@ Or If you just want the directory names use ` + "`rclone lsf --dirs-only`" + `. ` + lshelp.Help, + Annotations: map[string]string{ + "groups": "Filter,Listing", + }, Run: func(command *cobra.Command, args []string) { ci := fs.GetConfig(context.Background()) cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/lsf/lsf.go b/cmd/lsf/lsf.go index 8322e7c25685f..22e4de754c822 100644 --- a/cmd/lsf/lsf.go +++ b/cmd/lsf/lsf.go @@ -31,15 +31,15 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.StringVarP(cmdFlags, &format, "format", "F", "p", "Output format - see help for details") - flags.StringVarP(cmdFlags, &separator, "separator", "s", ";", "Separator for the items in the format") - flags.BoolVarP(cmdFlags, &dirSlash, "dir-slash", "d", true, "Append a slash to directory names") - flags.FVarP(cmdFlags, &hashType, "hash", "", "Use this hash when `h` is used in the format MD5|SHA-1|DropboxHash") - flags.BoolVarP(cmdFlags, &filesOnly, "files-only", "", false, "Only list files") - flags.BoolVarP(cmdFlags, &dirsOnly, "dirs-only", "", false, "Only list directories") - flags.BoolVarP(cmdFlags, &csv, "csv", "", false, "Output in CSV format") - flags.BoolVarP(cmdFlags, &absolute, "absolute", "", false, "Put a leading / in front of path names") - flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing") + flags.StringVarP(cmdFlags, &format, "format", "F", "p", "Output format - see help for details", "") + flags.StringVarP(cmdFlags, &separator, "separator", "s", ";", "Separator for the items in the format", "") + flags.BoolVarP(cmdFlags, &dirSlash, "dir-slash", "d", true, "Append a slash to directory names", "") + flags.FVarP(cmdFlags, &hashType, "hash", "", "Use this hash when `h` is used in the format MD5|SHA-1|DropboxHash", "") + flags.BoolVarP(cmdFlags, &filesOnly, "files-only", "", false, "Only list files", "") + flags.BoolVarP(cmdFlags, &dirsOnly, "dirs-only", "", false, "Only list directories", "") + flags.BoolVarP(cmdFlags, &csv, "csv", "", false, "Output in CSV format", "") + flags.BoolVarP(cmdFlags, &absolute, "absolute", "", false, "Put a leading / in front of path names", "") + flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing", "") } var commandDefinition = &cobra.Command{ @@ -144,6 +144,7 @@ those only (without traversing the whole directory structure): ` + lshelp.Help, Annotations: map[string]string{ "versionIntroduced": "v1.40", + "groups": "Filter,Listing", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/lsjson/lsjson.go b/cmd/lsjson/lsjson.go index c7da1c8637064..00cb0f4b6bc63 100644 --- a/cmd/lsjson/lsjson.go +++ b/cmd/lsjson/lsjson.go @@ -23,17 +23,17 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &opt.Recurse, "recursive", "R", false, "Recurse into the listing") - flags.BoolVarP(cmdFlags, &opt.ShowHash, "hash", "", false, "Include hashes in the output (may take longer)") - flags.BoolVarP(cmdFlags, &opt.NoModTime, "no-modtime", "", false, "Don't read the modification time (can speed things up)") - flags.BoolVarP(cmdFlags, &opt.NoMimeType, "no-mimetype", "", false, "Don't read the mime type (can speed things up)") - flags.BoolVarP(cmdFlags, &opt.ShowEncrypted, "encrypted", "", false, "Show the encrypted names") - flags.BoolVarP(cmdFlags, &opt.ShowOrigIDs, "original", "", false, "Show the ID of the underlying Object") - flags.BoolVarP(cmdFlags, &opt.FilesOnly, "files-only", "", false, "Show only files in the listing") - flags.BoolVarP(cmdFlags, &opt.DirsOnly, "dirs-only", "", false, "Show only directories in the listing") - flags.BoolVarP(cmdFlags, &opt.Metadata, "metadata", "M", false, "Add metadata to the listing") - flags.StringArrayVarP(cmdFlags, &opt.HashTypes, "hash-type", "", nil, "Show only this hash type (may be repeated)") - flags.BoolVarP(cmdFlags, &statOnly, "stat", "", false, "Just return the info for the pointed to file") + flags.BoolVarP(cmdFlags, &opt.Recurse, "recursive", "R", false, "Recurse into the listing", "") + flags.BoolVarP(cmdFlags, &opt.ShowHash, "hash", "", false, "Include hashes in the output (may take longer)", "") + flags.BoolVarP(cmdFlags, &opt.NoModTime, "no-modtime", "", false, "Don't read the modification time (can speed things up)", "") + flags.BoolVarP(cmdFlags, &opt.NoMimeType, "no-mimetype", "", false, "Don't read the mime type (can speed things up)", "") + flags.BoolVarP(cmdFlags, &opt.ShowEncrypted, "encrypted", "", false, "Show the encrypted names", "") + flags.BoolVarP(cmdFlags, &opt.ShowOrigIDs, "original", "", false, "Show the ID of the underlying Object", "") + flags.BoolVarP(cmdFlags, &opt.FilesOnly, "files-only", "", false, "Show only files in the listing", "") + flags.BoolVarP(cmdFlags, &opt.DirsOnly, "dirs-only", "", false, "Show only directories in the listing", "") + flags.BoolVarP(cmdFlags, &opt.Metadata, "metadata", "M", false, "Add metadata to the listing", "") + flags.StringArrayVarP(cmdFlags, &opt.HashTypes, "hash-type", "", nil, "Show only this hash type (may be repeated)", "") + flags.BoolVarP(cmdFlags, &statOnly, "stat", "", false, "Just return the info for the pointed to file", "") } var commandDefinition = &cobra.Command{ @@ -114,8 +114,15 @@ can be processed line by line as each item is written one to a line. ` + lshelp.Help, Annotations: map[string]string{ "versionIntroduced": "v1.37", + "groups": "Filter,Listing", }, RunE: func(command *cobra.Command, args []string) error { + // Make sure we set the global Metadata flag too as it + // isn't parsed by cobra. We need to do this first + // before any backends are created. + ci := fs.GetConfig(context.Background()) + ci.Metadata = opt.Metadata + cmd.CheckArgs(1, 1, command, args) var fsrc fs.Fs var remote string diff --git a/cmd/lsl/lsl.go b/cmd/lsl/lsl.go index e7a7366f17a08..738f66a2ab292 100644 --- a/cmd/lsl/lsl.go +++ b/cmd/lsl/lsl.go @@ -33,6 +33,7 @@ Eg ` + lshelp.Help, Annotations: map[string]string{ "versionIntroduced": "v1.02", + "groups": "Filter,Listing", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/md5sum/md5sum.go b/cmd/md5sum/md5sum.go index 94c0ed3ef9f59..dd27a1f77aa8d 100644 --- a/cmd/md5sum/md5sum.go +++ b/cmd/md5sum/md5sum.go @@ -40,6 +40,7 @@ as a relative path). `, Annotations: map[string]string{ "versionIntroduced": "v1.02", + "groups": "Filter,Listing", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(0, 1, command, args) diff --git a/cmd/mkdir/mkdir.go b/cmd/mkdir/mkdir.go index 3c99180feae52..37dfc18f850fc 100644 --- a/cmd/mkdir/mkdir.go +++ b/cmd/mkdir/mkdir.go @@ -18,6 +18,9 @@ func init() { var commandDefinition = &cobra.Command{ Use: "mkdir remote:path", Short: `Make the path if it doesn't already exist.`, + Annotations: map[string]string{ + "groups": "Important", + }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) fdst := cmd.NewFsDir(args) diff --git a/cmd/mount/dir.go b/cmd/mount/dir.go index b82b521796f13..4a6f939f6648e 100644 --- a/cmd/mount/dir.go +++ b/cmd/mount/dir.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount @@ -250,7 +250,7 @@ func (d *Dir) Mknod(ctx context.Context, req *fuse.MknodRequest) (node fusefs.No defer log.Trace(d, "name=%v, mode=%d, rdev=%d", req.Name, req.Mode, req.Rdev)("node=%v, err=%v", &node, &err) if req.Rdev != 0 { fs.Errorf(d, "Can't create device node %q", req.Name) - return nil, fuse.EIO + return nil, fuse.Errno(syscall.EIO) } var cReq = fuse.CreateRequest{ Name: req.Name, diff --git a/cmd/mount/file.go b/cmd/mount/file.go index 1a0ad6c2860f5..f745dcc7bbc67 100644 --- a/cmd/mount/file.go +++ b/cmd/mount/file.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount diff --git a/cmd/mount/fs.go b/cmd/mount/fs.go index c89110ecc7f73..e81b2f07878ab 100644 --- a/cmd/mount/fs.go +++ b/cmd/mount/fs.go @@ -1,7 +1,7 @@ // FUSE main Fs -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount @@ -82,11 +82,11 @@ func translateError(err error) error { case vfs.OK: return nil case vfs.ENOENT, fs.ErrorDirNotFound, fs.ErrorObjectNotFound: - return fuse.ENOENT + return fuse.Errno(syscall.ENOENT) case vfs.EEXIST, fs.ErrorDirExists: - return fuse.EEXIST + return fuse.Errno(syscall.EEXIST) case vfs.EPERM, fs.ErrorPermissionDenied: - return fuse.EPERM + return fuse.Errno(syscall.EPERM) case vfs.ECLOSED: return fuse.Errno(syscall.EBADF) case vfs.ENOTEMPTY: diff --git a/cmd/mount/handle.go b/cmd/mount/handle.go index 7b7b6c010eabd..65d344538b52c 100644 --- a/cmd/mount/handle.go +++ b/cmd/mount/handle.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount @@ -25,15 +25,13 @@ var _ fusefs.HandleReader = (*FileHandle)(nil) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) (err error) { var n int defer log.Trace(fh, "len=%d, offset=%d", req.Size, req.Offset)("read=%d, err=%v", &n, &err) - data := make([]byte, req.Size) + data := resp.Data[:req.Size] n, err = fh.Handle.ReadAt(data, req.Offset) + resp.Data = data[:n] if err == io.EOF { err = nil - } else if err != nil { - return translateError(err) } - resp.Data = data[:n] - return nil + return translateError(err) } // Check interface satisfied diff --git a/cmd/mount/mount.go b/cmd/mount/mount.go index 9be432c5e0b9d..b32ba29aedb8c 100644 --- a/cmd/mount/mount.go +++ b/cmd/mount/mount.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux // Package mount implements a FUSE mounting system for rclone remotes. package mount diff --git a/cmd/mount/mount_test.go b/cmd/mount/mount_test.go index ec5422cc9189b..df4d02ec09629 100644 --- a/cmd/mount/mount_test.go +++ b/cmd/mount/mount_test.go @@ -1,14 +1,15 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount import ( "testing" + "github.com/rclone/rclone/vfs/vfscommon" "github.com/rclone/rclone/vfs/vfstest" ) func TestMount(t *testing.T) { - vfstest.RunTests(t, false, mount) + vfstest.RunTests(t, false, vfscommon.CacheModeOff, true, mount) } diff --git a/cmd/mount/mount_unsupported.go b/cmd/mount/mount_unsupported.go index 84f8656dc2e64..c2feafbc3e76d 100644 --- a/cmd/mount/mount_unsupported.go +++ b/cmd/mount/mount_unsupported.go @@ -1,10 +1,8 @@ -//go:build !linux && !freebsd -// +build !linux,!freebsd +//go:build !linux +// +build !linux // Package mount implements a FUSE mounting system for rclone remotes. // // Build for mount for unsupported platforms to stop go complaining // about "no buildable Go source files". -// -// Invert the build constraint: linux freebsd package mount diff --git a/cmd/mount2/mount.go b/cmd/mount2/mount.go index 152f3a89edd20..f244bf40df63c 100644 --- a/cmd/mount2/mount.go +++ b/cmd/mount2/mount.go @@ -26,12 +26,14 @@ func init() { // man mount.fuse for more info and note the -o flag for other options func mountOptions(fsys *FS, f fs.Fs, opt *mountlib.Options) (mountOpts *fuse.MountOptions) { mountOpts = &fuse.MountOptions{ - AllowOther: fsys.opt.AllowOther, - FsName: opt.DeviceName, - Name: "rclone", - DisableXAttrs: true, - Debug: fsys.opt.DebugFUSE, - MaxReadAhead: int(fsys.opt.MaxReadAhead), + AllowOther: fsys.opt.AllowOther, + FsName: opt.DeviceName, + Name: "rclone", + DisableXAttrs: true, + Debug: fsys.opt.DebugFUSE, + MaxReadAhead: int(fsys.opt.MaxReadAhead), + MaxWrite: 1024 * 1024, // Linux v4.20+ caps requests at 1 MiB + DisableReadDirPlus: true, // RememberInodes: true, // SingleThreaded: true, @@ -47,12 +49,42 @@ func mountOptions(fsys *FS, f fs.Fs, opt *mountlib.Options) (mountOpts *fuse.Mou // async I/O. Concurrency for synchronous I/O is not limited. MaxBackground int - // Write size to use. If 0, use default. This number is - // capped at the kernel maximum. + // MaxWrite is the max size for read and write requests. If 0, use + // go-fuse default (currently 64 kiB). + // This number is internally capped at MAX_KERNEL_WRITE (higher values don't make + // sense). + // + // Non-direct-io reads are mostly served via kernel readahead, which is + // additionally subject to the MaxReadAhead limit. + // + // Implementation notes: + // + // There's four values the Linux kernel looks at when deciding the request size: + // * MaxWrite, passed via InitOut.MaxWrite. Limits the WRITE size. + // * max_read, passed via a string mount option. Limits the READ size. + // go-fuse sets max_read equal to MaxWrite. + // You can see the current max_read value in /proc/self/mounts . + // * MaxPages, passed via InitOut.MaxPages. In Linux 4.20 and later, the value + // can go up to 1 MiB and go-fuse calculates the MaxPages value acc. + // to MaxWrite, rounding up. + // On older kernels, the value is fixed at 128 kiB and the + // passed value is ignored. No request can be larger than MaxPages, so + // READ and WRITE are effectively capped at MaxPages. + // * MaxReadAhead, passed via InitOut.MaxReadAhead. MaxWrite int - // Max read ahead to use. If 0, use default. This number is - // capped at the kernel maximum. + // MaxReadAhead is the max read ahead size to use. It controls how much data the + // kernel reads in advance to satisfy future read requests from applications. + // How much exactly is subject to clever heuristics in the kernel + // (see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/readahead.c?h=v6.2-rc5#n375 + // if you are brave) and hence also depends on the kernel version. + // + // If 0, use kernel default. This number is capped at the kernel maximum + // (128 kiB on Linux) and cannot be larger than MaxWrite. + // + // MaxReadAhead only affects buffered reads (=non-direct-io), but even then, the + // kernel can and does send larger reads to satisfy read requests from applications + // (up to MaxWrite or VM_READAHEAD_PAGES=128 kiB, whichever is less). MaxReadAhead int // If IgnoreSecurityLabels is set, all security related xattr @@ -87,9 +119,19 @@ func mountOptions(fsys *FS, f fs.Fs, opt *mountlib.Options) (mountOpts *fuse.Mou // you must implement the GetLk/SetLk/SetLkw methods. EnableLocks bool + // If set, the kernel caches all Readlink return values. The + // filesystem must use content notification to force the + // kernel to issue a new Readlink call. + EnableSymlinkCaching bool + // If set, ask kernel not to do automatic data cache invalidation. // The filesystem is fully responsible for invalidating data cache. ExplicitDataCacheControl bool + + // Disable ReadDirPlus capability so ReadDir is used instead. Simple + // directory queries (i.e. 'ls' without '-l') can be faster with + // ReadDir, as no per-file stat calls are needed + DisableReadDirPlus bool */ } @@ -176,8 +218,8 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (<-chan error MountOptions: *mountOpts, EntryTimeout: &opt.AttrTimeout, AttrTimeout: &opt.AttrTimeout, - // UID - // GID + GID: VFS.Opt.GID, + UID: VFS.Opt.UID, } root, err := fsys.Root() diff --git a/cmd/mount2/mount_test.go b/cmd/mount2/mount_test.go index c6572a9832937..5ff74ff3c7764 100644 --- a/cmd/mount2/mount_test.go +++ b/cmd/mount2/mount_test.go @@ -1,16 +1,15 @@ -//go:build linux || (darwin && amd64) -// +build linux darwin,amd64 +//go:build linux +// +build linux package mount2 import ( "testing" - "github.com/rclone/rclone/fstest/testy" + "github.com/rclone/rclone/vfs/vfscommon" "github.com/rclone/rclone/vfs/vfstest" ) func TestMount(t *testing.T) { - testy.SkipUnreliable(t) - vfstest.RunTests(t, false, mount) + vfstest.RunTests(t, false, vfscommon.CacheModeOff, true, mount) } diff --git a/cmd/mount2/node.go b/cmd/mount2/node.go index fae416d648218..0ba1aded4a075 100644 --- a/cmd/mount2/node.go +++ b/cmd/mount2/node.go @@ -85,17 +85,16 @@ func (n *Node) lookupVfsNodeInDir(leaf string) (vfsNode vfs.Node, errno syscall. // will not work. func (n *Node) Statfs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno { defer log.Trace(n, "")("out=%+v", &out) - out = new(fuse.StatfsOut) const blockSize = 4096 - const fsBlocks = (1 << 50) / blockSize - out.Blocks = fsBlocks // Total data blocks in file system. - out.Bfree = fsBlocks // Free blocks in file system. - out.Bavail = fsBlocks // Free blocks in file system if you're not root. - out.Files = 1e9 // Total files in file system. - out.Ffree = 1e9 // Free files in file system. - out.Bsize = blockSize // Block size - out.NameLen = 255 // Maximum file name length? - out.Frsize = blockSize // Fragment size, smallest addressable data size in the file system. + total, _, free := n.fsys.VFS.Statfs() + out.Blocks = uint64(total) / blockSize // Total data blocks in file system. + out.Bfree = uint64(free) / blockSize // Free blocks in file system. + out.Bavail = out.Bfree // Free blocks in file system if you're not root. + out.Files = 1e9 // Total files in file system. + out.Ffree = 1e9 // Free files in file system. + out.Bsize = blockSize // Block size + out.NameLen = 255 // Maximum file name length? + out.Frsize = blockSize // Fragment size, smallest addressable data size in the file system. mountlib.ClipBlocks(&out.Blocks) mountlib.ClipBlocks(&out.Bfree) mountlib.ClipBlocks(&out.Bavail) @@ -405,3 +404,40 @@ func (n *Node) Rename(ctx context.Context, oldName string, newParent fusefs.Inod } var _ = (fusefs.NodeRenamer)((*Node)(nil)) + +// Getxattr should read data for the given attribute into +// `dest` and return the number of bytes. If `dest` is too +// small, it should return ERANGE and the size of the attribute. +// If not defined, Getxattr will return ENOATTR. +func (n *Node) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno) { + return 0, syscall.ENOSYS // we never implement this +} + +var _ fusefs.NodeGetxattrer = (*Node)(nil) + +// Setxattr should store data for the given attribute. See +// setxattr(2) for information about flags. +// If not defined, Setxattr will return ENOATTR. +func (n *Node) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno { + return syscall.ENOSYS // we never implement this +} + +var _ fusefs.NodeSetxattrer = (*Node)(nil) + +// Removexattr should delete the given attribute. +// If not defined, Removexattr will return ENOATTR. +func (n *Node) Removexattr(ctx context.Context, attr string) syscall.Errno { + return syscall.ENOSYS // we never implement this +} + +var _ fusefs.NodeRemovexattrer = (*Node)(nil) + +// Listxattr should read all attributes (null terminated) into +// `dest`. If the `dest` buffer is too small, it should return ERANGE +// and the correct size. If not defined, return an empty list and +// success. +func (n *Node) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno) { + return 0, syscall.ENOSYS // we never implement this +} + +var _ fusefs.NodeListxattrer = (*Node)(nil) diff --git a/cmd/mountlib/check_linux.go b/cmd/mountlib/check_linux.go index 1c32a6d8ad426..81e3ccf37a43c 100644 --- a/cmd/mountlib/check_linux.go +++ b/cmd/mountlib/check_linux.go @@ -4,22 +4,20 @@ package mountlib import ( - "errors" "fmt" "path/filepath" "strings" "time" - "github.com/artyom/mtab" + "github.com/moby/sys/mountinfo" ) const ( - mtabPath = "/proc/mounts" pollInterval = 100 * time.Millisecond ) // CheckMountEmpty checks if folder is not already a mountpoint. -// On Linux we use the OS-specific /proc/mount API so the check won't access the path. +// On Linux we use the OS-specific /proc/self/mountinfo API so the check won't access the path. // Directories marked as "mounted" by autofs are considered not mounted. func CheckMountEmpty(mountpoint string) error { const msg = "directory already mounted, use --allow-non-empty to mount anyway: %s" @@ -29,43 +27,57 @@ func CheckMountEmpty(mountpoint string) error { return fmt.Errorf("cannot get absolute path: %s: %w", mountpoint, err) } - entries, err := mtab.Entries(mtabPath) + infos, err := mountinfo.GetMounts(mountinfo.SingleEntryFilter(mountpointAbs)) if err != nil { - return fmt.Errorf("cannot read %s: %w", mtabPath, err) + return fmt.Errorf("cannot get mounts: %w", err) } + foundAutofs := false - for _, entry := range entries { - if entry.Dir == mountpointAbs { - if entry.Type != "autofs" { - return fmt.Errorf(msg, mountpointAbs) - } - foundAutofs = true + for _, info := range infos { + if info.FSType != "autofs" { + return fmt.Errorf(msg, mountpointAbs) } + foundAutofs = true } // It isn't safe to list an autofs in the middle of mounting if foundAutofs { return nil } + return checkMountEmpty(mountpoint) } +// singleEntryFilter looks for a specific entry. +// +// It may appear more than once and we return all of them if so. +func singleEntryFilter(mp string) mountinfo.FilterFunc { + return func(m *mountinfo.Info) (skip, stop bool) { + return m.Mountpoint != mp, false + } +} + // CheckMountReady checks whether mountpoint is mounted by rclone. // Only mounts with type "rclone" or "fuse.rclone" count. func CheckMountReady(mountpoint string) error { + const msg = "mount not ready: %s" + mountpointAbs, err := filepath.Abs(mountpoint) if err != nil { return fmt.Errorf("cannot get absolute path: %s: %w", mountpoint, err) } - entries, err := mtab.Entries(mtabPath) + + infos, err := mountinfo.GetMounts(singleEntryFilter(mountpointAbs)) if err != nil { - return fmt.Errorf("cannot read %s: %w", mtabPath, err) + return fmt.Errorf("cannot get mounts: %w", err) } - for _, entry := range entries { - if entry.Dir == mountpointAbs && strings.Contains(entry.Type, "rclone") { + + for _, info := range infos { + if strings.Contains(info.FSType, "rclone") { return nil } } - return errors.New("mount not ready") + + return fmt.Errorf(msg, mountpointAbs) } // WaitMountReady waits until mountpoint is mounted by rclone. diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go index 25fc272e1afea..4bc9e066a9e83 100644 --- a/cmd/mountlib/mount.go +++ b/cmd/mountlib/mount.go @@ -3,6 +3,7 @@ package mountlib import ( "context" + _ "embed" "fmt" "log" "os" @@ -27,6 +28,9 @@ import ( "github.com/spf13/pflag" ) +//go:embed mount.md +var mountHelp string + // Options for creating the mount type Options struct { DebugFUSE bool @@ -48,6 +52,7 @@ type Options struct { DaemonTimeout time.Duration // OSXFUSE only AsyncRead bool NetworkMode bool // Windows only + CaseInsensitive fs.Tristate } // DefaultOpt is the default values for creating the mount @@ -124,30 +129,31 @@ var Opt Options // AddFlags adds the non filing system specific flags to the command func AddFlags(flagSet *pflag.FlagSet) { rc.AddOption("mount", &Opt) - flags.BoolVarP(flagSet, &Opt.DebugFUSE, "debug-fuse", "", Opt.DebugFUSE, "Debug the FUSE internals - needs -v") - flags.DurationVarP(flagSet, &Opt.AttrTimeout, "attr-timeout", "", Opt.AttrTimeout, "Time for which file/directory attributes are cached") - flags.StringArrayVarP(flagSet, &Opt.ExtraOptions, "option", "o", []string{}, "Option for libfuse/WinFsp (repeat if required)") - flags.StringArrayVarP(flagSet, &Opt.ExtraFlags, "fuse-flag", "", []string{}, "Flags or arguments to be passed direct to libfuse/WinFsp (repeat if required)") + flags.BoolVarP(flagSet, &Opt.DebugFUSE, "debug-fuse", "", Opt.DebugFUSE, "Debug the FUSE internals - needs -v", "Mount") + flags.DurationVarP(flagSet, &Opt.AttrTimeout, "attr-timeout", "", Opt.AttrTimeout, "Time for which file/directory attributes are cached", "Mount") + flags.StringArrayVarP(flagSet, &Opt.ExtraOptions, "option", "o", []string{}, "Option for libfuse/WinFsp (repeat if required)", "Mount") + flags.StringArrayVarP(flagSet, &Opt.ExtraFlags, "fuse-flag", "", []string{}, "Flags or arguments to be passed direct to libfuse/WinFsp (repeat if required)", "Mount") // Non-Windows only - flags.BoolVarP(flagSet, &Opt.Daemon, "daemon", "", Opt.Daemon, "Run mount in background and exit parent process (as background output is suppressed, use --log-file with --log-format=pid,... to monitor) (not supported on Windows)") - flags.DurationVarP(flagSet, &Opt.DaemonTimeout, "daemon-timeout", "", Opt.DaemonTimeout, "Time limit for rclone to respond to kernel (not supported on Windows)") - flags.BoolVarP(flagSet, &Opt.DefaultPermissions, "default-permissions", "", Opt.DefaultPermissions, "Makes kernel enforce access control based on the file mode (not supported on Windows)") - flags.BoolVarP(flagSet, &Opt.AllowNonEmpty, "allow-non-empty", "", Opt.AllowNonEmpty, "Allow mounting over a non-empty directory (not supported on Windows)") - flags.BoolVarP(flagSet, &Opt.AllowRoot, "allow-root", "", Opt.AllowRoot, "Allow access to root user (not supported on Windows)") - flags.BoolVarP(flagSet, &Opt.AllowOther, "allow-other", "", Opt.AllowOther, "Allow access to other users (not supported on Windows)") - flags.BoolVarP(flagSet, &Opt.AsyncRead, "async-read", "", Opt.AsyncRead, "Use asynchronous reads (not supported on Windows)") - flags.FVarP(flagSet, &Opt.MaxReadAhead, "max-read-ahead", "", "The number of bytes that can be prefetched for sequential reads (not supported on Windows)") - flags.BoolVarP(flagSet, &Opt.WritebackCache, "write-back-cache", "", Opt.WritebackCache, "Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)") - flags.StringVarP(flagSet, &Opt.DeviceName, "devname", "", Opt.DeviceName, "Set the device name - default is remote:path") + flags.BoolVarP(flagSet, &Opt.Daemon, "daemon", "", Opt.Daemon, "Run mount in background and exit parent process (as background output is suppressed, use --log-file with --log-format=pid,... to monitor) (not supported on Windows)", "Mount") + flags.DurationVarP(flagSet, &Opt.DaemonTimeout, "daemon-timeout", "", Opt.DaemonTimeout, "Time limit for rclone to respond to kernel (not supported on Windows)", "Mount") + flags.BoolVarP(flagSet, &Opt.DefaultPermissions, "default-permissions", "", Opt.DefaultPermissions, "Makes kernel enforce access control based on the file mode (not supported on Windows)", "Mount") + flags.BoolVarP(flagSet, &Opt.AllowNonEmpty, "allow-non-empty", "", Opt.AllowNonEmpty, "Allow mounting over a non-empty directory (not supported on Windows)", "Mount") + flags.BoolVarP(flagSet, &Opt.AllowRoot, "allow-root", "", Opt.AllowRoot, "Allow access to root user (not supported on Windows)", "Mount") + flags.BoolVarP(flagSet, &Opt.AllowOther, "allow-other", "", Opt.AllowOther, "Allow access to other users (not supported on Windows)", "Mount") + flags.BoolVarP(flagSet, &Opt.AsyncRead, "async-read", "", Opt.AsyncRead, "Use asynchronous reads (not supported on Windows)", "Mount") + flags.FVarP(flagSet, &Opt.MaxReadAhead, "max-read-ahead", "", "The number of bytes that can be prefetched for sequential reads (not supported on Windows)", "Mount") + flags.BoolVarP(flagSet, &Opt.WritebackCache, "write-back-cache", "", Opt.WritebackCache, "Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)", "Mount") + flags.StringVarP(flagSet, &Opt.DeviceName, "devname", "", Opt.DeviceName, "Set the device name - default is remote:path", "Mount") + flags.FVarP(flagSet, &Opt.CaseInsensitive, "mount-case-insensitive", "", "Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto)", "Mount") // Windows and OSX - flags.StringVarP(flagSet, &Opt.VolumeName, "volname", "", Opt.VolumeName, "Set the volume name (supported on Windows and OSX only)") + flags.StringVarP(flagSet, &Opt.VolumeName, "volname", "", Opt.VolumeName, "Set the volume name (supported on Windows and OSX only)", "Mount") // OSX only - flags.BoolVarP(flagSet, &Opt.NoAppleDouble, "noappledouble", "", Opt.NoAppleDouble, "Ignore Apple Double (._) and .DS_Store files (supported on OSX only)") - flags.BoolVarP(flagSet, &Opt.NoAppleXattr, "noapplexattr", "", Opt.NoAppleXattr, "Ignore all \"com.apple.*\" extended attributes (supported on OSX only)") + flags.BoolVarP(flagSet, &Opt.NoAppleDouble, "noappledouble", "", Opt.NoAppleDouble, "Ignore Apple Double (._) and .DS_Store files (supported on OSX only)", "Mount") + flags.BoolVarP(flagSet, &Opt.NoAppleXattr, "noapplexattr", "", Opt.NoAppleXattr, "Ignore all \"com.apple.*\" extended attributes (supported on OSX only)", "Mount") // Windows only - flags.BoolVarP(flagSet, &Opt.NetworkMode, "network-mode", "", Opt.NetworkMode, "Mount as remote network drive, instead of fixed disk drive (supported on Windows only)") + flags.BoolVarP(flagSet, &Opt.NetworkMode, "network-mode", "", Opt.NetworkMode, "Mount as remote network drive, instead of fixed disk drive (supported on Windows only)", "Mount") // Unix only - flags.DurationVarP(flagSet, &Opt.DaemonWait, "daemon-wait", "", Opt.DaemonWait, "Time to wait for ready mount from daemon (maximum time on Linux, constant sleep time on OSX/BSD) (not supported on Windows)") + flags.DurationVarP(flagSet, &Opt.DaemonWait, "daemon-wait", "", Opt.DaemonWait, "Time to wait for ready mount from daemon (maximum time on Linux, constant sleep time on OSX/BSD) (not supported on Windows)", "Mount") } // NewMountCommand makes a mount command with the given name and Mount function @@ -156,9 +162,10 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm Use: commandName + " remote:path /path/to/mountpoint", Hidden: hidden, Short: `Mount the remote as file system on a mountpoint.`, - Long: strings.ReplaceAll(strings.ReplaceAll(mountHelp, "|", "`"), "@", commandName) + vfs.Help, + Long: strings.ReplaceAll(mountHelp, "@", commandName) + vfs.Help, Annotations: map[string]string{ "versionIntroduced": "v1.33", + "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) diff --git a/cmd/mountlib/help.go b/cmd/mountlib/mount.md similarity index 76% rename from cmd/mountlib/help.go rename to cmd/mountlib/mount.md index 944330c75ecb7..9d367ca1ec08b 100644 --- a/cmd/mountlib/help.go +++ b/cmd/mountlib/mount.md @@ -1,15 +1,11 @@ -package mountlib - -// "@" will be replaced by the command name, "|" will be replaced by backticks -var mountHelp = ` rclone @ allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's cloud storage systems as a file system with FUSE. -First set up your remote using |rclone config|. Check it works with |rclone ls| etc. +First set up your remote using `rclone config`. Check it works with `rclone ls` etc. On Linux and macOS, you can run mount in either foreground or background (aka -daemon) mode. Mount runs in foreground mode by default. Use the |--daemon| flag +daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag to force background mode. On Windows you can run mount in foreground only, the flag is ignored. @@ -18,7 +14,7 @@ program starts, spawns background rclone process to setup and maintain the mount, waits until success or timeout and exits with appropriate code (killing the child process if it fails). -On Linux/macOS/FreeBSD start the mount like this, where |/path/to/local/mount| +On Linux/macOS/FreeBSD start the mount like this, where `/path/to/local/mount` is an **empty** **existing** directory: rclone @ remote:path/to/files /path/to/local/mount @@ -29,10 +25,10 @@ rclone will serve the mount and occupy the console so another window should be used to work with the mount until rclone is interrupted e.g. by pressing Ctrl-C. The following examples will mount to an automatically assigned drive, -to specific drive letter |X:|, to path |C:\path\parent\mount| +to specific drive letter `X:`, to path `C:\path\parent\mount` (where parent directory or drive must exist, and mount must **not** exist, and is not supported when [mounting as a network drive](#mounting-modes-on-windows)), and -the last example will mount as network share |\\cloud\remote| and map it to an +the last example will mount as network share `\\cloud\remote` and map it to an automatically assigned drive: rclone @ remote:path/to/files * @@ -89,7 +85,7 @@ as a network drive instead. When mounting as a fixed disk drive you can either mount to an unused drive letter, or to a path representing a **nonexistent** subdirectory of an **existing** parent -directory or drive. Using the special value |*| will tell rclone to +directory or drive. Using the special value `*` will tell rclone to automatically assign the next available drive letter, starting with Z: and moving backward. Examples: @@ -98,45 +94,45 @@ Examples: rclone @ remote:path/to/files C:\path\parent\mount rclone @ remote:path/to/files X: -Option |--volname| can be used to set a custom volume name for the mounted +Option `--volname` can be used to set a custom volume name for the mounted file system. The default is to use the remote name and path. -To mount as network drive, you can add option |--network-mode| +To mount as network drive, you can add option `--network-mode` to your @ command. Mounting to a directory path is not supported in this mode, it is a limitation Windows imposes on junctions, so the remote must always be mounted to a drive letter. rclone @ remote:path/to/files X: --network-mode -A volume name specified with |--volname| will be used to create the network share path. -A complete UNC path, such as |\\cloud\remote|, optionally with path -|\\cloud\remote\madeup\path|, will be used as is. Any other -string will be used as the share part, after a default prefix |\\server\|. -If no volume name is specified then |\\server\share| will be used. +A volume name specified with `--volname` will be used to create the network share path. +A complete UNC path, such as `\\cloud\remote`, optionally with path +`\\cloud\remote\madeup\path`, will be used as is. Any other +string will be used as the share part, after a default prefix `\\server\`. +If no volume name is specified then `\\server\share` will be used. You must make sure the volume name is unique when you are mounting more than one drive, or else the mount command will fail. The share name will treated as the volume label for the mapped drive, shown in Windows Explorer etc, while the complete -|\\server\share| will be reported as the remote UNC path by -|net use| etc, just like a normal network drive mapping. +`\\server\share` will be reported as the remote UNC path by +`net use` etc, just like a normal network drive mapping. -If you specify a full network share UNC path with |--volname|, this will implicitly -set the |--network-mode| option, so the following two examples have same result: +If you specify a full network share UNC path with `--volname`, this will implicitly +set the `--network-mode` option, so the following two examples have same result: rclone @ remote:path/to/files X: --network-mode rclone @ remote:path/to/files X: --volname \\server\share You may also specify the network share UNC path as the mountpoint itself. Then rclone -will automatically assign a drive letter, same as with |*| and use that as +will automatically assign a drive letter, same as with `*` and use that as mountpoint, and instead use the UNC path specified as the volume name, as if it were -specified with the |--volname| option. This will also implicitly set -the |--network-mode| option. This means the following two examples have same result: +specified with the `--volname` option. This will also implicitly set +the `--network-mode` option. This means the following two examples have same result: rclone @ remote:path/to/files \\cloud\remote rclone @ remote:path/to/files * --volname \\cloud\remote There is yet another way to enable network mode, and to set the share path, and that is to pass the "native" libfuse/WinFsp option directly: -|--fuse-flag --VolumePrefix=\server\share|. Note that the path +`--fuse-flag --VolumePrefix=\server\share`. Note that the path must be with just a single backslash prefix in this case. @@ -157,15 +153,15 @@ representing permissions for the POSIX permission scopes: Owner, group and other By default, the owner and group will be taken from the current user, and the built-in group "Everyone" will be used to represent others. The user/group can be customized with FUSE options "UserName" and "GroupName", -e.g. |-o UserName=user123 -o GroupName="Authenticated Users"|. +e.g. `-o UserName=user123 -o GroupName="Authenticated Users"`. The permissions on each entry will be set according to [options](#options) -|--dir-perms| and |--file-perms|, which takes a value in traditional Unix +`--dir-perms` and `--file-perms`, which takes a value in traditional Unix [numeric notation](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation). -The default permissions corresponds to |--file-perms 0666 --dir-perms 0777|, +The default permissions corresponds to `--file-perms 0666 --dir-perms 0777`, i.e. read and write permissions to everyone. This means you will not be able to start any programs from the mount. To be able to do that you must add -execute permissions, e.g. |--file-perms 0777 --dir-perms 0777| to add it +execute permissions, e.g. `--file-perms 0777 --dir-perms 0777` to add it to everyone. If the program needs to write files, chances are you will have to enable [VFS File Caching](#vfs-file-caching) as well (see also [limitations](#limitations)). Note that the default write permission have @@ -193,12 +189,12 @@ will be added automatically for compatibility with Unix. Some example use cases will following. If you set POSIX permissions for only allowing access to the owner, -using |--file-perms 0600 --dir-perms 0700|, the user group and the built-in +using `--file-perms 0600 --dir-perms 0700`, the user group and the built-in "Everyone" group will still be given some special permissions, as described above. Some programs may then (incorrectly) interpret this as the file being accessible by everyone, for example an SSH client may warn about "unprotected private key file". You can work around this by specifying -|-o FileSecurity="D:P(A;;FA;;;OW)"|, which sets file all access (FA) to the +`-o FileSecurity="D:P(A;;FA;;;OW)"`, which sets file all access (FA) to the owner (OW), and nothing else. When setting write permissions then, except for the owner, this does not @@ -207,11 +203,11 @@ This may prevent applications from writing to files, giving permission denied error instead. To set working write permissions for the built-in "Everyone" group, similar to what it gets by default but with the addition of the "write extended attributes", you can specify -|-o FileSecurity="D:P(A;;FRFW;;;WD)"|, which sets file read (FR) and file +`-o FileSecurity="D:P(A;;FRFW;;;WD)"`, which sets file read (FR) and file write (FW) to everyone (WD). If file execute (FX) is also needed, then change -to |-o FileSecurity="D:P(A;;FRFWFX;;;WD)"|, or set file all access (FA) to +to `-o FileSecurity="D:P(A;;FRFWFX;;;WD)"`, or set file all access (FA) to get full access permissions, including delete, with -|-o FileSecurity="D:P(A;;FA;;;WD)"|. +`-o FileSecurity="D:P(A;;FA;;;WD)"`. #### Windows caveats @@ -235,7 +231,7 @@ It is also possible to make a drive mount available to everyone on the system, by running the process creating it as the built-in SYSTEM account. There are several ways to do this: One is to use the command-line utility [PsExec](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec), -from Microsoft's Sysinternals suite, which has option |-s| to start +from Microsoft's Sysinternals suite, which has option `-s` to start processes as the SYSTEM account. Another alternative is to run the mount command from a Windows Scheduled Task, or a Windows Service, configured to run as the SYSTEM account. A third alternative is to use the @@ -243,7 +239,7 @@ to run as the SYSTEM account. A third alternative is to use the Read more in the [install documentation](https://rclone.org/install/). Note that when running rclone as another user, it will not use the configuration file from your profile unless you tell it to -with the [|--config|](https://rclone.org/docs/#config-config-file) option. +with the [`--config`](https://rclone.org/docs/#config-config-file) option. Note also that it is now the SYSTEM account that will have the owner permissions, and other accounts will have permissions according to the group or others scopes. As mentioned above, these will then not get the @@ -256,11 +252,28 @@ does not suffer from the same limitations. ### Mounting on macOS -Mounting on macOS can be done either via [macFUSE](https://osxfuse.github.io/) +Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/), [macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or [FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server. +## NFS mount + +This method spins up an NFS server using [serve nfs](/commands/rclone_serve_nfs/) command and mounts +it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to +send SIGTERM signal to the rclone process using |kill| command to stop the mount. + +#### macFUSE Notes + +If installing macFUSE using [dmg packages](https://github.com/osxfuse/osxfuse/releases) from +the website, rclone will locate the macFUSE libraries without any further intervention. +If however, macFUSE is installed using the [macports](https://www.macports.org/) package manager, +the following addition steps are required. + + sudo mkdir /usr/local/lib + cd /usr/local/lib + sudo ln -s /opt/local/lib/libfuse.2.dylib + #### FUSE-T Limitations, Caveats, and Notes There are some limitations, caveats, and notes about how it works. These are current as @@ -283,31 +296,33 @@ of the file. Rclone includes flags for unicode normalization with macFUSE that should be updated for FUSE-T. See [this forum post](https://forum.rclone.org/t/some-unicode-forms-break-mount-on-macos-with-fuse-t/36403) and [FUSE-T issue #16](https://github.com/macos-fuse-t/fuse-t/issues/16). The following -flag should be added to the |rclone mount| command. +flag should be added to the `rclone mount` command. -o modules=iconv,from_code=UTF-8,to_code=UTF-8 ##### Read Only mounts -When mounting with |--read-only|, attempts to write to files will fail *silently* as +When mounting with `--read-only`, attempts to write to files will fail *silently* as opposed to with a clear warning as in macFUSE. ### Limitations -Without the use of |--vfs-cache-mode| this can only write files +Without the use of `--vfs-cache-mode` this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without -|--vfs-cache-mode writes| or |--vfs-cache-mode full|. +`--vfs-cache-mode writes` or `--vfs-cache-mode full`. See the [VFS File Caching](#vfs-file-caching) section for more info. +When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| +the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty directories will have a tendency to disappear once they fall out of the directory cache. -When |rclone mount| is invoked on Unix with |--daemon| flag, the main rclone +When `rclone mount` is invoked on Unix with `--daemon` flag, the main rclone program will wait for the background mount to become ready or until the timeout -specified by the |--daemon-wait| flag. On Linux it can check mount status using +specified by the `--daemon-wait` flag. On Linux it can check mount status using ProcFS so the flag in fact sets **maximum** time to wait, while the real wait can be less. On macOS / BSD the time to wait is constant and the check is performed only at the end. We advise you to set wait time on macOS reasonably. @@ -325,10 +340,10 @@ for solutions to make @ more reliable. ### Attribute caching -You can use the flag |--attr-timeout| to set the time the kernel caches +You can use the flag `--attr-timeout` to set the time the kernel caches the attributes (size, modification time, etc.) for directory entries. -The default is |1s| which caches files just long enough to avoid +The default is `1s` which caches files just long enough to avoid too many callbacks to rclone from the kernel. In theory 0s should be the correct value for filesystems which can @@ -339,14 +354,14 @@ few problems such as and [excessive time listing directories](https://github.com/rclone/rclone/issues/2095#issuecomment-371141147). The kernel can cache the info about a file for the time given by -|--attr-timeout|. You may see corruption if the remote file changes +`--attr-timeout`. You may see corruption if the remote file changes length during this window. It will show up as either a truncated file -or a file with garbage on the end. With |--attr-timeout 1s| this is -very unlikely but not impossible. The higher you set |--attr-timeout| +or a file with garbage on the end. With `--attr-timeout 1s` this is +very unlikely but not impossible. The higher you set `--attr-timeout` the more likely it is. The default setting of "1s" is the lowest setting which mitigates the problems above. -If you set it higher (|10s| or |1m| say) then the kernel will call +If you set it higher (`10s` or `1m` say) then the kernel will call back to rclone less often making it more efficient, however there is more chance of the corruption issue above. @@ -369,81 +384,79 @@ Units having the rclone @ service specified as a requirement will see all files and folders immediately in this mode. Note that systemd runs mount units without any environment variables including -|PATH| or |HOME|. This means that tilde (|~|) expansion will not work -and you should provide |--config| and |--cache-dir| explicitly as absolute +`PATH` or `HOME`. This means that tilde (`~`) expansion will not work +and you should provide `--config` and `--cache-dir` explicitly as absolute paths via rclone arguments. -Since mounting requires the |fusermount| program, rclone will use the fallback -PATH of |/bin:/usr/bin| in this scenario. Please ensure that |fusermount| +Since mounting requires the `fusermount` program, rclone will use the fallback +PATH of `/bin:/usr/bin` in this scenario. Please ensure that `fusermount` is present on this PATH. ### Rclone as Unix mount helper -The core Unix program |/bin/mount| normally takes the |-t FSTYPE| argument -then runs the |/sbin/mount.FSTYPE| helper program passing it mount options -as |-o key=val,...| or |--opt=...|. Automount (classic or systemd) behaves +The core Unix program `/bin/mount` normally takes the `-t FSTYPE` argument +then runs the `/sbin/mount.FSTYPE` helper program passing it mount options +as `-o key=val,...` or `--opt=...`. Automount (classic or systemd) behaves in a similar way. -rclone by default expects GNU-style flags |--key val|. To run it as a mount -helper you should symlink rclone binary to |/sbin/mount.rclone| and optionally -|/usr/bin/rclonefs|, e.g. |ln -s /usr/bin/rclone /sbin/mount.rclone|. +rclone by default expects GNU-style flags `--key val`. To run it as a mount +helper you should symlink rclone binary to `/sbin/mount.rclone` and optionally +`/usr/bin/rclonefs`, e.g. `ln -s /usr/bin/rclone /sbin/mount.rclone`. rclone will detect it and translate command-line arguments appropriately. Now you can run classic mounts like this: -||| +``` mount sftp1:subdir /mnt/data -t rclone -o vfs_cache_mode=writes,sftp_key_file=/path/to/pem -||| +``` or create systemd mount units: -||| +``` # /etc/systemd/system/mnt-data.mount [Unit] -After=network-online.target +Description=Mount for /mnt/data [Mount] Type=rclone What=sftp1:subdir Where=/mnt/data -Options=rw,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone -||| +Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone +``` optionally accompanied by systemd automount unit -||| +``` # /etc/systemd/system/mnt-data.automount [Unit] -After=network-online.target -Before=remote-fs.target +Description=AutoMount for /mnt/data [Automount] Where=/mnt/data TimeoutIdleSec=600 [Install] WantedBy=multi-user.target -||| +``` -or add in |/etc/fstab| a line like -||| +or add in `/etc/fstab` a line like +``` sftp1:subdir /mnt/data rclone rw,noauto,nofail,_netdev,x-systemd.automount,args2env,vfs_cache_mode=writes,config=/etc/rclone.conf,cache_dir=/var/cache/rclone 0 0 -||| +``` or use classic Automountd. -Remember to provide explicit |config=...,cache-dir=...| as a workaround for -mount units being run without |HOME|. +Remember to provide explicit `config=...,cache-dir=...` as a workaround for +mount units being run without `HOME`. -Rclone in the mount helper mode will split |-o| argument(s) by comma, replace |_| -by |-| and prepend |--| to get the command-line flags. Options containing commas +Rclone in the mount helper mode will split `-o` argument(s) by comma, replace `_` +by `-` and prepend `--` to get the command-line flags. Options containing commas or spaces can be wrapped in single or double quotes. Any inner quotes inside outer quotes of the same type should be doubled. Mount option syntax includes a few extra options treated specially: -- |env.NAME=VALUE| will set an environment variable for the mount process. +- `env.NAME=VALUE` will set an environment variable for the mount process. This helps with Automountd and Systemd.mount which don't allow setting custom environment for mount helpers. - Typically you will use |env.HTTPS_PROXY=proxy.host:3128| or |env.HOME=/root| -- |command=cmount| can be used to run |cmount| or any other rclone command - rather than the default |mount|. -- |args2env| will pass mount options to the mount helper running in background + Typically you will use `env.HTTPS_PROXY=proxy.host:3128` or `env.HOME=/root` +- `command=cmount` can be used to run `cmount` or any other rclone command + rather than the default `mount`. +- `args2env` will pass mount options to the mount helper running in background via environment variables instead of command line arguments. This allows to - hide secrets from such commands as |ps| or |pgrep|. -- |vv...| will be transformed into appropriate |--verbose=N| -- standard mount options like |x-systemd.automount|, |_netdev|, |nosuid| and alike + hide secrets from such commands as `ps` or `pgrep`. +- `vv...` will be transformed into appropriate `--verbose=N` +- standard mount options like `x-systemd.automount`, `_netdev`, `nosuid` and alike are intended only for Automountd and ignored by rclone. -` diff --git a/cmd/mountlib/rc.go b/cmd/mountlib/rc.go index d4c091235a618..df13ca97ce820 100644 --- a/cmd/mountlib/rc.go +++ b/cmd/mountlib/rc.go @@ -98,7 +98,7 @@ func mountRc(ctx context.Context, in rc.Params) (out rc.Params, err error) { } if mountOpt.Daemon { - return nil, errors.New("Daemon Option not supported over the API") + return nil, errors.New("daemon option not supported over the API") } mountType, err := in.GetString("mountType") @@ -111,7 +111,7 @@ func mountRc(ctx context.Context, in rc.Params) (out rc.Params, err error) { } mountType, mountFn := ResolveMountMethod(mountType) if mountFn == nil { - return nil, errors.New("Mount Option specified is not registered, or is invalid") + return nil, errors.New("mount option specified is not registered, or is invalid") } // Get Fs.fs to be mounted from fs parameter in the params diff --git a/cmd/move/move.go b/cmd/move/move.go index fd1004db11420..ae726043009b2 100644 --- a/cmd/move/move.go +++ b/cmd/move/move.go @@ -21,8 +21,8 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &deleteEmptySrcDirs, "delete-empty-src-dirs", "", deleteEmptySrcDirs, "Delete empty source dirs after move") - flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after move") + flags.BoolVarP(cmdFlags, &deleteEmptySrcDirs, "delete-empty-src-dirs", "", deleteEmptySrcDirs, "Delete empty source dirs after move", "") + flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after move", "") } var commandDefinition = &cobra.Command{ @@ -62,6 +62,7 @@ can speed transfers up greatly. `, "|", "`"), Annotations: map[string]string{ "versionIntroduced": "v1.19", + "groups": "Filter,Listing,Important,Copy", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) diff --git a/cmd/moveto/moveto.go b/cmd/moveto/moveto.go index f007fb18287d0..68b354d556368 100644 --- a/cmd/moveto/moveto.go +++ b/cmd/moveto/moveto.go @@ -51,6 +51,7 @@ successful transfer. `, Annotations: map[string]string{ "versionIntroduced": "v1.35", + "groups": "Filter,Listing,Important,Copy", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) diff --git a/cmd/ncdu/ncdu.go b/cmd/ncdu/ncdu.go index 6fdb210a5d702..cde48d972ca67 100644 --- a/cmd/ncdu/ncdu.go +++ b/cmd/ncdu/ncdu.go @@ -19,6 +19,7 @@ import ( "github.com/rclone/rclone/cmd/ncdu/scan" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/fspath" + "github.com/rclone/rclone/fs/log" "github.com/rclone/rclone/fs/operations" "github.com/rivo/uniseg" "github.com/spf13/cobra" @@ -76,12 +77,13 @@ the remote you can also use the [size](/commands/rclone_size/) command. `, Annotations: map[string]string{ "versionIntroduced": "v1.37", + "groups": "Filter,Listing", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) fsrc := cmd.NewFsSrc(args) cmd.Run(false, false, command, func() error { - return NewUI(fsrc).Show() + return NewUI(fsrc).Run() }) }, } @@ -110,6 +112,7 @@ func helpText() (tr []string) { tr = append(tr, []string{ " Y display current path", " ^L refresh screen (fix screen corruption)", + " r recalculate file sizes", " ? to toggle help on and off", " q/ESC/^c to quit", }...) @@ -120,6 +123,7 @@ func helpText() (tr []string) { type UI struct { s tcell.Screen f fs.Fs // fs being displayed + cancel func() // cancel the current scanning process fsName string // human name of Fs root *scan.Dir // root directory d *scan.Dir // current directory being displayed @@ -353,7 +357,7 @@ func (u *UI) hasEmptyDir() bool { } // Draw the current screen -func (u *UI) Draw() error { +func (u *UI) Draw() { ctx := context.Background() w, h := u.s.Size() u.dirListHeight = h - 3 @@ -382,6 +386,12 @@ func (u *UI) Draw() error { } showEmptyDir := u.hasEmptyDir() dirPos := u.dirPosMap[u.path] + // Check to see if a rescan has invalidated the position + if dirPos.offset >= len(u.sortPerm) { + delete(u.dirPosMap, u.path) + dirPos.offset = 0 + dirPos.entry = 0 + } for i, j := range u.sortPerm[dirPos.offset:] { entry := u.entries[j] n := i + dirPos.offset @@ -489,8 +499,6 @@ func (u *UI) Draw() error { if u.showBox { u.Box() } - u.s.Show() - return nil } // Move the cursor this many spaces adjusting the viewport as necessary @@ -900,8 +908,18 @@ func NewUI(f fs.Fs) *UI { } } -// Show shows the user interface -func (u *UI) Show() error { +func (u *UI) scan() (chan *scan.Dir, chan error, chan struct{}) { + if cancel := u.cancel; cancel != nil { + cancel() + } + u.listing = true + ctx := context.Background() + ctx, u.cancel = context.WithCancel(ctx) + return scan.Scan(ctx, u.f) +} + +// Run shows the user interface +func (u *UI) Run() error { var err error u.s, err = tcell.NewScreen() if err != nil { @@ -911,11 +929,32 @@ func (u *UI) Show() error { if err != nil { return fmt.Errorf("screen init: %w", err) } + + // Hijack fs.LogPrint so that it doesn't corrupt the screen. + if logPrint := fs.LogPrint; !log.Redirected() { + type log struct { + text string + level fs.LogLevel + } + var logs []log + fs.LogPrint = func(level fs.LogLevel, text string) { + if len(logs) > 100 { + logs = logs[len(logs)-100:] + } + logs = append(logs, log{level: level, text: text}) + } + defer func() { + fs.LogPrint = logPrint + for i := range logs { + logPrint(logs[i].level, logs[i].text) + } + }() + } + defer u.s.Fini() // scan the disk in the background - u.listing = true - rootChan, errChan, updated := scan.Scan(context.Background(), u.f) + rootChan, errChan, updated := u.scan() // Poll the events into a channel events := make(chan tcell.Event) @@ -924,10 +963,6 @@ func (u *UI) Show() error { // Main loop, waiting for events and channels outer: for { - err := u.Draw() - if err != nil { - return fmt.Errorf("draw failed: %w", err) - } select { case root := <-rootChan: u.root = root @@ -938,16 +973,14 @@ outer: } u.listing = false case <-updated: - // redraw // TODO: might want to limit updates per second u.sortCurrentDir() case ev := <-events: switch ev := ev.(type) { case *tcell.EventResize: - if u.root != nil { - u.sortCurrentDir() // redraw - } + u.Draw() u.s.Sync() + continue // don't draw again case *tcell.EventKey: var c rune if k := ev.Key(); k == tcell.KeyRune { @@ -1022,15 +1055,22 @@ outer: u.deleteSelected() case '?': u.togglePopupBox(helpText()) + case 'r': + // restart scan + rootChan, errChan, updated = u.scan() // Refresh the screen. Not obvious what key to map // this onto, but ^L is a common choice. case key(tcell.KeyCtrlL): + u.Draw() u.s.Sync() + continue // don't draw again } } } - // listen to key presses, etc. + + u.Draw() + u.s.Show() } return nil } diff --git a/cmd/nfsmount/nfsmount.go b/cmd/nfsmount/nfsmount.go new file mode 100644 index 0000000000000..755197fa242e9 --- /dev/null +++ b/cmd/nfsmount/nfsmount.go @@ -0,0 +1,69 @@ +//go:build darwin && !cmount +// +build darwin,!cmount + +// Package nfsmount implements mounting functionality using serve nfs command +// +// NFS mount is only needed for macOS since it has no +// support for FUSE-based file systems +package nfsmount + +import ( + "context" + "fmt" + "net" + "os/exec" + "runtime" + "strings" + + "github.com/rclone/rclone/cmd/mountlib" + "github.com/rclone/rclone/cmd/serve/nfs" + "github.com/rclone/rclone/vfs" +) + +func init() { + cmd := mountlib.NewMountCommand("mount", false, mount) + cmd.Aliases = append(cmd.Aliases, "nfsmount") + mountlib.AddRc("nfsmount", mount) +} + +func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors <-chan error, unmount func() error, err error) { + s, err := nfs.NewServer(context.Background(), VFS, &nfs.Options{}) + if err != nil { + return + } + errChan := make(chan error, 1) + go func() { + errChan <- s.Serve() + }() + // The port is always picked at random after the NFS server has started + // we need to query the server for the port number so we can mount it + _, port, err := net.SplitHostPort(s.Addr().String()) + if err != nil { + err = fmt.Errorf("cannot find port number in %s", s.Addr().String()) + return + } + optionsString := strings.Join(opt.ExtraOptions, ",") + err = exec.Command("mount", fmt.Sprintf("-oport=%s,mountport=%s,%s", port, port, optionsString), "localhost:", mountpoint).Run() + if err != nil { + err = fmt.Errorf("failed to mount NFS volume %e", err) + return + } + asyncerrors = errChan + unmount = func() error { + var umountErr error + if runtime.GOOS == "darwin" { + umountErr = exec.Command("diskutil", "umount", "force", mountpoint).Run() + } else { + umountErr = exec.Command("umount", "-f", mountpoint).Run() + } + shutdownErr := s.Shutdown() + VFS.Shutdown() + if umountErr != nil { + return fmt.Errorf("failed to umount the NFS volume %e", umountErr) + } else if shutdownErr != nil { + return fmt.Errorf("failed to shutdown NFS server: %e", shutdownErr) + } + return nil + } + return +} diff --git a/cmd/nfsmount/nfsmount_test.go b/cmd/nfsmount/nfsmount_test.go new file mode 100644 index 0000000000000..d4c9c34417c0c --- /dev/null +++ b/cmd/nfsmount/nfsmount_test.go @@ -0,0 +1,15 @@ +//go:build darwin && !cmount +// +build darwin,!cmount + +package nfsmount + +import ( + "testing" + + "github.com/rclone/rclone/vfs/vfscommon" + "github.com/rclone/rclone/vfs/vfstest" +) + +func TestMount(t *testing.T) { + vfstest.RunTests(t, false, vfscommon.CacheModeMinimal, false, mount) +} diff --git a/cmd/nfsmount/nfsmount_unsupported.go b/cmd/nfsmount/nfsmount_unsupported.go new file mode 100644 index 0000000000000..d24115837015e --- /dev/null +++ b/cmd/nfsmount/nfsmount_unsupported.go @@ -0,0 +1,8 @@ +// Build for nfsmount for unsupported platforms to stop go complaining +// about "no buildable Go source files " + +//go:build !darwin || cmount +// +build !darwin cmount + +// Package nfsmount implements mount command using NFS, not needed on most platforms +package nfsmount diff --git a/cmd/progress.go b/cmd/progress.go index 56556db2e2b9e..fbdcd19a1ca90 100644 --- a/cmd/progress.go +++ b/cmd/progress.go @@ -20,7 +20,7 @@ const ( // interval between progress prints defaultProgressInterval = 500 * time.Millisecond // time format for logging - logTimeFormat = "2006-01-02 15:04:05" + logTimeFormat = "2006/01/02 15:04:05" ) // startProgress starts the progress bar printing @@ -75,14 +75,13 @@ func startProgress() func() { // state for the progress printing var ( - nlines = 0 // number of lines in the previous stats block - progressMu sync.Mutex + nlines = 0 // number of lines in the previous stats block ) // printProgress prints the progress with an optional log func printProgress(logMessage string) { - progressMu.Lock() - defer progressMu.Unlock() + operations.StdoutMutex.Lock() + defer operations.StdoutMutex.Unlock() var buf bytes.Buffer w, _ := terminal.GetSize() diff --git a/cmd/purge/purge.go b/cmd/purge/purge.go index d41e22cf67ab5..a8ddb3a6c5b6e 100644 --- a/cmd/purge/purge.go +++ b/cmd/purge/purge.go @@ -26,6 +26,9 @@ delete files. To delete empty directories only, use command **Important**: Since this can cause data loss, test first with the ` + "`--dry-run` or the `--interactive`/`-i`" + ` flag. `, + Annotations: map[string]string{ + "groups": "Important", + }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) fdst := cmd.NewFsDir(args) diff --git a/cmd/rc/rc.go b/cmd/rc/rc.go index 1276fc024b364..2c88d2914b1c1 100644 --- a/cmd/rc/rc.go +++ b/cmd/rc/rc.go @@ -36,14 +36,14 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &noOutput, "no-output", "", noOutput, "If set, don't output the JSON result") - flags.StringVarP(cmdFlags, &url, "url", "", url, "URL to connect to rclone remote control") - flags.StringVarP(cmdFlags, &jsonInput, "json", "", jsonInput, "Input JSON - use instead of key=value args") - flags.StringVarP(cmdFlags, &authUser, "user", "", "", "Username to use to rclone remote control") - flags.StringVarP(cmdFlags, &authPass, "pass", "", "", "Password to use to connect to rclone remote control") - flags.BoolVarP(cmdFlags, &loopback, "loopback", "", false, "If set connect to this rclone instance not via HTTP") - flags.StringArrayVarP(cmdFlags, &options, "opt", "o", options, "Option in the form name=value or name placed in the \"opt\" array") - flags.StringArrayVarP(cmdFlags, &arguments, "arg", "a", arguments, "Argument placed in the \"arg\" array") + flags.BoolVarP(cmdFlags, &noOutput, "no-output", "", noOutput, "If set, don't output the JSON result", "") + flags.StringVarP(cmdFlags, &url, "url", "", url, "URL to connect to rclone remote control", "") + flags.StringVarP(cmdFlags, &jsonInput, "json", "", jsonInput, "Input JSON - use instead of key=value args", "") + flags.StringVarP(cmdFlags, &authUser, "user", "", "", "Username to use to rclone remote control", "") + flags.StringVarP(cmdFlags, &authPass, "pass", "", "", "Password to use to connect to rclone remote control", "") + flags.BoolVarP(cmdFlags, &loopback, "loopback", "", false, "If set connect to this rclone instance not via HTTP", "") + flags.StringArrayVarP(cmdFlags, &options, "opt", "o", options, "Option in the form name=value or name placed in the \"opt\" array", "") + flags.StringArrayVarP(cmdFlags, &arguments, "arg", "a", arguments, "Argument placed in the \"arg\" array", "") } var commandDefinition = &cobra.Command{ @@ -168,6 +168,16 @@ func setAlternateFlag(flagName string, output *string) { } } +// Format an error and create a synthetic server return from it +func errorf(status int, path string, format string, arg ...any) (out rc.Params, err error) { + err = fmt.Errorf(format, arg...) + out = make(rc.Params) + out["error"] = err.Error() + out["path"] = path + out["status"] = status + return out, err +} + // do a call from (path, in) to (out, err). // // if err is set, out may be a valid error return or it may be nil @@ -176,16 +186,16 @@ func doCall(ctx context.Context, path string, in rc.Params) (out rc.Params, err if loopback { call := rc.Calls.Get(path) if call == nil { - return nil, fmt.Errorf("method %q not found", path) + return errorf(http.StatusBadRequest, path, "loopback: method %q not found", path) } _, out, err := jobs.NewJob(ctx, call.Fn, in) if err != nil { - return nil, fmt.Errorf("loopback call failed: %w", err) + return errorf(http.StatusInternalServerError, path, "loopback: call failed: %w", err) } // Reshape (serialize then deserialize) the data so it is in the form expected err = rc.Reshape(&out, out) if err != nil { - return nil, fmt.Errorf("loopback reshape failed: %w", err) + return errorf(http.StatusInternalServerError, path, "loopback: reshape failed: %w", err) } return out, nil } @@ -195,12 +205,12 @@ func doCall(ctx context.Context, path string, in rc.Params) (out rc.Params, err url += path data, err := json.Marshal(in) if err != nil { - return nil, fmt.Errorf("failed to encode JSON: %w", err) + return errorf(http.StatusBadRequest, path, "failed to encode request: %w", err) } req, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("failed to make request: %w", err) + return errorf(http.StatusInternalServerError, path, "failed to make request: %w", err) } req.Header.Set("Content-Type", "application/json") @@ -210,28 +220,24 @@ func doCall(ctx context.Context, path string, in rc.Params) (out rc.Params, err resp, err := client.Do(req) if err != nil { - return nil, fmt.Errorf("connection failed: %w", err) + return errorf(http.StatusServiceUnavailable, path, "connection failed: %w", err) } defer fs.CheckClose(resp.Body, &err) - if resp.StatusCode != http.StatusOK { - var body []byte - body, err = io.ReadAll(resp.Body) - var bodyString string - if err == nil { - bodyString = string(body) - } else { - bodyString = err.Error() - } - bodyString = strings.TrimSpace(bodyString) - return nil, fmt.Errorf("failed to read rc response: %s: %s", resp.Status, bodyString) + // Read response + var body []byte + var bodyString string + body, err = io.ReadAll(resp.Body) + bodyString = strings.TrimSpace(string(body)) + if err != nil { + return errorf(resp.StatusCode, "failed to read rc response: %s: %s", resp.Status, bodyString) } // Parse output out = make(rc.Params) - err = json.NewDecoder(resp.Body).Decode(&out) + err = json.NewDecoder(strings.NewReader(bodyString)).Decode(&out) if err != nil { - return nil, fmt.Errorf("failed to decode JSON: %w", err) + return errorf(resp.StatusCode, path, "failed to decode response: %w: %s", err, bodyString) } // Check we got 200 OK diff --git a/cmd/rcat/rcat.go b/cmd/rcat/rcat.go index c66fe465090ea..e352c6a1cf7dd 100644 --- a/cmd/rcat/rcat.go +++ b/cmd/rcat/rcat.go @@ -20,7 +20,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.Int64VarP(cmdFlags, &size, "size", "", size, "File size hint to preallocate") + flags.Int64VarP(cmdFlags, &size, "size", "", size, "File size hint to preallocate", "") } var commandDefinition = &cobra.Command{ @@ -52,12 +52,14 @@ and actually stream it, even if remote backend doesn't support streaming. size of the stream is different in length to the ` + "`--size`" + ` passed in then the transfer will likely fail. -Note that the upload can also not be retried because the data is -not kept around until the upload succeeds. If you need to transfer -a lot of data, you're better off caching locally and then -` + "`rclone move`" + ` it to the destination.`, +Note that the upload cannot be retried because the data is not stored. +If the backend supports multipart uploading then individual chunks can +be retried. If you need to transfer a lot of data, you may be better +off caching it locally and then ` + "`rclone move`" + ` it to the +destination which can use retries.`, Annotations: map[string]string{ "versionIntroduced": "v1.38", + "groups": "Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/rcd/rcd.go b/cmd/rcd/rcd.go index 818580f3ab43e..c023931f0359d 100644 --- a/cmd/rcd/rcd.go +++ b/cmd/rcd/rcd.go @@ -4,14 +4,12 @@ package rcd import ( "context" "log" - "sync" - sysdnotify "github.com/iguanesolutions/go-systemd/v5/notify" "github.com/rclone/rclone/cmd" "github.com/rclone/rclone/fs/rc/rcflags" "github.com/rclone/rclone/fs/rc/rcserver" - "github.com/rclone/rclone/lib/atexit" libhttp "github.com/rclone/rclone/lib/http" + "github.com/rclone/rclone/lib/systemd" "github.com/spf13/cobra" ) @@ -32,9 +30,10 @@ for GET requests on the URL passed in. It will also open the URL in the browser when rclone is run. See the [rc documentation](/rc/) for more info on the rc flags. -` + libhttp.Help + libhttp.TemplateHelp + libhttp.AuthHelp, +` + libhttp.Help(rcflags.FlagPrefix) + libhttp.TemplateHelp(rcflags.FlagPrefix) + libhttp.AuthHelp(rcflags.FlagPrefix), Annotations: map[string]string{ "versionIntroduced": "v1.45", + "groups": "RC", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(0, 1, command, args) @@ -57,21 +56,8 @@ See the [rc documentation](/rc/) for more info on the rc flags. } // Notify stopping on exit - var finaliseOnce sync.Once - finalise := func() { - finaliseOnce.Do(func() { - _ = sysdnotify.Stopping() - }) - } - fnHandle := atexit.Register(finalise) - defer atexit.Unregister(fnHandle) - - // Notify ready to systemd - if err := sysdnotify.Ready(); err != nil { - log.Fatalf("failed to notify ready to systemd: %v", err) - } + defer systemd.Notify()() s.Wait() - finalise() }, } diff --git a/cmd/rmdir/rmdir.go b/cmd/rmdir/rmdir.go index 778315be83e0a..00f77036660a2 100644 --- a/cmd/rmdir/rmdir.go +++ b/cmd/rmdir/rmdir.go @@ -24,6 +24,9 @@ with option ` + "`--rmdirs`" + `) to do that. To delete a path and any objects in it, use [purge](/commands/rclone_purge/) command. `, + Annotations: map[string]string{ + "groups": "Important", + }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) fdst := cmd.NewFsDir(args) diff --git a/cmd/rmdirs/rmdirs.go b/cmd/rmdirs/rmdirs.go index 62711dea40a25..470f34ff5b5fd 100644 --- a/cmd/rmdirs/rmdirs.go +++ b/cmd/rmdirs/rmdirs.go @@ -35,11 +35,15 @@ empty directories in. For example the [delete](/commands/rclone_delete/) command will delete files but leave the directory structure (unless used with option ` + "`--rmdirs`" + `). -To delete a path and any objects in it, use [purge](/commands/rclone_purge/) +This will delete ` + "`--checkers`" + ` directories concurrently so +if you have thousands of empty directories consider increasing this number. + +To delete a path and any objects in it, use the [purge](/commands/rclone_purge/) command. `, Annotations: map[string]string{ "versionIntroduced": "v1.35", + "groups": "Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/selfupdate/selfupdate.go b/cmd/selfupdate/selfupdate.go index 184710cb3ca3c..5adf9a4b8e908 100644 --- a/cmd/selfupdate/selfupdate.go +++ b/cmd/selfupdate/selfupdate.go @@ -10,6 +10,7 @@ import ( "bytes" "context" "crypto/sha256" + _ "embed" "encoding/hex" "errors" "fmt" @@ -35,6 +36,9 @@ import ( versionCmd "github.com/rclone/rclone/cmd/version" ) +//go:embed selfupdate.md +var selfUpdateHelp string + // Options contains options for the self-update command type Options struct { Check bool @@ -51,30 +55,31 @@ var Opt = Options{} func init() { cmd.Root.AddCommand(cmdSelfUpdate) cmdFlags := cmdSelfUpdate.Flags() - flags.BoolVarP(cmdFlags, &Opt.Check, "check", "", Opt.Check, "Check for latest release, do not download") - flags.StringVarP(cmdFlags, &Opt.Output, "output", "", Opt.Output, "Save the downloaded binary at a given path (default: replace running binary)") - flags.BoolVarP(cmdFlags, &Opt.Stable, "stable", "", Opt.Stable, "Install stable release (this is the default)") - flags.BoolVarP(cmdFlags, &Opt.Beta, "beta", "", Opt.Beta, "Install beta release") - flags.StringVarP(cmdFlags, &Opt.Version, "version", "", Opt.Version, "Install the given rclone version (default: latest)") - flags.StringVarP(cmdFlags, &Opt.Package, "package", "", Opt.Package, "Package format: zip|deb|rpm (default: zip)") + flags.BoolVarP(cmdFlags, &Opt.Check, "check", "", Opt.Check, "Check for latest release, do not download", "") + flags.StringVarP(cmdFlags, &Opt.Output, "output", "", Opt.Output, "Save the downloaded binary at a given path (default: replace running binary)", "") + flags.BoolVarP(cmdFlags, &Opt.Stable, "stable", "", Opt.Stable, "Install stable release (this is the default)", "") + flags.BoolVarP(cmdFlags, &Opt.Beta, "beta", "", Opt.Beta, "Install beta release", "") + flags.StringVarP(cmdFlags, &Opt.Version, "version", "", Opt.Version, "Install the given rclone version (default: latest)", "") + flags.StringVarP(cmdFlags, &Opt.Package, "package", "", Opt.Package, "Package format: zip|deb|rpm (default: zip)", "") } var cmdSelfUpdate = &cobra.Command{ Use: "selfupdate", Aliases: []string{"self-update"}, Short: `Update the rclone binary.`, - Long: strings.ReplaceAll(selfUpdateHelp, "|", "`"), + Long: selfUpdateHelp, Annotations: map[string]string{ "versionIntroduced": "v1.55", }, Run: func(command *cobra.Command, args []string) { + ctx := context.Background() cmd.CheckArgs(0, 0, command, args) if Opt.Package == "" { Opt.Package = "zip" } gotActionFlags := Opt.Stable || Opt.Beta || Opt.Output != "" || Opt.Version != "" || Opt.Package != "zip" if Opt.Check && !gotActionFlags { - versionCmd.CheckVersion() + versionCmd.CheckVersion(ctx) return } if Opt.Package != "zip" { @@ -108,7 +113,7 @@ func GetVersion(ctx context.Context, beta bool, version string) (newVersion, sit if version == "" { // Request the latest release number from the download site - _, newVersion, _, err = versionCmd.GetVersion(siteURL + "/version.txt") + _, newVersion, _, err = versionCmd.GetVersion(ctx, siteURL+"/version.txt") return } diff --git a/cmd/selfupdate/help.go b/cmd/selfupdate/selfupdate.md similarity index 52% rename from cmd/selfupdate/help.go rename to cmd/selfupdate/selfupdate.md index d3044bb113cbe..73a0066620cd5 100644 --- a/cmd/selfupdate/help.go +++ b/cmd/selfupdate/selfupdate.md @@ -1,54 +1,47 @@ -//go:build !noselfupdate -// +build !noselfupdate +This command downloads the latest release of rclone and replaces the +currently running binary. The download is verified with a hashsum and +cryptographically signed signature; see [the release signing +docs](/release_signing/) for details. -package selfupdate - -// Note: "|" will be replaced by backticks in the help string below -var selfUpdateHelp = ` -This command downloads the latest release of rclone and replaces -the currently running binary. The download is verified with a hashsum -and cryptographically signed signature. - -If used without flags (or with implied |--stable| flag), this command +If used without flags (or with implied `--stable` flag), this command will install the latest stable release. However, some issues may be fixed (or features added) only in the latest beta release. In such cases you should -run the command with the |--beta| flag, i.e. |rclone selfupdate --beta|. +run the command with the `--beta` flag, i.e. `rclone selfupdate --beta`. You can check in advance what version would be installed by adding the -|--check| flag, then repeat the command without it when you are satisfied. +`--check` flag, then repeat the command without it when you are satisfied. Sometimes the rclone team may recommend you a concrete beta or stable rclone release to troubleshoot your issue or add a bleeding edge feature. -The |--version VER| flag, if given, will update to the concrete version -instead of the latest one. If you omit micro version from |VER| (for -example |1.53|), the latest matching micro version will be used. +The `--version VER` flag, if given, will update to the concrete version +instead of the latest one. If you omit micro version from `VER` (for +example `1.53`), the latest matching micro version will be used. Upon successful update rclone will print a message that contains a previous version number. You will need it if you later decide to revert your update for some reason. Then you'll have to note the previous version and run the -following command: |rclone selfupdate [--beta] OLDVER|. -If the old version contains only dots and digits (for example |v1.54.0|) -then it's a stable release so you won't need the |--beta| flag. Beta releases -have an additional information similar to |v1.54.0-beta.5111.06f1c0c61|. +following command: `rclone selfupdate [--beta] OLDVER`. +If the old version contains only dots and digits (for example `v1.54.0`) +then it's a stable release so you won't need the `--beta` flag. Beta releases +have an additional information similar to `v1.54.0-beta.5111.06f1c0c61`. (if you are a developer and use a locally built rclone, the version number -will end with |-DEV|, you will have to rebuild it as it obviously can't +will end with `-DEV`, you will have to rebuild it as it obviously can't be distributed). If you previously installed rclone via a package manager, the package may include local documentation or configure services. You may wish to update -with the flag |--package deb| or |--package rpm| (whichever is correct for -your OS) to update these too. This command with the default |--package zip| +with the flag `--package deb` or `--package rpm` (whichever is correct for +your OS) to update these too. This command with the default `--package zip` will update only the rclone executable so the local manual may become inaccurate after it. -The |rclone mount| command (https://rclone.org/commands/rclone_mount/) may +The [rclone mount](/commands/rclone_mount/) command may or may not support extended FUSE options depending on the build and OS. -|selfupdate| will refuse to update if the capability would be discarded. +`selfupdate` will refuse to update if the capability would be discarded. Note: Windows forbids deletion of a currently running executable so this command will rename the old executable to 'rclone.old.exe' upon success. Please note that this command was not available before rclone version 1.55. -If it fails for you with the message |unknown command "selfupdate"| then +If it fails for you with the message `unknown command "selfupdate"` then you will need to update manually following the install instructions located at https://rclone.org/install/ -` diff --git a/cmd/selfupdate/selfupdate_test.go b/cmd/selfupdate/selfupdate_test.go index 9c02f458412ac..92d1d91c79005 100644 --- a/cmd/selfupdate/selfupdate_test.go +++ b/cmd/selfupdate/selfupdate_test.go @@ -14,6 +14,7 @@ import ( "time" "github.com/rclone/rclone/fs" + _ "github.com/rclone/rclone/fstest" // needed to run under integration tests "github.com/rclone/rclone/fstest/testy" "github.com/stretchr/testify/assert" ) diff --git a/cmd/selfupdate/testdata/verify/SHA256SUMS b/cmd/selfupdate/testdata/verify/SHA256SUMS new file mode 100644 index 0000000000000..8a2df1e6a0606 --- /dev/null +++ b/cmd/selfupdate/testdata/verify/SHA256SUMS @@ -0,0 +1,10 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +b20b47f579a2c790ca752fb5d8e5651fade7d5867cbac0a4f71e805fc5c468d0 archive.zip +-----BEGIN PGP SIGNATURE----- + +iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZS+oVQAKCRCTk14C/ztU ++lNsAJ9XRiODlM4fIW9yqiltO3N+lLeucwCfRzD3cXk6BCB5wdz7pTgnItk9N74= +=1GTr +-----END PGP SIGNATURE----- diff --git a/cmd/selfupdate/testdata/verify/archive.zip b/cmd/selfupdate/testdata/verify/archive.zip new file mode 100644 index 0000000000000..c2ecc6aecf550 Binary files /dev/null and b/cmd/selfupdate/testdata/verify/archive.zip differ diff --git a/cmd/selfupdate/verify.go b/cmd/selfupdate/verify.go index 503bbd7f6368d..7c3d76df61131 100644 --- a/cmd/selfupdate/verify.go +++ b/cmd/selfupdate/verify.go @@ -26,24 +26,37 @@ QbogRGodbKhqY4v+cMNkKiemBuTQiWPkpKjifwNsD1fNjNKfDP3pJ64Yz7a4fuzV X1YwBACpKVuEen34lmcX6ziY4jq8rKibKBs4JjQCRO24kYoHDULVe+RS9krQWY5b e0foDhru4dsKccefK099G+WEzKVCKxupstWkTT/iJwajR8mIqd4AhD0wO9W3MCfV Ov8ykMDZ7qBWk1DHc87Ep3W1o8t8wq74ifV+HjhhWg8QAylXg7QlTmljayBDcmFp -Zy1Xb29kIDxuaWNrQGNyYWlnLXdvb2QuY29tPohxBBMRCAAxBQsHCgMEAxUDAgMW -AgECF4AWIQT79zfs6firGGBL0qyTk14C/ztU+gUCXjg2UgIZAQAKCRCTk14C/ztU -+lmmAJ4jH5FyULzStjisuTvHLTVz6G44eQCfaR5QGZFPseenE5ic2WeQcBcmtoG5 -Ag0EO7LdgRAIAI6QdFBg3/xa1gFKPYy1ihV9eSdGqwWZGJvokWsfCvHy5180tj/v -UNOLAJrdqglMSvevNTXe8bT65D6423AAsLhch9wq/aNqrHolTYABzxRigjcS1//T -yln5naGUzlVQXDVfrDk3Md/NrkdOFj7r/YyMF0+iWwpFz2qAjL95i5wfVZ1kWGrT -2AmivE1wD1sWT/Ja3FDI0NRkU0Nbz/a0TKe4ml8iLVtZXpTRbxxCCPdkHXXgSyu1 -eZ4NrF/wTJuvwGn12TJ1EF95aVkHxAUw0+KmLGdcyBG+IKuHamrsjWIAXGXV///K -AxPgUthccQ03HMjltFsrdmen5Q034YM3eOsAAwUH/jAKiIAA8LpZmZPnt9GZ4+Ol -Zp22VAfyfDOFl4Ol+cWjkLAgjAFsm5gnOKcRSE/9XPxnQqkhw7+ZygYuUMgTDJ99 -/5IM1UQL3ooS+oFrDaE99S8bLeOe17skcdXcA/K83VqD9m93rQRnbtD+75zqKkZn -9WNFyKCXg5P6PFPdNYRtlQKOcwFR9mHRLUmapQSAM8Y2pCgALZ7GViKQca8/TT1T -gZk9fJMZYGez+IlOPxTJxjn80+vywk4/wdIWSiQj+8u5RzT9sjmm77wbMVNGRqYd -W/EemW9Zz9vi0CIvJGgbPMqcuxw8e/5lnuQ6Mi3uDR0P2RNIAhFrdZpVSME8xQaI -RgQYEQIABgUCO7LdgQAKCRCTk14C/ztU+mLBAKC2cdFy7eLaQAvyzcE2VK6HVIjn -JACguA00bxLQuJ4+RCJrLFZP8ZlN2sc= -=TtR5 ------END PGP PUBLIC KEY BLOCK-----` +Zy1Xb29kIDxuaWNrQGNyYWlnLXdvb2QuY29tPoh0BBMRCAA0BQsHCgMEAxUDAgMW +AgECF4ACGQEWIQT79zfs6firGGBL0qyTk14C/ztU+gUCZS/mXAIbIwAKCRCTk14C +/ztU+tX+AJ9CUAnPvT4w5yRAPRfDiwWIPUqBOgCgiTelkzvUxvLWnYmpowwzKmsx +qaSJAjMEEAEIAB0WIQTjs1jchY+zB/SBcLnLDb68XzLIHQUCZPRnNAAKCRDLDb68 +XzLIHZSAD/oCk9Z0xJfbpriphTBxFy7bWyPKF1lM1GZZaLKkktGfunf1i0Q7rhwp +Nu+u1launlOTp6ZoY36Ce2Qa1eSxWAQdjVajw9kOHXCAewrTREOMY/mb7RVGjajo +0Egl8T9iD3JRyaxu2iVtbpZYuqehtGG28CaCzmtqE+EJcx1cGqAGSuuaDWRYlVX8 +KDip44GQB5Lut30vwSIoZG1CPCR6VE82u4cl3mYZUfcJkCHsiLzoeadVzb+fOd+2 +ybzBn8Y77ifGgM+dSFSHe03mFfcHPdp0QImF9HQR7XI0UMZmEJsw7c2vDrRa+kRY +2A4/amGn4Tahuazq8g2yqgGm3yAj49qGNarAau849lDr7R49j73ESnNVBGJ9ShzU +4Ls+S1A5gohZVu2s1fkE3mbAmoTfU4JCrpRydOuL9xRJk5gbL44sKeuGODNshyTP +JzG9DmRHpLsBn59v8mg5tqSfBIGqcqBxxnYHJnkK801MkaLW2m7wDmtz6P3TW86g +GukzfIN3/OufLjnpN3Nx376JwWDDIyif7sn6/q+ZMwGz9uLKZkAeM5c3Dh4ygpgl +iSLoV2bZzDz0iLxKWW7QOVVdWHmlEqbTldpQ7gUEPG7mxpzVo0xd6nHncSq0M91x +29It4B3fATx/iJB2eardMzSsbzHiwTg0eswhYYGpSKZLgp4RShnVAbkCDQQ7st2B +EAgAjpB0UGDf/FrWAUo9jLWKFX15J0arBZkYm+iRax8K8fLnXzS2P+9Q04sAmt2q +CUxK9681Nd7xtPrkPrjbcACwuFyH3Cr9o2qseiVNgAHPFGKCNxLX/9PKWfmdoZTO +VVBcNV+sOTcx382uR04WPuv9jIwXT6JbCkXPaoCMv3mLnB9VnWRYatPYCaK8TXAP +WxZP8lrcUMjQ1GRTQ1vP9rRMp7iaXyItW1lelNFvHEII92QddeBLK7V5ng2sX/BM +m6/AafXZMnUQX3lpWQfEBTDT4qYsZ1zIEb4gq4dqauyNYgBcZdX//8oDE+BS2Fxx +DTccyOW0Wyt2Z6flDTfhgzd46wADBQf+MAqIgADwulmZk+e30Znj46VmnbZUB/J8 +M4WXg6X5xaOQsCCMAWybmCc4pxFIT/1c/GdCqSHDv5nKBi5QyBMMn33/kgzVRAve +ihL6gWsNoT31Lxst457XuyRx1dwD8rzdWoP2b3etBGdu0P7vnOoqRmf1Y0XIoJeD +k/o8U901hG2VAo5zAVH2YdEtSZqlBIAzxjakKAAtnsZWIpBxrz9NPVOBmT18kxlg +Z7P4iU4/FMnGOfzT6/LCTj/B0hZKJCP7y7lHNP2yOabvvBsxU0ZGph1b8R6Zb1nP +2+LQIi8kaBs8ypy7HDx7/mWe5DoyLe4NHQ/ZE0gCEWt1mlVIwTzFBohGBBgRAgAG +BQI7st2BAAoJEJOTXgL/O1T6YsEAoLZx0XLt4tpAC/LNwTZUrodUiOckAKC4DTRv +EtC4nj5EImssVk/xmU3axw== +=VUqh +-----END PGP PUBLIC KEY BLOCK----- +` func verifyHashsum(ctx context.Context, siteURL, version, archive string, hash []byte) error { sumsURL := fmt.Sprintf("%s/%s/SHA256SUMS", siteURL, version) @@ -52,16 +65,26 @@ func verifyHashsum(ctx context.Context, siteURL, version, archive string, hash [ return err } fs.Debugf(nil, "downloaded hashsum list: %s", sumsURL) + return verifyHashsumDownloaded(ctx, sumsBuf, archive, hash) +} +func verifyHashsumDownloaded(ctx context.Context, sumsBuf []byte, archive string, hash []byte) error { keyRing, err := openpgp.ReadArmoredKeyRing(strings.NewReader(ncwPublicKeyPGP)) if err != nil { - return errors.New("unsupported signing key") + return fmt.Errorf("unsupported signing key: %w", err) } + block, rest := clearsign.Decode(sumsBuf) - // block.Bytes = block.Bytes[1:] // uncomment to test invalid signature + if block == nil { + return errors.New("invalid hashsum signature: couldn't find detached signature") + } + if len(rest) > 0 { + return fmt.Errorf("invalid hashsum signature: %d bytes of unsigned data", len(rest)) + } + _, err = openpgp.CheckDetachedSignature(keyRing, bytes.NewReader(block.Bytes), block.ArmoredSignature.Body, nil) - if err != nil || len(rest) > 0 { - return errors.New("invalid hashsum signature") + if err != nil { + return fmt.Errorf("invalid hashsum signature: %w", err) } wantHash, err := findFileHash(sumsBuf, archive) diff --git a/cmd/selfupdate/verify_test.go b/cmd/selfupdate/verify_test.go new file mode 100644 index 0000000000000..bf3e7754db10d --- /dev/null +++ b/cmd/selfupdate/verify_test.go @@ -0,0 +1,43 @@ +//go:build !noselfupdate +// +build !noselfupdate + +package selfupdate + +import ( + "context" + "encoding/hex" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestVerify(t *testing.T) { + ctx := context.Background() + sumsBuf, err := os.ReadFile("testdata/verify/SHA256SUMS") + require.NoError(t, err) + hash, err := hex.DecodeString("b20b47f579a2c790ca752fb5d8e5651fade7d5867cbac0a4f71e805fc5c468d0") + require.NoError(t, err) + + t.Run("NoError", func(t *testing.T) { + err = verifyHashsumDownloaded(ctx, sumsBuf, "archive.zip", hash) + require.NoError(t, err) + }) + t.Run("BadSig", func(t *testing.T) { + sumsBuf[0x60] ^= 1 // change the signature by one bit + err = verifyHashsumDownloaded(ctx, sumsBuf, "archive.zip", hash) + assert.ErrorContains(t, err, "invalid signature") + sumsBuf[0x60] ^= 1 // undo the change + }) + t.Run("BadSum", func(t *testing.T) { + hash[0] ^= 1 // change the SHA256 by one bit + err = verifyHashsumDownloaded(ctx, sumsBuf, "archive.zip", hash) + assert.ErrorContains(t, err, "archive hash mismatch") + hash[0] ^= 1 // undo the change + }) + t.Run("BadName", func(t *testing.T) { + err = verifyHashsumDownloaded(ctx, sumsBuf, "archive.zipX", hash) + assert.ErrorContains(t, err, "unable to find hash") + }) +} diff --git a/cmd/serve/dlna/cds.go b/cmd/serve/dlna/cds.go index f7cd77d1ff683..72fcceeab5850 100644 --- a/cmd/serve/dlna/cds.go +++ b/cmd/serve/dlna/cds.go @@ -60,6 +60,11 @@ func (cds *contentDirectoryService) cdsObjectToUpnpavObject(cdsObject object, fi var mimeType string if o, ok := fileInfo.DirEntry().(fs.Object); ok { mimeType = fs.MimeType(context.TODO(), o) + // If backend doesn't know what the mime type is then + // try getting it from the file name + if mimeType == "application/octet-stream" { + mimeType = fs.MimeTypeFromName(fileInfo.Name()) + } } else { mimeType = fs.MimeTypeFromName(fileInfo.Name()) } diff --git a/cmd/serve/dlna/dlna.go b/cmd/serve/dlna/dlna.go index 19db02f16ae88..1a2a779149259 100644 --- a/cmd/serve/dlna/dlna.go +++ b/cmd/serve/dlna/dlna.go @@ -22,6 +22,7 @@ import ( "github.com/rclone/rclone/cmd/serve/dlna/data" "github.com/rclone/rclone/cmd/serve/dlna/dlnaflags" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/lib/systemd" "github.com/rclone/rclone/vfs" "github.com/rclone/rclone/vfs/vfsflags" "github.com/spf13/cobra" @@ -50,6 +51,7 @@ files that they are not able to play back correctly. ` + dlnaflags.Help + vfs.Help, Annotations: map[string]string{ "versionIntroduced": "v1.46", + "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) @@ -63,6 +65,7 @@ files that they are not able to play back correctly. if err := s.Serve(); err != nil { return err } + defer systemd.Notify()() s.Wait() return nil }) @@ -126,11 +129,10 @@ func newServer(f fs.Fs, opt *dlnaflags.Options) (*server, error) { FriendlyName: friendlyName, RootDeviceUUID: makeDeviceUUID(friendlyName), Interfaces: interfaces, - - httpListenAddr: opt.ListenAddr, - - f: f, - vfs: vfs.New(f, &vfsflags.Opt), + waitChan: make(chan struct{}), + httpListenAddr: opt.ListenAddr, + f: f, + vfs: vfs.New(f, &vfsflags.Opt), } s.services = map[string]UPnPService{ @@ -303,7 +305,7 @@ func (s *server) Serve() (err error) { go func() { fs.Logf(s.f, "Serving HTTP on %s", s.HTTPConn.Addr().String()) - err = s.serveHTTP() + err := s.serveHTTP() if err != nil { fs.Logf(s.f, "Error on serving HTTP server: %v", err) } diff --git a/cmd/serve/dlna/dlnaflags/dlnaflags.go b/cmd/serve/dlna/dlnaflags/dlnaflags.go index 10745474c4d8c..8b2f393041713 100644 --- a/cmd/serve/dlna/dlnaflags/dlnaflags.go +++ b/cmd/serve/dlna/dlnaflags/dlnaflags.go @@ -49,11 +49,11 @@ var ( func addFlagsPrefix(flagSet *pflag.FlagSet, prefix string, Opt *Options) { rc.AddOption("dlna", &Opt) - flags.StringVarP(flagSet, &Opt.ListenAddr, prefix+"addr", "", Opt.ListenAddr, "The ip:port or :port to bind the DLNA http server to") - flags.StringVarP(flagSet, &Opt.FriendlyName, prefix+"name", "", Opt.FriendlyName, "Name of DLNA server") - flags.BoolVarP(flagSet, &Opt.LogTrace, prefix+"log-trace", "", Opt.LogTrace, "Enable trace logging of SOAP traffic") - flags.StringArrayVarP(flagSet, &Opt.InterfaceNames, prefix+"interface", "", Opt.InterfaceNames, "The interface to use for SSDP (repeat as necessary)") - flags.DurationVarP(flagSet, &Opt.AnnounceInterval, prefix+"announce-interval", "", Opt.AnnounceInterval, "The interval between SSDP announcements") + flags.StringVarP(flagSet, &Opt.ListenAddr, prefix+"addr", "", Opt.ListenAddr, "The ip:port or :port to bind the DLNA http server to", prefix) + flags.StringVarP(flagSet, &Opt.FriendlyName, prefix+"name", "", Opt.FriendlyName, "Name of DLNA server", prefix) + flags.BoolVarP(flagSet, &Opt.LogTrace, prefix+"log-trace", "", Opt.LogTrace, "Enable trace logging of SOAP traffic", prefix) + flags.StringArrayVarP(flagSet, &Opt.InterfaceNames, prefix+"interface", "", Opt.InterfaceNames, "The interface to use for SSDP (repeat as necessary)", prefix) + flags.DurationVarP(flagSet, &Opt.AnnounceInterval, prefix+"announce-interval", "", Opt.AnnounceInterval, "The interval between SSDP announcements", prefix) } // AddFlags add the command line flags for DLNA serving. diff --git a/cmd/serve/docker/docker.go b/cmd/serve/docker/docker.go index d160558651e2a..9493f740792cd 100644 --- a/cmd/serve/docker/docker.go +++ b/cmd/serve/docker/docker.go @@ -3,8 +3,8 @@ package docker import ( "context" + _ "embed" "path/filepath" - "strings" "syscall" "github.com/spf13/cobra" @@ -30,14 +30,17 @@ var ( noSpec = false ) +//go:embed docker.md +var longHelp string + func init() { cmdFlags := Command.Flags() // Add command specific flags - flags.StringVarP(cmdFlags, &baseDir, "base-dir", "", baseDir, "Base directory for volumes") - flags.StringVarP(cmdFlags, &socketAddr, "socket-addr", "", socketAddr, "Address or absolute path (default: /run/docker/plugins/rclone.sock)") - flags.IntVarP(cmdFlags, &socketGid, "socket-gid", "", socketGid, "GID for unix socket (default: current process GID)") - flags.BoolVarP(cmdFlags, &forgetState, "forget-state", "", forgetState, "Skip restoring previous state") - flags.BoolVarP(cmdFlags, &noSpec, "no-spec", "", noSpec, "Do not write spec file") + flags.StringVarP(cmdFlags, &baseDir, "base-dir", "", baseDir, "Base directory for volumes", "") + flags.StringVarP(cmdFlags, &socketAddr, "socket-addr", "", socketAddr, "Address or absolute path (default: /run/docker/plugins/rclone.sock)", "") + flags.IntVarP(cmdFlags, &socketGid, "socket-gid", "", socketGid, "GID for unix socket (default: current process GID)", "") + flags.BoolVarP(cmdFlags, &forgetState, "forget-state", "", forgetState, "Skip restoring previous state", "") + flags.BoolVarP(cmdFlags, &noSpec, "no-spec", "", noSpec, "Do not write spec file", "") // Add common mount/vfs flags mountlib.AddFlags(cmdFlags) vfsflags.AddFlags(cmdFlags) @@ -47,9 +50,10 @@ func init() { var Command = &cobra.Command{ Use: "docker", Short: `Serve any remote on docker's volume plugin API.`, - Long: strings.ReplaceAll(longHelp, "|", "`") + vfs.Help, + Long: longHelp + vfs.Help, Annotations: map[string]string{ "versionIntroduced": "v1.56", + "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(0, 0, command, args) diff --git a/cmd/serve/docker/help.go b/cmd/serve/docker/docker.md similarity index 67% rename from cmd/serve/docker/help.go rename to cmd/serve/docker/docker.md index 531213dd059f6..853f5f954004e 100644 --- a/cmd/serve/docker/help.go +++ b/cmd/serve/docker/docker.md @@ -1,7 +1,3 @@ -package docker - -// Note: "|" will be replaced by backticks -var longHelp = ` This command implements the Docker volume plugin API allowing docker to use rclone as a data storage mechanism for various cloud providers. rclone provides [docker volume plugin](/docker) based on it. @@ -12,32 +8,31 @@ docker daemon and runs the corresponding code when necessary. Docker plugins can run as a managed plugin under control of the docker daemon or as an independent native service. For testing, you can just run it directly from the command line, for example: -||| +``` sudo rclone serve docker --base-dir /tmp/rclone-volumes --socket-addr localhost:8787 -vv -||| +``` -Running |rclone serve docker| will create the said socket, listening for +Running `rclone serve docker` will create the said socket, listening for commands from Docker to create the necessary Volumes. Normally you need not -give the |--socket-addr| flag. The API will listen on the unix domain socket -at |/run/docker/plugins/rclone.sock|. In the example above rclone will create -a TCP socket and a small file |/etc/docker/plugins/rclone.spec| containing -the socket address. We use |sudo| because both paths are writeable only by +give the `--socket-addr` flag. The API will listen on the unix domain socket +at `/run/docker/plugins/rclone.sock`. In the example above rclone will create +a TCP socket and a small file `/etc/docker/plugins/rclone.spec` containing +the socket address. We use `sudo` because both paths are writeable only by the root user. If you later decide to change listening socket, the docker daemon must be -restarted to reconnect to |/run/docker/plugins/rclone.sock| -or parse new |/etc/docker/plugins/rclone.spec|. Until you restart, any +restarted to reconnect to `/run/docker/plugins/rclone.sock` +or parse new `/etc/docker/plugins/rclone.spec`. Until you restart, any volume related docker commands will timeout trying to access the old socket. Running directly is supported on **Linux only**, not on Windows or MacOS. This is not a problem with managed plugin mode described in details in the [full documentation](https://rclone.org/docker). -The command will create volume mounts under the path given by |--base-dir| -(by default |/var/lib/docker-volumes/rclone| available only to root) -and maintain the JSON formatted file |docker-plugin.state| in the rclone cache +The command will create volume mounts under the path given by `--base-dir` +(by default `/var/lib/docker-volumes/rclone` available only to root) +and maintain the JSON formatted file `docker-plugin.state` in the rclone cache directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. -` diff --git a/cmd/serve/ftp/ftp.go b/cmd/serve/ftp/ftp.go index 28bd4325f5ed4..3c24c3583ccce 100644 --- a/cmd/serve/ftp/ftp.go +++ b/cmd/serve/ftp/ftp.go @@ -9,6 +9,7 @@ import ( "errors" "fmt" "io" + iofs "io/fs" "net" "os" "os/user" @@ -23,13 +24,14 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/config/obscure" "github.com/rclone/rclone/fs/log" "github.com/rclone/rclone/fs/rc" "github.com/rclone/rclone/vfs" "github.com/rclone/rclone/vfs/vfsflags" "github.com/spf13/cobra" "github.com/spf13/pflag" - ftp "goftp.io/server/core" + ftp "goftp.io/server/v2" ) // Options contains options for the http Server @@ -59,13 +61,13 @@ var Opt = DefaultOpt // AddFlags adds flags for ftp func AddFlags(flagSet *pflag.FlagSet) { rc.AddOption("ftp", &Opt) - flags.StringVarP(flagSet, &Opt.ListenAddr, "addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to") - flags.StringVarP(flagSet, &Opt.PublicIP, "public-ip", "", Opt.PublicIP, "Public IP address to advertise for passive connections") - flags.StringVarP(flagSet, &Opt.PassivePorts, "passive-port", "", Opt.PassivePorts, "Passive port range to use") - flags.StringVarP(flagSet, &Opt.BasicUser, "user", "", Opt.BasicUser, "User name for authentication") - flags.StringVarP(flagSet, &Opt.BasicPass, "pass", "", Opt.BasicPass, "Password for authentication (empty value allow every password)") - flags.StringVarP(flagSet, &Opt.TLSCert, "cert", "", Opt.TLSCert, "TLS PEM key (concatenation of certificate and CA certificate)") - flags.StringVarP(flagSet, &Opt.TLSKey, "key", "", Opt.TLSKey, "TLS PEM Private key") + flags.StringVarP(flagSet, &Opt.ListenAddr, "addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to", "") + flags.StringVarP(flagSet, &Opt.PublicIP, "public-ip", "", Opt.PublicIP, "Public IP address to advertise for passive connections", "") + flags.StringVarP(flagSet, &Opt.PassivePorts, "passive-port", "", Opt.PassivePorts, "Passive port range to use", "") + flags.StringVarP(flagSet, &Opt.BasicUser, "user", "", Opt.BasicUser, "User name for authentication", "") + flags.StringVarP(flagSet, &Opt.BasicPass, "pass", "", Opt.BasicPass, "Password for authentication (empty value allow every password)", "") + flags.StringVarP(flagSet, &Opt.TLSCert, "cert", "", Opt.TLSCert, "TLS PEM key (concatenation of certificate and CA certificate)", "") + flags.StringVarP(flagSet, &Opt.TLSKey, "key", "", Opt.TLSKey, "TLS PEM Private key", "") } func init() { @@ -101,6 +103,7 @@ You can set a single username and password with the --user and --pass flags. ` + vfs.Help + proxy.Help, Annotations: map[string]string{ "versionIntroduced": "v1.44", + "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { var f fs.Fs @@ -120,21 +123,23 @@ You can set a single username and password with the --user and --pass flags. }, } -// server contains everything to run the server -type server struct { - f fs.Fs - srv *ftp.Server - ctx context.Context // for global config - opt Options - vfs *vfs.VFS - proxy *proxy.Proxy - useTLS bool +// driver contains everything to run the driver for the FTP server +type driver struct { + f fs.Fs + srv *ftp.Server + ctx context.Context // for global config + opt Options + globalVFS *vfs.VFS // the VFS if not using auth proxy + proxy *proxy.Proxy // may be nil if not in use + useTLS bool + userPassMu sync.Mutex // to protect userPass + userPass map[string]string // cache of username => password when using vfs proxy } var passivePortsRe = regexp.MustCompile(`^\s*\d+\s*-\s*\d+\s*$`) // Make a new FTP to serve the remote -func newServer(ctx context.Context, f fs.Fs, opt *Options) (*server, error) { +func newServer(ctx context.Context, f fs.Fs, opt *Options) (*driver, error) { host, port, err := net.SplitHostPort(opt.ListenAddr) if err != nil { return nil, errors.New("failed to parse host:port") @@ -144,54 +149,59 @@ func newServer(ctx context.Context, f fs.Fs, opt *Options) (*server, error) { return nil, errors.New("failed to parse host:port") } - s := &server{ + d := &driver{ f: f, ctx: ctx, opt: *opt, } if proxyflags.Opt.AuthProxy != "" { - s.proxy = proxy.New(ctx, &proxyflags.Opt) + d.proxy = proxy.New(ctx, &proxyflags.Opt) + d.userPass = make(map[string]string, 16) } else { - s.vfs = vfs.New(f, &vfsflags.Opt) + d.globalVFS = vfs.New(f, &vfsflags.Opt) } - s.useTLS = s.opt.TLSKey != "" + d.useTLS = d.opt.TLSKey != "" // Check PassivePorts format since the server library doesn't! if !passivePortsRe.MatchString(opt.PassivePorts) { return nil, fmt.Errorf("invalid format for passive ports %q", opt.PassivePorts) } - ftpopt := &ftp.ServerOpts{ + ftpopt := &ftp.Options{ Name: "Rclone FTP Server", WelcomeMessage: "Welcome to Rclone " + fs.Version + " FTP Server", - Factory: s, // implemented by NewDriver method + Driver: d, Hostname: host, Port: portNum, PublicIP: opt.PublicIP, PassivePorts: opt.PassivePorts, - Auth: s, // implemented by CheckPasswd method + Auth: d, + Perm: ftp.NewSimplePerm("ftp", "ftp"), // fake user and group Logger: &Logger{}, - TLS: s.useTLS, - CertFile: s.opt.TLSCert, - KeyFile: s.opt.TLSKey, + TLS: d.useTLS, + CertFile: d.opt.TLSCert, + KeyFile: d.opt.TLSKey, //TODO implement a maximum of https://godoc.org/goftp.io/server#ServerOpts } - s.srv = ftp.NewServer(ftpopt) - return s, nil + d.srv, err = ftp.NewServer(ftpopt) + if err != nil { + return nil, fmt.Errorf("failed to create new FTP server: %w", err) + } + return d, nil } // serve runs the ftp server -func (s *server) serve() error { - fs.Logf(s.f, "Serving FTP on %s", s.srv.Hostname+":"+strconv.Itoa(s.srv.Port)) - return s.srv.ListenAndServe() +func (d *driver) serve() error { + fs.Logf(d.f, "Serving FTP on %s", d.srv.Hostname+":"+strconv.Itoa(d.srv.Port)) + return d.srv.ListenAndServe() } // close stops the ftp server // //lint:ignore U1000 unused when not building linux -func (s *server) close() error { - fs.Logf(s.f, "Stopping FTP on %s", s.srv.Hostname+":"+strconv.Itoa(s.srv.Port)) - return s.srv.Shutdown() +func (d *driver) close() error { + fs.Logf(d.f, "Stopping FTP on %s", d.srv.Hostname+":"+strconv.Itoa(d.srv.Port)) + return d.srv.Shutdown() } // Logger ftp logger output formatted message @@ -222,44 +232,26 @@ func (l *Logger) PrintResponse(sessionID string, code int, message string) { } // CheckPasswd handle auth based on configuration -// -// This is not used - the one in Driver should be called instead -func (s *server) CheckPasswd(user, pass string) (ok bool, err error) { - err = errors.New("internal error: server.CheckPasswd should never be called") - fs.Errorf(nil, "Error: %v", err) - return false, err -} - -// NewDriver starts a new session for each client connection -func (s *server) NewDriver() (ftp.Driver, error) { - log.Trace("", "Init driver")("") - d := &Driver{ - s: s, - vfs: s.vfs, // this can be nil if proxy set - } - return d, nil -} - -// Driver implementation of ftp server -type Driver struct { - s *server - vfs *vfs.VFS - lock sync.Mutex -} - -// CheckPasswd handle auth based on configuration -func (d *Driver) CheckPasswd(user, pass string) (ok bool, err error) { - s := d.s - if s.proxy != nil { - var VFS *vfs.VFS - VFS, _, err = s.proxy.Call(user, pass, false) +func (d *driver) CheckPasswd(sctx *ftp.Context, user, pass string) (ok bool, err error) { + if d.proxy != nil { + _, _, err = d.proxy.Call(user, pass, false) if err != nil { fs.Infof(nil, "proxy login failed: %v", err) return false, nil } - d.vfs = VFS + // Cache obscured password for later lookup. + // + // We don't cache the VFS directly in the driver as we want them + // to be expired and the auth proxy does that for us. + oPass, err := obscure.Obscure(pass) + if err != nil { + return false, err + } + d.userPassMu.Lock() + d.userPass[user] = oPass + d.userPassMu.Unlock() } else { - ok = s.opt.BasicUser == user && (s.opt.BasicPass == "" || s.opt.BasicPass == pass) + ok = d.opt.BasicUser == user && (d.opt.BasicPass == "" || d.opt.BasicPass == pass) if !ok { fs.Infof(nil, "login failed: bad credentials") return false, nil @@ -268,22 +260,52 @@ func (d *Driver) CheckPasswd(user, pass string) (ok bool, err error) { return true, nil } +// Get the VFS for this connection +func (d *driver) getVFS(sctx *ftp.Context) (VFS *vfs.VFS, err error) { + if d.proxy == nil { + // If no proxy always use the same VFS + return d.globalVFS, nil + } + user := sctx.Sess.LoginUser() + d.userPassMu.Lock() + oPass, ok := d.userPass[user] + d.userPassMu.Unlock() + if !ok { + return nil, fmt.Errorf("proxy user not logged in") + } + pass, err := obscure.Reveal(oPass) + if err != nil { + return nil, err + } + VFS, _, err = d.proxy.Call(user, pass, false) + if err != nil { + return nil, fmt.Errorf("proxy login failed: %w", err) + } + return VFS, nil +} + // Stat get information on file or folder -func (d *Driver) Stat(path string) (fi ftp.FileInfo, err error) { +func (d *driver) Stat(sctx *ftp.Context, path string) (fi iofs.FileInfo, err error) { defer log.Trace(path, "")("fi=%+v, err = %v", &fi, &err) - n, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) if err != nil { return nil, err } - return &FileInfo{n, n.Mode(), d.vfs.Opt.UID, d.vfs.Opt.GID}, err + n, err := VFS.Stat(path) + if err != nil { + return nil, err + } + return &FileInfo{n, n.Mode(), VFS.Opt.UID, VFS.Opt.GID}, err } // ChangeDir move current folder -func (d *Driver) ChangeDir(path string) (err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) ChangeDir(sctx *ftp.Context, path string) (err error) { defer log.Trace(path, "")("err = %v", &err) - n, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return err + } + n, err := VFS.Stat(path) if err != nil { return err } @@ -294,11 +316,13 @@ func (d *Driver) ChangeDir(path string) (err error) { } // ListDir list content of a folder -func (d *Driver) ListDir(path string, callback func(ftp.FileInfo) error) (err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) ListDir(sctx *ftp.Context, path string, callback func(iofs.FileInfo) error) (err error) { defer log.Trace(path, "")("err = %v", &err) - node, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return err + } + node, err := VFS.Stat(path) if err == vfs.ENOENT { return errors.New("directory not found") } else if err != nil { @@ -317,11 +341,11 @@ func (d *Driver) ListDir(path string, callback func(ftp.FileInfo) error) (err er // Account the transfer tr := accounting.GlobalStats().NewTransferRemoteSize(path, node.Size()) defer func() { - tr.Done(d.s.ctx, err) + tr.Done(d.ctx, err) }() for _, file := range dirEntries { - err = callback(&FileInfo{file, file.Mode(), d.vfs.Opt.UID, d.vfs.Opt.GID}) + err = callback(&FileInfo{file, file.Mode(), VFS.Opt.UID, VFS.Opt.GID}) if err != nil { return err } @@ -330,11 +354,13 @@ func (d *Driver) ListDir(path string, callback func(ftp.FileInfo) error) (err er } // DeleteDir delete a folder and his content -func (d *Driver) DeleteDir(path string) (err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) DeleteDir(sctx *ftp.Context, path string) (err error) { defer log.Trace(path, "")("err = %v", &err) - node, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return err + } + node, err := VFS.Stat(path) if err != nil { return err } @@ -349,11 +375,13 @@ func (d *Driver) DeleteDir(path string) (err error) { } // DeleteFile delete a file -func (d *Driver) DeleteFile(path string) (err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) DeleteFile(sctx *ftp.Context, path string) (err error) { defer log.Trace(path, "")("err = %v", &err) - node, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return err + } + node, err := VFS.Stat(path) if err != nil { return err } @@ -368,19 +396,23 @@ func (d *Driver) DeleteFile(path string) (err error) { } // Rename rename a file or folder -func (d *Driver) Rename(oldName, newName string) (err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) Rename(sctx *ftp.Context, oldName, newName string) (err error) { defer log.Trace(oldName, "newName=%q", newName)("err = %v", &err) - return d.vfs.Rename(oldName, newName) + VFS, err := d.getVFS(sctx) + if err != nil { + return err + } + return VFS.Rename(oldName, newName) } // MakeDir create a folder -func (d *Driver) MakeDir(path string) (err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) MakeDir(sctx *ftp.Context, path string) (err error) { defer log.Trace(path, "")("err = %v", &err) - dir, leaf, err := d.vfs.StatParent(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return err + } + dir, leaf, err := VFS.StatParent(path) if err != nil { return err } @@ -389,11 +421,13 @@ func (d *Driver) MakeDir(path string) (err error) { } // GetFile download a file -func (d *Driver) GetFile(path string, offset int64) (size int64, fr io.ReadCloser, err error) { - d.lock.Lock() - defer d.lock.Unlock() +func (d *driver) GetFile(sctx *ftp.Context, path string, offset int64) (size int64, fr io.ReadCloser, err error) { defer log.Trace(path, "offset=%v", offset)("err = %v", &err) - node, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return 0, nil, err + } + node, err := VFS.Stat(path) if err == vfs.ENOENT { fs.Infof(path, "File not found") return 0, nil, errors.New("file not found") @@ -415,22 +449,25 @@ func (d *Driver) GetFile(path string, offset int64) (size int64, fr io.ReadClose // Account the transfer tr := accounting.GlobalStats().NewTransferRemoteSize(path, node.Size()) - defer tr.Done(d.s.ctx, nil) + defer tr.Done(d.ctx, nil) return node.Size(), handle, nil } // PutFile upload a file -func (d *Driver) PutFile(path string, data io.Reader, appendData bool) (n int64, err error) { - d.lock.Lock() - defer d.lock.Unlock() - defer log.Trace(path, "append=%v", appendData)("err = %v", &err) +func (d *driver) PutFile(sctx *ftp.Context, path string, data io.Reader, offset int64) (n int64, err error) { + defer log.Trace(path, "offset=%d", offset)("err = %v", &err) + var isExist bool - node, err := d.vfs.Stat(path) + VFS, err := d.getVFS(sctx) + if err != nil { + return 0, err + } + fi, err := VFS.Stat(path) if err == nil { isExist = true - if node.IsDir() { - return 0, errors.New("a dir has the same name") + if fi.IsDir() { + return 0, errors.New("can't create file - directory exists") } } else { if os.IsNotExist(err) { @@ -440,41 +477,51 @@ func (d *Driver) PutFile(path string, data io.Reader, appendData bool) (n int64, } } - if appendData && !isExist { - appendData = false + if offset > -1 && !isExist { + offset = -1 } - if !appendData { + var f vfs.Handle + + if offset == -1 { if isExist { - err = node.Remove() + err = VFS.Remove(path) if err != nil { return 0, err } } - f, err := d.vfs.OpenFile(path, os.O_RDWR|os.O_CREATE, 0660) + f, err = VFS.Create(path) if err != nil { return 0, err } - defer closeIO(path, f) - bytes, err := io.Copy(f, data) + defer fs.CheckClose(f, &err) + n, err = io.Copy(f, data) if err != nil { return 0, err } - return bytes, nil + return n, nil } - of, err := d.vfs.OpenFile(path, os.O_APPEND|os.O_RDWR, 0660) + f, err = VFS.OpenFile(path, os.O_APPEND|os.O_RDWR, 0660) if err != nil { return 0, err } - defer closeIO(path, of) + defer fs.CheckClose(f, &err) - _, err = of.Seek(0, os.SEEK_END) + info, err := f.Stat() if err != nil { return 0, err } + if offset > info.Size() { + return 0, fmt.Errorf("offset %d is beyond file size %d", offset, info.Size()) + } - bytes, err := io.Copy(of, data) + _, err = f.Seek(offset, io.SeekStart) + if err != nil { + return 0, err + } + + bytes, err := io.Copy(f, data) if err != nil { return 0, err } @@ -520,10 +567,3 @@ func (f *FileInfo) Group() string { func (f *FileInfo) ModTime() time.Time { return f.FileInfo.ModTime().UTC() } - -func closeIO(path string, c io.Closer) { - err := c.Close() - if err != nil { - log.Trace(path, "")("err = %v", &err) - } -} diff --git a/cmd/serve/ftp/ftp_test.go b/cmd/serve/ftp/ftp_test.go index 6ac0d344ceefa..59fd59b8de10f 100644 --- a/cmd/serve/ftp/ftp_test.go +++ b/cmd/serve/ftp/ftp_test.go @@ -18,7 +18,7 @@ import ( "github.com/rclone/rclone/fs/config/configmap" "github.com/rclone/rclone/fs/config/obscure" "github.com/stretchr/testify/assert" - ftp "goftp.io/server/core" + ftp "goftp.io/server/v2" ) const ( diff --git a/cmd/serve/http/data/assets_generate.go b/cmd/serve/http/data/assets_generate.go deleted file mode 100644 index 6196ba206d450..0000000000000 --- a/cmd/serve/http/data/assets_generate.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build ignore -// +build ignore - -package main - -import ( - "log" - "net/http" - - "github.com/shurcooL/vfsgen" -) - -func main() { - var AssetDir http.FileSystem = http.Dir("./templates") - err := vfsgen.Generate(AssetDir, vfsgen.Options{ - PackageName: "data", - BuildTags: "!dev", - VariableName: "Assets", - }) - if err != nil { - log.Fatalln(err) - } -} diff --git a/cmd/serve/http/data/assets_vfsdata.go b/cmd/serve/http/data/assets_vfsdata.go deleted file mode 100644 index 69bc52ef763f9..0000000000000 --- a/cmd/serve/http/data/assets_vfsdata.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by vfsgen; DO NOT EDIT. - -//go:build !dev -// +build !dev - -package data - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "net/http" - "os" - pathpkg "path" - "time" -) - -// Assets statically implements the virtual filesystem provided to vfsgen. -var Assets = func() http.FileSystem { - fs := vfsgen۰FS{ - "/": &vfsgen۰DirInfo{ - name: "/", - modTime: time.Date(2020, 5, 5, 16, 40, 6, 115915195, time.UTC), - }, - "/index.html": &vfsgen۰CompressedFileInfo{ - name: "index.html", - modTime: time.Date(2020, 5, 5, 16, 40, 5, 919909715, time.UTC), - uncompressedSize: 15424, - - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x7b\x6d\x73\xdb\x46\xf2\xe7\x6b\xe9\x53\x4c\x98\xcd\x8a\x4a\xc0\xe1\x3c\x3f\x48\xa4\xf6\x6c\xc6\x59\xbb\x56\x71\x52\xb1\x9d\xad\x6c\x2a\x2f\x20\x62\x48\xe2\x0c\x02\x0c\x00\xea\xc1\x3a\x55\xdd\x87\xb8\x4f\x78\x9f\xe4\xaa\x67\x00\x12\x90\x28\x27\x7b\xf5\xdf\xbf\xec\xa2\x80\x9e\x99\x9e\x7e\xf8\x75\x4f\x37\x08\x4d\xbe\x18\x8d\xd0\xf1\x78\x8c\x66\xc5\xe6\xae\x4c\x97\xab\x1a\x31\x42\x25\xfa\x3e\xae\xeb\x95\xbb\x41\xaf\x8b\xac\x46\x71\x9e\xa0\xf7\x2b\x87\x66\x71\x92\xdc\xa1\x17\xdb\x7a\x55\x94\xd5\xf1\x78\x0c\xeb\x2e\xd3\xb9\xcb\x2b\x97\xa0\x6d\x9e\xb8\x12\xd5\x2b\x87\x5e\x6c\xe2\xf9\xca\xb5\x23\x11\xfa\xd9\x95\x55\x5a\xe4\x88\x61\x82\x86\x30\x61\xd0\x0c\x0d\x4e\xcf\x81\xc5\x5d\xb1\x45\xeb\xf8\x0e\xe5\x45\x8d\xb6\x95\x43\xf5\x2a\xad\xd0\x22\xcd\x1c\x72\xb7\x73\xb7\xa9\x51\x9a\xa3\x79\xb1\xde\x64\x69\x9c\xcf\x1d\xba\x49\xeb\x95\xdf\xa7\xe1\x82\x81\xc7\x2f\x0d\x8f\xe2\xaa\x8e\xd3\x1c\xc5\x68\x5e\x6c\xee\x50\xb1\xe8\x4e\x44\x71\xdd\x08\x0d\x3f\xab\xba\xde\x9c\x8d\xc7\x37\x37\x37\x38\xf6\x02\xe3\xa2\x5c\x8e\xb3\x30\xb5\x1a\x5f\xbe\x99\xbd\x7a\xfb\xee\xd5\x88\x61\xd2\x2c\xfa\x90\x67\xae\xaa\x50\xe9\x7e\xdf\xa6\xa5\x4b\xd0\xd5\x1d\x8a\x37\x9b\x2c\x9d\xc7\x57\x99\x43\x59\x7c\x83\x8a\x12\xc5\xcb\xd2\xb9\x04\xd5\x05\x08\x7d\x53\xa6\x75\x9a\x2f\x23\x54\x15\x8b\xfa\x26\x2e\x1d\xb0\x49\xd2\xaa\x2e\xd3\xab\x6d\xdd\xb3\x59\x2b\x62\x5a\xf5\x26\x14\x39\x8a\x73\x34\x78\xf1\x0e\xbd\x79\x37\x40\x2f\x5f\xbc\x7b\xf3\x2e\x02\x26\xff\x7c\xf3\xfe\xf5\x0f\x1f\xde\xa3\x7f\xbe\xf8\xe9\xa7\x17\x6f\xdf\xbf\x79\xf5\x0e\xfd\xf0\x13\x9a\xfd\xf0\xf6\xdb\x37\xef\xdf\xfc\xf0\xf6\x1d\xfa\xe1\x3b\xf4\xe2\xed\x2f\xe8\x1f\x6f\xde\x7e\x1b\x21\x97\xd6\x2b\x57\x22\x77\xbb\x29\x41\x83\xa2\x44\x29\x58\xd3\x25\xde\x74\xef\x9c\xeb\x89\xb0\x28\x82\x48\xd5\xc6\xcd\xd3\x45\x3a\x47\x59\x9c\x2f\xb7\xf1\xd2\xa1\x65\x71\xed\xca\x3c\xcd\x97\x68\xe3\xca\x75\x5a\x81\x57\x2b\x40\x07\xb0\xc9\xd2\x75\x5a\xc7\xb5\x27\x3d\xd1\x0b\xa3\xe3\xef\x8b\x04\xb8\x85\x19\x67\x08\xbd\x48\xe2\x4d\x1d\x4c\x55\xce\xb3\x22\x77\x68\x1d\x97\x1f\xb7\x1b\x34\x1a\x5d\x1c\x1f\x4f\xbe\xf8\xf6\x87\xd9\xfb\x5f\x7e\x7c\x85\x56\xf5\x3a\xbb\x38\x9e\x84\x5f\x47\x93\x95\x8b\x93\x8b\xe3\xa3\xa3\x49\x9d\xd6\x99\xbb\xb8\xbf\x87\x01\x84\xdf\xc6\x6b\xf7\xf0\x30\x19\x07\x2a\x8c\xaf\x5d\x1d\xa3\xf9\x2a\x2e\x2b\x57\x4f\x07\xdb\x7a\x31\x32\x83\xfd\x40\x1e\xaf\xdd\x74\x70\x9d\xba\x9b\x4d\x51\xd6\x03\x34\x2f\xf2\xda\xe5\xf5\x74\x70\x93\x26\xf5\x6a\x9a\xb8\xeb\x74\xee\x46\xfe\x26\x42\x69\x9e\xd6\x69\x9c\x8d\xaa\x79\x9c\xb9\x29\xc5\xe4\x09\xa3\x65\x51\x2c\x33\xd7\x61\x93\x17\x75\x19\xe7\x55\x16\xd7\x6e\x70\x71\x3c\xa9\xea\x3b\x10\xeb\x6b\x74\x8f\x36\x71\x92\xa4\xf9\xf2\x0c\x91\x73\xd0\x78\x99\xe6\xfe\xf2\xe1\xf8\xaa\x48\xee\xd0\xfd\xf1\xd1\xa2\xc8\xeb\xd1\x22\x5e\xa7\xd9\xdd\x19\xaa\xe2\xbc\x1a\x55\xae\x4c\x17\xe7\xc7\x47\xb5\xbb\xad\x47\xa5\x03\xe3\x7a\x0e\xc5\xa6\x4e\xd7\xe9\x27\x57\x6d\x9c\x4b\xce\x8f\x8f\xae\xe2\xf9\xc7\x65\x59\x6c\xf3\x64\x34\x2f\xb2\xa2\x3c\x43\x5f\x2e\xfc\xcf\xf9\xf1\xc3\x71\x0c\xbc\x5b\x32\x21\xca\x25\xbc\x65\x99\xb8\x79\x51\x7a\xc7\x9c\xa1\xbc\xc8\x9d\x9f\x7e\xb6\x02\x6f\x47\xc7\x2b\x8a\x9a\xeb\x2e\x03\x4e\xed\x3c\xf0\x05\x87\xc0\xbc\x2f\xab\xed\x7a\x1d\x97\x5e\x85\x46\xc7\x51\xe6\x16\xf5\x19\x92\x5f\x9d\xef\x49\x3e\xc7\x04\xda\xc3\x71\xbd\x3a\x5b\xa4\x65\x55\x8f\xe6\xab\x34\x4b\xa2\xe3\x3a\xe9\xde\x03\x27\xef\x81\x33\x44\xbf\x3a\x47\xe3\xaf\x51\x0d\x8b\x5d\xe9\x21\xba\x2e\xae\x20\x45\x7c\x3d\x0e\x7c\xb2\xb8\xc7\x66\x7f\xfb\xe7\xb9\x04\x4d\xba\xf2\xd7\xc5\xe6\x0c\x31\xb9\xb9\xed\x28\x70\x55\xd4\x75\xb1\x3e\x43\x34\x90\x0f\xd9\x9c\xc1\x3f\x6f\x1b\xba\x73\x68\x95\x7e\x72\x67\x88\x11\xbf\xc8\x53\x6e\x5c\x30\x45\x5e\x94\xeb\x38\x3b\x3f\x3e\xba\x59\xa5\xb5\x1b\x55\x9b\x78\xee\x80\x7a\x53\xc6\x9b\xf3\xe3\x23\xb0\xfc\x22\x2b\x6e\x46\xb7\x67\x68\x95\x26\x89\xcb\x5b\xb7\xb5\x23\x67\xc8\x65\x59\xba\xa9\xd2\xea\x7c\xef\x20\x6b\x6d\x23\xc1\x23\xc7\x93\xf3\xe3\xa3\x1d\xee\x90\x00\x79\x1e\x1e\x39\xf9\x09\x28\x7c\x3c\x67\x69\x40\x86\x9f\xfb\xc8\x4d\x7b\x20\x1f\x3f\x1c\xaf\x21\x03\xdf\x1f\x1f\x25\x69\xb5\xc9\xe2\xbb\x33\x74\x95\x15\xf3\x8f\x30\x82\x7d\xc8\xf4\x4d\x42\xd9\xde\x24\x2d\xea\x7f\x76\x65\x12\xe7\x71\xd4\x87\xff\x55\x51\x26\xae\xdc\x3b\x60\x73\x8b\xaa\x22\x4b\x13\xf4\xa5\x9d\xc1\xbf\xf3\x47\x8e\xa3\xe4\xb0\xe3\x48\xd0\xd9\x0b\x33\x4a\x6b\xb7\xde\x6b\xd0\xc2\x93\xba\x35\x4c\xf9\x72\x91\x66\x75\x0f\x12\x67\xc1\x62\x8d\x2c\x3d\x21\x66\xb3\x99\xc7\xb4\x3f\x0e\x3a\xa0\x23\xe4\xab\xbd\xf0\xf3\x22\xcb\xe2\x4d\xe5\xce\x50\x7b\xe5\xd7\xf8\x2d\x0e\xe8\x97\xc4\xd5\xca\x25\xe8\xcb\x24\x86\x7f\x7e\xaa\x4f\x13\x75\xb9\xf7\xd6\x33\x51\xef\xe6\x21\xc2\x20\x1c\x76\x4e\x8d\xb3\x74\x99\x9f\x21\x88\xcb\xf3\x8e\x4e\x60\x12\x04\x7e\x80\xf0\x98\xad\xe2\x7c\xe9\x12\xb4\x28\x8b\x35\x22\x90\x9f\x59\x1b\x65\x4f\x62\xe3\xb3\x26\xee\x79\x59\x79\xca\x41\x88\x7b\xce\x5d\x94\x5e\x65\x71\xc0\x4b\xbd\x42\xd5\xf5\x12\x46\xae\x5d\x59\xa7\xf3\x38\x6b\x35\x58\xa7\x49\x92\x05\xdb\x85\x08\x3f\x18\x3b\x5d\x01\x1a\xa4\xd7\xc9\x59\x5e\xaf\x02\x72\x87\xec\xb4\xe3\x28\x43\xbe\x7a\x32\x81\x9f\xf6\x7c\x4f\x7c\x00\x37\xbf\x9a\x04\xb6\x9f\x2c\x4e\xa3\xfe\x6a\x71\xfa\xd8\xf0\x1e\x5e\x87\xc4\x68\xd4\xdc\x14\x55\x1a\x42\x2e\xbe\xaa\x8a\x6c\x5b\xb7\x2a\x62\x38\x67\xbc\x2b\xf1\xb2\xd8\x6e\x3a\x88\x0d\x39\x96\x62\x2d\x01\xb3\x47\x37\x45\x99\x8c\xae\x4a\x17\x7f\x3c\x43\xfe\xd7\x28\xce\xb2\x6e\x1a\x01\xd3\xb4\x43\x30\xf9\xb1\x57\x36\xa5\x1b\xb5\x7e\xc1\xe9\xbc\xc8\x9f\x46\x87\x6c\x02\x08\x46\x71\x55\x94\x75\x2f\xda\xd3\x1c\x32\xc5\xa8\x09\xfa\x5d\x18\x78\xe9\x56\xae\x13\x5f\x1d\x6d\x4b\x97\xc5\x75\x7a\xed\x20\xb5\x01\xae\x30\x0b\x01\xd8\xd9\x02\xd7\xc5\xe6\x39\x13\x1d\x05\x23\x90\x76\xf9\x88\x3e\x91\x10\x07\x6c\x3e\xcb\xa1\x85\x6e\x58\xba\x67\xf8\x70\xbc\x28\x8a\x27\x39\xc0\xc7\xcb\x53\x90\x87\x54\xd6\x75\xf8\xdc\xe5\xb5\x2b\x81\xcd\xff\x58\xbb\x24\x8d\xd1\x70\x1d\xdf\x8e\x1a\x9b\x28\x42\x36\xb7\x80\x91\xf1\xd7\x47\x78\x95\x26\xae\x4d\x1d\x7b\x63\x86\xe3\xf8\xe8\x01\x95\x6e\x5d\x5c\x87\x72\xe9\xa3\x73\x1b\x94\xc4\xb5\xab\xa0\x3e\xdc\x9f\x60\x47\x07\xb0\xdd\x9a\x3f\xde\xd6\x05\xf0\x39\x3e\xea\x41\x96\x9f\x46\x8f\x96\x05\xc4\x1f\x3a\xae\x8f\x0e\x21\x19\x38\x86\x53\xee\xd1\x11\x13\xe8\x3e\xaa\xbb\xa7\x03\xd0\x3b\x59\xf5\xa8\x63\x0d\x4a\x82\x41\x1f\x8e\x1f\x8e\x27\xe3\xa6\x62\x3a\x9a\x8c\x9b\x8a\x6f\xe2\x13\x5f\x91\x67\x45\x9c\x4c\x4f\x02\x8b\xe1\xe9\x79\x5d\x2c\x97\x99\x1b\x0e\x7c\xee\x1c\x9c\x9e\xcf\x7d\xf6\x7a\x97\x7e\x72\xc3\xd3\x13\x5f\xa6\x41\x68\x5d\x87\x16\x64\x3a\xa0\x98\x0e\xd0\xed\x3a\xcb\xab\xe9\xa0\xd3\x01\xdc\x70\x5f\xfd\x33\x42\xc8\xb8\xba\x5e\x36\x53\xce\x6e\xb3\x34\xff\x78\x68\x22\xb5\xd6\x8e\xfd\xe8\x00\x05\x4c\x4f\x07\x64\x80\x42\xf1\x08\x57\x5e\xfc\xe9\xe0\x00\xd4\x7c\xed\x78\x34\x49\xdc\xa2\xf2\x57\x47\xbe\x05\xfb\xae\xc8\xa0\xf6\x80\xda\xd7\xd3\x96\x28\x4d\xa6\x83\x85\xa7\x0e\xa0\x19\xca\x46\xe5\x16\x38\xe6\x45\xfe\xc9\x95\x45\xa0\xf9\x5b\x17\x38\x1e\x1d\x4d\x36\x71\xbd\x42\xc9\x74\xf0\x3d\x33\x12\x33\x86\xb8\xc6\x52\xae\x46\x54\x30\xac\x2e\x29\x25\xd8\x22\xf2\x9a\x53\xac\x67\x54\x60\x26\x11\x41\x04\x51\x05\xd4\x30\xf5\x5a\x4b\x4c\x57\x1c\x48\xec\x67\xb8\x9e\x93\x11\x23\x58\xc9\x11\xcc\x57\x23\x3f\x69\x04\x0c\xc2\xe5\xa7\x56\x8a\x2f\xbf\xfb\xee\x05\x21\x64\x30\x7e\x56\x12\xd5\xdd\x97\x2b\x44\x90\x24\x98\x19\x44\x90\xd2\x58\x8b\x6b\x2a\x0d\xd6\x73\x82\xa8\xc6\x42\x23\xbf\x1d\x82\x15\xd2\x7f\x86\xcb\xd7\x9e\xd9\x1c\xa6\x08\x10\x19\xe4\xa0\x02\xf3\x70\xe5\xa7\xfc\x0c\xdc\xe4\x9c\x8c\x3c\x9f\x56\x6c\x18\x19\xed\x27\x75\xc5\x9e\xbd\x60\xa6\x15\x7b\x32\x5e\x1e\xb0\xfe\xa8\x5a\x15\x65\x3d\xdf\xd6\xe0\xd4\xb2\xf8\xe8\x1a\xa3\x37\x77\xa3\xc6\xe7\xb4\xe7\x91\xae\xc7\xdc\xb5\xcb\x8b\x24\xd9\x79\xe9\x20\xf3\x11\x9c\xe0\x9b\x83\x9e\x6e\xd6\x3d\xb7\xb0\x5a\xc5\x9b\x1d\x04\x9e\x9a\x5e\x18\xad\x22\xf0\x96\x30\xca\x12\x86\x2e\x3d\x1a\x28\x13\xdc\xf4\xc9\x00\x0f\x46\xb4\x91\x11\x41\x97\x9c\x62\x65\xa9\x92\xcc\x46\x04\x79\xaf\x35\x4b\x08\x22\x11\x55\xd8\x58\x65\x29\x51\x88\xf4\x78\x90\x88\x52\x86\x95\x50\x44\x53\xe0\xa1\x70\xc3\xe3\x19\xb2\x96\x98\x58\xcd\x0d\x91\x68\xd6\x21\x4b\x81\x85\x90\x8a\x10\x83\x38\x61\x58\x49\xc9\x8c\xec\x6e\x74\x58\xb3\x7f\x0d\xbc\x7d\xde\x79\x7b\x3c\x02\xe6\xc5\x64\x0c\x76\xf9\x03\x2b\xa9\x9e\xe2\x5c\xf5\x34\x07\xd0\x46\x1e\xb4\xdc\x48\x65\x10\x89\x3c\x72\xa9\x25\xdc\x82\xea\x8c\x29\x2c\x24\x15\x4c\xa0\x19\x89\x98\xe0\xd8\x12\x2b\x34\x45\x1d\x1e\x4c\x1a\x4c\x2d\xe7\xcc\xa0\xce\x46\x1d\xea\x65\x47\x9c\x0e\x79\xd6\xb1\x43\x8f\xc7\xce\x66\x9d\xfd\xba\xd4\xbd\x4c\x5d\xbb\x77\x04\xef\xd9\x7d\xaf\x5c\xd7\xee\x0a\xf5\x6d\xf4\x8c\x9d\x7d\x24\x3d\xb2\xf3\x2e\xa2\xba\x16\xa7\x4c\x61\x2a\x05\xe5\x22\x62\x92\x60\x29\x2d\x35\x02\xcd\x80\x6c\x24\xb1\x1a\xc8\x14\x1b\xc3\x95\xe6\x88\x32\x8d\x39\x21\x52\x80\x99\x38\x26\x44\x51\xc6\x3c\x55\x6b\xa6\x08\x8b\x98\x14\x98\x06\xea\x8c\x32\x83\x85\xb2\x42\x00\x59\x62\xd6\x4e\x36\xd8\x52\x4b\x28\x98\x54\x61\x4a\x04\x31\x40\xb5\x58\x71\xc3\x39\x58\x54\x63\x42\x18\x11\x14\xcd\x28\xf7\x12\x59\xc5\xbc\xa1\x39\x53\x92\x53\x44\x21\x6f\x30\x63\x24\x4c\xb6\x88\x72\x8e\x29\x21\x44\x6a\x7f\x3b\xa3\x5c\x60\x61\xb9\xe6\xba\x19\x96\x58\x50\xc9\x95\xf0\x3c\xa4\xa4\x84\x21\xca\x15\xa6\x94\x31\x22\xfc\x7e\x4a\x4b\xe9\xb7\x53\xd8\x10\x4b\x84\xe8\x4a\x41\xb9\xc6\x4c\x1a\x45\xad\xd7\xc3\x1e\xa0\x0a\x2c\x75\xcb\xa2\x43\x06\x10\x04\xf5\xba\x54\x86\xcd\x9e\x4a\x38\x37\x9c\x79\x1b\x0b\xa9\xa9\xe0\x41\x0a\x6d\x94\x54\x2a\x62\xc2\x62\x4b\x0c\x55\xdc\x4b\x2c\x15\xd5\xda\x7a\x2a\xf1\xb6\xe8\x53\x0d\x96\xc1\x4d\x9e\x05\x31\x56\x33\x60\xc1\xb0\xa1\x82\x19\xe5\x2d\x61\x94\xb0\xdc\x46\x8c\x6b\xc8\x2f\x82\x98\x3e\x95\x63\xa6\xb9\x50\xde\x8a\x7b\x32\x93\x98\x04\xe1\xba\xb2\x51\x8d\x65\xcb\xd8\x60\x6a\x08\x13\x40\x25\xd8\x08\x65\xb9\x67\x61\xb1\xb6\x46\x53\x1e\x31\x22\x30\x6b\x0c\x27\x00\x4e\x96\x71\x11\x51\x6b\xb0\x82\xed\x04\xa2\x42\x60\xc1\x2c\x67\x26\xa2\x96\x63\xad\x40\x3f\x88\x78\x8d\x19\x55\xca\xd8\x88\x1a\x83\x8d\xb2\xdc\x18\x44\x25\xc1\x4a\x1b\x41\x69\x44\x8d\xc0\x26\x88\x4c\xa5\xc0\x86\x2b\xab\x79\x44\x0d\x6d\xc1\x32\x83\xb3\xcc\x5a\x29\xb9\x8c\xa8\x06\xa0\x5a\x69\x19\xa2\x8a\x63\xc5\x14\x15\x36\xa2\x5a\xec\xf0\xad\x0c\x16\x86\x4a\xc9\x22\xaa\x19\x56\x80\x58\x08\x06\xcd\x31\xe7\xca\x4a\x11\x51\x4d\xb0\xe0\x46\x6b\x85\xa8\xb6\x98\x52\x6e\x0d\x8f\x60\x9d\x52\x92\x13\x85\xa8\x91\x58\x1a\x6d\x80\x85\xd2\x98\x0b\x70\x1f\x9a\x51\xcb\x30\x51\x54\x33\x20\x2b\xcc\x28\x6c\x88\xc0\x00\x5a\x11\xae\x4d\x44\x95\xc4\x5c\x30\x23\x35\x62\x44\x7a\x29\xa8\x88\xa8\x12\x58\x05\xa5\x67\x8c\x32\xb0\x32\xd5\x9e\xca\x82\xf7\x18\xb5\x58\x5a\x43\x85\x8a\x40\x25\x6b\x21\x7e\x11\x63\x06\x53\xc5\xbc\xce\x7b\xea\x25\x13\x0a\x13\x09\x21\xfe\x2c\xd9\xca\xd6\xa9\xb3\x1e\x59\x63\x0d\x16\x92\x08\xa8\x5a\x32\xc1\x81\x6a\x31\x44\x13\x11\x08\xc0\xc7\x35\x31\xd6\x46\x8c\x50\x4c\x9a\x2c\x02\x19\x85\x51\x88\xbe\x88\x41\x0e\x0b\x50\x86\x10\x20\xda\x1a\xa3\x22\x46\x38\x96\x21\x31\x40\x14\x71\xcd\x34\x95\x5d\xea\x0c\x92\x84\x50\x9c\xf1\x47\x93\x0d\x96\x9c\x32\xad\x7b\x8c\x15\xc1\x60\x62\xc6\xbb\x52\x5c\x72\x48\x71\x84\x31\x00\x11\xd7\x58\x5b\x80\x00\x9a\x71\x48\x5b\x8c\x68\xa9\x23\x80\x35\x13\xc6\x1a\xc4\x99\xc1\x4a\x30\x6e\x44\xe4\xf3\x88\x8f\xea\x1e\x91\x61\x06\x8e\xa6\xc0\xa0\x43\x26\x98\x00\x95\xa1\x2e\x5b\x66\x30\x0b\x81\xd3\x95\x81\x29\xac\x83\xc0\x97\x1d\x89\x15\xc7\x42\xb4\xae\xf6\x89\x8a\x6b\xa9\x22\x45\xb1\xb1\x01\xb3\x1d\x53\x28\x1a\xec\x65\x25\xb5\x02\xee\x66\x1d\xa3\xfa\x41\x82\x19\x57\x8a\xb3\x1e\x03\xf0\x92\xe5\x5c\xeb\xfe\x6e\xe0\x52\x2d\x2c\x8d\x94\x68\x40\x21\xbc\x9f\x89\x36\x44\x47\x4a\x61\x0d\x33\xb5\xe9\x12\x21\xa8\x02\x88\x2f\xf7\x54\x4a\x48\x8b\x88\xcb\x2e\x06\xf7\xe4\x19\xa0\xdf\x28\x4e\xc0\x68\x7b\x32\xe4\x7f\xaa\x14\x33\x2c\xa2\x54\x63\xaa\x34\x87\xc2\x93\x4a\xcc\xb4\x10\x5c\x47\x10\xf2\xa2\x3d\x9b\x28\xc1\x4a\x29\x4e\x00\xc6\x14\x2a\x0e\x6b\x10\x25\x06\x73\x49\xac\xe5\x11\xd5\x12\xf3\x86\x6f\x87\x6a\x29\xd6\x21\xc0\x66\x1d\x32\x04\x1b\x6b\x72\x02\x85\x84\x1d\xa0\xc6\x38\xb6\x10\xfc\x12\x51\x26\x20\x46\x85\x14\x11\x13\xba\x0d\xfe\x19\x85\xa4\x48\xb4\x66\x3e\xf1\xd2\x76\xae\x84\x34\xce\xac\x08\x49\xba\x55\xee\xd0\x11\xfb\xcc\xc1\x0d\x3f\x03\xe4\x1f\x57\x2f\x8a\x72\x3d\x1d\xec\x9e\x5c\x0f\x19\x35\x58\x58\x9f\x0c\x11\x55\x04\x13\xff\x73\x8a\xfc\x83\xf0\xe1\x88\x46\x88\x9e\xa2\xfd\xf4\x51\x77\xfe\xa8\xbb\xe0\x51\x61\xb0\xaf\xb4\x77\x17\xbe\x09\x82\x46\xf6\x71\x0b\x94\x66\x6e\x5f\x79\x43\x73\xf9\xb8\xf2\x66\xb2\xab\xcc\xc1\xd2\xbb\x5d\x91\xa5\xb9\x9b\xc7\x9b\xe9\xc0\x3f\x2e\xeb\x91\xff\x67\x91\xe6\x2d\xfd\x49\x17\x43\x39\x62\x02\x53\x76\xcd\x34\xb8\x66\x4e\x90\xc2\x54\x21\x89\x0d\x40\x06\x53\x38\x59\x31\x6d\xae\x5f\x33\x6e\xe7\x1a\x73\x68\xae\x80\x3a\x12\xd8\xaa\xe6\xd2\x4f\xf8\xd9\xd7\x02\xf2\x1d\x44\x36\x0c\xf8\x0a\x85\x6b\x44\xf9\x6b\xf0\x9b\x9e\x51\xe3\x19\x73\xff\x5f\x87\xd5\x41\x80\x4f\x07\x5a\x2c\x40\xb2\x5f\x7d\x49\x99\x0d\x90\x82\x46\x8a\x60\x69\x90\x86\x3e\x8a\x5a\x4c\xa1\xcf\x63\xda\x5f\xbe\x66\xc2\x5e\xee\x16\x7d\x7a\xb6\xfb\x49\x33\xf7\x9f\xea\x7d\xba\xac\xdb\xce\xe7\x20\x00\x29\x6f\x20\x14\xa1\xdd\xe5\xe9\x93\x8e\xa8\xc7\x2e\xf4\x43\x3d\xc4\xfc\x21\x68\x3c\x6e\xfe\xbf\x30\xd2\x75\x04\xb4\x3f\x98\x32\x2a\x8c\x51\xbe\x23\x30\x00\x10\x23\xb4\xf6\x1d\x01\x9c\xc7\xdc\x5a\x26\x3c\x6e\x84\x35\xbe\xc8\xb7\x0a\x5b\x6b\xad\xe1\x01\x21\xcc\x70\xcd\xbb\xd4\x4b\xa8\x85\xac\xd5\x70\xe8\x77\xc8\x33\x5f\x39\x59\xe9\xcb\xe5\x3d\x99\x71\x8b\xa9\x26\x86\xed\xb6\x13\xac\x4b\xdc\x4b\x74\xb9\xa7\x52\xc6\x31\x15\x32\x64\xe6\x43\x54\x0a\x47\xbe\x91\x82\x46\x0c\x1b\xc1\xa8\x26\x56\xb8\x11\x15\x3e\x5d\x72\x65\x05\x1c\x7f\xfd\x91\xcb\x46\x1b\x09\x3a\xf6\x87\x66\x20\x83\x24\xc4\x12\x1d\x8d\x28\xd6\x54\x68\x6b\x0d\x73\x23\x22\x11\x89\x20\x58\x08\x63\xd6\xc2\x4d\xc7\x9e\x4d\xf2\x2a\xdd\xbc\xa6\x54\xd3\xcf\x74\x74\x94\x2a\xa8\x0c\x88\x6f\x64\x29\x55\x3e\xeb\x5b\x22\xac\xf2\x99\x5c\x45\x94\x52\x2c\x0c\x9c\x55\x08\x94\x64\xd2\x10\x62\x22\xca\x20\x5e\x19\x94\xa3\x70\x5c\xc1\xed\x25\x24\x66\x7f\xf1\x98\xe7\xee\xa6\x2b\x96\xb6\xe2\x4f\x35\x40\x42\x63\x43\x38\x05\x73\x5a\x81\x49\x38\xe8\x66\x02\x52\xa7\xb5\x86\x02\x59\x62\x1a\xca\x7b\x61\xb0\x15\x56\x4a\x19\xbc\x4f\x42\x01\x25\x2c\x16\x8c\x2a\xb2\xc3\x84\xa7\xce\x24\xc1\x94\x1a\x21\x0c\x60\x42\x63\x13\xc8\x70\x00\x28\x43\x18\xd3\x11\xf3\xe5\xaf\x2f\x1a\x24\xc5\x0c\xca\x58\x28\x7e\xac\xc5\x3c\xd4\x92\x33\xc9\x30\x23\xc6\x2a\x63\x22\x4e\x08\x16\xfe\xa4\x93\x1c\x73\xad\x7d\x33\xc1\x09\x45\x52\x60\x2d\x2c\x51\x5c\xf8\xdb\x19\x34\x55\x82\x69\xc1\x55\x18\xd6\x98\x28\xc1\x35\xb1\x9e\x85\x0a\x7d\x83\xd4\x58\x2b\xca\xbc\x76\x16\x3a\x4e\xce\x34\x9a\x49\x83\x85\x34\x44\x36\xe4\x46\x0a\xa8\x9f\x89\x56\x0c\x0e\x40\x0b\x2d\xdd\x53\xaa\xc6\x1c\xea\x19\xee\x59\xec\xc9\x0a\x9b\x46\xbd\x2e\x55\x62\xbb\xa3\x2a\x03\x3d\x2e\xf3\xa6\x37\x80\x4f\x1a\xa4\xe0\x52\x6a\x06\x93\x39\xb4\x37\x50\x84\x4b\x83\x19\x25\xbe\xae\x86\x60\x32\x8d\x2d\xfa\x54\xd1\x74\x61\xa0\x1e\x37\x9a\x43\x24\x18\x8d\x75\xa8\xc1\x24\x34\x2c\xdc\x0a\x49\x23\x66\x38\xd6\xa1\x8c\xeb\x52\xb5\xc5\xd6\xf7\x87\xb3\x1e\x95\x63\x16\x64\xeb\x8a\xa6\x74\xdb\x14\x49\x8b\x0d\xb3\x4c\x42\xb7\xa5\x28\x56\x4d\xf3\xaa\x28\x16\xc2\x17\x08\xe0\x92\x60\x35\xc5\xb1\xe4\x86\x09\xc2\x7d\xcb\xa7\x42\x81\xa0\x7c\xfd\xc4\x39\xb4\xd5\x42\x63\xc5\x84\xb0\x68\xa6\xa0\xdf\x91\xbe\xeb\x60\x02\xba\x15\x5f\xf0\x6b\x86\x39\xd3\x82\xfa\xc2\x83\x60\xee\xc5\xd5\x0a\x0b\x23\xad\xb6\xcc\x77\x76\xc1\x36\x33\x43\xb0\x12\x42\x0a\x0a\x54\x81\x65\x68\xcb\x0c\xd4\x3b\x92\x4a\x45\x23\xc6\x59\x8b\x6c\x4b\x30\xe5\x44\x4a\xf0\x05\x07\xb6\xa1\xd4\xb2\x02\x5b\x23\xad\x02\x79\x99\xc1\x32\x74\x33\x10\xc2\x5a\x31\x28\xf6\x99\xf6\x8d\x26\x1c\x8a\x44\x43\xc9\x69\x64\x78\xd0\x41\xda\xa7\x00\x94\x63\x4d\x89\x66\x26\xf4\x91\x06\xf6\x43\x94\x11\x2c\x20\xd6\x64\xc4\x18\xd4\xfd\x54\xc0\x69\xc9\xb4\x97\x82\xf9\xfa\xcb\x04\x85\x67\xd0\xdf\x1b\x66\x29\xd4\xfa\x8c\x63\x11\xdc\x06\x6d\x24\x13\x9a\x36\x93\x59\xd3\x19\x0a\x8b\x0d\xa5\x52\xf4\xa8\x97\xd0\x89\x69\x22\xa4\x35\xcf\x92\xa1\x5c\x6b\x1b\xf0\x0e\x59\x12\x48\x8f\x92\x86\xd6\x90\xd0\xf0\xdc\x88\xed\x1e\x45\x68\x82\x09\xb5\x96\x48\xdf\xee\xcb\x26\x7b\x50\x4d\xa1\xc8\xf5\xcf\x38\x04\x36\x01\xc1\xd0\x45\x6a\x66\x0c\x14\x9d\x52\x62\x19\xf2\x01\xd5\x0a\x13\xe6\x1b\xc3\x0e\x75\x46\x75\x53\x54\xf6\xc8\xd4\x10\xdf\x68\x43\x4a\xe9\x30\x36\x14\x1b\x46\x01\xec\x7b\x19\x2e\x01\x49\x5a\x52\x66\x95\x6f\x86\x4c\xe8\xb3\x67\xa0\x28\x34\xc9\x0a\x4a\x5f\xc8\x45\xbe\xd2\xf6\xfd\x82\xa5\xdc\x86\xae\x8e\x86\x84\xd0\xa3\x6a\xcc\x9a\xc6\xa9\x47\x96\x58\xb4\xcd\xc5\x8e\x31\x85\x44\x1a\x22\xa6\x23\x05\xb4\xc0\x3a\x48\x7c\xb9\x17\x19\xfc\xb8\x7b\xdc\x63\x08\x66\x84\x79\x16\xdc\x62\xdd\x3c\x1a\xd8\x9b\x82\x72\x1b\x0c\x26\x04\x83\xea\xdf\x3f\x65\xd8\x9b\x35\x0c\x53\x6c\x8c\x54\xdc\xf6\x79\x10\x4c\x9a\x56\xad\xbb\x21\x38\x95\x71\x0b\x3d\xb5\x60\x3b\x10\x81\xff\x99\x26\x70\xee\x08\x60\x1e\x9e\x93\x74\xa9\x12\xc2\x18\xfa\x80\xcb\x2e\x59\xef\x9e\x3a\x5c\x76\x80\xd8\x21\xcf\x8c\xc1\x92\x32\x62\xe1\x84\xdb\x93\x01\x64\x54\x32\xe8\xdd\xa8\x11\xd8\x86\x67\x54\x5c\x61\xcb\xb8\xef\x7e\x7c\xeb\xdf\x60\x8b\x33\xcc\xa9\xe4\x44\x43\xe8\x50\xcc\x82\x03\x39\xf1\xd1\x2c\x03\x43\xb8\x13\x12\xdb\x10\x56\x33\xb8\x85\x73\x20\x24\x00\x2e\xb1\x94\x60\x4e\x16\x31\xcd\xc0\x93\x86\x6b\x24\x14\x04\xa4\x50\x04\xce\x25\xda\x46\xfa\x4c\x28\xac\xa4\xd2\x4c\xa9\x50\xc3\x34\x93\x35\xa6\x44\x71\x42\x6c\x48\xc6\x61\xd7\x83\x27\x69\xb7\xcd\x19\xcd\x8a\xcd\xdd\xae\xd2\x6b\x4b\xc1\x43\x5f\xa7\x1c\x2e\x3f\x05\x81\x1a\x48\x59\x19\x21\xc6\xfe\xb8\xff\xe9\xce\x1f\x75\x17\xfc\xb9\xfe\xe7\xc3\x06\xc5\x65\x59\xdc\x3c\xee\x81\xb6\x9b\x91\xa7\x3f\x23\xe5\x08\x4e\x11\xc6\xd0\x88\x11\x83\x29\x3b\xed\xf7\x2f\x9d\x25\xeb\xb8\x2e\xd3\xdb\x21\x66\x4c\x50\xee\xbf\xfd\xc1\x14\x4e\x7b\xc4\xb9\xc4\x4a\x23\xaa\x04\xe6\xf2\xf4\x71\xad\x4c\x06\x50\xb6\xac\x47\x10\x64\x54\x23\x41\x19\x26\x74\x35\x62\x06\x1b\xa6\x9b\x5f\x19\x15\x58\x50\x31\x62\x50\xbf\x49\x74\xe8\x0e\x85\xbb\x03\x0d\x07\xe8\xfe\x6d\x71\x93\x1f\xd6\x3e\x29\x6e\xf2\xff\x94\xfe\xa3\xbe\x01\x00\xb3\x96\xff\x77\x1b\x60\x32\x6e\xbf\x0c\x9c\x8c\xab\x6b\x4f\x9b\x84\x77\x91\xc2\xf0\x8a\x86\xf9\xf7\xf7\x65\x9c\x2f\x1d\xfa\x4b\x1a\xa1\xbf\xcc\xcb\xed\xfa\x0a\x9d\x4d\x11\x7e\x59\xba\x38\xf1\xb7\x0f\x0f\x93\x18\xad\x4a\xb7\x98\x0e\x9a\xf7\xe2\xc2\x34\x7c\x99\xe6\x1f\x1f\x1e\x06\x17\x7d\xea\x7b\x77\x5b\x3f\x3c\x4c\xc6\xf1\xc5\xfd\x7d\xba\x40\x39\x70\x46\xe4\xe1\x61\x7c\x7f\xef\xf2\xe4\xe1\xa1\xf9\x15\x44\x0c\x42\x84\x6f\x63\x83\x60\x93\x75\x9c\xe6\xcd\x97\x99\xe9\x35\x9a\x67\x71\x55\x4d\x07\x6b\x57\xc7\x8d\x03\x3c\x19\x3c\xd8\xbc\x19\xb6\xf3\x4b\xb5\x89\xf3\xee\x7c\xff\x12\xce\xe0\x62\x92\xe6\x9b\x6d\x8d\xea\xbb\x8d\x9b\x0e\x6a\x77\x5b\x0f\xd0\x26\x8b\xe7\x6e\xe5\xbf\xf1\xf2\x7d\x5e\xed\xca\x41\xdb\xf3\xf9\xeb\x22\xff\xe8\xee\xb6\x9b\xfd\x17\xc2\x27\x17\x93\x31\xf0\x6f\x4d\x9c\xa4\xd7\xad\x91\xdb\xab\x8e\xb4\x59\x5a\xd5\x69\xbe\x6c\x05\x0e\xef\xee\xc4\x65\x1a\x8f\x12\x57\xcd\xcb\xf4\xca\x25\x57\x77\x4f\x15\xa8\xdb\xb7\x10\xfd\x4d\xb9\x2b\xf1\xeb\xd5\xc5\x64\xdc\xa9\xfe\xbb\xfd\x49\xeb\x99\xbf\x55\x45\x59\x4f\xf3\x78\xed\x92\xb4\xf4\xaf\x51\xfd\xd5\x7f\x77\x3d\x8d\xab\xf9\xa0\x95\xcb\xbf\x77\xe1\xdf\x5b\x08\xdf\x6b\x5f\xf8\x6f\xb1\x9b\xc1\xba\xd8\xec\xbe\x6a\xa6\x6e\xbd\xff\x06\x1a\x4b\xb8\xeb\x7f\xd7\x7d\x9d\xba\x9b\x97\xc5\xed\x74\xe0\xbf\xec\x65\xd8\x32\x46\xad\x40\x0a\x13\x2e\x8d\xb1\x76\x70\x31\xd9\x56\x0e\xf9\xef\xb2\xcf\x82\x84\x5f\xee\xf2\xcd\xc5\x64\xbc\xad\xdc\x45\x80\x65\x57\x84\xf0\xb6\xc4\x7f\x56\x8a\x4e\xdc\xf7\xe5\x18\xc7\x3b\xab\x7e\xc6\xba\x07\xac\xda\xd8\xf2\x6d\xbc\x76\x1d\x26\x7f\xd2\x63\x55\xfa\xe9\x33\x3c\xdf\xa5\x9f\x3e\xc3\xb3\x9d\xdc\xbe\xe3\x31\x78\x6e\x93\x3a\xfd\x9c\xe0\xe1\x15\x5a\x97\xfc\x3b\x1b\x75\x26\x4c\xc6\x3b\xa8\x02\xb5\x0b\xe1\xab\x22\xb9\x3b\x84\xe7\x04\xd6\x27\xdd\xfb\x27\x82\x63\xbc\xd7\xa6\x1f\xda\xcb\x62\xbb\x19\x5c\xfc\xbd\x40\xdb\x4d\x37\x26\xfd\xf6\x5d\x05\x7a\xfc\xff\xba\x4e\xe2\x6a\x75\xfe\x88\xfc\x54\xaf\x3f\x3b\xaf\x33\xa1\xa3\xff\xfd\xfd\x08\x85\x64\x8a\x5f\xe5\x75\x99\xba\x2a\xe4\x39\xaf\x7e\xcb\xc4\x3f\x7a\x3c\xa0\xfb\x73\x26\x01\xa6\xe9\x02\xe1\x37\xd5\xb7\x69\xd9\xf2\x6b\x5e\x40\x69\x03\x25\x04\x47\x1b\x2a\xf4\x0f\x22\x85\x53\x38\x93\x0e\x46\x47\xf3\x6a\x48\x2f\x32\xba\x82\xb8\xac\x72\xff\x25\x32\x30\x25\x11\x67\xfc\xa0\x0c\x69\xb0\xf0\x33\x12\xb4\x87\xc7\x13\x60\x40\x78\x0e\x2e\x1e\x9f\x55\xf8\xc3\x4f\x97\x9d\x43\x0a\x5f\xba\x78\x11\x8e\xa7\x3e\x7a\xba\xe6\x3f\x6c\x72\x00\x42\x12\xd7\xf1\x28\x44\xd2\x60\x44\x0f\xe2\xe5\x89\x99\x1e\xaf\xbb\xbf\xc7\x10\xd7\x20\xd4\x04\xc2\xff\x62\x47\x98\x8c\xfd\xfd\x13\x6e\x1d\x95\x5b\xd1\xbe\x2f\x92\xf7\xe9\xda\xa1\xff\x85\xe2\x45\xed\xca\x57\x9b\x62\xbe\x42\xbd\x2d\x9f\x62\x16\xd2\x80\x7f\xc3\x0b\x2e\xbc\x1c\x2d\x97\x60\xa0\xce\xed\x64\x0c\x73\x9e\x4a\xf2\x58\xaf\x27\x9b\xfc\xdf\xff\xfd\x7f\x3e\x27\xfe\xbf\x19\x4c\x9d\xa5\x93\x71\x27\x9d\x4c\xc6\xfe\x4c\xed\x1f\xc1\x93\x71\x5b\x3a\x4c\xe0\x90\xdd\xd4\x7e\xf8\x3a\x2e\x51\x38\xc5\x5f\x65\x68\x8a\x92\x62\xbe\x5d\xbb\xbc\xc6\x4b\x57\xbf\xca\x1c\x5c\xbe\xbc\x7b\x93\x0c\x9b\x93\xfe\xe4\xf4\x1c\x16\xb5\x0b\xf0\xa2\x98\x6f\xab\x61\x43\xdc\xe6\xf3\x3a\x2d\x72\xd4\x16\x05\xfe\x55\xb3\xb0\xc3\xef\x68\xba\xdb\x05\x5f\xc7\xd9\xd6\xe1\xba\x4c\xd7\xc3\x53\x5c\x17\x97\xc5\x8d\x2b\x67\x71\xe5\x1a\x3e\x7e\x81\xcb\xdc\xba\xea\xca\xf3\xfb\xd6\x95\x77\xef\x5c\xe6\xe6\x75\x51\xbe\xc8\xb2\xe1\x49\x5d\x62\x08\x85\x46\xa4\x23\xbf\x02\x2f\x8a\xf2\x55\x3c\x5f\x0d\x5b\x61\x86\x2e\x6b\xe5\x38\x4a\x17\x68\xf8\xc5\xef\xbb\xdb\x23\x97\x61\xff\xc2\x18\x6e\xde\xfb\x43\x53\x74\x72\x72\xde\x0c\x96\xae\xde\x96\x79\x73\xd7\xd8\x18\x04\x83\x28\xf2\x96\x72\x59\x5f\xa6\xe1\x89\x7f\x5b\xb4\x15\x67\x37\xf9\xe7\x18\x66\x87\x65\x18\xea\xab\x59\xf8\x6b\x85\xcf\x18\xc0\x4b\xda\xac\xc5\x69\x9e\xb8\xdb\x1f\x16\xc3\xdf\x4f\xd1\x17\xd3\x29\x1a\xd1\x3f\xa7\xc0\x83\x07\xe3\x67\xa7\xe6\x45\xee\x4e\x7a\x1a\x3e\x04\x01\x1e\x7a\xee\xcc\x8a\x79\x9c\xa5\x9f\xdc\xb7\x4d\x64\x0c\x5d\x84\xbc\x50\x11\x8a\xcb\x56\x18\x90\xd8\x75\xd5\x43\xd3\xe9\xd4\xbf\xc1\xbe\x48\x73\x97\xec\x64\xee\x9a\xf5\x61\xe7\xed\x04\x2c\xe4\x6e\x10\x6c\x31\x74\x80\xbd\x17\x75\xf3\xd7\x38\xc3\x93\x36\x22\x4f\x4e\x1b\xf3\xc0\x5e\x69\xf5\x36\x7e\x3b\x4c\x4e\x77\x8c\x1f\xb1\xe8\x48\xd2\x35\xea\x93\x65\x87\xfc\x1c\x3e\x1f\x69\x83\x12\xef\x29\x68\x41\xdf\xd5\x65\x9a\x2f\x87\xbf\xfe\x16\xa1\xfb\x24\xbe\x3b\x43\x03\x36\x4a\xd2\x65\x5a\x0f\x22\xb4\x2e\xf2\x7a\xd5\xa3\xdc\xb9\xb8\x3c\x43\x83\x7c\xbb\x76\x65\x3a\x1f\x44\x68\x55\x6c\xcb\xfe\x9a\x34\xdf\xd6\xae\x47\xaa\xdc\xbc\xc8\x93\x0e\xa9\xeb\x19\xb0\x18\x18\xe4\x32\xad\x40\xb0\x17\x65\x19\xdf\xe1\x4d\x59\xd4\x05\x14\xf1\xb8\xca\xd2\xb9\xc3\xf3\x38\xcb\x86\x07\xa2\xb9\x7a\x79\xf7\x3e\x5e\x42\x31\x36\x1c\x00\x93\x41\x63\xd5\x96\xe1\x2e\x82\x1e\xbb\xfd\xf4\xfc\xb8\xdd\x7c\xe9\xea\x0f\x65\xf6\x63\x5c\xc6\x6b\x57\xbb\x12\x62\xbb\x05\xcb\xa3\xa1\x61\xe5\x2f\xbb\xa9\xa0\xfa\x31\x5e\xba\x0f\x3f\x5d\xa2\x29\xba\x49\xf3\xa4\xb8\xc1\xb0\x13\x2c\xc6\x95\x8b\xcb\xf9\x0a\x57\xdb\xab\x2a\x98\x98\x9e\x46\x7e\x5d\xf5\xe1\xa7\xcb\x9f\xa1\x41\xb8\xca\x1c\x64\x85\x96\x07\xae\x36\x59\x5a\x0f\x4f\xfe\x7a\xd2\x4e\xdc\xed\xfc\xd6\xbf\xb9\xed\xfd\x1e\x04\x3f\x5a\x14\x25\x1a\xa6\x68\x8a\xc8\x39\x4a\xd1\x04\xf5\x98\xe2\xcc\xe5\xcb\x7a\x75\x8e\xd2\x6f\xbe\xd9\x81\xa3\xcf\x0d\xf6\xed\x2e\xf9\x35\xfd\xad\xdd\x7f\x7a\xd2\x58\x27\xa0\xac\xbf\xee\x57\xf2\x9b\x0f\x86\xbe\x29\x5a\xe4\xa1\x47\x93\xe9\x6f\xfd\xc8\x41\x7f\x43\x75\xb9\x75\xe8\x0c\x25\x6e\x5e\x24\xee\xc3\x4f\x6f\x66\xc5\x7a\x53\xe4\x2e\xaf\x1f\x6f\x44\x7f\x3b\x7d\x0a\xe4\x87\x7e\x72\x6e\xde\xdc\xf5\x87\x0c\x2c\x3a\xdd\x7b\xc6\x9f\xbf\x68\xfa\xc4\x87\x27\x7e\xe0\xe4\x51\x76\x06\x2c\x1d\x3e\x30\xaa\x97\x77\xb3\x96\x7d\x67\xa3\xf3\xd6\x0b\x43\x60\xe1\x1d\x11\xa1\x60\x76\x9f\x4e\xc3\xda\xbd\x23\xd0\x04\x1d\x72\x0a\x2c\x9e\x6f\xcb\xf2\x75\xe9\x16\x9d\x75\xe0\x0d\x28\x6c\x76\xc1\x3e\x0c\xe5\xc4\xf4\x04\x7a\xca\x93\xd3\x7b\xd4\x98\xdd\xaf\x5f\x2d\xd1\x74\xc7\x05\x97\xce\x77\xbc\xc3\x30\x35\x42\x27\x31\xac\x38\xdf\xa5\xce\xfe\x0e\xb0\x72\xb5\xec\x9f\x0c\x9d\xed\xe2\x3f\xbd\x5b\x1c\x36\x0b\xf2\xfd\x1b\xbb\x1d\x72\x6b\xe9\xe2\x04\x50\xf9\x5d\x9a\x85\xd7\xb0\xa1\x52\xea\x86\xdd\x36\x4f\xbd\xbf\x7e\x3d\x79\x09\x9b\xfe\xc3\x7f\x7e\xef\x3f\xff\xee\x3f\xdf\xfb\xcf\x1f\xfd\xe7\x2b\xff\xf9\x2f\xff\xf9\xcb\xcb\x93\xdf\xf6\x9e\x0f\xf1\xe3\x6f\x6f\x56\x69\x16\xf6\x41\x17\x53\x44\x09\x13\xfb\xc0\x01\xe2\x38\x10\x1b\xd1\xbf\xf9\x26\xed\x66\xfd\x06\xfc\x9b\xb8\xac\xdc\x77\x59\x11\xd7\x41\x60\x5c\x17\xdf\xa5\xb7\xce\xbf\x47\xff\x0d\x3a\x41\x27\xe8\x9b\x20\xf9\xaf\xe9\x6f\x4d\x02\xec\xa9\xdd\x7d\xef\xbc\x9b\x63\xd2\x4f\xee\x79\x70\xee\xf2\x1f\x4c\x1b\x9c\x76\xd3\xc3\x5e\xc5\x90\x22\x80\xcf\xc1\xd4\xb0\xda\xae\xe3\x1c\xf6\x45\xd3\xc3\xb6\xf7\x0e\x4c\xf3\xdc\x95\xaf\xdf\x7f\x7f\xd9\xba\xf7\xe9\x08\x9a\xa2\x1d\xaf\x8e\x77\xc3\x63\xa9\xb6\x4c\x9b\x8c\x43\x6d\x37\x19\x87\x3f\xc8\xfc\x7f\x01\x00\x00\xff\xff\xd1\xe7\x7f\xef\x40\x3c\x00\x00"), - }, - } - fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ - fs["/index.html"].(os.FileInfo), - } - - return fs -}() - -type vfsgen۰FS map[string]interface{} - -func (fs vfsgen۰FS) Open(path string) (http.File, error) { - path = pathpkg.Clean("/" + path) - f, ok := fs[path] - if !ok { - return nil, &os.PathError{Op: "open", Path: path, Err: os.ErrNotExist} - } - - switch f := f.(type) { - case *vfsgen۰CompressedFileInfo: - gr, err := gzip.NewReader(bytes.NewReader(f.compressedContent)) - if err != nil { - // This should never happen because we generate the gzip bytes such that they are always valid. - panic("unexpected error reading own gzip compressed bytes: " + err.Error()) - } - return &vfsgen۰CompressedFile{ - vfsgen۰CompressedFileInfo: f, - gr: gr, - }, nil - case *vfsgen۰DirInfo: - return &vfsgen۰Dir{ - vfsgen۰DirInfo: f, - }, nil - default: - // This should never happen because we generate only the above types. - panic(fmt.Sprintf("unexpected type %T", f)) - } -} - -// vfsgen۰CompressedFileInfo is a static definition of a gzip compressed file. -type vfsgen۰CompressedFileInfo struct { - name string - modTime time.Time - compressedContent []byte - uncompressedSize int64 -} - -func (f *vfsgen۰CompressedFileInfo) Readdir(count int) ([]os.FileInfo, error) { - return nil, fmt.Errorf("cannot Readdir from file %s", f.name) -} -func (f *vfsgen۰CompressedFileInfo) Stat() (os.FileInfo, error) { return f, nil } - -func (f *vfsgen۰CompressedFileInfo) GzipBytes() []byte { - return f.compressedContent -} - -func (f *vfsgen۰CompressedFileInfo) Name() string { return f.name } -func (f *vfsgen۰CompressedFileInfo) Size() int64 { return f.uncompressedSize } -func (f *vfsgen۰CompressedFileInfo) Mode() os.FileMode { return 0444 } -func (f *vfsgen۰CompressedFileInfo) ModTime() time.Time { return f.modTime } -func (f *vfsgen۰CompressedFileInfo) IsDir() bool { return false } -func (f *vfsgen۰CompressedFileInfo) Sys() interface{} { return nil } - -// vfsgen۰CompressedFile is an opened compressedFile instance. -type vfsgen۰CompressedFile struct { - *vfsgen۰CompressedFileInfo - gr *gzip.Reader - grPos int64 // Actual gr uncompressed position. - seekPos int64 // Seek uncompressed position. -} - -func (f *vfsgen۰CompressedFile) Read(p []byte) (n int, err error) { - if f.grPos > f.seekPos { - // Rewind to beginning. - err = f.gr.Reset(bytes.NewReader(f.compressedContent)) - if err != nil { - return 0, err - } - f.grPos = 0 - } - if f.grPos < f.seekPos { - // Fast-forward. - _, err = io.CopyN(io.Discard, f.gr, f.seekPos-f.grPos) - if err != nil { - return 0, err - } - f.grPos = f.seekPos - } - n, err = f.gr.Read(p) - f.grPos += int64(n) - f.seekPos = f.grPos - return n, err -} -func (f *vfsgen۰CompressedFile) Seek(offset int64, whence int) (int64, error) { - switch whence { - case io.SeekStart: - f.seekPos = 0 + offset - case io.SeekCurrent: - f.seekPos += offset - case io.SeekEnd: - f.seekPos = f.uncompressedSize + offset - default: - panic(fmt.Errorf("invalid whence value: %v", whence)) - } - return f.seekPos, nil -} -func (f *vfsgen۰CompressedFile) Close() error { - return f.gr.Close() -} - -// vfsgen۰DirInfo is a static definition of a directory. -type vfsgen۰DirInfo struct { - name string - modTime time.Time - entries []os.FileInfo -} - -func (d *vfsgen۰DirInfo) Read([]byte) (int, error) { - return 0, fmt.Errorf("cannot Read from directory %s", d.name) -} -func (d *vfsgen۰DirInfo) Close() error { return nil } -func (d *vfsgen۰DirInfo) Stat() (os.FileInfo, error) { return d, nil } - -func (d *vfsgen۰DirInfo) Name() string { return d.name } -func (d *vfsgen۰DirInfo) Size() int64 { return 0 } -func (d *vfsgen۰DirInfo) Mode() os.FileMode { return 0755 | os.ModeDir } -func (d *vfsgen۰DirInfo) ModTime() time.Time { return d.modTime } -func (d *vfsgen۰DirInfo) IsDir() bool { return true } -func (d *vfsgen۰DirInfo) Sys() interface{} { return nil } - -// vfsgen۰Dir is an opened dir instance. -type vfsgen۰Dir struct { - *vfsgen۰DirInfo - pos int // Position within entries for Seek and Readdir. -} - -func (d *vfsgen۰Dir) Seek(offset int64, whence int) (int64, error) { - if offset == 0 && whence == io.SeekStart { - d.pos = 0 - return 0, nil - } - return 0, fmt.Errorf("unsupported Seek in directory %s", d.name) -} - -func (d *vfsgen۰Dir) Readdir(count int) ([]os.FileInfo, error) { - if d.pos >= len(d.entries) && count > 0 { - return nil, io.EOF - } - if count <= 0 || count > len(d.entries)-d.pos { - count = len(d.entries) - d.pos - } - e := d.entries[d.pos : d.pos+count] - d.pos += count - return e, nil -} diff --git a/cmd/serve/http/data/data.go b/cmd/serve/http/data/data.go deleted file mode 100644 index d0ab355b5db2b..0000000000000 --- a/cmd/serve/http/data/data.go +++ /dev/null @@ -1,99 +0,0 @@ -// Package data provides common functionality for http servers -// The "go:generate" directive compiles static assets by running assets_generate.go -// -//go:generate go run assets_generate.go -package data - -import ( - "fmt" - "html/template" - "io" - "os" - "time" - - "github.com/spf13/pflag" - - "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/config/flags" -) - -// Help describes the options for the serve package -var Help = ` -#### Template - -` + "`--template`" + ` allows a user to specify a custom markup template for HTTP -and WebDAV serve functions. The server exports the following markup -to be used within the template to server pages: - -| Parameter | Description | -| :---------- | :---------- | -| .Name | The full path of a file/directory. | -| .Title | Directory listing of .Name | -| .Sort | The current sort used. This is changeable via ?sort= parameter | -| | Sort Options: namedirfirst,name,size,time (default namedirfirst) | -| .Order | The current ordering used. This is changeable via ?order= parameter | -| | Order Options: asc,desc (default asc) | -| .Query | Currently unused. | -| .Breadcrumb | Allows for creating a relative navigation | -|-- .Link | The relative to the root link of the Text. | -|-- .Text | The Name of the directory. | -| .Entries | Information about a specific file/directory. | -|-- .URL | The 'url' of an entry. | -|-- .Leaf | Currently same as 'URL' but intended to be 'just' the name. | -|-- .IsDir | Boolean for if an entry is a directory or not. | -|-- .Size | Size in Bytes of the entry. | -|-- .ModTime | The UTC timestamp of an entry. | -` - -// Options for the templating functionality -type Options struct { - Template string -} - -// AddFlags for the templating functionality -func AddFlags(flagSet *pflag.FlagSet, prefix string, Opt *Options) { - flags.StringVarP(flagSet, &Opt.Template, prefix+"template", "", Opt.Template, "User-specified template") -} - -// AfterEpoch returns the time since the epoch for the given time -func AfterEpoch(t time.Time) bool { - return t.After(time.Time{}) -} - -// GetTemplate returns the HTML template for serving directories via HTTP/WebDAV -func GetTemplate(tmpl string) (tpl *template.Template, err error) { - var templateString string - if tmpl == "" { - templateFile, err := Assets.Open("index.html") - if err != nil { - return nil, fmt.Errorf("get template open: %w", err) - } - - defer fs.CheckClose(templateFile, &err) - - templateBytes, err := io.ReadAll(templateFile) - if err != nil { - return nil, fmt.Errorf("get template read: %w", err) - } - - templateString = string(templateBytes) - - } else { - templateFile, err := os.ReadFile(tmpl) - if err != nil { - return nil, fmt.Errorf("get template open: %w", err) - } - - templateString = string(templateFile) - } - - funcMap := template.FuncMap{ - "afterEpoch": AfterEpoch, - } - tpl, err = template.New("index").Funcs(funcMap).Parse(templateString) - if err != nil { - return nil, fmt.Errorf("get template parse: %w", err) - } - - return -} diff --git a/cmd/serve/http/data/templates/index.html b/cmd/serve/http/data/templates/index.html deleted file mode 100644 index 348050c0278e4..0000000000000 --- a/cmd/serve/http/data/templates/index.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - {{html .Name}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    - {{range $i, $crumb := .Breadcrumb}}{{html $crumb.Text}}{{if ne $i 0}}/{{end}}{{end}} -

    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - {{- range .Entries}} - - - - {{- if .IsDir}} - - {{- else}} - - {{- end}} - {{- if .ModTime | afterEpoch }} - - {{- else}} - - {{- end}} - - - {{- end}} - -
    - - - Name - - Size - - Modified -
    - - Go up - -
    - - {{- if .IsDir}} - - {{- else}} - - {{- end}} - {{html .Leaf}} - {{.Size}}
    -
    -
    - - - diff --git a/cmd/serve/http/http.go b/cmd/serve/http/http.go index 0385b21c758dc..6af35ccd9f21f 100644 --- a/cmd/serve/http/http.go +++ b/cmd/serve/http/http.go @@ -22,6 +22,7 @@ import ( "github.com/rclone/rclone/fs/accounting" libhttp "github.com/rclone/rclone/lib/http" "github.com/rclone/rclone/lib/http/serve" + "github.com/rclone/rclone/lib/systemd" "github.com/rclone/rclone/vfs" "github.com/rclone/rclone/vfs/vfsflags" "github.com/spf13/cobra" @@ -44,11 +45,15 @@ var DefaultOpt = Options{ // Opt is options set by command line flags var Opt = DefaultOpt +// flagPrefix is the prefix used to uniquely identify command line flags. +// It is intentionally empty for this package. +const flagPrefix = "" + func init() { flagSet := Command.Flags() - libhttp.AddAuthFlagsPrefix(flagSet, "", &Opt.Auth) - libhttp.AddHTTPFlagsPrefix(flagSet, "", &Opt.HTTP) - libhttp.AddTemplateFlagsPrefix(flagSet, "", &Opt.Template) + libhttp.AddAuthFlagsPrefix(flagSet, flagPrefix, &Opt.Auth) + libhttp.AddHTTPFlagsPrefix(flagSet, flagPrefix, &Opt.HTTP) + libhttp.AddTemplateFlagsPrefix(flagSet, flagPrefix, &Opt.Template) vfsflags.AddFlags(flagSet) proxyflags.AddFlags(flagSet) } @@ -68,9 +73,10 @@ The server will log errors. Use ` + "`-v`" + ` to see access logs. ` + "`--bwlimit`" + ` will be respected for file transfers. Use ` + "`--stats`" + ` to control the stats printing. -` + libhttp.Help + libhttp.TemplateHelp + libhttp.AuthHelp + vfs.Help + proxy.Help, +` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help + proxy.Help, Annotations: map[string]string{ "versionIntroduced": "v1.39", + "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { var f fs.Fs @@ -87,6 +93,7 @@ control the stats printing. log.Fatal(err) } + defer systemd.Notify()() s.server.Wait() return nil }) diff --git a/cmd/serve/nfs/filesystem.go b/cmd/serve/nfs/filesystem.go new file mode 100644 index 0000000000000..25916e0ddc804 --- /dev/null +++ b/cmd/serve/nfs/filesystem.go @@ -0,0 +1,159 @@ +//go:build unix +// +build unix + +package nfs + +import ( + "os" + "path" + "strings" + "time" + + billy "github.com/go-git/go-billy/v5" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/vfs" + "github.com/rclone/rclone/vfs/vfscommon" +) + +// FS is our wrapper around the VFS to properly support billy.Filesystem interface +type FS struct { + vfs *vfs.VFS +} + +// ReadDir implements read dir +func (f *FS) ReadDir(path string) (dir []os.FileInfo, err error) { + return f.vfs.ReadDir(path) +} + +// Create implements creating new files +func (f *FS) Create(filename string) (billy.File, error) { + return f.vfs.Create(filename) +} + +// Open opens a file +func (f *FS) Open(filename string) (billy.File, error) { + return f.vfs.Open(filename) +} + +// OpenFile opens a file +func (f *FS) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error) { + return f.vfs.OpenFile(filename, flag, perm) +} + +// Stat gets the file stat +func (f *FS) Stat(filename string) (os.FileInfo, error) { + return f.vfs.Stat(filename) +} + +// Rename renames a file +func (f *FS) Rename(oldpath, newpath string) error { + return f.vfs.Rename(oldpath, newpath) +} + +// Remove deletes a file +func (f *FS) Remove(filename string) error { + return f.vfs.Remove(filename) +} + +// Join joins path elements +func (f *FS) Join(elem ...string) string { + return path.Join(elem...) +} + +// TempFile is not implemented +func (f *FS) TempFile(dir, prefix string) (billy.File, error) { + return nil, os.ErrInvalid +} + +// MkdirAll creates a directory and all the ones above it +// it does not redirect to VFS.MkDirAll because that one doesn't +// honor the permissions +func (f *FS) MkdirAll(filename string, perm os.FileMode) error { + parts := strings.Split(filename, "/") + for i := range parts { + current := strings.Join(parts[:i+1], "/") + _, err := f.Stat(current) + if err == vfs.ENOENT { + err = f.vfs.Mkdir(current, perm) + if err != nil { + return err + } + } + } + return nil +} + +// Lstat gets the stats for symlink +func (f *FS) Lstat(filename string) (os.FileInfo, error) { + return f.vfs.Stat(filename) +} + +// Symlink is not supported over NFS +func (f *FS) Symlink(target, link string) error { + return os.ErrInvalid +} + +// Readlink is not supported +func (f *FS) Readlink(link string) (string, error) { + return "", os.ErrInvalid +} + +// Chmod changes the file modes +func (f *FS) Chmod(name string, mode os.FileMode) error { + file, err := f.vfs.Open(name) + if err != nil { + return err + } + defer func() { + if err := file.Close(); err != nil { + fs.Logf(f, "Error while closing file: %e", err) + } + }() + return file.Chmod(mode) +} + +// Lchown changes the owner of symlink +func (f *FS) Lchown(name string, uid, gid int) error { + return f.Chown(name, uid, gid) +} + +// Chown changes owner of the file +func (f *FS) Chown(name string, uid, gid int) error { + file, err := f.vfs.Open(name) + if err != nil { + return err + } + defer func() { + if err := file.Close(); err != nil { + fs.Logf(f, "Error while closing file: %e", err) + } + }() + return file.Chown(uid, gid) +} + +// Chtimes changes the acces time and modified time +func (f *FS) Chtimes(name string, atime time.Time, mtime time.Time) error { + return f.vfs.Chtimes(name, atime, mtime) +} + +// Chroot is not supported in VFS +func (f *FS) Chroot(path string) (billy.Filesystem, error) { + return nil, os.ErrInvalid +} + +// Root returns the root of a VFS +func (f *FS) Root() string { + return f.vfs.Fs().Root() +} + +// Capabilities exports the filesystem capabilities +func (f *FS) Capabilities() billy.Capability { + if f.vfs.Opt.CacheMode == vfscommon.CacheModeOff { + return billy.ReadCapability | billy.SeekCapability + } + return billy.WriteCapability | billy.ReadCapability | + billy.ReadAndWriteCapability | billy.SeekCapability | billy.TruncateCapability +} + +// Interface check +var _ billy.Filesystem = (*FS)(nil) diff --git a/cmd/serve/nfs/handler.go b/cmd/serve/nfs/handler.go new file mode 100644 index 0000000000000..4a34d6138f76b --- /dev/null +++ b/cmd/serve/nfs/handler.go @@ -0,0 +1,70 @@ +//go:build unix +// +build unix + +package nfs + +import ( + "context" + "net" + + "github.com/go-git/go-billy/v5" + "github.com/rclone/rclone/vfs" + "github.com/willscott/go-nfs" + nfshelper "github.com/willscott/go-nfs/helpers" +) + +// NewBackendAuthHandler creates a handler for the provided filesystem +func NewBackendAuthHandler(vfs *vfs.VFS) nfs.Handler { + return &BackendAuthHandler{vfs} +} + +// BackendAuthHandler returns a NFS backing that exposes a given file system in response to all mount requests. +type BackendAuthHandler struct { + vfs *vfs.VFS +} + +// Mount backs Mount RPC Requests, allowing for access control policies. +func (h *BackendAuthHandler) Mount(ctx context.Context, conn net.Conn, req nfs.MountRequest) (status nfs.MountStatus, hndl billy.Filesystem, auths []nfs.AuthFlavor) { + status = nfs.MountStatusOk + hndl = &FS{vfs: h.vfs} + auths = []nfs.AuthFlavor{nfs.AuthFlavorNull} + return +} + +// Change provides an interface for updating file attributes. +func (h *BackendAuthHandler) Change(fs billy.Filesystem) billy.Change { + if c, ok := fs.(billy.Change); ok { + return c + } + return nil +} + +// FSStat provides information about a filesystem. +func (h *BackendAuthHandler) FSStat(ctx context.Context, f billy.Filesystem, s *nfs.FSStat) error { + total, _, free := h.vfs.Statfs() + s.TotalSize = uint64(total) + s.FreeSize = uint64(free) + s.AvailableSize = uint64(free) + return nil +} + +// ToHandle handled by CachingHandler +func (h *BackendAuthHandler) ToHandle(f billy.Filesystem, s []string) []byte { + return []byte{} +} + +// FromHandle handled by CachingHandler +func (h *BackendAuthHandler) FromHandle([]byte) (billy.Filesystem, []string, error) { + return nil, []string{}, nil +} + +// HandleLimit handled by cachingHandler +func (h *BackendAuthHandler) HandleLimit() int { + return -1 +} + +func newHandler(vfs *vfs.VFS) nfs.Handler { + handler := NewBackendAuthHandler(vfs) + cacheHelper := nfshelper.NewCachingHandler(handler, 1024) + return cacheHelper +} diff --git a/cmd/serve/nfs/nfs.go b/cmd/serve/nfs/nfs.go new file mode 100644 index 0000000000000..3e4722cb64661 --- /dev/null +++ b/cmd/serve/nfs/nfs.go @@ -0,0 +1,97 @@ +//go:build unix +// +build unix + +// Package nfs implements a server to serve a VFS remote over NFSv3 protocol +// +// There is no authentication available on this server +// and it is served on loopback interface by default. +// +// This is primarily used for mounting a VFS remote +// in macOS, where FUSE-mounting mechanisms are usually not available. +package nfs + +import ( + "context" + + "github.com/rclone/rclone/cmd" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/rc" + "github.com/rclone/rclone/vfs" + "github.com/rclone/rclone/vfs/vfsflags" + "github.com/spf13/cobra" + "github.com/spf13/pflag" +) + +// Options contains options for the NFS Server +type Options struct { + ListenAddr string // Port to listen on +} + +var opt Options + +// AddFlags adds flags for the sftp +func AddFlags(flagSet *pflag.FlagSet, Opt *Options) { + rc.AddOption("nfs", &Opt) + flags.StringVarP(flagSet, &Opt.ListenAddr, "addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to", "") +} + +func init() { + vfsflags.AddFlags(Command.Flags()) + AddFlags(Command.Flags(), &opt) +} + +// Run the command +func Run(command *cobra.Command, args []string) { + var f fs.Fs + cmd.CheckArgs(1, 1, command, args) + f = cmd.NewFsSrc(args) + cmd.Run(false, true, command, func() error { + s, err := NewServer(context.Background(), vfs.New(f, &vfsflags.Opt), &opt) + if err != nil { + return err + } + return s.Serve() + }) +} + +// Command is the definition of the command +var Command = &cobra.Command{ + Use: "nfs remote:path", + Short: `Serve the remote as an NFS mount`, + Long: `Create an NFS server that serves the given remote over the network. + +The primary purpose for this command is to enable [mount command](/commands/rclone_mount/) on recent macOS versions where +installing FUSE is very cumbersome. + +Since this is running on NFSv3, no authentication method is available. Any client +will be able to access the data. To limit access, you can use serve NFS on loopback address +and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; +meaning that it is only available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address and port using ` + "`--addr`" + ` flag. + +Modifying files through NFS protocol requires VFS caching. Usually you will need to specify ` + "`--vfs-cache-mode`" + ` +in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, +the mount will be read-only. + +To serve NFS over the network use following command: + + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full + +We specify a specific port that we can use in the mount command: + +To mount the server under Linux/macOS, use the following command: + + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint + +Where ` + "`$PORT`" + ` is the same port number we used in the serve nfs command. + +This feature is only available on Unix platforms. + +` + vfs.Help, + Annotations: map[string]string{ + "versionIntroduced": "v1.65", + "groups": "Filter", + }, + Run: Run, +} diff --git a/cmd/serve/nfs/nfs_unsupported.go b/cmd/serve/nfs/nfs_unsupported.go new file mode 100644 index 0000000000000..99b2f6df63066 --- /dev/null +++ b/cmd/serve/nfs/nfs_unsupported.go @@ -0,0 +1,13 @@ +// For unsupported architectures +//go:build !unix +// +build !unix + +// Package nfs is not supported on non-Unix platforms +package nfs + +import ( + "github.com/spf13/cobra" +) + +// For unsupported platforms we just put nil +var Command *cobra.Command = nil diff --git a/cmd/serve/nfs/server.go b/cmd/serve/nfs/server.go new file mode 100644 index 0000000000000..c66e687a901df --- /dev/null +++ b/cmd/serve/nfs/server.go @@ -0,0 +1,61 @@ +//go:build unix +// +build unix + +package nfs + +import ( + "context" + "net" + + nfs "github.com/willscott/go-nfs" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/vfs" + "github.com/rclone/rclone/vfs/vfscommon" +) + +// Server contains everything to run the Server +type Server struct { + opt Options + handler nfs.Handler + ctx context.Context // for global config + listener net.Listener +} + +// NewServer creates a new server +func NewServer(ctx context.Context, vfs *vfs.VFS, opt *Options) (s *Server, err error) { + if vfs.Opt.CacheMode == vfscommon.CacheModeOff { + fs.LogPrintf(fs.LogLevelWarning, ctx, "NFS writes don't work without a cache, the filesystem will be served read-only") + } + // Our NFS server doesn't have any authentication, we run it on localhost and random port by default + if opt.ListenAddr == "" { + opt.ListenAddr = "localhost:" + } + + s = &Server{ + ctx: ctx, + opt: *opt, + } + s.handler = newHandler(vfs) + s.listener, err = net.Listen("tcp", s.opt.ListenAddr) + if err != nil { + fs.Errorf(nil, "NFS server failed to listen: %v\n", err) + } + return +} + +// Addr returns the listening address of the server +func (s *Server) Addr() net.Addr { + return s.listener.Addr() +} + +// Shutdown stops the server +func (s *Server) Shutdown() error { + return s.listener.Close() +} + +// Serve starts the server +func (s *Server) Serve() (err error) { + fs.Logf(nil, "NFS Server running at %s\n", s.listener.Addr()) + return nfs.Serve(s.listener, s.handler) +} diff --git a/cmd/serve/proxy/proxyflags/proxyflags.go b/cmd/serve/proxy/proxyflags/proxyflags.go index 043cc6e4426a6..33fa5512dd535 100644 --- a/cmd/serve/proxy/proxyflags/proxyflags.go +++ b/cmd/serve/proxy/proxyflags/proxyflags.go @@ -14,5 +14,5 @@ var ( // AddFlags adds the non filing system specific flags to the command func AddFlags(flagSet *pflag.FlagSet) { - flags.StringVarP(flagSet, &Opt.AuthProxy, "auth-proxy", "", Opt.AuthProxy, "A program to use to create the backend from the auth") + flags.StringVarP(flagSet, &Opt.AuthProxy, "auth-proxy", "", Opt.AuthProxy, "A program to use to create the backend from the auth", "") } diff --git a/cmd/serve/restic/restic.go b/cmd/serve/restic/restic.go index fbdc947e13d8d..be56fe947a05b 100644 --- a/cmd/serve/restic/restic.go +++ b/cmd/serve/restic/restic.go @@ -23,6 +23,7 @@ import ( "github.com/rclone/rclone/fs/walk" libhttp "github.com/rclone/rclone/lib/http" "github.com/rclone/rclone/lib/http/serve" + "github.com/rclone/rclone/lib/systemd" "github.com/rclone/rclone/lib/terminal" "github.com/spf13/cobra" "golang.org/x/net/http2" @@ -47,14 +48,18 @@ var DefaultOpt = Options{ // Opt is options set by command line flags var Opt = DefaultOpt +// flagPrefix is the prefix used to uniquely identify command line flags. +// It is intentionally empty for this package. +const flagPrefix = "" + func init() { flagSet := Command.Flags() - libhttp.AddAuthFlagsPrefix(flagSet, "", &Opt.Auth) - libhttp.AddHTTPFlagsPrefix(flagSet, "", &Opt.HTTP) - flags.BoolVarP(flagSet, &Opt.Stdio, "stdio", "", false, "Run an HTTP2 server on stdin/stdout") - flags.BoolVarP(flagSet, &Opt.AppendOnly, "append-only", "", false, "Disallow deletion of repository data") - flags.BoolVarP(flagSet, &Opt.PrivateRepos, "private-repos", "", false, "Users can only access their private repo") - flags.BoolVarP(flagSet, &Opt.CacheObjects, "cache-objects", "", true, "Cache listed objects") + libhttp.AddAuthFlagsPrefix(flagSet, flagPrefix, &Opt.Auth) + libhttp.AddHTTPFlagsPrefix(flagSet, flagPrefix, &Opt.HTTP) + flags.BoolVarP(flagSet, &Opt.Stdio, "stdio", "", false, "Run an HTTP2 server on stdin/stdout", "") + flags.BoolVarP(flagSet, &Opt.AppendOnly, "append-only", "", false, "Disallow deletion of repository data", "") + flags.BoolVarP(flagSet, &Opt.PrivateRepos, "private-repos", "", false, "Users can only access their private repo", "") + flags.BoolVarP(flagSet, &Opt.CacheObjects, "cache-objects", "", true, "Cache listed objects", "") } // Command definition for cobra @@ -142,7 +147,7 @@ these **must** end with /. Eg The` + "`--private-repos`" + ` flag can be used to limit users to repositories starting with a path of ` + "`//`" + `. -` + libhttp.Help + libhttp.AuthHelp, +` + libhttp.Help(flagPrefix) + libhttp.AuthHelp(flagPrefix), Annotations: map[string]string{ "versionIntroduced": "v1.40", }, @@ -173,7 +178,10 @@ with a path of ` + "`//`" + `. return nil } fs.Logf(s.f, "Serving restic REST API on %s", s.URLs()) + + defer systemd.Notify()() s.Wait() + return nil }) }, diff --git a/cmd/serve/s3/backend.go b/cmd/serve/s3/backend.go new file mode 100644 index 0000000000000..397760102b40b --- /dev/null +++ b/cmd/serve/s3/backend.go @@ -0,0 +1,468 @@ +// Package s3 implements an s3 server for rclone +package s3 + +import ( + "context" + "encoding/hex" + "io" + "os" + "path" + "strings" + "sync" + + "github.com/Mikubill/gofakes3" + "github.com/ncw/swift/v2" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/vfs" +) + +var ( + emptyPrefix = &gofakes3.Prefix{} + timeFormat = "Mon, 2 Jan 2006 15:04:05.999999999 GMT" +) + +// s3Backend implements the gofacess3.Backend interface to make an S3 +// backend for gofakes3 +type s3Backend struct { + opt *Options + vfs *vfs.VFS + meta *sync.Map +} + +// newBackend creates a new SimpleBucketBackend. +func newBackend(vfs *vfs.VFS, opt *Options) gofakes3.Backend { + return &s3Backend{ + vfs: vfs, + opt: opt, + meta: new(sync.Map), + } +} + +// ListBuckets always returns the default bucket. +func (b *s3Backend) ListBuckets() ([]gofakes3.BucketInfo, error) { + dirEntries, err := getDirEntries("/", b.vfs) + if err != nil { + return nil, err + } + var response []gofakes3.BucketInfo + for _, entry := range dirEntries { + if entry.IsDir() { + response = append(response, gofakes3.BucketInfo{ + Name: gofakes3.URLEncode(entry.Name()), + CreationDate: gofakes3.NewContentTime(entry.ModTime()), + }) + } + // FIXME: handle files in root dir + } + + return response, nil +} + +// ListBucket lists the objects in the given bucket. +func (b *s3Backend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error) { + _, err := b.vfs.Stat(bucket) + if err != nil { + return nil, gofakes3.BucketNotFound(bucket) + } + if prefix == nil { + prefix = emptyPrefix + } + + // workaround + if strings.TrimSpace(prefix.Prefix) == "" { + prefix.HasPrefix = false + } + if strings.TrimSpace(prefix.Delimiter) == "" { + prefix.HasDelimiter = false + } + + response := gofakes3.NewObjectList() + if b.vfs.Fs().Features().BucketBased || prefix.HasDelimiter && prefix.Delimiter != "/" { + err = b.getObjectsListArbitrary(bucket, prefix, response) + } else { + path, remaining := prefixParser(prefix) + err = b.entryListR(bucket, path, remaining, prefix.HasDelimiter, response) + } + + if err == gofakes3.ErrNoSuchKey { + // AWS just returns an empty list + response = gofakes3.NewObjectList() + } else if err != nil { + return nil, err + } + + return b.pager(response, page) +} + +// HeadObject returns the fileinfo for the given object name. +// +// Note that the metadata is not supported yet. +func (b *s3Backend) HeadObject(bucketName, objectName string) (*gofakes3.Object, error) { + _, err := b.vfs.Stat(bucketName) + if err != nil { + return nil, gofakes3.BucketNotFound(bucketName) + } + + fp := path.Join(bucketName, objectName) + node, err := b.vfs.Stat(fp) + if err != nil { + return nil, gofakes3.KeyNotFound(objectName) + } + + if !node.IsFile() { + return nil, gofakes3.KeyNotFound(objectName) + } + + entry := node.DirEntry() + if entry == nil { + return nil, gofakes3.KeyNotFound(objectName) + } + + fobj := entry.(fs.Object) + size := node.Size() + hash := getFileHashByte(fobj) + + meta := map[string]string{ + "Last-Modified": node.ModTime().Format(timeFormat), + "Content-Type": fs.MimeType(context.Background(), fobj), + } + + if val, ok := b.meta.Load(fp); ok { + metaMap := val.(map[string]string) + for k, v := range metaMap { + meta[k] = v + } + } + + return &gofakes3.Object{ + Name: objectName, + Hash: hash, + Metadata: meta, + Size: size, + Contents: noOpReadCloser{}, + }, nil +} + +// GetObject fetchs the object from the filesystem. +func (b *s3Backend) GetObject(bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (obj *gofakes3.Object, err error) { + _, err = b.vfs.Stat(bucketName) + if err != nil { + return nil, gofakes3.BucketNotFound(bucketName) + } + + fp := path.Join(bucketName, objectName) + node, err := b.vfs.Stat(fp) + if err != nil { + return nil, gofakes3.KeyNotFound(objectName) + } + + if !node.IsFile() { + return nil, gofakes3.KeyNotFound(objectName) + } + + entry := node.DirEntry() + if entry == nil { + return nil, gofakes3.KeyNotFound(objectName) + } + + fobj := entry.(fs.Object) + file := node.(*vfs.File) + + size := node.Size() + hash := getFileHashByte(fobj) + + in, err := file.Open(os.O_RDONLY) + if err != nil { + return nil, gofakes3.ErrInternal + } + defer func() { + // If an error occurs, the caller may not have access to Object.Body in order to close it: + if err != nil { + _ = in.Close() + } + }() + + var rdr io.ReadCloser = in + rnge, err := rangeRequest.Range(size) + if err != nil { + return nil, err + } + + if rnge != nil { + if _, err := in.Seek(rnge.Start, io.SeekStart); err != nil { + return nil, err + } + rdr = limitReadCloser(rdr, in.Close, rnge.Length) + } + + meta := map[string]string{ + "Last-Modified": node.ModTime().Format(timeFormat), + "Content-Type": fs.MimeType(context.Background(), fobj), + } + + if val, ok := b.meta.Load(fp); ok { + metaMap := val.(map[string]string) + for k, v := range metaMap { + meta[k] = v + } + } + + return &gofakes3.Object{ + Name: gofakes3.URLEncode(objectName), + Hash: hash, + Metadata: meta, + Size: size, + Range: rnge, + Contents: rdr, + }, nil +} + +// TouchObject creates or updates meta on specified object. +func (b *s3Backend) TouchObject(fp string, meta map[string]string) (result gofakes3.PutObjectResult, err error) { + _, err = b.vfs.Stat(fp) + if err == vfs.ENOENT { + f, err := b.vfs.Create(fp) + if err != nil { + return result, err + } + _ = f.Close() + return b.TouchObject(fp, meta) + } else if err != nil { + return result, err + } + + _, err = b.vfs.Stat(fp) + if err != nil { + return result, err + } + + b.meta.Store(fp, meta) + + if val, ok := meta["X-Amz-Meta-Mtime"]; ok { + ti, err := swift.FloatStringToTime(val) + if err == nil { + return result, b.vfs.Chtimes(fp, ti, ti) + } + // ignore error since the file is successfully created + } + + if val, ok := meta["mtime"]; ok { + ti, err := swift.FloatStringToTime(val) + if err == nil { + return result, b.vfs.Chtimes(fp, ti, ti) + } + // ignore error since the file is successfully created + } + + return result, nil +} + +// PutObject creates or overwrites the object with the given name. +func (b *s3Backend) PutObject( + bucketName, objectName string, + meta map[string]string, + input io.Reader, size int64, +) (result gofakes3.PutObjectResult, err error) { + _, err = b.vfs.Stat(bucketName) + if err != nil { + return result, gofakes3.BucketNotFound(bucketName) + } + + fp := path.Join(bucketName, objectName) + objectDir := path.Dir(fp) + // _, err = db.fs.Stat(objectDir) + // if err == vfs.ENOENT { + // fs.Errorf(objectDir, "PutObject failed: path not found") + // return result, gofakes3.KeyNotFound(objectName) + // } + + if objectDir != "." { + if err := mkdirRecursive(objectDir, b.vfs); err != nil { + return result, err + } + } + + f, err := b.vfs.Create(fp) + if err != nil { + return result, err + } + + if _, err := io.Copy(f, input); err != nil { + // remove file when i/o error occurred (FsPutErr) + _ = f.Close() + _ = b.vfs.Remove(fp) + return result, err + } + + if err := f.Close(); err != nil { + // remove file when close error occurred (FsPutErr) + _ = b.vfs.Remove(fp) + return result, err + } + + _, err = b.vfs.Stat(fp) + if err != nil { + return result, err + } + + b.meta.Store(fp, meta) + + if val, ok := meta["X-Amz-Meta-Mtime"]; ok { + ti, err := swift.FloatStringToTime(val) + if err == nil { + return result, b.vfs.Chtimes(fp, ti, ti) + } + // ignore error since the file is successfully created + } + + if val, ok := meta["mtime"]; ok { + ti, err := swift.FloatStringToTime(val) + if err == nil { + return result, b.vfs.Chtimes(fp, ti, ti) + } + // ignore error since the file is successfully created + } + + return result, nil +} + +// DeleteMulti deletes multiple objects in a single request. +func (b *s3Backend) DeleteMulti(bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error) { + for _, object := range objects { + if err := b.deleteObject(bucketName, object); err != nil { + fs.Errorf("serve s3", "delete object failed: %v", err) + result.Error = append(result.Error, gofakes3.ErrorResult{ + Code: gofakes3.ErrInternal, + Message: gofakes3.ErrInternal.Message(), + Key: object, + }) + } else { + result.Deleted = append(result.Deleted, gofakes3.ObjectID{ + Key: object, + }) + } + } + + return result, nil +} + +// DeleteObject deletes the object with the given name. +func (b *s3Backend) DeleteObject(bucketName, objectName string) (result gofakes3.ObjectDeleteResult, rerr error) { + return result, b.deleteObject(bucketName, objectName) +} + +// deleteObject deletes the object from the filesystem. +func (b *s3Backend) deleteObject(bucketName, objectName string) error { + _, err := b.vfs.Stat(bucketName) + if err != nil { + return gofakes3.BucketNotFound(bucketName) + } + + fp := path.Join(bucketName, objectName) + // S3 does not report an error when attemping to delete a key that does not exist, so + // we need to skip IsNotExist errors. + if err := b.vfs.Remove(fp); err != nil && !os.IsNotExist(err) { + return err + } + + // FIXME: unsafe operation + if b.vfs.Fs().Features().CanHaveEmptyDirectories { + rmdirRecursive(fp, b.vfs) + } + return nil +} + +// CreateBucket creates a new bucket. +func (b *s3Backend) CreateBucket(name string) error { + _, err := b.vfs.Stat(name) + if err != nil && err != vfs.ENOENT { + return gofakes3.ErrInternal + } + + if err == nil { + return gofakes3.ErrBucketAlreadyExists + } + + if err := b.vfs.Mkdir(name, 0755); err != nil { + return gofakes3.ErrInternal + } + return nil +} + +// DeleteBucket deletes the bucket with the given name. +func (b *s3Backend) DeleteBucket(name string) error { + _, err := b.vfs.Stat(name) + if err != nil { + return gofakes3.BucketNotFound(name) + } + + if err := b.vfs.Remove(name); err != nil { + return gofakes3.ErrBucketNotEmpty + } + + return nil +} + +// BucketExists checks if the bucket exists. +func (b *s3Backend) BucketExists(name string) (exists bool, err error) { + _, err = b.vfs.Stat(name) + if err != nil { + return false, nil + } + + return true, nil +} + +// CopyObject copy specified object from srcKey to dstKey. +func (b *s3Backend) CopyObject(srcBucket, srcKey, dstBucket, dstKey string, meta map[string]string) (result gofakes3.CopyObjectResult, err error) { + fp := path.Join(srcBucket, srcKey) + if srcBucket == dstBucket && srcKey == dstKey { + b.meta.Store(fp, meta) + + val, ok := meta["X-Amz-Meta-Mtime"] + if !ok { + if val, ok = meta["mtime"]; !ok { + return + } + } + // update modtime + ti, err := swift.FloatStringToTime(val) + if err != nil { + return result, nil + } + + return result, b.vfs.Chtimes(fp, ti, ti) + } + + cStat, err := b.vfs.Stat(fp) + if err != nil { + return + } + + c, err := b.GetObject(srcBucket, srcKey, nil) + if err != nil { + return + } + defer func() { + _ = c.Contents.Close() + }() + + for k, v := range c.Metadata { + if _, found := meta[k]; !found && k != "X-Amz-Acl" { + meta[k] = v + } + } + if _, ok := meta["mtime"]; !ok { + meta["mtime"] = swift.TimeToFloatString(cStat.ModTime()) + } + + _, err = b.PutObject(dstBucket, dstKey, meta, c.Contents, c.Size) + if err != nil { + return + } + + return gofakes3.CopyObjectResult{ + ETag: `"` + hex.EncodeToString(c.Hash) + `"`, + LastModified: gofakes3.NewContentTime(cStat.ModTime()), + }, nil +} diff --git a/cmd/serve/s3/ioutils.go b/cmd/serve/s3/ioutils.go new file mode 100644 index 0000000000000..9ca5e695d23f6 --- /dev/null +++ b/cmd/serve/s3/ioutils.go @@ -0,0 +1,34 @@ +package s3 + +import "io" + +type noOpReadCloser struct{} + +type readerWithCloser struct { + io.Reader + closer func() error +} + +var _ io.ReadCloser = &readerWithCloser{} + +func (d noOpReadCloser) Read(b []byte) (n int, err error) { + return 0, io.EOF +} + +func (d noOpReadCloser) Close() error { + return nil +} + +func limitReadCloser(rdr io.Reader, closer func() error, sz int64) io.ReadCloser { + return &readerWithCloser{ + Reader: io.LimitReader(rdr, sz), + closer: closer, + } +} + +func (rwc *readerWithCloser) Close() error { + if rwc.closer != nil { + return rwc.closer() + } + return nil +} diff --git a/cmd/serve/s3/list.go b/cmd/serve/s3/list.go new file mode 100644 index 0000000000000..93f0f87e3f264 --- /dev/null +++ b/cmd/serve/s3/list.go @@ -0,0 +1,85 @@ +package s3 + +import ( + "context" + "path" + "strings" + + "github.com/Mikubill/gofakes3" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/walk" +) + +func (b *s3Backend) entryListR(bucket, fdPath, name string, acceptComPrefix bool, response *gofakes3.ObjectList) error { + fp := path.Join(bucket, fdPath) + + dirEntries, err := getDirEntries(fp, b.vfs) + if err != nil { + return err + } + + for _, entry := range dirEntries { + object := entry.Name() + + // workround for control-chars detect + objectPath := path.Join(fdPath, object) + + if !strings.HasPrefix(object, name) { + continue + } + + if entry.IsDir() { + if acceptComPrefix { + response.AddPrefix(gofakes3.URLEncode(objectPath)) + continue + } + err := b.entryListR(bucket, path.Join(fdPath, object), "", false, response) + if err != nil { + return err + } + } else { + item := &gofakes3.Content{ + Key: gofakes3.URLEncode(objectPath), + LastModified: gofakes3.NewContentTime(entry.ModTime()), + ETag: getFileHash(entry), + Size: entry.Size(), + StorageClass: gofakes3.StorageStandard, + } + response.Add(item) + } + } + return nil +} + +// getObjectsList lists the objects in the given bucket. +func (b *s3Backend) getObjectsListArbitrary(bucket string, prefix *gofakes3.Prefix, response *gofakes3.ObjectList) error { + // ignore error - vfs may have uncommitted updates, such as new dir etc. + _ = walk.ListR(context.Background(), b.vfs.Fs(), bucket, false, -1, walk.ListObjects, func(entries fs.DirEntries) error { + for _, entry := range entries { + entry := entry.(fs.Object) + objName := entry.Remote() + object := strings.TrimPrefix(objName, bucket)[1:] + + var matchResult gofakes3.PrefixMatch + if prefix.Match(object, &matchResult) { + if matchResult.CommonPrefix { + response.AddPrefix(gofakes3.URLEncode(object)) + continue + } + + item := &gofakes3.Content{ + Key: gofakes3.URLEncode(object), + LastModified: gofakes3.NewContentTime(entry.ModTime(context.Background())), + ETag: getFileHash(entry), + Size: entry.Size(), + StorageClass: gofakes3.StorageStandard, + } + response.Add(item) + } + } + + return nil + }) + + return nil +} diff --git a/cmd/serve/s3/logger.go b/cmd/serve/s3/logger.go new file mode 100644 index 0000000000000..8c9b3067bff17 --- /dev/null +++ b/cmd/serve/s3/logger.go @@ -0,0 +1,25 @@ +package s3 + +import ( + "fmt" + + "github.com/Mikubill/gofakes3" + "github.com/rclone/rclone/fs" +) + +// logger output formatted message +type logger struct{} + +// print log message +func (l logger) Print(level gofakes3.LogLevel, v ...interface{}) { + switch level { + default: + fallthrough + case gofakes3.LogErr: + fs.Errorf("serve s3", fmt.Sprintln(v...)) + case gofakes3.LogWarn: + fs.Infof("serve s3", fmt.Sprintln(v...)) + case gofakes3.LogInfo: + fs.Debugf("serve s3", fmt.Sprintln(v...)) + } +} diff --git a/cmd/serve/s3/pager.go b/cmd/serve/s3/pager.go new file mode 100644 index 0000000000000..1aa3c5e68b8c4 --- /dev/null +++ b/cmd/serve/s3/pager.go @@ -0,0 +1,66 @@ +// Package s3 implements a fake s3 server for rclone +package s3 + +import ( + "sort" + + "github.com/Mikubill/gofakes3" +) + +// pager splits the object list into smulitply pages. +func (db *s3Backend) pager(list *gofakes3.ObjectList, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error) { + // sort by alphabet + sort.Slice(list.CommonPrefixes, func(i, j int) bool { + return list.CommonPrefixes[i].Prefix < list.CommonPrefixes[j].Prefix + }) + // sort by modtime + sort.Slice(list.Contents, func(i, j int) bool { + return list.Contents[i].LastModified.Before(list.Contents[j].LastModified.Time) + }) + tokens := page.MaxKeys + if tokens == 0 { + tokens = 1000 + } + if page.HasMarker { + for i, obj := range list.Contents { + if obj.Key == page.Marker { + list.Contents = list.Contents[i+1:] + break + } + } + for i, obj := range list.CommonPrefixes { + if obj.Prefix == page.Marker { + list.CommonPrefixes = list.CommonPrefixes[i+1:] + break + } + } + } + + response := gofakes3.NewObjectList() + for _, obj := range list.CommonPrefixes { + if tokens <= 0 { + break + } + response.AddPrefix(obj.Prefix) + tokens-- + } + + for _, obj := range list.Contents { + if tokens <= 0 { + break + } + response.Add(obj) + tokens-- + } + + if len(list.CommonPrefixes)+len(list.Contents) > int(page.MaxKeys) { + response.IsTruncated = true + if len(response.Contents) > 0 { + response.NextMarker = response.Contents[len(response.Contents)-1].Key + } else { + response.NextMarker = response.CommonPrefixes[len(response.CommonPrefixes)-1].Prefix + } + } + + return response, nil +} diff --git a/cmd/serve/s3/s3.go b/cmd/serve/s3/s3.go new file mode 100644 index 0000000000000..db9e384915265 --- /dev/null +++ b/cmd/serve/s3/s3.go @@ -0,0 +1,81 @@ +package s3 + +import ( + "context" + _ "embed" + + "github.com/rclone/rclone/cmd" + "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/hash" + httplib "github.com/rclone/rclone/lib/http" + "github.com/rclone/rclone/vfs" + "github.com/rclone/rclone/vfs/vfsflags" + "github.com/spf13/cobra" +) + +// DefaultOpt is the default values used for Options +var DefaultOpt = Options{ + pathBucketMode: true, + hashName: "MD5", + hashType: hash.MD5, + noCleanup: false, + HTTP: httplib.DefaultCfg(), +} + +// Opt is options set by command line flags +var Opt = DefaultOpt + +const flagPrefix = "" + +func init() { + flagSet := Command.Flags() + httplib.AddHTTPFlagsPrefix(flagSet, flagPrefix, &Opt.HTTP) + vfsflags.AddFlags(flagSet) + flags.BoolVarP(flagSet, &Opt.pathBucketMode, "force-path-style", "", Opt.pathBucketMode, "If true use path style access if false use virtual hosted style (default true)", "") + flags.StringVarP(flagSet, &Opt.hashName, "etag-hash", "", Opt.hashName, "Which hash to use for the ETag, or auto or blank for off", "") + flags.StringArrayVarP(flagSet, &Opt.authPair, "auth-key", "", Opt.authPair, "Set key pair for v4 authorization: access_key_id,secret_access_key", "") + flags.BoolVarP(flagSet, &Opt.noCleanup, "no-cleanup", "", Opt.noCleanup, "Not to cleanup empty folder after object is deleted", "") +} + +//go:embed serve_s3.md +var serveS3Help string + +// Command definition for cobra +var Command = &cobra.Command{ + Annotations: map[string]string{ + "versionIntroduced": "v1.65", + "groups": "Filter", + "status": "Experimental", + }, + Use: "s3 remote:path", + Short: `Serve remote:path over s3.`, + Long: serveS3Help + httplib.Help(flagPrefix) + vfs.Help, + RunE: func(command *cobra.Command, args []string) error { + cmd.CheckArgs(1, 1, command, args) + f := cmd.NewFsSrc(args) + + if Opt.hashName == "auto" { + Opt.hashType = f.Hashes().GetOne() + } else if Opt.hashName != "" { + err := Opt.hashType.Set(Opt.hashName) + if err != nil { + return err + } + } + cmd.Run(false, false, command, func() error { + s, err := newServer(context.Background(), f, &Opt) + if err != nil { + return err + } + router := s.Router() + s.Bind(router) + err = s.serve() + if err != nil { + return err + } + s.Wait() + return nil + }) + return nil + }, +} diff --git a/cmd/serve/s3/s3_test.go b/cmd/serve/s3/s3_test.go new file mode 100644 index 0000000000000..2622d5fbcd0f0 --- /dev/null +++ b/cmd/serve/s3/s3_test.go @@ -0,0 +1,204 @@ +// Serve s3 tests set up a server and run the integration tests +// for the s3 remote against it. + +package s3 + +import ( + "bytes" + "context" + "fmt" + "io" + "net/url" + "os" + "os/exec" + "path" + "strings" + "testing" + "time" + + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + "github.com/rclone/rclone/fs/object" + + _ "github.com/rclone/rclone/backend/local" + "github.com/rclone/rclone/cmd/serve/servetest" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/fstest" + httplib "github.com/rclone/rclone/lib/http" + "github.com/rclone/rclone/lib/random" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +const ( + endpoint = "localhost:0" +) + +// Configure and serve the server +func serveS3(f fs.Fs) (testURL string, keyid string, keysec string) { + keyid = random.String(16) + keysec = random.String(16) + serveropt := &Options{ + HTTP: httplib.DefaultCfg(), + pathBucketMode: true, + hashName: "", + hashType: hash.None, + authPair: []string{fmt.Sprintf("%s,%s", keyid, keysec)}, + } + + serveropt.HTTP.ListenAddr = []string{endpoint} + w, _ := newServer(context.Background(), f, serveropt) + router := w.Router() + + w.Bind(router) + w.Serve() + testURL = w.Server.URLs()[0] + + return +} + +// TestS3 runs the s3 server then runs the unit tests for the +// s3 remote against it. +func TestS3(t *testing.T) { + start := func(f fs.Fs) (configmap.Simple, func()) { + testURL, keyid, keysec := serveS3(f) + // Config for the backend we'll use to connect to the server + config := configmap.Simple{ + "type": "s3", + "provider": "Rclone", + "endpoint": testURL, + "access_key_id": keyid, + "secret_access_key": keysec, + } + + return config, func() {} + } + + RunS3UnitTests(t, "s3", start) +} + +func RunS3UnitTests(t *testing.T, name string, start servetest.StartFn) { + fstest.Initialise() + ci := fs.GetConfig(context.Background()) + ci.DisableFeatures = append(ci.DisableFeatures, "Metadata") + + fremote, _, clean, err := fstest.RandomRemote() + assert.NoError(t, err) + defer clean() + + err = fremote.Mkdir(context.Background(), "") + assert.NoError(t, err) + + f := fremote + config, cleanup := start(f) + defer cleanup() + + // Change directory to run the tests + cwd, err := os.Getwd() + require.NoError(t, err) + err = os.Chdir("../../../backend/" + name) + require.NoError(t, err, "failed to cd to "+name+" backend") + defer func() { + // Change back to the old directory + require.NoError(t, os.Chdir(cwd)) + }() + + // RunS3UnitTests the backend tests with an on the fly remote + args := []string{"test"} + if testing.Verbose() { + args = append(args, "-v") + } + if *fstest.Verbose { + args = append(args, "-verbose") + } + remoteName := "serve" + name + ":" + args = append(args, "-remote", remoteName) + args = append(args, "-run", "^TestIntegration$") + args = append(args, "-list-retries", fmt.Sprint(*fstest.ListRetries)) + cmd := exec.Command("go", args...) + + // Configure the backend with environment variables + cmd.Env = os.Environ() + prefix := "RCLONE_CONFIG_" + strings.ToUpper(remoteName[:len(remoteName)-1]) + "_" + for k, v := range config { + cmd.Env = append(cmd.Env, prefix+strings.ToUpper(k)+"="+v) + } + + // RunS3UnitTests the test + out, err := cmd.CombinedOutput() + if len(out) != 0 { + t.Logf("\n----------\n%s----------\n", string(out)) + } + assert.NoError(t, err, "Running "+name+" integration tests") +} + +// tests using the minio client +func TestEncodingWithMinioClient(t *testing.T) { + cases := []struct { + description string + bucket string + path string + filename string + expected string + }{ + { + description: "weird file in bucket root", + bucket: "mybucket", + path: "", + filename: " file with w€r^d ch@r \\#~+§4%&'. txt ", + }, + { + description: "weird file inside a weird folder", + bucket: "mybucket", + path: "ä#/नेपाल&/?/", + filename: " file with w€r^d ch@r \\#~+§4%&'. txt ", + }, + } + + for _, tt := range cases { + t.Run(tt.description, func(t *testing.T) { + fstest.Initialise() + f, _, clean, err := fstest.RandomRemote() + assert.NoError(t, err) + defer clean() + err = f.Mkdir(context.Background(), path.Join(tt.bucket, tt.path)) + assert.NoError(t, err) + + buf := bytes.NewBufferString("contents") + uploadHash := hash.NewMultiHasher() + in := io.TeeReader(buf, uploadHash) + + obji := object.NewStaticObjectInfo( + path.Join(tt.bucket, tt.path, tt.filename), + time.Now(), + int64(buf.Len()), + true, + nil, + nil, + ) + _, err = f.Put(context.Background(), in, obji) + assert.NoError(t, err) + + endpoint, keyid, keysec := serveS3(f) + testURL, _ := url.Parse(endpoint) + minioClient, err := minio.New(testURL.Host, &minio.Options{ + Creds: credentials.NewStaticV4(keyid, keysec, ""), + Secure: false, + }) + assert.NoError(t, err) + + buckets, err := minioClient.ListBuckets(context.Background()) + assert.NoError(t, err) + assert.Equal(t, buckets[0].Name, tt.bucket) + objects := minioClient.ListObjects(context.Background(), tt.bucket, minio.ListObjectsOptions{ + Recursive: true, + }) + for object := range objects { + assert.Equal(t, path.Join(tt.path, tt.filename), object.Key) + } + }) + } + +} diff --git a/cmd/serve/s3/serve_s3.md b/cmd/serve/s3/serve_s3.md new file mode 100644 index 0000000000000..65445ff1cea61 --- /dev/null +++ b/cmd/serve/s3/serve_s3.md @@ -0,0 +1,115 @@ +`serve s3` implements a basic s3 server that serves a remote via s3. +This can be viewed with an s3 client, or you can make an [s3 type +remote](/s3/) to read and write to it with rclone. + +`serve s3` is considered **Experimental** so use with care. + +S3 server supports Signature Version 4 authentication. Just use +`--auth-key accessKey,secretKey` and set the `Authorization` +header correctly in the request. (See the [AWS +docs](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)). + +`--auth-key` can be repeated for multiple auth pairs. If +`--auth-key` is not provided then `serve s3` will allow anonymous +access. + +Please note that some clients may require HTTPS endpoints. See [the +SSL docs](#ssl-tls) for more information. + +This command uses the [VFS directory cache](#vfs-virtual-file-system). +All the functionality will work with `--vfs-cache-mode off`. Using +`--vfs-cache-mode full` (or `writes`) can be used to cache objects +locally to improve performance. + +Use `--force-path-style=false` if you want to use the bucket name as a +part of the hostname (such as mybucket.local) + +Use `--etag-hash` if you want to change the hash uses for the `ETag`. +Note that using anything other than `MD5` (the default) is likely to +cause problems for S3 clients which rely on the Etag being the MD5. + +### Quickstart + +For a simple set up, to serve `remote:path` over s3, run the server +like this: + +``` +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +``` + +This will be compatible with an rclone remote which is defined like this: + +``` +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +``` + +Note that setting `disable_multipart_uploads = true` is to work around +[a bug](#bugs) which will be fixed in due course. + +### Bugs + +When uploading multipart files `serve s3` holds all the parts in +memory (see [#7453](https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. + +Multipart server side copies do not work (see +[#7454](https://github.com/rclone/rclone/issues/7454)). These take a +very long time and eventually fail. The default threshold for +multipart server side copies is 5G which is the maximum it can be, so +files above this side will fail to be server side copied. + +For a current list of `serve s3` bugs see the [serve +s3](https://github.com/rclone/rclone/labels/serve%20s3) bug category +on GitHub. + +### Limitations + +`serve s3` will treat all directories in the root as buckets and +ignore all files in the root. You can use `CreateBucket` to create +folders under the root, but you can't create empty folders under other +folders not in the root. + +When using `PutObject` or `DeleteObject`, rclone will automatically +create or clean up empty folders. If you don't want to clean up empty +folders automatically, use `--no-cleanup`. + +When using `ListObjects`, rclone will use `/` when the delimiter is +empty. This reduces backend requests with no effect on most +operations, but if the delimiter is something other than `/` and +empty, rclone will do a full recursive search of the backend, which +can take some time. + +Versioning is not currently supported. + +Metadata will only be saved in memory other than the rclone `mtime` +metadata which will be set as the modification time of the file. + +### Supported operations + +`serve s3` currently supports the following operations. + +- Bucket + - `ListBuckets` + - `CreateBucket` + - `DeleteBucket` +- Object + - `HeadObject` + - `ListObjects` + - `GetObject` + - `PutObject` + - `DeleteObject` + - `DeleteObjects` + - `CreateMultipartUpload` + - `CompleteMultipartUpload` + - `AbortMultipartUpload` + - `CopyObject` + - `UploadPart` + +Other operations will return error `Unimplemented`. diff --git a/cmd/serve/s3/server.go b/cmd/serve/s3/server.go new file mode 100644 index 0000000000000..b9e9a75504daa --- /dev/null +++ b/cmd/serve/s3/server.go @@ -0,0 +1,83 @@ +// Package s3 implements a fake s3 server for rclone +package s3 + +import ( + "context" + "fmt" + "math/rand" + "net/http" + + "github.com/Mikubill/gofakes3" + "github.com/go-chi/chi/v5" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/hash" + httplib "github.com/rclone/rclone/lib/http" + "github.com/rclone/rclone/vfs" + "github.com/rclone/rclone/vfs/vfsflags" +) + +// Options contains options for the http Server +type Options struct { + //TODO add more options + pathBucketMode bool + hashName string + hashType hash.Type + authPair []string + noCleanup bool + HTTP httplib.Config +} + +// Server is a s3.FileSystem interface +type Server struct { + *httplib.Server + f fs.Fs + vfs *vfs.VFS + faker *gofakes3.GoFakeS3 + handler http.Handler + ctx context.Context // for global config +} + +// Make a new S3 Server to serve the remote +func newServer(ctx context.Context, f fs.Fs, opt *Options) (s *Server, err error) { + w := &Server{ + f: f, + ctx: ctx, + vfs: vfs.New(f, &vfsflags.Opt), + } + + if len(opt.authPair) == 0 { + fs.Logf("serve s3", "No auth provided so allowing anonymous access") + } + + var newLogger logger + w.faker = gofakes3.New( + newBackend(w.vfs, opt), + gofakes3.WithHostBucket(!opt.pathBucketMode), + gofakes3.WithLogger(newLogger), + gofakes3.WithRequestID(rand.Uint64()), + gofakes3.WithoutVersioning(), + gofakes3.WithV4Auth(authlistResolver(opt.authPair)), + gofakes3.WithIntegrityCheck(true), // Check Content-MD5 if supplied + ) + + w.Server, err = httplib.NewServer(ctx, + httplib.WithConfig(opt.HTTP), + ) + if err != nil { + return nil, fmt.Errorf("failed to init server: %w", err) + } + + w.handler = w.faker.Server() + return w, nil +} + +// Bind register the handler to http.Router +func (w *Server) Bind(router chi.Router) { + router.Handle("/*", w.handler) +} + +func (w *Server) serve() error { + w.Serve() + fs.Logf(w.f, "Starting s3 server on %s", w.URLs()) + return nil +} diff --git a/cmd/serve/s3/utils.go b/cmd/serve/s3/utils.go new file mode 100644 index 0000000000000..c61283cc6bf4f --- /dev/null +++ b/cmd/serve/s3/utils.go @@ -0,0 +1,136 @@ +package s3 + +import ( + "context" + "encoding/hex" + "fmt" + "io" + "os" + "path" + "strings" + + "github.com/Mikubill/gofakes3" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/vfs" +) + +func getDirEntries(prefix string, VFS *vfs.VFS) (vfs.Nodes, error) { + node, err := VFS.Stat(prefix) + + if err == vfs.ENOENT { + return nil, gofakes3.ErrNoSuchKey + } else if err != nil { + return nil, err + } + + if !node.IsDir() { + return nil, gofakes3.ErrNoSuchKey + } + + dir := node.(*vfs.Dir) + dirEntries, err := dir.ReadDirAll() + if err != nil { + return nil, err + } + + return dirEntries, nil +} + +func getFileHashByte(node interface{}) []byte { + b, err := hex.DecodeString(getFileHash(node)) + if err != nil { + return nil + } + return b +} + +func getFileHash(node interface{}) string { + var o fs.Object + + switch b := node.(type) { + case vfs.Node: + fsObj, ok := b.DirEntry().(fs.Object) + if !ok { + fs.Debugf("serve s3", "File uploading - reading hash from VFS cache") + in, err := b.Open(os.O_RDONLY) + if err != nil { + return "" + } + defer func() { + _ = in.Close() + }() + h, err := hash.NewMultiHasherTypes(hash.NewHashSet(Opt.hashType)) + if err != nil { + return "" + } + _, err = io.Copy(h, in) + if err != nil { + return "" + } + return h.Sums()[Opt.hashType] + } + o = fsObj + case fs.Object: + o = b + } + + hash, err := o.Hash(context.Background(), Opt.hashType) + if err != nil { + return "" + } + return hash +} + +func prefixParser(p *gofakes3.Prefix) (path, remaining string) { + idx := strings.LastIndexByte(p.Prefix, '/') + if idx < 0 { + return "", p.Prefix + } + return p.Prefix[:idx], p.Prefix[idx+1:] +} + +// FIXME this could be implemented by VFS.MkdirAll() +func mkdirRecursive(path string, VFS *vfs.VFS) error { + path = strings.Trim(path, "/") + dirs := strings.Split(path, "/") + dir := "" + for _, d := range dirs { + dir += "/" + d + if _, err := VFS.Stat(dir); err != nil { + err := VFS.Mkdir(dir, 0777) + if err != nil { + return err + } + } + } + return nil +} + +func rmdirRecursive(p string, VFS *vfs.VFS) { + dir := path.Dir(p) + if !strings.ContainsAny(dir, "/\\") { + // might be bucket(root) + return + } + if _, err := VFS.Stat(dir); err == nil { + err := VFS.Remove(dir) + if err != nil { + return + } + rmdirRecursive(dir, VFS) + } +} + +func authlistResolver(list []string) map[string]string { + authList := make(map[string]string) + for _, v := range list { + parts := strings.Split(v, ",") + if len(parts) != 2 { + fs.Infof(nil, fmt.Sprintf("Ignored: invalid auth pair %s", v)) + continue + } + authList[parts[0]] = parts[1] + } + return authList +} diff --git a/cmd/serve/serve.go b/cmd/serve/serve.go index 8f523f52c3f03..c415499a07f22 100644 --- a/cmd/serve/serve.go +++ b/cmd/serve/serve.go @@ -9,7 +9,9 @@ import ( "github.com/rclone/rclone/cmd/serve/docker" "github.com/rclone/rclone/cmd/serve/ftp" "github.com/rclone/rclone/cmd/serve/http" + "github.com/rclone/rclone/cmd/serve/nfs" "github.com/rclone/rclone/cmd/serve/restic" + "github.com/rclone/rclone/cmd/serve/s3" "github.com/rclone/rclone/cmd/serve/sftp" "github.com/rclone/rclone/cmd/serve/webdav" "github.com/spf13/cobra" @@ -35,6 +37,12 @@ func init() { if docker.Command != nil { Command.AddCommand(docker.Command) } + if nfs.Command != nil { + Command.AddCommand(nfs.Command) + } + if s3.Command != nil { + Command.AddCommand(s3.Command) + } cmd.Root.AddCommand(Command) } diff --git a/cmd/serve/sftp/connection.go b/cmd/serve/sftp/connection.go index 42564c151d8c7..91c83002c122c 100644 --- a/cmd/serve/sftp/connection.go +++ b/cmd/serve/sftp/connection.go @@ -123,11 +123,28 @@ func (c *conn) execCommand(ctx context.Context, out io.Writer, command string) ( } o, ok := node.DirEntry().(fs.ObjectInfo) if !ok { - return errors.New("unexpected non file") - } - hashSum, err = o.Hash(ctx, ht) - if err != nil { - return fmt.Errorf("hash failed: %w", err) + fs.Debugf(args, "File uploading - reading hash from VFS cache") + in, err := node.Open(os.O_RDONLY) + if err != nil { + return fmt.Errorf("hash vfs open failed: %w", err) + } + defer func() { + _ = in.Close() + }() + h, err := hash.NewMultiHasherTypes(hash.NewHashSet(ht)) + if err != nil { + return fmt.Errorf("hash vfs create multi-hasher failed: %w", err) + } + _, err = io.Copy(h, in) + if err != nil { + return fmt.Errorf("hash vfs copy failed: %w", err) + } + hashSum = h.Sums()[ht] + } else { + hashSum, err = o.Hash(ctx, ht) + if err != nil { + return fmt.Errorf("hash failed: %w", err) + } } } _, err = fmt.Fprintf(out, "%s %s\n", hashSum, args) diff --git a/cmd/serve/sftp/handler.go b/cmd/serve/sftp/handler.go index aba3601a29727..b937af80a1375 100644 --- a/cmd/serve/sftp/handler.go +++ b/cmd/serve/sftp/handler.go @@ -83,6 +83,10 @@ func (v vfsHandler) Filecmd(r *sftp.Request) error { // link.symlink = r.Filepath // v.files[r.Target] = link return sftp.ErrSshFxOpUnsupported + case "Link": + return sftp.ErrSshFxOpUnsupported + default: + return sftp.ErrSshFxOpUnsupported } return nil } diff --git a/cmd/serve/sftp/sftp.go b/cmd/serve/sftp/sftp.go index 2a255224bee92..117f3ff615dc2 100644 --- a/cmd/serve/sftp/sftp.go +++ b/cmd/serve/sftp/sftp.go @@ -13,6 +13,7 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/fs/rc" + "github.com/rclone/rclone/lib/systemd" "github.com/rclone/rclone/vfs" "github.com/rclone/rclone/vfs/vfsflags" "github.com/spf13/cobra" @@ -42,13 +43,13 @@ var Opt = DefaultOpt // AddFlags adds flags for the sftp func AddFlags(flagSet *pflag.FlagSet, Opt *Options) { rc.AddOption("sftp", &Opt) - flags.StringVarP(flagSet, &Opt.ListenAddr, "addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to") - flags.StringArrayVarP(flagSet, &Opt.HostKeys, "key", "", Opt.HostKeys, "SSH private host key file (Can be multi-valued, leave blank to auto generate)") - flags.StringVarP(flagSet, &Opt.AuthorizedKeys, "authorized-keys", "", Opt.AuthorizedKeys, "Authorized keys file") - flags.StringVarP(flagSet, &Opt.User, "user", "", Opt.User, "User name for authentication") - flags.StringVarP(flagSet, &Opt.Pass, "pass", "", Opt.Pass, "Password for authentication") - flags.BoolVarP(flagSet, &Opt.NoAuth, "no-auth", "", Opt.NoAuth, "Allow connections with no authentication if set") - flags.BoolVarP(flagSet, &Opt.Stdio, "stdio", "", Opt.Stdio, "Run an sftp server on stdin/stdout") + flags.StringVarP(flagSet, &Opt.ListenAddr, "addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to", "") + flags.StringArrayVarP(flagSet, &Opt.HostKeys, "key", "", Opt.HostKeys, "SSH private host key file (Can be multi-valued, leave blank to auto generate)", "") + flags.StringVarP(flagSet, &Opt.AuthorizedKeys, "authorized-keys", "", Opt.AuthorizedKeys, "Authorized keys file", "") + flags.StringVarP(flagSet, &Opt.User, "user", "", Opt.User, "User name for authentication", "") + flags.StringVarP(flagSet, &Opt.Pass, "pass", "", Opt.Pass, "Password for authentication", "") + flags.BoolVarP(flagSet, &Opt.NoAuth, "no-auth", "", Opt.NoAuth, "Allow connections with no authentication if set", "") + flags.BoolVarP(flagSet, &Opt.Stdio, "stdio", "", Opt.Stdio, "Run an sftp server on stdin/stdout", "") } func init() { @@ -108,7 +109,7 @@ which can lead to "corrupted on transfer" errors. This is the case because the client chooses indiscriminately which server to send commands to while the servers all have different views of the state of the filing system. -The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from beeing +The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being used. Omitting "restrict" and using ` + "`--sftp-path-override`" + ` to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case. @@ -116,6 +117,7 @@ provided by OpenSSH in this case. ` + vfs.Help + proxy.Help, Annotations: map[string]string{ "versionIntroduced": "v1.48", + "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { var f fs.Fs @@ -134,6 +136,7 @@ provided by OpenSSH in this case. if err != nil { return err } + defer systemd.Notify()() s.Wait() return nil }) diff --git a/cmd/serve/webdav/webdav.go b/cmd/serve/webdav/webdav.go index daaa537f981f8..f482d13d5d7cd 100644 --- a/cmd/serve/webdav/webdav.go +++ b/cmd/serve/webdav/webdav.go @@ -3,10 +3,14 @@ package webdav import ( "context" + "encoding/xml" "errors" "fmt" + "mime" "net/http" "os" + "path" + "strconv" "strings" "time" @@ -20,6 +24,7 @@ import ( "github.com/rclone/rclone/fs/hash" libhttp "github.com/rclone/rclone/lib/http" "github.com/rclone/rclone/lib/http/serve" + "github.com/rclone/rclone/lib/systemd" "github.com/rclone/rclone/vfs" "github.com/rclone/rclone/vfs/vfsflags" "github.com/spf13/cobra" @@ -48,15 +53,19 @@ var DefaultOpt = Options{ // Opt is options set by command line flags var Opt = DefaultOpt +// flagPrefix is the prefix used to uniquely identify command line flags. +// It is intentionally empty for this package. +const flagPrefix = "" + func init() { flagSet := Command.Flags() - libhttp.AddAuthFlagsPrefix(flagSet, "", &Opt.Auth) - libhttp.AddHTTPFlagsPrefix(flagSet, "", &Opt.HTTP) + libhttp.AddAuthFlagsPrefix(flagSet, flagPrefix, &Opt.Auth) + libhttp.AddHTTPFlagsPrefix(flagSet, flagPrefix, &Opt.HTTP) libhttp.AddTemplateFlagsPrefix(flagSet, "", &Opt.Template) vfsflags.AddFlags(flagSet) proxyflags.AddFlags(flagSet) - flags.StringVarP(flagSet, &Opt.HashName, "etag-hash", "", "", "Which hash to use for the ETag, or auto or blank for off") - flags.BoolVarP(flagSet, &Opt.DisableGETDir, "disable-dir-list", "", false, "Disable HTML directory list on GET request for a directory") + flags.StringVarP(flagSet, &Opt.HashName, "etag-hash", "", "", "Which hash to use for the ETag, or auto or blank for off", "") + flags.BoolVarP(flagSet, &Opt.DisableGETDir, "disable-dir-list", "", false, "Disable HTML directory list on GET request for a directory", "") } // Command definition for cobra @@ -103,9 +112,10 @@ Create a new DWORD BasicAuthLevel with value 2. https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint -` + libhttp.Help + libhttp.TemplateHelp + libhttp.AuthHelp + vfs.Help + proxy.Help, +` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help + proxy.Help, Annotations: map[string]string{ "versionIntroduced": "v1.39", + "groups": "Filter", }, RunE: func(command *cobra.Command, args []string) error { var f fs.Fs @@ -136,6 +146,7 @@ https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-bl if err != nil { return err } + defer systemd.Notify()() s.Wait() return nil }) @@ -251,6 +262,52 @@ func (w *WebDAV) auth(user, pass string) (value interface{}, err error) { return VFS, err } +type webdavRW struct { + http.ResponseWriter + status int +} + +func (rw *webdavRW) WriteHeader(statusCode int) { + rw.status = statusCode + rw.ResponseWriter.WriteHeader(statusCode) +} + +func (rw *webdavRW) isSuccessfull() bool { + return rw.status == 0 || (rw.status >= 200 && rw.status <= 299) +} + +func (w *WebDAV) postprocess(r *http.Request, remote string) { + // set modtime from requests, don't write to client because status is already written + switch r.Method { + case "COPY", "MOVE", "PUT": + VFS, err := w.getVFS(r.Context()) + if err != nil { + fs.Errorf(nil, "Failed to get VFS: %v", err) + return + } + + // Get the node + node, err := VFS.Stat(remote) + if err != nil { + fs.Errorf(nil, "Failed to stat node: %v", err) + return + } + + mh := r.Header.Get("X-OC-Mtime") + if mh != "" { + modtimeUnix, err := strconv.ParseInt(mh, 10, 64) + if err == nil { + err = node.SetModTime(time.Unix(modtimeUnix, 0)) + if err != nil { + fs.Errorf(nil, "Failed to set modtime: %v", err) + } + } else { + fs.Errorf(nil, "Failed to parse modtime: %v", err) + } + } + } +} + func (w *WebDAV) ServeHTTP(rw http.ResponseWriter, r *http.Request) { urlPath := r.URL.Path isDir := strings.HasSuffix(urlPath, "/") @@ -262,7 +319,12 @@ func (w *WebDAV) ServeHTTP(rw http.ResponseWriter, r *http.Request) { // Add URL Prefix back to path since webdavhandler needs to // return absolute references. r.URL.Path = w.opt.HTTP.BaseURL + r.URL.Path - w.webdavhandler.ServeHTTP(rw, r) + wrw := &webdavRW{ResponseWriter: rw} + w.webdavhandler.ServeHTTP(wrw, r) + + if wrw.isSuccessfull() { + w.postprocess(r, remote) + } } // serveDir serves a directory index at dirRemote @@ -352,7 +414,7 @@ func (w *WebDAV) OpenFile(ctx context.Context, name string, flags int, perm os.F if err != nil { return nil, err } - return Handle{Handle: f, w: w}, nil + return Handle{Handle: f, w: w, ctx: ctx}, nil } // RemoveAll removes a file or a directory and its contents @@ -400,7 +462,8 @@ func (w *WebDAV) Stat(ctx context.Context, name string) (fi os.FileInfo, err err // Handle represents an open file type Handle struct { vfs.Handle - w *WebDAV + w *WebDAV + ctx context.Context } // Readdir reads directory entries from the handle @@ -425,6 +488,65 @@ func (h Handle) Stat() (fi os.FileInfo, err error) { return FileInfo{FileInfo: fi, w: h.w}, nil } +// DeadProps returns extra properties about the handle +func (h Handle) DeadProps() (map[xml.Name]webdav.Property, error) { + var ( + xmlName xml.Name + property webdav.Property + properties = make(map[xml.Name]webdav.Property) + ) + if h.w.opt.HashType != hash.None { + entry := h.Handle.Node().DirEntry() + if o, ok := entry.(fs.Object); ok { + hash, err := o.Hash(h.ctx, h.w.opt.HashType) + if err == nil { + xmlName.Space = "http://owncloud.org/ns" + xmlName.Local = "checksums" + property.XMLName = xmlName + property.InnerXML = append(property.InnerXML, ""...) + property.InnerXML = append(property.InnerXML, strings.ToUpper(h.w.opt.HashType.String())...) + property.InnerXML = append(property.InnerXML, ':') + property.InnerXML = append(property.InnerXML, hash...) + property.InnerXML = append(property.InnerXML, ""...) + properties[xmlName] = property + } else { + fs.Errorf(nil, "failed to calculate hash: %v", err) + } + } + } + + xmlName.Space = "DAV:" + xmlName.Local = "lastmodified" + property.XMLName = xmlName + property.InnerXML = strconv.AppendInt(nil, h.Handle.Node().ModTime().Unix(), 10) + properties[xmlName] = property + + return properties, nil +} + +// Patch changes modtime of the underlying resources, it returns ok for all properties, the error is from setModtime if any +// FIXME does not check for invalid property and SetModTime error +func (h Handle) Patch(proppatches []webdav.Proppatch) ([]webdav.Propstat, error) { + var ( + stat webdav.Propstat + err error + ) + stat.Status = http.StatusOK + for _, patch := range proppatches { + for _, prop := range patch.Props { + stat.Props = append(stat.Props, webdav.Property{XMLName: prop.XMLName}) + if prop.XMLName.Space == "DAV:" && prop.XMLName.Local == "lastmodified" { + var modtimeUnix int64 + modtimeUnix, err = strconv.ParseInt(string(prop.InnerXML), 10, 64) + if err == nil { + err = h.Handle.Node().SetModTime(time.Unix(modtimeUnix, 0)) + } + } + } + } + return []webdav.Propstat{stat}, err +} + // FileInfo represents info about a file satisfying os.FileInfo and // also some additional interfaces for webdav for ETag and ContentType type FileInfo struct { @@ -463,12 +585,14 @@ func (fi FileInfo) ContentType(ctx context.Context) (contentType string, err err fs.Errorf(fi, "Expecting vfs.Node, got %T", fi.FileInfo) return "application/octet-stream", nil } - entry := node.DirEntry() + entry := node.DirEntry() // can be nil switch x := entry.(type) { case fs.Object: return fs.MimeType(ctx, x), nil case fs.Directory: return "inode/directory", nil + case nil: + return mime.TypeByExtension(path.Ext(node.Name())), nil } fs.Errorf(fi, "Expecting fs.Object or fs.Directory, got %T", entry) return "application/octet-stream", nil diff --git a/cmd/serve/webdav/webdav_test.go b/cmd/serve/webdav/webdav_test.go index 2bc61a58af6bf..6734d6f6e5279 100644 --- a/cmd/serve/webdav/webdav_test.go +++ b/cmd/serve/webdav/webdav_test.go @@ -65,7 +65,7 @@ func TestWebDav(t *testing.T) { // Config for the backend we'll use to connect to the server config := configmap.Simple{ "type": "webdav", - "vendor": "other", + "vendor": "rclone", "url": w.Server.URLs()[0], "user": testUser, "pass": obscure.MustObscure(testPass), diff --git a/cmd/sha1sum/sha1sum.go b/cmd/sha1sum/sha1sum.go index 483832ec2a740..6c70367a301ee 100644 --- a/cmd/sha1sum/sha1sum.go +++ b/cmd/sha1sum/sha1sum.go @@ -43,6 +43,7 @@ a remote:path. `, Annotations: map[string]string{ "versionIntroduced": "v1.27", + "groups": "Filter,Listing", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(0, 1, command, args) diff --git a/cmd/size/size.go b/cmd/size/size.go index 8be1305292042..be00952bb15eb 100644 --- a/cmd/size/size.go +++ b/cmd/size/size.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "os" + "strconv" "github.com/rclone/rclone/cmd" "github.com/rclone/rclone/fs" @@ -19,7 +20,7 @@ var jsonOutput bool func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &jsonOutput, "json", "", false, "Format output as JSON") + flags.BoolVarP(cmdFlags, &jsonOutput, "json", "", false, "Format output as JSON", "") } var commandDefinition = &cobra.Command{ @@ -39,13 +40,14 @@ recursion. Some backends do not always provide file sizes, see for example [Google Photos](/googlephotos/#size) and -[Google Drive](/drive/#limitations-of-google-docs). +[Google Docs](/drive/#limitations-of-google-docs). Rclone will then show a notice in the log indicating how many such files were encountered, and count them in as empty files in the output of the size command. `, Annotations: map[string]string{ "versionIntroduced": "v1.23", + "groups": "Filter,Listing", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) @@ -68,7 +70,13 @@ of the size command. if jsonOutput { return json.NewEncoder(os.Stdout).Encode(results) } - fmt.Printf("Total objects: %s (%d)\n", fs.CountSuffix(results.Count), results.Count) + count := strconv.FormatInt(results.Count, 10) + countSuffix := fs.CountSuffix(results.Count).String() + if count == countSuffix { + fmt.Printf("Total objects: %s\n", count) + } else { + fmt.Printf("Total objects: %s (%s)\n", countSuffix, count) + } fmt.Printf("Total size: %s (%d Byte)\n", fs.SizeSuffix(results.Bytes).ByteUnit(), results.Bytes) if results.Sizeless > 0 { fmt.Printf("Total objects with unknown size: %s (%d)\n", fs.CountSuffix(results.Sizeless), results.Sizeless) diff --git a/cmd/sync/sync.go b/cmd/sync/sync.go index 25c3746be50b9..da9184f300740 100644 --- a/cmd/sync/sync.go +++ b/cmd/sync/sync.go @@ -18,7 +18,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after sync") + flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after sync", "") } var commandDefinition = &cobra.Command{ @@ -60,6 +60,9 @@ destination that is inside the source directory. **Note**: Use the ` + "`rclone dedupe`" + ` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14372) for more info. `, + Annotations: map[string]string{ + "groups": "Sync,Copy,Filter,Listing,Important", + }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(2, 2, command, args) fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args) diff --git a/cmd/test/changenotify/changenotify.go b/cmd/test/changenotify/changenotify.go index 6b88e5f11b9dd..27d17ba30b623 100644 --- a/cmd/test/changenotify/changenotify.go +++ b/cmd/test/changenotify/changenotify.go @@ -20,7 +20,7 @@ var ( func init() { test.Command.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.DurationVarP(cmdFlags, &pollInterval, "poll-interval", "", pollInterval, "Time to wait between polling for changes") + flags.DurationVarP(cmdFlags, &pollInterval, "poll-interval", "", pollInterval, "Time to wait between polling for changes", "") } var commandDefinition = &cobra.Command{ diff --git a/cmd/test/info/base32768.go b/cmd/test/info/base32768.go new file mode 100644 index 0000000000000..8f3f61343104f --- /dev/null +++ b/cmd/test/info/base32768.go @@ -0,0 +1,94 @@ +package info + +// Create files with all possible base 32768 file names + +import ( + "context" + "fmt" + "log" + "os" + "path/filepath" + "strings" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/fspath" + "github.com/rclone/rclone/fs/operations" + "github.com/rclone/rclone/fs/sync" +) + +const safeAlphabet = "ƀɀɠʀҠԀڀڠݠހ߀ကႠᄀᄠᅀᆀᇠሀሠበዠጠᎠᏀᐠᑀᑠᒀᒠᓀᓠᔀᔠᕀᕠᖀᖠᗀᗠᘀᘠᙀᚠᛀកᠠᡀᣀᦀ᧠ᨠᯀᰀᴀ⇠⋀⍀⍠⎀⎠⏀␀─┠╀╠▀■◀◠☀☠♀♠⚀⚠⛀⛠✀✠❀➀➠⠀⠠⡀⡠⢀⢠⣀⣠⤀⤠⥀⥠⦠⨠⩀⪀⪠⫠⬀⬠⭀ⰀⲀⲠⳀⴀⵀ⺠⻀㇀㐀㐠㑀㑠㒀㒠㓀㓠㔀㔠㕀㕠㖀㖠㗀㗠㘀㘠㙀㙠㚀㚠㛀㛠㜀㜠㝀㝠㞀㞠㟀㟠㠀㠠㡀㡠㢀㢠㣀㣠㤀㤠㥀㥠㦀㦠㧀㧠㨀㨠㩀㩠㪀㪠㫀㫠㬀㬠㭀㭠㮀㮠㯀㯠㰀㰠㱀㱠㲀㲠㳀㳠㴀㴠㵀㵠㶀㶠㷀㷠㸀㸠㹀㹠㺀㺠㻀㻠㼀㼠㽀㽠㾀㾠㿀㿠䀀䀠䁀䁠䂀䂠䃀䃠䄀䄠䅀䅠䆀䆠䇀䇠䈀䈠䉀䉠䊀䊠䋀䋠䌀䌠䍀䍠䎀䎠䏀䏠䐀䐠䑀䑠䒀䒠䓀䓠䔀䔠䕀䕠䖀䖠䗀䗠䘀䘠䙀䙠䚀䚠䛀䛠䜀䜠䝀䝠䞀䞠䟀䟠䠀䠠䡀䡠䢀䢠䣀䣠䤀䤠䥀䥠䦀䦠䧀䧠䨀䨠䩀䩠䪀䪠䫀䫠䬀䬠䭀䭠䮀䮠䯀䯠䰀䰠䱀䱠䲀䲠䳀䳠䴀䴠䵀䵠䶀䷀䷠一丠乀习亀亠什仠伀传佀你侀侠俀俠倀倠偀偠傀傠僀僠儀儠兀兠冀冠净几刀删剀剠劀加勀勠匀匠區占厀厠叀叠吀吠呀呠咀咠哀哠唀唠啀啠喀喠嗀嗠嘀嘠噀噠嚀嚠囀因圀圠址坠垀垠埀埠堀堠塀塠墀墠壀壠夀夠奀奠妀妠姀姠娀娠婀婠媀媠嫀嫠嬀嬠孀孠宀宠寀寠尀尠局屠岀岠峀峠崀崠嵀嵠嶀嶠巀巠帀帠幀幠庀庠廀廠开张彀彠往徠忀忠怀怠恀恠悀悠惀惠愀愠慀慠憀憠懀懠戀戠所扠技抠拀拠挀挠捀捠掀掠揀揠搀搠摀摠撀撠擀擠攀攠敀敠斀斠旀无昀映晀晠暀暠曀曠最朠杀杠枀枠柀柠栀栠桀桠梀梠检棠椀椠楀楠榀榠槀槠樀樠橀橠檀檠櫀櫠欀欠歀歠殀殠毀毠氀氠汀池沀沠泀泠洀洠浀浠涀涠淀淠渀渠湀湠満溠滀滠漀漠潀潠澀澠激濠瀀瀠灀灠炀炠烀烠焀焠煀煠熀熠燀燠爀爠牀牠犀犠狀狠猀猠獀獠玀玠珀珠琀琠瑀瑠璀璠瓀瓠甀甠畀畠疀疠痀痠瘀瘠癀癠皀皠盀盠眀眠着睠瞀瞠矀矠砀砠础硠碀碠磀磠礀礠祀祠禀禠秀秠稀稠穀穠窀窠竀章笀笠筀筠简箠節篠簀簠籀籠粀粠糀糠紀素絀絠綀綠緀締縀縠繀繠纀纠绀绠缀缠罀罠羀羠翀翠耀耠聀聠肀肠胀胠脀脠腀腠膀膠臀臠舀舠艀艠芀芠苀苠茀茠荀荠莀莠菀菠萀萠葀葠蒀蒠蓀蓠蔀蔠蕀蕠薀薠藀藠蘀蘠虀虠蚀蚠蛀蛠蜀蜠蝀蝠螀螠蟀蟠蠀蠠血衠袀袠裀裠褀褠襀襠覀覠觀觠言訠詀詠誀誠諀諠謀謠譀譠讀讠诀诠谀谠豀豠貀負賀賠贀贠赀赠趀趠跀跠踀踠蹀蹠躀躠軀軠輀輠轀轠辀辠迀迠退造遀遠邀邠郀郠鄀鄠酀酠醀醠釀釠鈀鈠鉀鉠銀銠鋀鋠錀錠鍀鍠鎀鎠鏀鏠鐀鐠鑀鑠钀钠铀铠销锠镀镠門閠闀闠阀阠陀陠隀隠雀雠需霠靀靠鞀鞠韀韠頀頠顀顠颀颠飀飠餀餠饀饠馀馠駀駠騀騠驀驠骀骠髀髠鬀鬠魀魠鮀鮠鯀鯠鰀鰠鱀鱠鲀鲠鳀鳠鴀鴠鵀鵠鶀鶠鷀鷠鸀鸠鹀鹠麀麠黀黠鼀鼠齀齠龀龠ꀀꀠꁀꁠꂀꂠꃀꃠꄀꄠꅀꅠꆀꆠꇀꇠꈀꈠꉀꉠꊀꊠꋀꋠꌀꌠꍀꍠꎀꎠꏀꏠꐀꐠꑀꑠ꒠ꔀꔠꕀꕠꖀꖠꗀꗠꙀꚠꛀ꜀꜠ꝀꞀꡀ" + +func (r *results) checkBase32768() { + r.canBase32768 = false + ctx := context.Background() + + n := 0 + dir, err := os.MkdirTemp("", "rclone-base32768-files") + if err != nil { + log.Printf("Failed to make temp dir: %v", err) + return + } + defer func() { + _ = os.RemoveAll(dir) + }() + + // Create test files + for _, c := range safeAlphabet { + var out strings.Builder + for i := rune(0); i < 32; i++ { + out.WriteRune(c + i) + } + fileName := filepath.Join(dir, fmt.Sprintf("%04d-%s.txt", n, out.String())) + err = os.WriteFile(fileName, []byte(fileName), 0666) + if err != nil { + log.Printf("write %q failed: %v", fileName, err) + return + } + n++ + } + + // Make a local fs + fLocal, err := fs.NewFs(ctx, dir) + if err != nil { + log.Printf("Failed to make local fs: %v", err) + return + } + + testDir := "test-base32768" + + // Make a remote fs + s := fs.ConfigStringFull(r.f) + s = fspath.JoinRootPath(s, testDir) + fRemote, err := fs.NewFs(ctx, s) + if err != nil { + log.Printf("Failed to make remote fs: %v", err) + return + } + + defer func() { + err := operations.Purge(ctx, r.f, testDir) + if err != nil { + log.Printf("Failed to purge test directory: %v", err) + return + } + }() + + // Sync local to remote + err = sync.Sync(ctx, fRemote, fLocal, false) + if err != nil { + log.Printf("Failed to sync remote fs: %v", err) + return + } + + // Check local to remote + err = operations.Check(ctx, &operations.CheckOpt{ + Fdst: fRemote, + Fsrc: fLocal, + }) + if err != nil { + log.Printf("Failed to check remote fs: %v", err) + return + } + + r.canBase32768 = true +} diff --git a/cmd/test/info/info.go b/cmd/test/info/info.go index 0715547965587..40b9a9e6fe02b 100644 --- a/cmd/test/info/info.go +++ b/cmd/test/info/info.go @@ -37,6 +37,7 @@ var ( checkControl bool checkLength bool checkStreaming bool + checkBase32768 bool all bool uploadWait time.Duration positionLeftRe = regexp.MustCompile(`(?s)^(.*)-position-left-([[:xdigit:]]+)$`) @@ -47,13 +48,14 @@ var ( func init() { test.Command.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.StringVarP(cmdFlags, &writeJSON, "write-json", "", "", "Write results to file") - flags.BoolVarP(cmdFlags, &checkNormalization, "check-normalization", "", false, "Check UTF-8 Normalization") - flags.BoolVarP(cmdFlags, &checkControl, "check-control", "", false, "Check control characters") - flags.DurationVarP(cmdFlags, &uploadWait, "upload-wait", "", 0, "Wait after writing a file") - flags.BoolVarP(cmdFlags, &checkLength, "check-length", "", false, "Check max filename length") - flags.BoolVarP(cmdFlags, &checkStreaming, "check-streaming", "", false, "Check uploads with indeterminate file size") - flags.BoolVarP(cmdFlags, &all, "all", "", false, "Run all tests") + flags.StringVarP(cmdFlags, &writeJSON, "write-json", "", "", "Write results to file", "") + flags.BoolVarP(cmdFlags, &checkNormalization, "check-normalization", "", false, "Check UTF-8 Normalization", "") + flags.BoolVarP(cmdFlags, &checkControl, "check-control", "", false, "Check control characters", "") + flags.DurationVarP(cmdFlags, &uploadWait, "upload-wait", "", 0, "Wait after writing a file", "") + flags.BoolVarP(cmdFlags, &checkLength, "check-length", "", false, "Check max filename length", "") + flags.BoolVarP(cmdFlags, &checkStreaming, "check-streaming", "", false, "Check uploads with indeterminate file size", "") + flags.BoolVarP(cmdFlags, &checkBase32768, "check-base32768", "", false, "Check can store all possible base32768 characters", "") + flags.BoolVarP(cmdFlags, &all, "all", "", false, "Run all tests", "") } var commandDefinition = &cobra.Command{ @@ -71,14 +73,15 @@ a bit of go code for each one. }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1e6, command, args) - if !checkNormalization && !checkControl && !checkLength && !checkStreaming && !all { - log.Fatalf("no tests selected - select a test or use -all") + if !checkNormalization && !checkControl && !checkLength && !checkStreaming && !checkBase32768 && !all { + log.Fatalf("no tests selected - select a test or use --all") } if all { checkNormalization = true checkControl = true checkLength = true checkStreaming = true + checkBase32768 = true } for i := range args { f := cmd.NewFsDir(args[i : i+1]) @@ -100,6 +103,7 @@ type results struct { canReadUnnormalized bool canReadRenormalized bool canStream bool + canBase32768 bool } func newResults(ctx context.Context, f fs.Fs) *results { @@ -141,6 +145,9 @@ func (r *results) Print() { if checkStreaming { fmt.Printf("canStream = %v\n", r.canStream) } + if checkBase32768 { + fmt.Printf("base32768isOK = %v // make sure maxFileLength for 2 byte unicode chars is the same as for 1 byte characters\n", r.canBase32768) + } } // WriteJSON writes the results to a JSON file when requested @@ -483,6 +490,9 @@ func readInfo(ctx context.Context, f fs.Fs) error { if checkStreaming { r.checkStreaming() } + if checkBase32768 { + r.checkBase32768() + } r.Print() r.WriteJSON() return nil diff --git a/cmd/test/makefiles/makefiles.go b/cmd/test/makefiles/makefiles.go index 7b0ac57a88920..f48778cb03830 100644 --- a/cmd/test/makefiles/makefiles.go +++ b/cmd/test/makefiles/makefiles.go @@ -49,25 +49,25 @@ var ( func init() { test.Command.AddCommand(makefilesCmd) makefilesFlags := makefilesCmd.Flags() - flags.IntVarP(makefilesFlags, &numberOfFiles, "files", "", numberOfFiles, "Number of files to create") - flags.IntVarP(makefilesFlags, &averageFilesPerDirectory, "files-per-directory", "", averageFilesPerDirectory, "Average number of files per directory") - flags.IntVarP(makefilesFlags, &maxDepth, "max-depth", "", maxDepth, "Maximum depth of directory hierarchy") - flags.FVarP(makefilesFlags, &minFileSize, "min-file-size", "", "Minimum size of file to create") - flags.FVarP(makefilesFlags, &maxFileSize, "max-file-size", "", "Maximum size of files to create") - flags.IntVarP(makefilesFlags, &minFileNameLength, "min-name-length", "", minFileNameLength, "Minimum size of file names") - flags.IntVarP(makefilesFlags, &maxFileNameLength, "max-name-length", "", maxFileNameLength, "Maximum size of file names") + flags.IntVarP(makefilesFlags, &numberOfFiles, "files", "", numberOfFiles, "Number of files to create", "") + flags.IntVarP(makefilesFlags, &averageFilesPerDirectory, "files-per-directory", "", averageFilesPerDirectory, "Average number of files per directory", "") + flags.IntVarP(makefilesFlags, &maxDepth, "max-depth", "", maxDepth, "Maximum depth of directory hierarchy", "") + flags.FVarP(makefilesFlags, &minFileSize, "min-file-size", "", "Minimum size of file to create", "") + flags.FVarP(makefilesFlags, &maxFileSize, "max-file-size", "", "Maximum size of files to create", "") + flags.IntVarP(makefilesFlags, &minFileNameLength, "min-name-length", "", minFileNameLength, "Minimum size of file names", "") + flags.IntVarP(makefilesFlags, &maxFileNameLength, "max-name-length", "", maxFileNameLength, "Maximum size of file names", "") test.Command.AddCommand(makefileCmd) makefileFlags := makefileCmd.Flags() // Common flags to makefiles and makefile for _, f := range []*pflag.FlagSet{makefilesFlags, makefileFlags} { - flags.Int64VarP(f, &seed, "seed", "", seed, "Seed for the random number generator (0 for random)") - flags.BoolVarP(f, &zero, "zero", "", zero, "Fill files with ASCII 0x00") - flags.BoolVarP(f, &sparse, "sparse", "", sparse, "Make the files sparse (appear to be filled with ASCII 0x00)") - flags.BoolVarP(f, &ascii, "ascii", "", ascii, "Fill files with random ASCII printable bytes only") - flags.BoolVarP(f, &pattern, "pattern", "", pattern, "Fill files with a periodic pattern") - flags.BoolVarP(f, &chargen, "chargen", "", chargen, "Fill files with a ASCII chargen pattern") + flags.Int64VarP(f, &seed, "seed", "", seed, "Seed for the random number generator (0 for random)", "") + flags.BoolVarP(f, &zero, "zero", "", zero, "Fill files with ASCII 0x00", "") + flags.BoolVarP(f, &sparse, "sparse", "", sparse, "Make the files sparse (appear to be filled with ASCII 0x00)", "") + flags.BoolVarP(f, &ascii, "ascii", "", ascii, "Fill files with random ASCII printable bytes only", "") + flags.BoolVarP(f, &pattern, "pattern", "", pattern, "Fill files with a periodic pattern", "") + flags.BoolVarP(f, &chargen, "chargen", "", chargen, "Fill files with a ASCII chargen pattern", "") } } @@ -224,7 +224,7 @@ func (r *chargenReader) Read(p []byte) (n int, err error) { func fileName() (name string) { for { length := randSource.Intn(maxFileNameLength-minFileNameLength) + minFileNameLength - name = random.StringFn(length, randSource.Intn) + name = random.StringFn(length, randSource) if _, found := fileNames[name]; !found { break } diff --git a/cmd/test/test.go b/cmd/test/test.go index 8888f85c66fc7..381d5681a2fb0 100644 --- a/cmd/test/test.go +++ b/cmd/test/test.go @@ -16,7 +16,7 @@ var Command = &cobra.Command{ Short: `Run a test command`, Long: `Rclone test is used to run test commands. -Select which test comand you want with the subcommand, eg +Select which test command you want with the subcommand, eg rclone test memory remote: diff --git a/cmd/touch/touch.go b/cmd/touch/touch.go index 5dcf123e37e23..e86aba5556463 100644 --- a/cmd/touch/touch.go +++ b/cmd/touch/touch.go @@ -34,10 +34,10 @@ const ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, ¬CreateNewFile, "no-create", "C", false, "Do not create the file if it does not exist (implied with --recursive)") - flags.StringVarP(cmdFlags, &timeAsArgument, "timestamp", "t", "", "Use specified time instead of the current time of day") - flags.BoolVarP(cmdFlags, &localTime, "localtime", "", false, "Use localtime for timestamp, not UTC") - flags.BoolVarP(cmdFlags, &recursive, "recursive", "R", false, "Recursively touch all files") + flags.BoolVarP(cmdFlags, ¬CreateNewFile, "no-create", "C", false, "Do not create the file if it does not exist (implied with --recursive)", "") + flags.StringVarP(cmdFlags, &timeAsArgument, "timestamp", "t", "", "Use specified time instead of the current time of day", "") + flags.BoolVarP(cmdFlags, &localTime, "localtime", "", false, "Use localtime for timestamp, not UTC", "") + flags.BoolVarP(cmdFlags, &recursive, "recursive", "R", false, "Recursively touch all files", "") } var commandDefinition = &cobra.Command{ @@ -66,6 +66,7 @@ then add the ` + "`--localtime`" + ` flag. `, Annotations: map[string]string{ "versionIntroduced": "v1.39", + "groups": "Filter,Listing,Important", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) @@ -141,7 +142,7 @@ func Touch(ctx context.Context, f fs.Fs, remote string) error { file, err := f.NewObject(ctx, remote) if err != nil { if errors.Is(err, fs.ErrorObjectNotFound) { - // Touching non-existant path, possibly creating it as new file + // Touching non-existent path, possibly creating it as new file if remote == "" { fs.Logf(f, "Not touching empty directory") return nil diff --git a/cmd/tree/tree.go b/cmd/tree/tree.go index 16fb1da371984..a0b1dd44de38e 100644 --- a/cmd/tree/tree.go +++ b/cmd/tree/tree.go @@ -35,35 +35,35 @@ func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() // List - flags.BoolVarP(cmdFlags, &opts.All, "all", "a", false, "All files are listed (list . files too)") - flags.BoolVarP(cmdFlags, &opts.DirsOnly, "dirs-only", "d", false, "List directories only") - flags.BoolVarP(cmdFlags, &opts.FullPath, "full-path", "", false, "Print the full path prefix for each file") - //flags.BoolVarP(cmdFlags, &opts.IgnoreCase, "ignore-case", "", false, "Ignore case when pattern matching") - flags.BoolVarP(cmdFlags, &noReport, "noreport", "", false, "Turn off file/directory count at end of tree listing") - // flags.BoolVarP(cmdFlags, &opts.FollowLink, "follow", "l", false, "Follow symbolic links like directories") - flags.IntVarP(cmdFlags, &opts.DeepLevel, "level", "", 0, "Descend only level directories deep") + flags.BoolVarP(cmdFlags, &opts.All, "all", "a", false, "All files are listed (list . files too)", "") + flags.BoolVarP(cmdFlags, &opts.DirsOnly, "dirs-only", "d", false, "List directories only", "") + flags.BoolVarP(cmdFlags, &opts.FullPath, "full-path", "", false, "Print the full path prefix for each file", "") + //flags.BoolVarP(cmdFlags, &opts.IgnoreCase, "ignore-case", "", false, "Ignore case when pattern matching", "") + flags.BoolVarP(cmdFlags, &noReport, "noreport", "", false, "Turn off file/directory count at end of tree listing", "") + // flags.BoolVarP(cmdFlags, &opts.FollowLink, "follow", "l", false, "Follow symbolic links like directories","") + flags.IntVarP(cmdFlags, &opts.DeepLevel, "level", "", 0, "Descend only level directories deep", "") // flags.StringVarP(cmdFlags, &opts.Pattern, "pattern", "P", "", "List only those files that match the pattern given") // flags.StringVarP(cmdFlags, &opts.IPattern, "exclude", "", "", "Do not list files that match the given pattern") - flags.StringVarP(cmdFlags, &outFileName, "output", "o", "", "Output to file instead of stdout") + flags.StringVarP(cmdFlags, &outFileName, "output", "o", "", "Output to file instead of stdout", "") // Files - flags.BoolVarP(cmdFlags, &opts.ByteSize, "size", "s", false, "Print the size in bytes of each file.") - flags.BoolVarP(cmdFlags, &opts.FileMode, "protections", "p", false, "Print the protections for each file.") + flags.BoolVarP(cmdFlags, &opts.ByteSize, "size", "s", false, "Print the size in bytes of each file.", "") + flags.BoolVarP(cmdFlags, &opts.FileMode, "protections", "p", false, "Print the protections for each file.", "") // flags.BoolVarP(cmdFlags, &opts.ShowUid, "uid", "", false, "Displays file owner or UID number.") // flags.BoolVarP(cmdFlags, &opts.ShowGid, "gid", "", false, "Displays file group owner or GID number.") - flags.BoolVarP(cmdFlags, &opts.Quotes, "quote", "Q", false, "Quote filenames with double quotes.") - flags.BoolVarP(cmdFlags, &opts.LastMod, "modtime", "D", false, "Print the date of last modification.") + flags.BoolVarP(cmdFlags, &opts.Quotes, "quote", "Q", false, "Quote filenames with double quotes.", "") + flags.BoolVarP(cmdFlags, &opts.LastMod, "modtime", "D", false, "Print the date of last modification.", "") // flags.BoolVarP(cmdFlags, &opts.Inodes, "inodes", "", false, "Print inode number of each file.") // flags.BoolVarP(cmdFlags, &opts.Device, "device", "", false, "Print device ID number to which each file belongs.") // Sort - flags.BoolVarP(cmdFlags, &opts.NoSort, "unsorted", "U", false, "Leave files unsorted") - flags.BoolVarP(cmdFlags, &opts.VerSort, "version", "", false, "Sort files alphanumerically by version") - flags.BoolVarP(cmdFlags, &opts.ModSort, "sort-modtime", "t", false, "Sort files by last modification time") - flags.BoolVarP(cmdFlags, &opts.CTimeSort, "sort-ctime", "", false, "Sort files by last status change time") - flags.BoolVarP(cmdFlags, &opts.ReverSort, "sort-reverse", "r", false, "Reverse the order of the sort") - flags.BoolVarP(cmdFlags, &opts.DirSort, "dirsfirst", "", false, "List directories before files (-U disables)") - flags.StringVarP(cmdFlags, &sort, "sort", "", "", "Select sort: name,version,size,mtime,ctime") + flags.BoolVarP(cmdFlags, &opts.NoSort, "unsorted", "U", false, "Leave files unsorted", "") + flags.BoolVarP(cmdFlags, &opts.VerSort, "version", "", false, "Sort files alphanumerically by version", "") + flags.BoolVarP(cmdFlags, &opts.ModSort, "sort-modtime", "t", false, "Sort files by last modification time", "") + flags.BoolVarP(cmdFlags, &opts.CTimeSort, "sort-ctime", "", false, "Sort files by last status change time", "") + flags.BoolVarP(cmdFlags, &opts.ReverSort, "sort-reverse", "r", false, "Reverse the order of the sort", "") + flags.BoolVarP(cmdFlags, &opts.DirSort, "dirsfirst", "", false, "List directories before files (-U disables)", "") + flags.StringVarP(cmdFlags, &sort, "sort", "", "", "Select sort: name,version,size,mtime,ctime", "") // Graphics - flags.BoolVarP(cmdFlags, &opts.NoIndent, "noindent", "", false, "Don't print indentation lines") + flags.BoolVarP(cmdFlags, &opts.NoIndent, "noindent", "", false, "Don't print indentation lines", "") } var commandDefinition = &cobra.Command{ @@ -99,6 +99,7 @@ For a more interactive navigation of the remote see the `, Annotations: map[string]string{ "versionIntroduced": "v1.38", + "groups": "Filter,Listing", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(1, 1, command, args) diff --git a/cmd/version/version.go b/cmd/version/version.go index 5d35cb98ce956..4b61e8d929588 100644 --- a/cmd/version/version.go +++ b/cmd/version/version.go @@ -2,6 +2,7 @@ package version import ( + "context" "errors" "fmt" "io" @@ -13,6 +14,7 @@ import ( "github.com/rclone/rclone/cmd" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/fshttp" "github.com/spf13/cobra" ) @@ -23,7 +25,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &check, "check", "", false, "Check for new version") + flags.BoolVarP(cmdFlags, &check, "check", "", false, "Check for new version", "") } var commandDefinition = &cobra.Command{ @@ -71,9 +73,10 @@ Or "versionIntroduced": "v1.33", }, Run: func(command *cobra.Command, args []string) { + ctx := context.Background() cmd.CheckArgs(0, 0, command, args) if check { - CheckVersion() + CheckVersion(ctx) } else { cmd.ShowVersion() } @@ -89,8 +92,8 @@ func stripV(s string) string { } // GetVersion gets the version available for download -func GetVersion(url string) (v *semver.Version, vs string, date time.Time, err error) { - resp, err := http.Get(url) +func GetVersion(ctx context.Context, url string) (v *semver.Version, vs string, date time.Time, err error) { + resp, err := fshttp.NewClient(ctx).Get(url) if err != nil { return v, vs, date, err } @@ -114,7 +117,7 @@ func GetVersion(url string) (v *semver.Version, vs string, date time.Time, err e } // CheckVersion checks the installed version against available downloads -func CheckVersion() { +func CheckVersion(ctx context.Context) { vCurrent, err := semver.NewVersion(stripV(fs.Version)) if err != nil { fs.Errorf(nil, "Failed to parse version: %v", err) @@ -122,7 +125,7 @@ func CheckVersion() { const timeFormat = "2006-01-02" printVersion := func(what, url string) { - v, vs, t, err := GetVersion(url + "version.txt") + v, vs, t, err := GetVersion(ctx, url+"version.txt") if err != nil { fs.Errorf(nil, "Failed to get rclone %s version: %v", what, err) return diff --git a/cmdtest/cmdtest_test.go b/cmdtest/cmdtest_test.go index c8870258cc36f..f77ce9d93d63f 100644 --- a/cmdtest/cmdtest_test.go +++ b/cmdtest/cmdtest_test.go @@ -43,7 +43,7 @@ const rcloneTestMain = "RCLONE_TEST_MAIN" // rcloneExecMain calls rclone with the given environment and arguments. // The environment variables are in a single string separated by ; -// The terminal output is retuned as a string. +// The terminal output is returned as a string. func rcloneExecMain(env string, args ...string) (string, error) { _, found := os.LookupEnv(rcloneTestMain) if !found { @@ -62,7 +62,7 @@ func rcloneExecMain(env string, args ...string) (string, error) { // rcloneEnv calls rclone with the given environment and arguments. // The environment variables are in a single string separated by ; // The test config file is automatically configured in RCLONE_CONFIG. -// The terminal output is retuned as a string. +// The terminal output is returned as a string. func rcloneEnv(env string, args ...string) (string, error) { envConfig := env if testConfig != "" { @@ -76,7 +76,7 @@ func rcloneEnv(env string, args ...string) (string, error) { // rclone calls rclone with the given arguments, E.g. "version","--help". // The test config file is automatically configured in RCLONE_CONFIG. -// The terminal output is retuned as a string. +// The terminal output is returned as a string. func rclone(args ...string) (string, error) { return rcloneEnv("", args...) } diff --git a/contrib/docker-plugin/managed/Dockerfile b/contrib/docker-plugin/managed/Dockerfile index 0f82b36aa7335..2a16ed1da633f 100644 --- a/contrib/docker-plugin/managed/Dockerfile +++ b/contrib/docker-plugin/managed/Dockerfile @@ -8,7 +8,7 @@ FROM alpine:latest COPY --from=binaries /usr/local/bin/rclone /usr/bin/rclone RUN mkdir -p /data/config /data/cache /mnt \ - && apk --no-cache add ca-certificates fuse tzdata \ + && apk --no-cache add ca-certificates fuse3 tzdata \ && echo "user_allow_other" >> /etc/fuse.conf \ && rclone version diff --git a/docs/content/KEYS b/docs/content/KEYS new file mode 100644 index 0000000000000..af442fb390509 --- /dev/null +++ b/docs/content/KEYS @@ -0,0 +1,138 @@ +This file contains the PGP keys that are and have been used to sign +rclone releases. + +Users: pgp < KEYS +or + gpg --import KEYS + +Developers: + pgp -kxa and append it to this file. +or + (pgpk -ll && pgpk -xa ) >> this file. +or + (gpg --list-sigs && gpg --armor --export ) >> this file. + +pub dsa1024 2001-09-27 [SCA] + FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +uid [ultimate] Nick Craig-Wood +sig 3 93935E02FF3B54FA 2001-09-27 Nick Craig-Wood +sig 3 93935E02FF3B54FA 2020-02-03 Nick Craig-Wood +sig 3 93935E02FF3B54FA 2001-09-27 Nick Craig-Wood +sig A54E275E4248E016 2019-11-04 [User ID not found] +sig CB0DBEBC5F32C81D 2023-09-03 Nick Craig-Wood +sub elg2048 2001-09-27 [E] +sig 93935E02FF3B54FA 2001-09-27 Nick Craig-Wood + +pub rsa4096 2022-09-16 [SC] + E3B358DC858FB307F48170B9CB0DBEBC5F32C81D +uid [ultimate] Nick Craig-Wood +sig 3 CB0DBEBC5F32C81D 2022-09-16 Nick Craig-Wood +sig 93935E02FF3B54FA 2023-09-03 Nick Craig-Wood +sub rsa4096 2022-09-16 [E] +sig CB0DBEBC5F32C81D 2022-09-16 Nick Craig-Wood + +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQGiBDuy3V0RBADVQOAF5aFiCxD3t2h6iAF2WMiaMlgZ6kX2i/u7addNkzX71VU9 +7NpI0SnsP5YWt+gEedST6OmFbtLfZWCR4KWn5XnNdjCMNhxaH6WccVqNm4ALPIqT +59uVjkgf8RISmmoNJ1d+2wMWjQTUfwOEmoIgH6n+2MYNUKuctBrwAACflwCg1I1Q +O/prv/5hczdpQCs+fL87DxsD/Rt7pIXvsIOZyQWbIhSvNpGalJuMkW5Jx92UjsE9 +1Ipo3Xr6SGRPgW9+NxAZAsiZfCX/19knAyNrN9blwL0rcPDnkhdGwK69kfjF+wq+ +QbogRGodbKhqY4v+cMNkKiemBuTQiWPkpKjifwNsD1fNjNKfDP3pJ64Yz7a4fuzV +X1YwBACpKVuEen34lmcX6ziY4jq8rKibKBs4JjQCRO24kYoHDULVe+RS9krQWY5b +e0foDhru4dsKccefK099G+WEzKVCKxupstWkTT/iJwajR8mIqd4AhD0wO9W3MCfV +Ov8ykMDZ7qBWk1DHc87Ep3W1o8t8wq74ifV+HjhhWg8QAylXg7QlTmljayBDcmFp +Zy1Xb29kIDxuaWNrQGNyYWlnLXdvb2QuY29tPohXBBMRAgAXBQI7st1dBQsHCgME +AxUDAgMWAgECF4AACgkQk5NeAv87VPoPswCfaetrHxFhv6vpjadYWc6tyAZJHD4A +n2IfppvFB0vdOFgYBz/+u/6rN4p1iHEEExEIADEFCwcKAwQDFQMCAxYCAQIXgBYh +BPv3N+zp+KsYYEvSrJOTXgL/O1T6BQJeODZSAhkBAAoJEJOTXgL/O1T6WaYAniMf +kXJQvNK2OKy5O8ctNXPobjh5AJ9pHlAZkU+x56cTmJzZZ5BwFya2gYhXBBMRAgAX +BQI7st1dBQsHCgMEAxUDAgMWAgECF4AACgkQk5NeAv87VPoPswCgwDDvPZfRHenT +ca1r22pCum0FSlkAniLGFmVYPIcnMMF9OxQ6wBy34oZGiQIzBBABCgAdFiEEje07 +Kgm0YIzmpewHpU4nXkJI4BYFAl3Ap2EACgkQpU4nXkJI4BYFjw//Y3MtrkqtACWp +idlcLHRYpU+e17dhsZBP2afq56/B2zXFvtYnH0QyGN/YDjHMfK6Zi2Xxem7jg8ww +qH9s7eBAJUwbM6oAuhvQfdqpLCygAAep1ZKhuguSEUvJjoajqPQNjJE/aqini4Es +fnEVuK+y9L+smQvtFFx9U+PV7l6Z9WE3SFYtFvjUBL3FeaIfh36fUyj4xXR17Guj +ADtTHiWR4xElJ16NCj2VhfbE2wxoG2/SHDfHpzjW3B/pRJZOCOvJZcrtZRNqruff +8JGvLObswTlNiTn9rjc5lCPkMhnEke5i20BIymlPMlaNCE64AkkB/FDFed69b7u8 +R1E1LivBL0qoXIt1s8E+UW9ADBCxwloFeHroZhDPs6Y00EK+hGSJonB1pzguVc0u +MA9v9Gfcx099KQbfuSZefBCzpkktsmulb/59WEfK1Q4oVjdmCUG3/qwmLzAilzs6 +YaD75V6lp1lCON2jWod5xYSPsuvo2T0Exj4Q5MZcLVwqzH4UnmJPqdRVxWhhJEDE +qlsU+t0LCpDt4saVI5A91k5HMqFOJpX2hbLEx5OG3/gksED6FcZd1mwUVWEChjC0 +L6UNqpQZi+bNAX0CxY9XeqEIMN/EhLDbmLEwUHgMC3G4hX813k23mSWHBRsa0Mik +PCXX3tRioqPNF5ALl4gOmnF6ZD+WAQeJAjMEEAEIAB0WIQTjs1jchY+zB/SBcLnL +Db68XzLIHQUCZPRnNAAKCRDLDb68XzLIHZSAD/oCk9Z0xJfbpriphTBxFy7bWyPK +F1lM1GZZaLKkktGfunf1i0Q7rhwpNu+u1launlOTp6ZoY36Ce2Qa1eSxWAQdjVaj +w9kOHXCAewrTREOMY/mb7RVGjajo0Egl8T9iD3JRyaxu2iVtbpZYuqehtGG28CaC +zmtqE+EJcx1cGqAGSuuaDWRYlVX8KDip44GQB5Lut30vwSIoZG1CPCR6VE82u4cl +3mYZUfcJkCHsiLzoeadVzb+fOd+2ybzBn8Y77ifGgM+dSFSHe03mFfcHPdp0QImF +9HQR7XI0UMZmEJsw7c2vDrRa+kRY2A4/amGn4Tahuazq8g2yqgGm3yAj49qGNarA +au849lDr7R49j73ESnNVBGJ9ShzU4Ls+S1A5gohZVu2s1fkE3mbAmoTfU4JCrpRy +dOuL9xRJk5gbL44sKeuGODNshyTPJzG9DmRHpLsBn59v8mg5tqSfBIGqcqBxxnYH +JnkK801MkaLW2m7wDmtz6P3TW86gGukzfIN3/OufLjnpN3Nx376JwWDDIyif7sn6 +/q+ZMwGz9uLKZkAeM5c3Dh4ygpgliSLoV2bZzDz0iLxKWW7QOVVdWHmlEqbTldpQ +7gUEPG7mxpzVo0xd6nHncSq0M91x29It4B3fATx/iJB2eardMzSsbzHiwTg0eswh +YYGpSKZLgp4RShnVAbkCDQQ7st2BEAgAjpB0UGDf/FrWAUo9jLWKFX15J0arBZkY +m+iRax8K8fLnXzS2P+9Q04sAmt2qCUxK9681Nd7xtPrkPrjbcACwuFyH3Cr9o2qs +eiVNgAHPFGKCNxLX/9PKWfmdoZTOVVBcNV+sOTcx382uR04WPuv9jIwXT6JbCkXP +aoCMv3mLnB9VnWRYatPYCaK8TXAPWxZP8lrcUMjQ1GRTQ1vP9rRMp7iaXyItW1le +lNFvHEII92QddeBLK7V5ng2sX/BMm6/AafXZMnUQX3lpWQfEBTDT4qYsZ1zIEb4g +q4dqauyNYgBcZdX//8oDE+BS2FxxDTccyOW0Wyt2Z6flDTfhgzd46wADBQf+MAqI +gADwulmZk+e30Znj46VmnbZUB/J8M4WXg6X5xaOQsCCMAWybmCc4pxFIT/1c/GdC +qSHDv5nKBi5QyBMMn33/kgzVRAveihL6gWsNoT31Lxst457XuyRx1dwD8rzdWoP2 +b3etBGdu0P7vnOoqRmf1Y0XIoJeDk/o8U901hG2VAo5zAVH2YdEtSZqlBIAzxjak +KAAtnsZWIpBxrz9NPVOBmT18kxlgZ7P4iU4/FMnGOfzT6/LCTj/B0hZKJCP7y7lH +NP2yOabvvBsxU0ZGph1b8R6Zb1nP2+LQIi8kaBs8ypy7HDx7/mWe5DoyLe4NHQ/Z +E0gCEWt1mlVIwTzFBohGBBgRAgAGBQI7st2BAAoJEJOTXgL/O1T6YsEAoLZx0XLt +4tpAC/LNwTZUrodUiOckAKC4DTRvEtC4nj5EImssVk/xmU3ax5kCDQRjJI69ARAA +wCCaKZZmZe8mmusRuoHrqeVImFo+JUTNiktszB/l97INgZCSpVGFOcc4l4Weoioy +hObJV5wnpFjhadhpiRG1XYzNYi6vNKz8lsUkFxfkIFiXU2kRkwtQShiWf4LmobDQ +sY9SXRK2cVEFQwOqK9E0k99ZKoaQ31aqq1zcAzkRlBrJmjgmRJHX3DltA7z676Ap +YEJgAkDRBXFe3zViuxZ0/MMYqtwsbePvOMkXlPmQJ8havOjZRa0mEZtDekMt11vv +1bG1qFebMFuwYVd7YZ1kzL8NU8gNOtuW0E67Ts5voZdlZiQAbDke9V9uj9+hfae6 +vICrZ7eriPGVD6BetGNjUNFN+8fwHMycOvvHjZ/JlN8lCfw4ImK4F18ms51pqD74 +3w0b2VvoQOkkCzEyUReTixh60aMIabx8so4BmFdi7cK9E+4/WU933d+dSEVgr9Hp +ast2WoNTo7cPWgIcxSctWvq9AIULLDVytI2BVRbIRL5vZHNIlE839AVbef8SP5Vc +V+8xjNRw3bzpxhnu4TqYTrvexvq7YOsMxVc9qqN2w8w+Q6jL/0Hjq2fUouV6JH/u +6GY1vo9dCOXMROS/fD3qJfDIb/NZuYqnt2jQArJW2YVxL+4DE7yKvSNaHGY5kwEV +BrQCCTb16ANWxUHkBBuSP2+hYKrVQPAisdsovHRgcF0AEQEAAbQlTmljayBDcmFp +Zy1Xb29kIDxuaWNrQGNyYWlnLXdvb2QuY29tPokCTgQTAQgAOBYhBOOzWNyFj7MH +9IFwucsNvrxfMsgdBQJjJI69AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJ +EMsNvrxfMsgdxW8QAIckFmxogPfLD6kqIoiZerqPRcz5rYBfxa7lgQkuoLaqWhCP +QR+e5Ug3bqxexkYQrTyZwqzTTgntTTWt4hSg75mgAujMQh1bsYbxcSHiLSh3Q8bO +AaX3o+ewycqKRvaVLYD7m/f8ZHgjRdwtEV3M9tVIOpa/KB51+3PM23Kx7pWP8RnT +mLhbxDCQTYE4yiLFPBIoG8NH1raLXonvLHP+wFs2OJ18fkq3DHTKK48dTRs/QyNl +/kgmuFUv/SyXDEoe9XdweNnN4N005R7bHW9iJEoV8KBFJi9/K89jokwrrRCUk1Pz +p/QXSKYLX59uqufL4LQOCtEhmVJPTQKCd4eUhvCva70efRm1fwqV/PHJDXB2Y84Q +oBPyxitFJGvBc1RsB3t1iO9IAuWnfFLYBayVGbpHseO5RdgJT/Q1hWeZTFi3vfXX +snuDSl5FcjLhDVe5rrAa/oAGki2fA7YOeK7PB0uwK7O8s2ZErDHnV99zYMVy7hnY +LhxDhic4mQ/1uJ/6mcEO+6NU4FM6EA0Bt28WTgRyOM2WnZ8xjBBmHtV4ucvmbQn1 +CCZUCe6HG06l8/soaMKiCZFS0CKwed9ymhlHPp5nyD3CJw53EKdEDQAjSOxc9sI0 +L5/P73ijRkOVz5xMtyxXXAnsyVa0yXo/rbzBGjKMcJeuAa1168a3ydu0gMMWiF0E +EBEIAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZPRnIgAKCRCTk14C/ztU+nDL +AJ99G+k/+uCkMnJuQazlb10HeiF4DwCgx+BNLTMkLduN9F+bqPsKq0oVsCa5Ag0E +YySOvQEQALoUUvMMNBKr7xMUVSe/lvBQUhzdthcDARdCf5m/UQoBYdyfYEA7m0x1 +5fKMl2duZdT9pYTSt60LeRXiC4bJaMCl60Nb2gwPF7ko32TFLpEyRHznVeEw+ExV +OU82lOWwI6AOFwHO4hL+wgK5RXV9qgve3n30ccTvKRHpjmQSa2YD3S5pO20KRsJt +iU8nm1+e7zXGEqWvR3L4QhJtN4Xtda+Gv95lH22Y+XnHri9MNMYbXrhTrOAig1ne +5GF3goG/yps6QyoV2zdY+Zqojpi9sCtRdiwbETbp8izQNV53QBqORIILBuzZpmqJ +gSNbbFsAdJkmPfLbjx57BieF2YUvsl0DtVc8KdN6UCrhQF2CNaGdWWpJyKF6AHkE +iIt0npvlgAM8ZZ0y0WF5XqefvIEMx7DmpKZ822gvR2aTmDJzPhgFTVhelVHDJ6NS +l5FUhA+DB1U7SwFULc2VFJdDa2zrnM0T+bz5cc8mi1zazzcBklzLNpRoT0Iex2LC ++KPFmsBbObKGffvDwQkEJgBJ9FweRGLfiHOo1V4E+QwIZhoch/H5u9+2J3Hp0S/r +H6Jn97AjYZMUVZBC4rICBaIevqaIuP/Qno2hRSkccF388lLBWRW/qa8vaRpk9Xgt +8umvLmnumEKmmWxF6rHZu34ijgnaWfuunydfiu/v0kd6H5tO8h9NABEBAAGJAjYE +GAEIACAWIQTjs1jchY+zB/SBcLnLDb68XzLIHQUCYySOvQIbDAAKCRDLDb68XzLI +HcZpD/oCT20Tufzh3YvRqd7+nAziHzPoz15bkd0Y2B9wAQ4kkT4o6/vSSqpQeBAL +UVh54cTaMkyFUTr53U5rK0QyEFrwa1j6wQvHSbOhaCAVacii9n8eyELI0755eCAN +7w7mRsS05hTgKdQwn4TKnb9FvST+TMyyBcL8IPnHcmYbiX1repRlUZ5VvyWtQDO2 +Z3BISWtOnMJjItQ9N8zj3KkeLVtWennroYpDEJo2qpb5Ga320Mijoh0Mm8r3uM7o +rarpfnEsUGiko++elHVbgv7iTxyfxV+ny14ROAcY6VtF8a6MUflKYnAJytD9fwGt +2+Of7CB72b3Zq47XLh7FXozqWL2zCVrU5u55NXKGaSRXmPec54RrtAF0BfGpkbHZ +W4xOS2E4IzBNf3rhh7Nj+4MCGmx7RuRzHvlkltS38ktXQmUfch8pFhLKW8byxFhu +Je3QS3vnKmA2dQzHKZDQj8uyHUUD0WQlBtaY2p7G4zFhuC+xNHDs8Xbo+NCgsmg7 +8qSub42rXViT0kK9xeAKr3qKbumQqIfXHWQvamFHJeIpvrLEffhWKZc83PXpL9wY +JP/Rm0jTtKJeqD8w7rnafOi9qKyE2FgpltdWzsUSPDjqMlCgCrggqtUzTgKYl1S/ +6jXcPGkEadKE/t3kelkupnlwlyVLxF7NaIrb8fAqCau0MWIh4g== +=Iv9u +-----END PGP PUBLIC KEY BLOCK----- diff --git a/docs/content/_index.md b/docs/content/_index.md index 16ea91e1aafa1..a749137515c61 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -21,7 +21,7 @@ notoc: true Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage -interfaces. [Over 40 cloud storage products](#providers) support +interfaces. [Over 70 cloud storage products](#providers) support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols. @@ -113,7 +113,7 @@ WebDAV or S3, that work out of the box.) {{< provider name="Box" home="https://www.box.com/" config="/box/" >}} {{< provider name="Ceph" home="http://ceph.com/" config="/s3/#ceph" >}} {{< provider name="China Mobile Ecloud Elastic Object Storage (EOS)" home="https://ecloud.10086.cn/home/product-introduction/eos/" config="/s3/#china-mobile-ecloud-eos" >}} -{{< provider name="Arvan Cloud Object Storage (AOS)" home="https://www.arvancloud.com/en/products/cloud-storage" config="/s3/#arvan-cloud-object-storage-aos" >}} +{{< provider name="Arvan Cloud Object Storage (AOS)" home="https://www.arvancloud.ir/en/products/cloud-storage" config="/s3/#arvan-cloud-object-storage-aos" >}} {{< provider name="Citrix ShareFile" home="http://sharefile.com/" config="/sharefile/" >}} {{< provider name="Cloudflare R2" home="https://blog.cloudflare.com/r2-open-beta/" config="/s3/#cloudflare-r2" >}} {{< provider name="DigitalOcean Spaces" home="https://www.digitalocean.com/products/object-storage/" config="/s3/#digitalocean-spaces" >}} @@ -121,6 +121,7 @@ WebDAV or S3, that work out of the box.) {{< provider name="Dreamhost" home="https://www.dreamhost.com/cloud/storage/" config="/s3/#dreamhost" >}} {{< provider name="Dropbox" home="https://www.dropbox.com/" config="/dropbox/" >}} {{< provider name="Enterprise File Fabric" home="https://storagemadeeasy.com/about/" config="/filefabric/" >}} +{{< provider name="Fastmail Files" home="https://www.fastmail.com/" config="/webdav/#fastmail-files" >}} {{< provider name="FTP" home="https://en.wikipedia.org/wiki/File_Transfer_Protocol" config="/ftp/" >}} {{< provider name="Google Cloud Storage" home="https://cloud.google.com/storage/" config="/googlecloudstorage/" >}} {{< provider name="Google Drive" home="https://www.google.com/drive/" config="/drive/" >}} @@ -135,26 +136,35 @@ WebDAV or S3, that work out of the box.) {{< provider name="IDrive e2" home="https://www.idrive.com/e2/?refer=rclone" config="/s3/#idrive-e2" >}} {{< provider name="IONOS Cloud" home="https://cloud.ionos.com/storage/object-storage" config="/s3/#ionos" >}} {{< provider name="Koofr" home="https://koofr.eu/" config="/koofr/" >}} +{{< provider name="Leviia Object Storage" home="https://www.leviia.com/object-storage" config="/s3/#leviia" >}} {{< provider name="Liara Object Storage" home="https://liara.ir/landing/object-storage" config="/s3/#liara-object-storage" >}} +{{< provider name="Linkbox" home="https://linkbox.to/" config="/linkbox/" >}} +{{< provider name="Linode Object Storage" home="https://www.linode.com/products/object-storage/" config="/s3/#linode" >}} {{< provider name="Mail.ru Cloud" home="https://cloud.mail.ru/" config="/mailru/" >}} {{< provider name="Memset Memstore" home="https://www.memset.com/cloud/storage/" config="/swift/" >}} {{< provider name="Mega" home="https://mega.nz/" config="/mega/" >}} {{< provider name="Memory" home="/memory/" config="/memory/" >}} {{< provider name="Microsoft Azure Blob Storage" home="https://azure.microsoft.com/en-us/services/storage/blobs/" config="/azureblob/" >}} +{{< provider name="Microsoft Azure Files Storage" home="https://azure.microsoft.com/en-us/services/storage/files/" config="/azurefiles/" >}} {{< provider name="Microsoft OneDrive" home="https://onedrive.live.com/" config="/onedrive/" >}} {{< provider name="Minio" home="https://www.minio.io/" config="/s3/#minio" >}} {{< provider name="Nextcloud" home="https://nextcloud.com/" config="/webdav/#nextcloud" >}} {{< provider name="OVH" home="https://www.ovh.co.uk/public-cloud/storage/object-storage/" config="/swift/" >}} +{{< provider name="Blomp Cloud Storage" home="https://rclone.org/swift/" config="/swift/" >}} {{< provider name="OpenDrive" home="https://www.opendrive.com/" config="/opendrive/" >}} {{< provider name="OpenStack Swift" home="https://docs.openstack.org/swift/latest/" config="/swift/" >}} {{< provider name="Oracle Cloud Storage Swift" home="https://docs.oracle.com/en-us/iaas/integration/doc/configure-object-storage.html" config="/swift/" >}} {{< provider name="Oracle Object Storage" home="https://www.oracle.com/cloud/storage/object-storage" config="/oracleobjectstorage/" >}} {{< provider name="ownCloud" home="https://owncloud.org/" config="/webdav/#owncloud" >}} {{< provider name="pCloud" home="https://www.pcloud.com/" config="/pcloud/" >}} +{{< provider name="Petabox" home="https://petabox.io/" config="/s3/#petabox" >}} +{{< provider name="PikPak" home="https://mypikpak.com/" config="/pikpak/" >}} {{< provider name="premiumize.me" home="https://premiumize.me/" config="/premiumizeme/" >}} {{< provider name="put.io" home="https://put.io/" config="/putio/" >}} +{{< provider name="Proton Drive" home="https://proton.me/drive" config="/protondrive/" >}} {{< provider name="QingStor" home="https://www.qingcloud.com/products/storage" config="/qingstor/" >}} {{< provider name="Qiniu Cloud Object Storage (Kodo)" home="https://www.qiniu.com/en/products/kodo" config="/s3/#qiniu" >}} +{{< provider name="Quatrix by Maytech" home="https://www.maytech.net/products/quatrix-business" config="/quatrix/" >}} {{< provider name="Rackspace Cloud Files" home="https://www.rackspace.com/cloud/files" config="/swift/" >}} {{< provider name="rsync.net" home="https://rsync.net/products/rclone.html" config="/sftp/#rsync-net" >}} {{< provider name="Scaleway" home="https://www.scaleway.com/object-storage/" config="/s3/#scaleway" >}} @@ -166,6 +176,7 @@ WebDAV or S3, that work out of the box.) {{< provider name="SMB / CIFS" home="https://en.wikipedia.org/wiki/Server_Message_Block" config="/smb/" >}} {{< provider name="StackPath" home="https://www.stackpath.com/products/object-storage/" config="/s3/#stackpath" >}} {{< provider name="Storj" home="https://storj.io/" config="/storj/" >}} +{{< provider name="Synology" home="https://c2.synology.com/en-global/object-storage/overview" config="/s3/#synology-c2" >}} {{< provider name="SugarSync" home="https://sugarsync.com/" config="/sugarsync/" >}} {{< provider name="Tencent Cloud Object Storage (COS)" home="https://intl.cloud.tencent.com/product/cos" config="/s3/#tencent-cos" >}} {{< provider name="Uptobox" home="https://uptobox.com" config="/uptobox/" >}} diff --git a/docs/content/amazonclouddrive.md b/docs/content/amazonclouddrive.md index b0068f94f524d..cffc75e1f7285 100644 --- a/docs/content/amazonclouddrive.md +++ b/docs/content/amazonclouddrive.md @@ -127,13 +127,13 @@ To copy a local directory to an Amazon Drive directory called backup rclone copy /home/source remote:backup -### Modified time and MD5SUMs +### Modification times and hashes Amazon Drive doesn't allow modification times to be changed via the API so these won't be accurate or used for syncing. -It does store MD5SUMs so for a more accurate sync, you can use the -`--checksum` flag. +It does support the MD5 hash algorithm, so for a more accurate sync, +you can use the `--checksum` flag. ### Restricted filename characters @@ -303,7 +303,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ACD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/authors.md b/docs/content/authors.md index 34fa161c202d0..447fac7b84d15 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -13,7 +13,7 @@ Authors Contributors ------------ -{{< rem `email addresses removed from here need to be addeed to +{{< rem `email addresses removed from here need to be added to bin/.ignore-emails to make sure update-authors.py doesn't immediately put them back in again.` >}} @@ -526,7 +526,7 @@ put them back in again.` >}} * HNGamingUK * Jonta <359397+Jonta@users.noreply.github.com> * YenForYang - * Joda Stößer + * SimJoSt / Joda Stößer * Logeshwaran * Rajat Goel * r0kk3rz @@ -541,7 +541,6 @@ put them back in again.` >}} * Chris Nelson * Felix Bünemann * Atílio Antônio - * Roberto Ricci * Carlo Mion * Chris Lu * Vitor Arruda @@ -587,7 +586,7 @@ put them back in again.` >}} * Leroy van Logchem * Zsolt Ero * Lesmiscore - * ehsantdy + * ehsantdy * SwazRGB <65694696+swazrgb@users.noreply.github.com> * Mateusz Puczyński * Michael C Tiernan - MIT-Research Computing Project @@ -597,6 +596,7 @@ put them back in again.` >}} * Christian Galo <36752715+cgalo5758@users.noreply.github.com> * Erik van Velzen * Derek Battams + * Paul * SimonLiu * Hugo Laloge * Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com> @@ -696,3 +696,112 @@ put them back in again.` >}} * Leandro Sacchet * dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * cycneuramus <56681631+cycneuramus@users.noreply.github.com> + * Arnavion + * Christopher Merry + * Thibault Coupin + * Richard Tweed + * Zach Kipp + * yuudi <26199752+yuudi@users.noreply.github.com> + * NickIAm + * Juang, Yi-Lin + * jumbi77 + * Aditya Basu + * ed + * Drew Parsons + * Joel + * wiserain + * Roel Arents + * Shyim + * Rintze Zelle <78232505+rzelle-lallemand@users.noreply.github.com> + * Damo + * WeidiDeng + * Brian Starkey + * jladbrook + * Loren Gordon + * dlitster + * Tobias Gion + * Jānis Bebrītis + * Adam K + * Andrei Smirnov + * Janne Hellsten + * cc <12904584+shvc@users.noreply.github.com> + * Tareq Sharafy + * kapitainsky + * douchen + * Sam Lai <70988+slai@users.noreply.github.com> + * URenko <18209292+URenko@users.noreply.github.com> + * Stanislav Gromov + * Paulo Schreiner + * Mariusz Suchodolski + * danielkrajnik + * Peter Fern + * zzq + * mac-15 + * Sawada Tsunayoshi <34431649+TsunayoshiSawada@users.noreply.github.com> + * Dean Attali + * Fjodor42 + * BakaWang + * Mahad <56235065+Mahad-lab@users.noreply.github.com> + * Vladislav Vorobev + * darix + * Benjamin <36415086+bbenjamin-sys@users.noreply.github.com> + * Chun-Hung Tseng + * Ricardo D'O. Albanus + * gabriel-suela + * Tiago Boeing + * Edwin Mackenzie-Owen + * Niklas Hambüchen + * yuudi + * Zach + * nielash <31582349+nielash@users.noreply.github.com> + * Julian Lepinski + * Raymond Berger + * Nihaal Sangha + * Masamune3210 <1053504+Masamune3210@users.noreply.github.com> + * James Braza + * antoinetran + * alexia + * nielash + * Vitor Gomes + * Jacob Hands + * hideo aoyama <100831251+boukendesho@users.noreply.github.com> + * Roberto Ricci + * Bjørn Smith + * Alishan Ladhani <8869764+aladh@users.noreply.github.com> + * zjx20 + * Oksana <142890647+oks-maytech@users.noreply.github.com> + * Volodymyr Kit + * David Pedersen + * Drew Stinnett + * Pat Patterson + * Herby Gillot + * Nikita Shoshin + * rinsuki <428rinsuki+git@gmail.com> + * Beyond Meat <51850644+beyondmeat@users.noreply.github.com> + * Saleh Dindar + * Volodymyr <142890760+vkit-maytech@users.noreply.github.com> + * Gabriel Espinoza <31670639+gspinoza@users.noreply.github.com> + * Keigo Imai + * Ivan Yanitra + * alfish2000 + * wuxingzhong + * Adithya Kumar + * Tayo-pasedaRJ <138471223+Tayo-pasedaRJ@users.noreply.github.com> + * Peter Kreuser + * Piyush + * fotile96 + * Luc Ritchie + * cynful + * wjielai + * Jack Deng + * Mikubill <31246794+Mikubill@users.noreply.github.com> + * Artur Neumann + * Saw-jan + * Oksana Zhykina + * karan + * viktor + * moongdal + * Mina Galić + * Alen Šiljak + * 你知道未来吗 + * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> diff --git a/docs/content/azureblob.md b/docs/content/azureblob.md index 9a3440e99a93f..0e4bfd7f2d7ec 100644 --- a/docs/content/azureblob.md +++ b/docs/content/azureblob.md @@ -75,10 +75,10 @@ This remote supports `--fast-list` which allows you to use fewer transactions in exchange for more memory. See the [rclone docs](/docs/#fast-list) for more details. -### Modified time +### Modification times and hashes -The modified time is stored as metadata on the object with the `mtime` -key. It is stored using RFC3339 Format time with nanosecond +The modification time is stored as metadata on the object with the +`mtime` key. It is stored using RFC3339 Format time with nanosecond precision. The metadata is supplied during directory listings so there is no performance overhead to using it. @@ -88,6 +88,10 @@ flag. Note that rclone can't set `LastModified`, so using the `--update` flag when syncing is recommended if using `--use-server-modtime`. +MD5 hashes are stored with blobs. However blobs that were uploaded in +chunks only have an MD5 if the source remote was capable of MD5 +hashes, e.g. the local disk. + ### Performance When uploading large files, increasing the value of @@ -116,12 +120,6 @@ These only get replaced if they are the last character in the name: Invalid UTF-8 bytes will also be [replaced](/overview/#invalid-utf8), as they can't be used in JSON strings. -### Hashes - -MD5 hashes are stored with blobs. However blobs that were uploaded in -chunks only have an MD5 if the source remote was capable of MD5 -hashes, e.g. the local disk. - ### Authentication {#authentication} There are a number of ways of supplying credentials for Azure Blob @@ -162,6 +160,12 @@ It reads configuration from these variables, in the following order: - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to - `AZURE_USERNAME`: a username (usually an email address) - `AZURE_PASSWORD`: the user's password +4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). + ##### Env Auth: 2. Managed Service Identity Credentials @@ -189,7 +193,7 @@ Then you could access rclone resources like this: Or - rclone lsf --azureblob-env-auth --azureblob-acccount=ACCOUNT :azureblob:CONTAINER + rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER Which is analogous to using the `az` tool: @@ -669,10 +673,10 @@ Properties: #### --azureblob-access-tier -Access tier of blob: hot, cool or archive. +Access tier of blob: hot, cool, cold or archive. -Archived blobs can be restored by setting access tier to hot or -cool. Leave blank if you intend to use default access tier, which is +Archived blobs can be restored by setting access tier to hot, cool or +cold. Leave blank if you intend to use default access tier, which is set at account level If there is no "access tier" specified, rclone doesn't apply any tier. @@ -680,7 +684,7 @@ rclone performs "Set Tier" operation on blobs while uploading, if objects are not modified, specifying "access tier" to new one will have no effect. If blobs are in "archive tier" at remote, trying to perform data transfer operations from remote will not be allowed. User should first restore by -tiering blob to "Hot" or "Cool". +tiering blob to "Hot", "Cool" or "Cold". Properties: @@ -731,10 +735,7 @@ Properties: #### --azureblob-memory-pool-flush-time -How often internal memory buffer pools will be flushed. - -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool. +How often internal memory buffer pools will be flushed. (no longer used) Properties: @@ -745,7 +746,7 @@ Properties: #### --azureblob-memory-pool-use-mmap -Whether to use mmap buffers in internal memory pool. +Whether to use mmap buffers in internal memory pool. (no longer used) Properties: @@ -764,7 +765,7 @@ Properties: - Config: encoding - Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 #### --azureblob-public-access @@ -786,6 +787,24 @@ Properties: - "container" - Allow full public read access for container and blob data. +#### --azureblob-directory-markers + +Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with "/", to persist the folder. + +This object also has the metadata "hdi_isfolder = true" to conform to +the Microsoft standard. + + +Properties: + +- Config: directory_markers +- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS +- Type: bool +- Default: false + #### --azureblob-no-check-container If set, don't attempt to check the container exists or create it. diff --git a/docs/content/azurefiles.md b/docs/content/azurefiles.md new file mode 100644 index 0000000000000..a6e84f2e0c6fd --- /dev/null +++ b/docs/content/azurefiles.md @@ -0,0 +1,707 @@ +--- +title: "Microsoft Azure Files Storage" +description: "Rclone docs for Microsoft Azure Files Storage" +versionIntroduced: "v1.65" +--- + +# {{< icon "fab fa-windows" >}} Microsoft Azure Files Storage + +Paths are specified as `remote:` You may put subdirectories in too, +e.g. `remote:path/to/dir`. + +## Configuration + +Here is an example of making a Microsoft Azure Files Storage +configuration. For a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Microsoft Azure Files Storage + \ "azurefiles" +[snip] + +Option account. +Azure Storage Account Name. +Set this to the Azure Storage Account Name in use. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. +If this is blank and if env_auth is set it will be read from the +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. +Enter a value. Press Enter to leave empty. +account> account_name + +Option share_name. +Azure Files Share Name. +This is required and is the name of the share to access. +Enter a value. Press Enter to leave empty. +share_name> share_name + +Option env_auth. +Read credentials from runtime (environment variables, CLI or MSI). +See the [authentication docs](/azurefiles#authentication) for full info. +Enter a boolean value (true or false). Press Enter for the default (false). +env_auth> + +Option key. +Storage Account Shared Key. +Leave blank to use SAS URL or connection string. +Enter a value. Press Enter to leave empty. +key> base64encodedkey== + +Option sas_url. +SAS URL. +Leave blank if using account/key or connection string. +Enter a value. Press Enter to leave empty. +sas_url> + +Option connection_string. +Azure Files Connection String. +Enter a value. Press Enter to leave empty. +connection_string> +[snip] + +Configuration complete. +Options: +- type: azurefiles +- account: account_name +- share_name: share_name +- key: base64encodedkey== +Keep this "remote" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> +``` + +Once configured you can use rclone. + +See all files in the top level: + + rclone lsf remote: + +Make a new directory in the root: + + rclone mkdir remote:dir + +Recursively List the contents: + + rclone ls remote: + +Sync `/home/local/directory` to the remote directory, deleting any +excess files in the directory. + + rclone sync --interactive /home/local/directory remote:dir + +### Modified time + +The modified time is stored as Azure standard `LastModified` time on +files + +### Performance + +When uploading large files, increasing the value of +`--azurefiles-upload-concurrency` will increase performance at the cost +of using more memory. The default of 16 is set quite conservatively to +use less memory. It maybe be necessary raise it to 64 or higher to +fully utilize a 1 GBit/s link with a single file transfer. + +### Restricted filename characters + +In addition to the [default restricted characters set](/overview/#restricted-characters) +the following characters are also replaced: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \ | 0x5C | \ | +| \| | 0x7C | | | + +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| . | 0x2E | . | + +Invalid UTF-8 bytes will also be [replaced](/overview/#invalid-utf8), +as they can't be used in JSON strings. + +### Hashes + +MD5 hashes are stored with files. Not all files will have MD5 hashes +as these have to be uploaded with the file. + +### Authentication {#authentication} + +There are a number of ways of supplying credentials for Azure Files +Storage. Rclone tries them in the order of the sections below. + +#### Env Auth + +If the `env_auth` config parameter is `true` then rclone will pull +credentials from the environment or runtime. + +It tries these authentication methods in this order: + +1. Environment Variables +2. Managed Service Identity Credentials +3. Azure CLI credentials (as used by the az tool) + +These are described in the following sections + +##### Env Auth: 1. Environment Variables + +If `env_auth` is set and environment variables are present rclone +authenticates a service principal with a secret or certificate, or a +user with a password, depending on which environment variable are set. +It reads configuration from these variables, in the following order: + +1. Service principal with client secret + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets +2. Service principal with certificate + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. +3. User with username and password + - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations". + - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to + - `AZURE_USERNAME`: a username (usually an email address) + - `AZURE_PASSWORD`: the user's password +4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). + + +##### Env Auth: 2. Managed Service Identity Credentials + +When using Managed Service Identity if the VM(SS) on which this +program is running has a system-assigned identity, it will be used by +default. If the resource has no system-assigned but exactly one +user-assigned identity, the user-assigned identity will be used by +default. + +If the resource has multiple user-assigned identities you will need to +unset `env_auth` and set `use_msi` instead. See the [`use_msi` +section](#use_msi). + +##### Env Auth: 3. Azure CLI credentials (as used by the az tool) + +Credentials created with the `az` tool can be picked up using `env_auth`. + +For example if you were to login with a service principal like this: + + az login --service-principal -u XXX -p XXX --tenant XXX + +Then you could access rclone resources like this: + + rclone lsf :azurefiles,env_auth,account=ACCOUNT: + +Or + + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: + +#### Account and Shared Key + +This is the most straight forward and least flexible way. Just fill +in the `account` and `key` lines and leave the rest blank. + +#### SAS URL + +To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`. + +#### Connection String + +To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`. + +#### Service principal with client secret + +If these variables are set, rclone will authenticate with a service principal with a client secret. + +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID. +- `client_id`: the service principal's client ID +- `client_secret`: one of the service principal's client secrets + +The credentials can also be placed in a file using the +`service_principal_file` configuration option. + +#### Service principal with certificate + +If these variables are set, rclone will authenticate with a service principal with certificate. + +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID. +- `client_id`: the service principal's client ID +- `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key. +- `client_certificate_password`: (optional) password for the certificate file. +- `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. + +**NB** `client_certificate_password` must be obscured - see [rclone obscure](/commands/rclone_obscure/). + +#### User with username and password + +If these variables are set, rclone will authenticate with username and password. + +- `tenant`: (optional) tenant to authenticate in. Defaults to "organizations". +- `client_id`: client ID of the application the user will authenticate to +- `username`: a username (usually an email address) +- `password`: the user's password + +Microsoft doesn't recommend this kind of authentication, because it's +less secure than other authentication flows. This method is not +interactive, so it isn't compatible with any form of multi-factor +authentication, and the application must already have user or admin +consent. This credential can only authenticate work and school +accounts; it can't authenticate Microsoft accounts. + +**NB** `password` must be obscured - see [rclone obscure](/commands/rclone_obscure/). + +#### Managed Service Identity Credentials {#use_msi} + +If `use_msi` is set then managed service identity credentials are +used. This authentication only works when running in an Azure service. +`env_auth` needs to be unset to use this. + +However if you have multiple user identities to choose from these must +be explicitly specified using exactly one of the `msi_object_id`, +`msi_client_id`, or `msi_mi_res_id` parameters. + +If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is +set, this is is equivalent to using `env_auth`. + +{{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/azurefiles/azurefiles.go then run make backenddocs" >}} +### Standard options + +Here are the Standard options specific to azurefiles (Microsoft Azure Files). + +#### --azurefiles-account + +Azure Storage Account Name. + +Set this to the Azure Storage Account Name in use. + +Leave blank to use SAS URL or connection string, otherwise it needs to be set. + +If this is blank and if env_auth is set it will be read from the +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. + + +Properties: + +- Config: account +- Env Var: RCLONE_AZUREFILES_ACCOUNT +- Type: string +- Required: false + +#### --azurefiles-share-name + +Azure Files Share Name. + +This is required and is the name of the share to access. + + +Properties: + +- Config: share_name +- Env Var: RCLONE_AZUREFILES_SHARE_NAME +- Type: string +- Required: false + +#### --azurefiles-env-auth + +Read credentials from runtime (environment variables, CLI or MSI). + +See the [authentication docs](/azurefiles#authentication) for full info. + +Properties: + +- Config: env_auth +- Env Var: RCLONE_AZUREFILES_ENV_AUTH +- Type: bool +- Default: false + +#### --azurefiles-key + +Storage Account Shared Key. + +Leave blank to use SAS URL or connection string. + +Properties: + +- Config: key +- Env Var: RCLONE_AZUREFILES_KEY +- Type: string +- Required: false + +#### --azurefiles-sas-url + +SAS URL. + +Leave blank if using account/key or connection string. + +Properties: + +- Config: sas_url +- Env Var: RCLONE_AZUREFILES_SAS_URL +- Type: string +- Required: false + +#### --azurefiles-connection-string + +Azure Files Connection String. + +Properties: + +- Config: connection_string +- Env Var: RCLONE_AZUREFILES_CONNECTION_STRING +- Type: string +- Required: false + +#### --azurefiles-tenant + +ID of the service principal's tenant. Also called its directory ID. + +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password + + +Properties: + +- Config: tenant +- Env Var: RCLONE_AZUREFILES_TENANT +- Type: string +- Required: false + +#### --azurefiles-client-id + +The ID of the client in use. + +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password + + +Properties: + +- Config: client_id +- Env Var: RCLONE_AZUREFILES_CLIENT_ID +- Type: string +- Required: false + +#### --azurefiles-client-secret + +One of the service principal's client secrets + +Set this if using +- Service principal with client secret + + +Properties: + +- Config: client_secret +- Env Var: RCLONE_AZUREFILES_CLIENT_SECRET +- Type: string +- Required: false + +#### --azurefiles-client-certificate-path + +Path to a PEM or PKCS12 certificate file including the private key. + +Set this if using +- Service principal with certificate + + +Properties: + +- Config: client_certificate_path +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH +- Type: string +- Required: false + +#### --azurefiles-client-certificate-password + +Password for the certificate file (optional). + +Optionally set this if using +- Service principal with certificate + +And the certificate has a password. + + +**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). + +Properties: + +- Config: client_certificate_password +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD +- Type: string +- Required: false + +### Advanced options + +Here are the Advanced options specific to azurefiles (Microsoft Azure Files). + +#### --azurefiles-client-send-certificate-chain + +Send the certificate chain when using certificate auth. + +Specifies whether an authentication request will include an x5c header +to support subject name / issuer based authentication. When set to +true, authentication requests include the x5c header. + +Optionally set this if using +- Service principal with certificate + + +Properties: + +- Config: client_send_certificate_chain +- Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN +- Type: bool +- Default: false + +#### --azurefiles-username + +User name (usually an email address) + +Set this if using +- User with username and password + + +Properties: + +- Config: username +- Env Var: RCLONE_AZUREFILES_USERNAME +- Type: string +- Required: false + +#### --azurefiles-password + +The user's password + +Set this if using +- User with username and password + + +**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). + +Properties: + +- Config: password +- Env Var: RCLONE_AZUREFILES_PASSWORD +- Type: string +- Required: false + +#### --azurefiles-service-principal-file + +Path to file containing credentials for use with a service principal. + +Leave blank normally. Needed only if you want to use a service principal instead of interactive login. + + $ az ad sp create-for-rbac --name "" \ + --role "Storage Files Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json + +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + +**NB** this section needs updating for Azure Files - pull requests appreciated! + +It may be more convenient to put the credentials directly into the +rclone config file under the `client_id`, `tenant` and `client_secret` +keys instead of setting `service_principal_file`. + + +Properties: + +- Config: service_principal_file +- Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE +- Type: string +- Required: false + +#### --azurefiles-use-msi + +Use a managed service identity to authenticate (only works in Azure). + +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) +to authenticate to Azure Storage instead of a SAS token or account key. + +If the VM(SS) on which this program is running has a system-assigned identity, it will +be used by default. If the resource has no system-assigned but exactly one user-assigned identity, +the user-assigned identity will be used by default. If the resource has multiple user-assigned +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, +msi_client_id, or msi_mi_res_id parameters. + +Properties: + +- Config: use_msi +- Env Var: RCLONE_AZUREFILES_USE_MSI +- Type: bool +- Default: false + +#### --azurefiles-msi-object-id + +Object ID of the user-assigned MSI to use, if any. + +Leave blank if msi_client_id or msi_mi_res_id specified. + +Properties: + +- Config: msi_object_id +- Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID +- Type: string +- Required: false + +#### --azurefiles-msi-client-id + +Object ID of the user-assigned MSI to use, if any. + +Leave blank if msi_object_id or msi_mi_res_id specified. + +Properties: + +- Config: msi_client_id +- Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID +- Type: string +- Required: false + +#### --azurefiles-msi-mi-res-id + +Azure resource ID of the user-assigned MSI to use, if any. + +Leave blank if msi_client_id or msi_object_id specified. + +Properties: + +- Config: msi_mi_res_id +- Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID +- Type: string +- Required: false + +#### --azurefiles-endpoint + +Endpoint for the service. + +Leave blank normally. + +Properties: + +- Config: endpoint +- Env Var: RCLONE_AZUREFILES_ENDPOINT +- Type: string +- Required: false + +#### --azurefiles-chunk-size + +Upload chunk size. + +Note that this is stored in memory and there may be up to +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once +in memory. + +Properties: + +- Config: chunk_size +- Env Var: RCLONE_AZUREFILES_CHUNK_SIZE +- Type: SizeSuffix +- Default: 4Mi + +#### --azurefiles-upload-concurrency + +Concurrency for multipart uploads. + +This is the number of chunks of the same file that are uploaded +concurrently. + +If you are uploading small numbers of large files over high-speed +links and these uploads do not fully utilize your bandwidth, then +increasing this may help to speed up the transfers. + +Note that chunks are stored in memory and there may be up to +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once +in memory. + +Properties: + +- Config: upload_concurrency +- Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY +- Type: int +- Default: 16 + +#### --azurefiles-max-stream-size + +Max size for streamed files. + +Azure files needs to know in advance how big the file will be. When +rclone doesn't know it uses this value instead. + +This will be used when rclone is streaming data, the most common uses are: + +- Uploading files with `--vfs-cache-mode off` with `rclone mount` +- Using `rclone rcat` +- Copying files with unknown length + +You will need this much free space in the share as the file will be this size temporarily. + + +Properties: + +- Config: max_stream_size +- Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE +- Type: SizeSuffix +- Default: 10Gi + +#### --azurefiles-encoding + +The encoding for the backend. + +See the [encoding section in the overview](/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_AZUREFILES_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot + +{{< rem autogenerated options stop >}} + +### Custom upload headers + +You can set custom upload headers with the `--header-upload` flag. + +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type + +Eg `--header-upload "Content-Type: text/potato"` + +## Limitations + +MD5 sums are only uploaded with chunked files if the source has an MD5 +sum. This will always be the case for a local to azure copy. diff --git a/docs/content/b2.md b/docs/content/b2.md index b5e5552b52304..7f822b42f109c 100644 --- a/docs/content/b2.md +++ b/docs/content/b2.md @@ -96,9 +96,9 @@ This remote supports `--fast-list` which allows you to use fewer transactions in exchange for more memory. See the [rclone docs](/docs/#fast-list) for more details. -### Modified time +### Modification times -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as `X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 in the Backblaze standard. Other tools should be able to use this as a modified time. @@ -231,6 +231,19 @@ $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt ``` +#### Versions naming caveat + +When using `--b2-versions` flag rclone is relying on the file name +to work out whether the objects are versions or not. Versions' names +are created by inserting timestamp between file name and its extension. +``` + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt +``` +If there are real files present with the same names as versions, then +behaviour of `--b2-versions` can be unpredictable. + ### Data usage It is useful to know how many requests are sent to the server in different scenarios. @@ -479,6 +492,24 @@ Properties: - Type: SizeSuffix - Default: 96Mi +#### --b2-upload-concurrency + +Concurrency for multipart uploads. + +This is the number of chunks of the same file that are uploaded +concurrently. + +Note that chunks are stored in memory and there may be up to +"--transfers" * "--b2-upload-concurrency" chunks stored at once +in memory. + +Properties: + +- Config: upload_concurrency +- Env Var: RCLONE_B2_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 + #### --b2-disable-checksum Disable checksums for large (> upload cutoff) files. @@ -537,9 +568,7 @@ Properties: #### --b2-memory-pool-flush-time -How often internal memory buffer pools will be flushed. -Uploads which requires additional buffers (f.e multipart) will use memory pool for allocations. -This option controls how often unused buffers will be removed from the pool. +How often internal memory buffer pools will be flushed. (no longer used) Properties: @@ -550,7 +579,7 @@ Properties: #### --b2-memory-pool-use-mmap -Whether to use mmap buffers in internal memory pool. +Whether to use mmap buffers in internal memory pool. (no longer used) Properties: @@ -559,6 +588,37 @@ Properties: - Type: bool - Default: false +#### --b2-lifecycle + +Set the number of days deleted files should be kept when creating a bucket. + +On bucket creation, this parameter is used to create a lifecycle rule +for the entire bucket. + +If lifecycle is 0 (the default) it does not create a lifecycle rule so +the default B2 behaviour applies. This is to create versions of files +on delete and overwrite and to keep them indefinitely. + +If lifecycle is >0 then it creates a single rule setting the number of +days before a file that is deleted or overwritten is deleted +permanently. This is known as daysFromHidingToDeleting in the b2 docs. + +The minimum value for this parameter is 1 day. + +You can also enable hard_delete in the config also which will mean +deletions won't cause versions but overwrites will still cause +versions to be made. + +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. + + +Properties: + +- Config: lifecycle +- Env Var: RCLONE_B2_LIFECYCLE +- Type: int +- Default: 0 + #### --b2-encoding The encoding for the backend. @@ -569,9 +629,76 @@ Properties: - Config: encoding - Env Var: RCLONE_B2_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +## Backend commands + +Here are the commands specific to the b2 backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](/rc/#backend-command). + +### lifecycle + +Read or set the lifecycle for a bucket + + rclone backend lifecycle remote: [options] [+] + +This command can be used to read or set the lifecycle for a bucket. + +Usage Examples: + +To show the current lifecycle rules: + + rclone backend lifecycle b2:bucket + +This will dump something like this showing the lifecycle rules. + + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] + +If there are no lifecycle rules (the default) then it will just return []. + +To reset the current lifecycle rules: + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 + +This will run and then print the new lifecycle rules as above. + +Rclone only lets you set lifecycles for the whole bucket with the +fileNamePrefix = "". + +You can't disable versioning with B2. The best you can do is to set +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in +the config also which will mean deletions won't cause versions but +overwrites will still cause versions to be made. + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 + +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules + + +Options: + +- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off. +- "daysFromUploadingToHiding": This many days after uploading a file is hidden + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/bisync.md b/docs/content/bisync.md index df88cf87eca58..be03f8cb83757 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -91,10 +91,16 @@ Optional Flags: If exceeded, the bisync run will abort. (default: 50%) --force Bypass `--max-delete` safety check and run the sync. Consider using with `--verbose` + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) --remove-empty-dirs Remove empty directories at the final cleanup step. -1, --resync Performs the resync run. Warning: Path1 files may overwrite Path2 versions. Consider using `--verbose` or `--dry-run` first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! --localtime Use local time in listings (default: UTC) --no-cleanup Retain working files (useful for troubleshooting and testing). --workdir PATH Use custom working directory (useful for testing). @@ -121,7 +127,7 @@ Cloud references are distinguished by having a `:` in the argument (see [Windows support](#windows) below). Path1 and Path2 are treated equally, in that neither has priority for -file changes, and access efficiency does not change whether a remote +file changes (except during [`--resync`](#resync)), and access efficiency does not change whether a remote is on Path1 or Path2. The listings in bisync working directory (default: `~/.cache/rclone/bisync`) @@ -130,8 +136,8 @@ to individual directories within the tree may be set up, e.g.: `path_to_local_tree..dropbox_subdir.lst`. Any empty directories after the sync on both the Path1 and Path2 -filesystems are not deleted by default. If the `--remove-empty-dirs` -flag is specified, then both paths will have any empty directories purged +filesystems are not deleted by default, unless `--create-empty-src-dirs` is specified. +If the `--remove-empty-dirs` flag is specified, then both paths will have ALL empty directories purged as the last step in the process. ## Command-line flags @@ -140,15 +146,31 @@ as the last step in the process. This will effectively make both Path1 and Path2 filesystems contain a matching superset of all files. Path2 files that do not exist in Path1 will -be copied to Path1, and the process will then sync the Path1 tree to Path2. +be copied to Path1, and the process will then copy the Path1 tree to Path2. -The base directories on the both Path1 and Path2 filesystems must exist +The `--resync` sequence is roughly equivalent to: +``` +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 +``` +Or, if using `--create-empty-src-dirs`: +``` +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 --create-empty-src-dirs +rclone copy Path2 Path1 --create-empty-src-dirs +``` + +The base directories on both Path1 and Path2 filesystems must exist or bisync will fail. This is required for safety - that bisync can verify that both paths are valid. -When using `--resync`, a newer version of a file either on Path1 or Path2 -filesystem, will overwrite the file on the other path (only the last version -will be kept). Carefully evaluate deltas using [--dry-run](/flags/#non-backend-flags). +When using `--resync`, a newer version of a file on the Path2 filesystem +will be overwritten by the Path1 filesystem version. +(Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) +Carefully evaluate deltas using [--dry-run](/flags/#non-backend-flags). + +[//]: # (I reverted a recent change in the above paragraph, as it was incorrect. +https://github.com/rclone/rclone/commit/dd72aff98a46c6e20848ac7ae5f7b19d45802493 ) For a resync run, one of the paths may be empty (no files in the path tree). The resync run should result in files on both paths, else a normal non-resync @@ -165,13 +187,23 @@ Access check files are an additional safety measure against data loss. bisync will ensure it can find matching `RCLONE_TEST` files in the same places in the Path1 and Path2 filesystems. `RCLONE_TEST` files are not generated automatically. -For `--check-access`to succeed, you must first either: -**A)** Place one or more `RCLONE_TEST` files in the Path1 or Path2 filesystem -and then do either a run without `--check-access` or a [--resync](#resync) to -set matching files on both filesystems, or +For `--check-access` to succeed, you must first either: +**A)** Place one or more `RCLONE_TEST` files in both systems, or **B)** Set `--check-filename` to a filename already in use in various locations -throughout your sync'd fileset. -Time stamps and file contents are not important, just the names and locations. +throughout your sync'd fileset. Recommended methods for **A)** include: +* `rclone touch Path1/RCLONE_TEST` (create a new file) +* `rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST` (copy an existing file) +* `rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST"` (copy multiple files at once, recursively) +* create the files manually (outside of rclone) +* run `bisync` once *without* `--check-access` to set matching files on both filesystems +will also work, but is not preferred, due to potential for user error +(you are temporarily disabling the safety feature). + +Note that `--check-access` is still enforced on `--resync`, so `bisync --resync --check-access` +will not work as a method of initially setting the files (this is to ensure that bisync can't +[inadvertently circumvent its own safety switch](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should).) + +Time stamps and file contents for `RCLONE_TEST` files are not important, just the names and locations. If you have symbolic links in your sync tree it is recommended to place `RCLONE_TEST` files in the linked-to directory tree to protect against bisync assuming a bunch of deleted files if the linked-to tree should not be @@ -198,7 +230,7 @@ files and a bunch of new files. This safety check is intended to block bisync from deleting all of the files on both filesystems due to a temporary network access issue, or if the user had inadvertently deleted the files on one side or the other. -To force the sync either set a different delete percentage limit, +To force the sync, either set a different delete percentage limit, e.g. `--max-delete 75` (allows up to 75% deletion), or use `--force` to bypass the check. @@ -215,17 +247,17 @@ An [example filters file](#example-filters-file) contains filters for non-allowed files for synching with Dropbox. If you make changes to your filters file then bisync requires a run -with `--resync`. This is a safety feature, which avoids existing files +with `--resync`. This is a safety feature, which prevents existing files on the Path1 and/or Path2 side from seeming to disappear from view (since they are excluded in the new listings), which would fool bisync into seeing them as deleted (as compared to the prior run listings), and then bisync would proceed to delete them for real. -To block this from happening bisync calculates an MD5 hash of the filters file +To block this from happening, bisync calculates an MD5 hash of the filters file and stores the hash in a `.md5` file in the same place as your filters file. -On the next runs with `--filters-file` set, bisync re-calculates the MD5 hash -of the current filters file and compares it to the hash stored in `.md5` file. -If they don't match the run aborts with a critical error and thus forces you +On the next run with `--filters-file` set, bisync re-calculates the MD5 hash +of the current filters file and compares it to the hash stored in the `.md5` file. +If they don't match, the run aborts with a critical error and thus forces you to do a `--resync`, likely avoiding a disaster. #### --check-sync @@ -245,6 +277,60 @@ sync run times for very large numbers of files. The check may be run manually with `--check-sync=only`. It runs only the integrity check and terminates without actually synching. +See also: [Concurrent modifications](#concurrent-modifications) + + +#### --ignore-listing-checksum + +By default, bisync will retrieve (or generate) checksums (for backends that support them) +when creating the listings for both paths, and store the checksums in the listing files. +`--ignore-listing-checksum` will disable this behavior, which may speed things up considerably, +especially on backends (such as [local](/local/)) where hashes must be computed on the fly instead of retrieved. +Please note the following: + +* While checksums are (by default) generated and stored in the listing files, +they are NOT currently used for determining diffs (deltas). +It is anticipated that full checksum support will be added in a future version. +* `--ignore-listing-checksum` is NOT the same as [`--ignore-checksum`](/docs/#ignore-checksum), +and you may wish to use one or the other, or both. In a nutshell: +`--ignore-listing-checksum` controls whether checksums are considered when scanning for diffs, +while `--ignore-checksum` controls whether checksums are considered during the copy/sync operations that follow, +if there ARE diffs. +* Unless `--ignore-listing-checksum` is passed, bisync currently computes hashes for one path +*even when there's no common hash with the other path* +(for example, a [crypt](/crypt/#modification-times-and-hashes) remote.) +* If both paths support checksums and have a common hash, +AND `--ignore-listing-checksum` was not specified when creating the listings, +`--check-sync=only` can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) +However, `--check-sync=only` will NOT include checksums if the previous listings +were generated on a run using `--ignore-listing-checksum`. For a more robust integrity check of the current state, +consider using [`check`](commands/rclone_check/) +(or [`cryptcheck`](/commands/rclone_cryptcheck/), if at least one path is a `crypt` remote.) + +#### --resilient + +***Caution: this is an experimental feature. Use at your own risk!*** + +By default, most errors or interruptions will cause bisync to abort and +require [`--resync`](#resync) to recover. This is a safety feature, +to prevent bisync from running again until a user checks things out. +However, in some cases, bisync can go too far and enforce a lockout when one isn't actually necessary, +like for certain less-serious errors that might resolve themselves on the next run. +When `--resilient` is specified, bisync tries its best to recover and self-correct, +and only requires `--resync` as a last resort when a human's involvement is absolutely necessary. +The intended use case is for running bisync as a background process (such as via scheduled [cron](#cron)). + +When using `--resilient` mode, bisync will still report the error and abort, +however it will not lock out future runs -- allowing the possibility of retrying at the next normally scheduled time, +without requiring a `--resync` first. Examples of such retryable errors include +access test failures, missing listing files, and filter change detections. +These safety features will still prevent the *current* run from proceeding -- +the difference is that if conditions have improved by the time of the *next* run, +that next run will be allowed to proceed. +Certain more serious errors will still enforce a `--resync` lockout, even in `--resilient` mode, to prevent data loss. + +Behavior of `--resilient` may change in a future version. + ## Operation ### Runtime flow details @@ -288,15 +374,26 @@ Path1 deleted | File no longer exists on Path1 | File is deleted Type | Description | Result | Implementation --------------------------------|---------------------------------------|------------------------------------|----------------------- -Path1 new AND Path2 new | File is new on Path1 AND new on Path2 | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 -Path2 newer AND Path1 changed | File is newer on Path2 AND also changed (newer/older/size) on Path1 | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 +Path1 new/changed AND Path2 new/changed AND Path1 == Path2 | File is new/changed on Path1 AND new/changed on Path2 AND Path1 version is currently identical to Path2 | No change | None +Path1 new AND Path2 new | File is new on Path1 AND new on Path2 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 +Path2 newer AND Path1 changed | File is newer on Path2 AND also changed (newer/older/size) on Path1 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 Path2 newer AND Path1 deleted | File is newer on Path2 AND also deleted on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 Path2 deleted AND Path1 changed | File is deleted on Path2 AND changed (newer/older/size) on Path1 | Path1 version survives |`rclone copy` Path1 to Path2 Path1 deleted AND Path2 changed | File is deleted on Path1 AND changed (newer/older/size) on Path2 | Path2 version survives | `rclone copy` Path2 to Path1 +As of `rclone v1.64`, bisync is now better at detecting *false positive* sync conflicts, +which would previously have resulted in unnecessary renames and duplicates. +Now, when bisync comes to a file that it wants to rename (because it is new/changed on both sides), +it first checks whether the Path1 and Path2 versions are currently *identical* +(using the same underlying function as [`check`](commands/rclone_check/).) +If bisync concludes that the files are identical, it will skip them and move on. +Otherwise, it will create renamed `..Path1` and `..Path2` duplicates, as before. +This behavior also [improves the experience of renaming directories](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=Renamed%20directories), +as a `--resync` is no longer required, so long as the same change has been made on both sides. + ### All files changed check {#all-files-changed} -if _all_ prior existing files on either of the filesystems have changed +If _all_ prior existing files on either of the filesystems have changed (e.g. timestamps have changed due to changing the system's timezone) then bisync will abort without making any changes. Any new files are not considered for this check. You could use `--force` @@ -305,7 +402,7 @@ Alternately, a `--resync` may be used (Path1 versions will be pushed to Path2). Consider the situation carefully and perhaps use `--dry-run` before you commit to the changes. -### Modification time +### Modification times Bisync relies on file timestamps to identify changed files and will _refuse_ to operate if backend lacks the modification time support. @@ -333,7 +430,7 @@ It is recommended to use `--resync --dry-run --verbose` initially and _carefully_ review what changes will be made before running the `--resync` without `--dry-run`. -Most of these events come up due to a error status from an internal call. +Most of these events come up due to an error status from an internal call. On such a critical error the `{...}.path1.lst` and `{...}.path2.lst` listing files are renamed to extension `.lst-err`, which blocks any future bisync runs (since the normal `.lst` files are not found). @@ -343,6 +440,8 @@ typically at `${HOME}/.cache/rclone/bisync/` on Linux. Some errors are considered temporary and re-running the bisync is not blocked. The _critical return_ blocks further bisync runs. +See also: [`--resilient`](#resilient) + ### Lock file When bisync is running, a lock file is created in the bisync working directory, @@ -383,7 +482,7 @@ It has not been fully tested with other services yet. If it works, or sorta works, please let us know and we'll update the list. Run the test suite to check for proper operation as described below. -First release of `rclone bisync` requires that underlying backend supported +First release of `rclone bisync` requires that underlying backend supports the modification time feature and will refuse to run otherwise. This limitation will be lifted in a future `rclone bisync` release. @@ -398,38 +497,97 @@ This will be solved in a future release, there is no workaround at the moment. Files that **change during** a bisync run may result in data loss. This has been seen in a highly dynamic environment, where the filesystem is getting hammered by running processes during the sync. -The solution is to sync at quiet times or [filter out](#filtering) +The currently recommended solution is to sync at quiet times or [filter out](#filtering) unnecessary directories and files. -### Empty directories +As an [alternative approach](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), +consider using `--check-sync=false` (and possibly `--resilient`) to make bisync more forgiving +of filesystems that change during the sync. +Be advised that this may cause bisync to miss events that occur during a bisync run, +so it is a good idea to supplement this with a periodic independent integrity check, +and corrective sync if diffs are found. For example, a possible sequence could look like this: + +1. Normally scheduled bisync run: + +``` +rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient +``` + +2. Periodic independent integrity check (perhaps scheduled nightly or weekly): + +``` +rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt +``` -New empty directories on one path are _not_ propagated to the other side. -This is because bisync (and rclone) natively works on files not directories. -The following sequence is a workaround but will not propagate the delete -of an empty directory to the other side: +3. If diffs are found, you have some choices to correct them. +If one side is more up-to-date and you want to make the other side match it, you could run: ``` -rclone bisync PATH1 PATH2 -rclone copy PATH1 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs -rclone copy PATH2 PATH2 --filter "+ */" --filter "- **" --create-empty-src-dirs +rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v ``` +(or switch Path1 and Path2 to make Path2 the source-of-truth) + +Or, if neither side is totally up-to-date, you could run a `--resync` to bring them back into agreement +(but remember that this could cause deleted files to re-appear.) + +*Note also that `rclone check` does not currently include empty directories, +so if you want to know if any empty directories are out of sync, +consider alternatively running the above `rclone sync` command with `--dry-run` added. + +### Empty directories + +By default, new/deleted empty directories on one path are _not_ propagated to the other side. +This is because bisync (and rclone) natively works on files, not directories. +However, this can be changed with the `--create-empty-src-dirs` flag, which works in +much the same way as in [`sync`](/commands/rclone_sync/) and [`copy`](/commands/rclone_copy/). +When used, empty directories created or deleted on one side will also be created or deleted on the other side. +The following should be noted: +* `--create-empty-src-dirs` is not compatible with `--remove-empty-dirs`. Use only one or the other (or neither). +* It is not recommended to switch back and forth between `--create-empty-src-dirs` +and the default (no `--create-empty-src-dirs`) without running `--resync`. +This is because it may appear as though all directories (not just the empty ones) were created/deleted, +when actually you've just toggled between making them visible/invisible to bisync. +It looks scarier than it is, but it's still probably best to stick to one or the other, +and use `--resync` when you need to switch. ### Renamed directories -Renaming a folder on the Path1 side results is deleting all files on +Renaming a folder on the Path1 side results in deleting all files on the Path2 side and then copying all files again from Path1 to Path2. Bisync sees this as all files in the old directory name as deleted and all -files in the new directory name as new. Similarly, renaming a directory on -both sides to the same name will result in creating `..path1` and `..path2` -files on both sides. -Currently the most effective and efficient method of renaming a directory -is to rename it on both sides, then do a `--resync`. +files in the new directory name as new. +Currently, the most effective and efficient method of renaming a directory +is to rename it to the same name on both sides. (As of `rclone v1.64`, +a `--resync` is no longer required after doing so, as bisync will automatically +detect that Path1 and Path2 are in agreement.) + +### `--fast-list` used by default + +Unlike most other rclone commands, bisync uses [`--fast-list`](/docs/#fast-list) by default, +for backends that support it. In many cases this is desirable, however, +there are some scenarios in which bisync could be faster *without* `--fast-list`, +and there is also a [known issue concerning Google Drive users with many empty directories](https://github.com/rclone/rclone/commit/cbf3d4356135814921382dd3285d859d15d0aa77). +For now, the recommended way to avoid using `--fast-list` is to add `--disable ListR` +to all bisync commands. The default behavior may change in a future version. + +### Overridden Configs + +When rclone detects an overridden config, it adds a suffix like `{ABCDE}` on the fly +to the internal name of the remote. Bisync follows suit by including this suffix in its listing filenames. +However, this suffix does not necessarily persist from run to run, especially if different flags are provided. +So if next time the suffix assigned is `{FGHIJ}`, bisync will get confused, +because it's looking for a listing file with `{FGHIJ}`, when the file it wants has `{ABCDE}`. +As a result, it throws +`Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run` +and refuses to run again until the user runs a `--resync` (unless using `--resilient`). +The best workaround at the moment is to set any backend-specific flags in the [config file](/commands/rclone_config/) +instead of specifying them with command flags. (You can still override them as needed for other rclone commands.) ### Case sensitivity Synching with **case-insensitive** filesystems, such as Windows or `Box`, can result in file name conflicts. This will be fixed in a future release. -The near term workaround is to make sure that files on both sides +The near-term workaround is to make sure that files on both sides don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). ## Windows support {#windows} @@ -492,7 +650,7 @@ below. - Excluding such dirs first will make rclone operations (much) faster. - Specific files may also be excluded, as with the Dropbox exclusions example below. -2. Decide if its easier (or cleaner) to: +2. Decide if it's easier (or cleaner) to: - Include select directories and therefore _exclude everything else_ -- or -- - Exclude select directories and therefore _include everything else_ 3. Include select directories: @@ -511,7 +669,7 @@ below. For example: `-/Desktop/tempfiles/`, or `- /testdir/`. Again, a `**` on the end is not necessary. - Do _not_ add a `- **` in the file. Without this line, everything - will be included that has not be explicitly excluded. + will be included that has not been explicitly excluded. - Disregard step 3. A few rules for the syntax of a filter file expanding on @@ -596,7 +754,7 @@ quashed by adding `--quiet` to the bisync command line. # NOTICE: If you make changes to this file you MUST do a --resync run. # Run with --dry-run to see what changes will be made. -# Dropbox wont sync some files so filter them away here. +# Dropbox won't sync some files so filter them away here. # See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing - .dropbox.attr - ~*.tmp @@ -655,7 +813,7 @@ The second has no deltas between local and remote. The `--dry-run` messages may indicate that it would try to delete some files. For example, if a file is new on Path2 and does not exist on Path1 then it would normally be copied to Path1, but with `--dry-run` enabled those -copies don't happen, which leads to the attempted delete on the Path2, +copies don't happen, which leads to the attempted delete on Path2, blocked again by --dry-run: `... Not deleting as --dry-run`. This whole confusing situation is an artifact of the `--dry-run` flag. @@ -664,14 +822,14 @@ copied to Path1 then the threatened deletes on Path2 may be disregarded. ### Retries -Rclone has built in retries. If you run with `--verbose` you'll see +Rclone has built-in retries. If you run with `--verbose` you'll see error and retry messages such as shown below. This is usually not a bug. -If at the end of the run you see `Bisync successful` and not +If at the end of the run, you see `Bisync successful` and not `Bisync critical error` or `Bisync aborted` then the run was successful, and you can ignore the error messages. The following run shows an intermittent fail. Lines _5_ and _6- are -low level messages. Line _6_ is a bubbled-up _warning_ message, conveying +low-level messages. Line _6_ is a bubbled-up _warning_ message, conveying the error. Rclone normally retries failing commands, so there may be numerous such messages in the log. @@ -751,7 +909,7 @@ and an OwnCloud server, with output logged to a runlog file: */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log ``` -See [crontab syntax](https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES)). +See [crontab syntax](https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES) for the details of crontab time interval expressions. If you run `rclone bisync` as a cron job, redirect stdout/stderr to a file. @@ -943,7 +1101,7 @@ test command flags can be equally prefixed by a single `-` or double dash. synched tree even if there are check file mismatches in the test tree. - Some Dropbox tests can fail, notably printing the following message: `src and dst identical but can't set mod time without deleting and re-uploading` - This is expected and happens due a way Dropbox handles modification times. + This is expected and happens due to the way Dropbox handles modification times. You should use the `-refresh-times` test flag to make up for this. - If Dropbox tests hit request limit for you and print error message `too_many_requests/...: Too many requests or write operations.` @@ -1008,7 +1166,7 @@ Your normal workflow might be as follows: Delete a single file. - `delete-glob ` Delete a group of files located one level deep in the given directory - with names maching a given glob pattern. + with names matching a given glob pattern. - `touch-glob YYYY-MM-DD ` Change modification time on a group of files. - `touch-copy YYYY-MM-DD ` @@ -1096,9 +1254,28 @@ with [@cjnaz](https://github.com/cjnaz)'s full support and encouragement. Bisync adopts the differential synchronization technique, which is based on keeping history of changes performed by both synchronizing sides. -See the _Dual Shadow Method_ section in the +See the _Dual Shadow Method_ section in [Neil Fraser's article](https://neil.fraser.name/writing/sync/). Also note a number of academic publications by [Benjamin Pierce](http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) about _Unison_ and synchronization in general. + +## Changelog + +### `v1.64` +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) +causing dry runs to inadvertently commit filter changes +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs) +causing `--resync` to erroneously delete empty folders and duplicate files unique to Path2 +* `--check-access` is now enforced during `--resync`, preventing data loss in [certain user error scenarios](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should) +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations) +causing bisync to consider more files than necessary due to overbroad filters during delete operations +* [Improved detection of false positive change conflicts](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides) +(identical files are now left alone instead of renamed) +* Added [support for `--create-empty-src-dirs`](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed) +* Added experimental `--resilient` mode to allow [recovery from self-correctable errors](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20Bisync%20should%20be%20more%20resilient%20to%20self%2Dcorrectable%20errors) +* Added [new `--ignore-listing-checksum` flag](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20%2D%2Dignore%2Dchecksum%20should%20be%20split%20into%20two%20flags%20for%20separate%20purposes) +to distinguish from `--ignore-checksum` +* [Performance improvements](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20Deletes%20take%20several%20times%20longer%20than%20copies) for large remotes +* Documentation and testing improvements \ No newline at end of file diff --git a/docs/content/box.md b/docs/content/box.md index 61634f8c9cbcc..9e35c5c4fb126 100644 --- a/docs/content/box.md +++ b/docs/content/box.md @@ -199,7 +199,7 @@ d) Delete this remote y/e/d> y ``` -### Modified time and hashes +### Modification times and hashes Box allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -438,6 +438,28 @@ Properties: - Type: string - Required: false +#### --box-impersonate + +Impersonate this user ID when using a service account. + +Setting this flag allows rclone, when using a JWT service account, to +act on behalf of another user by setting the as-user header. + +The user ID is the Box identifier for a user. User IDs can found for +any user via the GET /users endpoint, which is only available to +admins, or by calling the GET /users/me endpoint with an authenticated +user session. + +See: https://developer.box.com/guides/authentication/jwt/as-user/ + + +Properties: + +- Config: impersonate +- Env Var: RCLONE_BOX_IMPERSONATE +- Type: string +- Required: false + #### --box-encoding The encoding for the backend. @@ -448,7 +470,7 @@ Properties: - Config: encoding - Env Var: RCLONE_BOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot {{< rem autogenerated options stop >}} @@ -473,3 +495,27 @@ remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +## Get your own Box App ID + +Here is how to create your own Box App ID for rclone: + +1. Go to the [Box Developer Console](https://app.box.com/developers/console) +and login, then click `My Apps` on the sidebar. Click `Create New App` +and select `Custom App`. + +2. In the first screen on the box that pops up, you can pretty much enter +whatever you want. The `App Name` can be whatever. For `Purpose` choose +automation to avoid having to fill out anything else. Click `Next`. + +3. In the second screen of the creation screen, select +`User Authentication (OAuth 2.0)`. Then click `Create App`. + +4. You should now be on the `Configuration` tab of your new app. If not, +click on it at the top of the webpage. Copy down `Client ID` +and `Client Secret`, you'll need those for rclone. + +5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` + +6. For `Application Scopes`, select `Read all files and folders stored in Box` +and `Write all files and folders stored in box` (assuming you want to do both). +Leave others unchecked. Click `Save Changes` at the top right. diff --git a/docs/content/changelog.md b/docs/content/changelog.md index 7adb6066a2ba5..17387e5b0d1b3 100644 --- a/docs/content/changelog.md +++ b/docs/content/changelog.md @@ -5,6 +5,489 @@ description: "Rclone Changelog" # Changelog +## v1.65.0 - 2023-11-26 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.65.0) + +* New backends + * Azure Files (karan, moongdal, Nick Craig-Wood) + * ImageKit (Abhinav Dhiman) + * Linkbox (viktor, Nick Craig-Wood) +* New commands + * `serve s3`: Let rclone act as an S3 compatible server (Mikubill, Artur Neumann, Saw-jan, Nick Craig-Wood) + * `nfsmount`: mount command to provide mount mechanism on macOS without FUSE (Saleh Dindar) + * `serve nfs`: to serve a remote for use by `nfsmount` (Saleh Dindar) +* New Features + * install.sh: Clean up temp files in install script (Jacob Hands) + * build + * Update all dependencies (Nick Craig-Wood) + * Refactor version info and icon resource handling on windows (albertony) + * doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick Craig-Wood) + * Implement `--metadata-mapper` to transform metatadata with a user supplied program (Nick Craig-Wood) + * Add `ChunkWriterDoesntSeek` feature flag and set it for b2 (Nick Craig-Wood) + * lib/http: Export basic go string functions for use in `--template` (Gabriel Espinoza) + * makefile: Use POSIX compatible install arguments (Mina Galić) + * operations + * Use less memory when doing multithread uploads (Nick Craig-Wood) + * Implement `--partial-suffix` to control extension of temporary file names (Volodymyr) + * rc + * Add `operations/check` to the rc API (Nick Craig-Wood) + * Always report an error as JSON (Nick Craig-Wood) + * Set `Last-Modified` header for files served by `--rc-serve` (Nikita Shoshin) + * size: Dont show duplicate object count when less than 1k (albertony) +* Bug Fixes + * fshttp: Fix `--contimeout` being ignored (你知道未来吗) + * march: Fix excessive parallelism when using `--no-traverse` (Nick Craig-Wood) + * ncdu: Fix crash when re-entering changed directory after rescan (Nick Craig-Wood) + * operations + * Fix overwrite of destination when multi-thread transfer fails (Nick Craig-Wood) + * Fix invalid UTF-8 when truncating file names when not using `--inplace` (Nick Craig-Wood) + * serve dnla: Fix crash on graceful exit (wuxingzhong) +* Mount + * Disable mount for freebsd and alias cmount as mount on that platform (Nick Craig-Wood) +* VFS + * Add `--vfs-refresh` flag to read all the directories on start (Beyond Meat) + * Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh Dindar) + * Add go-billy dependency and make sure vfs.Handle implements billy.File (Saleh Dindar) + * Error out early if can't upload 0 length file (Nick Craig-Wood) +* Local + * Fix copying from Windows Volume Shadows (Nick Craig-Wood) +* Azure Blob + * Add support for cold tier (Ivan Yanitra) +* B2 + * Implement "rclone backend lifecycle" to read and set bucket lifecycles (Nick Craig-Wood) + * Implement `--b2-lifecycle` to control lifecycle when creating buckets (Nick Craig-Wood) + * Fix listing all buckets when not needed (Nick Craig-Wood) + * Fix multi-thread upload with copyto going to wrong name (Nick Craig-Wood) + * Fix server side chunked copy when file size was exactly `--b2-copy-cutoff` (Nick Craig-Wood) + * Fix streaming chunked files an exact multiple of chunk size (Nick Craig-Wood) +* Box + * Filter more EventIDs when polling (David Sze) + * Add more logging for polling (David Sze) + * Fix performance problem reading metadata for single files (Nick Craig-Wood) +* Drive + * Add read/write metadata support (Nick Craig-Wood) + * Add support for SHA-1 and SHA-256 checksums (rinsuki) + * Add `--drive-show-all-gdocs` to allow unexportable gdocs to be server side copied (Nick Craig-Wood) + * Add a note that `--drive-scope` accepts comma-separated list of scopes (Keigo Imai) + * Fix error updating created time metadata on existing object (Nick Craig-Wood) + * Fix integration tests by enabling metadata support from the context (Nick Craig-Wood) +* Dropbox + * Factor batcher into lib/batcher (Nick Craig-Wood) + * Fix missing encoding for rclone purge (Nick Craig-Wood) +* Google Cloud Storage + * Fix 400 Bad request errors when using multi-thread copy (Nick Craig-Wood) +* Googlephotos + * Implement batcher for uploads (Nick Craig-Wood) +* Hdfs + * Added support for list of namenodes in hdfs remote config (Tayo-pasedaRJ) +* HTTP + * Implement set backend command to update running backend (Nick Craig-Wood) + * Enable methods used with WebDAV (Alen Šiljak) +* Jottacloud + * Add support for reading and writing metadata (albertony) +* Onedrive + * Implement ListR method which gives `--fast-list` support (Nick Craig-Wood) + * This must be enabled with the `--onedrive-delta` flag +* Quatrix + * Add partial upload support (Oksana Zhykina) + * Overwrite files on conflict during server-side move (Oksana Zhykina) +* S3 + * Add Linode provider (Nick Craig-Wood) + * Add docs on how to add a new provider (Nick Craig-Wood) + * Fix no error being returned when creating a bucket we don't own (Nick Craig-Wood) + * Emit a debug message if anonymous credentials are in use (Nick Craig-Wood) + * Add `--s3-disable-multipart-uploads` flag (Nick Craig-Wood) + * Detect looping when using gcs and versions (Nick Craig-Wood) +* SFTP + * Implement `--sftp-copy-is-hardlink` to server side copy as hardlink (Nick Craig-Wood) +* Smb + * Fix incorrect `about` size by switching to `github.com/cloudsoda/go-smb2` fork (Nick Craig-Wood) + * Fix modtime of multithread uploads by setting PartialUploads (Nick Craig-Wood) +* WebDAV + * Added an rclone vendor to work with `rclone serve webdav` (Adithya Kumar) + +## v1.64.2 - 2023-10-19 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.1...v1.64.2) + +* Bug Fixes + * selfupdate: Fix "invalid hashsum signature" error (Nick Craig-Wood) + * build: Fix docker build running out of space (Nick Craig-Wood) + +## v1.64.1 - 2023-10-17 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.64.1) + +* Bug Fixes + * cmd: Make `--progress` output logs in the same format as without (Nick Craig-Wood) + * docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj Ghosh, Nick Craig-Wood) + * lsjson: Make sure we set the global metadata flag too (Nick Craig-Wood) + * operations + * Ensure concurrency is no greater than the number of chunks (Pat Patterson) + * Fix OpenOptions ignored in copy if operation was a multiThreadCopy (Vitor Gomes) + * Fix error message on delete to have file name (Nick Craig-Wood) + * serve sftp: Return not supported error for not supported commands (Nick Craig-Wood) + * build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid reset (Nick Craig-Wood) + * pacer: Fix b2 deadlock by defaulting max connections to unlimited (Nick Craig-Wood) +* Mount + * Fix automount not detecting drive is ready (Nick Craig-Wood) +* VFS + * Fix update dir modification time (Saleh Dindar) +* Azure Blob + * Fix "fatal error: concurrent map writes" (Nick Craig-Wood) +* B2 + * Fix multipart upload: corrupted on transfer: sizes differ XXX vs 0 (Nick Craig-Wood) + * Fix locking window when getting mutipart upload URL (Nick Craig-Wood) + * Fix server side copies greater than 4GB (Nick Craig-Wood) + * Fix chunked streaming uploads (Nick Craig-Wood) + * Reduce default `--b2-upload-concurrency` to 4 to reduce memory usage (Nick Craig-Wood) +* Onedrive + * Fix the configurator to allow `/teams/ID` in the config (Nick Craig-Wood) +* Oracleobjectstorage + * Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Nick Craig-Wood) +* S3 + * Fix slice bounds out of range error when listing (Nick Craig-Wood) + * Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Vitor Gomes) +* Storj + * Update storj.io/uplink to v1.12.0 (Kaloyan Raev) + +## v1.64.0 - 2023-09-11 + +[See commits](https://github.com/rclone/rclone/compare/v1.63.0...v1.64.0) + +* New backends + * [Proton Drive](/protondrive/) (Chun-Hung Tseng) + * [Quatrix](/quatrix/) (Oksana, Volodymyr Kit) + * New S3 providers + * [Synology C2](/s3/#synology-c2) (BakaWang) + * [Leviia](/s3/#leviia) (Benjamin) + * New Jottacloud providers + * [Onlime](/jottacloud/) (Fjodor42) + * [Telia Sky](/jottacloud/) (NoLooseEnds) +* Major changes + * Multi-thread transfers (Vitor Gomes, Nick Craig-Wood, Manoj Ghosh, Edwin Mackenzie-Owen) + * Multi-thread transfers are now available when transferring to: + * `local`, `s3`, `azureblob`, `b2`, `oracleobjectstorage` and `smb` + * This greatly improves transfer speed between two network sources. + * In memory buffering has been unified between all backends and should share memory better. + * See [--multi-thread docs](/docs/#multi-thread-cutoff) for more info +* New commands + * `rclone config redacted` support mechanism for showing redacted config (Nick Craig-Wood) +* New Features + * accounting + * Show server side stats in own lines and not as bytes transferred (Nick Craig-Wood) + * bisync + * Add new `--ignore-listing-checksum` flag to distinguish from `--ignore-checksum` (nielash) + * Add experimental `--resilient` mode to allow recovery from self-correctable errors (nielash) + * Add support for `--create-empty-src-dirs` (nielash) + * Dry runs no longer commit filter changes (nielash) + * Enforce `--check-access` during `--resync` (nielash) + * Apply filters correctly during deletes (nielash) + * Equality check before renaming (leave identical files alone) (nielash) + * Fix `dryRun` rc parameter being ignored (nielash) + * build + * Update to `go1.21` and make `go1.19` the minimum required version (Anagh Kumar Baranwal, Nick Craig-Wood) + * Update dependencies (Nick Craig-Wood) + * Add snap installation (hideo aoyama) + * Change Winget Releaser job to `ubuntu-latest` (sitiom) + * cmd: Refactor and use sysdnotify in more commands (eNV25) + * config: Add `--multi-thread-chunk-size` flag (Vitor Gomes) + * doc updates (antoinetran, Benjamin, Bjørn Smith, Dean Attali, gabriel-suela, James Braza, Justin Hellings, kapitainsky, Mahad, Masamune3210, Nick Craig-Wood, Nihaal Sangha, Niklas Hambüchen, Raymond Berger, r-ricci, Sawada Tsunayoshi, Tiago Boeing, Vladislav Vorobev) + * fs + * Use atomic types everywhere (Roberto Ricci) + * When `--max-transfer` limit is reached exit with code (10) (kapitainsky) + * Add rclone completion powershell - basic implementation only (Nick Craig-Wood) + * http servers: Allow CORS to be set with `--allow-origin` flag (yuudi) + * lib/rest: Remove unnecessary `nil` check (Eng Zer Jun) + * ncdu: Add keybinding to rescan filesystem (eNV25) + * rc + * Add `executeId` to job listings (yuudi) + * Add `core/du` to measure local disk usage (Nick Craig-Wood) + * Add `operations/settier` to API (Drew Stinnett) + * rclone test info: Add `--check-base32768` flag to check can store all base32768 characters (Nick Craig-Wood) + * rmdirs: Remove directories concurrently controlled by `--checkers` (Nick Craig-Wood) +* Bug Fixes + * accounting: Don't stop calculating average transfer speed until the operation is complete (Jacob Hands) + * fs: Fix `transferTime` not being set in JSON logs (Jacob Hands) + * fshttp: Fix `--bind 0.0.0.0` allowing IPv6 and `--bind ::0` allowing IPv4 (Nick Craig-Wood) + * operations: Fix overlapping check on case insensitive file systems (Nick Craig-Wood) + * serve dlna: Fix MIME type if backend can't identify it (Nick Craig-Wood) + * serve ftp: Fix race condition when using the auth proxy (Nick Craig-Wood) + * serve sftp: Fix hash calculations with `--vfs-cache-mode full` (Nick Craig-Wood) + * serve webdav: Fix error: Expecting fs.Object or fs.Directory, got `nil` (Nick Craig-Wood) + * sync: Fix lockup with `--cutoff-mode=soft` and `--max-duration` (Nick Craig-Wood) +* Mount + * fix: Mount parsing for linux (Anagh Kumar Baranwal) +* VFS + * Add `--vfs-cache-min-free-space` to control minimum free space on the disk containing the cache (Nick Craig-Wood) + * Added cache cleaner for directories to reduce memory usage (Anagh Kumar Baranwal) + * Update parent directory modtimes on vfs actions (David Pedersen) + * Keep virtual directory status accurate and reduce deadlock potential (Anagh Kumar Baranwal) + * Make sure struct field is aligned for atomic access (Roberto Ricci) +* Local + * Rmdir return an error if the path is not a dir (zjx20) +* Azure Blob + * Implement `OpenChunkWriter` and multi-thread uploads (Nick Craig-Wood) + * Fix creation of directory markers (Nick Craig-Wood) + * Fix purging with directory markers (Nick Craig-Wood) +* B2 + * Implement `OpenChunkWriter` and multi-thread uploads (Nick Craig-Wood) + * Fix rclone link when object path contains special characters (Alishan Ladhani) +* Box + * Add polling support (David Sze) + * Add `--box-impersonate` to impersonate a user ID (Nick Craig-Wood) + * Fix unhelpful decoding of error messages into decimal numbers (Nick Craig-Wood) +* Chunker + * Update documentation to mention issue with small files (Ricardo D'O. Albanus) +* Compress + * Fix ChangeNotify (Nick Craig-Wood) +* Drive + * Add `--drive-fast-list-bug-fix` to control ListR bug workaround (Nick Craig-Wood) +* Fichier + * Implement `DirMove` (Nick Craig-Wood) + * Fix error code parsing (alexia) +* FTP + * Add socks_proxy support for SOCKS5 proxies (Zach) + * Fix 425 "TLS session of data connection not resumed" errors (Nick Craig-Wood) +* Hdfs + * Retry "replication in progress" errors when uploading (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) +* HTTP + * CORS should not be sent if not set (yuudi) + * Fix webdav OPTIONS response (yuudi) +* Opendrive + * Fix List on a just deleted and remade directory (Nick Craig-Wood) +* Oracleobjectstorage + * Use rclone's rate limiter in multipart transfers (Manoj Ghosh) + * Implement `OpenChunkWriter` and multi-thread uploads (Manoj Ghosh) +* S3 + * Refactor multipart upload to use `OpenChunkWriter` and `ChunkWriter` (Vitor Gomes) + * Factor generic multipart upload into `lib/multipart` (Nick Craig-Wood) + * Fix purging of root directory with `--s3-directory-markers` (Nick Craig-Wood) + * Add `rclone backend set` command to update the running config (Nick Craig-Wood) + * Add `rclone backend restore-status` command (Nick Craig-Wood) +* SFTP + * Stop uploads re-using the same ssh connection to improve performance (Nick Craig-Wood) + * Add `--sftp-ssh` to specify an external ssh binary to use (Nick Craig-Wood) + * Add socks_proxy support for SOCKS5 proxies (Zach) + * Support dynamic `--sftp-path-override` (nielash) + * Fix spurious warning when using `--sftp-ssh` (Nick Craig-Wood) +* Smb + * Implement multi-threaded writes for copies to smb (Edwin Mackenzie-Owen) +* Storj + * Performance improvement for large file uploads (Kaloyan Raev) +* Swift + * Fix HEADing 0-length objects when `--swift-no-large-objects` set (Julian Lepinski) +* Union + * Add `:writback` to act as a simple cache (Nick Craig-Wood) +* WebDAV + * Nextcloud: fix segment violation in low-level retry (Paul) +* Zoho + * Remove Range requests workarounds to fix integration tests (Nick Craig-Wood) + +## v1.63.1 - 2023-07-17 + +[See commits](https://github.com/rclone/rclone/compare/v1.63.0...v1.63.1) + +* Bug Fixes + * build: Fix macos builds for versions < 12 (Anagh Kumar Baranwal) + * dirtree: Fix performance with large directories of directories and `--fast-list` (Nick Craig-Wood) + * operations + * Fix deadlock when using `lsd`/`ls` with `--progress` (Nick Craig-Wood) + * Fix `.rclonelink` files not being converted back to symlinks (Nick Craig-Wood) + * doc fixes (Dean Attali, Mahad, Nick Craig-Wood, Sawada Tsunayoshi, Vladislav Vorobev) +* Local + * Fix partial directory read for corrupted filesystem (Nick Craig-Wood) +* Box + * Fix reconnect failing with HTTP 400 Bad Request (albertony) +* Smb + * Fix "Statfs failed: bucket or container name is needed" when mounting (Nick Craig-Wood) +* WebDAV + * Nextcloud: fix must use /dav/files/USER endpoint not /webdav error (Paul) + * Nextcloud chunking: add more guidance for the user to check the config (darix) + +## v1.63.0 - 2023-06-30 + +[See commits](https://github.com/rclone/rclone/compare/v1.62.0...v1.63.0) + +* New backends + * [Pikpak](/pikpak/) (wiserain) + * New S3 providers + * [petabox.io](/s3/#petabox) (Andrei Smirnov) + * [Google Cloud Storage](/s3/#google-cloud-storage) (Anthony Pessy) + * New WebDAV providers + * [Fastmail](/webdav/#fastmail-files) (Arnavion) +* Major changes + * Files will be copied to a temporary name ending in `.partial` when copying to `local`,`ftp`,`sftp` then renamed at the end of the transfer. (Janne Hellsten, Nick Craig-Wood) + * This helps with data integrity as we don't delete the existing file until the new one is complete. + * It can be disabled with the [--inplace](/docs/#inplace) flag. + * This behaviour will also happen if the backend is wrapped, for example `sftp` wrapped with `crypt`. + * The [s3](/s3/#s3-directory-markers), [azureblob](/azureblob/#azureblob-directory-markers) and [gcs](/googlecloudstorage/#gcs-directory-markers) backends now support directory markers so empty directories are supported (Jānis Bebrītis, Nick Craig-Wood) + * The [--default-time](/docs/#default-time-time) flag now controls the unknown modification time of files/dirs (Nick Craig-Wood) + * If a file or directory does not have a modification time rclone can read then rclone will display this fixed time instead. + * For the old behaviour use `--default-time 0s` which will set this time to the time rclone started up. +* New Features + * build + * Modernise linters in use and fixup all affected code (albertony) + * Push docker beta to GHCR (GitHub container registry) (Richard Tweed) + * cat: Add `--separator` option to cat command (Loren Gordon) + * config + * Do not remove/overwrite other files during config file save (albertony) + * Do not overwrite config file symbolic link (albertony) + * Stop `config create` making invalid config files (Nick Craig-Wood) + * doc updates (Adam K, Aditya Basu, albertony, asdffdsazqqq, Damo, danielkrajnik, Dimitri Papadopoulos, dlitster, Drew Parsons, jumbi77, kapitainsky, mac-15, Mariusz Suchodolski, Nick Craig-Wood, NickIAm, Rintze Zelle, Stanislav Gromov, Tareq Sharafy, URenko, yuudi, Zach Kipp) + * fs + * Add `size` to JSON logs when moving or copying an object (Nick Craig-Wood) + * Allow boolean features to be enabled with `--disable !Feature` (Nick Craig-Wood) + * genautocomplete: Rename to `completion` with alias to the old name (Nick Craig-Wood) + * librclone: Added example on using `librclone` with Go (alankrit) + * lsjson: Make `--stat` more efficient (Nick Craig-Wood) + * operations + * Implement `--multi-thread-write-buffer-size` for speed improvements on downloads (Paulo Schreiner) + * Reopen downloads on error when using `check --download` and `cat` (Nick Craig-Wood) + * rc: `config/listremotes` includes remotes defined with environment variables (kapitainsky) + * selfupdate: Obey `--no-check-certificate` flag (Nick Craig-Wood) + * serve restic: Trigger systemd notify (Shyim) + * serve webdav: Implement owncloud checksum and modtime extensions (WeidiDeng) + * sync: `--suffix-keep-extension` preserve 2 part extensions like .tar.gz (Nick Craig-Wood) +* Bug Fixes + * accounting + * Fix Prometheus metrics to be the same as `core/stats` (Nick Craig-Wood) + * Bwlimit signal handler should always start (Sam Lai) + * bisync: Fix `maxDelete` parameter being ignored via the rc (Nick Craig-Wood) + * cmd/ncdu: Fix screen corruption when logging (eNV25) + * filter: Fix deadlock with errors on `--files-from` (douchen) + * fs + * Fix interaction between `--progress` and `--interactive` (Nick Craig-Wood) + * Fix infinite recursive call in pacer ModifyCalculator (fixes issue reported by the staticcheck linter) (albertony) + * lib/atexit: Ensure OnError only calls cancel function once (Nick Craig-Wood) + * lib/rest: Fix problems re-using HTTP connections (Nick Craig-Wood) + * rc + * Fix `operations/stat` with trailing `/` (Nick Craig-Wood) + * Fix missing `--rc` flags (Nick Craig-Wood) + * Fix output of Time values in `options/get` (Nick Craig-Wood) + * serve dlna: Fix potential data race (Nick Craig-Wood) + * version: Fix reported os/kernel version for windows (albertony) +* Mount + * Add `--mount-case-insensitive` to force the mount to be case insensitive (Nick Craig-Wood) + * Removed unnecessary byte slice allocation for reads (Anagh Kumar Baranwal) + * Clarify rclone mount error when installed via homebrew (Nick Craig-Wood) + * Added _netdev to the example mount so it gets treated as a remote-fs rather than local-fs (Anagh Kumar Baranwal) +* Mount2 + * Updated go-fuse version (Anagh Kumar Baranwal) + * Fixed statfs (Anagh Kumar Baranwal) + * Disable xattrs (Anagh Kumar Baranwal) +* VFS + * Add MkdirAll function to make a directory and all beneath (Nick Craig-Wood) + * Fix reload: failed to add virtual dir entry: file does not exist (Nick Craig-Wood) + * Fix writing to a read only directory creating spurious directory entries (WeidiDeng) + * Fix potential data race (Nick Craig-Wood) + * Fix backends being Shutdown too early when startup takes a long time (Nick Craig-Wood) +* Local + * Fix filtering of symlinks with `-l`/`--links` flag (Nick Craig-Wood) + * Fix /path/to/file.rclonelink when `-l`/`--links` is in use (Nick Craig-Wood) + * Fix crash with `--metadata` on Android (Nick Craig-Wood) +* Cache + * Fix backends shutting down when in use when used via the rc (Nick Craig-Wood) +* Crypt + * Add `--crypt-suffix` option to set a custom suffix for encrypted files (jladbrook) + * Add `--crypt-pass-bad-blocks` to allow corrupted file output (Nick Craig-Wood) + * Fix reading 0 length files (Nick Craig-Wood) + * Try not to return "unexpected EOF" error (Nick Craig-Wood) + * Reduce allocations (albertony) + * Recommend Dropbox for `base32768` encoding (Nick Craig-Wood) +* Azure Blob + * Empty directory markers (Nick Craig-Wood) + * Support azure workload identities (Tareq Sharafy) + * Fix azure blob uploads with multiple bits of metadata (Nick Craig-Wood) + * Fix azurite compatibility by sending nil tier if set to empty string (Roel Arents) +* Combine + * Implement missing methods (Nick Craig-Wood) + * Fix goroutine stack overflow on bad object (Nick Craig-Wood) +* Drive + * Add `--drive-env-auth` to get IAM credentials from runtime (Peter Brunner) + * Update drive service account guide (Juang, Yi-Lin) + * Fix change notify picking up files outside the root (Nick Craig-Wood) + * Fix trailing slash mis-identificaton of folder as file (Nick Craig-Wood) + * Fix incorrect remote after Update on object (Nick Craig-Wood) +* Dropbox + * Implement `--dropbox-pacer-min-sleep` flag (Nick Craig-Wood) + * Fix the dropbox batcher stalling (Misty) +* Fichier + * Add `--ficicher-cdn` option to use the CDN for download (Nick Craig-Wood) +* FTP + * Lower log message priority when `SetModTime` is not supported to debug (Tobias Gion) + * Fix "unsupported LIST line" errors on startup (Nick Craig-Wood) + * Fix "501 Not a valid pathname." errors when creating directories (Nick Craig-Wood) +* Google Cloud Storage + * Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) + * Added `--gcs-user-project` needed for requester pays (Christopher Merry) +* HTTP + * Add client certificate user auth middleware. This can auth `serve restic` from the username in the client cert. (Peter Fern) +* Jottacloud + * Fix vfs writeback stuck in a failed upload loop with file versioning disabled (albertony) +* Onedrive + * Add `--onedrive-av-override` flag to download files flagged as virus (Nick Craig-Wood) + * Fix quickxorhash on 32 bit architectures (Nick Craig-Wood) + * Report any list errors during `rclone cleanup` (albertony) +* Putio + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) + * Fix modification times not being preserved for server side copy and move (Nick Craig-Wood) + * Fix server side copy failures (400 errors) (Nick Craig-Wood) +* S3 + * Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) + * Update Scaleway storage classes (Brian Starkey) + * Fix `--s3-versions` on individual objects (Nick Craig-Wood) + * Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood) + * Fix missing "tier" metadata (Nick Craig-Wood) + * Fix V3sign: add missing subresource delete (cc) + * Fix Arvancloud Domain and region changes and alphabetise the provider (Ehsan Tadayon) + * Fix Qiniu KODO quirks virtualHostStyle is false (zzq) +* SFTP + * Add `--sftp-host-key-algorithms ` to allow specifying SSH host key algorithms (Joel) + * Fix using `--sftp-key-use-agent` and `--sftp-key-file` together needing private key file (Arnav Singh) + * Fix move to allow overwriting existing files (Nick Craig-Wood) + * Don't stat directories before listing them (Nick Craig-Wood) + * Don't check remote points to a file if it ends with / (Nick Craig-Wood) +* Sharefile + * Disable streamed transfers as they no longer work (Nick Craig-Wood) +* Smb + * Code cleanup to avoid overwriting ctx before first use (fixes issue reported by the staticcheck linter) (albertony) +* Storj + * Fix "uplink: too many requests" errors when uploading to the same file (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) +* Swift + * Ignore 404 error when deleting an object (Nick Craig-Wood) +* Union + * Implement missing methods (Nick Craig-Wood) + * Allow errors to be unwrapped for inspection (Nick Craig-Wood) +* Uptobox + * Add `--uptobox-private` flag to make all uploaded files private (Nick Craig-Wood) + * Fix improper regex (Aaron Gokaslan) + * Fix Update returning the wrong object (Nick Craig-Wood) + * Fix rmdir declaring that directories weren't empty (Nick Craig-Wood) +* WebDAV + * nextcloud: Add support for chunked uploads (Paul) + * Set modtime using propset for owncloud and nextcloud (WeidiDeng) + * Make pacer minSleep configurable with `--webdav-pacer-min-sleep` (ed) + * Fix server side copy/move not overwriting (WeidiDeng) + * Fix modtime on server side copy for owncloud and nextcloud (Nick Craig-Wood) +* Yandex + * Fix 400 Bad Request on transfer failure (Nick Craig-Wood) +* Zoho + * Fix downloads with `Range:` header returning the wrong data (Nick Craig-Wood) + +## v1.62.2 - 2023-03-16 + +[See commits](https://github.com/rclone/rclone/compare/v1.62.1...v1.62.2) + +* Bug Fixes + * docker volume plugin: Add missing fuse3 dependency (Nick Craig-Wood) + * docs: Fix size documentation (asdffdsazqqq) +* FTP + * Fix 426 errors on downloads with vsftpd (Lesmiscore) + ## v1.62.1 - 2023-03-15 [See commits](https://github.com/rclone/rclone/compare/v1.62.0...v1.62.1) @@ -2010,8 +2493,8 @@ all the docs and Edward Barker for helping re-write the front page. * Use proper import path go.etcd.io/bbolt (Robert-André Mauchin) * Crypt * Calculate hashes for uploads from local disk (Nick Craig-Wood) - * This allows crypted Jottacloud uploads without using local disk - * This means crypted s3/b2 uploads will now have hashes + * This allows encrypted Jottacloud uploads without using local disk + * This means encrypted s3/b2 uploads will now have hashes * Added `rclone backend decode`/`encode` commands to replicate functionality of `cryptdecode` (Anagh Kumar Baranwal) * Get rid of the unused Cipher interface as it obfuscated the code (Nick Craig-Wood) * Azure Blob @@ -3221,7 +3704,7 @@ Point release to fix hubic and azureblob backends. * Fix panic when running without plex configs (Remus Bunduc) * Fix root folder caching (Remus Bunduc) * Crypt - * Check the crypted hash of files when uploading for extra data security + * Check the encrypted hash of files when uploading for extra data security * Dropbox * Make Dropbox for business folders accessible using an initial `/` in the path * Google Cloud Storage @@ -3576,7 +4059,7 @@ Point release to fix hubic and azureblob backends. * New commands * `rcat` - read from standard input and stream upload * `tree` - shows a nicely formatted recursive listing - * `cryptdecode` - decode crypted file names (thanks ishuah) + * `cryptdecode` - decode encrypted file names (thanks ishuah) * `config show` - print the config file * `config file` - print the config file location * New Features @@ -3602,7 +4085,7 @@ Point release to fix hubic and azureblob backends. * Revert to copy when moving file across file system boundaries * `--skip-links` to suppress symlink warnings (thanks Zhiming Wang) * Mount - * Re-use `rcat` internals to support uploads from all remotes + * Reuse `rcat` internals to support uploads from all remotes * Dropbox * Fix "entry doesn't belong in directory" error * Stop using deprecated API methods @@ -3880,7 +4363,7 @@ Point release to fix hubic and azureblob backends. * Fix `rclone move` command * Delete src files which already existed in dst * Fix deletion of src file when dst file older - * Fix `rclone check` on crypted file systems + * Fix `rclone check` on encrypted file systems * Make failed uploads not count as "Transferred" * Make sure high level retries show with `-q` * Use a vendor directory with godep for repeatable builds diff --git a/docs/content/chunker.md b/docs/content/chunker.md index f9287c89ca2ff..e7011dc08abed 100644 --- a/docs/content/chunker.md +++ b/docs/content/chunker.md @@ -97,7 +97,7 @@ will put files in a directory called `name` in the current directory. When rclone starts a file upload, chunker checks the file size. If it doesn't exceed the configured chunk size, chunker will just pass the file -to the wrapped remote. If a file is large, chunker will transparently cut +to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut data in pieces with temporary names and stream them one by one, on the fly. Each data chunk will contain the specified number of bytes, except for the last one which may have less data. If file size is unknown in advance @@ -129,6 +129,14 @@ proceed with current command. You can set the `--chunker-fail-hard` flag to have commands abort with error message in such cases. +**Caveat**: As it is now, chunker will always create a temporary file in the +backend and then rename it, even if the file is below the chunk threshold. +This will result in unnecessary API calls and can severely restrict throughput +when handling transfers primarily composed of small files on some backends (e.g. Box). +A workaround to this issue is to use chunker only for files above the chunk threshold +via `--min-size` and then perform a separate call without chunker on the remaining +files. + #### Chunk names @@ -218,7 +226,7 @@ guarantee given hash for all files. If wrapped remote doesn't support it, chunker will then add metadata to all files, even small. However, this can double the amount of small files in storage and incur additional service charges. You can even use chunker to force md5/sha1 support in any other remote -at expense of sidecar meta objects by setting e.g. `chunk_type=sha1all` +at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` to force hashsums and `chunk_size=1P` to effectively disable chunking. Normally, when a file is copied to chunker controlled remote, chunker @@ -236,7 +244,7 @@ revert (sometimes silently) to time/size comparison if compatible hashsums between source and target are not found. -### Modified time +### Modification times Chunker stores modification times using the wrapped remote so support depends on that. For a small non-chunked file the chunker overlay simply diff --git a/docs/content/commands/rclone.md b/docs/content/commands/rclone.md index f256d6f4f4891..e1489389dd01b 100644 --- a/docs/content/commands/rclone.md +++ b/docs/content/commands/rclone.md @@ -5,11 +5,11 @@ slug: rclone url: /commands/rclone/ # autogenerated - DO NOT EDIT, instead edit the source code in cmd/ and as part of making a release run "make commanddocs" --- -# rclone +## rclone Show help for rclone commands, flags and backends. -## Synopsis +### Synopsis Rclone syncs files to and from cloud storage providers as well as @@ -24,15 +24,843 @@ documentation, changelog and configuration walkthroughs. rclone [flags] ``` -## Options +### Options ``` - -h, --help help for rclone + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal's client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don't store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don't attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user's password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as 'true' + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --backup-dir string Make backups into hierarchy based in DIR + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default "user") + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --check-first Do all the checks before starting transfers + --checkers int Number of checkers to run in parallel (default 8) + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default "md5") + --chunker-remote string Remote to chunk/unchunk + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --combine-upstreams SpaceSepList Upstreams for combining + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default "gzip") + --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + --config string Config file (default "$HOME/.config/rclone/rclone.conf") + --contimeout Duration Connect timeout (default 1m0s) + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + -L, --copy-links Follow symlinks and copy the pointed to item + --cpuprofile string Write cpu profile to file + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") + --crypt-filename-encryption string How to encrypt the filenames (default "standard") + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --delete-excluded Delete files on dest excluded from sync + --disable string Disable a comma separated list of features (use --disable help to see a list) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + -n, --dry-run Do a trial run with no permanent changes + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --fast-list Use recursive list if available; uses more memory but fewer transactions + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default "$USER") + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) + --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports + --hdfs-service-principal-name string Kerberos service principal name for the namenode + --hdfs-username string Hadoop user name + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + -h, --help help for rclone + --hidrive-auth-url string Auth server URL + --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) + --hidrive-client-id string OAuth Client Id + --hidrive-client-secret string OAuth Client Secret + --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) + --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") + --hidrive-root-prefix string The root/parent folder for all paths (default "/") + --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") + --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") + --hidrive-token string OAuth Access Token as a JSON blob + --hidrive-token-url string Token server url + --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) + --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) + --http-headers CommaSepList Set HTTP headers for all transactions + --http-no-head Don't use HEAD requests + --http-no-slash Set this if the site doesn't end directories with / + --http-url string URL of HTTP host to connect to + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + --ignore-case Ignore case in filters (case insensitive) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-errors Delete even if there are I/O errors + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings + --immutable Do not modify files, fail if existing files have been modified + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --inplace Download directly to destination file instead of atomic download to temp/rename + -i, --interactive Enable interactive mode + --internetarchive-access-key-id string IAS3 Access Key + --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") + --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") + --internetarchive-secret-access-key string IAS3 Secret Key (password) + --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) + --jottacloud-auth-url string Auth server URL + --jottacloud-client-id string OAuth Client Id + --jottacloud-client-secret string OAuth Client Secret + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-hard-delete Delete files permanently rather than putting them into the trash + --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) + --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them + --jottacloud-token string OAuth Access Token as a JSON blob + --jottacloud-token-url string Token server url + --jottacloud-trashed-only Only show files that are in the trash + --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-endpoint string The Koofr API endpoint to use + --koofr-mountid string Mount ID of the mount to use + --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) + --koofr-provider string Choose your storage provider + --koofr-setmtime Does the backend support setting modification time (default true) + --koofr-user string Your user name + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --linkbox-token string Token from https://www.linkbox.to/admin/account + -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension + --local-case-insensitive Force the filesystem to report itself as case insensitive + --local-case-sensitive Force the filesystem to report itself as case sensitive + --local-encoding Encoding The encoding for the backend (default Slash,Dot) + --local-no-check-updated Don't check to see if the files change during upload + --local-no-preallocate Disable preallocation of disk space for transferred files + --local-no-set-modtime Disable setting modtime + --local-no-sparse Disable sparse files for multi-thread downloads + --local-nounc Disable UNC (long path names) conversion on Windows + --local-unicode-normalization Apply unicode NFC normalization to paths and filenames + --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default "date,time") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --low-level-retries int Number of low level retries to do (default 10) + --mailru-auth-url string Auth server URL + --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) + --mailru-client-id string OAuth Client Id + --mailru-client-secret string OAuth Client Secret + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-pass string Password (obscured) + --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) + --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") + --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) + --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) + --mailru-token string OAuth Access Token as a JSON blob + --mailru-token-url string Token server url + --mailru-user string User name (usually email) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + --mega-debug Output more debug from Mega + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-hard-delete Delete files permanently rather than putting them into the trash + --mega-pass string Password (obscured) + --mega-use-https Use HTTPS for transfers + --mega-user string User name + --memprofile string Write memory profile to file + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --netstorage-account string Set the NetStorage account name + --netstorage-host string Domain+path of NetStorage host to connect to + --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") + --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-check-dest Don't check the destination, copy regardless + --no-console Hide console window (supported on Windows only) + --no-gzip-encoding Don't set Accept-Encoding: gzip + --no-traverse Don't traverse destination file system on copy + --no-unicode-normalization Don't normalize unicode characters in filenames + --no-update-modtime Don't update destination modtime if files identical + -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) + --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) + --onedrive-auth-url string Auth server URL + --onedrive-av-override Allows download of files the server thinks has a virus + --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) + --onedrive-client-id string OAuth Client Id + --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings + --onedrive-drive-id string The ID of the drive to use + --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings + --onedrive-hash-type string Specify the hash in use for the backend (default "auto") + --onedrive-link-password string Set the password for links created by the link command + --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") + --onedrive-link-type string Set the type of the links created by the link command (default "view") + --onedrive-list-chunk int Size of listing chunk (default 1000) + --onedrive-no-versions Remove all versions on modifying operations + --onedrive-region string Choose national cloud region for OneDrive (default "global") + --onedrive-root-folder-id string ID of the root folder + --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --onedrive-token string OAuth Access Token as a JSON blob + --onedrive-token-url string Token server url + --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object + --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --oos-compartment string Object storage compartment OCID + --oos-config-file string Path to OCI config file (default "~/.oci/config") + --oos-config-profile string Profile name inside the oci config file (default "Default") + --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --oos-copy-timeout Duration Timeout for copy (default 1m0s) + --oos-disable-checksum Don't store MD5 checksum with object metadata + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-endpoint string Endpoint for Object storage API + --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery + --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --oos-namespace string Object storage namespace + --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it + --oos-provider string Choose your Auth Provider (default "env_auth") + --oos-region string Object storage Region + --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm + --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the + --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") + --oos-upload-concurrency int Concurrency for multipart uploads (default 10) + --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-password string Password (obscured) + --opendrive-username string Username + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --password-command SpaceSepList Command for supplying password for encrypted configuration + --pcloud-auth-url string Auth server URL + --pcloud-client-id string OAuth Client Id + --pcloud-client-secret string OAuth Client Secret + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") + --pcloud-password string Your pcloud password (obscured) + --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") + --pcloud-token string OAuth Access Token as a JSON blob + --pcloud-token-url string Token server url + --pcloud-username string Your pcloud username + --pikpak-auth-url string Auth server URL + --pikpak-client-id string OAuth Client Id + --pikpak-client-secret string OAuth Client Secret + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) + --pikpak-pass string Pikpak password (obscured) + --pikpak-root-folder-id string ID of the root folder + --pikpak-token string OAuth Access Token as a JSON blob + --pikpak-token-url string Token server url + --pikpak-trashed-only Only show files that are in the trash + --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) + --pikpak-user string Pikpak username + --premiumizeme-auth-url string Auth server URL + --premiumizeme-client-id string OAuth Client Id + --premiumizeme-client-secret string OAuth Client Secret + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-token string OAuth Access Token as a JSON blob + --premiumizeme-token-url string Token server url + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + --protondrive-2fa string The 2FA code + --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") + --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) + --protondrive-original-file-size Return the file size before encryption (default true) + --protondrive-password string The password of your proton account (obscured) + --protondrive-replace-existing-draft Create a new revision when filename conflict is detected + --protondrive-username string The username of your proton account + --putio-auth-url string Auth server URL + --putio-client-id string OAuth Client Id + --putio-client-secret string OAuth Client Secret + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-token string OAuth Access Token as a JSON blob + --putio-token-url string Token server url + --qingstor-access-key-id string QingStor Access Key ID + --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) + --qingstor-connection-retries int Number of connection retries (default 3) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-endpoint string Enter an endpoint URL to connection QingStor API + --qingstor-env-auth Get QingStor credentials from runtime + --qingstor-secret-access-key string QingStor Secret Access Key (password) + --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) + --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --qingstor-zone string Zone to connect to + --quatrix-api-key string API key for accessing Quatrix account + --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-hard-delete Delete files permanently rather than putting them into the trash + --quatrix-host string Host name of Quatrix account + --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) + --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) + -q, --quiet Print as little stuff as possible + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui + --refresh-times Refresh the modtime of remote files + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --s3-access-key-id string AWS Access Key ID + --s3-acl string Canned ACL used when creating buckets and storing or copying objects + --s3-bucket-acl string Canned ACL used when creating buckets + --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --s3-decompress If set this will decompress gzip encoded objects + --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created + --s3-disable-checksum Don't store MD5 checksum with object metadata + --s3-disable-http2 Disable usage of http2 for S3 backends + --s3-download-url string Custom endpoint for downloads + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-endpoint string Endpoint for S3 API + --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) + --s3-force-path-style If true use path style access if false use virtual hosted style (default true) + --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery + --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) + --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) + --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto + --s3-location-constraint string Location constraint - must be set to match the Region + --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) + --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it + --s3-no-head If set, don't HEAD uploaded objects to check integrity + --s3-no-head-object If set, do not do HEAD before GET when getting objects + --s3-no-system-metadata Suppress setting and reading of system metadata + --s3-profile string Profile to use in the shared credentials file + --s3-provider string Choose your S3 provider + --s3-region string Region to connect to + --s3-requester-pays Enables requester pays option when interacting with S3 bucket + --s3-secret-access-key string AWS Secret Access Key (password) + --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 + --s3-session-token string An AWS session token + --s3-shared-credentials-file string Path to the shared credentials file + --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 + --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data + --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data + --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) + --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key + --s3-storage-class string The storage class to use when storing new objects in S3 + --s3-sts-endpoint string Endpoint for STS + --s3-upload-concurrency int Concurrency for multipart uploads (default 4) + --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint + --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) + --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) + --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads + --s3-v2-auth If true use v2 authentication + --s3-version-at Time Show file versions as they were at the specified time (default off) + --s3-versions Include old versions in directory listings + --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) + --seafile-create-library Should rclone create a library if it doesn't exist + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-library string Name of the library + --seafile-library-key string Library password (for encrypted libraries only) (obscured) + --seafile-pass string Password (obscured) + --seafile-url string URL of seafile host to connect to + --seafile-user string User name (usually email address) + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --sftp-ask-password Allow asking for SFTP password when needed + --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) + --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference + --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks + --sftp-disable-concurrent-reads If set don't use concurrent reads + --sftp-disable-concurrent-writes If set don't use concurrent writes + --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available + --sftp-host string SSH host to connect to + --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference + --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference + --sftp-key-file string Path to PEM-encoded private key file + --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) + --sftp-key-pem string Raw PEM-encoded private key + --sftp-key-use-agent When set forces the usage of the ssh-agent + --sftp-known-hosts-file string Optional path to known_hosts file + --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference + --sftp-md5sum-command string The command used to read md5 hashes + --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) + --sftp-path-override string Override path used by SSH shell commands + --sftp-port int SSH port number (default 22) + --sftp-pubkey-file string Optional path to public key file + --sftp-server-command string Specifies the path or command to run a sftp server on the remote host + --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands + --sftp-set-modtime Set the modified time on the remote if set (default true) + --sftp-sha1sum-command string The command used to read sha1 hashes + --sftp-shell-type string The type of SSH shell on remote server, if any + --sftp-skip-links Set to skip any symlinks and any other non regular files + --sftp-socks-proxy string Socks 5 proxy host + --sftp-ssh SpaceSepList Path and arguments to external ssh binary + --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") + --sftp-use-fstat If set use fstat instead of stat + --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods + --sftp-user string SSH username (default "$USER") + --sharefile-auth-url string Auth server URL + --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) + --sharefile-client-id string OAuth Client Id + --sharefile-client-secret string OAuth Client Secret + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-endpoint string Endpoint for API calls + --sharefile-root-folder-id string ID of the root folder + --sharefile-token string OAuth Access Token as a JSON blob + --sharefile-token-url string Token server url + --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) + --sia-api-password string Sia Daemon API Password (obscured) + --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-user-agent string Siad User Agent (default "Sia-Agent") + --size-only Skip based on size only, not modtime or checksum + --skip-links Don't warn about skipped symlinks + --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) + --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) + --smb-host string SMB server hostname to connect to + --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --smb-pass string SMB password (obscured) + --smb-port int SMB port number (default 445) + --smb-spn string Service principal name + --smb-user string SMB username (default "$USER") + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") + --storj-access-grant string Access grant + --storj-api-key string API key + --storj-passphrase string Encryption passphrase + --storj-provider string Choose an authentication method (default "existing") + --storj-satellite-address string Satellite address (default "us1.storj.io") + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --sugarsync-access-key-id string Sugarsync Access Key ID + --sugarsync-app-id string Sugarsync App ID + --sugarsync-authorization string Sugarsync authorization + --sugarsync-authorization-expiry string Sugarsync authorization expiry + --sugarsync-deleted-id string Sugarsync deleted folder id + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-hard-delete Permanently delete files if true + --sugarsync-private-access-key string Sugarsync Private Access Key + --sugarsync-refresh-token string Sugarsync refresh token + --sugarsync-root-id string Sugarsync root id + --sugarsync-user string Sugarsync user + --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) + --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) + --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) + --swift-auth string Authentication URL for server (OS_AUTH_URL) + --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) + --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) + --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) + --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) + --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") + --swift-env-auth Get swift credentials from environment variables in standard OpenStack form + --swift-key string API key or password (OS_PASSWORD) + --swift-leave-parts-on-error If true avoid calling abort upload on a failure + --swift-no-chunk Don't chunk files during streaming upload + --swift-no-large-objects Disable support for static and dynamic large objects + --swift-region string Region name - optional (OS_REGION_NAME) + --swift-storage-policy string The storage policy to use when creating a new container + --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) + --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) + --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) + --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) + --swift-user string User name to log in (OS_USERNAME) + --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") + --temp-dir string Directory rclone will use for temporary files (default "/tmp") + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") + --transfers int Number of file transfers to run in parallel (default 4) + --union-action-policy string Policy to choose upstream on ACTION category (default "epall") + --union-cache-time int Cache time of usage and free space (in seconds) (default 120) + --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") + --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) + --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") + --union-upstreams string List of space separated upstreams + -u, --update Skip files that are newer on the destination + --uptobox-access-token string Your access token + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-private Set to make uploaded files private + --use-cookies Enable session cookiejar + --use-json-log Use json log format + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") + -v, --verbose count Print lots more stuff (repeat for more) + -V, --version Print the version number + --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) + --webdav-bearer-token-command string Command to run to get a bearer token + --webdav-encoding string The encoding for the backend + --webdav-headers CommaSepList Set HTTP headers for all transactions + --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) + --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --webdav-pass string Password (obscured) + --webdav-url string URL of http host to connect to + --webdav-user string User name + --webdav-vendor string Name of the WebDAV site/service/software you are using + --yandex-auth-url string Auth server URL + --yandex-client-id string OAuth Client Id + --yandex-client-secret string OAuth Client Secret + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-hard-delete Delete files permanently rather than putting them into the trash + --yandex-token string OAuth Access Token as a JSON blob + --yandex-token-url string Token server url + --zoho-auth-url string Auth server URL + --zoho-client-id string OAuth Client Id + --zoho-client-secret string OAuth Client Secret + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-region string Zoho region to connect to + --zoho-token string OAuth Access Token as a JSON blob + --zoho-token-url string Token server url ``` -See the [global flags page](/flags/) for global options not listed here. - -## SEE ALSO +### SEE ALSO * [rclone about](/commands/rclone_about/) - Get quota information from the remote. * [rclone authorize](/commands/rclone_authorize/) - Remote authorization. @@ -40,23 +868,22 @@ See the [global flags page](/flags/) for global options not listed here. * [rclone bisync](/commands/rclone_bisync/) - Perform bidirectional synchronization between two paths. * [rclone cat](/commands/rclone_cat/) - Concatenates any files and sends them to stdout. * [rclone check](/commands/rclone_check/) - Checks the files in the source and destination match. -* [rclone checksum](/commands/rclone_checksum/) - Checks the files in the source against a SUM file. +* [rclone checksum](/commands/rclone_checksum/) - Checks the files in the destination against a SUM file. * [rclone cleanup](/commands/rclone_cleanup/) - Clean up the remote if possible. -* [rclone completion](/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](/commands/rclone_completion/) - Output completion script for a given shell. * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. * [rclone copy](/commands/rclone_copy/) - Copy files from source to dest, skipping identical files. * [rclone copyto](/commands/rclone_copyto/) - Copy files from source to dest, skipping identical files. * [rclone copyurl](/commands/rclone_copyurl/) - Copy url content to dest. -* [rclone cryptcheck](/commands/rclone_cryptcheck/) - Cryptcheck checks the integrity of a crypted remote. +* [rclone cryptcheck](/commands/rclone_cryptcheck/) - Cryptcheck checks the integrity of an encrypted remote. * [rclone cryptdecode](/commands/rclone_cryptdecode/) - Cryptdecode returns unencrypted file names. * [rclone dedupe](/commands/rclone_dedupe/) - Interactively find duplicate filenames and delete/rename them. * [rclone delete](/commands/rclone_delete/) - Remove the files in path. * [rclone deletefile](/commands/rclone_deletefile/) - Remove a single file from remote. -* [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output completion script for a given shell. * [rclone gendocs](/commands/rclone_gendocs/) - Output markdown docs for rclone to the directory supplied. * [rclone hashsum](/commands/rclone_hashsum/) - Produces a hashsum file for all the objects in the path. * [rclone link](/commands/rclone_link/) - Generate public link to file/folder. -* [rclone listremotes](/commands/rclone_listremotes/) - List all the remotes in the config file. +* [rclone listremotes](/commands/rclone_listremotes/) - List all the remotes in the config file and defined in environment variables. * [rclone ls](/commands/rclone_ls/) - List the objects in the path with size and path. * [rclone lsd](/commands/rclone_lsd/) - List all directories/containers/buckets in the path. * [rclone lsf](/commands/rclone_lsf/) - List directories and objects in remote:path formatted for parsing. diff --git a/docs/content/commands/rclone_about.md b/docs/content/commands/rclone_about.md index 4464aa80a634c..27328c8c4b9f4 100644 --- a/docs/content/commands/rclone_about.md +++ b/docs/content/commands/rclone_about.md @@ -72,9 +72,10 @@ rclone about remote: [flags] --json Format output as JSON ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_authorize.md b/docs/content/commands/rclone_authorize.md index 95b124822941f..5182880b42200 100644 --- a/docs/content/commands/rclone_authorize.md +++ b/docs/content/commands/rclone_authorize.md @@ -34,9 +34,10 @@ rclone authorize [flags] --template string The path to a custom Go template for generating HTML responses ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_backend.md b/docs/content/commands/rclone_backend.md index 8e29f42ede74d..e4d0c30102ce5 100644 --- a/docs/content/commands/rclone_backend.md +++ b/docs/content/commands/rclone_backend.md @@ -3,6 +3,7 @@ title: "rclone backend" description: "Run a backend-specific command." slug: rclone_backend url: /commands/rclone_backend/ +groups: Important versionIntroduced: v1.52 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/backend/ and as part of making a release run "make commanddocs" --- @@ -52,9 +53,20 @@ rclone backend remote:path [opts] [flags] -o, --option stringArray Option in the form name=value or name ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_bisync.md b/docs/content/commands/rclone_bisync.md index dacda99370a81..057e31848ad62 100644 --- a/docs/content/commands/rclone_bisync.md +++ b/docs/content/commands/rclone_bisync.md @@ -3,6 +3,7 @@ title: "rclone bisync" description: "Perform bidirectional synchronization between two paths." slug: rclone_bisync url: /commands/rclone_bisync/ +groups: Filter,Copy,Important versionIntroduced: v1.58 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/bisync/ and as part of making a release run "make commanddocs" --- @@ -32,22 +33,103 @@ rclone bisync remote1:path1 remote2:path2 [flags] ## Options ``` - --check-access Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort. - --check-filename string Filename for --check-access (default: RCLONE_TEST) - --check-sync string Controls comparison of final listings: true|false|only (default: true) (default "true") - --filters-file string Read filtering patterns from a file - --force Bypass --max-delete safety check and run the sync. Consider using with --verbose - -h, --help help for bisync - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first. - --workdir string Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync) + --check-access Ensure expected RCLONE_TEST files are found on both Path1 and Path2 filesystems, else abort. + --check-filename string Filename for --check-access (default: RCLONE_TEST) + --check-sync string Controls comparison of final listings: true|false|only (default: true) (default "true") + --create-empty-src-dirs Sync creation and deletion of empty directories. (Not compatible with --remove-empty-dirs) + --filters-file string Read filtering patterns from a file + --force Bypass --max-delete safety check and run the sync. Consider using with --verbose + -h, --help help for bisync + --ignore-listing-checksum Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks) + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --remove-empty-dirs Remove ALL empty directories at the final cleanup step. + --resilient Allow future runs to retry after certain less-serious errors, instead of requiring --resync. Use at your own risk! + -1, --resync Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first. + --workdir string Use custom working dir - useful for testing. (default: $HOME/.cache/rclone/bisync) +``` + + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) ``` See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_cat.md b/docs/content/commands/rclone_cat.md index 6ad41423d65c3..6580c9590d926 100644 --- a/docs/content/commands/rclone_cat.md +++ b/docs/content/commands/rclone_cat.md @@ -3,6 +3,7 @@ title: "rclone cat" description: "Concatenates any files and sends them to stdout." slug: rclone_cat url: /commands/rclone_cat/ +groups: Filter,Listing versionIntroduced: v1.33 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/cat/ and as part of making a release run "make commanddocs" --- @@ -32,6 +33,18 @@ the end and `--offset` and `--count` to print a section in the middle. Note that if offset is negative it will count from the end, so `--offset -1 --count 1` is equivalent to `--tail 1`. +Use the `--separator` flag to print a separator value between files. Be sure to +shell-escape special characters. For example, to print a newline between +files, use: + +* bash: + + rclone --include "*.txt" --separator $'\n' cat remote:path/to/dir + +* powershell: + + rclone --include "*.txt" --separator "`n" cat remote:path/to/dir + ``` rclone cat remote:path [flags] @@ -40,17 +53,57 @@ rclone cat remote:path [flags] ## Options ``` - --count int Only print N characters (default -1) - --discard Discard the output instead of printing - --head int Only print the first N characters - -h, --help help for cat - --offset int Start printing at offset N (or from end if -ve) - --tail int Only print the last N characters + --count int Only print N characters (default -1) + --discard Discard the output instead of printing + --head int Only print the first N characters + -h, --help help for cat + --offset int Start printing at offset N (or from end if -ve) + --separator string Separator to use between objects when printing multiple files + --tail int Only print the last N characters +``` + + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions ``` See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_check.md b/docs/content/commands/rclone_check.md index 112633fabbcc2..d6a2243ede0ae 100644 --- a/docs/content/commands/rclone_check.md +++ b/docs/content/commands/rclone_check.md @@ -3,6 +3,7 @@ title: "rclone check" description: "Checks the files in the source and destination match." slug: rclone_check url: /commands/rclone_check/ +groups: Filter,Listing,Check # autogenerated - DO NOT EDIT, instead edit the source code in cmd/check/ and as part of making a release run "make commanddocs" --- # rclone check @@ -18,7 +19,7 @@ match. It doesn't alter the source or destination. For the [crypt](/crypt/) remote there is a dedicated command, [cryptcheck](/commands/rclone_cryptcheck/), that are able to check -the checksums of the crypted files. +the checksums of the encrypted files. If you supply the `--size-only` flag, it will only compare the sizes not the hashes as well. Use this for a quick check. @@ -52,6 +53,9 @@ you what happened to it. These are reminiscent of diff files. - `* path` means path was present in source and destination but different. - `! path` means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the [--checkers=N](/docs/#checkers-n) +option for more information. + ``` rclone check source:path dest:path [flags] @@ -72,9 +76,56 @@ rclone check source:path dest:path [flags] --one-way Check one way only, source files must exist on remote ``` + +## Check Options + +Flags used for `rclone check`. + +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_checksum.md b/docs/content/commands/rclone_checksum.md index 661dab6b2d929..1e78aeb65e1fe 100644 --- a/docs/content/commands/rclone_checksum.md +++ b/docs/content/commands/rclone_checksum.md @@ -1,24 +1,28 @@ --- title: "rclone checksum" -description: "Checks the files in the source against a SUM file." +description: "Checks the files in the destination against a SUM file." slug: rclone_checksum url: /commands/rclone_checksum/ +groups: Filter,Listing versionIntroduced: v1.56 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/checksum/ and as part of making a release run "make commanddocs" --- # rclone checksum -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. ## Synopsis -Checks that hashsums of source files match the SUM file. +Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system. -If you supply the `--download` flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for remotes +The sumfile is treated as the source and the dst:path is treated as +the destination for the purposes of the output. + +If you supply the `--download` flag, it will download the data from the remote +and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. Note that hash values in the SUM file are treated as case insensitive. @@ -44,9 +48,12 @@ you what happened to it. These are reminiscent of diff files. - `* path` means path was present in source and destination but different. - `! path` means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the [--checkers=N](/docs/#checkers-n) +option for more information. + ``` -rclone checksum sumfile src:path [flags] +rclone checksum sumfile dst:path [flags] ``` ## Options @@ -63,9 +70,48 @@ rclone checksum sumfile src:path [flags] --one-way Check one way only, source files must exist on remote ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_cleanup.md b/docs/content/commands/rclone_cleanup.md index 0b7b0b189bb76..30b51d517ce19 100644 --- a/docs/content/commands/rclone_cleanup.md +++ b/docs/content/commands/rclone_cleanup.md @@ -3,6 +3,7 @@ title: "rclone cleanup" description: "Clean up the remote if possible." slug: rclone_cleanup url: /commands/rclone_cleanup/ +groups: Important versionIntroduced: v1.31 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/cleanup/ and as part of making a release run "make commanddocs" --- @@ -27,9 +28,20 @@ rclone cleanup remote:path [flags] -h, --help help for cleanup ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_completion.md b/docs/content/commands/rclone_completion.md index 9193c9868f2ee..0ecf68522c3f7 100644 --- a/docs/content/commands/rclone_completion.md +++ b/docs/content/commands/rclone_completion.md @@ -1,18 +1,20 @@ --- title: "rclone completion" -description: "Generate the autocompletion script for the specified shell" +description: "Output completion script for a given shell." slug: rclone_completion url: /commands/rclone_completion/ +versionIntroduced: v1.33 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/completion/ and as part of making a release run "make commanddocs" --- # rclone completion -Generate the autocompletion script for the specified shell +Output completion script for a given shell. ## Synopsis -Generate the autocompletion script for rclone for the specified shell. -See each sub-command's help for details on how to use the generated script. + +Generates a shell completion script for rclone. +Run with `--help` to list the supported shells. ## Options @@ -21,13 +23,14 @@ See each sub-command's help for details on how to use the generated script. -h, --help help for completion ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. -* [rclone completion bash](/commands/rclone_completion_bash/) - Generate the autocompletion script for bash -* [rclone completion fish](/commands/rclone_completion_fish/) - Generate the autocompletion script for fish -* [rclone completion powershell](/commands/rclone_completion_powershell/) - Generate the autocompletion script for powershell -* [rclone completion zsh](/commands/rclone_completion_zsh/) - Generate the autocompletion script for zsh +* [rclone completion bash](/commands/rclone_completion_bash/) - Output bash completion script for rclone. +* [rclone completion fish](/commands/rclone_completion_fish/) - Output fish completion script for rclone. +* [rclone completion powershell](/commands/rclone_completion_powershell/) - Output powershell completion script for rclone. +* [rclone completion zsh](/commands/rclone_completion_zsh/) - Output zsh completion script for rclone. diff --git a/docs/content/commands/rclone_completion_bash.md b/docs/content/commands/rclone_completion_bash.md index b5772be3ec1a1..08df4c9edbc65 100644 --- a/docs/content/commands/rclone_completion_bash.md +++ b/docs/content/commands/rclone_completion_bash.md @@ -1,52 +1,49 @@ --- title: "rclone completion bash" -description: "Generate the autocompletion script for bash" +description: "Output bash completion script for rclone." slug: rclone_completion_bash url: /commands/rclone_completion_bash/ # autogenerated - DO NOT EDIT, instead edit the source code in cmd/completion/bash/ and as part of making a release run "make commanddocs" --- # rclone completion bash -Generate the autocompletion script for bash +Output bash completion script for rclone. ## Synopsis -Generate the autocompletion script for the bash shell. -This script depends on the 'bash-completion' package. -If it is not installed already, you can install it via your OS's package manager. +Generates a bash shell autocompletion script for rclone. -To load completions in your current shell session: +This writes to /etc/bash_completion.d/rclone by default so will +probably need to be run with sudo or as root, e.g. - source <(rclone completion bash) + sudo rclone genautocomplete bash -To load completions for every new session, execute once: +Logout and login again to use the autocompletion scripts, or source +them directly -### Linux: + . /etc/bash_completion - rclone completion bash > /etc/bash_completion.d/rclone +If you supply a command line argument the script will be written +there. -### macOS: - - rclone completion bash > $(brew --prefix)/etc/bash_completion.d/rclone - -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. ``` -rclone completion bash +rclone completion bash [output_file] [flags] ``` ## Options ``` - -h, --help help for bash - --no-descriptions disable completion descriptions + -h, --help help for bash ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](/commands/rclone_completion/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_completion_fish.md b/docs/content/commands/rclone_completion_fish.md index 5e09dadfbb915..3934273a21742 100644 --- a/docs/content/commands/rclone_completion_fish.md +++ b/docs/content/commands/rclone_completion_fish.md @@ -1,43 +1,49 @@ --- title: "rclone completion fish" -description: "Generate the autocompletion script for fish" +description: "Output fish completion script for rclone." slug: rclone_completion_fish url: /commands/rclone_completion_fish/ # autogenerated - DO NOT EDIT, instead edit the source code in cmd/completion/fish/ and as part of making a release run "make commanddocs" --- # rclone completion fish -Generate the autocompletion script for fish +Output fish completion script for rclone. ## Synopsis -Generate the autocompletion script for the fish shell. -To load completions in your current shell session: +Generates a fish autocompletion script for rclone. - rclone completion fish | source +This writes to /etc/fish/completions/rclone.fish by default so will +probably need to be run with sudo or as root, e.g. -To load completions for every new session, execute once: + sudo rclone genautocomplete fish - rclone completion fish > ~/.config/fish/completions/rclone.fish +Logout and login again to use the autocompletion scripts, or source +them directly -You will need to start a new shell for this setup to take effect. + . /etc/fish/completions/rclone.fish + +If you supply a command line argument the script will be written +there. + +If output_file is "-", then the output will be written to stdout. ``` -rclone completion fish [flags] +rclone completion fish [output_file] [flags] ``` ## Options ``` - -h, --help help for fish - --no-descriptions disable completion descriptions + -h, --help help for fish ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](/commands/rclone_completion/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_completion_powershell.md b/docs/content/commands/rclone_completion_powershell.md index 8dfbafc458f9d..47a5febbdcd50 100644 --- a/docs/content/commands/rclone_completion_powershell.md +++ b/docs/content/commands/rclone_completion_powershell.md @@ -1,40 +1,43 @@ --- title: "rclone completion powershell" -description: "Generate the autocompletion script for powershell" +description: "Output powershell completion script for rclone." slug: rclone_completion_powershell url: /commands/rclone_completion_powershell/ # autogenerated - DO NOT EDIT, instead edit the source code in cmd/completion/powershell/ and as part of making a release run "make commanddocs" --- # rclone completion powershell -Generate the autocompletion script for powershell +Output powershell completion script for rclone. ## Synopsis + Generate the autocompletion script for powershell. To load completions in your current shell session: - rclone completion powershell | Out-String | Invoke-Expression + rclone completion powershell | Out-String | Invoke-Expression To load completions for every new session, add the output of the above command to your powershell profile. +If output_file is "-" or missing, then the output will be written to stdout. + ``` -rclone completion powershell [flags] +rclone completion powershell [output_file] [flags] ``` ## Options ``` - -h, --help help for powershell - --no-descriptions disable completion descriptions + -h, --help help for powershell ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](/commands/rclone_completion/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_completion_zsh.md b/docs/content/commands/rclone_completion_zsh.md index 1490817f71326..92ca04c12fec9 100644 --- a/docs/content/commands/rclone_completion_zsh.md +++ b/docs/content/commands/rclone_completion_zsh.md @@ -1,54 +1,49 @@ --- title: "rclone completion zsh" -description: "Generate the autocompletion script for zsh" +description: "Output zsh completion script for rclone." slug: rclone_completion_zsh url: /commands/rclone_completion_zsh/ # autogenerated - DO NOT EDIT, instead edit the source code in cmd/completion/zsh/ and as part of making a release run "make commanddocs" --- # rclone completion zsh -Generate the autocompletion script for zsh +Output zsh completion script for rclone. ## Synopsis -Generate the autocompletion script for the zsh shell. -If shell completion is not already enabled in your environment you will need -to enable it. You can execute the following once: +Generates a zsh autocompletion script for rclone. - echo "autoload -U compinit; compinit" >> ~/.zshrc +This writes to /usr/share/zsh/vendor-completions/_rclone by default so will +probably need to be run with sudo or as root, e.g. -To load completions in your current shell session: + sudo rclone genautocomplete zsh - source <(rclone completion zsh); compdef _rclone rclone +Logout and login again to use the autocompletion scripts, or source +them directly -To load completions for every new session, execute once: + autoload -U compinit && compinit -### Linux: +If you supply a command line argument the script will be written +there. - rclone completion zsh > "${fpath[1]}/_rclone" - -### macOS: - - rclone completion zsh > $(brew --prefix)/share/zsh/site-functions/_rclone - -You will need to start a new shell for this setup to take effect. +If output_file is "-", then the output will be written to stdout. ``` -rclone completion zsh [flags] +rclone completion zsh [output_file] [flags] ``` ## Options ``` - -h, --help help for zsh - --no-descriptions disable completion descriptions + -h, --help help for zsh ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO -* [rclone completion](/commands/rclone_completion/) - Generate the autocompletion script for the specified shell +* [rclone completion](/commands/rclone_completion/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_config.md b/docs/content/commands/rclone_config.md index 186d90d2651dd..ee4c1403bd235 100644 --- a/docs/content/commands/rclone_config.md +++ b/docs/content/commands/rclone_config.md @@ -27,20 +27,23 @@ rclone config [flags] -h, --help help for config ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone config create](/commands/rclone_config_create/) - Create a new remote with name, type and options. * [rclone config delete](/commands/rclone_config_delete/) - Delete an existing remote. * [rclone config disconnect](/commands/rclone_config_disconnect/) - Disconnects user from remote * [rclone config dump](/commands/rclone_config_dump/) - Dump the config file as JSON. +* [rclone config edit](/commands/rclone_config_edit/) - Enter an interactive configuration session. * [rclone config file](/commands/rclone_config_file/) - Show path of configuration file in use. * [rclone config password](/commands/rclone_config_password/) - Update password in an existing remote. * [rclone config paths](/commands/rclone_config_paths/) - Show paths used for configuration, cache, temp etc. * [rclone config providers](/commands/rclone_config_providers/) - List in JSON format all the providers and options. * [rclone config reconnect](/commands/rclone_config_reconnect/) - Re-authenticates user with remote. +* [rclone config redacted](/commands/rclone_config_redacted/) - Print redacted (decrypted) config file, or the redacted config for a single remote. * [rclone config show](/commands/rclone_config_show/) - Print (decrypted) config file, or the config for a single remote. * [rclone config touch](/commands/rclone_config_touch/) - Ensure configuration file exists. * [rclone config update](/commands/rclone_config_update/) - Update options in an existing remote. diff --git a/docs/content/commands/rclone_config_create.md b/docs/content/commands/rclone_config_create.md index a923b246dad5d..326c142c2fc1b 100644 --- a/docs/content/commands/rclone_config_create.md +++ b/docs/content/commands/rclone_config_create.md @@ -132,9 +132,10 @@ rclone config create name type [key value]* [flags] --state string State - use with --continue ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_delete.md b/docs/content/commands/rclone_config_delete.md index c58bed4e42c2e..aeafa236ba70b 100644 --- a/docs/content/commands/rclone_config_delete.md +++ b/docs/content/commands/rclone_config_delete.md @@ -20,9 +20,10 @@ rclone config delete name [flags] -h, --help help for delete ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_disconnect.md b/docs/content/commands/rclone_config_disconnect.md index 76a64378a8a93..619c01b82d016 100644 --- a/docs/content/commands/rclone_config_disconnect.md +++ b/docs/content/commands/rclone_config_disconnect.md @@ -29,9 +29,10 @@ rclone config disconnect remote: [flags] -h, --help help for disconnect ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_dump.md b/docs/content/commands/rclone_config_dump.md index e0119936dbc93..5e6c859bf8db8 100644 --- a/docs/content/commands/rclone_config_dump.md +++ b/docs/content/commands/rclone_config_dump.md @@ -20,9 +20,10 @@ rclone config dump [flags] -h, --help help for dump ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_edit.md b/docs/content/commands/rclone_config_edit.md index dade7e042a66d..2d36391963d34 100644 --- a/docs/content/commands/rclone_config_edit.md +++ b/docs/content/commands/rclone_config_edit.md @@ -3,13 +3,14 @@ title: "rclone config edit" description: "Enter an interactive configuration session." slug: rclone_config_edit url: /commands/rclone_config_edit/ +versionIntroduced: v1.39 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/config/edit/ and as part of making a release run "make commanddocs" --- # rclone config edit Enter an interactive configuration session. -# Synopsis +## Synopsis Enter an interactive configuration session where you can setup new remotes and manage existing ones. You may also set or remove a @@ -20,12 +21,13 @@ password to protect your configuration. rclone config edit [flags] ``` -# Options +## Options ``` -h, --help help for edit ``` + See the [global flags page](/flags/) for global options not listed here. # SEE ALSO diff --git a/docs/content/commands/rclone_config_file.md b/docs/content/commands/rclone_config_file.md index 8585b77f933a1..76de779d59220 100644 --- a/docs/content/commands/rclone_config_file.md +++ b/docs/content/commands/rclone_config_file.md @@ -20,9 +20,10 @@ rclone config file [flags] -h, --help help for file ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_password.md b/docs/content/commands/rclone_config_password.md index f69301811e0ae..406877bc14ab5 100644 --- a/docs/content/commands/rclone_config_password.md +++ b/docs/content/commands/rclone_config_password.md @@ -36,9 +36,10 @@ rclone config password name [key value]+ [flags] -h, --help help for password ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_paths.md b/docs/content/commands/rclone_config_paths.md index 7762ce0903b96..2b12cc6ad6c45 100644 --- a/docs/content/commands/rclone_config_paths.md +++ b/docs/content/commands/rclone_config_paths.md @@ -20,9 +20,10 @@ rclone config paths [flags] -h, --help help for paths ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_providers.md b/docs/content/commands/rclone_config_providers.md index 43441af08832e..07668581d384d 100644 --- a/docs/content/commands/rclone_config_providers.md +++ b/docs/content/commands/rclone_config_providers.md @@ -20,9 +20,10 @@ rclone config providers [flags] -h, --help help for providers ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_reconnect.md b/docs/content/commands/rclone_config_reconnect.md index bb2e9f740cae1..c60608ced8a47 100644 --- a/docs/content/commands/rclone_config_reconnect.md +++ b/docs/content/commands/rclone_config_reconnect.md @@ -29,9 +29,10 @@ rclone config reconnect remote: [flags] -h, --help help for reconnect ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_redacted.md b/docs/content/commands/rclone_config_redacted.md new file mode 100644 index 0000000000000..e792dde4c8b77 --- /dev/null +++ b/docs/content/commands/rclone_config_redacted.md @@ -0,0 +1,43 @@ +--- +title: "rclone config redacted" +description: "Print redacted (decrypted) config file, or the redacted config for a single remote." +slug: rclone_config_redacted +url: /commands/rclone_config_redacted/ +versionIntroduced: v1.64 +# autogenerated - DO NOT EDIT, instead edit the source code in cmd/config/redacted/ and as part of making a release run "make commanddocs" +--- +# rclone config redacted + +Print redacted (decrypted) config file, or the redacted config for a single remote. + +## Synopsis + +This prints a redacted copy of the config file, either the +whole config file or for a given remote. + +The config file will be redacted by replacing all passwords and other +sensitive info with XXX. + +This makes the config file suitable for posting online for support. + +It should be double checked before posting as the redaction may not be perfect. + + + +``` +rclone config redacted [] [flags] +``` + +## Options + +``` + -h, --help help for redacted +``` + + +See the [global flags page](/flags/) for global options not listed here. + +# SEE ALSO + +* [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. + diff --git a/docs/content/commands/rclone_config_show.md b/docs/content/commands/rclone_config_show.md index beab56349cbfa..5bf4150bfcd37 100644 --- a/docs/content/commands/rclone_config_show.md +++ b/docs/content/commands/rclone_config_show.md @@ -20,9 +20,10 @@ rclone config show [] [flags] -h, --help help for show ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_touch.md b/docs/content/commands/rclone_config_touch.md index d96c3702782a3..c16f95af89bbb 100644 --- a/docs/content/commands/rclone_config_touch.md +++ b/docs/content/commands/rclone_config_touch.md @@ -20,9 +20,10 @@ rclone config touch [flags] -h, --help help for touch ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_update.md b/docs/content/commands/rclone_config_update.md index 9e3fa9a38a1f9..55147084d3031 100644 --- a/docs/content/commands/rclone_config_update.md +++ b/docs/content/commands/rclone_config_update.md @@ -132,9 +132,10 @@ rclone config update name [key value]+ [flags] --state string State - use with --continue ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_config_userinfo.md b/docs/content/commands/rclone_config_userinfo.md index d7930a0b32507..ab1ba95398a22 100644 --- a/docs/content/commands/rclone_config_userinfo.md +++ b/docs/content/commands/rclone_config_userinfo.md @@ -27,9 +27,10 @@ rclone config userinfo remote: [flags] --json Format output as JSON ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_copy.md b/docs/content/commands/rclone_copy.md index 022f3e7b08e5f..315dc4b8a0bad 100644 --- a/docs/content/commands/rclone_copy.md +++ b/docs/content/commands/rclone_copy.md @@ -3,6 +3,7 @@ title: "rclone copy" description: "Copy files from source to dest, skipping identical files." slug: rclone_copy url: /commands/rclone_copy/ +groups: Copy,Filter,Listing,Important # autogenerated - DO NOT EDIT, instead edit the source code in cmd/copy/ and as part of making a release run "make commanddocs" --- # rclone copy @@ -80,9 +81,96 @@ rclone copy source:path dest:path [flags] -h, --help help for copy ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_copyto.md b/docs/content/commands/rclone_copyto.md index bfd8b5e72fb15..30a42e53f4c99 100644 --- a/docs/content/commands/rclone_copyto.md +++ b/docs/content/commands/rclone_copyto.md @@ -3,6 +3,7 @@ title: "rclone copyto" description: "Copy files from source to dest, skipping identical files." slug: rclone_copyto url: /commands/rclone_copyto/ +groups: Copy,Filter,Listing,Important versionIntroduced: v1.35 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/copyto/ and as part of making a release run "make commanddocs" --- @@ -52,9 +53,96 @@ rclone copyto source:path dest:path [flags] -h, --help help for copyto ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_copyurl.md b/docs/content/commands/rclone_copyurl.md index 2d13cd9a8633c..caeea9de2e7f1 100644 --- a/docs/content/commands/rclone_copyurl.md +++ b/docs/content/commands/rclone_copyurl.md @@ -3,6 +3,7 @@ title: "rclone copyurl" description: "Copy url content to dest." slug: rclone_copyurl url: /commands/rclone_copyurl/ +groups: Important versionIntroduced: v1.43 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/copyurl/ and as part of making a release run "make commanddocs" --- @@ -44,9 +45,20 @@ rclone copyurl https://example.com dest:path [flags] --stdout Write the output to stdout rather than a file ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_cryptcheck.md b/docs/content/commands/rclone_cryptcheck.md index 21528b029ff79..9f258d2f047ca 100644 --- a/docs/content/commands/rclone_cryptcheck.md +++ b/docs/content/commands/rclone_cryptcheck.md @@ -1,21 +1,22 @@ --- title: "rclone cryptcheck" -description: "Cryptcheck checks the integrity of a crypted remote." +description: "Cryptcheck checks the integrity of an encrypted remote." slug: rclone_cryptcheck url: /commands/rclone_cryptcheck/ +groups: Filter,Listing,Check versionIntroduced: v1.36 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/cryptcheck/ and as part of making a release run "make commanddocs" --- # rclone cryptcheck -Cryptcheck checks the integrity of a crypted remote. +Cryptcheck checks the integrity of an encrypted remote. ## Synopsis rclone cryptcheck checks a remote against a [crypted](/crypt/) remote. This is the equivalent of running rclone [check](/commands/rclone_check/), -but able to check the checksums of the crypted remote. +but able to check the checksums of the encrypted remote. For it to work the underlying remote of the cryptedremote must support some kind of checksum. @@ -57,6 +58,9 @@ you what happened to it. These are reminiscent of diff files. - `* path` means path was present in source and destination but different. - `! path` means there was an error reading or hashing the source or dest. +The default number of parallel checks is 8. See the [--checkers=N](/docs/#checkers-n) +option for more information. + ``` rclone cryptcheck remote:path cryptedremote:path [flags] @@ -75,9 +79,56 @@ rclone cryptcheck remote:path cryptedremote:path [flags] --one-way Check one way only, source files must exist on remote ``` + +## Check Options + +Flags used for `rclone check`. + +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_cryptdecode.md b/docs/content/commands/rclone_cryptdecode.md index 11be5a7d1c2a0..bc9425407f28c 100644 --- a/docs/content/commands/rclone_cryptdecode.md +++ b/docs/content/commands/rclone_cryptdecode.md @@ -39,9 +39,10 @@ rclone cryptdecode encryptedremote: encryptedfilename [flags] --reverse Reverse cryptdecode, encrypts filenames ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_dedupe.md b/docs/content/commands/rclone_dedupe.md index a7a711b4576be..3791dfb4109b6 100644 --- a/docs/content/commands/rclone_dedupe.md +++ b/docs/content/commands/rclone_dedupe.md @@ -3,6 +3,7 @@ title: "rclone dedupe" description: "Interactively find duplicate filenames and delete/rename them." slug: rclone_dedupe url: /commands/rclone_dedupe/ +groups: Important versionIntroduced: v1.27 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/dedupe/ and as part of making a release run "make commanddocs" --- @@ -132,9 +133,20 @@ rclone dedupe [mode] remote:path [flags] -h, --help help for dedupe ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_delete.md b/docs/content/commands/rclone_delete.md index 08ec20f98faa0..9bfa4f8daab32 100644 --- a/docs/content/commands/rclone_delete.md +++ b/docs/content/commands/rclone_delete.md @@ -3,6 +3,7 @@ title: "rclone delete" description: "Remove the files in path." slug: rclone_delete url: /commands/rclone_delete/ +groups: Important,Filter,Listing versionIntroduced: v1.27 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/delete/ and as part of making a release run "make commanddocs" --- @@ -52,9 +53,58 @@ rclone delete remote:path [flags] --rmdirs rmdirs removes empty directories but leaves root intact ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_deletefile.md b/docs/content/commands/rclone_deletefile.md index 0cdaaf860be06..5bc923070ecb3 100644 --- a/docs/content/commands/rclone_deletefile.md +++ b/docs/content/commands/rclone_deletefile.md @@ -3,6 +3,7 @@ title: "rclone deletefile" description: "Remove a single file from remote." slug: rclone_deletefile url: /commands/rclone_deletefile/ +groups: Important versionIntroduced: v1.42 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/deletefile/ and as part of making a release run "make commanddocs" --- @@ -28,9 +29,20 @@ rclone deletefile remote:path [flags] -h, --help help for deletefile ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_genautocomplete.md b/docs/content/commands/rclone_genautocomplete.md index efaa38b07db30..d9174320f98e7 100644 --- a/docs/content/commands/rclone_genautocomplete.md +++ b/docs/content/commands/rclone_genautocomplete.md @@ -10,14 +10,14 @@ versionIntroduced: v1.33 Output completion script for a given shell. -## Synopsis +# Synopsis Generates a shell completion script for rclone. Run with `--help` to list the supported shells. -## Options +# Options ``` -h, --help help for genautocomplete @@ -25,7 +25,7 @@ Run with `--help` to list the supported shells. See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone genautocomplete bash](/commands/rclone_genautocomplete_bash/) - Output bash completion script for rclone. diff --git a/docs/content/commands/rclone_genautocomplete_bash.md b/docs/content/commands/rclone_genautocomplete_bash.md index a771b3af49d61..8def9b4a921e4 100644 --- a/docs/content/commands/rclone_genautocomplete_bash.md +++ b/docs/content/commands/rclone_genautocomplete_bash.md @@ -9,7 +9,7 @@ url: /commands/rclone_genautocomplete_bash/ Output bash completion script for rclone. -## Synopsis +# Synopsis Generates a bash shell autocompletion script for rclone. @@ -34,7 +34,7 @@ If output_file is "-", then the output will be written to stdout. rclone genautocomplete bash [output_file] [flags] ``` -## Options +# Options ``` -h, --help help for bash @@ -42,7 +42,7 @@ rclone genautocomplete bash [output_file] [flags] See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_genautocomplete_fish.md b/docs/content/commands/rclone_genautocomplete_fish.md index 85650f6c8cc18..db124f3ba8ce6 100644 --- a/docs/content/commands/rclone_genautocomplete_fish.md +++ b/docs/content/commands/rclone_genautocomplete_fish.md @@ -9,7 +9,7 @@ url: /commands/rclone_genautocomplete_fish/ Output fish completion script for rclone. -## Synopsis +# Synopsis Generates a fish autocompletion script for rclone. @@ -34,7 +34,7 @@ If output_file is "-", then the output will be written to stdout. rclone genautocomplete fish [output_file] [flags] ``` -## Options +# Options ``` -h, --help help for fish @@ -42,7 +42,7 @@ rclone genautocomplete fish [output_file] [flags] See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_genautocomplete_zsh.md b/docs/content/commands/rclone_genautocomplete_zsh.md index 5da7d79759e4a..33ca513425bb6 100644 --- a/docs/content/commands/rclone_genautocomplete_zsh.md +++ b/docs/content/commands/rclone_genautocomplete_zsh.md @@ -9,7 +9,7 @@ url: /commands/rclone_genautocomplete_zsh/ Output zsh completion script for rclone. -## Synopsis +# Synopsis Generates a zsh autocompletion script for rclone. @@ -34,7 +34,7 @@ If output_file is "-", then the output will be written to stdout. rclone genautocomplete zsh [output_file] [flags] ``` -## Options +# Options ``` -h, --help help for zsh @@ -42,7 +42,7 @@ rclone genautocomplete zsh [output_file] [flags] See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output completion script for a given shell. diff --git a/docs/content/commands/rclone_gendocs.md b/docs/content/commands/rclone_gendocs.md index 5389340c6e08b..d89d287c82dbb 100644 --- a/docs/content/commands/rclone_gendocs.md +++ b/docs/content/commands/rclone_gendocs.md @@ -27,9 +27,10 @@ rclone gendocs output_directory [flags] -h, --help help for gendocs ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_hashsum.md b/docs/content/commands/rclone_hashsum.md index e1a78e3be5abb..b3392c01b70eb 100644 --- a/docs/content/commands/rclone_hashsum.md +++ b/docs/content/commands/rclone_hashsum.md @@ -3,6 +3,7 @@ title: "rclone hashsum" description: "Produces a hashsum file for all the objects in the path." slug: rclone_hashsum url: /commands/rclone_hashsum/ +groups: Filter,Listing versionIntroduced: v1.41 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/hashsum/ and as part of making a release run "make commanddocs" --- @@ -39,10 +40,6 @@ Run without a hash to see the list of all supported hashes, e.g. * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor Then @@ -52,7 +49,7 @@ Note that hash names are case insensitive and values are output in lower case. ``` -rclone hashsum remote:path [flags] +rclone hashsum [ remote:path] [flags] ``` ## Options @@ -65,9 +62,48 @@ rclone hashsum remote:path [flags] --output-file string Output hashsums to a file rather than the terminal ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_link.md b/docs/content/commands/rclone_link.md index 45684987307b6..71b461a93719a 100644 --- a/docs/content/commands/rclone_link.md +++ b/docs/content/commands/rclone_link.md @@ -47,9 +47,10 @@ rclone link remote:path [flags] --unlink Remove existing public link to file/folder ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_listremotes.md b/docs/content/commands/rclone_listremotes.md index fdf20b88c8c99..d943182bb010f 100644 --- a/docs/content/commands/rclone_listremotes.md +++ b/docs/content/commands/rclone_listremotes.md @@ -1,6 +1,6 @@ --- title: "rclone listremotes" -description: "List all the remotes in the config file." +description: "List all the remotes in the config file and defined in environment variables." slug: rclone_listremotes url: /commands/rclone_listremotes/ versionIntroduced: v1.34 @@ -8,7 +8,7 @@ versionIntroduced: v1.34 --- # rclone listremotes -List all the remotes in the config file. +List all the remotes in the config file and defined in environment variables. ## Synopsis @@ -29,9 +29,10 @@ rclone listremotes [flags] --long Show the type as well as names ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_ls.md b/docs/content/commands/rclone_ls.md index a1bfc8cfe4c7f..5c438b1bb1c45 100644 --- a/docs/content/commands/rclone_ls.md +++ b/docs/content/commands/rclone_ls.md @@ -3,6 +3,7 @@ title: "rclone ls" description: "List the objects in the path with size and path." slug: rclone_ls url: /commands/rclone_ls/ +groups: Filter,Listing # autogenerated - DO NOT EDIT, instead edit the source code in cmd/ls/ and as part of making a release run "make commanddocs" --- # rclone ls @@ -57,9 +58,48 @@ rclone ls remote:path [flags] -h, --help help for ls ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_lsd.md b/docs/content/commands/rclone_lsd.md index 86a1f47c7b5cd..8fd4193579653 100644 --- a/docs/content/commands/rclone_lsd.md +++ b/docs/content/commands/rclone_lsd.md @@ -3,6 +3,7 @@ title: "rclone lsd" description: "List all directories/containers/buckets in the path." slug: rclone_lsd url: /commands/rclone_lsd/ +groups: Filter,Listing # autogenerated - DO NOT EDIT, instead edit the source code in cmd/lsd/ and as part of making a release run "make commanddocs" --- # rclone lsd @@ -68,9 +69,48 @@ rclone lsd remote:path [flags] -R, --recursive Recurse into the listing ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_lsf.md b/docs/content/commands/rclone_lsf.md index 8567cbc9e653e..c45322182152c 100644 --- a/docs/content/commands/rclone_lsf.md +++ b/docs/content/commands/rclone_lsf.md @@ -3,6 +3,7 @@ title: "rclone lsf" description: "List directories and objects in remote:path formatted for parsing." slug: rclone_lsf url: /commands/rclone_lsf/ +groups: Filter,Listing versionIntroduced: v1.40 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/lsf/ and as part of making a release run "make commanddocs" --- @@ -151,9 +152,48 @@ rclone lsf remote:path [flags] -s, --separator string Separator for the items in the format (default ";") ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_lsjson.md b/docs/content/commands/rclone_lsjson.md index fbb979363ce3f..837427e5901d0 100644 --- a/docs/content/commands/rclone_lsjson.md +++ b/docs/content/commands/rclone_lsjson.md @@ -3,6 +3,7 @@ title: "rclone lsjson" description: "List directories and objects in the path in JSON format." slug: rclone_lsjson url: /commands/rclone_lsjson/ +groups: Filter,Listing versionIntroduced: v1.37 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/lsjson/ and as part of making a release run "make commanddocs" --- @@ -129,9 +130,48 @@ rclone lsjson remote:path [flags] --stat Just return the info for the pointed to file ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_lsl.md b/docs/content/commands/rclone_lsl.md index b7419e7ac8e40..eb4617906254f 100644 --- a/docs/content/commands/rclone_lsl.md +++ b/docs/content/commands/rclone_lsl.md @@ -3,6 +3,7 @@ title: "rclone lsl" description: "List the objects in path with modification time, size and path." slug: rclone_lsl url: /commands/rclone_lsl/ +groups: Filter,Listing versionIntroduced: v1.02 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/lsl/ and as part of making a release run "make commanddocs" --- @@ -58,9 +59,48 @@ rclone lsl remote:path [flags] -h, --help help for lsl ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_md5sum.md b/docs/content/commands/rclone_md5sum.md index c805064295ce0..0ec173a5f66ff 100644 --- a/docs/content/commands/rclone_md5sum.md +++ b/docs/content/commands/rclone_md5sum.md @@ -3,6 +3,7 @@ title: "rclone md5sum" description: "Produces an md5sum file for all the objects in the path." slug: rclone_md5sum url: /commands/rclone_md5sum/ +groups: Filter,Listing versionIntroduced: v1.02 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/md5sum/ and as part of making a release run "make commanddocs" --- @@ -45,9 +46,48 @@ rclone md5sum remote:path [flags] --output-file string Output hashsums to a file rather than the terminal ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_mkdir.md b/docs/content/commands/rclone_mkdir.md index 4d009c91ed828..0ca2025ab57c4 100644 --- a/docs/content/commands/rclone_mkdir.md +++ b/docs/content/commands/rclone_mkdir.md @@ -3,6 +3,7 @@ title: "rclone mkdir" description: "Make the path if it doesn't already exist." slug: rclone_mkdir url: /commands/rclone_mkdir/ +groups: Important # autogenerated - DO NOT EDIT, instead edit the source code in cmd/mkdir/ and as part of making a release run "make commanddocs" --- # rclone mkdir @@ -19,9 +20,20 @@ rclone mkdir remote:path [flags] -h, --help help for mkdir ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_mount.md b/docs/content/commands/rclone_mount.md index 322a3426c736c..c22fb2e7ead14 100644 --- a/docs/content/commands/rclone_mount.md +++ b/docs/content/commands/rclone_mount.md @@ -3,6 +3,7 @@ title: "rclone mount" description: "Mount the remote as file system on a mountpoint." slug: rclone_mount url: /commands/rclone_mount/ +groups: Filter versionIntroduced: v1.33 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/mount/ and as part of making a release run "make commanddocs" --- @@ -12,7 +13,6 @@ Mount the remote as file system on a mountpoint. ## Synopsis - rclone mount allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's cloud storage systems as a file system with FUSE. @@ -267,11 +267,28 @@ does not suffer from the same limitations. ## Mounting on macOS -Mounting on macOS can be done either via [macFUSE](https://osxfuse.github.io/) +Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/), [macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or [FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server. +# NFS mount + +This method spins up an NFS server using [serve nfs](/commands/rclone_serve_nfs/) command and mounts +it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to +send SIGTERM signal to the rclone process using |kill| command to stop the mount. + +### macFUSE Notes + +If installing macFUSE using [dmg packages](https://github.com/osxfuse/osxfuse/releases) from +the website, rclone will locate the macFUSE libraries without any further intervention. +If however, macFUSE is installed using the [macports](https://www.macports.org/) package manager, +the following addition steps are required. + + sudo mkdir /usr/local/lib + cd /usr/local/lib + sudo ln -s /opt/local/lib/libfuse.2.dylib + ### FUSE-T Limitations, Caveats, and Notes There are some limitations, caveats, and notes about how it works. These are current as @@ -310,6 +327,8 @@ sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without `--vfs-cache-mode writes` or `--vfs-cache-mode full`. See the [VFS File Caching](#vfs-file-caching) section for more info. +When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| +the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty @@ -408,20 +427,19 @@ or create systemd mount units: ``` # /etc/systemd/system/mnt-data.mount [Unit] -After=network-online.target +Description=Mount for /mnt/data [Mount] Type=rclone What=sftp1:subdir Where=/mnt/data -Options=rw,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone +Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/etc/rclone.conf,cache-dir=/var/rclone ``` optionally accompanied by systemd automount unit ``` # /etc/systemd/system/mnt-data.automount [Unit] -After=network-online.target -Before=remote-fs.target +Description=AutoMount for /mnt/data [Automount] Where=/mnt/data TimeoutIdleSec=600 @@ -457,7 +475,6 @@ Mount option syntax includes a few extra options treated specially: - `vv...` will be transformed into appropriate `--verbose=N` - standard mount options like `x-systemd.automount`, `_netdev`, `nosuid` and alike are intended only for Automountd and ignored by rclone. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -532,12 +549,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -554,10 +572,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -802,6 +832,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for mount --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -813,8 +844,9 @@ rclone mount remote:path /path/to/mountpoint [flags] --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -824,6 +856,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -831,9 +864,39 @@ rclone mount remote:path /path/to/mountpoint [flags] --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_move.md b/docs/content/commands/rclone_move.md index cd2e96fa35654..bc6efdddedd36 100644 --- a/docs/content/commands/rclone_move.md +++ b/docs/content/commands/rclone_move.md @@ -3,6 +3,7 @@ title: "rclone move" description: "Move files from source to dest." slug: rclone_move url: /commands/rclone_move/ +groups: Filter,Listing,Important,Copy versionIntroduced: v1.19 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/move/ and as part of making a release run "make commanddocs" --- @@ -56,9 +57,96 @@ rclone move source:path dest:path [flags] -h, --help help for move ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_moveto.md b/docs/content/commands/rclone_moveto.md index 4a236fe93f23c..79f3e3420937a 100644 --- a/docs/content/commands/rclone_moveto.md +++ b/docs/content/commands/rclone_moveto.md @@ -3,6 +3,7 @@ title: "rclone moveto" description: "Move file or directory from source to dest." slug: rclone_moveto url: /commands/rclone_moveto/ +groups: Filter,Listing,Important,Copy versionIntroduced: v1.35 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/moveto/ and as part of making a release run "make commanddocs" --- @@ -55,9 +56,96 @@ rclone moveto source:path dest:path [flags] -h, --help help for moveto ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_ncdu.md b/docs/content/commands/rclone_ncdu.md index a92250cf25969..4c0a41b3e8c46 100644 --- a/docs/content/commands/rclone_ncdu.md +++ b/docs/content/commands/rclone_ncdu.md @@ -3,6 +3,7 @@ title: "rclone ncdu" description: "Explore a remote with a text based user interface." slug: rclone_ncdu url: /commands/rclone_ncdu/ +groups: Filter,Listing versionIntroduced: v1.37 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/ncdu/ and as part of making a release run "make commanddocs" --- @@ -43,6 +44,7 @@ press '?' to toggle the help on and off. The supported keys are: y copy current path to clipboard Y display current path ^L refresh screen (fix screen corruption) + r recalculate file sizes ? to toggle help on and off q/ESC/^c to quit @@ -83,9 +85,48 @@ rclone ncdu remote:path [flags] -h, --help help for ncdu ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_obscure.md b/docs/content/commands/rclone_obscure.md index 06f556430ad7c..d5ab27510c172 100644 --- a/docs/content/commands/rclone_obscure.md +++ b/docs/content/commands/rclone_obscure.md @@ -46,9 +46,10 @@ rclone obscure password [flags] -h, --help help for obscure ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_purge.md b/docs/content/commands/rclone_purge.md index 6b87acc56ed6a..7fea5b3f5c825 100644 --- a/docs/content/commands/rclone_purge.md +++ b/docs/content/commands/rclone_purge.md @@ -3,6 +3,7 @@ title: "rclone purge" description: "Remove the path and all of its contents." slug: rclone_purge url: /commands/rclone_purge/ +groups: Important # autogenerated - DO NOT EDIT, instead edit the source code in cmd/purge/ and as part of making a release run "make commanddocs" --- # rclone purge @@ -32,9 +33,20 @@ rclone purge remote:path [flags] -h, --help help for purge ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_rc.md b/docs/content/commands/rclone_rc.md index 1cdd9b135d6e6..5ffad08042526 100644 --- a/docs/content/commands/rclone_rc.md +++ b/docs/content/commands/rclone_rc.md @@ -81,9 +81,10 @@ rclone rc commands parameter [flags] --user string Username to use to rclone remote control ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_rcat.md b/docs/content/commands/rclone_rcat.md index a51eda8515973..1f25458813240 100644 --- a/docs/content/commands/rclone_rcat.md +++ b/docs/content/commands/rclone_rcat.md @@ -3,6 +3,7 @@ title: "rclone rcat" description: "Copies standard input to file on remote." slug: rclone_rcat url: /commands/rclone_rcat/ +groups: Important versionIntroduced: v1.38 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/rcat/ and as part of making a release run "make commanddocs" --- @@ -38,10 +39,11 @@ and actually stream it, even if remote backend doesn't support streaming. size of the stream is different in length to the `--size` passed in then the transfer will likely fail. -Note that the upload can also not be retried because the data is -not kept around until the upload succeeds. If you need to transfer -a lot of data, you're better off caching locally and then -`rclone move` it to the destination. +Note that the upload cannot be retried because the data is not stored. +If the backend supports multipart uploading then individual chunks can +be retried. If you need to transfer a lot of data, you may be better +off caching it locally and then `rclone move` it to the +destination which can use retries. ``` rclone rcat remote:path [flags] @@ -54,9 +56,20 @@ rclone rcat remote:path [flags] --size int File size hint to preallocate (default -1) ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_rcd.md b/docs/content/commands/rclone_rcd.md index d179b606abddf..73a40c42bba0a 100644 --- a/docs/content/commands/rclone_rcd.md +++ b/docs/content/commands/rclone_rcd.md @@ -3,6 +3,7 @@ title: "rclone rcd" description: "Run rclone listening to remote control commands only." slug: rclone_rcd url: /commands/rclone_rcd/ +groups: RC versionIntroduced: v1.45 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/rcd/ and as part of making a release run "make commanddocs" --- @@ -25,54 +26,54 @@ See the [rc documentation](/rc/) for more info on the rc flags. ## Server options -Use `--addr` to specify which IP address and port the server should -listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +Use `--rc-addr` to specify which IP address and port the server should +listen on, eg `--rc-addr 1.2.3.4:8000` or `--rc-addr :8080` to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port. -If you set `--addr` to listen on a public or LAN accessible IP address +If you set `--rc-addr` to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info. You can use a unix socket by setting the url to `unix:///path/to/socket` or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions. -`--addr` may be repeated to listen on multiple IPs/ports/sockets. +`--rc-addr` may be repeated to listen on multiple IPs/ports/sockets. -`--server-read-timeout` and `--server-write-timeout` can be used to +`--rc-server-read-timeout` and `--rc-server-write-timeout` can be used to control the timeouts on the server. Note that this is the total time for a transfer. -`--max-header-bytes` controls the maximum number of bytes the server will +`--rc-max-header-bytes` controls the maximum number of bytes the server will accept in the HTTP header. -`--baseurl` controls the URL prefix that rclone serves from. By default -rclone will serve from the root. If you used `--baseurl "/rclone"` then +`--rc-baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--rc-baseurl "/rclone"` then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically -inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, -`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +inserts leading and trailing "/" on `--rc-baseurl`, so `--rc-baseurl "rclone"`, +`--rc-baseurl "/rclone"` and `--rc-baseurl "/rclone/"` are all treated identically. ### TLS (SSL) By default this will serve over http. If you want you can serve over -https. You will need to supply the `--cert` and `--key` flags. +https. You will need to supply the `--rc-cert` and `--rc-key` flags. If you wish to do client side certificate validation then you will need to -supply `--client-ca` also. +supply `--rc-client-ca` also. -`--cert` should be a either a PEM encoded certificate or a concatenation -of that with the CA certificate. `--key` should be the PEM encoded -private key and `--client-ca` should be the PEM encoded client +`--rc-cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--krc-ey` should be the PEM encoded +private key and `--rc-client-ca` should be the PEM encoded client certificate authority certificate. ---min-tls-version is minimum TLS version that is acceptable. Valid +--rc-min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). ### Template -`--template` allows a user to specify a custom markup template for HTTP +`--rc-template` allows a user to specify a custom markup template for HTTP and WebDAV serve functions. The server exports the following markup to be used within the template to server pages: @@ -95,14 +96,29 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or -set a single username and password with the `--user` and `--pass` flags. +set a single username and password with the `--rc-user` and `--rc-pass` flags. -Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + +Use `--rc-htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -114,9 +130,9 @@ To create an htpasswd file: The password file can be updated while rclone is running. -Use `--realm` to set the authentication realm. +Use `--rc-realm` to set the authentication realm. -Use `--salt` to change the password hashing salt from the default. +Use `--rc-salt` to change the password hashing salt from the default. ``` @@ -129,9 +145,45 @@ rclone rcd * [flags] -h, --help help for rcd ``` + +## RC Options + +Flags to control the Remote Control API. + +``` + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_rmdir.md b/docs/content/commands/rclone_rmdir.md index c8424e24a0ee5..72c41b722d780 100644 --- a/docs/content/commands/rclone_rmdir.md +++ b/docs/content/commands/rclone_rmdir.md @@ -3,6 +3,7 @@ title: "rclone rmdir" description: "Remove the empty directory at path." slug: rclone_rmdir url: /commands/rclone_rmdir/ +groups: Important # autogenerated - DO NOT EDIT, instead edit the source code in cmd/rmdir/ and as part of making a release run "make commanddocs" --- # rclone rmdir @@ -30,9 +31,20 @@ rclone rmdir remote:path [flags] -h, --help help for rmdir ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_rmdirs.md b/docs/content/commands/rclone_rmdirs.md index 22196b848ccdd..1a89a07269cc6 100644 --- a/docs/content/commands/rclone_rmdirs.md +++ b/docs/content/commands/rclone_rmdirs.md @@ -3,6 +3,7 @@ title: "rclone rmdirs" description: "Remove empty directories under the path." slug: rclone_rmdirs url: /commands/rclone_rmdirs/ +groups: Important versionIntroduced: v1.35 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/rmdirs/ and as part of making a release run "make commanddocs" --- @@ -26,7 +27,10 @@ empty directories in. For example the [delete](/commands/rclone_delete/) command will delete files but leave the directory structure (unless used with option `--rmdirs`). -To delete a path and any objects in it, use [purge](/commands/rclone_purge/) +This will delete `--checkers` directories concurrently so +if you have thousands of empty directories consider increasing this number. + +To delete a path and any objects in it, use the [purge](/commands/rclone_purge/) command. @@ -41,9 +45,20 @@ rclone rmdirs remote:path [flags] --leave-root Do not remove root directory if empty ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_selfupdate.md b/docs/content/commands/rclone_selfupdate.md index 8a12883ad4ad0..82994370ec51a 100644 --- a/docs/content/commands/rclone_selfupdate.md +++ b/docs/content/commands/rclone_selfupdate.md @@ -12,10 +12,10 @@ Update the rclone binary. ## Synopsis - -This command downloads the latest release of rclone and replaces -the currently running binary. The download is verified with a hashsum -and cryptographically signed signature. +This command downloads the latest release of rclone and replaces the +currently running binary. The download is verified with a hashsum and +cryptographically signed signature; see [the release signing +docs](/release_signing/) for details. If used without flags (or with implied `--stable` flag), this command will install the latest stable release. However, some issues may be fixed @@ -48,7 +48,7 @@ your OS) to update these too. This command with the default `--package zip` will update only the rclone executable so the local manual may become inaccurate after it. -The `rclone mount` command (https://rclone.org/commands/rclone_mount/) may +The [rclone mount](/commands/rclone_mount/) command may or may not support extended FUSE options depending on the build and OS. `selfupdate` will refuse to update if the capability would be discarded. @@ -77,9 +77,10 @@ rclone selfupdate [flags] --version string Install the given rclone version (default: latest) ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_serve.md b/docs/content/commands/rclone_serve.md index ff08cc8b77afa..211472b8993c6 100644 --- a/docs/content/commands/rclone_serve.md +++ b/docs/content/commands/rclone_serve.md @@ -30,16 +30,19 @@ rclone serve [opts] [flags] -h, --help help for serve ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone serve dlna](/commands/rclone_serve_dlna/) - Serve remote:path over DLNA * [rclone serve docker](/commands/rclone_serve_docker/) - Serve any remote on docker's volume plugin API. * [rclone serve ftp](/commands/rclone_serve_ftp/) - Serve remote:path over FTP. * [rclone serve http](/commands/rclone_serve_http/) - Serve the remote over HTTP. +* [rclone serve nfs](/commands/rclone_serve_nfs/) - Serve the remote as an NFS mount * [rclone serve restic](/commands/rclone_serve_restic/) - Serve the remote for restic's REST API. +* [rclone serve s3](/commands/rclone_serve_s3/) - Serve remote:path over s3. * [rclone serve sftp](/commands/rclone_serve_sftp/) - Serve the remote over SFTP. * [rclone serve webdav](/commands/rclone_serve_webdav/) - Serve remote:path over WebDAV. diff --git a/docs/content/commands/rclone_serve_dlna.md b/docs/content/commands/rclone_serve_dlna.md index 00718ef47a82b..abe864473a4cd 100644 --- a/docs/content/commands/rclone_serve_dlna.md +++ b/docs/content/commands/rclone_serve_dlna.md @@ -3,6 +3,7 @@ title: "rclone serve dlna" description: "Serve remote:path over DLNA" slug: rclone_serve_dlna url: /commands/rclone_serve_dlna/ +groups: Filter versionIntroduced: v1.46 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/dlna/ and as part of making a release run "make commanddocs" --- @@ -35,7 +36,6 @@ default "rclone (hostname)". Use `--log-trace` in conjunction with `-vv` to enable additional debug logging of all UPNP traffic. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -110,12 +110,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -132,10 +133,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -379,8 +392,9 @@ rclone serve dlna remote:path [flags] --read-only Only allow read-only access --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -390,14 +404,45 @@ rclone serve dlna remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_serve_docker.md b/docs/content/commands/rclone_serve_docker.md index a7d02fc0351f0..0366cf6c903a6 100644 --- a/docs/content/commands/rclone_serve_docker.md +++ b/docs/content/commands/rclone_serve_docker.md @@ -3,6 +3,7 @@ title: "rclone serve docker" description: "Serve any remote on docker's volume plugin API." slug: rclone_serve_docker url: /commands/rclone_serve_docker/ +groups: Filter versionIntroduced: v1.56 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/docker/ and as part of making a release run "make commanddocs" --- @@ -12,7 +13,6 @@ Serve any remote on docker's volume plugin API. ## Synopsis - This command implements the Docker volume plugin API allowing docker to use rclone as a data storage mechanism for various cloud providers. rclone provides [docker volume plugin](/docker) based on it. @@ -51,7 +51,6 @@ directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -126,12 +125,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -148,10 +148,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -398,6 +410,7 @@ rclone serve docker [flags] --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) -h, --help help for docker --max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki) + --mount-case-insensitive Tristate Tell the OS the mount is case insensitive (true) or sensitive (false) regardless of the backend (auto) (default unset) --network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only) --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) @@ -412,8 +425,9 @@ rclone serve docker [flags] --socket-gid int GID for unix socket (default: current process GID) (default 1000) --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -423,6 +437,7 @@ rclone serve docker [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -430,9 +445,39 @@ rclone serve docker [flags] --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_serve_ftp.md b/docs/content/commands/rclone_serve_ftp.md index 475e7bb2136e2..6ba8142e98027 100644 --- a/docs/content/commands/rclone_serve_ftp.md +++ b/docs/content/commands/rclone_serve_ftp.md @@ -3,6 +3,7 @@ title: "rclone serve ftp" description: "Serve remote:path over FTP." slug: rclone_serve_ftp url: /commands/rclone_serve_ftp/ +groups: Filter versionIntroduced: v1.44 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/ftp/ and as part of making a release run "make commanddocs" --- @@ -32,7 +33,6 @@ then using Authentication is advised - see the next section for info. By default this will serve files without needing a login. You can set a single username and password with the --user and --pass flags. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -107,12 +107,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -129,10 +130,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -460,8 +473,9 @@ rclone serve ftp remote:path [flags] --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication (default "anonymous") - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -471,14 +485,45 @@ rclone serve ftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_serve_http.md b/docs/content/commands/rclone_serve_http.md index 0986a93029d07..f599e5284cd57 100644 --- a/docs/content/commands/rclone_serve_http.md +++ b/docs/content/commands/rclone_serve_http.md @@ -3,6 +3,7 @@ title: "rclone serve http" description: "Serve the remote over HTTP." slug: rclone_serve_http url: /commands/rclone_serve_http/ +groups: Filter versionIntroduced: v1.39 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/http/ and as part of making a release run "make commanddocs" --- @@ -96,6 +97,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -103,6 +115,10 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the `--user` and `--pass` flags. +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -118,7 +134,6 @@ The password file can be updated while rclone is running. Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -193,12 +208,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -215,10 +231,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -527,6 +555,7 @@ rclone serve http remote:path [flags] ``` --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --auth-proxy string A program to use to create the backend from the auth --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) @@ -554,8 +583,9 @@ rclone serve http remote:path [flags] --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -565,14 +595,45 @@ rclone serve http remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_serve_nfs.md b/docs/content/commands/rclone_serve_nfs.md new file mode 100644 index 0000000000000..bbd28ccf825ee --- /dev/null +++ b/docs/content/commands/rclone_serve_nfs.md @@ -0,0 +1,450 @@ +--- +title: "rclone serve nfs" +description: "Serve the remote as an NFS mount" +slug: rclone_serve_nfs +url: /commands/rclone_serve_nfs/ +groups: Filter +versionIntroduced: v1.65 +# autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/nfs/ and as part of making a release run "make commanddocs" +--- +# rclone serve nfs + +Serve the remote as an NFS mount + +## Synopsis + +Create an NFS server that serves the given remote over the network. + +The primary purpose for this command is to enable [mount command](/commands/rclone_mount/) on recent macOS versions where +installing FUSE is very cumbersome. + +Since this is running on NFSv3, no authentication method is available. Any client +will be able to access the data. To limit access, you can use serve NFS on loopback address +and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; +meaning that it is only available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address and port using `--addr` flag. + +Modifying files through NFS protocol requires VFS caching. Usually you will need to specify `--vfs-cache-mode` +in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, +the mount will be read-only. + +To serve NFS over the network use following command: + + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full + +We specify a specific port that we can use in the mount command: + +To mount the server under Linux/macOS, use the following command: + + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint + +Where `$PORT` is the same port number we used in the serve nfs command. + +This feature is only available on Unix platforms. + +## VFS - Virtual File System + +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. + +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. + +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. + +## VFS Directory Cache + +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. + + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) + +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. + +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: + + kill -SIGHUP $(pidof rclone) + +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: + + rclone rc vfs/forget + +Or individual files or directories: + + rclone rc vfs/forget file=path/to/file dir=path/to/dir + +## VFS File Buffering + +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. + +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. + +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. + +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. + +## VFS File Caching + +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. + +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. + +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. + +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. + +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. + +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . + +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. + +### --vfs-cache-mode off + +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. + +This will mean some operations are not possible + + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried + +### --vfs-cache-mode minimal + +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. + +These operations are not possible + + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried + +### --vfs-cache-mode writes + +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. + +This mode should support all normal file system operations. + +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. + +### --vfs-cache-mode full + +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. + +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. + +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. + +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. + +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. + +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. + +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. + +### Fingerprinting + +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: + +- size +- modification time +- hash + +where available on an object. + +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). + +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. + +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. + +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. + +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. + +## VFS Chunked Reading + +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. + +These flags control the chunking: + + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) + +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. + +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. + +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. + +## VFS Performance + +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. + +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. + + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. + +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. + + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) + +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). + + --transfers int Number of file transfers to run in parallel (default 4) + +## VFS Case Sensitivity + +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. + +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. + +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. + +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. + +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. + +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. + +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". + +## VFS Disk Options + +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. + + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) + +## Alternate report of used bytes + +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. + +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. + + +``` +rclone serve nfs remote:path [flags] +``` + +## Options + +``` + --addr string IPaddress:Port or :Port to bind server to + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for nfs + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +``` + + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +See the [global flags page](/flags/) for global options not listed here. + +# SEE ALSO + +* [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. + diff --git a/docs/content/commands/rclone_serve_restic.md b/docs/content/commands/rclone_serve_restic.md index cbd8cd5ac18a5..60f5f9a99eca0 100644 --- a/docs/content/commands/rclone_serve_restic.md +++ b/docs/content/commands/rclone_serve_restic.md @@ -148,6 +148,10 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the `--user` and `--pass` flags. +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -173,6 +177,7 @@ rclone serve restic remote:path [flags] ``` --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --append-only Disallow deletion of repository data --baseurl string Prefix for URLs - leave blank for root --cache-objects Cache listed objects (default true) @@ -193,9 +198,10 @@ rclone serve restic remote:path [flags] --user string User name for authentication ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_serve_s3.md b/docs/content/commands/rclone_serve_s3.md new file mode 100644 index 0000000000000..986d311199799 --- /dev/null +++ b/docs/content/commands/rclone_serve_s3.md @@ -0,0 +1,597 @@ +--- +title: "rclone serve s3" +description: "Serve remote:path over s3." +slug: rclone_serve_s3 +url: /commands/rclone_serve_s3/ +groups: Filter +status: Experimental +versionIntroduced: v1.65 +# autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/s3/ and as part of making a release run "make commanddocs" +--- +# rclone serve s3 + +Serve remote:path over s3. + +## Synopsis + +`serve s3` implements a basic s3 server that serves a remote via s3. +This can be viewed with an s3 client, or you can make an [s3 type +remote](/s3/) to read and write to it with rclone. + +`serve s3` is considered **Experimental** so use with care. + +S3 server supports Signature Version 4 authentication. Just use +`--auth-key accessKey,secretKey` and set the `Authorization` +header correctly in the request. (See the [AWS +docs](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)). + +`--auth-key` can be repeated for multiple auth pairs. If +`--auth-key` is not provided then `serve s3` will allow anonymous +access. + +Please note that some clients may require HTTPS endpoints. See [the +SSL docs](#ssl-tls) for more information. + +This command uses the [VFS directory cache](#vfs-virtual-file-system). +All the functionality will work with `--vfs-cache-mode off`. Using +`--vfs-cache-mode full` (or `writes`) can be used to cache objects +locally to improve performance. + +Use `--force-path-style=false` if you want to use the bucket name as a +part of the hostname (such as mybucket.local) + +Use `--etag-hash` if you want to change the hash uses for the `ETag`. +Note that using anything other than `MD5` (the default) is likely to +cause problems for S3 clients which rely on the Etag being the MD5. + +## Quickstart + +For a simple set up, to serve `remote:path` over s3, run the server +like this: + +``` +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +``` + +This will be compatible with an rclone remote which is defined like this: + +``` +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +``` + +Note that setting `disable_multipart_uploads = true` is to work around +[a bug](#bugs) which will be fixed in due course. + +## Bugs + +When uploading multipart files `serve s3` holds all the parts in +memory (see [#7453](https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. + +Multipart server side copies do not work (see +[#7454](https://github.com/rclone/rclone/issues/7454)). These take a +very long time and eventually fail. The default threshold for +multipart server side copies is 5G which is the maximum it can be, so +files above this side will fail to be server side copied. + +For a current list of `serve s3` bugs see the [serve +s3](https://github.com/rclone/rclone/labels/serve%20s3) bug category +on GitHub. + +## Limitations + +`serve s3` will treat all directories in the root as buckets and +ignore all files in the root. You can use `CreateBucket` to create +folders under the root, but you can't create empty folders under other +folders not in the root. + +When using `PutObject` or `DeleteObject`, rclone will automatically +create or clean up empty folders. If you don't want to clean up empty +folders automatically, use `--no-cleanup`. + +When using `ListObjects`, rclone will use `/` when the delimiter is +empty. This reduces backend requests with no effect on most +operations, but if the delimiter is something other than `/` and +empty, rclone will do a full recursive search of the backend, which +can take some time. + +Versioning is not currently supported. + +Metadata will only be saved in memory other than the rclone `mtime` +metadata which will be set as the modification time of the file. + +## Supported operations + +`serve s3` currently supports the following operations. + +- Bucket + - `ListBuckets` + - `CreateBucket` + - `DeleteBucket` +- Object + - `HeadObject` + - `ListObjects` + - `GetObject` + - `PutObject` + - `DeleteObject` + - `DeleteObjects` + - `CreateMultipartUpload` + - `CompleteMultipartUpload` + - `AbortMultipartUpload` + - `CopyObject` + - `UploadPart` + +Other operations will return error `Unimplemented`. + +## Server options + +Use `--addr` to specify which IP address and port the server should +listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +IPs. By default it only listens on localhost. You can use port +:0 to let the OS choose an available port. + +If you set `--addr` to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. + +You can use a unix socket by setting the url to `unix:///path/to/socket` +or just by using an absolute path name. Note that unix sockets bypass the +authentication - this is expected to be done with file system permissions. + +`--addr` may be repeated to listen on multiple IPs/ports/sockets. + +`--server-read-timeout` and `--server-write-timeout` can be used to +control the timeouts on the server. Note that this is the total time +for a transfer. + +`--max-header-bytes` controls the maximum number of bytes the server will +accept in the HTTP header. + +`--baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--baseurl "/rclone"` then +rclone would serve from a URL starting with "/rclone/". This is +useful if you wish to proxy rclone serve. Rclone automatically +inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, +`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +identically. + +### TLS (SSL) + +By default this will serve over http. If you want you can serve over +https. You will need to supply the `--cert` and `--key` flags. +If you wish to do client side certificate validation then you will need to +supply `--client-ca` also. + +`--cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--key` should be the PEM encoded +private key and `--client-ca` should be the PEM encoded client +certificate authority certificate. + +--min-tls-version is minimum TLS version that is acceptable. Valid + values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default + "tls1.0"). +## VFS - Virtual File System + +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. + +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. + +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. + +## VFS Directory Cache + +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. + + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) + +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. + +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: + + kill -SIGHUP $(pidof rclone) + +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: + + rclone rc vfs/forget + +Or individual files or directories: + + rclone rc vfs/forget file=path/to/file dir=path/to/dir + +## VFS File Buffering + +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. + +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. + +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. + +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. + +## VFS File Caching + +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. + +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. + +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. + +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. + +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. + +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . + +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. + +### --vfs-cache-mode off + +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. + +This will mean some operations are not possible + + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried + +### --vfs-cache-mode minimal + +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. + +These operations are not possible + + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried + +### --vfs-cache-mode writes + +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. + +This mode should support all normal file system operations. + +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. + +### --vfs-cache-mode full + +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. + +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. + +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. + +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. + +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. + +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. + +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. + +### Fingerprinting + +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: + +- size +- modification time +- hash + +where available on an object. + +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). + +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. + +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. + +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. + +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. + +## VFS Chunked Reading + +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. + +These flags control the chunking: + + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) + +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. + +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. + +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. + +## VFS Performance + +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. + +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. + + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. + +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. + + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) + +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). + + --transfers int Number of file transfers to run in parallel (default 4) + +## VFS Case Sensitivity + +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. + +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. + +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. + +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. + +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. + +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. + +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". + +## VFS Disk Options + +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. + + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) + +## Alternate report of used bytes + +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. + +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. + + +``` +rclone serve s3 remote:path [flags] +``` + +## Options + +``` + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-key stringArray Set key pair for v4 authorization: access_key_id,secret_access_key + --baseurl string Prefix for URLs - leave blank for root + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --etag-hash string Which hash to use for the ETag, or auto or blank for off (default "MD5") + --file-perms FileMode File permissions (default 0666) + --force-path-style If true use path style access if false use virtual hosted style (default true) (default true) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for s3 + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --no-checksum Don't compare checksums on up/download + --no-cleanup Not to cleanup empty folder after object is deleted + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +``` + + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +See the [global flags page](/flags/) for global options not listed here. + +# SEE ALSO + +* [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. + diff --git a/docs/content/commands/rclone_serve_sftp.md b/docs/content/commands/rclone_serve_sftp.md index 1e878c058bd0e..9181e7be424e5 100644 --- a/docs/content/commands/rclone_serve_sftp.md +++ b/docs/content/commands/rclone_serve_sftp.md @@ -3,6 +3,7 @@ title: "rclone serve sftp" description: "Serve the remote over SFTP." slug: rclone_serve_sftp url: /commands/rclone_serve_sftp/ +groups: Filter versionIntroduced: v1.48 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/sftp/ and as part of making a release run "make commanddocs" --- @@ -59,12 +60,11 @@ which can lead to "corrupted on transfer" errors. This is the case because the client chooses indiscriminately which server to send commands to while the servers all have different views of the state of the filing system. -The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from beeing +The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being used. Omitting "restrict" and using `--sftp-path-override` to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -139,12 +139,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -161,10 +162,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -492,8 +505,9 @@ rclone serve sftp remote:path [flags] --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -503,14 +517,45 @@ rclone serve sftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_serve_webdav.md b/docs/content/commands/rclone_serve_webdav.md index 55bd16069980c..a2f6554b17a33 100644 --- a/docs/content/commands/rclone_serve_webdav.md +++ b/docs/content/commands/rclone_serve_webdav.md @@ -3,6 +3,7 @@ title: "rclone serve webdav" description: "Serve remote:path over WebDAV." slug: rclone_serve_webdav url: /commands/rclone_serve_webdav/ +groups: Filter versionIntroduced: v1.39 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/webdav/ and as part of making a release run "make commanddocs" --- @@ -125,6 +126,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -132,6 +144,10 @@ By default this will serve files without needing a login. You can either use an htpasswd file which can take lots of users, or set a single username and password with the `--user` and `--pass` flags. +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. + Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is in standard apache format and supports MD5, SHA1 and BCrypt for basic authentication. Bcrypt is recommended. @@ -147,7 +163,6 @@ The password file can be updated while rclone is running. Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -222,12 +237,13 @@ write simultaneously to a file. See below for more details. Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both. - --cache-dir string Directory rclone will use for caching. - --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) - --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s) - --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) - --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) - --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) If run with `-vv` rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but @@ -244,10 +260,22 @@ seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. -If using `--vfs-cache-max-size` note that the cache may exceed this size -for two reasons. Firstly because it is only checked every -`--vfs-cache-poll-interval`. Secondly because open files cannot be -evicted from the cache. +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . You **should not** run two copies of rclone using the same VFS cache with the same or overlapping remotes if using `--vfs-cache-mode > off`. @@ -556,6 +584,7 @@ rclone serve webdav remote:path [flags] ``` --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from --auth-proxy string A program to use to create the backend from the auth --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) @@ -585,8 +614,9 @@ rclone serve webdav remote:path [flags] --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) --user string User name for authentication - --vfs-cache-max-age Duration Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) --vfs-case-insensitive If a file name not found, find a case insensitive match @@ -596,14 +626,45 @@ rclone serve webdav remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. diff --git a/docs/content/commands/rclone_settier.md b/docs/content/commands/rclone_settier.md index b69f9f302803d..5bcf1425d748d 100644 --- a/docs/content/commands/rclone_settier.md +++ b/docs/content/commands/rclone_settier.md @@ -46,9 +46,10 @@ rclone settier tier remote:path [flags] -h, --help help for settier ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_sha1sum.md b/docs/content/commands/rclone_sha1sum.md index 3d02f6d41ab95..4992640ad09ef 100644 --- a/docs/content/commands/rclone_sha1sum.md +++ b/docs/content/commands/rclone_sha1sum.md @@ -3,6 +3,7 @@ title: "rclone sha1sum" description: "Produces an sha1sum file for all the objects in the path." slug: rclone_sha1sum url: /commands/rclone_sha1sum/ +groups: Filter,Listing versionIntroduced: v1.27 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/sha1sum/ and as part of making a release run "make commanddocs" --- @@ -48,9 +49,48 @@ rclone sha1sum remote:path [flags] --output-file string Output hashsums to a file rather than the terminal ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_size.md b/docs/content/commands/rclone_size.md index ad58f6f11e686..06858eb3b57e9 100644 --- a/docs/content/commands/rclone_size.md +++ b/docs/content/commands/rclone_size.md @@ -3,6 +3,7 @@ title: "rclone size" description: "Prints the total size and number of objects in remote:path." slug: rclone_size url: /commands/rclone_size/ +groups: Filter,Listing versionIntroduced: v1.23 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/size/ and as part of making a release run "make commanddocs" --- @@ -26,7 +27,7 @@ recursion. Some backends do not always provide file sizes, see for example [Google Photos](/googlephotos/#size) and -[Google Drive](/drive/#limitations-of-google-docs). +[Google Docs](/drive/#limitations-of-google-docs). Rclone will then show a notice in the log indicating how many such files were encountered, and count them in as empty files in the output of the size command. @@ -43,9 +44,48 @@ rclone size remote:path [flags] --json Format output as JSON ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_sync.md b/docs/content/commands/rclone_sync.md index ef888c4922df6..8096e01c3ebec 100644 --- a/docs/content/commands/rclone_sync.md +++ b/docs/content/commands/rclone_sync.md @@ -3,6 +3,7 @@ title: "rclone sync" description: "Make source and dest identical, modifying destination only." slug: rclone_sync url: /commands/rclone_sync/ +groups: Sync,Copy,Filter,Listing,Important # autogenerated - DO NOT EDIT, instead edit the source code in cmd/sync/ and as part of making a release run "make commanddocs" --- # rclone sync @@ -59,9 +60,114 @@ rclone sync source:path dest:path [flags] -h, --help help for sync ``` + +## Copy Options + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + +## Sync Options + +Flags just used for `rclone sync`. + +``` + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") +``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_test.md b/docs/content/commands/rclone_test.md index 4eed2b262e958..aa0f9a114e3f0 100644 --- a/docs/content/commands/rclone_test.md +++ b/docs/content/commands/rclone_test.md @@ -14,7 +14,7 @@ Run a test command Rclone test is used to run test commands. -Select which test comand you want with the subcommand, eg +Select which test command you want with the subcommand, eg rclone test memory remote: @@ -30,9 +30,10 @@ so reading their documentation first is recommended. -h, --help help for test ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. * [rclone test changenotify](/commands/rclone_test_changenotify/) - Log any change notify requests for the remote passed in. diff --git a/docs/content/commands/rclone_test_changenotify.md b/docs/content/commands/rclone_test_changenotify.md index 1f87bc68240e0..3b5b192af00da 100644 --- a/docs/content/commands/rclone_test_changenotify.md +++ b/docs/content/commands/rclone_test_changenotify.md @@ -21,9 +21,10 @@ rclone test changenotify remote: [flags] --poll-interval Duration Time to wait between polling for changes (default 10s) ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone test](/commands/rclone_test/) - Run a test command diff --git a/docs/content/commands/rclone_test_histogram.md b/docs/content/commands/rclone_test_histogram.md index 493007d99bb86..9a9e2d875a0f0 100644 --- a/docs/content/commands/rclone_test_histogram.md +++ b/docs/content/commands/rclone_test_histogram.md @@ -29,9 +29,10 @@ rclone test histogram [remote:path] [flags] -h, --help help for histogram ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone test](/commands/rclone_test/) - Run a test command diff --git a/docs/content/commands/rclone_test_info.md b/docs/content/commands/rclone_test_info.md index 1a16e62423381..7cef53bd97571 100644 --- a/docs/content/commands/rclone_test_info.md +++ b/docs/content/commands/rclone_test_info.md @@ -28,6 +28,7 @@ rclone test info [remote:path]+ [flags] ``` --all Run all tests + --check-base32768 Check can store all possible base32768 characters --check-control Check control characters --check-length Check max filename length --check-normalization Check UTF-8 Normalization @@ -37,9 +38,10 @@ rclone test info [remote:path]+ [flags] --write-json string Write results to file ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone test](/commands/rclone_test/) - Run a test command diff --git a/docs/content/commands/rclone_test_makefile.md b/docs/content/commands/rclone_test_makefile.md index 4eb0977e31634..195fb8fd696de 100644 --- a/docs/content/commands/rclone_test_makefile.md +++ b/docs/content/commands/rclone_test_makefile.md @@ -26,9 +26,10 @@ rclone test makefile []+ [flags] --zero Fill files with ASCII 0x00 ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone test](/commands/rclone_test/) - Run a test command diff --git a/docs/content/commands/rclone_test_makefiles.md b/docs/content/commands/rclone_test_makefiles.md index 4211bed963d56..d2b0304fcbba8 100644 --- a/docs/content/commands/rclone_test_makefiles.md +++ b/docs/content/commands/rclone_test_makefiles.md @@ -33,9 +33,10 @@ rclone test makefiles [flags] --zero Fill files with ASCII 0x00 ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone test](/commands/rclone_test/) - Run a test command diff --git a/docs/content/commands/rclone_test_memory.md b/docs/content/commands/rclone_test_memory.md index 5d527fe20d6ba..49141e14ce629 100644 --- a/docs/content/commands/rclone_test_memory.md +++ b/docs/content/commands/rclone_test_memory.md @@ -20,9 +20,10 @@ rclone test memory remote:path [flags] -h, --help help for memory ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone test](/commands/rclone_test/) - Run a test command diff --git a/docs/content/commands/rclone_touch.md b/docs/content/commands/rclone_touch.md index 4c110248a9923..b44925414c8d9 100644 --- a/docs/content/commands/rclone_touch.md +++ b/docs/content/commands/rclone_touch.md @@ -3,6 +3,7 @@ title: "rclone touch" description: "Create new file or change file modification time." slug: rclone_touch url: /commands/rclone_touch/ +groups: Filter,Listing,Important versionIntroduced: v1.39 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/touch/ and as part of making a release run "make commanddocs" --- @@ -48,9 +49,58 @@ rclone touch remote:path [flags] -t, --timestamp string Use specified time instead of the current time of day ``` + +## Important Options + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_tree.md b/docs/content/commands/rclone_tree.md index 277f05e80b733..0151979042aeb 100644 --- a/docs/content/commands/rclone_tree.md +++ b/docs/content/commands/rclone_tree.md @@ -3,6 +3,7 @@ title: "rclone tree" description: "List the contents of the remote in a tree like fashion." slug: rclone_tree url: /commands/rclone_tree/ +groups: Filter,Listing versionIntroduced: v1.38 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/tree/ and as part of making a release run "make commanddocs" --- @@ -69,9 +70,48 @@ rclone tree remote:path [flags] --version Sort files alphanumerically by version ``` + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +## Listing Options + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/commands/rclone_version.md b/docs/content/commands/rclone_version.md index c2d424ee3e74a..d62ddf60bf4bc 100644 --- a/docs/content/commands/rclone_version.md +++ b/docs/content/commands/rclone_version.md @@ -62,9 +62,10 @@ rclone version [flags] -h, --help help for version ``` + See the [global flags page](/flags/) for global options not listed here. -## SEE ALSO +# SEE ALSO * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. diff --git a/docs/content/contact.md b/docs/content/contact.md index 62c7f7e7ef224..63e854090ae73 100644 --- a/docs/content/contact.md +++ b/docs/content/contact.md @@ -3,31 +3,42 @@ title: "Contact" description: "Contact the rclone project" --- -# Contact the rclone project # +# Contact the rclone project -## Forum ## +## Forum Forum for questions and general discussion: - * https://forum.rclone.org +- https://forum.rclone.org -## GitHub repository ## +## Business support + +For business support or sponsorship enquiries please see: + +- https://rclone.com/ +- sponsorship@rclone.com + +## GitHub repository The project's repository is located at: - * https://github.com/rclone/rclone +- https://github.com/rclone/rclone There you can file bug reports or contribute with pull requests. -## Twitter ## +## Twitter -You can also follow me on twitter for rclone announcements: +You can also follow Nick on twitter for rclone announcements: - * [@njcw](https://twitter.com/njcw) +- [@njcw](https://twitter.com/njcw) -## Email ## +## Email Or if all else fails or you want to ask something private or -confidential email [Nick Craig-Wood](mailto:nick@craig-wood.com). -Please don't email me requests for help - those are better directed to -the forum. Thanks! +confidential + +- info@rclone.com + +Please don't email requests for help to this address - those are +better directed to the forum unless you'd like to sign up for business +support. diff --git a/docs/content/crypt.md b/docs/content/crypt.md index 6bc73dfe93e6a..269e26fed5392 100644 --- a/docs/content/crypt.md +++ b/docs/content/crypt.md @@ -379,7 +379,7 @@ address this problem to a certain degree. For cloud storage systems with case sensitive file names (e.g. Google Drive), `base64` can be used to reduce file name length. For cloud storage systems using UTF-16 to store file names internally -(e.g. OneDrive), `base32768` can be used to drastically reduce +(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce file name length. An alternative, future rclone file name encryption mode may tolerate @@ -405,7 +405,7 @@ Example: `1/12/qgm4avr35m5loi1th53ato71v0` -### Modified time and hashes +### Modification times and hashes Crypt stores modification times using the underlying remote so support depends on that. @@ -414,7 +414,7 @@ Hashes are not stored for crypt. However the data integrity is protected by an extremely strong crypto authenticator. Use the `rclone cryptcheck` command to check the -integrity of a crypted remote instead of `rclone check` which can't +integrity of an encrypted remote instead of `rclone check` which can't check the checksums properly. {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/crypt/crypt.go then run make backenddocs" >}} @@ -454,7 +454,7 @@ Properties: - Very simple filename obfuscation. - "off" - Don't encrypt the file names. - - Adds a ".bin" extension only. + - Adds a ".bin", or "suffix" extension only. #### --crypt-directory-name-encryption @@ -509,6 +509,8 @@ Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). #### --crypt-server-side-across-configs +Deprecated: use --server-side-across-configs instead. + Allow server-side operations (e.g. copy) to work across different crypt configs. Normally this option is not what you want, but if you have two crypts @@ -562,6 +564,21 @@ Properties: - "false" - Encrypt file data. +#### --crypt-pass-bad-blocks + +If set this will pass bad blocks through as all 0. + +This should not be set in normal operation, it should only be set if +trying to recover an encrypted file with errors and it is desired to +recover as much of the file as possible. + +Properties: + +- Config: pass_bad_blocks +- Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS +- Type: bool +- Default: false + #### --crypt-filename-encoding How to encode the encrypted filename to text string. @@ -583,7 +600,21 @@ Properties: - Encode using base64. Suitable for case sensitive remote. - "base32768" - Encode using base32768. Suitable if your remote counts UTF-16 or - - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive) + - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) + +#### --crypt-suffix + +If this is set it will override the default suffix of ".bin". + +Setting suffix to "none" will result in an empty suffix. This may be useful +when the path length is critical. + +Properties: + +- Config: suffix +- Env Var: RCLONE_CRYPT_SUFFIX +- Type: string +- Default: ".bin" ### Metadata @@ -640,9 +671,9 @@ Usage Example: {{< rem autogenerated options stop >}} -## Backing up a crypted remote +## Backing up an encrypted remote -If you wish to backup a crypted remote, it is recommended that you use +If you wish to backup an encrypted remote, it is recommended that you use `rclone sync` on the encrypted files, and make sure the passwords are the same in the new encrypted remote. @@ -681,7 +712,7 @@ has a header and is divided into chunks. The initial nonce is generated from the operating systems crypto strong random number generator. The nonce is incremented for each chunk read making sure each nonce is unique for each block written. -The chance of a nonce being re-used is minuscule. If you wrote an +The chance of a nonce being reused is minuscule. If you wrote an exabyte of data (10¹⁸ bytes) you would have a probability of approximately 2×10⁻³² of re-using a nonce. diff --git a/docs/content/docs.md b/docs/content/docs.md index 5a9f441fbb465..30b2a5fbba6e2 100644 --- a/docs/content/docs.md +++ b/docs/content/docs.md @@ -54,18 +54,23 @@ See the following for detailed instructions for * [Internet Archive](/internetarchive/) * [Jottacloud](/jottacloud/) * [Koofr](/koofr/) + * [Linkbox](/linkbox/) * [Mail.ru Cloud](/mailru/) * [Mega](/mega/) * [Memory](/memory/) * [Microsoft Azure Blob Storage](/azureblob/) + * [Microsoft Azure Files Storage](/azurefiles/) * [Microsoft OneDrive](/onedrive/) - * [OpenStack Swift / Rackspace Cloudfiles / Memset Memstore](/swift/) + * [OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset Memstore](/swift/) * [OpenDrive](/opendrive/) * [Oracle Object Storage](/oracleobjectstorage/) * [Pcloud](/pcloud/) + * [PikPak](/pikpak/) * [premiumize.me](/premiumizeme/) * [put.io](/putio/) + * [Proton Drive](/protondrive/) * [QingStor](/qingstor/) + * [Quatrix by Maytech](/quatrix/) * [Seafile](/seafile/) * [SFTP](/sftp/) * [Sia](/sia/) @@ -350,6 +355,10 @@ possible to write in all of them. This is mostly a problem on Windows, where the console traditionally uses a non-Unicode character set - defined by the so-called "code page". +Do not use single character names on Windows as it creates ambiguity with Windows +drives' names, e.g.: remote called `C` is indistinguishable from `C` drive. Rclone +will always assume that single letter name refers to a drive. + Quoting and the shell --------------------- @@ -466,6 +475,10 @@ Note that arbitrary metadata may be added to objects using the `--metadata-set key=value` flag when the object is first uploaded. This flag can be repeated as many times as necessary. +The [--metadata-mapper](#metadata-mapper) flag can be used to pass the +name of a program in which can transform metadata when it is being +copied from source to destination. + ### Types of metadata Metadata is divided into two type. System metadata and User metadata. @@ -543,6 +556,7 @@ backend may implement. | atime | Time of last access: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | | mtime | Time of last modification: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | | btime | Time of file creation (birth): RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| utime | Time of file upload: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | | cache-control | Cache-Control header | no-cache | | content-disposition | Content-Disposition header | inline | | content-encoding | Content-Encoding header | gzip | @@ -640,6 +654,9 @@ IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If the host name doesn't resolve or resolves to more than one IP address it will give an error. +You can use `--bind 0.0.0.0` to force rclone to use IPv4 addresses and +`--bind ::0` to force rclone to use IPv6 addresses. + ### --bwlimit=BANDWIDTH_SPEC ### This option controls the bandwidth limit. For example @@ -840,7 +857,7 @@ they are incorrect as it would normally. ### --color WHEN ### -Specifiy when colors (and other ANSI codes) should be added to the output. +Specify when colors (and other ANSI codes) should be added to the output. `AUTO` (default) only allows ANSI codes when the output is a terminal @@ -947,6 +964,22 @@ You may also choose to [encrypt](#configuration-encryption) the file. When token-based authentication are used, the configuration file must be writable, because rclone needs to update the tokens inside it. +To reduce risk of corrupting an existing configuration file, rclone +will not write directly to it when saving changes. Instead it will +first write to a new, temporary, file. If a configuration file already +existed, it will (on Unix systems) try to mirror its permissions to +the new file. Then it will rename the existing file to a temporary +name as backup. Next, rclone will rename the new file to the correct name, +before finally cleaning up by deleting the backup file. + +If the configuration file path used by rclone is a symbolic link, then +this will be evaluated and rclone will write to the resolved path, instead +of overwriting the symbolic link. Temporary files used in the process +(described above) will be written to the same parent directory as that +of the resolved configuration file, but if this directory is also a +symbolic link it will not be resolved and the temporary files will be +written to the location of the directory symbolic link. + ### --contimeout=TIME ### Set the connection timeout. This should be in go time format which @@ -975,6 +1008,18 @@ Mode to run dedupe command in. One of `interactive`, `skip`, `first`, `newest`, `oldest`, `rename`. The default is `interactive`. See the dedupe command for more information as to what these options mean. +### --default-time TIME ### + +If a file or directory does have a modification time rclone can read +then rclone will display this fixed time instead. + +The default is `2000-01-01 00:00:00 UTC`. This can be configured in +any of the ways shown in [the time or duration options](#time-option). + +For example `--default-time 2020-06-01` to set the default time to the +1st of June 2020 or `--default-time 0s` to set the default time to the +time rclone started up. + ### --disable FEATURE,FEATURE,... ### This disables a comma separated list of optional features. For example @@ -988,10 +1033,24 @@ To see a list of which features can be disabled use: --disable help +The features a remote has can be seen in JSON format with: + + rclone backend features remote: + See the overview [features](/overview/#features) and [optional features](/overview/#optional-features) to get an idea of which feature does what. +Note that some features can be set to `true` if they are `true`/`false` +feature flag features by prefixing them with `!`. For example the +`CaseInsensitive` feature can be forced to `false` with `--disable CaseInsensitive` +and forced to `true` with `--disable '!CaseInsensitive'`. In general +it isn't a good idea doing this but it may be useful in extremis. + +(Note that `!` is a shell command which you will +need to escape with single quotes or a backslash on unix like +platforms.) + This flag can be useful for debugging and in exceptional circumstances (e.g. Google Drive limiting the total volume of Server Side Copies to 100 GiB/day). @@ -1214,6 +1273,50 @@ This can be useful as an additional layer of protection for immutable or append-only data sets (notably backup archives), where modification implies corruption and should not be propagated. +### --inplace {#inplace} + +The `--inplace` flag changes the behaviour of rclone when uploading +files to some backends (backends with the `PartialUploads` feature +flag set) such as: + +- local +- ftp +- sftp + +Without `--inplace` (the default) rclone will first upload to a +temporary file with an extension like this, where `XXXXXX` represents a +random string and `.partial` is [--partial-suffix](#partial-suffix) value +(`.partial` by default). + + original-file-name.XXXXXX.partial + +(rclone will make sure the final name is no longer than 100 characters +by truncating the `original-file-name` part if necessary). + +When the upload is complete, rclone will rename the `.partial` file to +the correct name, overwriting any existing file at that point. If the +upload fails then the `.partial` file will be deleted. + +This prevents other users of the backend from seeing partially +uploaded files in their new names and prevents overwriting the old +file until the new one is completely uploaded. + +If the `--inplace` flag is supplied, rclone will upload directly to +the final name without creating a `.partial` file. + +This means that an incomplete file will be visible in the directory +listings while the upload is in progress and any existing files will +be overwritten as soon as the upload starts. If the transfer fails +then the file will be deleted. This can cause data loss of the +existing file if the transfer fails. + +Note that on the local file system if you don't use `--inplace` hard +links (Unix only) will be broken. And if you do use `--inplace` you +won't be able to update in use executables. + +Note also that versions of rclone prior to v1.63.0 behave as if the +`--inplace` flag is always supplied. + ### -i, --interactive {#interactive} This flag can be used to tell rclone that you wish a manual @@ -1368,14 +1471,14 @@ what will happen. ### --max-duration=TIME ### -Rclone will stop scheduling new transfers when it has run for the +Rclone will stop transferring when it has run for the duration specified. - Defaults to off. -When the limit is reached any existing transfers will complete. +When the limit is reached all transfers will stop immediately. +Use `--cutoff-mode` to modify this behaviour. -Rclone won't exit with an error if the transfer limit is reached. +Rclone will exit with exit code 10 if the duration limit is reached. ### --max-transfer=SIZE ### @@ -1383,24 +1486,13 @@ Rclone will stop transferring when it has reached the size specified. Defaults to off. When the limit is reached all transfers will stop immediately. +Use `--cutoff-mode` to modify this behaviour. Rclone will exit with exit code 8 if the transfer limit is reached. -## -M, --metadata - -Setting this flag enables rclone to copy the metadata from the source -to the destination. For local backends this is ownership, permissions, -xattr etc. See the [#metadata](metadata section) for more info. - -### --metadata-set key=value - -Add metadata `key` = `value` when uploading. This can be repeated as -many times as required. See the [#metadata](metadata section) for more -info. - ### --cutoff-mode=hard|soft|cautious ### -This modifies the behavior of `--max-transfer` +This modifies the behavior of `--max-transfer` and `--max-duration` Defaults to `--cutoff-mode=hard`. Specifying `--cutoff-mode=hard` will stop transferring immediately @@ -1410,7 +1502,130 @@ Specifying `--cutoff-mode=soft` will stop starting new transfers when Rclone reaches the limit. Specifying `--cutoff-mode=cautious` will try to prevent Rclone -from reaching the limit. +from reaching the limit. Only applicable for `--max-transfer` + +## -M, --metadata + +Setting this flag enables rclone to copy the metadata from the source +to the destination. For local backends this is ownership, permissions, +xattr etc. See the [metadata section](#metadata) for more info. + +### --metadata-mapper SpaceSepList {#metadata-mapper} + +If you supply the parameter `--metadata-mapper /path/to/program` then +rclone will use that program to map metadata from source object to +destination object. + +The argument to this flag should be a command with an optional space separated +list of arguments. If one of the arguments has a space in then enclose +it in `"`, if you want a literal `"` in an argument then enclose the +argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) +for more info. + + --metadata-mapper "python bin/test_metadata_mapper.py" + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"' + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"' + +This uses a simple JSON based protocol with input on STDIN and output +on STDOUT. This will be called for every file and directory copied and +may be called concurrently. + +The program's job is to take a metadata blob on the input and turn it +into a metadata blob on the output suitable for the destination +backend. + +Input to the program (via STDIN) might look like this. This provides +some context for the `Metadata` which may be important. + +- `SrcFs` is the config string for the remote that the object is currently on. +- `SrcFsType` is the name of the source backend. +- `DstFs` is the config string for the remote that the object is being copied to +- `DstFsType` is the name of the destination backend. +- `Remote` is the path of the file relative to the root. +- `Size`, `MimeType`, `ModTime` are attributes of the file. +- `IsDir` is `true` if this is a directory (not yet implemented). +- `ID` is the source `ID` of the file if known. +- `Metadata` is the backend specific metadata as described in the backend docs. + +```json +{ + "SrcFs": "gdrive:", + "SrcFsType": "drive", + "DstFs": "newdrive:user", + "DstFsType": "onedrive", + "Remote": "test.txt", + "Size": 6, + "MimeType": "text/plain; charset=utf-8", + "ModTime": "2022-10-11T17:53:10.286745272+01:00", + "IsDir": false, + "ID": "xyz", + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain1.com", + "permissions": "...", + "description": "my nice file", + "starred": "false" + } +} +``` + +The program should then modify the input as desired and send it to +STDOUT. The returned `Metadata` field will be used in its entirety for +the destination object. Any other fields will be ignored. Note in this +example we translate user names and permissions and add something to +the description: + +```json +{ + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain2.com", + "permissions": "...", + "description": "my nice file [migrated from domain1]", + "starred": "false" + } +} +``` + +Metadata can be removed here too. + +An example python program might look something like this to implement +the above transformations. + +```python +import sys, json + +i = json.load(sys.stdin) +metadata = i["Metadata"] +# Add tag to description +if "description" in metadata: + metadata["description"] += " [migrated from domain1]" +else: + metadata["description"] = "[migrated from domain1]" +# Modify owner +if "owner" in metadata: + metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com") +o = { "Metadata": metadata } +json.dump(o, sys.stdout, indent="\t") +``` + +You can find this example (slightly expanded) in the rclone source code at +[bin/test_metadata_mapper.py](https://github.com/rclone/rclone/blob/master/test_metadata_mapper.py). + +If you want to see the input to the metadata mapper and the output +returned from it in the log you can use `-vv --dump mapper`. + +See the [metadata section](#metadata) for more info. + +### --metadata-set key=value + +Add metadata `key` = `value` when uploading. This can be repeated as +many times as required. See the [metadata section](#metadata) for more +info. ### --modify-window=TIME ### @@ -1425,58 +1640,85 @@ if you are reading and writing to an OS X filing system this will be This command line flag allows you to override that computed default. -### --multi-thread-cutoff=SIZE ### +### --multi-thread-write-buffer-size=SIZE ### -When downloading files to the local backend above this size, rclone -will use multiple threads to download the file (default 250M). +When transferring with multiple threads, rclone will buffer SIZE bytes +in memory before writing to disk for each thread. -Rclone preallocates the file (using `fallocate(FALLOC_FL_KEEP_SIZE)` -on unix or `NTSetInformationFile` on Windows both of which takes no -time) then each thread writes directly into the file at the correct -place. This means that rclone won't create fragmented or sparse files -and there won't be any assembly time at the end of the transfer. +This can improve performance if the underlying filesystem does not deal +well with a lot of small writes in different positions of the file, so +if you see transfers being limited by disk write speed, you might want +to experiment with different values. Specially for magnetic drives and +remote file systems a higher value can be useful. -The number of threads used to download is controlled by +Nevertheless, the default of `128k` should be fine for almost all use +cases, so before changing it ensure that network is not really your +bottleneck. + +As a final hint, size is not the only factor: block size (or similar +concept) can have an impact. In one case, we observed that exact +multiples of 16k performed much better than other values. + +### --multi-thread-chunk-size=SizeSuffix ### + +Normally the chunk size for multi thread transfers is set by the backend. +However some backends such as `local` and `smb` (which implement `OpenWriterAt` +but not `OpenChunkWriter`) don't have a natural chunk size. + +In this case the value of this option is used (default 64Mi). + +### --multi-thread-cutoff=SIZE {#multi-thread-cutoff} + +When transferring files above SIZE to capable backends, rclone will +use multiple threads to transfer the file (default 256M). + +Capable backends are marked in the +[overview](/overview/#optional-features) as `MultithreadUpload`. (They +need to implement either the `OpenWriterAt` or `OpenChunkedWriter` +internal interfaces). These include include, `local`, `s3`, +`azureblob`, `b2`, `oracleobjectstorage` and `smb` at the time of +writing. + +On the local disk, rclone preallocates the file (using +`fallocate(FALLOC_FL_KEEP_SIZE)` on unix or `NTSetInformationFile` on +Windows both of which takes no time) then each thread writes directly +into the file at the correct place. This means that rclone won't +create fragmented or sparse files and there won't be any assembly time +at the end of the transfer. + +The number of threads used to transfer is controlled by `--multi-thread-streams`. Use `-vv` if you wish to see info about the threads. This will work with the `sync`/`copy`/`move` commands and friends -`copyto`/`moveto`. Multi thread downloads will be used with `rclone +`copyto`/`moveto`. Multi thread transfers will be used with `rclone mount` and `rclone serve` if `--vfs-cache-mode` is set to `writes` or above. -**NB** that this **only** works for a local destination but will work -with any source. +**NB** that this **only** works with supported backends as the +destination but will work with any backend as the source. -**NB** that multi thread copies are disabled for local to local copies +**NB** that multi-thread copies are disabled for local to local copies as they are faster without unless `--multi-thread-streams` is set explicitly. -**NB** on Windows using multi-thread downloads will cause the -resulting files to be [sparse](https://en.wikipedia.org/wiki/Sparse_file). +**NB** on Windows using multi-thread transfers to the local disk will +cause the resulting files to be [sparse](https://en.wikipedia.org/wiki/Sparse_file). Use `--local-no-sparse` to disable sparse files (which may cause long -delays at the start of downloads) or disable multi-thread downloads +delays at the start of transfers) or disable multi-thread transfers with `--multi-thread-streams 0` ### --multi-thread-streams=N ### -When using multi thread downloads (see above `--multi-thread-cutoff`) -this sets the maximum number of streams to use. Set to `0` to disable -multi thread downloads (Default 4). - -Exactly how many streams rclone uses for the download depends on the -size of the file. To calculate the number of download streams Rclone -divides the size of the file by the `--multi-thread-cutoff` and rounds -up, up to the maximum set with `--multi-thread-streams`. +When using multi thread transfers (see above `--multi-thread-cutoff`) +this sets the number of streams to use. Set to `0` to disable multi +thread transfers (Default 4). -So if `--multi-thread-cutoff 250M` and `--multi-thread-streams 4` are -in effect (the defaults): - -- 0..250 MiB files will be downloaded with 1 stream -- 250..500 MiB files will be downloaded with 2 streams -- 500..750 MiB files will be downloaded with 3 streams -- 750+ MiB files will be downloaded with 4 streams +If the backend has a `--backend-upload-concurrency` setting (eg +`--s3-upload-concurrency`) then this setting will be used as the +number of transfers instead if it is larger than the value of +`--multi-thread-streams` or `--multi-thread-streams` isn't set. ### --no-check-dest ### @@ -1602,6 +1844,15 @@ If you want perfect ordering then you will need to specify [--check-first](#check-first) which will find all the files which need transferring first before transferring any. +### --partial-suffix {#partial-suffix} + +When [--inplace](#inplace) is not used, it causes rclone to use +the `--partial-suffix` as suffix for temporary files. + +Suffix length limit is 16 characters. + +The default is `.partial`. + ### --password-command SpaceSepList ### This flag supplies a program which should supply the config password @@ -1616,9 +1867,9 @@ for more info. Eg - --password-command echo hello - --password-command echo "hello with space" - --password-command echo "hello with ""quotes"" and space" + --password-command "echo hello" + --password-command 'echo "hello with space"' + --password-command 'echo "hello with ""quotes"" and space"' See the [Configuration Encryption](#configuration-encryption) for more info. @@ -1826,6 +2077,12 @@ would be backed up to `file.txt-2019-01-01` and with the flag it would be backed up to `file-2019-01-01.txt`. This can be helpful to make sure the suffixed files can still be opened. +If a file has two (or more) extensions and the second (or subsequent) +extension is recognised as a valid mime type, then the suffix will go +before that extension. So `file.tar.gz` would be backed up to +`file-2019-01-01.tar.gz` whereas `file.badextension.gz` would be +backed up to `file.badextension-2019-01-01.gz`. + ### --syslog ### On capable OSes (not Windows or Plan9) send all log output to syslog. @@ -1981,34 +2238,50 @@ there were IO errors`. ### --fast-list ### When doing anything which involves a directory listing (e.g. `sync`, -`copy`, `ls` - in fact nearly every command), rclone normally lists a -directory and processes it before using more directory lists to -process any subdirectories. This can be parallelised and works very -quickly using the least amount of memory. - -However, some remotes have a way of listing all files beneath a -directory in one (or a small number) of transactions. These tend to -be the bucket-based remotes (e.g. S3, B2, GCS, Swift). - -If you use the `--fast-list` flag then rclone will use this method for -listing directories. This will have the following consequences for -the listing: - - * It **will** use fewer transactions (important if you pay for them) - * It **will** use more memory. Rclone has to load the whole listing into memory. - * It *may* be faster because it uses fewer transactions - * It *may* be slower because it can't be parallelized - -rclone should always give identical results with and without -`--fast-list`. - -If you pay for transactions and can fit your entire sync listing into -memory then `--fast-list` is recommended. If you have a very big sync -to do then don't use `--fast-list` otherwise you will run out of -memory. - -If you use `--fast-list` on a remote which doesn't support it, then -rclone will just ignore it. +`copy`, `ls` - in fact nearly every command), rclone has different +strategies to choose from. + +The basic strategy is to list one directory and processes it before using +more directory lists to process any subdirectories. This is a mandatory +backend feature, called `List`, which means it is supported by all backends. +This strategy uses small amount of memory, and because it can be parallelised +it is fast for operations involving processing of the list results. + +Some backends provide the support for an alternative strategy, where all +files beneath a directory can be listed in one (or a small number) of +transactions. Rclone supports this alternative strategy through an optional +backend feature called [`ListR`](/overview/#listr). You can see in the storage +system overview documentation's [optional features](/overview/#optional-features) +section which backends it is enabled for (these tend to be the bucket-based +ones, e.g. S3, B2, GCS, Swift). This strategy requires fewer transactions +for highly recursive operations, which is important on backends where this +is charged or heavily rate limited. It may be faster (due to fewer transactions) +or slower (because it can't be parallelized) depending on different parameters, +and may require more memory if rclone has to keep the whole listing in memory. + +Which listing strategy rclone picks for a given operation is complicated, but +in general it tries to choose the best possible. It will prefer `ListR` in +situations where it doesn't need to store the listed files in memory, e.g. +for unlimited recursive `ls` command variants. In other situations it will +prefer `List`, e.g. for `sync` and `copy`, where it needs to keep the listed +files in memory, and is performing operations on them where parallelization +may be a huge advantage. + +Rclone is not able to take all relevant parameters into account for deciding +the best strategy, and therefore allows you to influence the choice in two ways: +You can stop rclone from using `ListR` by disabling the feature, using the +[--disable](#disable-feature-feature) option (`--disable ListR`), or you can +allow rclone to use `ListR` where it would normally choose not to do so due to +higher memory usage, using the `--fast-list` option. Rclone should always +produce identical results either way. Using `--disable ListR` or `--fast-list` +on a remote which doesn't support `ListR` does nothing, rclone will just ignore +it. + +A rule of thumb is that if you pay for transactions and can fit your entire +sync listing into memory, then `--fast-list` is recommended. If you have a +very big sync to do, then don't use `--fast-list`, otherwise you will run out +of memory. Run some tests and compare before you decide, and if in doubt then +just leave the default, let rclone decide, i.e. not use `--fast-list`. ### --timeout=TIME ### @@ -2345,6 +2618,12 @@ This dumps a list of the open files at the end of the command. It uses the `lsof` command to do that so you'll need that installed to use it. +#### --dump mapper #### + +This shows the JSON blobs being sent to the program supplied with +`--metadata-mapper` and received from it. It can be useful for +debugging the metadata mapper interface. + ### --memprofile=FILE ### Write memory profile to file. This can be analysed with `go tool pprof`. @@ -2450,6 +2729,7 @@ it will log a high priority message if the retry was successful. * `7` - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors) * `8` - Transfer exceeded - limit set by --max-transfer reached * `9` - Operation successful, but no files transferred + * `10` - Duration exceeded - limit set by --max-duration reached Environment Variables --------------------- @@ -2491,6 +2771,9 @@ for each backend. To find the name of the environment variable, you need to set, take `RCLONE_CONFIG_` + name of remote + `_` + name of config file option and make it all uppercase. +Note one implication here is the remote's name must be +convertible into a valid environment variable name, +so it can only contain letters, digits, or the `_` (underscore) character. For example, to configure an S3 remote named `mys3:` without a config file (using unix ways of setting environment variables): diff --git a/docs/content/donate.md b/docs/content/donate.md deleted file mode 100644 index 59fd6a9775e14..0000000000000 --- a/docs/content/donate.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: "Donations" -description: "Donations to the rclone project." -type: page ---- - -# {{< icon "fa fa-heart heart" >}} Donations to the rclone project - -Rclone is a free open-source project with thousands of contributions -from volunteers all round the world and I would like to thank all of -you for donating your time to the project. - -However, maintaining rclone is a lot of work - easily the equivalent -of a **full time job** - for me. Nothing stands still in the world of -cloud storage. Rclone needs constant attention adapting to changes by -cloud providers, adding new providers, adding new features, keeping -the integration tests working, fixing bugs and many more things! - -I love doing the work and I'd like to spend more time doing it - your -support helps make that possible. - -Thank you :-) - -{{< nick >}} - -PS I'm available for rclone and object storage related consultancy - -[email me](mailto:nick@craig-wood.com) for more info. - -{{< monthly_donations >}} - -## Personal users - -If you are a personal user and you would like to support the project -with sponsorship as a way of saying thank you that would be most -appreciated. {{< icon "fa fa-heart heart" >}} - -## Business users - -If your business distributes rclone as part of its products (which the -generous MIT licence allows) or uses it internally then it would make -business sense to sponsor the rclone project to ensure that the -project you rely on stays healthy and well maintained. - -If you run one of the cloud storage providers that rclone supports and -rclone is driving revenue your way then you know it makes sense to -sponsor the project. {{< icon "far fa-smile" >}} - -Note that if you choose the "GitHub Sponsors" option they will provide -proper tax invoices appropriate for your country. - -## Monthly donations - -Monthly donations help keep rclone development sustainable in the long -run so this is the preferred option. A small amount every month is -much better than a one off donation as it allows planning for the -future. - -{{< monthly_donations >}} - -## One off donations - -If you don't want to contribute monthly then of course we'd love a one -off donation. - -{{< one_off_donations >}} - -If you require a receipt or wish to contribute in a different way then -please [drop me an email](mailto:nick@craig-wood.com). diff --git a/docs/content/downloads.md b/docs/content/downloads.md index 96ea849a71d14..d1ae19af95e0a 100644 --- a/docs/content/downloads.md +++ b/docs/content/downloads.md @@ -29,6 +29,9 @@ See also [Android builds](https://beta.rclone.org/{{% version %}}/testbuilds/). These are built as part of the official release, but haven't been adopted as first class builds yet. +See [the release signing docs](/release_signing/) for how to verify +signatures on the release. + ## Script download and install ## To install rclone on Linux/macOS/BSD systems, run: diff --git a/docs/content/drive.md b/docs/content/drive.md index 7975cf6b9bd13..854b185eb889c 100644 --- a/docs/content/drive.md +++ b/docs/content/drive.md @@ -124,6 +124,8 @@ use. This changes what type of token is granted to rclone. [The scopes are defined here](https://developers.google.com/drive/v3/web/about-auth). +A comma-separated list is allowed e.g. `drive.readonly,drive.file`. + The scope are #### drive @@ -227,12 +229,9 @@ There's a few steps we need to go through to accomplish this: [Google Developer Console](https://console.developers.google.com). - You must have a project - create one if you don't. - Then go to "IAM & admin" -> "Service Accounts". - - Use the "Create Credentials" button. Fill in "Service account name" -with something that identifies your client. "Role" can be empty. - - Tick "Furnish a new private key" - select "Key type JSON". - - Tick "Enable G Suite Domain-wide Delegation". This option makes -"impersonation" possible, as documented here: -[Delegating domain-wide authority to the service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) + - Use the "Create Service Account" button. Fill in "Service account name" +and "Service account ID" with something that identifies your client. + - Select "Create And Continue". Step 2 and 3 are optional. - These credentials are what rclone will use for authentication. If you ever need to remove access, press the "Delete service account key" button. @@ -362,10 +361,14 @@ large folder (10600 directories, 39000 files): - without `--fast-list`: 22:05 min - with `--fast-list`: 58s -### Modified time +### Modification times and hashes Google drive stores modification times accurate to 1 ms. +Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however, +that a small fraction of files uploaded may not have SHA1 or SHA256 +hashes especially if they were uploaded before 2018. + ### Restricted filename characters Only Invalid UTF-8 bytes will be [replaced](/overview/#invalid-utf8), @@ -406,7 +409,7 @@ like a symlink in unix, except they point to the underlying file data (e.g. the inode in unix terms) so they don't break if the source is renamed or moved about. -Be default rclone treats these as follows. +By default rclone treats these as follows. For shortcuts pointing to files: @@ -585,7 +588,7 @@ Properties: #### --drive-scope -Scope that rclone should use when requesting access from drive. +Comma separated list of scopes that rclone should use when requesting access from drive. Properties: @@ -773,15 +776,40 @@ Properties: - Type: bool - Default: false +#### --drive-show-all-gdocs + +Show all Google Docs including non-exportable ones in listings. + +If you try a server side copy on a Google Form without this flag, you +will get this error: + + No export formats found for "application/vnd.google-apps.form" + +However adding this flag will allow the form to be server side copied. + +Note that rclone doesn't add extensions to the Google Docs file names +in this mode. + +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. + + +Properties: + +- Config: show_all_gdocs +- Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS +- Type: bool +- Default: false + #### --drive-skip-checksum-gphotos -Skip MD5 checksum on Google photos and videos only. +Skip checksums on Google photos and videos only. Use this if you get checksum errors when transferring Google photos or videos. Setting this flag will cause Google photos and videos to return a -blank MD5 checksum. +blank checksums. Google photos are identified by being in the "photos" space. @@ -1069,6 +1097,8 @@ Properties: #### --drive-server-side-across-configs +Deprecated: use --server-side-across-configs instead. + Allow server-side operations (e.g. copy) to work across different drive configs. This can be useful if you wish to do a server-side copy between two @@ -1195,7 +1225,7 @@ This resource key requirement only applies to a subset of old files. Note also that opening the folder once in the web interface (with the user you've authenticated rclone with) seems to be enough so that the -resource key is no needed. +resource key is not needed. Properties: @@ -1205,6 +1235,126 @@ Properties: - Type: string - Required: false +#### --drive-fast-list-bug-fix + +Work around a bug in Google Drive listing. + +Normally rclone will work around a bug in Google Drive when using +--fast-list (ListR) where the search "(A in parents) or (B in +parents)" returns nothing sometimes. See #3114, #4289 and +https://issuetracker.google.com/issues/149522397 + +Rclone detects this by finding no items in more than one directory +when listing and retries them as lists of individual directories. + +This means that if you have a lot of empty directories rclone will end +up listing them all individually and this can take many more API +calls. + +This flag allows the work-around to be disabled. This is **not** +recommended in normal use - only if you have a particular case you are +having trouble with like many empty directories. + + +Properties: + +- Config: fast_list_bug_fix +- Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX +- Type: bool +- Default: true + +#### --drive-metadata-owner + +Control whether owner should be read or written in metadata. + +Owner is a standard part of the file metadata so is easy to read. But it +isn't always desirable to set the owner from the metadata. + +Note that you can't set the owner on Shared Drives, and that setting +ownership will generate an email to the new owner (this can't be +disabled), and you can't transfer ownership to someone outside your +organization. + + +Properties: + +- Config: metadata_owner +- Env Var: RCLONE_DRIVE_METADATA_OWNER +- Type: Bits +- Default: read +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. + +#### --drive-metadata-permissions + +Control whether permissions should be read or written in metadata. + +Reading permissions metadata from files can be done quickly, but it +isn't always desirable to set the permissions from the metadata. + +Note that rclone drops any inherited permissions on Shared Drives and +any owner permission on My Drives as these are duplicated in the owner +metadata. + + +Properties: + +- Config: metadata_permissions +- Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. + +#### --drive-metadata-labels + +Control whether labels should be read or written in metadata. + +Reading labels metadata from files takes an extra API transaction and +will slow down listings. It isn't always desirable to set the labels +from the metadata. + +The format of labels is documented in the drive API documentation at +https://developers.google.com/drive/api/reference/rest/v3/Label - +rclone just provides a JSON dump of this format. + +When setting labels, the label and fields must already exist - rclone +will not create them. This means that if you are transferring labels +from two different accounts you will have to create the labels in +advance and use the metadata mapper to translate the IDs between the +two accounts. + + +Properties: + +- Config: metadata_labels +- Env Var: RCLONE_DRIVE_METADATA_LABELS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. + #### --drive-encoding The encoding for the backend. @@ -1215,9 +1365,50 @@ Properties: - Config: encoding - Env Var: RCLONE_DRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: InvalidUtf8 +#### --drive-env-auth + +Get IAM credentials from runtime (environment variables or instance meta data if no env vars). + +Only applies if service_account_file and service_account_credentials is blank. + +Properties: + +- Config: env_auth +- Env Var: RCLONE_DRIVE_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). + +### Metadata + +User metadata is stored in the properties field of the drive object. + +Here are the possible system metadata items for the drive backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| content-type | The MIME type of the file. | string | text/plain | N | +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | +| description | A short description of the file. | string | Contract for signing | N | +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N | +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | +| starred | Whether the user has starred the file. | boolean | false | N | +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | +| writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N | + +See the [metadata](/docs/#metadata) docs for more info. + ## Backend commands Here are the commands specific to the drive backend. @@ -1481,6 +1672,11 @@ Waiting a moderate period of time between attempts (estimated to be approximately 1 hour) and/or not using --fast-list both seem to be effective in preventing the problem. +### SHA1 or SHA256 hashes may be missing + +All files have MD5 hashes, but a small fraction of files uploaded may +not have SHA1 or SHA256 hashes especially if they were uploaded before 2018. + ## Making your own client_id When you use rclone with Google drive in its default configuration you @@ -1505,7 +1701,7 @@ be the same account as the Google Drive you want to access) "Google Drive API". 4. Click "Credentials" in the left-side panel (not "Create -credentials", which opens the wizard), then "Create credentials" +credentials", which opens the wizard). 5. If you already configured an "Oauth Consent Screen", then skip to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button diff --git a/docs/content/dropbox.md b/docs/content/dropbox.md index cb9af2e1c6dd2..91b15688e8b74 100644 --- a/docs/content/dropbox.md +++ b/docs/content/dropbox.md @@ -97,7 +97,7 @@ You can then use team folders like this `remote:/TeamFolder` and A leading `/` for a Dropbox personal account will do nothing, but it will take an extra HTTP transaction so it should be avoided. -### Modified time and Hashes +### Modification times and hashes Dropbox supports modified times, but the only way to set a modification time is to re-upload the file. @@ -343,6 +343,30 @@ Properties: - Type: bool - Default: false +#### --dropbox-pacer-min-sleep + +Minimum time to sleep between API calls. + +Properties: + +- Config: pacer_min_sleep +- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms + +#### --dropbox-encoding + +The encoding for the backend. + +See the [encoding section in the overview](/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_DROPBOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot + #### --dropbox-batch-mode Upload file batching sync|async|off. @@ -406,8 +430,8 @@ uploaded. The default for this is 0 which means rclone will choose a sensible default based on the batch_mode in use. -- batch_mode: async - default batch_timeout is 500ms -- batch_mode: sync - default batch_timeout is 10s +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 500ms - batch_mode: off - not in use @@ -429,19 +453,6 @@ Properties: - Type: Duration - Default: 10m0s -#### --dropbox-encoding - -The encoding for the backend. - -See the [encoding section in the overview](/overview/#encoding) for more info. - -Properties: - -- Config: encoding -- Env Var: RCLONE_DROPBOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot - {{< rem autogenerated options stop >}} ## Limitations @@ -483,7 +494,7 @@ to be the same account as the Dropbox you want to access) 2. Choose an API => Usually this should be `Dropbox API` -3. Choose the type of access you want to use => `Full Dropbox` or `App Folder` +3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). 4. Name your App. The app name is global, so you can't use `rclone` for example @@ -491,6 +502,6 @@ to be the same account as the Dropbox you want to access) 6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` -7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` +7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` 8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` diff --git a/docs/content/faq.md b/docs/content/faq.md index 574cd540f955d..c529405591f70 100644 --- a/docs/content/faq.md +++ b/docs/content/faq.md @@ -190,9 +190,29 @@ If you are using `systemd-resolved` (default on Arch Linux), ensure it is at version 233 or higher. Previous releases contain a bug which causes not all domains to be resolved properly. -Additionally with the `GODEBUG=netdns=` environment variable the Go -resolver decision can be influenced. This also allows to resolve certain -issues with DNS resolution. See the [name resolution section in the go docs](https://golang.org/pkg/net/#hdr-Name_Resolution). + +The Go resolver decision can be influenced with the `GODEBUG=netdns=...` +environment variable. This also allows to resolve certain issues with +DNS resolution. On Windows or MacOS systems, try forcing use of the +internal Go resolver by setting `GODEBUG=netdns=go` at runtime. On +other systems (Linux, \*BSD, etc) try forcing use of the system +name resolver by setting `GODEBUG=netdns=cgo` (and recompile rclone +from source with CGO enabled if necessary). See the +[name resolution section in the go docs](https://golang.org/pkg/net/#hdr-Name_Resolution). + +### Failed to start auth webserver on Windows ### +``` +Error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions. +... +yyyy/mm/dd hh:mm:ss Fatal error: config failed to refresh token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: An attempt was made to access a socket in a way forbidden by its access permissions. +``` + +This is sometimes caused by the Host Network Service causing issues with opening the port on the host. + +A simple solution may be restarting the Host Network Service with eg. Powershell +``` +Restart-Service hns +``` ### The total size reported in the stats for a sync is wrong and keeps changing diff --git a/docs/content/fichier.md b/docs/content/fichier.md index e4470faeab67a..b5a8245055685 100644 --- a/docs/content/fichier.md +++ b/docs/content/fichier.md @@ -76,11 +76,11 @@ To copy a local directory to a 1Fichier directory called backup rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes 1Fichier does not support modification times. It supports the Whirlpool hash algorithm. -### Duplicated files ### +### Duplicated files 1Fichier can have two files with exactly the same name and path (unlike a normal file system). @@ -171,6 +171,17 @@ Properties: - Type: string - Required: false +#### --fichier-cdn + +Set if you wish to use CDN download links. + +Properties: + +- Config: cdn +- Env Var: RCLONE_FICHIER_CDN +- Type: bool +- Default: false + #### --fichier-encoding The encoding for the backend. @@ -181,7 +192,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FICHIER_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/filefabric.md b/docs/content/filefabric.md index 69ee67fcdcba8..1666cd6bc7793 100644 --- a/docs/content/filefabric.md +++ b/docs/content/filefabric.md @@ -101,7 +101,7 @@ To copy a local directory to an Enterprise File Fabric directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes The Enterprise File Fabric allows modification times to be set on files accurate to 1 second. These will be used to detect whether @@ -271,7 +271,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/filtering.md b/docs/content/filtering.md index d61bb19924738..7afd66ff0f77b 100644 --- a/docs/content/filtering.md +++ b/docs/content/filtering.md @@ -27,7 +27,7 @@ E.g. `rclone copy "remote:dir*.jpg" /path/to/dir` does not have a filter effect. `rclone copy remote:dir /path/to/dir --include "*.jpg"` does. **Important** Avoid mixing any two of `--include...`, `--exclude...` or -`--filter...` flags in an rclone command. The results may not be what +`--filter...` flags in an rclone command. The results might not be what you expect. Instead use a `--filter...` flag. ## Patterns for matching path/file names @@ -88,7 +88,7 @@ separator or the beginning of the path/file. - doesn't match "afile.jpg" - doesn't match "directory/file.jpg" -The top level of the remote may not be the top level of the drive. +The top level of the remote might not be the top level of the drive. E.g. for a Microsoft Windows local directory structure @@ -166,7 +166,7 @@ Which will match a directory called `start` with a file called `end.jpg` in it as the `.*` will match `/` characters. Note that you can use `-vv --dump filters` to show the filter patterns -in regexp format - rclone implements the glob patters by transforming +in regexp format - rclone implements the glob patterns by transforming them into regular expressions. ## Filter pattern examples {#examples} @@ -367,7 +367,7 @@ all files on `remote:` excluding those in root directory `dir` and sub directories. E.g. on Microsoft Windows `rclone ls remote: --exclude "*\[{JP,KR,HK}\]*"` -lists the files in `remote:` with `[JP]` or `[KR]` or `[HK]` in +lists the files in `remote:` without `[JP]` or `[KR]` or `[HK]` in their name. Quotes prevent the shell from interpreting the `\` characters.`\` characters escape the `[` and `]` so an rclone filter treats them literally rather than as a character-range. The `{` and `}` diff --git a/docs/content/flags.md b/docs/content/flags.md index 51e9f931fb992..4ce4c079f439a 100644 --- a/docs/content/flags.md +++ b/docs/content/flags.md @@ -6,727 +6,959 @@ description: "Rclone Global Flags" # Global Flags This describes the global flags available to every rclone command -split into two groups, non backend and backend flags. +split into groups. -## Non Backend Flags -These flags are available for every command. +## Copy +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + + +## Sync + +Flags just used for `rclone sync`. + +``` + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") +``` + + +## Important + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + + +## Check + +Flags used for `rclone check`. + +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` + + +## Networking + +General networking and HTTP stuff. + +``` + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --contimeout Duration Connect timeout (default 1m0s) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-gzip-encoding Don't set Accept-Encoding: gzip + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --use-cookies Enable session cookiejar + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") +``` + + +## Performance + +Flags helpful for increasing performance. + +``` + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --checkers int Number of checkers to run in parallel (default 8) + --transfers int Number of file transfers to run in parallel (default 4) +``` + + +## Config + +General configuration of rclone. + +``` + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --config string Config file (default "$HOME/.config/rclone/rclone.conf") + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --disable string Disable a comma separated list of features (use --disable help to see a list) + -n, --dry-run Do a trial run with no permanent changes + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + -i, --interactive Enable interactive mode + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --low-level-retries int Number of low level retries to do (default 10) + --no-console Hide console window (supported on Windows only) + --no-unicode-normalization Don't normalize unicode characters in filenames + --password-command SpaceSepList Command for supplying password for encrypted configuration + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --temp-dir string Directory rclone will use for temporary files (default "/tmp") + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata ``` - --ask-password Allow prompt for password for encrypted configuration (default true) - --auto-confirm If enabled, do not request console confirmation - --backup-dir string Make backups into hierarchy based in DIR - --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name - --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) - --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --ca-cert stringArray CA certificate used to verify servers - --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") - --check-first Do all the checks before starting transfers - --checkers int Number of checkers to run in parallel (default 8) - -c, --checksum Skip based on checksum (if available) & size, not mod-time & size - --client-cert string Client SSL certificate (PEM) for mutual TLS auth - --client-key string Client SSL private key (PEM) for mutual TLS auth - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") - --compare-dest stringArray Include additional comma separated server-side paths during comparison - --config string Config file (default "$HOME/.config/rclone/rclone.conf") - --contimeout Duration Connect timeout (default 1m0s) - --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cpuprofile string Write cpu profile to file - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") - --delete-after When synchronizing, delete files on destination after transferring (default) - --delete-before When synchronizing, delete files on destination before transferring - --delete-during When synchronizing, delete files during transfer - --delete-excluded Delete files on dest excluded from sync - --disable string Disable a comma separated list of features (use --disable help to see a list) - --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. - --disable-http2 Disable HTTP/2 in the global transport - -n, --dry-run Do a trial run with no permanent changes - --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles - --dump-bodies Dump HTTP headers and bodies - may contain sensitive info - --dump-headers Dump HTTP headers - may contain sensitive info - --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) - --fast-list Use recursive list if available; uses more memory but fewer transactions - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) - --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) - --header stringArray Set HTTP header for all transactions - --header-download stringArray Set HTTP header for download transactions - --header-upload stringArray Set HTTP header for upload transactions - --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi - --ignore-case Ignore case in filters (case insensitive) - --ignore-case-sync Ignore case when synchronizing - --ignore-checksum Skip post copy check of checksums - --ignore-errors Delete even if there are I/O errors - --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum - -I, --ignore-times Don't skip files that match size and time - transfer all files - --immutable Do not modify files, fail if existing files have been modified - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - -i, --interactive Enable interactive mode - --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) - --log-file string Log everything to this file - --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") - --log-systemd Activate systemd integration for the logger - --low-level-retries int Number of low level retries to do (default 10) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) - --max-delete int When synchronizing, limit the number of deletes (default -1) - --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-duration Duration Maximum duration rclone will transfer data for (default 0s) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) - --max-transfer SizeSuffix Maximum size of data to transfer (default off) - --memprofile string Write memory profile to file - -M, --metadata If set, preserve metadata when copying objects - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --metadata-set stringArray Add metadata key=value when uploading - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) - --modify-window Duration Max time diff to be considered the same (default 1ns) - --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 250Mi) - --multi-thread-streams int Max number of streams to use for multi-thread downloads (default 4) - --no-check-certificate Do not verify the server SSL certificate (insecure) - --no-check-dest Don't check the destination, copy regardless - --no-console Hide console window (supported on Windows only) - --no-gzip-encoding Don't set Accept-Encoding: gzip - --no-traverse Don't traverse destination file system on copy - --no-unicode-normalization Don't normalize unicode characters in filenames - --no-update-modtime Don't update destination mod-time if files identical - --order-by string Instructions on how to order the transfers, e.g. 'size,descending' - --password-command SpaceSepList Command for supplying password for encrypted configuration - -P, --progress Show progress during transfer - --progress-terminal-title Show progress on the terminal title (requires -P/--progress) - -q, --quiet Print as little stuff as possible - --rc Enable the remote control server - --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) - --rc-allow-origin string Set the allowed origin for CORS - --rc-baseurl string Prefix for URLs - leave blank for root - --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) - --rc-client-ca string Client certificate authority to verify clients with - --rc-enable-metrics Enable prometheus metrics on /metrics - --rc-files string Path to local files to serve on the HTTP server - --rc-htpasswd string A htpasswd file - if not provided no authentication is done - --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) - --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) - --rc-key string TLS PEM Private key - --rc-max-header-bytes int Maximum size of request header (default 4096) - --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --rc-no-auth Don't require auth for certain methods - --rc-pass string Password for authentication - --rc-realm string Realm for authentication - --rc-salt string Password hashing salt (default "dlPL2MqE") - --rc-serve Enable the serving of remote objects - --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --rc-template string User-specified template - --rc-user string User name for authentication - --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") - --rc-web-gui Launch WebGUI on localhost - --rc-web-gui-force-update Force update to latest version of web gui - --rc-web-gui-no-open-browser Don't open the browser automatically - --rc-web-gui-update Check and update to latest version of web gui - --refresh-times Refresh the modtime of remote files - --retries int Retry operations this many times if they fail (default 3) - --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) - --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum - --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) - --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") - --stats-one-line Make the stats fit on one line - --stats-one-line-date Enable --stats-one-line and add current date/time prefix - --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format - --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") - --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) - --suffix string Suffix to add to changed files - --suffix-keep-extension Preserve the extension when using --suffix - --syslog Use Syslog for logging - --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") - --temp-dir string Directory rclone will use for temporary files (default "/tmp") - --timeout Duration IO idle timeout (default 5m0s) - --tpslimit float Limit HTTP transactions per second to this - --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) - --track-renames When synchronizing, track file renames and do a server-side move if possible - --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") - --transfers int Number of file transfers to run in parallel (default 4) - -u, --update Skip files that are newer on the destination - --use-cookies Enable session cookiejar - --use-json-log Use json log format - --use-mmap Use mmap allocator (see docs) - --use-server-modtime Use server modified time instead of object metadata - --user-agent string Set the user-agent to a specified string (default "rclone/v1.62.0") - -v, --verbose count Print lots more stuff (repeat for more) + + +## Debugging + +Flags for developers. + +``` + --cpuprofile string Write cpu profile to file + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --memprofile string Write memory profile to file +``` + + +## Filter + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + + +## Listing + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + + +## Logging + +Logging and statistics. + ``` + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default "date,time") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + -q, --quiet Print as little stuff as possible + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") + --use-json-log Use json log format + -v, --verbose count Print lots more stuff (repeat for more) +``` + -## Backend Flags +## Metadata -These flags are available for every command. They control the backends -and may be set in the config file. +Flags to control metadata. ``` - --acd-auth-url string Auth server URL - --acd-client-id string OAuth Client Id - --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) - --acd-token string OAuth Access Token as a JSON blob - --acd-token-url string Token server url - --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) - --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive - --azureblob-account string Azure Storage Account Name - --azureblob-archive-tier-delete Delete archive tier blobs before overwriting - --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) - --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) - --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key - --azureblob-client-id string The ID of the client in use - --azureblob-client-secret string One of the service principal's client secrets - --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth - --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) - --azureblob-endpoint string Endpoint for the service - --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) - --azureblob-key string Storage Account Shared Key - --azureblob-list-chunk int Size of blob list (default 5000) - --azureblob-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --azureblob-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any - --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any - --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any - --azureblob-no-check-container If set, don't attempt to check the container exists or create it - --azureblob-no-head-object If set, do not do HEAD before GET when getting objects - --azureblob-password string The user's password (obscured) - --azureblob-public-access string Public access level of a container: blob or container - --azureblob-sas-url string SAS URL for container level access only - --azureblob-service-principal-file string Path to file containing credentials for use with a service principal - --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID - --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) - --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) - --azureblob-use-emulator Uses local storage emulator if provided as 'true' - --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) - --azureblob-username string User name (usually an email address) - --b2-account string Account ID or Application Key ID - --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) - --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) - --b2-disable-checksum Disable checksums for large (> upload cutoff) files - --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) - --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --b2-endpoint string Endpoint for the service - --b2-hard-delete Permanently delete files on remote removal, otherwise hide files - --b2-key string Application Key - --b2-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --b2-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --b2-version-at Time Show file versions as they were at the specified time (default off) - --b2-versions Include old versions in directory listings - --box-access-token string Box App Primary Access Token - --box-auth-url string Auth server URL - --box-box-config-file string Box App config.json location - --box-box-sub-type string (default "user") - --box-client-id string OAuth Client Id - --box-client-secret string OAuth Client Secret - --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) - --box-list-chunk int Size of listing chunk 1-1000 (default 1000) - --box-owned-by string Only show items owned by the login (email address) passed in - --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point - --box-token string OAuth Access Token as a JSON blob - --box-token-url string Token server url - --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) - --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) - --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming - --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") - --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) - --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) - --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") - --cache-db-purge Clear all the cached data for this remote on start - --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) - --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) - --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server - --cache-plex-password string The password of the Plex user (obscured) - --cache-plex-url string The URL of the Plex server - --cache-plex-username string The username of the Plex user - --cache-read-retries int How many times to retry a read from a cache storage (default 10) - --cache-remote string Remote to cache - --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) - --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded - --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) - --cache-workers int How many workers should run in parallel to download chunks (default 4) - --cache-writes Cache file data on writes through the FS - --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) - --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks - --chunker-hash-type string Choose how chunker handles hash sums (default "md5") - --chunker-remote string Remote to chunk/unchunk - --combine-upstreams SpaceSepList Upstreams for combining - --compress-level int GZIP compression level (-2 to 9) (default -1) - --compress-mode string Compression mode (default "gzip") - --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) - --compress-remote string Remote to compress - -L, --copy-links Follow symlinks and copy the pointed to item - --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) - --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") - --crypt-filename-encryption string How to encrypt the filenames (default "standard") - --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted - --crypt-password string Password or pass phrase for encryption (obscured) - --crypt-password2 string Password or pass phrase for salt (obscured) - --crypt-remote string Remote to encrypt/decrypt - --crypt-server-side-across-configs Allow server-side operations (e.g. copy) to work across different crypt configs - --crypt-show-mapping For all files listed show how the names encrypt - --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded - --drive-allow-import-name-change Allow the filetype to change when uploading Google docs - --drive-auth-owner-only Only consider files owned by the authenticated user - --drive-auth-url string Auth server URL - --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) - --drive-client-id string Google Application Client Id - --drive-client-secret string OAuth Client Secret - --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut - --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) - --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") - --drive-formats string Deprecated: See export_formats - --drive-impersonate string Impersonate this user when using a service account - --drive-import-formats string Comma separated list of preferred formats for uploading Google docs - --drive-keep-revision-forever Keep new head revision of each file forever - --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) - --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) - --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) - --drive-resource-key string Resource key for accessing a link-shared file - --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive - --drive-server-side-across-configs Allow server-side operations (e.g. copy) to work across different drive configs - --drive-service-account-credentials string Service Account Credentials JSON blob - --drive-service-account-file string Service Account Credentials JSON file path - --drive-shared-with-me Only show files that are shared with me - --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only - --drive-skip-dangling-shortcuts If set skip dangling shortcut files - --drive-skip-gdocs Skip google documents in all listings - --drive-skip-shortcuts If set skip shortcut files - --drive-starred-only Only show files that are starred - --drive-stop-on-download-limit Make download limit errors be fatal - --drive-stop-on-upload-limit Make upload limit errors be fatal - --drive-team-drive string ID of the Shared Drive (Team Drive) - --drive-token string OAuth Access Token as a JSON blob - --drive-token-url string Token server url - --drive-trashed-only Only show files that are in the trash - --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) - --drive-use-created-date Use file created date instead of modified date - --drive-use-shared-date Use date file was shared instead of modified date - --drive-use-trash Send files to the trash instead of deleting permanently (default true) - --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) - --dropbox-auth-url string Auth server URL - --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) - --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") - --dropbox-batch-size int Max number of files in upload batch - --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) - --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) - --dropbox-client-id string OAuth Client Id - --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) - --dropbox-impersonate string Impersonate this user when using a business account - --dropbox-shared-files Instructs rclone to work on individual shared files - --dropbox-shared-folders Instructs rclone to work on shared folders - --dropbox-token string OAuth Access Token as a JSON blob - --dropbox-token-url string Token server url - --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) - --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) - --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) - --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --filefabric-permanent-token string Permanent Authentication Token - --filefabric-root-folder-id string ID of the root folder - --filefabric-token string Session Token - --filefabric-token-expiry string Token expiry time - --filefabric-url string URL of the Enterprise File Fabric to connect to - --filefabric-version string Version read from the file fabric - --ftp-ask-password Allow asking for FTP password when needed - --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) - --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited - --ftp-disable-epsv Disable using EPSV even if server advertises support - --ftp-disable-mlsd Disable using MLSD even if server advertises support - --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) - --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) - --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD - --ftp-host string FTP host to connect to - --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --ftp-no-check-certificate Do not verify the TLS certificate of the server - --ftp-pass string FTP password (obscured) - --ftp-port int FTP port number (default 21) - --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) - --ftp-tls Use Implicit FTPS (FTP over TLS) - --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) - --ftp-user string FTP username (default "$USER") - --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) - --gcs-anonymous Access public buckets and objects without credentials - --gcs-auth-url string Auth server URL - --gcs-bucket-acl string Access Control List for new buckets - --gcs-bucket-policy-only Access checks should use bucket-level IAM policies - --gcs-client-id string OAuth Client Id - --gcs-client-secret string OAuth Client Secret - --gcs-decompress If set this will decompress gzip encoded objects - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gcs-endpoint string Endpoint for the service - --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) - --gcs-location string Location for the newly created buckets - --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it - --gcs-object-acl string Access Control List for new objects - --gcs-project-number string Project number - --gcs-service-account-file string Service Account Credentials JSON file path - --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage - --gcs-token string OAuth Access Token as a JSON blob - --gcs-token-url string Token server url - --gphotos-auth-url string Auth server URL - --gphotos-client-id string OAuth Client Id - --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gphotos-include-archived Also view and download archived media - --gphotos-read-only Set to make the Google Photos backend read only - --gphotos-read-size Set to read the size of media items - --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) - --gphotos-token string OAuth Access Token as a JSON blob - --gphotos-token-url string Token server url - --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) - --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) - --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) - --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) - --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port - --hdfs-service-principal-name string Kerberos service principal name for the namenode - --hdfs-username string Hadoop user name - --hidrive-auth-url string Auth server URL - --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) - --hidrive-client-id string OAuth Client Id - --hidrive-client-secret string OAuth Client Secret - --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") - --hidrive-root-prefix string The root/parent folder for all paths (default "/") - --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") - --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") - --hidrive-token string OAuth Access Token as a JSON blob - --hidrive-token-url string Token server url - --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) - --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) - --http-headers CommaSepList Set HTTP headers for all transactions - --http-no-head Don't use HEAD requests - --http-no-slash Set this if the site doesn't end directories with / - --http-url string URL of HTTP host to connect to - --internetarchive-access-key-id string IAS3 Access Key - --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) - --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") - --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") - --internetarchive-secret-access-key string IAS3 Secret Key (password) - --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) - --jottacloud-hard-delete Delete files permanently rather than putting them into the trash - --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) - --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them - --jottacloud-trashed-only Only show files that are in the trash - --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --koofr-endpoint string The Koofr API endpoint to use - --koofr-mountid string Mount ID of the mount to use - --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) - --koofr-provider string Choose your storage provider - --koofr-setmtime Does the backend support setting modification time (default true) - --koofr-user string Your user name - -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension - --local-case-insensitive Force the filesystem to report itself as case insensitive - --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --local-no-check-updated Don't check to see if the files change during upload - --local-no-preallocate Disable preallocation of disk space for transferred files - --local-no-set-modtime Disable setting modtime - --local-no-sparse Disable sparse files for multi-thread downloads - --local-nounc Disable UNC (long path names) conversion on Windows - --local-unicode-normalization Apply unicode NFC normalization to paths and filenames - --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) - --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --mailru-pass string Password (obscured) - --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) - --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") - --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) - --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) - --mailru-user string User name (usually email) - --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --mega-hard-delete Delete files permanently rather than putting them into the trash - --mega-pass string Password (obscured) - --mega-use-https Use HTTPS for transfers - --mega-user string User name - --netstorage-account string Set the NetStorage account name - --netstorage-host string Domain+path of NetStorage host to connect to - --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") - --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) - -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) - --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) - --onedrive-auth-url string Auth server URL - --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) - --onedrive-client-id string OAuth Client Id - --onedrive-client-secret string OAuth Client Secret - --onedrive-drive-id string The ID of the drive to use - --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) - --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings - --onedrive-hash-type string Specify the hash in use for the backend (default "auto") - --onedrive-link-password string Set the password for links created by the link command - --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") - --onedrive-link-type string Set the type of the links created by the link command (default "view") - --onedrive-list-chunk int Size of listing chunk (default 1000) - --onedrive-no-versions Remove all versions on modifying operations - --onedrive-region string Choose national cloud region for OneDrive (default "global") - --onedrive-root-folder-id string ID of the root folder - --onedrive-server-side-across-configs Allow server-side operations (e.g. copy) to work across different onedrive configs - --onedrive-token string OAuth Access Token as a JSON blob - --onedrive-token-url string Token server url - --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --oos-compartment string Object storage compartment OCID - --oos-config-file string Path to OCI config file (default "~/.oci/config") - --oos-config-profile string Profile name inside the oci config file (default "Default") - --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --oos-copy-timeout Duration Timeout for copy (default 1m0s) - --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --oos-endpoint string Endpoint for Object storage API - --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --oos-namespace string Object storage namespace - --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it - --oos-provider string Choose your Auth Provider (default "env_auth") - --oos-region string Object storage Region - --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm - --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to - --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated - --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption - --oos-sse-kms-key-id string if using using your own master key in vault, this header specifies the - --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") - --oos-upload-concurrency int Concurrency for multipart uploads (default 10) - --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) - --opendrive-password string Password (obscured) - --opendrive-username string Username - --pcloud-auth-url string Auth server URL - --pcloud-client-id string OAuth Client Id - --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") - --pcloud-password string Your pcloud password (obscured) - --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") - --pcloud-token string OAuth Access Token as a JSON blob - --pcloud-token-url string Token server url - --pcloud-username string Your pcloud username - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --qingstor-access-key-id string QingStor Access Key ID - --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) - --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) - --qingstor-endpoint string Enter an endpoint URL to connection QingStor API - --qingstor-env-auth Get QingStor credentials from runtime - --qingstor-secret-access-key string QingStor Secret Access Key (password) - --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) - --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --qingstor-zone string Zone to connect to - --s3-access-key-id string AWS Access Key ID - --s3-acl string Canned ACL used when creating buckets and storing or copying objects - --s3-bucket-acl string Canned ACL used when creating buckets - --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --s3-decompress If set this will decompress gzip encoded objects - --s3-disable-checksum Don't store MD5 checksum with object metadata - --s3-disable-http2 Disable usage of http2 for S3 backends - --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --s3-endpoint string Endpoint for S3 API - --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) - --s3-force-path-style If true use path style access if false use virtual hosted style (default true) - --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) - --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) - --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto - --s3-location-constraint string Location constraint - must be set to match the Region - --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --s3-memory-pool-flush-time Duration How often internal memory buffer pools will be flushed (default 1m0s) - --s3-memory-pool-use-mmap Whether to use mmap buffers in internal memory pool - --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) - --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it - --s3-no-head If set, don't HEAD uploaded objects to check integrity - --s3-no-head-object If set, do not do HEAD before GET when getting objects - --s3-no-system-metadata Suppress setting and reading of system metadata - --s3-profile string Profile to use in the shared credentials file - --s3-provider string Choose your S3 provider - --s3-region string Region to connect to - --s3-requester-pays Enables requester pays option when interacting with S3 bucket - --s3-secret-access-key string AWS Secret Access Key (password) - --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 - --s3-session-token string An AWS session token - --s3-shared-credentials-file string Path to the shared credentials file - --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 - --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data - --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data - --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) - --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key - --s3-storage-class string The storage class to use when storing new objects in S3 - --s3-sts-endpoint string Endpoint for STS - --s3-upload-concurrency int Concurrency for multipart uploads (default 4) - --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint - --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) - --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads - --s3-v2-auth If true use v2 authentication - --s3-version-at Time Show file versions as they were at the specified time (default off) - --s3-versions Include old versions in directory listings - --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) - --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) - --seafile-library string Name of the library - --seafile-library-key string Library password (for encrypted libraries only) (obscured) - --seafile-pass string Password (obscured) - --seafile-url string URL of seafile host to connect to - --seafile-user string User name (usually email address) - --sftp-ask-password Allow asking for SFTP password when needed - --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) - --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference - --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) - --sftp-disable-concurrent-reads If set don't use concurrent reads - --sftp-disable-concurrent-writes If set don't use concurrent writes - --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available - --sftp-host string SSH host to connect to - --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference - --sftp-key-file string Path to PEM-encoded private key file - --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) - --sftp-key-pem string Raw PEM-encoded private key - --sftp-key-use-agent When set forces the usage of the ssh-agent - --sftp-known-hosts-file string Optional path to known_hosts file - --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference - --sftp-md5sum-command string The command used to read md5 hashes - --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) - --sftp-path-override string Override path used by SSH shell commands - --sftp-port int SSH port number (default 22) - --sftp-pubkey-file string Optional path to public key file - --sftp-server-command string Specifies the path or command to run a sftp server on the remote host - --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands - --sftp-set-modtime Set the modified time on the remote if set (default true) - --sftp-sha1sum-command string The command used to read sha1 hashes - --sftp-shell-type string The type of SSH shell on remote server, if any - --sftp-skip-links Set to skip any symlinks and any other non regular files - --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") - --sftp-use-fstat If set use fstat instead of stat - --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods - --sftp-user string SSH username (default "$USER") - --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) - --sharefile-endpoint string Endpoint for API calls - --sharefile-root-folder-id string ID of the root folder - --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) - --sia-api-password string Sia Daemon API Password (obscured) - --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) - --sia-user-agent string Siad User Agent (default "Sia-Agent") - --skip-links Don't warn about skipped symlinks - --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) - --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) - --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) - --smb-host string SMB server hostname to connect to - --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --smb-pass string SMB password (obscured) - --smb-port int SMB port number (default 445) - --smb-spn string Service principal name - --smb-user string SMB username (default "$USER") - --storj-access-grant string Access grant - --storj-api-key string API key - --storj-passphrase string Encryption passphrase - --storj-provider string Choose an authentication method (default "existing") - --storj-satellite-address string Satellite address (default "us1.storj.io") - --sugarsync-access-key-id string Sugarsync Access Key ID - --sugarsync-app-id string Sugarsync App ID - --sugarsync-authorization string Sugarsync authorization - --sugarsync-authorization-expiry string Sugarsync authorization expiry - --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) - --sugarsync-hard-delete Permanently delete files if true - --sugarsync-private-access-key string Sugarsync Private Access Key - --sugarsync-refresh-token string Sugarsync refresh token - --sugarsync-root-id string Sugarsync root id - --sugarsync-user string Sugarsync user - --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) - --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) - --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) - --swift-auth string Authentication URL for server (OS_AUTH_URL) - --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) - --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) - --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) - --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) - --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") - --swift-env-auth Get swift credentials from environment variables in standard OpenStack form - --swift-key string API key or password (OS_PASSWORD) - --swift-leave-parts-on-error If true avoid calling abort upload on a failure - --swift-no-chunk Don't chunk files during streaming upload - --swift-no-large-objects Disable support for static and dynamic large objects - --swift-region string Region name - optional (OS_REGION_NAME) - --swift-storage-policy string The storage policy to use when creating a new container - --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) - --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) - --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) - --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) - --swift-user string User name to log in (OS_USERNAME) - --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) - --union-action-policy string Policy to choose upstream on ACTION category (default "epall") - --union-cache-time int Cache time of usage and free space (in seconds) (default 120) - --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") - --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) - --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") - --union-upstreams string List of space separated upstreams - --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) - --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) - --webdav-bearer-token-command string Command to run to get a bearer token - --webdav-encoding string The encoding for the backend - --webdav-headers CommaSepList Set HTTP headers for all transactions - --webdav-pass string Password (obscured) - --webdav-url string URL of http host to connect to - --webdav-user string User name - --webdav-vendor string Name of the WebDAV site/service/software you are using - --yandex-auth-url string Auth server URL - --yandex-client-id string OAuth Client Id - --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --yandex-hard-delete Delete files permanently rather than putting them into the trash - --yandex-token string OAuth Access Token as a JSON blob - --yandex-token-url string Token server url - --zoho-auth-url string Auth server URL - --zoho-client-id string OAuth Client Id - --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) - --zoho-region string Zoho region to connect to - --zoho-token string OAuth Access Token as a JSON blob - --zoho-token-url string Token server url + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading +``` + + +## RC + +Flags to control the Remote Control API. + ``` + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui +``` + + +## Backend + +Backend only flags. These can be set in the config file also. + +``` + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal's client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don't store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don't attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user's password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as 'true' + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default "user") + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default "md5") + --chunker-remote string Remote to chunk/unchunk + --combine-upstreams SpaceSepList Upstreams for combining + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default "gzip") + --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + -L, --copy-links Follow symlinks and copy the pointed to item + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") + --crypt-filename-encryption string How to encrypt the filenames (default "standard") + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default "$USER") + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) + --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports + --hdfs-service-principal-name string Kerberos service principal name for the namenode + --hdfs-username string Hadoop user name + --hidrive-auth-url string Auth server URL + --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) + --hidrive-client-id string OAuth Client Id + --hidrive-client-secret string OAuth Client Secret + --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) + --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") + --hidrive-root-prefix string The root/parent folder for all paths (default "/") + --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") + --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") + --hidrive-token string OAuth Access Token as a JSON blob + --hidrive-token-url string Token server url + --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) + --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) + --http-headers CommaSepList Set HTTP headers for all transactions + --http-no-head Don't use HEAD requests + --http-no-slash Set this if the site doesn't end directories with / + --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings + --internetarchive-access-key-id string IAS3 Access Key + --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") + --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") + --internetarchive-secret-access-key string IAS3 Secret Key (password) + --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) + --jottacloud-auth-url string Auth server URL + --jottacloud-client-id string OAuth Client Id + --jottacloud-client-secret string OAuth Client Secret + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-hard-delete Delete files permanently rather than putting them into the trash + --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) + --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them + --jottacloud-token string OAuth Access Token as a JSON blob + --jottacloud-token-url string Token server url + --jottacloud-trashed-only Only show files that are in the trash + --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-endpoint string The Koofr API endpoint to use + --koofr-mountid string Mount ID of the mount to use + --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) + --koofr-provider string Choose your storage provider + --koofr-setmtime Does the backend support setting modification time (default true) + --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account + -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension + --local-case-insensitive Force the filesystem to report itself as case insensitive + --local-case-sensitive Force the filesystem to report itself as case sensitive + --local-encoding Encoding The encoding for the backend (default Slash,Dot) + --local-no-check-updated Don't check to see if the files change during upload + --local-no-preallocate Disable preallocation of disk space for transferred files + --local-no-set-modtime Disable setting modtime + --local-no-sparse Disable sparse files for multi-thread downloads + --local-nounc Disable UNC (long path names) conversion on Windows + --local-unicode-normalization Apply unicode NFC normalization to paths and filenames + --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) + --mailru-auth-url string Auth server URL + --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) + --mailru-client-id string OAuth Client Id + --mailru-client-secret string OAuth Client Secret + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-pass string Password (obscured) + --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) + --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") + --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) + --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) + --mailru-token string OAuth Access Token as a JSON blob + --mailru-token-url string Token server url + --mailru-user string User name (usually email) + --mega-debug Output more debug from Mega + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-hard-delete Delete files permanently rather than putting them into the trash + --mega-pass string Password (obscured) + --mega-use-https Use HTTPS for transfers + --mega-user string User name + --netstorage-account string Set the NetStorage account name + --netstorage-host string Domain+path of NetStorage host to connect to + --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") + --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) + -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) + --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) + --onedrive-auth-url string Auth server URL + --onedrive-av-override Allows download of files the server thinks has a virus + --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) + --onedrive-client-id string OAuth Client Id + --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings + --onedrive-drive-id string The ID of the drive to use + --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings + --onedrive-hash-type string Specify the hash in use for the backend (default "auto") + --onedrive-link-password string Set the password for links created by the link command + --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") + --onedrive-link-type string Set the type of the links created by the link command (default "view") + --onedrive-list-chunk int Size of listing chunk (default 1000) + --onedrive-no-versions Remove all versions on modifying operations + --onedrive-region string Choose national cloud region for OneDrive (default "global") + --onedrive-root-folder-id string ID of the root folder + --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --onedrive-token string OAuth Access Token as a JSON blob + --onedrive-token-url string Token server url + --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object + --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --oos-compartment string Object storage compartment OCID + --oos-config-file string Path to OCI config file (default "~/.oci/config") + --oos-config-profile string Profile name inside the oci config file (default "Default") + --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --oos-copy-timeout Duration Timeout for copy (default 1m0s) + --oos-disable-checksum Don't store MD5 checksum with object metadata + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-endpoint string Endpoint for Object storage API + --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery + --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --oos-namespace string Object storage namespace + --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it + --oos-provider string Choose your Auth Provider (default "env_auth") + --oos-region string Object storage Region + --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm + --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the + --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") + --oos-upload-concurrency int Concurrency for multipart uploads (default 10) + --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-password string Password (obscured) + --opendrive-username string Username + --pcloud-auth-url string Auth server URL + --pcloud-client-id string OAuth Client Id + --pcloud-client-secret string OAuth Client Secret + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") + --pcloud-password string Your pcloud password (obscured) + --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") + --pcloud-token string OAuth Access Token as a JSON blob + --pcloud-token-url string Token server url + --pcloud-username string Your pcloud username + --pikpak-auth-url string Auth server URL + --pikpak-client-id string OAuth Client Id + --pikpak-client-secret string OAuth Client Secret + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) + --pikpak-pass string Pikpak password (obscured) + --pikpak-root-folder-id string ID of the root folder + --pikpak-token string OAuth Access Token as a JSON blob + --pikpak-token-url string Token server url + --pikpak-trashed-only Only show files that are in the trash + --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) + --pikpak-user string Pikpak username + --premiumizeme-auth-url string Auth server URL + --premiumizeme-client-id string OAuth Client Id + --premiumizeme-client-secret string OAuth Client Secret + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-token string OAuth Access Token as a JSON blob + --premiumizeme-token-url string Token server url + --protondrive-2fa string The 2FA code + --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") + --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) + --protondrive-original-file-size Return the file size before encryption (default true) + --protondrive-password string The password of your proton account (obscured) + --protondrive-replace-existing-draft Create a new revision when filename conflict is detected + --protondrive-username string The username of your proton account + --putio-auth-url string Auth server URL + --putio-client-id string OAuth Client Id + --putio-client-secret string OAuth Client Secret + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-token string OAuth Access Token as a JSON blob + --putio-token-url string Token server url + --qingstor-access-key-id string QingStor Access Key ID + --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) + --qingstor-connection-retries int Number of connection retries (default 3) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-endpoint string Enter an endpoint URL to connection QingStor API + --qingstor-env-auth Get QingStor credentials from runtime + --qingstor-secret-access-key string QingStor Secret Access Key (password) + --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) + --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --qingstor-zone string Zone to connect to + --quatrix-api-key string API key for accessing Quatrix account + --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-hard-delete Delete files permanently rather than putting them into the trash + --quatrix-host string Host name of Quatrix account + --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) + --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) + --s3-access-key-id string AWS Access Key ID + --s3-acl string Canned ACL used when creating buckets and storing or copying objects + --s3-bucket-acl string Canned ACL used when creating buckets + --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --s3-decompress If set this will decompress gzip encoded objects + --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created + --s3-disable-checksum Don't store MD5 checksum with object metadata + --s3-disable-http2 Disable usage of http2 for S3 backends + --s3-download-url string Custom endpoint for downloads + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-endpoint string Endpoint for S3 API + --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) + --s3-force-path-style If true use path style access if false use virtual hosted style (default true) + --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery + --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) + --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) + --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto + --s3-location-constraint string Location constraint - must be set to match the Region + --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) + --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it + --s3-no-head If set, don't HEAD uploaded objects to check integrity + --s3-no-head-object If set, do not do HEAD before GET when getting objects + --s3-no-system-metadata Suppress setting and reading of system metadata + --s3-profile string Profile to use in the shared credentials file + --s3-provider string Choose your S3 provider + --s3-region string Region to connect to + --s3-requester-pays Enables requester pays option when interacting with S3 bucket + --s3-secret-access-key string AWS Secret Access Key (password) + --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 + --s3-session-token string An AWS session token + --s3-shared-credentials-file string Path to the shared credentials file + --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 + --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data + --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data + --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) + --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key + --s3-storage-class string The storage class to use when storing new objects in S3 + --s3-sts-endpoint string Endpoint for STS + --s3-upload-concurrency int Concurrency for multipart uploads (default 4) + --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint + --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) + --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) + --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads + --s3-v2-auth If true use v2 authentication + --s3-version-at Time Show file versions as they were at the specified time (default off) + --s3-versions Include old versions in directory listings + --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) + --seafile-create-library Should rclone create a library if it doesn't exist + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-library string Name of the library + --seafile-library-key string Library password (for encrypted libraries only) (obscured) + --seafile-pass string Password (obscured) + --seafile-url string URL of seafile host to connect to + --seafile-user string User name (usually email address) + --sftp-ask-password Allow asking for SFTP password when needed + --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) + --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference + --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks + --sftp-disable-concurrent-reads If set don't use concurrent reads + --sftp-disable-concurrent-writes If set don't use concurrent writes + --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available + --sftp-host string SSH host to connect to + --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference + --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference + --sftp-key-file string Path to PEM-encoded private key file + --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) + --sftp-key-pem string Raw PEM-encoded private key + --sftp-key-use-agent When set forces the usage of the ssh-agent + --sftp-known-hosts-file string Optional path to known_hosts file + --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference + --sftp-md5sum-command string The command used to read md5 hashes + --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) + --sftp-path-override string Override path used by SSH shell commands + --sftp-port int SSH port number (default 22) + --sftp-pubkey-file string Optional path to public key file + --sftp-server-command string Specifies the path or command to run a sftp server on the remote host + --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands + --sftp-set-modtime Set the modified time on the remote if set (default true) + --sftp-sha1sum-command string The command used to read sha1 hashes + --sftp-shell-type string The type of SSH shell on remote server, if any + --sftp-skip-links Set to skip any symlinks and any other non regular files + --sftp-socks-proxy string Socks 5 proxy host + --sftp-ssh SpaceSepList Path and arguments to external ssh binary + --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") + --sftp-use-fstat If set use fstat instead of stat + --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods + --sftp-user string SSH username (default "$USER") + --sharefile-auth-url string Auth server URL + --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) + --sharefile-client-id string OAuth Client Id + --sharefile-client-secret string OAuth Client Secret + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-endpoint string Endpoint for API calls + --sharefile-root-folder-id string ID of the root folder + --sharefile-token string OAuth Access Token as a JSON blob + --sharefile-token-url string Token server url + --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) + --sia-api-password string Sia Daemon API Password (obscured) + --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-user-agent string Siad User Agent (default "Sia-Agent") + --skip-links Don't warn about skipped symlinks + --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) + --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) + --smb-host string SMB server hostname to connect to + --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --smb-pass string SMB password (obscured) + --smb-port int SMB port number (default 445) + --smb-spn string Service principal name + --smb-user string SMB username (default "$USER") + --storj-access-grant string Access grant + --storj-api-key string API key + --storj-passphrase string Encryption passphrase + --storj-provider string Choose an authentication method (default "existing") + --storj-satellite-address string Satellite address (default "us1.storj.io") + --sugarsync-access-key-id string Sugarsync Access Key ID + --sugarsync-app-id string Sugarsync App ID + --sugarsync-authorization string Sugarsync authorization + --sugarsync-authorization-expiry string Sugarsync authorization expiry + --sugarsync-deleted-id string Sugarsync deleted folder id + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-hard-delete Permanently delete files if true + --sugarsync-private-access-key string Sugarsync Private Access Key + --sugarsync-refresh-token string Sugarsync refresh token + --sugarsync-root-id string Sugarsync root id + --sugarsync-user string Sugarsync user + --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) + --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) + --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) + --swift-auth string Authentication URL for server (OS_AUTH_URL) + --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) + --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) + --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) + --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) + --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") + --swift-env-auth Get swift credentials from environment variables in standard OpenStack form + --swift-key string API key or password (OS_PASSWORD) + --swift-leave-parts-on-error If true avoid calling abort upload on a failure + --swift-no-chunk Don't chunk files during streaming upload + --swift-no-large-objects Disable support for static and dynamic large objects + --swift-region string Region name - optional (OS_REGION_NAME) + --swift-storage-policy string The storage policy to use when creating a new container + --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) + --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) + --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) + --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) + --swift-user string User name to log in (OS_USERNAME) + --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) + --union-action-policy string Policy to choose upstream on ACTION category (default "epall") + --union-cache-time int Cache time of usage and free space (in seconds) (default 120) + --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") + --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) + --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") + --union-upstreams string List of space separated upstreams + --uptobox-access-token string Your access token + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-private Set to make uploaded files private + --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) + --webdav-bearer-token-command string Command to run to get a bearer token + --webdav-encoding string The encoding for the backend + --webdav-headers CommaSepList Set HTTP headers for all transactions + --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) + --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --webdav-pass string Password (obscured) + --webdav-url string URL of http host to connect to + --webdav-user string User name + --webdav-vendor string Name of the WebDAV site/service/software you are using + --yandex-auth-url string Auth server URL + --yandex-client-id string OAuth Client Id + --yandex-client-secret string OAuth Client Secret + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-hard-delete Delete files permanently rather than putting them into the trash + --yandex-token string OAuth Access Token as a JSON blob + --yandex-token-url string Token server url + --zoho-auth-url string Auth server URL + --zoho-client-id string OAuth Client Id + --zoho-client-secret string OAuth Client Secret + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-region string Zoho region to connect to + --zoho-token string OAuth Access Token as a JSON blob + --zoho-token-url string Token server url +``` + + diff --git a/docs/content/ftp.md b/docs/content/ftp.md index 394ad8a4289b4..b00bb8accd939 100644 --- a/docs/content/ftp.md +++ b/docs/content/ftp.md @@ -415,6 +415,24 @@ Properties: - Type: bool - Default: false +#### --ftp-socks-proxy + +Socks 5 proxy host. + + Supports the format user:pass@host:port, user@host:port, host:port. + + Example: + + myUser:myPass@localhost:9005 + + +Properties: + +- Config: socks_proxy +- Env Var: RCLONE_FTP_SOCKS_PROXY +- Type: string +- Required: false + #### --ftp-encoding The encoding for the backend. @@ -425,7 +443,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FTP_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,RightSpace,Dot - Examples: - "Asterisk,Ctl,Dot,Slash" @@ -468,7 +486,7 @@ at present. The `ftp_proxy` environment variable is not currently supported. -#### Modified time +### Modification times File modification time (timestamps) is supported to 1 second resolution for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. diff --git a/docs/content/googlecloudstorage.md b/docs/content/googlecloudstorage.md index 09254945678c8..561d536c5ee73 100644 --- a/docs/content/googlecloudstorage.md +++ b/docs/content/googlecloudstorage.md @@ -247,7 +247,7 @@ Eg `--header-upload "Content-Type text/potato"` Note that the last of these is for setting custom metadata in the form `--header-upload "x-goog-meta-key: value"` -### Modification time +### Modification times Google Cloud Storage stores md5sum natively. Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time @@ -320,6 +320,19 @@ Properties: - Type: string - Required: false +#### --gcs-user-project + +User project. + +Optional - needed only for requester pays. + +Properties: + +- Config: user_project +- Env Var: RCLONE_GCS_USER_PROJECT +- Type: string +- Required: false + #### --gcs-service-account-file Service Account Credentials JSON file path. @@ -611,6 +624,21 @@ Properties: - Type: string - Required: false +#### --gcs-directory-markers + +Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. + + +Properties: + +- Config: directory_markers +- Env Var: RCLONE_GCS_DIRECTORY_MARKERS +- Type: bool +- Default: false + #### --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it. @@ -668,7 +696,7 @@ Properties: - Config: encoding - Env Var: RCLONE_GCS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/googlephotos.md b/docs/content/googlephotos.md index e10b2a9fe09ef..76a9af6d6f35b 100644 --- a/docs/content/googlephotos.md +++ b/docs/content/googlephotos.md @@ -374,9 +374,93 @@ Properties: - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot +#### --gphotos-batch-mode + +Upload file batching sync|async|off. + +This sets the batch mode used by rclone. + +This has 3 possible values + +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don't check completion + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + + +Properties: + +- Config: batch_mode +- Env Var: RCLONE_GPHOTOS_BATCH_MODE +- Type: string +- Default: "sync" + +#### --gphotos-batch-size + +Max number of files in upload batch. + +This sets the batch size of files to upload. It has to be less than 50. + +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. + +- batch_mode: async - default batch_size is 50 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. + + +Properties: + +- Config: batch_size +- Env Var: RCLONE_GPHOTOS_BATCH_SIZE +- Type: int +- Default: 0 + +#### --gphotos-batch-timeout + +Max time to allow an idle upload batch before uploading. + +If an upload batch is idle for more than this long then it will be +uploaded. + +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. + +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 1s +- batch_mode: off - not in use + + +Properties: + +- Config: batch_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT +- Type: Duration +- Default: 0s + +#### --gphotos-batch-commit-timeout + +Max time to wait for a batch to finish committing + +Properties: + +- Config: batch_commit_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s + {{< rem autogenerated options stop >}} ## Limitations @@ -428,7 +512,7 @@ if you uploaded an image to `upload` then uploaded the same image to what it was uploaded with initially, not what you uploaded it with to `album`. In practise this shouldn't cause too many problems. -### Modified time +### Modification times The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not diff --git a/docs/content/hasher.md b/docs/content/hasher.md index 324f2b85f694b..f2606fc0165a8 100644 --- a/docs/content/hasher.md +++ b/docs/content/hasher.md @@ -341,6 +341,6 @@ directory, usually `~/.cache/rclone/kv/`. Databases are maintained one per _base_ backend, named like `BaseRemote~hasher.bolt`. Checksums for multiple `alias`-es into a single base backend will be stored in the single database. All local paths are treated as -aliases into the `local` backend (unless crypted or chunked) and stored +aliases into the `local` backend (unless encrypted or chunked) and stored in `~/.cache/rclone/kv/local~hasher.bolt`. Databases can be shared between multiple rclone processes. diff --git a/docs/content/hdfs.md b/docs/content/hdfs.md index 701590e6078a0..6e85414c33c3c 100644 --- a/docs/content/hdfs.md +++ b/docs/content/hdfs.md @@ -126,7 +126,7 @@ username = root You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data uploaded will be lost.) -### Modified time +### Modification times Time accurate to 1 second is stored. @@ -156,16 +156,16 @@ Here are the Standard options specific to hdfs (Hadoop distributed file system). #### --hdfs-namenode -Hadoop name node and port. +Hadoop name nodes and ports. -E.g. "namenode:8020" to connect to host namenode at port 8020. +E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020. Properties: - Config: namenode - Env Var: RCLONE_HDFS_NAMENODE -- Type: string -- Required: true +- Type: CommaSepList +- Default: #### --hdfs-username @@ -205,9 +205,9 @@ Properties: Kerberos data transfer protection: authentication|integrity|privacy. Specifies whether or not authentication, data signature integrity -checks, and wire encryption is required when communicating the the -datanodes. Possible values are 'authentication', 'integrity' and -'privacy'. Used only with KERBEROS enabled. +checks, and wire encryption are required when communicating with +the datanodes. Possible values are 'authentication', 'integrity' +and 'privacy'. Used only with KERBEROS enabled. Properties: @@ -229,7 +229,7 @@ Properties: - Config: encoding - Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/hidrive.md b/docs/content/hidrive.md index 91e8ab29b6571..f48dcb8e9d9f0 100644 --- a/docs/content/hidrive.md +++ b/docs/content/hidrive.md @@ -123,7 +123,7 @@ Using the process is very similar to the process of initial setup exemplified before. -### Modified time and hashes +### Modification times and hashes HiDrive allows modification times to be set on objects accurate to 1 second. @@ -415,7 +415,7 @@ Properties: - Config: encoding - Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/http.md b/docs/content/http.md index 06ae9cadacb28..0fa8ca0a18919 100644 --- a/docs/content/http.md +++ b/docs/content/http.md @@ -105,7 +105,7 @@ Sync the remote `directory` to `/home/local/directory`, deleting any excess file This remote is read only - you can't upload files to an HTTP server. -### Modified time +### Modification times Most HTTP servers store time accurate to 1 second. @@ -212,6 +212,46 @@ Properties: - Type: bool - Default: false +## Backend commands + +Here are the commands specific to the http backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](/rc/#backend-command). + +### set + +Set command for updating the config parameters. + + rclone backend set remote: [options] [+] + +This set command can be used to update the config parameters +for a running http backend. + +Usage Examples: + + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com + +The option keys are named as they are in the config file. + +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn't return anything. + + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/imagekit.md b/docs/content/imagekit.md new file mode 100644 index 0000000000000..c0ae147d2ea85 --- /dev/null +++ b/docs/content/imagekit.md @@ -0,0 +1,216 @@ +--- +title: "ImageKit" +description: "Rclone docs for ImageKit backend." +versionIntroduced: "v1.63" + +--- +# {{< icon "fa fa-cloud" >}} ImageKit +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. + +#### About ImageKit +[ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. + + +#### Accounts & Pricing + +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). + +## Configuration + +Here is an example of making an imagekit configuration. + +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. + +You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. + +Now run +``` +rclone config +``` + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter the name for the new remote. +name> imagekit-media-library + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / ImageKit.io +\ (imagekit) +[snip] +Storage> imagekit + +Option endpoint. +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +endpoint> https://ik.imagekit.io/imagekit_id + +Option public_key. +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +public_key> public_**************************** + +Option private_key. +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +private_key> private_**************************** + +Edit advanced config? +y) Yes +n) No (default) +y/n> n + +Configuration complete. +Options: +- type: imagekit +- endpoint: https://ik.imagekit.io/imagekit_id +- public_key: public_**************************** +- private_key: private_**************************** + +Keep this "imagekit-media-library" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` +List directories in the top level of your Media Library +``` +rclone lsd imagekit-media-library: +``` +Make a new directory. +``` +rclone mkdir imagekit-media-library:directory +``` +List the contents of a directory. +``` +rclone ls imagekit-media-library:directory +``` + +### Modified time and hashes + +ImageKit does not support modification times or hashes yet. + +### Checksums + +No checksums are supported. + +{{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/imagekit/imagekit.go then run make backenddocs" >}} +### Standard options + +Here are the Standard options specific to imagekit (ImageKit.io). + +#### --imagekit-endpoint + +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + +Properties: + +- Config: endpoint +- Env Var: RCLONE_IMAGEKIT_ENDPOINT +- Type: string +- Required: true + +#### --imagekit-public-key + +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + +Properties: + +- Config: public_key +- Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY +- Type: string +- Required: true + +#### --imagekit-private-key + +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + +Properties: + +- Config: private_key +- Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY +- Type: string +- Required: true + +### Advanced options + +Here are the Advanced options specific to imagekit (ImageKit.io). + +#### --imagekit-only-signed + +If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true. + +Properties: + +- Config: only_signed +- Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED +- Type: bool +- Default: false + +#### --imagekit-versions + +Include old versions in directory listings. + +Properties: + +- Config: versions +- Env Var: RCLONE_IMAGEKIT_VERSIONS +- Type: bool +- Default: false + +#### --imagekit-upload-tags + +Tags to add to the uploaded files, e.g. "tag1,tag2". + +Properties: + +- Config: upload_tags +- Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS +- Type: string +- Required: false + +#### --imagekit-encoding + +The encoding for the backend. + +See the [encoding section in the overview](/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_IMAGEKIT_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket + +### Metadata + +Any metadata supported by the underlying remote is read and written. + +Here are the possible system metadata items for the imagekit backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | +| file-type | Type of the file | string | image | **Y** | +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | +| has-alpha | Whether the image has alpha channel or not | bool | | **Y** | +| height | Height of the image or video in pixels | int | | **Y** | +| is-private-file | Whether the file is private or not | bool | | **Y** | +| size | Size of the object in bytes | int64 | | **Y** | +| tags | Tags associated with the file | string | tag1,tag2 | **Y** | +| width | Width of the image or video in pixels | int | | **Y** | + +See the [metadata](/docs/#metadata) docs for more info. + +{{< rem autogenerated options stop >}} diff --git a/docs/content/install.md b/docs/content/install.md index c17550c08c8e0..54b5480796291 100644 --- a/docs/content/install.md +++ b/docs/content/install.md @@ -22,6 +22,9 @@ run `rclone -h`. Already installed rclone can be easily updated to the latest version using the [rclone selfupdate](/commands/rclone_selfupdate/) command. +See [the release signing docs](/release_signing/) for how to verify +signatures on the release. + ## Script installation To install rclone on Linux/macOS/BSD systems, run: @@ -77,6 +80,19 @@ developers so it may be out of date. Its current version is as below. [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/rclone.svg)](https://repology.org/project/rclone/versions) +### Installation with MacPorts (#macos-macports) + +On macOS, rclone can also be installed via [MacPorts](https://www.macports.org): + + sudo port install rclone + +Note that this is a third party installer not controlled by the rclone +developers so it may be out of date. Its current version is as below. + +[![MacPorts port](https://repology.org/badge/version-for-repo/macports/rclone.svg)](https://repology.org/project/rclone/versions) + +More information [here](https://ports.macports.org/port/rclone/). + ### Precompiled binary, using curl {#macos-precompiled} To avoid problems with macOS gatekeeper enforcing the binary to be signed and @@ -146,9 +162,14 @@ feature then you will need to install the third party utility [Winget](https://learn.microsoft.com/en-us/windows/package-manager/) comes pre-installed with the latest versions of Windows. If not, update the [App Installer](https://www.microsoft.com/p/app-installer/9nblggh4nns1) package from the Microsoft store. +To install rclone ``` winget install Rclone.Rclone ``` +To uninstall rclone +``` +winget uninstall Rclone.Rclone --force +``` ### Chocolatey package manager {#windows-chocolatey} @@ -258,10 +279,16 @@ Here are some commands tested on an Ubuntu 18.04.3 host: # config on host at ~/.config/rclone/rclone.conf # data on host at ~/data +# add a remote interactively +docker run --rm -it \ + --volume ~/.config/rclone:/config/rclone \ + --user $(id -u):$(id -g) \ + rclone/rclone \ + config + # make sure the config is ok by listing the remotes docker run --rm \ --volume ~/.config/rclone:/config/rclone \ - --volume ~/data:/data:shared \ --user $(id -u):$(id -g) \ rclone/rclone \ listremotes @@ -279,11 +306,33 @@ docker run --rm \ ls ~/data/mount kill %1 ``` +## Snap installation {#snap} + +[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/rclone) + +Make sure you have [Snapd installed](https://snapcraft.io/docs/installing-snapd) + +```bash +$ sudo snap install rclone +``` +Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below. + +- Default config directory: + - /home/$USER/snap/rclone/current/.config/rclone + +Note: Due to the strict confinement of Snap, `rclone mount` feature is `not` supported. + +If mounting is wanted, either install a precompiled binary or enable the relevant option when [installing from source](#source). + +Note that this is controlled by [community maintainer](https://github.com/boukendesho/rclone-snap) not the rclone developers so it may be out of date. Its current version is as below. + +[![rclone](https://snapcraft.io/rclone/badge.svg)](https://snapcraft.io/rclone) + ## Source installation {#source} Make sure you have git and [Go](https://golang.org/) installed. -Go version 1.17 or newer is required, latest release is recommended. +Go version 1.18 or newer is required, the latest release is recommended. You can get it from your package manager, or download it from [golang.org/dl](https://golang.org/dl/). Then you can run the following: @@ -317,26 +366,59 @@ port of GCC, e.g. by installing it in a [MSYS2](https://www.msys2.org) distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible). -Additionally, on Windows, you must install the third party utility -[WinFsp](https://winfsp.dev/), with the "Developer" feature selected. +Additionally, to build with mount on Windows, you must install the third party +utility [WinFsp](https://winfsp.dev/), with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally `C:\Program Files (x86)\WinFsp\inc\fuse`). -You may also add arguments `-ldflags -s` (with or without `-tags cmount`), -to omit symbol table and debug information, making the executable file smaller, -and `-trimpath` to remove references to local file system paths. This is how -the official rclone releases are built. +You may add arguments `-ldflags -s` to omit symbol table and debug information, +making the executable file smaller, and `-trimpath` to remove references to +local file system paths. The official rclone releases are built with both of these. ``` go build -trimpath -ldflags -s -tags cmount ``` +If you want to customize the version string, as reported by +the `rclone version` command, you can set one of the variables `fs.Version`, +`fs.VersionTag` (to keep default suffix but customize the number), +or `fs.VersionSuffix` (to keep default number but customize the suffix). +This can be done from the build command, by adding to the `-ldflags` +argument value as shown below. + +``` +go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount +``` + +On Windows, the official executables also have the version information, +as well as a file icon, embedded as binary resources. To get that with your +own build you need to run the following command **before** the build command. +It generates a Windows resource system object file, with extension .syso, e.g. +`resource_windows_amd64.syso`, that will be automatically picked up by +future build commands. + +``` +go run bin/resource_windows.go +``` + +The above command will generate a resource file containing version information +based on the fs.Version variable in source at the time you run the command, +which means if the value of this variable changes you need to re-run the +command for it to be reflected in the version information. Also, if you +override this version variable in the build command as described above, you +need to do that also when generating the resource file, or else it will still +use the value from the source. + +``` +go run bin/resource_windows.go -version v9.9.9-test +``` + Instead of executing the `go build` command directly, you can run it via the -Makefile. It changes the version number suffix from "-DEV" to "-beta" and -appends commit details. It also copies the resulting rclone executable into -your GOPATH bin folder (`$(go env GOPATH)/bin`, which corresponds to -`~/go/bin/rclone` by default). +Makefile. The default target changes the version suffix from "-DEV" to "-beta" +followed by additional commit details, embeds version information binary resources +on Windows, and copies the resulting rclone executable into your GOPATH bin folder +(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default). ``` make @@ -349,32 +431,22 @@ make GOTAGS=cmount ``` There are other make targets that can be used for more advanced builds, -such as cross-compiling for all supported os/architectures, embedding -icon and version info resources into windows executable, and packaging +such as cross-compiling for all supported os/architectures, and packaging results into release artifacts. See [Makefile](https://github.com/rclone/rclone/blob/master/Makefile) and [cross-compile.go](https://github.com/rclone/rclone/blob/master/bin/cross-compile.go) for details. -Another alternative is to download the source, build and install rclone in one -operation, as a regular Go package. The source will be stored it in the Go -module cache, and the resulting executable will be in your GOPATH bin folder -(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default). - -With Go version 1.17 or newer: +Another alternative method for source installation is to download the source, +build and install rclone - all in one operation, as a regular Go package. +The source will be stored it in the Go module cache, and the resulting +executable will be in your GOPATH bin folder (`$(go env GOPATH)/bin`, +which corresponds to `~/go/bin/rclone` by default). ``` go install github.com/rclone/rclone@latest ``` -With Go versions older than 1.17 (do **not** use the `-u` flag, it causes Go to -try to update the dependencies that rclone uses and sometimes these don't work -with the current version): - -``` -go get github.com/rclone/rclone -``` - ## Ansible installation {#ansible} This can be done with [Stefan Weichinger's ansible @@ -536,7 +608,7 @@ It requires .NET Framework, but it is preinstalled on newer versions of Windows, also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage -as it is easy to back up and re-use the configuration +as it is easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter). diff --git a/docs/content/install.sh b/docs/content/install.sh index 0adb744007efa..302882d824204 100755 --- a/docs/content/install.sh +++ b/docs/content/install.sh @@ -193,6 +193,8 @@ case "$OS" in exit 2 esac +#cleanup +rm -rf "$tmp_dir" #update version variable post install version=$(rclone --version 2>>errors | head -n 1) diff --git a/docs/content/internetarchive.md b/docs/content/internetarchive.md index a2d5a4771d790..980c534a6f10a 100644 --- a/docs/content/internetarchive.md +++ b/docs/content/internetarchive.md @@ -260,7 +260,7 @@ Properties: - Config: encoding - Env Var: RCLONE_INTERNETARCHIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot ### Metadata diff --git a/docs/content/jottacloud.md b/docs/content/jottacloud.md index 24bcda7e9e5ef..3ac1fc370b929 100644 --- a/docs/content/jottacloud.md +++ b/docs/content/jottacloud.md @@ -14,6 +14,8 @@ it also provides white-label solutions to different companies, such as: * Telia Sky (sky.telia.no) * Tele2 * Tele2 Cloud (mittcloud.tele2.se) +* Onlime + * Onlime Cloud Storage (onlime.dk) * Elkjøp (with subsidiaries): * Elkjøp Cloud (cloud.elkjop.no) * Elgiganten Sweden (cloud.elgiganten.se) @@ -84,6 +86,18 @@ Tele2 Cloud customers as no support for creating a CLI token exists, and additio authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. +### Onlime Cloud Storage authentication + +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but +have recently set up their own hosting, transferring their customers from Jottacloud servers to their +own ones. + +This, of course, necessitates using their servers for authentication, but otherwise functionality and +architecture seems equivalent to Jottacloud. + +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest +of the setup is identical to the default setup. + ## Configuration Here is an example of how to make a remote called `remote` with the default setup. First run: @@ -127,6 +141,9 @@ Press Enter for the default (standard). / Tele2 Cloud authentication. 4 | Use this if you are using Tele2 Cloud. \ (tele2) + / Onlime Cloud authentication. + 5 | Use this if you are using Onlime Cloud. + \ (onlime) config_type> 1 Personal login token. Generate here: https://www.jottacloud.com/web/secure @@ -216,7 +233,7 @@ them. Generally you should avoid these, unless you know what you are doing. ### --fast-list -This remote supports `--fast-list` which allows you to use fewer +This backend supports `--fast-list` which allows you to use fewer transactions in exchange for more memory. See the [rclone docs](/docs/#fast-list) for more details. @@ -224,10 +241,11 @@ Note that the implementation in Jottacloud always uses only a single API request to get the entire list, so for large folders this could lead to long wait time before the first results are shown. -Note also that with rclone version 1.58 and newer information about -[MIME types](/overview/#mime-type) are not available when using `--fast-list`. +Note also that with rclone version 1.58 and newer, information about +[MIME types](/overview/#mime-type) and metadata item [utime](#metadata) +are not available when using `--fast-list`. -### Modified time and hashes +### Modification times and hashes Jottacloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -244,7 +262,7 @@ Small files will be cached in memory - see the [--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. When uploading from local disk the source checksum is always available, so this does not apply. Starting with rclone version 1.52 the same is -true for crypted remotes (in older versions the crypt backend would not +true for encrypted remotes (in older versions the crypt backend would not calculate hashes for uploads from local disk, so the Jottacloud backend had to do it as described above). @@ -288,10 +306,77 @@ command which will display your usage limit (unless it is unlimited) and the current usage. {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/jottacloud/jottacloud.go then run make backenddocs" >}} +### Standard options + +Here are the Standard options specific to jottacloud (Jottacloud). + +#### --jottacloud-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID +- Type: string +- Required: false + +#### --jottacloud-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET +- Type: string +- Required: false + ### Advanced options Here are the Advanced options specific to jottacloud (Jottacloud). +#### --jottacloud-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_JOTTACLOUD_TOKEN +- Type: string +- Required: false + +#### --jottacloud-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_JOTTACLOUD_AUTH_URL +- Type: string +- Required: false + +#### --jottacloud-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL +- Type: string +- Required: false + #### --jottacloud-md5-memory-limit Files bigger than this will be cached on disk to calculate the MD5 if required. @@ -359,9 +444,24 @@ Properties: - Config: encoding - Env Var: RCLONE_JOTTACLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot +### Metadata + +Jottacloud has limited support for metadata, currently an extended set of timestamps. + +Here are the possible system metadata items for the jottacloud backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| content-type | MIME type, also known as media type | string | text/plain | **Y** | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + +See the [metadata](/docs/#metadata) docs for more info. + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/koofr.md b/docs/content/koofr.md index 6fbbbcabfaefd..3d161297f661d 100644 --- a/docs/content/koofr.md +++ b/docs/content/koofr.md @@ -171,34 +171,6 @@ Properties: - Type: string - Required: true -#### --koofr-password - -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). - -**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). - -Properties: - -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: digistorage -- Type: string -- Required: true - -#### --koofr-password - -Your password for rclone (generate one at your service's settings page). - -**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). - -Properties: - -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: other -- Type: string -- Required: true - ### Advanced options Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). @@ -239,7 +211,7 @@ Properties: - Config: encoding - Env Var: RCLONE_KOOFR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/linkbox.md b/docs/content/linkbox.md new file mode 100644 index 0000000000000..4ea172b5e968c --- /dev/null +++ b/docs/content/linkbox.md @@ -0,0 +1,76 @@ +--- +title: "Linkbox" +description: "Rclone docs for Linkbox" +versionIntroduced: "v1.65" +--- + +# {{< icon "fa fa-infinity" >}} Linkbox + +Linkbox is [a private cloud drive](https://linkbox.to/). + +## Configuration + +Here is an example of making a remote for Linkbox. + +First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter name for new remote. +name> remote + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / Linkbox + \ (linkbox) +Storage> XX + +Option token. +Token from https://www.linkbox.to/admin/account +Enter a value. +token> testFromCLToken + +Configuration complete. +Options: +- type: linkbox +- token: XXXXXXXXXXX +Keep this "linkbox" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y + +``` + +{{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/linkbox/linkbox.go then run make backenddocs" >}} +### Standard options + +Here are the Standard options specific to linkbox (Linkbox). + +#### --linkbox-token + +Token from https://www.linkbox.to/admin/account + +Properties: + +- Config: token +- Env Var: RCLONE_LINKBOX_TOKEN +- Type: string +- Required: true + +{{< rem autogenerated options stop >}} + +## Limitations + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. diff --git a/docs/content/local.md b/docs/content/local.md index 42327a940d5b6..fec259cd73392 100644 --- a/docs/content/local.md +++ b/docs/content/local.md @@ -19,10 +19,10 @@ For consistencies sake one can also configure a remote of type rclone remote paths, e.g. `remote:path/to/wherever`, but it is probably easier not to. -### Modified time ### +### Modification times -Rclone reads and writes the modified time using an accuracy determined by -the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second +Rclone reads and writes the modification times using an accuracy determined +by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X. ### Filenames ### @@ -451,6 +451,11 @@ time we: - Only checksum the size that stat gave - Don't update the stat info for the file +**NB** do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. Properties: @@ -561,7 +566,7 @@ Properties: - Config: encoding - Env Var: RCLONE_LOCAL_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot ### Metadata diff --git a/docs/content/mailru.md b/docs/content/mailru.md index c618b27f5205c..01de432f2a0c9 100644 --- a/docs/content/mailru.md +++ b/docs/content/mailru.md @@ -8,8 +8,6 @@ versionIntroduced: "v1.50" [Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. -Currently it is recommended to disable 2FA on Mail.ru accounts intended for rclone until it gets eventually implemented. - ## Features highlights - Paths may be as deep as required, e.g. `remote:directory/subdirectory` @@ -125,17 +123,15 @@ excess files in the path. rclone sync --interactive /home/local/directory remote:directory -### Modified time +### Modification times and hashes Files support a modification time attribute with up to 1 second precision. Directories do not have a modification time, which is shown as "Jan 1 1970". -### Hash checksums - -Hash sums use a custom Mail.ru algorithm based on SHA1. +File hashes are supported, with a custom Mail.ru algorithm based on SHA1. If file size is less than or equal to the SHA1 block size (20 bytes), its hash is simply its data right-padded with zero bytes. -Hash sum of a larger file is computed as a SHA1 sum of the file data +Hashes of a larger file is computed as a SHA1 of the file data bytes concatenated with a decimal representation of the data length. ### Emptying Trash @@ -176,6 +172,32 @@ as they can't be used in JSON strings. Here are the Standard options specific to mailru (Mail.ru Cloud). +#### --mailru-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_MAILRU_CLIENT_ID +- Type: string +- Required: false + +#### --mailru-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_MAILRU_CLIENT_SECRET +- Type: string +- Required: false + #### --mailru-user User name (usually email). @@ -234,6 +256,43 @@ Properties: Here are the Advanced options specific to mailru (Mail.ru Cloud). +#### --mailru-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_MAILRU_TOKEN +- Type: string +- Required: false + +#### --mailru-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_MAILRU_AUTH_URL +- Type: string +- Required: false + +#### --mailru-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_MAILRU_TOKEN_URL +- Type: string +- Required: false + #### --mailru-speedup-file-patterns Comma separated list of file name patterns eligible for speedup (put by hash). @@ -350,7 +409,7 @@ Properties: - Config: encoding - Env Var: RCLONE_MAILRU_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/mega.md b/docs/content/mega.md index 8326f1fcb5c3d..e553842c0c58a 100644 --- a/docs/content/mega.md +++ b/docs/content/mega.md @@ -82,7 +82,7 @@ To copy a local directory to an Mega directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes Mega does not support modification times or hashes yet. @@ -259,7 +259,7 @@ Use HTTPS for transfers. MEGA uses plain text HTTP connections by default. Some ISPs throttle HTTP connections, this causes transfers to become very slow. Enabling this will force MEGA to use HTTPS for all transfers. -HTTPS is normally not necesary since all data is already encrypted anyway. +HTTPS is normally not necessary since all data is already encrypted anyway. Enabling it will increase CPU usage and add network overhead. Properties: @@ -279,11 +279,15 @@ Properties: - Config: encoding - Env Var: RCLONE_MEGA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot {{< rem autogenerated options stop >}} +### Process `killed` + +On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). + ## Limitations This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource diff --git a/docs/content/memory.md b/docs/content/memory.md index 843fc3cbd0270..783fc281594b1 100644 --- a/docs/content/memory.md +++ b/docs/content/memory.md @@ -54,7 +54,7 @@ testing or with an rclone server or rclone mount, e.g. rclone serve webdav :memory: rclone serve sftp :memory: -### Modified time and hashes +### Modification times and hashes The memory backend supports MD5 hashes and modification times accurate to 1 nS. diff --git a/docs/content/onedrive.md b/docs/content/onedrive.md index 8e65338e78562..e2ec8b0c2ce56 100644 --- a/docs/content/onedrive.md +++ b/docs/content/onedrive.md @@ -162,7 +162,7 @@ You may try to [verify you account](https://docs.microsoft.com/en-us/azure/activ Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). -### Modification time and hashes +### Modification times and hashes OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -183,6 +183,32 @@ your workflow. For all types of OneDrive you can use the `--checksum` flag. +### --fast-list + +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](/docs/#fast-list) for more details. + +This must be enabled with the `--onedrive-delta` flag (or `delta = +true` in the config file) as it can cause performance degradation. + +It does this by using the delta listing facilities of OneDrive which +returns all the files in the remote very efficiently. This is much +more efficient than listing directories recursively and is Microsoft's +recommended way of reading all the file information from a drive. + +This can be useful with `rclone mount` and [rclone rc vfs/refresh +recursive=true](/rc/#vfs-refresh)) to very quickly fill the mount with +information about all the files. + +The API used for the recursive listing (`ListR`) only supports listing +from the root of the drive. This will become increasingly inefficient +the further away you get from the root as rclone will have to discard +files outside of the directory you are using. + +Some commands (like `rclone lsf -R`) will use `ListR` by default - you +can turn this off with `--disable ListR` if you need to. + ### Restricted filename characters In addition to the [default restricted characters set](/overview/#restricted-characters) @@ -428,6 +454,8 @@ Properties: #### --onedrive-server-side-across-configs +Deprecated: use --server-side-across-configs instead. + Allow server-side operations (e.g. copy) to work across different onedrive configs. This will only work if you are copying between two OneDrive *Personal* drives AND @@ -531,7 +559,7 @@ Properties: Specify the hash in use for the backend. This specifies the hash type in use. If set to "auto" it will use the -default hash which is is QuickXorHash. +default hash which is QuickXorHash. Before rclone 1.62 an SHA1 hash was used by default for Onedrive Personal. For 1.62 and later the default is to use a QuickXorHash for @@ -568,6 +596,67 @@ Properties: - "none" - None - don't use any hashes +#### --onedrive-av-override + +Allows download of files the server thinks has a virus. + +The onedrive/sharepoint server may check files uploaded with an Anti +Virus checker. If it detects any potential viruses or malware it will +block download of the file. + +In this case you will see a message like this + + server reports this file is infected with a virus - use --onedrive-av-override to download anyway: Infected (name of virus): 403 Forbidden: + +If you are 100% sure you want to download this file anyway then use +the --onedrive-av-override flag, or av_override = true in the config +file. + + +Properties: + +- Config: av_override +- Env Var: RCLONE_ONEDRIVE_AV_OVERRIDE +- Type: bool +- Default: false + +#### --onedrive-delta + +If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise `ListR` +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the `root/directory` in `onedrive:root/directory`) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone `rc vfs/refresh`. + + +Properties: + +- Config: delta +- Env Var: RCLONE_ONEDRIVE_DELTA +- Type: bool +- Default: false + #### --onedrive-encoding The encoding for the backend. @@ -578,7 +667,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/opendrive.md b/docs/content/opendrive.md index 0758470a6631a..4cf82d77311db 100644 --- a/docs/content/opendrive.md +++ b/docs/content/opendrive.md @@ -64,12 +64,14 @@ To copy a local directory to an OpenDrive directory called backup rclone copy /home/source remote:backup -### Modified time and MD5SUMs +### Modification times and hashes OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -143,7 +145,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size diff --git a/docs/content/oracleobjectstorage.md b/docs/content/oracleobjectstorage.md index 73cf1920dbb7e..a418ad8b30621 100644 --- a/docs/content/oracleobjectstorage.md +++ b/docs/content/oracleobjectstorage.md @@ -1,17 +1,22 @@ --- title: "Oracle Object Storage" description: "Rclone docs for Oracle Object Storage" +type: page versionIntroduced: "v1.60" --- # {{< icon "fa fa-cloud" >}} Oracle Object Storage -[Oracle Object Storage Overview](https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/objectstorageoverview.htm) - -[Oracle Object Storage FAQ](https://www.oracle.com/cloud/storage/object-storage/faq/) +- [Oracle Object Storage Overview](https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/objectstorageoverview.htm) +- [Oracle Object Storage FAQ](https://www.oracle.com/cloud/storage/object-storage/faq/) +- [Oracle Object Storage Limits](https://docs.oracle.com/en-us/iaas/Content/Resources/Assets/whitepapers/oci-object-storage-best-practices.pdf) Paths are specified as `remote:bucket` (or `remote:` for the `lsd` command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +Sample command to transfer local artifacts to remote:bucket in oracle object storage: + +`rclone -vvv --progress --stats-one-line --max-stats-groups 10 --log-format date,time,UTC,longfile --fast-list --buffer-size 256Mi --oos-no-check-bucket --oos-upload-cutoff 10Mi --multi-thread-cutoff 16Mi --multi-thread-streams 3000 --transfers 3000 --checkers 64 --retries 2 --oos-chunk-size 10Mi --oos-upload-concurrency 10000 --oos-attempt-resume-upload --oos-leave-parts-on-error sync ./artifacts remote:bucket -vv` + ## Configuration Here is an example of making an oracle object storage configuration. `rclone config` walks you @@ -135,7 +140,7 @@ List the contents of a bucket rclone ls remote:bucket rclone ls remote:bucket --max-depth 1 -### OCI Authentication Provider +## Authentication Providers OCI has various authentication methods. To learn more about authentication methods please refer [oci authentication methods](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm) @@ -148,7 +153,8 @@ Rclone supports the following OCI authentication provider. Resource Principal No authentication -#### Authentication provider choice: User Principal +### User Principal + Sample rclone config file for Authentication Provider User Principal: [oos] @@ -168,7 +174,8 @@ Considerations: - Overhead of managing users and keys. - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials. -#### Authentication provider choice: Instance Principal +### Instance Principal + An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. With this approach no credentials have to be stored and managed. @@ -197,7 +204,8 @@ Considerations: - Everyone who has access to this machine can execute the CLI commands. - It is applicable for oci compute instances only. It cannot be used on external instance or resources. -#### Authentication provider choice: Resource Principal +### Resource Principal + Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). To use resource principal ensure Rclone process is started with these environment variables set in its process. @@ -216,7 +224,8 @@ Sample rclone configuration file for Authentication Provider Resource Principal: region = us-ashburn-1 provider = resource_principal_auth -#### Authentication provider choice: No authentication +### No authentication + Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication: @@ -227,10 +236,9 @@ Sample rclone configuration file for No authentication: region = us-ashburn-1 provider = no_auth -## Options -### Modified time +### Modification times and hashes -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as `opc-meta-mtime` as floating point since the epoch, accurate to 1 ns. If the modification time needs to be updated rclone will attempt to perform a server @@ -240,6 +248,8 @@ In the case the object is larger than 5Gb, the object will be uploaded rather th Note that reading this from the object takes an additional `HEAD` request as the metadata isn't returned in object listings. +The MD5 hash algorithm is supported. + ### Multipart uploads rclone supports multipart uploads with OOS which means that it can @@ -419,9 +429,8 @@ Properties: Chunk size to use for uploading. When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads -using this chunk size. +size (e.g. from "rclone rcat" or uploaded with "rclone mount" they will be uploaded +as multipart uploads using this chunk size. Note that "upload_concurrency" chunks of this size are buffered in memory per transfer. @@ -449,6 +458,26 @@ Properties: - Type: SizeSuffix - Default: 5Mi +#### --oos-max-upload-parts + +Maximum number of parts in a multipart upload. + +This option defines the maximum number of multipart chunks to use +when doing a multipart upload. + +OCI has max parts limit of 10,000 chunks. + +Rclone will automatically increase the chunk size when uploading a +large file of a known size to stay below this number of chunks limit. + + +Properties: + +- Config: max_upload_parts +- Env Var: RCLONE_OOS_MAX_UPLOAD_PARTS +- Type: int +- Default: 10000 + #### --oos-upload-concurrency Concurrency for multipart uploads. @@ -523,12 +552,12 @@ Properties: - Config: encoding - Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error -If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. +If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery. It should be set to true for resuming uploads across different sessions. @@ -543,6 +572,24 @@ Properties: - Type: bool - Default: false +#### --oos-attempt-resume-upload + +If true attempt to resume previously started multipart upload for the object. +This will be helpful to speed up multipart transfers by resuming uploads from past session. + +WARNING: If chunk size differs in resumed session from past incomplete session, then the resumed multipart upload is +aborted and a new multipart upload is started with the new chunk size. + +The flag leave_parts_on_error must be true to resume and optimize to skip parts that were already uploaded successfully. + + +Properties: + +- Config: attempt_resume_upload +- Env Var: RCLONE_OOS_ATTEMPT_RESUME_UPLOAD +- Type: bool +- Default: false + #### --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it. @@ -611,7 +658,7 @@ Properties: #### --oos-sse-kms-key-id -if using using your own master key in vault, this header specifies the +if using your own master key in vault, this header specifies the OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key. Please note only one of sse_customer_key_file|sse_customer_key|sse_kms_key_id is needed. @@ -725,3 +772,6 @@ Options: - "max-age": Max age of upload to delete {{< rem autogenerated options stop >}} + +## Tutorials +### [Mounting Buckets](/oracleobjectstorage/tutorial_mount/) diff --git a/docs/content/oracleobjectstorage/_index.md b/docs/content/oracleobjectstorage/_index.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/docs/content/oracleobjectstorage/tutorial_mount.md b/docs/content/oracleobjectstorage/tutorial_mount.md new file mode 100644 index 0000000000000..85364d0aa9da2 --- /dev/null +++ b/docs/content/oracleobjectstorage/tutorial_mount.md @@ -0,0 +1,471 @@ +--- +title: "Oracle Object Storage Mount" +description: "Oracle Object Storage mounting tutorial" +slug: tutorial_mount +url: /oracleobjectstorage/tutorial_mount/ +--- +# {{< icon "fa fa-cloud" >}} Mount Buckets and Expose via NFS Tutorial +This runbook shows how to [mount](/commands/rclone_mount/) *Oracle Object Storage* buckets as local file system in +OCI compute Instance using rclone tool. + +You will also learn how to export the rclone mounts as NFS mount, so that other NFS client can access them. + +Usage Pattern : + +NFS Client --> NFS Server --> RClone Mount --> OCI Object Storage + +## Step 1 : Install Rclone + +In oracle linux 8, Rclone can be installed from +[OL8_Developer](https://yum.oracle.com/repo/OracleLinux/OL8/developer/x86_64/index.html) Yum Repo, Please enable the +repo if not enabled already. + +```shell +[opc@base-inst-boot ~]$ sudo yum-config-manager --enable ol8_developer +[opc@base-inst-boot ~]$ sudo yum install -y rclone +[opc@base-inst-boot ~]$ sudo yum install -y fuse +# rclone will prefer fuse3 if available +[opc@base-inst-boot ~]$ sudo yum install -y fuse3 +[opc@base-inst-boot ~]$ yum info rclone +Last metadata expiration check: 0:01:58 ago on Fri 07 Apr 2023 05:53:43 PM GMT. +Installed Packages +Name : rclone +Version : 1.62.2 +Release : 1.0.1.el8 +Architecture : x86_64 +Size : 67 M +Source : rclone-1.62.2-1.0.1.el8.src.rpm +Repository : @System +From repo : ol8_developer +Summary : rsync for cloud storage +URL : http://rclone.org/ +License : MIT +Description : Rclone is a command line program to sync files and directories to and from various cloud services. +``` + +To run it as a mount helper you should symlink rclone binary to /sbin/mount.rclone and optionally /usr/bin/rclonefs, +e.g. ln -s /usr/bin/rclone /sbin/mount.rclone. rclone will detect it and translate command-line arguments appropriately. + +```shell +ln -s /usr/bin/rclone /sbin/mount.rclone +``` + +## Step 2: Setup Rclone Configuration file + +Let's assume you want to access 3 buckets from the oci compute instance using instance principal provider as means of +authenticating with object storage service. + +- namespace-a, bucket-a, +- namespace-b, bucket-b, +- namespace-c, bucket-c + +Rclone configuration file needs to have 3 remote sections, one section of each of above 3 buckets. Create a +configuration file in a accessible location that rclone program can read. + +```shell + +[opc@base-inst-boot ~]$ mkdir -p /etc/rclone +[opc@base-inst-boot ~]$ sudo touch /etc/rclone/rclone.conf + + +# add below contents to /etc/rclone/rclone.conf +[opc@base-inst-boot ~]$ cat /etc/rclone/rclone.conf + + +[ossa] +type = oracleobjectstorage +provider = instance_principal_auth +namespace = namespace-a +compartment = ocid1.compartment.oc1..aaaaaaaa...compartment-a +region = us-ashburn-1 + +[ossb] +type = oracleobjectstorage +provider = instance_principal_auth +namespace = namespace-b +compartment = ocid1.compartment.oc1..aaaaaaaa...compartment-b +region = us-ashburn-1 + + +[ossc] +type = oracleobjectstorage +provider = instance_principal_auth +namespace = namespace-c +compartment = ocid1.compartment.oc1..aaaaaaaa...compartment-c +region = us-ashburn-1 + +# List remotes +[opc@base-inst-boot ~]$ rclone --config /etc/rclone/rclone.conf listremotes +ossa: +ossb: +ossc: + +# Now please ensure you do not see below errors while listing the bucket, +# i.e you should fix the settings to see if namespace, compartment, bucket name are all correct. +# and you must have a dynamic group policy to allow the instance to use object-family in compartment. + +[opc@base-inst-boot ~]$ rclone --config /etc/rclone/rclone.conf ls ossa: +2023/04/07 19:09:21 Failed to ls: Error returned by ObjectStorage Service. Http Status Code: 404. Error Code: NamespaceNotFound. Opc request id: iad-1:kVVAb0knsVXDvu9aHUGHRs3gSNBOFO2_334B6co82LrPMWo2lM5PuBKNxJOTmZsS. Message: You do not have authorization to perform this request, or the requested resource could not be found. +Operation Name: ListBuckets +Timestamp: 2023-04-07 19:09:21 +0000 GMT +Client Version: Oracle-GoSDK/65.32.0 +Request Endpoint: GET https://objectstorage.us-ashburn-1.oraclecloud.com/n/namespace-a/b?compartmentId=ocid1.compartment.oc1..aaaaaaaa...compartment-a +Troubleshooting Tips: See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_404__404_namespacenotfound for more information about resolving this error. +Also see https://docs.oracle.com/iaas/api/#/en/objectstorage/20160918/Bucket/ListBuckets for details on this operation's requirements. +To get more info on the failing request, you can set OCI_GO_SDK_DEBUG env var to info or higher level to log the request/response details. +If you are unable to resolve this ObjectStorage issue, please contact Oracle support and provide them this full error message. +[opc@base-inst-boot ~]$ + +``` + +## Step 3: Setup Dynamic Group and Add IAM Policy. +Just like a human user has an identity identified by its USER-PRINCIPAL, every OCI compute instance is also a robotic +user identified by its INSTANCE-PRINCIPAL. The instance principal key is automatically fetched by rclone/with-oci-sdk +from instance-metadata to make calls to object storage. + +Similar to [user-group](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managinggroups.htm), +[instance groups](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm) +is known as dynamic-group in IAM. + +Create a dynamic group say rclone-dynamic-group that the oci compute instance becomes a member of the below group +says all instances belonging to compartment a...c is member of this dynamic-group. + +```shell +any {instance.compartment.id = '', + instance.compartment.id = '', + instance.compartment.id = '' + } +``` + +Now that you have a dynamic group, you need to add a policy allowing what permissions this dynamic-group has. +In our case, we want this dynamic-group to access object-storage. So create a policy now. + +```shell +allow dynamic-group rclone-dynamic-group to manage object-family in compartment compartment-a +allow dynamic-group rclone-dynamic-group to manage object-family in compartment compartment-b +allow dynamic-group rclone-dynamic-group to manage object-family in compartment compartment-c +``` + +After you add the policy, now ensure the rclone can list files in your bucket, if not please troubleshoot any mistakes +you did so far. Please note, identity can take upto a minute to ensure policy gets reflected. + +## Step 4: Setup Mount Folders +Let's assume you have to mount 3 buckets, bucket-a, bucket-b, bucket-c at path /opt/mnt/bucket-a, /opt/mnt/bucket-b, +/opt/mnt/bucket-c respectively. + +Create the mount folder and set its ownership to desired user, group. +```shell +[opc@base-inst-boot ~]$ sudo mkdir /opt/mnt +[opc@base-inst-boot ~]$ sudo chown -R opc:adm /opt/mnt +``` + +Set chmod permissions to user, group, others as desired for each mount path +```shell +[opc@base-inst-boot ~]$ sudo chmod 764 /opt/mnt +[opc@base-inst-boot ~]$ ls -al /opt/mnt/ +total 0 +drwxrw-r--. 2 opc adm 6 Apr 7 18:01 . +drwxr-xr-x. 10 root root 179 Apr 7 18:01 .. + +[opc@base-inst-boot ~]$ mkdir -p /opt/mnt/bucket-a +[opc@base-inst-boot ~]$ mkdir -p /opt/mnt/bucket-b +[opc@base-inst-boot ~]$ mkdir -p /opt/mnt/bucket-c + +[opc@base-inst-boot ~]$ ls -al /opt/mnt +total 0 +drwxrw-r--. 5 opc adm 54 Apr 7 18:17 . +drwxr-xr-x. 10 root root 179 Apr 7 18:01 .. +drwxrwxr-x. 2 opc opc 6 Apr 7 18:17 bucket-a +drwxrwxr-x. 2 opc opc 6 Apr 7 18:17 bucket-b +drwxrwxr-x. 2 opc opc 6 Apr 7 18:17 bucket-c +``` + +## Step 5: Identify Rclone mount CLI configuration settings to use. +Please read through this [rclone mount](https://rclone.org/commands/rclone_mount/) page completely to really +understand the mount and its flags, what is rclone +[virtual file system](https://rclone.org/commands/rclone_mount/#vfs-virtual-file-system) mode settings and +how to effectively use them for desired Read/Write consistencies. + +Local File systems expect things to be 100% reliable, whereas cloud storage systems are a long way from 100% reliable. +Object storage can throw several errors like 429, 503, 404 etc. The rclone sync/copy commands cope with this with +lots of retries. However rclone mount can't use retries in the same way without making local copies of the uploads. +Please Look at the VFS File Caching for solutions to make mount more reliable. + +First lets understand the rclone mount flags and some global flags for troubleshooting. + +```shell + +rclone mount \ + ossa:bucket-a \ # Remote:bucket-name + /opt/mnt/bucket-a \ # Local mount folder + --config /etc/rclone/rclone.conf \ # Path to rclone config file + --allow-non-empty \ # Allow mounting over a non-empty directory + --dir-perms 0770 \ # Directory permissions (default 0777) + --file-perms 0660 \ # File permissions (default 0666) + --allow-other \ # Allow access to other users + --umask 0117 \ # sets (660) rw-rw---- as permissions for the mount using the umask + --transfers 8 \ # default 4, can be set to adjust the number of parallel uploads of modified files to remote from the cache + --tpslimit 50 \ # Limit HTTP transactions per second to this. A transaction is roughly defined as an API call; + # its exact meaning will depend on the backend. For HTTP based backends it is an HTTP PUT/GET/POST/etc and its response + --cache-dir /tmp/rclone/cache # Directory rclone will use for caching. + --dir-cache-time 5m \ # Time to cache directory entries for (default 5m0s) + --vfs-cache-mode writes \ # Cache mode off|minimal|writes|full (default off), writes gives the maximum compatibility like a local disk + --vfs-cache-max-age 20m \ # Max age of objects in the cache (default 1h0m0s) + --vfs-cache-max-size 10G \ # Max total size of objects in the cache (default off) + --vfs-cache-poll-interval 1m \ # Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back 5s \ # Time to writeback files after last use when using cache (default 5s). + # Note that files are written back to the remote only when they are closed and + # if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or + # dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags. + --vfs-fast-fingerprint # Use fast (less accurate) fingerprints for change detection. + --log-level ERROR \ # log level, can be DEBUG, INFO, ERROR + --log-file /var/log/rclone/oosa-bucket-a.log # rclone application log + +``` + +### --vfs-cache-mode writes + +In this mode files opened for read only are still read directly from the remote, write only and read/write files are +buffered to disk first. This mode should support all normal file system operations. If an upload fails it will be +retried at exponentially increasing intervals up to 1 minute. + +VFS cache mode of writes is recommended, so that application can have maximum compatibility of using remote storage +as a local disk, when write is finished, file is closed, it is uploaded to backend remote after vfs-write-back duration +has elapsed. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone +is run with the same flags. + +### --tpslimit float + +Limit transactions per second to this number. Default is 0 which is used to mean unlimited transactions per second. + +A transaction is roughly defined as an API call; its exact meaning will depend on the backend. For HTTP based backends +it is an HTTP PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip transaction over TCP. + +For example, to limit rclone to 10 transactions per second use --tpslimit 10, or to 1 transaction every 2 seconds +use --tpslimit 0.5. + +Use this when the number of transactions per second from rclone is causing a problem with the cloud storage +provider (e.g. getting you banned or rate limited or throttled). + +This can be very useful for rclone mount to control the behaviour of applications using it. Let's guess and say Object +storage allows roughly 100 tps per tenant, so to be on safe side, it will be wise to set this at 50. (tune it to actuals per +region) + +### --vfs-fast-fingerprint + +If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This +makes the fingerprinting less accurate but much faster and will improve the opening time of cached files. If you are +running a vfs cache over local, s3, object storage or swift backends then using this flag is recommended. + +Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. +Fingerprints are made from: +- size +- modification time +- hash + where available on an object. + + +## Step 6: Mounting Options, Use Any one option + +### Step 6a: Run as a Service Daemon: Configure FSTAB entry for Rclone mount +Add this entry in /etc/fstab : +```shell +ossa:bucket-a /opt/mnt/bucket-a rclone rw,umask=0117,nofail,_netdev,args2env,config=/etc/rclone/rclone.conf,uid=1000,gid=4, +file_perms=0760,dir_perms=0760,allow_other,vfs_cache_mode=writes,cache_dir=/tmp/rclone/cache 0 0 +``` +IMPORTANT: Please note in fstab entry arguments are specified as underscore instead of dash, +example: vfs_cache_mode=writes instead of vfs-cache-mode=writes +Rclone in the mount helper mode will split -o argument(s) by comma, replace _ by - and prepend -- to +get the command-line flags. Options containing commas or spaces can be wrapped in single or double quotes. +Any inner quotes inside outer quotes of the same type should be doubled. + + +then run sudo mount -av +```shell + +[opc@base-inst-boot ~]$ sudo mount -av +/ : ignored +/boot : already mounted +/boot/efi : already mounted +/var/oled : already mounted +/dev/shm : already mounted +none : ignored +/opt/mnt/bucket-a : already mounted # This is the bucket mounted information, running mount -av again and again is idempotent. + +``` + +## Step 6b: Run as a Service Daemon: Configure systemd entry for Rclone mount + +If you are familiar with configuring systemd unit files, you can also configure the each rclone mount into a +systemd units file. +various examples in git search: https://github.com/search?l=Shell&q=rclone+unit&type=Code +```shell +tee "/etc/systemd/system/rclonebucketa.service" > /dev/null <&1 | grep -i 'Transport endpoint is not connected' | awk '{print ""$2"" }' | tr -d \:) +rclone_list=$(findmnt -t fuse.rclone -n 2>&1 | awk '{print ""$1"" }' | tr -d \:) +IFS=$'\n'; set -f +intersection=$(comm -12 <(printf '%s\n' "$erroneous_list" | sort) <(printf '%s\n' "$rclone_list" | sort)) +for directory in $intersection +do + echo "$directory is being fixed." + sudo fusermount -uz "$directory" +done +sudo mount -av + +``` +Script to idempotently add a Cron job to babysit the mount paths every 5 minutes +```shell +echo "Creating rclone nanny cron job." +croncmd="/etc/rclone/scripts/rclone_nanny_script.sh" +cronjob="*/5 * * * * $croncmd" +# idempotency - adds rclone_nanny cronjob only if absent. +( crontab -l | grep -v -F "$croncmd" || : ; echo "$cronjob" ) | crontab - +echo "Finished creating rclone nanny cron job." +``` + +Ensure the crontab is added, so that above nanny script runs every 5 minutes. +```shell +[opc@base-inst-boot ~]$ sudo crontab -l +*/5 * * * * /etc/rclone/scripts/rclone_nanny_script.sh +[opc@base-inst-boot ~]$ +``` + +## Step 8: Optional: Setup NFS server to access the mount points of rclone + +Let's say you want to make the rclone mount path /opt/mnt/bucket-a available as a NFS server export so that other +clients can access it by using a NFS client. + +### Step 8a : Setup NFS server + +Install NFS Utils +```shell +sudo yum install -y nfs-utils +``` + +Export the desired directory via NFS Server in the same machine where rclone has mounted to, ensure NFS service has +desired permissions to read the directory. If it runs as root, then it will have permissions for sure, but if it runs +as separate user then ensure that user has necessary desired privileges. +```shell +# this gives opc user and adm (administrators group) ownership to the path, so any user belonging to adm group will be able to access the files. +[opc@tools ~]$ sudo chown -R opc:adm /opt/mnt/bucket-a/ +[opc@tools ~]$ sudo chmod 764 /opt/mnt/bucket-a/ + +# Not export the mount path of rclone for exposing via nfs server +# There are various nfs export options that you should keep per desired usage. +# Syntax is +# (